Download Dymola 6, Additions.
Transcript
• Concealed classes are completely hidden for the users, who shall not be aware of the existence of such components at all. They are not shown in the package browser and they cannot be inspected. A class or a component is defined as concealed if one of these conditions is fulfilled: • It is declared in the protected section of an encrypted class. • Its lexically enclosing scope is concealed. • It has the Protection-annotation: hideFromBrowser=true. Dymola supports encryption on file basis, which means that all parts of an encrypted package must be stored in one file. Storing an encrypted package in several files or in subdirectories would reveal structural information. Instead it is possible to reveal the contents of encrypted packages. Developing encrypted libraries To allow visible components to be used in the normal way to compose models, set parameters and initial values, the developer of such components must make a careful design. The public part must provide all necessary parameters, necessary control of initialization and variables to inspect and plot. Nested modifiers cannot be used to modify concealed parameters. Instead new parameters have to be declared and propagated down the hierarchy. Parameters for initial conditions need to be introduced and propagated to start values or used in “initial sections”. The procedure for developing an encrypted library is: • The developer maintains an unencrypted library, which is easy to modify and easy to maintain in a version control system. All parts which should be concealed in the finished library must be declared as protected. • When the unencrypted library has been finished for release double-click on the package to show it in Dymola • If developing a licensed library add the following to the Modelica text in the Modelica text window: annotation(Dymola(checkSum="", Library="MyLib")); • Select ‘File/Export/Encrypted model’ which produces the encrypted file myPackage.moe. • The encrypted file, i.e., the .moe file, is distributed. The original .mo files for the encrypted parts are never distributed outside of the development group. It is worth pointing out that external decrypting of a .moe file is not supported by Dymola, but all development work must be performed in the original unencrypted .mo file. In Dymola all encrypted files are by definition read-only. 232