Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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.

Just to point out, these dont affect the simulation in any way

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;

Re: OpenModelica text view showing dot/period in the Modelica Script.

Is this a new implementation? Because I dont remember seeing this until I installed the Beta2 version

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.

There are 0 guests and 0 other users also viewing this topic
You are here: