OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
Values.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenModelica.
3  *
4  * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
5  * c/o Linköpings universitet, Department of Computer and Information Science,
6  * SE-58183 Linköping, Sweden.
7  *
8  * All rights reserved.
9  *
10  * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
11  * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
12  * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13  * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
14  * ACCORDING TO RECIPIENTS CHOICE.
15  *
16  * The OpenModelica software and the Open Source Modelica
17  * Consortium (OSMC) Public License (OSMC-PL) are obtained
18  * from OSMC, either from the above address,
19  * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
20  * http://www.openmodelica.org, and in the OpenModelica distribution.
21  * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
22  *
23  * This program is distributed WITHOUT ANY WARRANTY; without
24  * even the implied warranty of MERCHANTABILITY or FITNESS
25  * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
26  * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
27  *
28  * See the full OSMC Public License conditions for more details.
29  *
30  */
31 
32 #ifndef _OMS_VALUES_H_
33 #define _OMS_VALUES_H_
34 
35 #include "ComRef.h"
36 #include "Types.h"
37 #include <pugixml.hpp>
38 #include <map>
39 
40 namespace oms
41 {
42  class Values
43  {
44  public:
45  Values();
46  ~Values();
47 
48  oms_status_enu_t setReal(const ComRef& cref, double value);
49  oms_status_enu_t setInteger(const ComRef& cref, int value);
50  oms_status_enu_t setBoolean(const ComRef& cref, bool value);
51 
52  oms_status_enu_t exportToSSD(pugi::xml_node& node) const;
53  oms_status_enu_t importFromSSD(const pugi::xml_node& node, const std::string& sspVersion, const std::string& tempdir);
55 
56  oms_status_enu_t exportToSSV(pugi::xml_node& ssvNode) const;
57  oms_status_enu_t exportToSSVTemplate(pugi::xml_node& ssvNode, const ComRef& cref);
58  oms_status_enu_t exportToSSMTemplate(pugi::xml_node& ssmNode, const ComRef& cref);
59  oms_status_enu_t exportStartValuesHelper(pugi::xml_node& node) const;
60  oms_status_enu_t exportParameterMappingInline(pugi::xml_node& node) const;
62  oms_status_enu_t importParameterMapping(pugi::xml_node& parameterMapping);
63  oms_status_enu_t parseModelDescription(const char *filename);
64 
66 
67  std::map<ComRef, double> realStartValues;
68  std::map<ComRef, int> integerStartValues;
69  std::map<ComRef, bool> booleanStartValues;
70 
71  std::map<ComRef, double> realValues;
72  std::map<ComRef, int> integerValues;
73  std::map<ComRef, bool> booleanValues;
74 
75  std::map<ComRef, double> modelDescriptionRealStartValues;
76  std::map<ComRef, int> modelDescriptionIntegerStartValues;
77  std::map<ComRef, bool> modelDescriptionBooleanStartValues;
78 
79  std::multimap<ComRef, ComRef> mappedEntry;
80 
81  };
82 }
83 
84 #endif
oms_status_enu_t exportToSSMTemplate(pugi::xml_node &ssmNode, const ComRef &cref)
start values read from modelDescription.xml and creates a ssm template
Definition: Values.cpp:364
std::map< ComRef, bool > modelDescriptionBooleanStartValues
boolean start values read from modelDescription.xml
Definition: Values.h:77
oms_status_enu_t exportParameterMappingInline(pugi::xml_node &node) const
Definition: Values.cpp:299
std::map< ComRef, bool > booleanStartValues
parameters and start values defined before instantiating the FMU
Definition: Values.h:69
oms_status_enu_t importParameterMapping(pugi::xml_node &parameterMapping)
Definition: Values.cpp:522
std::map< ComRef, double > modelDescriptionRealStartValues
real start values read from modelDescription.xml
Definition: Values.h:75
oms_status_enu_t setBoolean(const ComRef &cref, bool value)
Definition: Values.cpp:67
oms_status_enu_t importFromSSD(const pugi::xml_node &node, const std::string &sspVersion, const std::string &tempdir)
Definition: Values.cpp:128
std::map< ComRef, bool > booleanValues
boolean input values defined after initialization
Definition: Values.h:73
oms_status_enu_t
Definition: Types.h:43
oms::ComRef getMappedCrefEntry(ComRef cref) const
Definition: Values.cpp:271
oms_status_enu_t setReal(const ComRef &cref, double value)
Definition: Values.cpp:55
std::map< ComRef, double > realStartValues
parameters and start values defined before instantiating the FMU
Definition: Values.h:67
oms_status_enu_t exportToSSV(pugi::xml_node &ssvNode) const
Definition: Values.cpp:196
oms_status_enu_t deleteStartValue(const ComRef &cref)
Definition: Values.cpp:73
std::map< ComRef, int > integerValues
integer input values defined after initialization
Definition: Values.h:72
oms_status_enu_t parseModelDescription(const char *filename)
Definition: Values.cpp:477
oms_status_enu_t setInteger(const ComRef &cref, int value)
Definition: Values.cpp:61
ComRef - component reference.
Definition: ComRef.h:43
std::map< ComRef, int > modelDescriptionIntegerStartValues
integer start values read from modelDescription.xml
Definition: Values.h:76
const char * parameters
Definition: Tags.cpp:79
std::multimap< ComRef, ComRef > mappedEntry
parameter names and values provided in the parameter source are to be mapped to the parameters of the...
Definition: Values.h:79
Definition: Values.h:42
~Values()
Definition: Values.cpp:51
Definition: AlgLoop.h:44
oms_status_enu_t exportToSSVTemplate(pugi::xml_node &ssvNode, const ComRef &cref)
start values read from modelDescription.xml and creates a ssv template
Definition: Values.cpp:322
Values()
Definition: Values.cpp:47
std::map< ComRef, int > integerStartValues
parameters and start values defined before instantiating the FMU
Definition: Values.h:68
oms_status_enu_t exportStartValuesHelper(pugi::xml_node &node) const
Definition: Values.cpp:208
oms_status_enu_t exportToSSD(pugi::xml_node &node) const
Definition: Values.cpp:106
std::map< ComRef, double > realValues
real input values defined after initialization
Definition: Values.h:71
oms_status_enu_t importStartValuesHelper(pugi::xml_node &parameters)
Definition: Values.cpp:397