﻿# Allgemeine Methoden

> [HTML Version](general-methods.html)

Allgemeine Methoden für alle Berechnungsmodule sind:

- VARIANT\_BOOL calculate();  
Run calculation.

- VARIANT\_BOOL loadFile(\[in\] BSTR p\_filename);  
Load file.

- VARIANT\_BOOL saveFile(\[in\] BSTR p\_filename);  
Save calculation file.

- VARIANT\_BOOL generateReport(\[in\] BSTR p\_filename);  
Generate a report into the filename.

- VARIANT\_BOOL showReport(\[in\] BSTR p\_filename);  
Generate the report into the filename and call a program to view it.

- VARIANT\_BOOL generateSpecialReport(\[in\] BSTR p\_type, \[in\] BSTR p\_filename);  
Generate a special report into the filename. Use type as "resultTables" for result tables.

- VARIANT\_BOOL generateImage(\[in\] BSTR p\_imageID, \[in\] BSTR p\_filename, \[in\] int p\_dpi, \[in\] int p\_widthinMM, \[in\] int p\_heightinMM);  
Generate an image and save it as file.

- `VARIANT\_BOOL generateImage3D(\[in\] BSTR p\_imageID, \[in\] BSTR p\_filename, \[in\] int p\_dpi, \[in\] int p\_widthinMM, \[in\] int p\_heightinMM, \[in\] double p\_dirX, \[in\] double p\_dirY, \[in\] double p\_dirZ, \[in\] double p\_upX, \[in\] double p\_upY, \[in\] double p\_upZ);`  
Generate an image of a 3D-scene and save it as file. dir is a vector in view direction, up is a vector for the up-direction of the view.

- SAFEARRAY(VARIANT) getDiagramData(\[in\] BSTR p\_imageID);  
Get the diagram data for diagrams. The format of the return value is \[\["name", \["x", "abscissa label", "abscissa unit", \[1, 2, 3, ...\], \["y", "ordinate label", "ordinate unit", \[1, 2, 3, ...\]\], \["name", ...\]\]

- VARIANT\_BOOL saveVariableList(\[in\] BSTR p\_path);  
Save the list of available variables into an XLSX file. The available variables depend on the input data.

- SAFEARRAY(VARIANT) getVariableList();  
Get the available variables as list. The available variables depend on the input data. The format is \[\["name", "type", "unit", "description"\], ...\]

- VARIANT\_BOOL runParameterVariation(\[in\] int p\_index, \[in\] BSTR p\_resultFilePath);  
Call the parameter variation with defined input settings for given index and saves the result table

- SAFEARRAY(VARIANT) runParameterVariation\_1(\[in\] int p\_index);

- Call the parameter variation with defined input settings for given index and returns the result table

- VARIANT\_BOOL setVarDouble(\[in\] BSTR p\_name, \[in\] double p\_value);  
Set variable to double value.

- VARIANT\_BOOL setVarBool(\[in\] BSTR p\_name, \[in\] VARIANT\_BOOL p\_value);  
Set variable to boolean value.

- VARIANT\_BOOL setVarInt(\[in\] BSTR p\_name, \[in\] int p\_value);  
Set variable to integer value.

- VARIANT\_BOOL setVarString(\[in\] BSTR p\_name, \[in\] BSTR p\_value);  
Set variable to character value.

- VARIANT\_BOOL getVarDouble(\[in\] BSTR p\_name, \[in,out\] double \*p\_value);  
Read back double variable.

- VARIANT\_BOOL getVarBool(\[in\] BSTR p\_name, \[in,out\] VARIANT\_BOOL \*p\_value);  
Read back boolean variable.

- VARIANT\_BOOL getVarInt(\[in\] BSTR p\_name, \[in,out\] int \*p\_value);  
Read back integer variable.

- VARIANT\_BOOL getVarString(\[in\] BSTR p\_name, \[in,out\] BSTR \*p\_value);  
Read back character variable.

- VARIANT\_BOOL setVar(\[in\] BSTR p\_name, \[in\] VARIANT p\_value);  
Set variable using variant

- VARIANT getVar(\[in\] BSTR p\_name);  
Get variable using variant

- VARIANT\_BOOL resizeArray(\[in\] BSTR p\_name, \[in\] int p\_count);  
Resize array variable





Jedes Berechnungsmodul mit GUI bietet folgende Methoden:

- void showWindow();  
Show user interface.

- void hideWindow();  
Hide user interface.

- void exec();  
Show user interface and process events until the window is closed.

- void setLanguage(\[in\] BSTR p\_lang);  
Pass language as two characters ("de", "en", "fr", "es", "tr", "ko", "zh", "ja")

- MesysModule\* getCalcModule();  
Get the calculation module from the user interface.

- void setCalcModule(MesysModule\*);  
Set the calculation module for the user interface.





Die Namen für die Variablen der Berechnungsmodule sind die gleichen, wie sie für die [benutzerdefinierten Protokollvorlagen](custom-report-templates.md) vorgesehen sind. Die Wellenberechnung ist derzeit nur eingeschränkt nutzbar, da zusätzliche Funktionen zur Änderung von Lasten und Randbedingungen fehlen.