Open mpradovelasco opened 1 year ago
See #11386.
Thank you for the information @adeas31 !
- The second component is from MSL. I do not know why appears the tidy text below, but this is a minor doubt.
This is source expression text. The expected usage of 'Show.RealValue' is something like this:
model m1
Modelica.Blocks.Sources.Sine sine(f=2) annotation (Placement(transformation(extent={{-10,50},{10,70}})));
Modelica.Blocks.Interaction.Show.RealValue realValue(use_numberPort=false, number=sine.y) annotation (Placement(transformation(extent={{-20,14},{20,54}})));
Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort=false, number=time) annotation (Placement(transformation(extent={{-20,-12},{20,28}})));
annotation (uses(Modelica(version="4.0.0")));
end m1;
After trying to define a MWE to show a potential DynamicSelect from #11157), several details are observed. All of them refer to the following minimal example:
DynamicSelect behaviour Really the DynamicSelect clause operates properly. It presents the dynamic texts when the diagram is shown in the plotting view. The following figure shows the view model after removing the DIcon2 component in view. This way the dynamic field respect the if expression based on parameter conditions (class DynamicIcon). The second component is from MSL. I do not know why appears the tidy text below, but this is a minor doubt.
Graphical primitives behaviour
However, I am interested in showing some graphic feedback in the diagram view of the model during GUI procedures. I have used the Text graphic primitive (annotation) in the DynamicIcon2 class, that it is now declared to the View model according the previous code. I reach the following results.
If I substitute the code:
by
the "H" is shown in the diagram (DIcon2 icon), as expected.
But if I try to use a conditional expression for strTest like
then textString = "%strTest" produces an empty field in the place of "H" of the DIcon2 icon as shown: I have tested other combinations and similar situations without success. This limitation difficults the feedback to the user of a selected value for a parameter.
Finally, if I used the initial code, with textString = "%gateType" for DynamicIcon2, the situation is more complex. When I drag and drop the icon DynamicIcon2, the place of H in DIcon2 remains empty as in previous figure. However, if I modify the gateType value using the dialog box as seen: now this is properly presented in the diagram (DIcon2 where I have selected the D value):
However, OMEdit gives the warning: Parameter gateType has annotation(Evaluate=true) and no binding.
This seems not logical, since it has a binding equation and it is indeed accepted by the GUI API.
But worst, if I try now to simulate the View model, OMEdit gives an error: [Found component 'D' in composite name 'DIcon2.FlipFlop.D', expected class.]
But the value defined was fine, according to the choicesAllMatching = true, as shown:
I suspect that it may be due to the fact that the modifier is using the name of the component where it is applied. That is:
In summary, DynamicSelect seems fine, but the field Text in the Icon annotation does not, what makes difficult the cited user feedback.
System: OMEdit 1.22 - dev (10 september), Enable Instance API ON , Windows 11.
I apologize for the extension. Thanks!