2 Copyright (C) 2012 Modelon AB
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the BSD style license.
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.
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>.
16 /** \file fmi1_xml_unit.h
17 * \brief Public interface to the FMI XML C-library. Handling of variable units.
20 #ifndef FMI1_XML_UNIT_H_
21 #define FMI1_XML_UNIT_H_
23 #include "fmi1_xml_model_description.h"
32 \addtogroup fmi1_xml_units Functions for handling unit definitions.
34 \addtogroup fmi1_xml_units Functions for handling unit definitions.
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);
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*);
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);