hello all,
i like to enable various parameters using the enable functionality in the dialog part of annotations. the trigger for true/false should be the choice of certain replaceable model. This means, if a certain model is chosen via the parameter dialog, corresponding parameter should fade in or out. i tried a lot but i did not find a solution. here is part of my code....
...
parameter Integer numberReactions(start=10) "Number of reactions"
annotation(Dialog(tab="Reaction", group="Gas phase",
enable=if ChemicalReactionModel==CementProcess.WorkBase.RotaryKiln.BaseClasses.ChemicalReactions.NoChemicalReaction then false else true),
Evaluate=true);
...
replaceable
CementProcess.WorkBase.RotaryKiln.BaseClasses.ChemicalReactions.NoChemicalReaction
ChemicalReactionModel(redeclare final package Medium = Medium,
redeclare final package MediumExchange
= MediumGasExchange, redeclare final function
KineticReaction =
KineticReaction, final n=n,
final numberReactions=numberReactions,
final reactionOn=reactionOn,
final Ai=Ai,
final nF=nF,
final Ea=Ea,
T=medium.T,
MoDXi=MolarDensity,
MoDExXi=fill(0,n,MediumGasExchange.nXi))
constrainedby
CementProcess.WorkBase.RotaryKiln.BaseClasses.ChemicalReactions.PartialChemicalReaction(
redeclare package Medium = Medium,
redeclare package MediumExchange =
MediumGasExchange, redeclare function KineticReaction =
KineticReaction, n=n,
numberReactions=numberReactions,
reactionOn=reactionOn,
Ai=Ai,
nF=nF,
Ea=Ea,
T=medium.T,
MoDXi=MolarDensity,
MoDExXi=fill(0,n,MediumGasExchange.nXi))
"Model for chemical reactions in the gas phase"
annotation (Dialog(tab="Reaction", group="Reaction model"),choicesAllMatching,
Placement(transformation(extent={{-4,-4},{20,20}}, rotation=180,
origin={38,10})));
as one might see, i introduced the replaceable model ChemicalReactionModel. It is intialized with ...NoChemicalReaction. Now i like to trigger the parameter numberReactions in the dialog field of annotations using enable....
I did not found the correct syntax that makes it work.
If you have any ideas i would be very grateful.
Thanks a lot
Uwe
