source: trunk/org.modelica.mdt.ui/doc/ch2.html @ 250

Last change on this file since 250 was 250, checked in by boris, 19 years ago
  • doc/ and icons/ folders are now properly moved to org.modelica.mdt.ui project
  • Property svn:executable set to *
File size: 4.5 KB
RevLine 
[250]1<html>
2<title>Modelica Development Tooling Help</title>
3<body>
4<h1>Getting started</h1>
5
6<h2 id = "configurate_omc">Configuring the OpenModelica Compiler</h2>
7
8MDT need to be able to locate the binary of the OpenModelica Compiler. It uses the
9environment variable OPENMODELICAHOME to do so.<br>
10If you have problems using MDT make sure that OPENMODELICAHOME is set to the
11folder where the Open Modelica Compiler is installed. In other words
12OPENMODELICAHOME must point to the folder that contais Open Modelica compiler
13binary. It is named omc.exe on Windows Platform and omc on Unix platforms.
14
15<h2 id = "using_modelica_perspective">Accessing the Modelica Perspective</h2>
16
17<p>
18The most convenient way to work with Modelica projects is to use to the
19Modelica perspective. To switch to the Modelica perspective, choose the
20<b>Window</b> menu item, pick <b>Open Perspective</b>
21 followed by <b>Other...</b>
22Select the <b>Modelica</b> option from the dialog presented and click <b>OK</b>.
23Not <b>Cancel</b>. Or any other button.
24</p>
25
26<h2 id = "making_a_project">Making a project</h2>
27<p>
28To start a new project, use the <b>New Modelica Project</b> Wizard. It is
29accessible through <b>File > New > Modelica Project</b>.
30After creating a project you can add files and folders to the project by selecting
31the corresponding wizard found in <b>File > New</b> menu subsection.
32Files having an extension <i>.mo</i> will be treated as Modelica source code files by MDT.
33</p>
34<img src="pix/new_modelica_project.png">
35
36<h2 id = "importing_a_project">Importing a project</h2>
37<p>
38To import an existing modelica project you need to create an empty modelica project and populate it
39with existing files. Create a new modelica project with the wizard. Use the file system import wizard
40on that project to copy the files to the project's folder. The import wizard is available by right
41clicking on the project in the <b>Modelica Projects</b> view and choosing <b>Import...</b> alternative.
42</p>
43
44<h2 = "making_a_package">Making a package</h2>
45<p>
46To create a new Modelica package, use the <b>New Modelica Package</b> Wizard.
47You can access it by going through <b>File > New > Modelica Package</b> or by
48right-clicking in a project and selecting <b>New > Modelica Package</b>.
49Enter the desired name of the package and a description about what it contains.
50</p>
51<img src="pix/new_modelica_package.png">
52
53<h2 = "making_a_class">Making a class</h2>
54<p>
55To make a new Modelica class, select where in the hierarchy that you want to add
56your new class and select <b>File > New > Modelica Class</b>. When creating a
57Modelica class you can add different restrictions on what the class can contain.
58These can for example be <i>model</i>, <i>connector</i>, <i>block</i>,
59<i>record</i>, or <i>function</i>.
60When you have selected your desired class type, you can select modifiers that
61add code blocks to the generated code. <i>Include initial code block</i> will for
62example add the line <b>initial equation</b> to the class.
63</p>
64<img src="pix/new_modelica_class.png">
65
66<h2 = "syntax_checking">Syntax checking</h2>
67<p>
68Whenever a Modelica (.mo) file is saved in the Modelica Editor, it is checked
69for syntactical errors. Any errors that are found are added to the Problems view
70and also marked in the source code editor. Errors are marked in the editor as a
71red circle with a white cross, a squiggly red line under the problematic
72construct, and as a red marker in the right-hand side of the editor. If you want
73to reach the problem, you can either click the item in the Problems view or
74select the red box in the right-hand side of the editor.
75</p>
76<img src="pix/error.png">
77
78<h2 = "code_completion">Code completion</h2>
79<p>
80If you type a dot (.) after anything that is loaded into OMC, code completion
81will kick in. If you for example type <b>Modelica.</b>, a list with packages
82and classes that are available in the Modelica package will be displayed. You
83can narrow down the matches by typing in the first characters of the class or
84package that you want to type in. So if you've first typed <b>Modelica.</b> you
85can the continue typing <b>Me</b> and MDT will propose <b>Mechanics</b> and
86<b>Media</b> as completions. You can always backtrack the narrowing by erasing
87characters.<br>
88<b>Note:</b> As of now, you have to have the Modelica System Library loaded for
89code completion on the system library to work. This can right now be
90accomplished by browsing the Modelica System Library in the projects view before
91trying to use code completion.
92</p>
93
94</body>
95</html>
Note: See TracBrowser for help on using the repository browser.