Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
vwaurich committed May 22, 2015
2 parents 76f2202 + eb6f814 commit 6584fe1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 41 deletions.
2 changes: 1 addition & 1 deletion 3rdParty
Submodule 3rdParty updated 96 files
+30 −30 FMIL/Config.cmake/fmilib.h
+26 −26 FMIL/LICENSE.md
+39 −39 FMIL/Test/FMI1/compress_test_fmu_zip.c
+80 −80 FMIL/Test/FMI1/fmi1_import_test.c
+210 −210 FMIL/Test/FMI1/fmi1_logger_test.c
+229 −229 FMIL/Test/FMI1/fmi_import_cs_test.c
+275 −275 FMIL/Test/FMI1/fmi_import_me_test.c
+268 −268 FMIL/Test/FMI1/fmu_dummy/fmu1_model.h
+162 −162 FMIL/Test/FMI1/fmu_dummy/fmu1_model_cs.c
+68 −68 FMIL/Test/FMI1/fmu_dummy/fmu1_model_defines.h
+157 −157 FMIL/Test/FMI1/fmu_dummy/fmu1_model_me.c
+98 −98 FMIL/Test/FMI2/fmi2_import_test.c
+248 −248 FMIL/Test/FMI2/fmu_dummy/fmu2_model.h
+180 −180 FMIL/Test/FMI2/fmu_dummy/fmu2_model_cs.c
+60 −60 FMIL/Test/FMI2/fmu_dummy/fmu2_model_defines.h
+185 −185 FMIL/Test/FMI2/fmu_dummy/fmu2_model_me.c
+38 −38 FMIL/Test/fmi_zip_unzip_test.c
+45 −45 FMIL/Test/fmi_zip_zip_test.c
+1 −1 FMIL/ThirdParty/Minizip/minizip/miniunz.c
+332 −332 FMIL/src/CAPI/include/FMI1/fmi1_capi.h
+275 −275 FMIL/src/CAPI/include/FMI2/fmi2_capi.h
+1 −1 FMIL/src/CAPI/src/FMI1/fmi1_capi.c
+90 −90 FMIL/src/CAPI/src/FMI1/fmi1_capi_cs.c
+127 −127 FMIL/src/CAPI/src/FMI1/fmi1_capi_me.c
+107 −107 FMIL/src/CAPI/src/FMI2/fmi2_capi.c
+59 −59 FMIL/src/CAPI/src/FMI2/fmi2_capi_cs.c
+11 −11 FMIL/src/CAPI/src/FMI2/fmi2_capi_impl.h
+92 −92 FMIL/src/CAPI/src/FMI2/fmi2_capi_me.c
+120 −120 FMIL/src/Import/include/FMI/fmi_import_context.h
+59 −59 FMIL/src/Import/include/FMI/fmi_import_util.h
+220 −220 FMIL/src/Import/include/FMI1/fmi1_import.h
+7 −7 FMIL/src/Import/include/FMI1/fmi1_import_capabilities.h
+363 −363 FMIL/src/Import/include/FMI1/fmi1_import_capi.h
+22 −22 FMIL/src/Import/include/FMI1/fmi1_import_convenience.h
+13 −13 FMIL/src/Import/include/FMI1/fmi1_import_type.h
+11 −11 FMIL/src/Import/include/FMI1/fmi1_import_unit.h
+38 −38 FMIL/src/Import/include/FMI1/fmi1_import_variable.h
+127 −127 FMIL/src/Import/include/FMI1/fmi1_import_variable_list.h
+18 −18 FMIL/src/Import/include/FMI1/fmi1_import_vendor_annotations.h
+357 −357 FMIL/src/Import/include/FMI2/fmi2_import.h
+577 −577 FMIL/src/Import/include/FMI2/fmi2_import_capi.h
+22 −22 FMIL/src/Import/include/FMI2/fmi2_import_convenience.h
+13 −13 FMIL/src/Import/include/FMI2/fmi2_import_type.h
+11 −11 FMIL/src/Import/include/FMI2/fmi2_import_unit.h
+21 −21 FMIL/src/Import/include/FMI2/fmi2_import_variable.h
+126 −126 FMIL/src/Import/include/FMI2/fmi2_import_variable_list.h
+7 −7 FMIL/src/Import/src/FMI/fmi_import_context.c
+42 −42 FMIL/src/Import/src/FMI/fmi_import_context_impl.h
+54 −54 FMIL/src/Import/src/FMI/fmi_import_util.c
+5 −5 FMIL/src/Import/src/FMI1/fmi1_import_capi.c
+55 −55 FMIL/src/Import/src/FMI1/fmi1_import_impl.h
+6 −6 FMIL/src/Import/src/FMI1/fmi1_import_variable.c
+14 −14 FMIL/src/Import/src/FMI2/fmi2_import.c
+26 −26 FMIL/src/Import/src/FMI2/fmi2_import_capi.c
+48 −48 FMIL/src/Import/src/FMI2/fmi2_import_impl.h
+6 −6 FMIL/src/Import/src/FMI2/fmi2_import_variable.c
+11 −11 FMIL/src/Util/include/FMI/fmi_util.h
+8 −8 FMIL/src/Util/include/FMI/fmi_version.h
+53 −53 FMIL/src/Util/include/FMI1/fmi1_enums.h
+121 −121 FMIL/src/Util/include/FMI1/fmi1_functions.h
+66 −66 FMIL/src/Util/include/FMI1/fmi1_types.h
+85 −85 FMIL/src/Util/include/FMI2/fmi2_enums.h
+146 −146 FMIL/src/Util/include/FMI2/fmi2_functions.h
+66 −66 FMIL/src/Util/include/FMI2/fmi2_types.h
+5 −5 FMIL/src/Util/include/JM/jm_callbacks.h
+111 −111 FMIL/src/Util/include/JM/jm_portability.h
+37 −37 FMIL/src/Util/src/FMI/fmi_util.c
+11 −11 FMIL/src/Util/src/FMI/fmi_version.c
+45 −45 FMIL/src/Util/src/FMI1/fmi1_enums.c
+74 −74 FMIL/src/XML/include/FMI/fmi_xml_context.h
+229 −229 FMIL/src/XML/include/FMI1/fmi1_xml_model_description.h
+253 −253 FMIL/src/XML/include/FMI2/fmi2_xml_model_description.h
+16 −16 FMIL/src/XML/include/FMI2/fmi2_xml_model_structure.h
+2 −2 FMIL/src/XML/src/FMI/fmi_xml_context.c
+2 −2 FMIL/src/XML/src/FMI/fmi_xml_context_impl.h
+25 −25 FMIL/src/XML/src/FMI1/fmi1_xml_model_description.c
+1 −1 FMIL/src/XML/src/FMI1/fmi1_xml_query.c
+114 −114 FMIL/src/XML/src/FMI2/fmi2_xml_model_description_impl.h
+2 −2 FMIL/src/XML/src/FMI2/fmi2_xml_parser.c
+7 −7 FMIL/src/XML/src/FMI2/fmi2_xml_parser.h
+1 −1 FMIL/src/XML/src/FMI2/fmi2_xml_query.c
+4 −4 FMIL/src/ZIP/src/fmi_zip_unzip.c
+12 −12 FMIL/src/ZIP/src/fmi_zip_zip.c
+1 −1 Ipopt/Ipopt/src/Algorithm/IpIpoptAlg.cpp
+90 −90 ModelicaExternalC/C-Sources/gconstructor.h
+4 −4 graphstream/Makefile
+71 −71 graphstream/gs-netstream/c++/Makefile
+224 −224 graphstream/gs-netstream/c++/src/netstream-constants.h
+143 −143 graphstream/gs-netstream/c++/src/netstream-main.cpp
+330 −330 graphstream/gs-netstream/c++/src/netstream-sender.cpp
+211 −211 graphstream/gs-netstream/c++/src/netstream-sender.h
+40 −40 graphstream/gs-netstream/c++/src/netstream-sizes.h
+638 −638 graphstream/gs-netstream/c++/src/netstream-socket.cpp
+131 −131 graphstream/gs-netstream/c++/src/netstream-socket.h
+540 −540 graphstream/gs-netstream/c++/src/netstream-storage.cpp
+130 −130 graphstream/gs-netstream/c++/src/netstream-storage.h
30 changes: 11 additions & 19 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -2847,9 +2847,7 @@ algorithm
case (cache,_,"readSimulationResult",{Values.STRING(filename),Values.ARRAY(valueLst=cvars),Values.INTEGER(size)},st,_)
equation
vars_1 = List.map(cvars, ValuesUtil.printCodeVariableName);
pwd = System.pwd();
pd = System.pathDelimiter();
filename_1 = if System.strncmp("/",filename,1)==0 then filename else stringAppendList({pwd,pd,filename});
filename_1 = Util.absoluteOrRelative(filename);
value = ValuesUtil.readDataset(filename_1, vars_1, size);
then
(cache,value,st);
Expand All @@ -2863,16 +2861,14 @@ algorithm
equation
pwd = System.pwd();
pd = System.pathDelimiter();
filename_1 = if System.strncmp("/",filename,1)==0 then filename else stringAppendList({pwd,pd,filename});
filename_1 = Util.absoluteOrRelative(filename);
i = SimulationResults.readSimulationResultSize(filename_1);
then
(cache,Values.INTEGER(i),st);

case (cache,_,"readSimulationResultVars",{Values.STRING(filename),Values.BOOL(b1),Values.BOOL(b2)},st,_)
equation
pwd = System.pwd();
pd = System.pathDelimiter();
filename_1 = if System.strncmp("/",filename,1)==0 then filename else stringAppendList({pwd,pd,filename});
filename_1 = Util.absoluteOrRelative(filename);
args = SimulationResults.readVariables(filename_1, b1, b2);
vals = List.map(args, ValuesUtil.makeString);
v = ValuesUtil.makeArray(vals);
Expand All @@ -2881,12 +2877,10 @@ algorithm

case (cache,_,"compareSimulationResults",{Values.STRING(filename),Values.STRING(filename_1),Values.STRING(filename2),Values.REAL(x1),Values.REAL(x2),Values.ARRAY(valueLst=cvars)},st,_)
equation
pwd = System.pwd();
pd = System.pathDelimiter();
filename = if System.substring(filename,1,1) == "/" then filename else stringAppendList({pwd,pd,filename});
filename = Util.absoluteOrRelative(filename);
filename_1 = Util.testsuiteFriendlyPath(filename_1);
filename_1 = if System.substring(filename_1,1,1) == "/" then filename_1 else stringAppendList({pwd,pd,filename_1});
filename2 = if System.substring(filename2,1,1) == "/" then filename2 else stringAppendList({pwd,pd,filename2});
filename_1 = Util.absoluteOrRelative(filename_1);
filename2 = Util.absoluteOrRelative(filename2);
vars_1 = List.map(cvars, ValuesUtil.extractValueString);
strings = SimulationResults.cmpSimulationResults(Config.getRunningTestsuite(),filename,filename_1,filename2,x1,x2,vars_1);
cvars = List.map(strings,ValuesUtil.makeString);
Expand All @@ -2911,10 +2905,10 @@ algorithm
equation
pwd = System.pwd();
pd = System.pathDelimiter();
filename = if System.substring(filename,1,1) == "/" then filename else stringAppendList({pwd,pd,filename});
filename = Util.absoluteOrRelative(filename);
filename_1 = Util.testsuiteFriendlyPath(filename_1);
filename_1 = if System.substring(filename_1,1,1) == "/" then filename_1 else stringAppendList({pwd,pd,filename_1});
filename2 = if System.substring(filename2,1,1) == "/" then filename2 else stringAppendList({pwd,pd,filename2});
filename_1 = Util.absoluteOrRelative(filename_1);
filename2 = Util.absoluteOrRelative(filename2);
vars_1 = List.map(cvars, ValuesUtil.extractValueString);
(b,strings) = SimulationResults.diffSimulationResults(Config.getRunningTestsuite(),filename,filename_1,filename2,reltol,reltolDiffMinMax,rangeDelta,vars_1,b);
cvars = List.map(strings,ValuesUtil.makeString);
Expand All @@ -2929,11 +2923,9 @@ algorithm

case (cache,_,"diffSimulationResultsHtml",{Values.STRING(str),Values.STRING(filename),Values.STRING(filename_1),Values.REAL(reltol),Values.REAL(reltolDiffMinMax),Values.REAL(rangeDelta)},st,_)
equation
pwd = System.pwd();
pd = System.pathDelimiter();
filename = if System.substring(filename,1,1) == "/" then filename else stringAppendList({pwd,pd,filename});
filename = Util.absoluteOrRelative(filename);
filename_1 = Util.testsuiteFriendlyPath(filename_1);
filename_1 = if System.substring(filename_1,1,1) == "/" then filename_1 else stringAppendList({pwd,pd,filename_1});
filename_1 = Util.absoluteOrRelative(filename_1);
str = SimulationResults.diffSimulationResultsHtml(Config.getRunningTestsuite(),filename,filename_1,reltol,reltolDiffMinMax,rangeDelta,str);
then
(cache,Values.STRING(str),st);
Expand Down
15 changes: 15 additions & 0 deletions Compiler/Util/Util.mo
Expand Up @@ -1751,5 +1751,20 @@ public function anyReturnTrue<T>
output Boolean b = true;
end anyReturnTrue;

public function absoluteOrRelative
"@author: adrpo
returns the given path if it exists if not it considers it relative and returns that"
input String inFileName;
output String outFileName;
protected
String pwd, pd;
algorithm
pwd := System.pwd();
pd := System.pathDelimiter();
outFileName := if System.regularFileExists(inFileName)
then inFileName
else stringAppendList({pwd,pd,inFileName});
end absoluteOrRelative;

annotation(__OpenModelica_Interface="util");
end Util;
38 changes: 18 additions & 20 deletions SimulationRuntime/cpp/Include/Core/SimController/ISimController.h
Expand Up @@ -34,37 +34,33 @@ struct SimSettings
LogType logType;
};

/*SimController to start and stop the simulation*/
/**
* SimController to start and stop the simulation
*/
class ISimController
{

public:
/// Enumeration to control the time integration

virtual ~ISimController() {};
/*
#if defined(__vxworks) || defined(__TRICORE__)
#else
virtual std::pair<boost::shared_ptr<IMixedSystem>,boost::shared_ptr<ISimData> > LoadSystem(boost::shared_ptr<ISimData> (*createSimDataCallback)(), boost::shared_ptr<IMixedSystem> (*createSystemCallback)(IGlobalSettings*, boost::shared_ptr<IAlgLoopSolverFactory>, boost::shared_ptr<ISimData>), string modelKey)=0;
#endif
*/
virtual boost::weak_ptr<IMixedSystem> LoadSystem(string modelLib,string modelKey) = 0;
virtual boost::weak_ptr<IMixedSystem> LoadModelicaSystem(PATH modelica_path,string modelKey) = 0;
virtual boost::weak_ptr<ISimData> LoadSimData(string modelKey) = 0;
/*
/**
Creates SimVars object, stores all model variable in continuous block of memory
@modelKey model name
@dim_real number of all real variables (real algebraic vars,discrete algebraic vars, state vars, der state vars)
@dim_int number of all integer variables integer algebraic vars
@dim_bool number of all bool variables (boolean algebraic vars)
@dim_pre_vars number of all pre variables (real algebraic vars,discrete algebraic vars, boolean algebraic vars, integer algebraic vars, state vars, der state vars)
@dim_z number of all state variables
@z_i start index of state vector in real_vars list
@param model name
@param dim_real number of all real variables (real algebraic vars,discrete algebraic vars, state vars, der state vars)
@param dim_int number of all integer variables integer algebraic vars
@param dim_bool number of all bool variables (boolean algebraic vars)
@param dim_pre_vars number of all pre variables (real algebraic vars,discrete algebraic vars, boolean algebraic vars, integer algebraic vars, state vars, der state vars)
@param dim_z number of all state variables
@param z_i start index of state vector in real_vars list
*/
virtual boost::weak_ptr<ISimVars> LoadSimVars(string modelKey,size_t dim_real,size_t dim_int,size_t dim_bool,size_t dim_pre_vars,size_t dim_z,size_t z_i) = 0;
/*
/**
Starts the simulation
modelKey: Modelica model name
modelica_path: path to Modelica system dll
@param modelKey Modelica model name
@param modelica_path: path to Modelica system dll
*/
virtual void Start(SimSettings simsettings, string modelKey)=0;

Expand All @@ -74,7 +70,9 @@ class ISimController
virtual boost::weak_ptr<IMixedSystem> getSystem(string modelname) = 0;
virtual void calcOneStep() = 0;

/// Stops the simulation
/**
* Stops the simulation
*/
virtual void Stop() = 0;
};
/** @} */ // end of coreSimcontroller
2 changes: 1 addition & 1 deletion common

0 comments on commit 6584fe1

Please sign in to comment.