Hi there,
In a given problem type (ptype),
I would like to know how to launch different batch scripts from GID,
(for example: ptype_0.unix.bat, ptype_1.unix.bat, or ptype_2.unix.bat)
depending on the value of a control variable defined in the problem_data.
Is that possible?
Many thanks,
Andres
[GiDlist] multiple batch scripts
Moderator: GiD Team
[GiDlist] multiple batch scripts
A possible dark trick:
Can use a secondary bas file (ptype-1.bas) to write "on fly" a secondary bat file, depending on some problem_data parameter.
The main ptype.unix.bat must rename the dat file (result of the secondary template), to set .unix.bat extension, and run it
(on Unix platform must also use chmod in order to be run)
for example the ptype.unix.bat content is similar to:
rename %1-1.dat secondary.unix.bat
chmod +x secondary.unix.bat
secondary.bat %1 %2 %3
Enrique Escolano
----- Original Message -----
From: "Andres Peratta" andres at wessex.ac.uk
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 6:29 PM
Subject: [GiDlist] multiple batch scripts
Hi there,
In a given problem type (ptype),
I would like to know how to launch different batch scripts from GID,
(for example: ptype_0.unix.bat, ptype_1.unix.bat, or ptype_2.unix.bat)
depending on the value of a control variable defined in the problem_data.
Is that possible?
Many thanks,
Andres
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20041027/0ffbf622/attachment.htm
Can use a secondary bas file (ptype-1.bas) to write "on fly" a secondary bat file, depending on some problem_data parameter.
The main ptype.unix.bat must rename the dat file (result of the secondary template), to set .unix.bat extension, and run it
(on Unix platform must also use chmod in order to be run)
for example the ptype.unix.bat content is similar to:
rename %1-1.dat secondary.unix.bat
chmod +x secondary.unix.bat
secondary.bat %1 %2 %3
Enrique Escolano
----- Original Message -----
From: "Andres Peratta" andres at wessex.ac.uk
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 6:29 PM
Subject: [GiDlist] multiple batch scripts
Hi there,
In a given problem type (ptype),
I would like to know how to launch different batch scripts from GID,
(for example: ptype_0.unix.bat, ptype_1.unix.bat, or ptype_2.unix.bat)
depending on the value of a control variable defined in the problem_data.
Is that possible?
Many thanks,
Andres
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20041027/0ffbf622/attachment.htm
[GiDlist] multiple batch scripts
Another more elegant method:
Can define in your problemtype.tcl file a procedure, named SelectGIDBatFile
SelectGIDBatFile is called automagically by GiD and must return the .bat file name or nothing
For example, if you have a general data field named Solver#CB(solver_1,solver_2), can use:
proc SelectGIDBatFile { directory basename } {
set batfile ""
if { [GidUtils::GetProblemDataValue "Solver#CB(solver_1,solver_2)"] == "solver_1" } {
set batfile ptype_1.unix.bat
} else {
set batfile ptype_2.unix.bat
}
return $batfile
}
Enrique Escolano
----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 10:33 PM
Subject: Re: [GiDlist] multiple batch scripts
A possible dark trick:
Can use a secondary bas file (ptype-1.bas) to write "on fly" a secondary bat file, depending on some problem_data parameter.
The main ptype.unix.bat must rename the dat file (result of the secondary template), to set .unix.bat extension, and run it
(on Unix platform must also use chmod in order to be run)
for example the ptype.unix.bat content is similar to:
rename %1-1.dat secondary.unix.bat
chmod +x secondary.unix.bat
secondary.bat %1 %2 %3
Enrique Escolano
----- Original Message -----
From: "Andres Peratta" andres at wessex.ac.uk
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 6:29 PM
Subject: [GiDlist] multiple batch scripts
Hi there,
In a given problem type (ptype),
I would like to know how to launch different batch scripts from GID,
(for example: ptype_0.unix.bat, ptype_1.unix.bat, or ptype_2.unix.bat)
depending on the value of a control variable defined in the problem_data.
Is that possible?
Many thanks,
Andres
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20041028/23a5313c/attachment.htm
Can define in your problemtype.tcl file a procedure, named SelectGIDBatFile
SelectGIDBatFile is called automagically by GiD and must return the .bat file name or nothing
For example, if you have a general data field named Solver#CB(solver_1,solver_2), can use:
proc SelectGIDBatFile { directory basename } {
set batfile ""
if { [GidUtils::GetProblemDataValue "Solver#CB(solver_1,solver_2)"] == "solver_1" } {
set batfile ptype_1.unix.bat
} else {
set batfile ptype_2.unix.bat
}
return $batfile
}
Enrique Escolano
----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 10:33 PM
Subject: Re: [GiDlist] multiple batch scripts
A possible dark trick:
Can use a secondary bas file (ptype-1.bas) to write "on fly" a secondary bat file, depending on some problem_data parameter.
The main ptype.unix.bat must rename the dat file (result of the secondary template), to set .unix.bat extension, and run it
(on Unix platform must also use chmod in order to be run)
for example the ptype.unix.bat content is similar to:
rename %1-1.dat secondary.unix.bat
chmod +x secondary.unix.bat
secondary.bat %1 %2 %3
Enrique Escolano
----- Original Message -----
From: "Andres Peratta" andres at wessex.ac.uk
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, October 27, 2004 6:29 PM
Subject: [GiDlist] multiple batch scripts
Hi there,
In a given problem type (ptype),
I would like to know how to launch different batch scripts from GID,
(for example: ptype_0.unix.bat, ptype_1.unix.bat, or ptype_2.unix.bat)
depending on the value of a control variable defined in the problem_data.
Is that possible?
Many thanks,
Andres
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20041028/23a5313c/attachment.htm