https://projects.ecoinformatics.org/ecoinfo/https://projects.ecoinformatics.org/ecoinfo/ecoinfo/favicon.ico?14691340362009-08-12T22:50:00ZEcoinformatics RedmineKepler - Bug #4306: add command line params to the configurationhttps://projects.ecoinformatics.org/ecoinfo/issues/4306?journal_id=146262009-08-12T22:50:00ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>I'm off work this week, but I would support adding the command line<br />arguments to the Configuration. I would consider doing this work<br />myself after Tue., August 18.</p> Kepler - Bug #4306: add command line params to the configurationhttps://projects.ecoinformatics.org/ecoinfo/issues/4306?journal_id=146272009-08-12T23:22:39ZDavid Welkerwelker4kepler@gmail.com
<ul></ul><p>Fixed with an alternative solution.</p>
<p>Now, all the command-line args can be iterated through anywhere from Kepler with the following:</p>
<p>for( String arg : CommandLineArgs.get() )<br /> ....</p> Kepler - Bug #4306: add command line params to the configurationhttps://projects.ecoinformatics.org/ecoinfo/issues/4306?journal_id=146282009-08-17T15:37:12ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Adding another class is not as clean a solution as having this information<br />in the Configuration. The reason is that adding another class adds<br />complexity. We have a Configuration for this purpose, we should use it.</p>
<p>I'll take this bug and mark it for after 2.0.0.</p> Kepler - Bug #4306: add command line params to the configurationhttps://projects.ecoinformatics.org/ecoinfo/issues/4306?journal_id=146292009-08-17T15:42:34ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Here's some email about this. Note that adding a separate CommandLineArgs<br />solution might not work with PN:</p>
<p>Colin writes:</p>
<blockquote>
<p>Just as a last note, the stack trace solution will not work under the PN >director as the actor's thread starts at the "ProcessThread" class.</p>
<p>:-)<br />Colin</p>
</blockquote>
<p>David Welker wrote:</p>
<blockquote>
<p>Hi Michal,</p>
<p>I have added a fix to this. Now, if you want to know what command-line args were passed, you can cycle through them. For example, here is code that would allow you to see if -nogui was specified.</p>
<p>import org.kepler.CommandLineArgs;</p>
<p>....</p>
<p>public void fire() throws IllegalActionException
{<br />....<br />boolean noguiSpecified = false;</p>
<p>for( String arg : CommandLineArgs.get() )<br />if( arg.equals("-nogui") )
{<br />noguiSpecified = true;<br />break;<br />} <br />....</p>
<p>}</p>
<p>Hope that helps. It certainly is a little cleaner that looking at stack traces.</p>
<p>David</p>
<p>On Aug 12, 2009, at 12:10 PM, Michal Owsiak wrote:</p>
<blockquote>
<p>Thanks for the info.</p>
<p>The hack-way is not a pretty solution, but it will do a thing - I will<br />check that and tell you whether it works fine.</p>
<p>What I am trying to accomplish is creating an actor that is able to show<br />dialog window - when GUI mode is enabled, and skip showing it, when<br />-nogui is passed. This way I can easily (without changing actor's<br />parameters within workflow) use the same scenario for both cases.<br />Otherwise I have to enable/disable some parameter.</p>
<p>But as I have mentioned, I will check the "stack thing" - it should work.</p>
<p>Anyway, if it is possible to add this feature it would be fine.</p>
<p>Another useful feature (in case of -nogui mode) would be providing<br />Kepler developers with an access to command line arguments. This way it<br />would be possible to parametrize workflow from outside through the<br />application's parameters - this would useful whenever Kepler is started<br />as a part of a process.</p>
<p>Regards</p>
<p>michal</p>
<blockquote>
<p>There is no really good way to do this at present.</p>
<p>If -nogui passed in as an argument, then that affects what is called<br />(either org.kepler.KeplerConfigurationApplication or<br />ptolemy.moml.MoMLCommandLineApplication) but unfortunately the fact that<br />-nogui was passed in is not otherwise stored.</p>
<p>A hackish way to detect whether new -nogui was passed in that should<br />work (I haven't tried it) would be to examine the current stack trace<br />and see if either of the following is present.</p>
<p>org.kepler.KeplerConfigurationApplication.main(String[] args)</p>
<p>OR</p>
<p>ptolemy.moml.MoMLCommandLineApplication(String[] args)</p>
<p>One of these classes is called if and only if -nogui was passed in as a<br />command-line argument.</p>
<p>What are you trying to accomplish? Should we make it more convenient to<br />determine whether -nogui has been passed in on the command line?</p>
<p>-David</p>
<p>On Aug 12, 2009, at 2:38 AM, Michal Owsiak wrote:</p>
<blockquote>
<p>Hello all,</p>
<p>I want to check within the actor's fire() method whether Kepler was<br />started with "-nogui" argument. Is it possible to determine whether this<br />switch was used during Kepler execution? How this information can be<br />retrieved?</p>
<p>Regards</p>
<p>Michal</p>
<p>-- <br />Michal Owsiak <<a class="email" href="mailto:michalo@man.poznan.pl">michalo@man.poznan.pl</a>><br />Poznan Supercomputing and Networking Center<br />ul. Noskowskiego 10, 61-704 Poznan, POLAND<br /><a class="external" href="http://www.man.poznan.pl">http://www.man.poznan.pl</a><br />_<em><i></em></i>__<em>_</em>___________________________________<br />Kepler-dev mailing list<br />Kepler-dev@kepler-project.org<br /><a class="external" href="http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev">http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev</a></p>
</blockquote>
</blockquote>
<p>-- <br />Michal Owsiak <<a class="email" href="mailto:michalo@man.poznan.pl">michalo@man.poznan.pl</a>><br />Poznan Supercomputing and Networking Center<br />ul. Noskowskiego 10, 61-704 Poznan, POLAND<br /><a class="external" href="http://www.man.poznan.pl">http://www.man.poznan.pl</a></p>
</blockquote>
<p>_<em><i></em></i>__<em>_</em>___________________________________<br />Kepler-dev mailing list<br />Kepler-dev@kepler-project.org<br /><a class="external" href="http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev">http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev</a></p>
</blockquote> Kepler - Bug #4306: add command line params to the configurationhttps://projects.ecoinformatics.org/ecoinfo/issues/4306?journal_id=146302013-03-27T21:26:23ZRedmine Admin
<ul></ul><p>Original Bugzilla ID was 4306</p>