#!/bin/sh -x # $Id: updateDOPCenterImage 67290 2013-08-29 19:12:29Z hudson $ # A script that updates the DOPCenter.png file # This script will only work on a machine that # has a graphica display. # Linux machines without physical graphical displays # can use Xvfb # 1. Install Xvfb on your machine # yum install Xvfb # 2. Start up the display # Xvfb :1 -screen 0 1024x768x24 & # export DISPLAY=localhost:1.0 # 3. Run this script # $PTII/ptolemy/domains/space/demo/DOPCenter/updateDOPCenterImage # Local admins, see also: # http://embedded.eecs.berkeley.edu/dopsysadmin/faq/125.html # This model requires that ~/.spacecadet contains the password. # Use a png because there is already a .gif that is the background. # Note that png does not reliably display under Windows XP or Windows Server 2003. cp DOPCenter.png DOPCenter.png.orig # FIXME: we should not need to run ExportImage twice $PTII/bin/ptinvoke -Dptolemy.ptII.doNotExit= ptolemy.vergil.basic.export.ExportModel png -run -save $PTII/ptolemy/domains/space/demo/DOPCenter/DOPCenter.xml $PTII/bin/ptinvoke -Dptolemy.ptII.doNotExit= ptolemy.vergil.basic.export.ExportModel png -run -save $PTII/ptolemy/domains/space/demo/DOPCenter/DOPCenter.xml diff DOPCenter.png.orig DOPCenter.png status=$? if [ $status -ne 0 ]; then #echo "Added a 'Last Update Line'" #mogrify -font Courier -draw "text 10,20 \"Last updated: `date`\"" DOPCenter.png echo "Committing changed files" svn commit -m "Automatic update" DOPCenter.png DOPCenter.xml fi rm DOPCenter.png.orig # Create Placard.pdf for # http://chess.eecs.berkeley.edu/ptexternal/src/ptII/ptolemy/domains/space/demo/DOPCenter/Placard.pdf # Create Placard.tex. $PTII/bin/ptinvoke ptolemy.actor.gui.MoMLSimpleApplication Placard.xml # Create Placard.pdf, which changes each time, so it is not checked in. pdflatex Placard.tex # Clean up junk created by pdflatex and Ptolemy II. rm Placard.aux Placard.log Placard.tex