]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI1/fmi1_xml_unit.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / include / FMI1 / fmi1_xml_unit.h
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
7      This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     FMILIB_License.txt file for more details.
11
12     You should have received a copy of the FMILIB_License.txt file
13     along with this program. If not, contact Modelon AB <http://www.modelon.com>.
14 */
15
16 /** \file fmi1_xml_unit.h
17 *  \brief Public interface to the FMI XML C-library. Handling of variable units.
18 */
19
20 #ifndef FMI1_XML_UNIT_H_
21 #define FMI1_XML_UNIT_H_
22
23 #include "fmi1_xml_model_description.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28                 
29         /**
30         \addtogroup fmi1_xml
31         @{
32         \addtogroup fmi1_xml_units Functions for handling unit definitions.
33         @}
34         \addtogroup fmi1_xml_units Functions for handling unit definitions.
35         @{
36         */
37
38 /** \brief Get a list of all the unit definitions */
39 fmi1_xml_unit_definitions_t* fmi1_xml_get_unit_definitions(fmi1_xml_model_description_t* md);
40 unsigned int  fmi1_xml_get_unit_definitions_number(fmi1_xml_unit_definitions_t*);
41 fmi1_xml_unit_t* fmi1_xml_get_unit(fmi1_xml_unit_definitions_t*, unsigned int  index);
42 const char* fmi1_xml_get_unit_name(fmi1_xml_unit_t*);
43 unsigned int fmi1_xml_get_unit_display_unit_number(fmi1_xml_unit_t*);
44 fmi1_xml_display_unit_t* fmi1_xml_get_unit_display_unit(fmi1_xml_unit_t*, size_t index);
45
46 fmi1_xml_display_unit_t* fmi1_xml_get_type_display_unit(fmi1_xml_real_typedef_t*);
47 fmi1_xml_unit_t* fmi1_xml_get_base_unit(fmi1_xml_display_unit_t*);
48 const char* fmi1_xml_get_display_unit_name(fmi1_xml_display_unit_t*);
49 double fmi1_xml_get_display_unit_gain(fmi1_xml_display_unit_t*);
50 double fmi1_xml_get_display_unit_offset(fmi1_xml_display_unit_t*);
51
52 double fmi1_xml_convert_to_display_unit(double, fmi1_xml_display_unit_t*, int isRelativeQuantity);
53 double fmi1_xml_convert_from_display_unit(double, fmi1_xml_display_unit_t*, int isRelativeQuantity);
54 /**
55 @}
56 */
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif