[kepler-users] Monitor Value and Display
Kenneth Evans
evans at aps.anl.gov
Tue Nov 13 08:34:25 PST 2007
Edward,
>> I think it would be wrong for the Display to not open if handed
>> empty strings to display, since empty strings are actually information.
The case I am trying to implement uses a SSH to Execute actor, which seems
to be part of Kepler, not Ptolemy. It has outputs for stdout, stderr,
error, and return code. I put the return code in a Monitor, but the other 3
can be longer than one line. I then get three dialogs that have to be
dismissed every time I run it. I see no need to display blank results for
stderr and error. I only need information if something went wrong. On the
other hand, blank results for stdout would be informative, since they would
probably be unexpected.
I guess I would like stderr and error to function like an error dialog.
Similarly, a Display could also be used like an info dialog. I don't see
this as wrong.
On the other hand, I certainly don't think not opening if handed empty
strings should be the default behavior of the Display if that is what you
thought I meant. (It could be an option, though.) In any event I can make
that happen myself if I want that behavior. I did this by making a class
with the Display and the desired logic, then using instances of the class
for stderr and error.
The issues I described below have to do with how the class works rather than
with the Display itself.
As far as sending an example, that would be easier to understand than words.
I can easily send the Kepler .xml file. I would have to find some way to
implement something similar in Vergil. I didn't see a Ptolemy actor with
things like stdout, stderr, and other things on a quick look.
I also note that problem 1. below may be a Kepler problem. I don't see why
checking for the output equal to "" should not work.
Thanks for your interest.
-Ken
-----Original Message-----
From: Edward A. Lee [mailto:eal at eecs.berkeley.edu]
Sent: Monday, November 12, 2007 8:09 PM
To: Kenneth Evans
Cc: Kepler Mailing List
Subject: Re: [kepler-users] Monitor Value and Display
I think it would be wrong for the Display to not open if handed
empty strings to display, since empty strings are actually information
(albeit not much :-)
If you send me a MoML file with your class definition, I'll take a
look at the problems you cite.
Edward
At 02:10 PM 11/12/2007, Kenneth Evans wrote:
>Edward,
>
>Thanks, I think it works much better with those changes.
>
>I wanted the Display to appear only if the contents are not blank. What
you
>did is a necessary condition for that to be possible. I can in fact do
this
>using an Expression involving input.length() and a BooleanSwitch. I had
>some problems, though.
>
>1. In Kepler I could not use a StringCompare with the second string equal
to
>"" in place of the Expression. It returned False even when a Monitor said
>the value was "" and an Expression using input.length() said the length was
>0. (Why I ended up using input.length() in an Expression). I don't
>understand that.
>
>2. I tried to make a ConditionalDisplay class with the switch logic and a
>Display inside the class (since I had several of these and it makes the
>diagram much cleaner). It works but seems to ignore the default parameters
>of 10 rows by 80 columns that I specified in the class and uses what are
>probably the default parameters for the Display.
>
>3. I could not define parameters in the class to pass things like the title
>to the Display. It ignores them in the same way. What I would like to do
>is have a parameter in the class that is named rowsDisplayed and use that
as
>the value of the rowsDisplayed parameter of the Display inside the class.
I
>did not find syntax to do this. At this point I would guess you probably
>can't use an expression for the Display parameters like you can in a
>Constant, for example. (Or else I don't understand ;-)
>
>Thanks,
>
> -Ken
>
>-----Original Message-----
>From: Edward A. Lee [mailto:eal at eecs.berkeley.edu]
>Sent: Saturday, November 10, 2007 2:55 AM
>To: Kenneth Evans
>Cc: Kepler Mailing List
>Subject: Re: [kepler-users] Monitor Value and Display
>
>
>Hi Ken.
>
>I'm checking in the following improvements:
>
> Display: Modified to open the window only on receipt of the first token.
> MonitorValue: Modified to clear the display in initialize
>
>Thanks for the suggestions.
>
>Edward
>
>At 11:09 AM 11/8/2007, Kenneth Evans wrote:
>>Hi,
>>
>>I have minor problems with Monitor Value and Display that I havent been
>>able to work around. Perhaps someone with more experience can help.
>>
>>1. If you use Monitor Display, say as the result of a long calculation, it
>>retains the same value when you run the workflow again. Is there a way to
>>clear it at the start of a run?
>>
>>2. If you use Display for, say an actor like SSH to Execute, that has
>>outputs that typically have nothing in them (stderr and error in this
case)
>>then a Display attached to them comes up every time and can be a nuisance.
>>Is there a way to make the Display (or an alternative) come up only when
>the
>>output is not empty. You can't use a Monitor Value in this case as there
>>may be more than one line on those occasions where the output is not
empty.
>>
>>Thanks,
>>
>> -Ken
>>
>>
>>_______________________________________________
>>Kepler-users mailing list
>>Kepler-users at ecoinformatics.org
>>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-users
>
>------------
>Edward A. Lee
>Chair of EECS and Robert S. Pepper Distinguished Professor
>231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
>phone: 510-642-0253, fax: 510-642-2845
>eal at eecs.Berkeley.EDU,
>http://www.eecs.berkeley.edu/Faculty/Homepages/lee.html
>
>
>_______________________________________________
>Kepler-users mailing list
>Kepler-users at ecoinformatics.org
>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-users
------------
Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
eal at eecs.Berkeley.EDU,
http://www.eecs.berkeley.edu/Faculty/Homepages/lee.html
More information about the Kepler-users
mailing list