Re: [foxboro] Help on converting DM displays to jpg or gif format

Hi there,

The following script files pref's the display on a DM screen, dumps it to
a temp file and converts it to a protable bitmap format. This bitmap format
can then be ftp'd to and Intel PC. Be aware of the file size ~2Mb. 
Then download from irfanview (www.irfanview.com) the viewer. It provides you
with a batch converter to a huge number of file formats. (for free!) 

#!/bin/sh
# Script to convert X-Windows dump to 
# portable bitmap format file


# define variables:

# temp folder
TEMPFOLDER=/opt/tmp/disp

# X windows dump utility
Xdump=/usr/openwin/bin/xwd

# X windows dump convert utility
Xconv=/usr/openwin/bin/xwdtopnm

# Foxboro pref utility
Pref_tool=/usr/local/pref

# Station Letterbug
#LBug=Enter letterbug !!!!!
LBug=PCAT00

# Display Manager (DM) Letterbug
#DMName=Enter DM name !!!!!!!
DMName=PCAT00

# Sleep time between DM actions
SleepTime=5

# Make temp dir
if [ ! -d /opt/tmp/disp ]
then
        mkdir $TEMPFOLDER
fi
cd $TEMPFOLDER

# listing of displays to be converted
disp='/usr/disp/disp1
/usr/disp/disp2
/usr/disp/disp3
/usr/disp/disp4'

for i in $disp
do
        # Echo Display name
        echo " Now  printing $i"

        # Display process graphic on DM $DMName
        $Pref_tool -$DMName dmcmd $i

        # Give DM some time to find connections
        sleep $SleepTime

        # Display process graphic name in message line
        $Pref_tool -$DMName dmcmd 'dmcmd msglin "[$ST0]"'
        sleep $SleepTime

        # extract display name
        dispname=`basename $i`

        # Dump display as X windows dump
        $Xdump -name "FOXBORO: Display Manager  $LBug:$DMName" -out
${TEMPFOLDER}/${dispname}.Xwd

        # Convert to portable bitmap format
        $Xconv ${TEMPFOLDER}/${dispname}.Xwd > ${TEMPFOLDER}/${dispname}.ppm

        # Delete X windows dump
        rm ${TEMPFOLDER}/${dispname}.Xwd
done

Have fun
Norbert

> -----Original Message-----
> From: Maneesh Agrawal [SMTP:Maneesh.Agrawal@xxxxxxxxxxxx]
> Sent: Monday, July 28, 2003 2:08 PM
> To:   foxboro@xxxxxxxxxxxxx
> Subject:      [foxboro] Help on converting DM displays to jpg or gif
> format
> 
> Hi list,
> I would like to port the DM displays from our systems to normal windows PC
> 
>  in either the 'gif 'or 'jpg' format.Using 'snapshot' will be too 
> cumbersome as there are plenty of displays.
> 
> Does anybody have any scripts or tools by which we can do this easily and 
> quickly?
> 
> Thanks & Regards,
> Maneesh Agrawal- Systems Engineer,
> Invensys Middle East - Kuwait Operations.
> Mobile:+965-9896718
> email: Maneesh.Agrawal@xxxxxxxxxxxx
> Fax:     +965-3718360
> 
>  
>  
> _______________________________________________________________________
> This mailing list is neither sponsored nor endorsed by Invensys Process
> Systems (formerly The Foxboro Company). Use the info you obtain here at
> your own risks. Read http://www.thecassandraproject.org/disclaimer.html
>  
> foxboro mailing list:             http://www.freelists.org/list/foxboro
> to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
> to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
>  
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/03
>  
> 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/03
 
 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: