- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OpenModelica text view showing...
OpenModelica text view showing dot/period in the Modelica Script.
OpenModelica text view showing dot/period in the Modelica Script.
Hi, I recently downloaded the OpenModelica 1.9.1 Beta2 (r19512) (RML version). I've seen in quite some places the Modelica scripts show dot/periods in the code.
Sample Code snippet from Modelica.Blocks.Continuous.LimPID:
Code:
parameter .Modelica.Blocks.Types.SimpleController controllerType = .Modelica.Blocks.Types.SimpleController.PID "Type of controller";
parameter SIunits.Time Ti(min = Modelica.Constants.small) = 0.5 "Time constant of Integrator block" annotation(Dialog(enable = controllerType == .Modelica.Blocks.Types.SimpleController.PI or controllerType == .Modelica.Blocks.Types.SimpleController.PID));
parameter SIunits.Time Td(min = 0) = 0.1 "Time constant of Derivative block" annotation(Dialog(enable = controllerType == .Modelica.Blocks.Types.SimpleController.PD or controllerType == .Modelica.Blocks.Types.SimpleController.PID));
Notice the .'s before the word Modelica?
Is this a bug or has there been any changes related to this in the latest Modelica version?
Re: OpenModelica text view showing dot/period in the Modelica Script.
The dot in front of a name means "do lookup from the root", which gives faster translation times if a Modelica tool does lookup as described by the specification in addition to looking outside encapsulation, etc.
Try:
Code:
model N
Real r;
end N;
model M
type N = Real;
.N n;
end M;
- sjoelund.se
- 1700 Posts
Re: OpenModelica text view showing dot/period in the Modelica Script.
It's been in Modelica language spec since 3.2 (March 2010), and OpenModelica earlier than that.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OpenModelica text view showing...