diff --git a/.gitvalidfiles b/.gitvalidfiles index 37ef097b2..1dc321241 100644 --- a/.gitvalidfiles +++ b/.gitvalidfiles @@ -70,6 +70,7 @@ ./openmodelica/fmi/CoSimulationStandAlone/testedFMU/fmusdk1.0.2/bouncingBall.fmu ./openmodelica/fmi/CoSimulationStandAlone/testedFMU/fmusdk1.0.2/vanDerPol.fmu ./openmodelica/java/dummy_test.c +./openmodelica/xml/testVisRef_visual.xml ./simulation/libraries/3rdParty/DrModelica/ReferenceFiles/ABCDsystem_ref.mat ./simulation/libraries/3rdParty/DrModelica/ReferenceFiles/Activate_ref.mat ./simulation/libraries/3rdParty/DrModelica/ReferenceFiles/AddEmpty_ref.mat diff --git a/openmodelica/xml/Makefile b/openmodelica/xml/Makefile index 4f57c50b1..dd89f0efc 100644 --- a/openmodelica/xml/Makefile +++ b/openmodelica/xml/Makefile @@ -1,6 +1,7 @@ TEST=../../rtest -v TESTFILES=\ +testVis.mos \ XmlDumpComment.mos \ testMSD.mos \ SimpleTriggeredTrapezoid.mos \ @@ -15,7 +16,8 @@ FAILINGTESTFILES= \ DEPENDENCIES = \ *.mo \ *.mos \ -Makefile +Makefile \ +testVisRef_visual.xml CLEAN = `ls | grep -w -v -f deps.tmp` diff --git a/openmodelica/xml/testVis.mo b/openmodelica/xml/testVis.mo new file mode 100644 index 000000000..331866fe5 --- /dev/null +++ b/openmodelica/xml/testVis.mo @@ -0,0 +1,6 @@ +within ; +model testVis + inner Modelica.Mechanics.MultiBody.World world(animateWorld=false) + annotation (Placement(transformation(extent={{-38,18},{-18,38}}))); + annotation (uses(Modelica(version="3.2.1")), Diagram(graphics)); +end testVis; diff --git a/openmodelica/xml/testVis.mos b/openmodelica/xml/testVis.mos new file mode 100644 index 000000000..37b93d94d --- /dev/null +++ b/openmodelica/xml/testVis.mos @@ -0,0 +1,33 @@ +// name: testVis +// keywords: visualization +// status: correct +// A test to check the proper generation of the visualization xml. +// + +loadModel(Modelica,{"3.2.1"}); getErrorString(); + +loadFile("testVis.mo");getErrorString(); +setDebugFlags("visxml"); getErrorString(); +setCommandLineOptions("+n=1"); getErrorString(); +simulate(testVis);getErrorString(); + +compareFiles("testVis_visual.xml","testVisRef_visual.xml");getErrorString(); + +// Result: +// true +// "" +// true +// "" +// true +// "" +// true +// "" +// record SimulationResult +// resultFile = "testVis_res.mat", +// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'testVis', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", +// messages = "" +// end SimulationResult; +// "" +// true +// "" +// endResult diff --git a/openmodelica/xml/testVisRef_visual.xml b/openmodelica/xml/testVisRef_visual.xml new file mode 100644 index 000000000..88848609e --- /dev/null +++ b/openmodelica/xml/testVisRef_visual.xml @@ -0,0 +1,69 @@ + + + + world.gravityArrowLine + cylinder + 1.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + world.gravityArrowLine.r_shape[1] + world.gravityArrowLine.r_shape[2] + world.gravityArrowLine.r_shape[3] + 0.0 + -1.0 + 0.0 + 0.0 + 1.0 + 0.0 + world.gravityArrowLine.length + world.gravityArrowLine.width + world.gravityArrowLine.height + 0.0 + 0.0 + 230.0 + 0.0 + 0.0 + + + world.gravityArrowHead + cone + 1.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + world.gravityArrowHead.r_shape[1] + world.gravityArrowHead.r_shape[2] + world.gravityArrowHead.r_shape[3] + 0.0 + -1.0 + 0.0 + 0.0 + 1.0 + 0.0 + world.gravityArrowHead.length + world.gravityArrowHead.width + world.gravityArrowHead.height + 0.0 + 0.0 + 230.0 + 0.0 + 0.0 + + \ No newline at end of file