Skip to content

Commit

Permalink
Enable working testcase StringParameters (#3292)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Aug 4, 2015
1 parent 7d07b6b commit 3b6fb38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
15 changes: 8 additions & 7 deletions openmodelica/fmi/ModelExchange/1.0/Makefile
Expand Up @@ -18,8 +18,9 @@ TanksConnectedPI.mos \
CoupledClutches.mos \
BooleanNetwork1.mos \
IntegerNetwork1.mos \
StringParameters.mos

# test that currently fail. Move up when fixed.
# test that currently fail. Move up when fixed.
# Run make testfailing
FAILINGTESTFILES= \

Expand All @@ -42,8 +43,8 @@ test:
@echo
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
@$(TEST) $(TESTFILES)
# Cleans all files that are not listed as dependencies

# Cleans all files that are not listed as dependencies
clean :
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@rm -f $(CLEAN)
Expand All @@ -52,11 +53,11 @@ clean :
# do it after cleaning and updating the folder
# then you can get a list of file names (which must be dependencies
# since you got them from repository + your own new files)
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo Dependency list saved in deps.txt.
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES

Expand Down
17 changes: 7 additions & 10 deletions openmodelica/fmi/ModelExchange/1.0/StringParameters.mos
Expand Up @@ -9,10 +9,7 @@ loadFile("StringParameters.mo"); getErrorString();
translateModelFMU(StringParameters); getErrorString();
importFMU("StringParameters.fmu"); getErrorString();
loadFile("StringParameters_me_FMU.mo"); getErrorString();
simulate(StringParameters_me_FMU, stopTime=3.0); getErrorString();
val(ball,0);
val(ball,1);
val(ball,3);
simulate(StringParameters_me_FMU, stopTime=3.0, simflags="-output=sball,eball"); getErrorString();

// Result:
// true
Expand All @@ -28,11 +25,11 @@ val(ball,3);
// ""
// record SimulationResult
// resultFile = "StringParameters_me_FMU_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'StringParameters_me_FMU', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'StringParameters_me_FMU', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-output=sball,eball'",
// messages = "time=3,sball=\"RedBall\",eball=\"BlueBall\"
// "
// end SimulationResult;
// ""
// 1.0
// 0.2250205572103477
// -0.9555203906613871
// "[openmodelica/fmi/ModelExchange/1.0/StringParameters_me_FMU.mo:14:3-14:55:writable] Warning: Parameter eball has no value, and is fixed during initialization (fixed=true), using available start value (start="BlueBall") as default value.
// [openmodelica/fmi/ModelExchange/1.0/StringParameters_me_FMU.mo:15:3-15:54:writable] Warning: Parameter sball has no value, and is fixed during initialization (fixed=true), using available start value (start="RedBall") as default value.
// "
// endResult
8 changes: 2 additions & 6 deletions simulation/modelica/others/ComplexFun.mos
Expand Up @@ -39,7 +39,7 @@ val(x,{0.0,0.1,0.2,0.7,1.0});
getErrorString();

simulate(problem2);
getErrorString();
getErrorString() == "";

val(y,{0.0,0.1,0.2,0.7,1.0});
getErrorString();
Expand Down Expand Up @@ -112,11 +112,7 @@ getErrorString();
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "Failed to build model: problem2"
// end SimulationResult;
// "[CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f1.z
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f5.z
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f1.z
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f5.z
// "
// false
// {0.0,-0.07207592200561265,-0.08240453183331929,-0.04555334217802521,8.980666631940483e-19}
// ""
// true
Expand Down

0 comments on commit 3b6fb38

Please sign in to comment.