[Gate-users] Gate equivalent of a "pass" command

Emilie Gaudin Emilie.Odette.Gaudin at USherbrooke.ca
Wed Mar 4 18:19:18 CET 2020


Hi Chris,

Since GATE 8.1 lots of condition can be performed within .mac files.

As you said there are enable/disable commands:
/control/if {alias1} == 1                 test.mac
/control/doif {alias2}  == 1           /geometry/test/run

There is also a command where you can look for a string (can be a string, a int or a float):
/control/strif {alias3} == string1    some.mac
/control/strif {alias3} != string2   other.mac

Maybe this tool can be helpful for your problem. You can workaround your mac code to work fine with this tool or read the GATE  help for more command tool !

Cheers,

Émilie

________________________________
De : Gate-users <gate-users-bounces at lists.opengatecollaboration.org> de la part de Christopher Watanabe <chris.r.watanabe at gmail.com>
Envoyé : 4 mars 2020 12:01
À : gate-users at lists.opengatecollaboration.org <gate-users at lists.opengatecollaboration.org>
Objet : [Gate-users] Gate equivalent of a "pass" command


Hello all,

I’m assigning some commands to a Gate macro via bash scripts. In this way, within my bash script, I can declare a variable called “visCommand” that will control whether visualization is called by the Gate macro or not:

within bash script ----------------------------

if $vis ; then

                visCommand=’/control/execute mac/vis.mac’

else

                visCommand=’/vis/disable’

fi
---------------------------------------------------------



Then just calling {visCommand} in my Gate macro calls the appropriate command. This works fine for Gate commands that have enabling or disabling, but I would like to accomplish a similar task. Namely calling for a certain number of primaries per run if a non-zero argument is given for number of primaries. However, this is not a matter of disabling anything, so I’m wondering whether Gate has the equivalent of a “pass” command.

Within bash script once more ----------------------------------



If [ $primaries > 0]; then

                activityCommand=’/gate/application/setNumberOfPrimariesPerRun {primariesPerRun}’

else

                activityCommand=SOME GATE COMMAND THAT TELLS GATE TO DO NOTHING

fi



If you don’t understand the bash scripting, that’s okay. In this context, I just need a Gate command that tells Gate to disregard this line in the macro. I’ve tried to just insert a comment, but GATE throws an error because it can’t find the command. I’m not sure whether this would be a bash nuance though – perhaps something such as activityCommand=’#/this_is_a_gate_comment’ is somehow illegal.



In any case, I appreciate any help! And if you’re curious about calling Gate from bash scripts, let me know in an email!

Best,

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20200304/4c6712fd/attachment-0001.html>


More information about the Gate-users mailing list