[esp-r] Re: more version ESP-r
Achim Geissler
achim.geissler at intergga.ch
Sat Jul 16 16:39:47 BST 2011
Hi Filippo
what do you plan to do? As written by Gian Luca, you have "two versions" of ESP-r, already. You can start every ESP-r component in text mode by invoking with
$> prj -mode text
In general, this is definitely possible from Python, also. However, then it may become tricky, because you need to send the started process many instructions to be able to do anything interesting.
It is quite easy, though, to write scripts that do special tasks and call these scripts from other scripts. E.g. set a new control file by the following ("set_ctl.sh"):
#!/bin/sh
#
# Script changes control file in .cfg. <set_ctl> expects two
# arguments:
# 1. configuration file name (with relative path)
# 2. control file name (with relative path)
#
CONFIG=$1
CONTRL=$2
echo "$CONFIG, control: $CTL "
prj -file $CONFIG -mode text >> /dev/null <<XXX
m # browse/edit/simulate
n # global control
$CONTRL
- # exit
y # save changes
y # overwrite
Run: Whatever
-
-
XXX
unset CONFIG
unset CONTRL
Creating the instruction sequence is best done by doing whatever you wish in text mode and noting all the steps you need to take. Then simply write a shell script like the example above. In a calling script you can use such a "tool" like this ("run-everything.sh", the snippet uses some more tools of the general type described above):
for CTL in $CTLLIST
do
. ./set_ctl.sh $VAR.cfg $CTL
. ./simulate.sh $VAR.cfg ../../${VAR}_${theOPR}_${CTL}.res $FD $FM $TD $TM $PP
. ./res_supplied-energy.sh ../../${VAR}_${theOPR}_${CTL}.res ${VAR}_${theOPR}_${CTL}_supplied.dat
done # current CTL / complete list
Hope this helps.
Best
Achim
On Jul 15, 2011, at 4:22 PM, Filippo Monari wrote:
> Hi,
> I'd like to have a GUI version and a console version of ESP-r on my Ubuntu box because I want to try making some scripts.
> Can you tell me hoe can I reach this goal?
> Furthermore have anyone of you tried to use ESP-r with Python? There is out there some guide or example?
> Kind regards,
> Filippo
>
> _______________________________________________
> esp-r mailing list
> esp-r at lists.strath.ac.uk
> http://lists.strath.ac.uk/mailman/listinfo/esp-r
achim.geissler at intergga.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.strath.ac.uk/archives/esp-r/attachments/20110716/a97459fe/attachment.html
More information about the esp-r
mailing list