[kepler-dev] Actor Configure Dialog

Edward A. Lee eal at eecs.berkeley.edu
Fri Mar 10 11:51:34 PST 2006


At 04:26 PM 3/9/2006, Jing Tao wrote:
>Hi, devs:
>
>Now I am playing to configure eml actor and have some puzzle about
>attributeChange method and configure dialog.
>
>First, if I add a print out statement in attribute change, I found during
>opening a workflow which has one eml actor, the attributeChange method
>will be call 55 times even there are only 10 attributes in this actor.
>Why attributeChange be called some
>many times?

Typically it will be called when attribute is set to a default
value in the constructor, and then it will be called again when
the MoML is parsed to set it to the model-specific value.
This would account for 20 of the 55, but I would have to
see stack traces to identify the rest...


>Second, if I updated a parameter value and click commit button. This will
>trigger calling attributeChange method. if I update a parameter value and
>click cancel button, this will trigger calling attributeChange metod too.
>How can I tell them which cause the calling of attributeChange method in
>the actor class?

I don't think you can.  But it wouldn't be useful information
anyway... The Cancel button restores the value of parameters to
what it was when the dialog was opened.  This could actually be
a genuine change in value for the actor, since the value might
have been changed while the dialog was open.  In particular,
the value actually gets changed each time a parameter value
field in the dialog loses the focus. The purpose is to give
the user immediate feedback if the value is erroneous.


>Third one is: in eml configure panel, there are two parameters are related
>to each one. Ideally if I updated value in one parameter, the other should
>be updated too without clicking any button. Here is a example, eml actor
>has "EML File" (which is file parameter and "SelectedEntity" (which is a
>string choice parameter). If I choose different eml file in "EML 
>File" parameter, and "SelectedEntity"
>should display the different entity name which is in the different eml
>file. I have Helloworld.xml which's entity name is "Hello world" and 
>Goodmorning.xml
>which's enity name is "Good morning". First I chose Helloworld.xml in "EML
>File" and "Selected Entity" shows "Hello world". But if I update the
>value to Goodmorning.xml and "Selected Entity" will show "Good morning"
>and with another choice "Hello world"! Howerver, if you click commit and
>reopen configure window again, the "EML file" value will be 
>Goodmorning.xml and "Selected Entity" only have the
>choice "Good morning". It seems my removeAllChoice code in
>attributeChange only works after clicking commit button. How can I achieve
>this kind real time update in configure panel before clicking commit
>button?

I don't really understand your example, but you have to choose
between committing value changes as early as possible (when the
field loses focus) or as late as possible (when commit is clicked).
It sounds to me like you want both, which I don't think is possible...
We chose as early as possible to get feedback immediately to the user
if the value is wrong...  If you defer it to when commit is clicked,
then values will only be updated then, so cross coupled values will
not change until you click commit and re-open the dialog.

Edward


------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  



More information about the Kepler-dev mailing list