Skip to content

Commit 1983c2f

Browse files
atrosinenkoOpenModelica-Hudson
authored andcommitted
Add some example auto-completion information for use by OMEdit
Belonging to [master]: - OpenModelica/OMCompiler#2958 - OpenModelica/OpenModelica-testsuite#1157
1 parent a2024ab commit 1983c2f

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

Compiler/FrontEnd/ModelicaBuiltin.mo

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,126 @@ package ReleaseNotes
41374137
end ReleaseNotes;
41384138
end UsersGuide;
41394139

4140+
package AutoCompletion "Auto completion information for OMEdit."
4141+
package Annotations "Auto completion information on annotations."
4142+
// Annotations for Documentation
4143+
record Documentation "Defines the documentation."
4144+
String info "The textual description of the class.";
4145+
String revisions "A list of revisions and other annotations defined by a tool.";
4146+
end Documentation;
4147+
4148+
String preferredView = "diagram" "Default view when selecting the class (<b>info</b>, <b>diagram</b> or <b>text</b>).";
4149+
Boolean DocumentationClass = true "Implies that this class and all classes within it are treated as having the annotation <b>preferredView=\"info\"</b>. If the annotation <b>preferredView</b> is explicitly set for a class, it has precedence over a <b>DocumentationClass</b> annotation.";
4150+
4151+
// Annotations for Code Generation
4152+
Boolean Evaluate = true "Defines if the value can be utilize for symbolic processing.";
4153+
Boolean HideResult = true "Proposes to not show the simulator results.";
4154+
Boolean Inline = true "Proposes to inline the function which means the body of the function is included at all places where the function is called.";
4155+
Boolean LateInline = true "Proposes to inline the function after all symbolic transformations have been performed.";
4156+
Boolean GenerateEvents = true "proposes that crossing functions in the function should generate events.";
4157+
Integer smoothOrder "Defines the number of differentiations of the function, in order that all of the differentiated outputs are continuous provided all input arguments and their derivatives up to order <b>smoothOrder</b> are continuous.";
4158+
4159+
// Annotations for Simulation Experiments
4160+
record experiment "Define default experiment parameters."
4161+
Real StartTime(unit = "s") = 0 "Default start time of simulation.";
4162+
Real StopTime(unit = "s") = 1 "Default stop time of simulation.";
4163+
Real Interval(unit = "s", min = 0) = 0.002 "Resolution for the result grid.";
4164+
Real Tolerance(min = 0) = 1e-6 "Default relative integration tolerance.";
4165+
end experiment;
4166+
4167+
// Annotation for single use of class
4168+
Boolean singleInstance = true "Indicates that there should only be one component instance of the class.";
4169+
4170+
// TODO: Annotations for Graphical Objects. Do we really need them? Don't think that users will prefer to write them manually.
4171+
4172+
// Annotations for the Graphical User Interface
4173+
String defaultComponentName "Recommended name when creating a component of the class.";
4174+
String defaultComponentPrefixes "Recommended prefixes when creating a component of the class.";
4175+
String missingInnerMessage "Specifies a message when an <b>outer</b> component of the class does not have a corresponding <b>inner</b> component.";
4176+
Boolean absoluteValue "If <b>false</b>, then the variable defines a relative quantity, and if <b>true</b> an absolute quantity.";
4177+
Boolean defaultConnectionStructurallyInconsistent "If <b>true</b>, it is stated that a default connection will result in a structurally inconsistent model or block.";
4178+
String obsolete "Indicates that the class ideally should not be used anymore and gives a message indicating the recommended action.";
4179+
String unassignedMessage "Defines a diagnostic message to use when a variable declaration cannot be computed due to the structure of the equations.";
4180+
4181+
record Dialog
4182+
parameter String tab = "General";
4183+
parameter String group = "Parameters";
4184+
parameter Boolean enable = true;
4185+
parameter Boolean showStartAttribute = false;
4186+
parameter Boolean colorSelector = false;
4187+
parameter Selector loadSelector;
4188+
parameter Selector saveSelector;
4189+
parameter String groupImage = "";
4190+
parameter Boolean connectorSizing = false;
4191+
end Dialog;
4192+
4193+
record Selector
4194+
parameter String filter = "";
4195+
parameter String caption = "";
4196+
end Selector;
4197+
4198+
// Annotations for Version Handling
4199+
String version "The version number of the released library.";
4200+
String versionDate "The date in UTC format (according to ISO 8601) when the library was released.";
4201+
Integer versionBuild "The optional build number of the library.";
4202+
String dateModified "The UTC date and time (according to ISO 8601) of the last modification of the package.";
4203+
String revisionId "A tool specific revision identifier possibly generated by a source code management system (e.g. Subversion or CVS).";
4204+
4205+
record uses "A list of dependent classes."
4206+
end uses;
4207+
4208+
// Annotations for Access Control to Protect Intellectual Property
4209+
type Access = enumeration(hide, icon, documentation, diagram, nonPackageText, nonPackageDuplicate, packageText, packageDuplicate);
4210+
4211+
record Protection "Protection of class"
4212+
Access access "Defines what parts of a class are visible.";
4213+
String features[:] = fill("", 0) "Required license features";
4214+
record License
4215+
String libraryKey;
4216+
String licenseFile = "" "Optional, default mapping if empty";
4217+
end License;
4218+
end Protection;
4219+
4220+
record Authorization
4221+
String licensor = "" "Optional string to show information about the licensor";
4222+
String libraryKey "Matching the key in the class. Must be encrypted and not visible";
4223+
License license[:] "Definition of the license options and of the access rights";
4224+
end Authorization;
4225+
4226+
record License
4227+
String licensee = "" "Optional string to show information about the licensee";
4228+
String id[:] "Unique machine identifications, e.g. MAC addresses";
4229+
String features[:] = fill("", 0) "Activated library license features";
4230+
String startDate = "" "Optional start date in UTCformat YYYY-MM-DD";
4231+
String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD";
4232+
String operations[:] = fill("",0) "Library usage conditions";
4233+
end License;
4234+
4235+
// TODO: Function Derivative Annotations
4236+
4237+
// Inverse Function Annotation
4238+
record inverse
4239+
end inverse;
4240+
4241+
// TODO: External Function Annotations
4242+
4243+
// Annotation Choices for Modifications and Redeclarations
4244+
record choices "Defines a suitable redeclaration or modifications of the element."
4245+
Boolean checkBox = true "Display a checkbox to input the values false or true in the graphical user interface.";
4246+
// TODO: how to handle choice?
4247+
end choices;
4248+
4249+
Boolean choicesAllMatching "Specify whether to construct an automatic list of choices menu or not.";
4250+
4251+
// TODO: Annotation for External Libraries and Include Files
4252+
4253+
annotation(
4254+
Documentation(info = "<html>In this package annotations are gathered in their record-like form together with meta information such as descriptions, units, min, max, etc.</html>"));
4255+
end Annotations;
4256+
annotation(
4257+
Documentation(info = "<html>In this package a machine-readable auto completion information is gathered for use by OMEdit.</html>"));
4258+
end AutoCompletion;
4259+
41404260
annotation(
41414261
Documentation(revisions="<html>See <a href=\"modelica://OpenModelica.UsersGuide.ReleaseNotes\">ReleaseNotes</a></html>",
41424262
__Dymola_DocumentationClass = true),

0 commit comments

Comments
 (0)