Browse Source

instructions

Claudio Gomes 7 years ago
parent
commit
0ae2439c44

+ 37 - 0
examples/mass_spring_damper/fmusdk/.gitignore

@@ -0,0 +1,37 @@
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# Build artifacts
+build/
+temp/
+dist/

+ 11 - 0
examples/mass_spring_damper/fmusdk/.travis.yml

@@ -0,0 +1,11 @@
+language: c
+
+os:
+  - linux
+  - osx
+
+script:
+  - mkdir -p build
+  - cd build
+  - cmake "Unix Makefiles" ..
+  - make

+ 198 - 0
examples/mass_spring_damper/fmusdk/CMakeLists.txt

@@ -0,0 +1,198 @@
+cmake_minimum_required (VERSION 3.2)
+
+FUNCTION(cat IN_FILE OUT_FILE)
+  file(READ ${IN_FILE} CONTENTS)
+  file(APPEND ${OUT_FILE} "${CONTENTS}")
+ENDFUNCTION()
+
+project (FMUSDK)
+
+if (WIN32)
+   set(FMI_PLATFORM win)
+elseif (APPLE)
+   set(FMI_PLATFORM darwin)
+else ()
+   set(FMI_PLATFORM linux)
+endif ()
+
+if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+    set (FMI_PLATFORM ${FMI_PLATFORM}64)
+else ()
+    set (FMI_PLATFORM ${FMI_PLATFORM}32)
+endif ()
+
+MESSAGE("FMI_PLATFORM: " ${FMI_PLATFORM})
+
+# --------------------- FMU models ---------------------
+foreach (FMI_VERSION 10 20)
+foreach (FMI_TYPE cs me)
+foreach (MODEL_NAME bouncingBall dq inc values vanDerPol)
+
+set(TARGET_NAME ${MODEL_NAME}_${FMI_VERSION}_${FMI_TYPE})
+
+add_library(${TARGET_NAME} SHARED fmu${FMI_VERSION}/src/models/${MODEL_NAME}/${MODEL_NAME}.c fmu${FMI_VERSION}/src/models/${MODEL_NAME}/modelDescription_${FMI_TYPE}.xml)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE})
+
+target_compile_definitions(${TARGET_NAME} PRIVATE DISABLE_PREFIX)
+
+if (${FMI_TYPE} MATCHES "cs")
+  target_compile_definitions(${TARGET_NAME} PRIVATE FMI_COSIMULATION)
+endif()
+
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/models")
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/include")
+
+set(FMU_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/temp/fmu${FMI_VERSION}/${FMI_TYPE}/${MODEL_NAME})
+
+set_target_properties(${TARGET_NAME} PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    RUNTIME_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    LIBRARY_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    LIBRARY_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    LIBRARY_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    ARCHIVE_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    ARCHIVE_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+    ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}/binaries/${FMI_PLATFORM}"
+)
+
+set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "")
+set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME ${MODEL_NAME})
+
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+  ${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/models/${MODEL_NAME}/modelDescription_${FMI_TYPE}.xml
+  "${FMU_BUILD_DIR}/modelDescription.xml"
+)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+  "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/models/${MODEL_NAME}/${MODEL_NAME}.c"
+  "${FMU_BUILD_DIR}/sources/${MODEL_NAME}.c"
+)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+  "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/models/fmuTemplate.c"
+  "${FMU_BUILD_DIR}/sources/fmuTemplate.c"
+)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+  "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/models/fmuTemplate.h"
+  "${FMU_BUILD_DIR}/sources/fmuTemplate.h"
+)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE}/${MODEL_NAME}.fmu" --format=zip
+  "modelDescription.xml"
+  "binaries"
+  "sources"
+  WORKING_DIRECTORY ${FMU_BUILD_DIR}
+)
+
+endforeach(MODEL_NAME)
+endforeach(FMI_TYPE)
+endforeach(FMI_VERSION)
+
+# --------------------- FMU simulators ---------------------
+foreach (FMI_VERSION 10 20)
+foreach (FMI_TYPE cs me)
+set(TARGET_NAME fmusim_${FMI_VERSION}_${FMI_TYPE})
+
+if (${FMI_TYPE} STREQUAL "cs")
+  set(SIM_TYPE co_simulation)
+else ()
+  set(SIM_TYPE model_exchange)
+endif ()
+
+set(SRCS
+  "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/sim_support.c"
+  "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/xmlVersionParser.c")
+
+if (${FMI_VERSION} EQUAL 10)
+  set(SRCS ${SRCS}
+    "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/stack.c"
+    "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/xml_parser.c")
+else ()
+  set(SRCS ${SRCS}
+    "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/XmlElement.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/XmlParser.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/XmlParserCApi.cpp")
+endif ()
+
+add_executable(${TARGET_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/${SIM_TYPE}/main.c" ${SRCS})
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE})
+
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/${SIM_TYPE}")
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared")
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/include")
+target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser")
+
+if (${FMI_TYPE} STREQUAL "cs")
+  target_compile_definitions(${TARGET_NAME} PRIVATE FMI_COSIMULATION)
+endif ()
+target_compile_definitions(${TARGET_NAME} PRIVATE STANDALONE_XML_PARSER)
+target_compile_definitions(${TARGET_NAME} PRIVATE LIBXML_STATIC)
+
+if (WIN32)
+  set(TARGET_OUTPUT_NAME "${TARGET_NAME}.exe")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+  set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+  set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+
+  target_link_libraries (${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/${FMI_PLATFORM}/libxml2.lib")
+  if (${FMI_VERSION} EQUAL 10)
+    target_link_libraries (${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/fmu${FMI_VERSION}/src/shared/parser/${FMI_PLATFORM}/libexpatMT.lib")
+  endif ()
+else ()
+  set(TARGET_OUTPUT_NAME "${TARGET_NAME}")
+  target_link_libraries (${TARGET_NAME} PRIVATE "dl")
+  target_link_libraries (${TARGET_NAME} PRIVATE "xml2")
+  target_link_libraries (${TARGET_NAME} PRIVATE "expat")
+endif ()
+
+
+set(FMU_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/temp/fmu${FMI_VERSION}/${FMI_TYPE})
+
+set_target_properties(${TARGET_NAME} PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}"
+    RUNTIME_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}"
+    RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}"
+    LIBRARY_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}"
+    LIBRARY_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}"
+    LIBRARY_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}"
+    ARCHIVE_OUTPUT_DIRECTORY         "${FMU_BUILD_DIR}"
+    ARCHIVE_OUTPUT_DIRECTORY_DEBUG   "${FMU_BUILD_DIR}"
+    ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${FMU_BUILD_DIR}"
+)
+
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+  "${FMU_BUILD_DIR}/${TARGET_OUTPUT_NAME}"
+  "${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE}/"
+)
+
+endforeach(FMI_TYPE)
+endforeach(FMI_VERSION)
+
+# --------------------- test simulators and models ---------------------
+enable_testing()
+foreach (FMI_VERSION 10 20)
+foreach (FMI_TYPE cs me)
+foreach (MODEL_NAME bouncingBall dq inc values vanDerPol)
+
+set(FMU_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/temp/fmu${FMI_VERSION}/${FMI_TYPE})
+set(TEST_NAME test_${MODEL_NAME}_${FMI_VERSION}_${FMI_TYPE})
+
+add_test(NAME ${TEST_NAME}
+	COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE}/fmusim_${FMI_VERSION}_${FMI_TYPE}"
+			"${CMAKE_CURRENT_SOURCE_DIR}/dist/fmu${FMI_VERSION}/${FMI_TYPE}/${MODEL_NAME}.fmu"
+	WORKING_DIRECTORY "${FMU_BUILD_DIR}/${MODEL_NAME}"
+)
+set_tests_properties(${TEST_NAME} PROPERTIES ENVIRONMENT FMUSDK_HOME=${CMAKE_CURRENT_SOURCE_DIR})
+ 
+endforeach(MODEL_NAME)
+endforeach(FMI_TYPE)
+endforeach(FMI_VERSION)
+

+ 183 - 0
examples/mass_spring_damper/fmusdk/CONTRIBUTING.md

@@ -0,0 +1,183 @@
+# Contributing to this project
+
+Please take a moment to review this document in order to make the contribution
+process easy and effective for everyone involved.
+
+Following these guidelines helps to communicate that you respect the time of
+the developers managing and developing this open source project. In return,
+they should reciprocate that respect in addressing your issue or assessing
+patches and features.
+
+
+## Using the issue tracker
+
+The issue tracker is the preferred channel for [bug reports](#bugs),
+[features requests](#features) and [submitting pull
+requests](#pull-requests), but please respect the following restrictions:
+
+* Please **do not** use the issue tracker for personal support requests (use
+  [Stack Overflow](http://stackoverflow.com) or IRC).
+
+* Please **do not** derail or troll issues. Keep the discussion on topic and
+  respect the opinions of others.
+
+
+## Bug reports
+
+A bug is a _demonstrable problem_ that is caused by the code in the repository.
+Good bug reports are extremely helpful - thank you!
+
+Guidelines for bug reports:
+
+1. **Use the GitHub issue search** — check if the issue has already been
+   reported.
+
+2. **Check if the issue has been fixed** — try to reproduce it using the
+   latest `master` or development branch in the repository.
+
+3. **Isolate the problem** — create a reduced test
+   case or example.
+
+A good bug report shouldn't leave others needing to chase you up for more
+information. Please try to be as detailed as possible in your report. What is
+your environment? What steps will reproduce the issue? What browser(s) and OS
+experience the problem? What would you expect to be the outcome? All these
+details will help people to fix any potential bugs.
+
+Example:
+
+> Short and descriptive example bug report title
+>
+> A summary of the issue and the platform/OS environment in which it occurs. If
+> suitable, include the steps required to reproduce the bug.
+>
+> 1. This is the first step
+> 2. This is the second step
+> 3. Further steps, etc.
+>
+> `<url>` - a link to the reduced test case
+>
+> Any other information you want to share that is relevant to the issue being
+> reported. This might include the lines of code that you have identified as
+> causing the bug, and potential solutions (and your opinions on their
+> merits).
+
+
+## Feature requests
+
+Feature requests are welcome. But take a moment to find out whether your idea
+fits with the scope and aims of the project. It's up to *you* to make a strong
+case to convince the project's developers of the merits of this feature. Please
+provide as much detail and context as possible.
+
+
+## Commit messages
+
+Please follow [the seven rules of a great Git commit message](https://chris.beams.io/posts/git-commit/) when committing your changes:
+
+- Separate subject from body with a blank line
+- Limit the subject line to 50 characters
+- Capitalize the subject line
+- Do not end the subject line with a period
+- Use the imperative mood in the subject line
+- Wrap the body at 72 characters
+- Use the body to explain what and why vs. how
+
+For example:
+
+```
+Summarize changes in around 50 characters or less
+
+More detailed explanatory text, if necessary. Wrap it to about 72
+characters or so. In some contexts, the first line is treated as the
+subject of the commit and the rest of the text as the body. The
+blank line separating the summary from the body is critical (unless
+you omit the body entirely); various tools like `log`, `shortlog`
+and `rebase` can get confused if you run the two together.
+
+Explain the problem that this commit is solving. Focus on why you
+are making this change as opposed to how (the code explains that).
+Are there side effects or other unintuitive consequences of this
+change? Here's the place to explain them.
+
+Further paragraphs come after blank lines.
+
+ - Bullet points are okay, too
+
+ - Typically a hyphen or asterisk is used for the bullet, preceded
+   by a single space, with blank lines in between, but conventions
+   vary here
+
+If you use an issue tracker, put references to them at the bottom,
+like this:
+
+Resolves: #123
+See also: #456, #789
+```
+
+## Pull requests
+
+Good pull requests - patches, improvements, new features - are a fantastic
+help. They should remain focused in scope and avoid containing unrelated
+commits.
+
+**Please ask first** before embarking on any significant pull request (e.g.
+implementing features, refactoring code, porting to a different language),
+otherwise you risk spending a lot of time working on something that the
+project's developers might not want to merge into the project.
+
+Please adhere to the coding conventions used throughout a project (indentation,
+accurate comments, etc.) and any other requirements (such as test coverage).
+
+Follow this process if you'd like your work considered for inclusion in the
+project:
+
+1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
+   and configure the remotes:
+
+   ```bash
+   # Clone your fork of the repo into the current directory
+   git clone https://github.com/<your-username>/<repo-name>
+   # Navigate to the newly cloned directory
+   cd <repo-name>
+   # Assign the original repo to a remote called "upstream"
+   git remote add upstream https://github.com/<upstream-owner>/<repo-name>
+   ```
+
+2. If you cloned a while ago, get the latest changes from upstream:
+
+   ```bash
+   git checkout <dev-branch>
+   git pull upstream <dev-branch>
+   ```
+
+3. Create a new topic branch (off the main project development branch) to
+   contain your feature, change, or fix:
+
+   ```bash
+   git checkout -b <topic-branch-name>
+   ```
+
+4. Commit your changes in logical chunks. Please adhere to these [git commit
+   message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+   or your code is unlikely be merged into the main project. Use Git's
+   [interactive rebase](https://help.github.com/articles/interactive-rebase)
+   feature to tidy up your commits before making them public.
+
+5. Locally merge (or rebase) the upstream development branch into your topic branch:
+
+   ```bash
+   git pull [--rebase] upstream <dev-branch>
+   ```
+
+6. Push your topic branch up to your fork:
+
+   ```bash
+   git push origin <topic-branch-name>
+   ```
+
+7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
+    with a clear title and description.
+
+**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
+license your work under the same [license](../LICENSE.md) as that used by the project.

+ 25 - 0
examples/mass_spring_damper/fmusdk/LICENSE.md

@@ -0,0 +1,25 @@
+# FMU SDK License
+
+Copyright (c) 2008-2018, QTronic GmbH. All rights reserved.
+The FMU SDK is licensed by the copyright holder under the [2-Clause BSD License](https://www.opensource.org/licenses/bsd-license.html):
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+  
+- Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY QTRONIC GMBH "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL QTRONIC GMBH BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 73 - 0
examples/mass_spring_damper/fmusdk/Makefile

@@ -0,0 +1,73 @@
+all:
+	(cd fmu10; $(MAKE))
+	(cd fmu20; $(MAKE))
+
+clean:
+	(cd fmu10; $(MAKE) clean)
+	(cd fmu20; $(MAKE) clean)
+
+distclean: clean
+	rm -f fmu10/bin/fmusim_cs* fmu10/bin/fmusim_me*
+	rm -f fmu20/bin/fmusim_cs* fmu20/bin/fmusim_me*
+	rm -rf fmu10/fmu
+	rm -rf fmu20/fmu
+	rm -rf fmuTmp* 
+	rm -f *.csv
+	find . -name "*~" -exec rm {} \;
+	find . -name "#*~" -exec rm {} \;
+
+run_all: run_all_fmu10 run_all_fmu20
+
+# Run all the fmu10 fmus.  Args are from run_all.bat
+run_all_fmu10:
+	fmu10/bin/fmusim_me fmu10/fmu/me/bouncingBall.fmu 4 0.01 0 c
+	mv result.csv result_me10_bouncingBall.csv
+	fmu10/bin/fmusim_cs fmu10/fmu/cs/bouncingBall.fmu 4 0.01 0 c
+	mv result.csv result_cs10_bouncingBall.csv
+	#
+	fmu10/bin/fmusim_me fmu10/fmu/me/vanDerPol.fmu 5 0.1 0 c
+	mv result.csv result_me10_vanDerPol.csv
+	fmu10/bin/fmusim_cs fmu10/fmu/cs/vanDerPol.fmu 5 0.1 0 c
+	mv result.csv result_cs10_vanDerPol.csv
+	#
+	fmu10/bin/fmusim_me fmu10/fmu/me/dq.fmu 1 0.1 0 c
+	mv result.csv result_me10_dq.csv
+	fmu10/bin/fmusim_cs fmu10/fmu/cs/dq.fmu 1 0.1 0 c
+	mv result.csv result_cs10_dq.csv
+	#
+	fmu10/bin/fmusim_me fmu10/fmu/me/inc.fmu 15 0.1 0 c
+	mv result.csv result_me10_inc.csv
+	fmu10/bin/fmusim_cs fmu10/fmu/cs/inc.fmu 15 0.1 0 c
+	mv result.csv result_cs10_inc.csv
+	#
+	fmu10/bin/fmusim_me fmu10/fmu/me/values.fmu 12 0.1 0 c
+	mv result.csv result_me10_values.csv
+	fmu10/bin/fmusim_cs fmu10/fmu/cs/values.fmu 12 0.1 0 c
+	mv result.csv result_cs10_values.csv
+
+# Run all the fmu20 fmus.  Args are from run_all.bat
+run_all_fmu20:
+	fmu20/bin/fmusim_me fmu20/fmu/me/bouncingBall.fmu 4 0.01 0 c
+	mv result.csv result_me20_bouncingBall.csv
+	fmu20/bin/fmusim_cs fmu20/fmu/cs/bouncingBall.fmu 4 0.01 0 c
+	mv result.csv result_cs20_bouncingBall.csv
+	#
+	fmu20/bin/fmusim_me fmu20/fmu/me/vanDerPol.fmu 5 0.1 0 c
+	mv result.csv result_me20_vanDerPol.csv
+	fmu20/bin/fmusim_cs fmu20/fmu/cs/vanDerPol.fmu 5 0.1 0 c
+	mv result.csv result_cs20_vanDerPol.csv
+	#
+	fmu20/bin/fmusim_me fmu20/fmu/me/dq.fmu 1 0.1 0 c
+	mv result.csv result_me20_dq.csv
+	fmu20/bin/fmusim_cs fmu20/fmu/cs/dq.fmu 1 0.1 0 c
+	mv result.csv result_cs20_dq.csv
+	#
+	fmu20/bin/fmusim_me fmu20/fmu/me/inc.fmu 15 0.1 0 c
+	mv result.csv result_me20_inc.csv
+	fmu20/bin/fmusim_cs fmu20/fmu/cs/inc.fmu 15 0.1 0 c
+	mv result.csv result_cs20_inc.csv
+	#
+	fmu20/bin/fmusim_me fmu20/fmu/me/values.fmu 12 0.1 0 c
+	mv result.csv result_me20_values.csv
+	fmu20/bin/fmusim_cs fmu20/fmu/cs/values.fmu 12 0.1 0 c
+	mv result.csv result_cs20_values.csv

File diff suppressed because it is too large
+ 193 - 0
examples/mass_spring_damper/fmusdk/README.md


+ 16 - 0
examples/mass_spring_damper/fmusdk/appveyor.yml

@@ -0,0 +1,16 @@
+clone_folder: c:\projects\fmusdk
+
+image:
+  - Visual Studio 2015
+
+before_build:
+  - cmd: |-
+      mkdir build
+      cd build
+      cmake -G "Visual Studio 14 2015 Win64" ..
+
+build:
+  project: c:\projects\fmusdk\build\FMUSDK.sln
+
+artifacts:
+  - path: dist

+ 39 - 0
examples/mass_spring_damper/fmusdk/fmusim.bat

@@ -0,0 +1,39 @@
+@echo off 
+rem ------------------------------------------------------------
+rem To run a simulation, start this batch in this directory. 
+rem Example: fmusim me10 fmu10/fmu/me/win32/dq.fmu 0.3 0.1 1 c
+rem Example: fmusim cs20 fmu20/fmu/cs/win64/dq.fmu 0.3 0.1 1 c -win64
+rem To build simulators and FMUs, run install.bat
+rem Copyright QTronic GmbH. All rights reserved.
+rem ------------------------------------------------------------
+
+setlocal
+set FMUSDK_HOME=.
+
+rem first parameter is the type of FMI simulation to run
+set SIM_TYPE=%1
+
+rem get all command line argument after the %1
+set SIM_OPTIONS=
+
+rem if not speficied them win32
+set FMI_PLATFORM=win32
+
+rem shift all arguments down by one
+SHIFT
+:loop1
+if "%1"=="-win64" (set FMI_PLATFORM=win64) else (
+  if "%1"=="" goto after_loop
+  set SIM_OPTIONS=%SIM_OPTIONS% %1
+)
+shift
+goto loop1
+
+:after_loop
+if %SIM_TYPE%==me10 (fmu10\bin\%FMI_PLATFORM%\fmusim_me.exe %SIM_OPTIONS%
+) else (if %SIM_TYPE%==cs10 (fmu10\bin\%FMI_PLATFORM%\fmusim_cs.exe %SIM_OPTIONS%
+) else (if %SIM_TYPE%==me20 (fmu20\bin\%FMI_PLATFORM%\fmusim_me.exe %SIM_OPTIONS%
+) else (if %SIM_TYPE%==cs20 (fmu20\bin\%FMI_PLATFORM%\fmusim_cs.exe %SIM_OPTIONS%
+) else (echo Use one of cs10 cs20 me10 me20 as first argument))))
+
+endlocal

+ 24 - 0
examples/mass_spring_damper/fmusdk/install.bat

@@ -0,0 +1,24 @@
+@echo off 
+
+rem ------------------------------------------------------------
+rem This batch builds all simulators and FMUs of the FmuSDK20
+rem for Windows platforms
+rem Command to build 32 bit version: install
+rem Commant to build 64 bit version: install -win64
+rem Copyright QTronic GmbH. All rights reserved.
+rem ------------------------------------------------------------
+
+echo -----------------------------------------------------------
+echo Making the simulators and models for FMI 1.0 of the FmuSDK ...
+pushd fmu10\src
+call build_all %1
+popd
+
+echo -----------------------------------------------------------
+echo Making the simulators and models for FMI 2.0 of the FmuSDK ...
+pushd fmu20\src
+call build_all %1
+popd
+
+rem keep window visible for user
+pause

+ 107 - 0
examples/mass_spring_damper/fmusdk/run_all.bat

@@ -0,0 +1,107 @@
+@echo off 
+
+rem ------------------------------------------------------------
+rem This batch runs all FMUs of the FmuSDK and stores simulation
+rem results in CSV files, one file per simulation run.
+rem Command to run the 32 bit version: run_all
+rem Command to run the 64 bit version: run_all -win64
+rem Copyright QTronic GmbH. All rights reserved.
+rem ------------------------------------------------------------
+
+setlocal
+if "%1"=="-win64" (
+set FMI_PLATFORM=win64
+) else (
+set FMI_PLATFORM=win32
+)
+
+echo -----------------------------------------------------------
+echo Running all FMUs 1.0 of the FmuSDK ...
+
+echo -----------------------------------------------------------
+call fmusim me10 fmu10\fmu\me\%FMI_PLATFORM%\bouncingBall.fmu 4 0.01 0 c %1
+move /Y result.csv result_me10%FMI_PLATFORM%_bouncingBall.csv
+
+echo -----------------------------------------------------------
+call fmusim cs10 fmu10\fmu\cs\%FMI_PLATFORM%\bouncingBall.fmu 4 0.01 0 c %1
+move /Y result.csv result_cs10%FMI_PLATFORM%_bouncingBall.csv
+
+echo -----------------------------------------------------------
+call fmusim me10 fmu10\fmu\me\%FMI_PLATFORM%\vanDerPol.fmu 5 0.1 0 c %1
+move /Y result.csv result_me10%FMI_PLATFORM%_vanDerPol.csv
+
+echo -----------------------------------------------------------
+call fmusim cs10 fmu10\fmu\cs\%FMI_PLATFORM%\vanDerPol.fmu 5 0.1 0 c %1
+move /Y result.csv result_cs10%FMI_PLATFORM%_vanDerPol.csv
+
+echo -----------------------------------------------------------
+call fmusim me10 fmu10\fmu\me\%FMI_PLATFORM%\dq.fmu 1 0.1 0 c %1
+move /Y result.csv result_me10%FMI_PLATFORM%_dq.csv
+
+echo -----------------------------------------------------------
+call fmusim cs10 fmu10\fmu\cs\%FMI_PLATFORM%\dq.fmu 1 0.1 0 c %1
+move /Y result.csv result_cs10%FMI_PLATFORM%_dq.csv
+
+echo -----------------------------------------------------------
+call fmusim me10 fmu10\fmu\me\%FMI_PLATFORM%\inc.fmu 15 0.1 0 c %1
+move /Y result.csv result_me10%FMI_PLATFORM%_inc.csv
+
+echo -----------------------------------------------------------
+call fmusim cs10 fmu10\fmu\cs\%FMI_PLATFORM%\inc.fmu 15 0.1 0 c %1
+move /Y result.csv result_cs10%FMI_PLATFORM%_inc.csv
+
+echo -----------------------------------------------------------
+call fmusim me10 fmu10\fmu\me\%FMI_PLATFORM%\values.fmu 12 0.1 0 c %1
+move /Y result.csv result_me10%FMI_PLATFORM%_values.csv
+
+echo -----------------------------------------------------------
+call fmusim cs10 fmu10\fmu\cs\%FMI_PLATFORM%\values.fmu 12 0.1 0 c %1
+move /Y result.csv result_cs10%FMI_PLATFORM%_values.csv
+
+echo -----------------------------------------------------------
+echo Running all FMUs 2.0 of the FmuSDK ...
+
+echo -----------------------------------------------------------
+call fmusim me20 fmu20\fmu\me\%FMI_PLATFORM%\bouncingBall.fmu 4 0.01 0 c %1
+move /Y result.csv result_me20%FMI_PLATFORM%_bouncingBall.csv
+
+echo -----------------------------------------------------------
+call fmusim cs20 fmu20\fmu\cs\%FMI_PLATFORM%\bouncingBall.fmu 4 0.01 0 c %1
+move /Y result.csv result_cs20%FMI_PLATFORM%_bouncingBall.csv
+
+echo -----------------------------------------------------------
+call fmusim me20 fmu20\fmu\me\%FMI_PLATFORM%\vanDerPol.fmu 5 0.1 0 c %1
+move /Y result.csv result_me20%FMI_PLATFORM%_vanDerPol.csv
+
+echo -----------------------------------------------------------
+call fmusim cs20 fmu20\fmu\cs\%FMI_PLATFORM%\vanDerPol.fmu 5 0.1 0 c %1
+move /Y result.csv result_cs20%FMI_PLATFORM%_vanDerPol.csv
+
+echo -----------------------------------------------------------
+call fmusim me20 fmu20\fmu\me\%FMI_PLATFORM%\dq.fmu 1 0.1 0 c %1
+move /Y result.csv result_me20%FMI_PLATFORM%_dq.csv
+
+echo -----------------------------------------------------------
+call fmusim cs20 fmu20\fmu\cs\%FMI_PLATFORM%\dq.fmu 1 0.1 0 c %1
+move /Y result.csv result_cs20%FMI_PLATFORM%_dq.csv
+
+echo -----------------------------------------------------------
+call fmusim me20 fmu20\fmu\me\%FMI_PLATFORM%\inc.fmu 15 0.1 0 c %1
+move /Y result.csv result_me20%FMI_PLATFORM%_inc.csv
+
+echo -----------------------------------------------------------
+call fmusim cs20 fmu20\fmu\cs\%FMI_PLATFORM%\inc.fmu 15 0.1 0 c %1
+move /Y result.csv result_cs20%FMI_PLATFORM%_inc.csv
+
+echo -----------------------------------------------------------
+call fmusim me20 fmu20\fmu\me\%FMI_PLATFORM%\values.fmu 12 0.1 0 c %1
+move /Y result.csv result_me20%FMI_PLATFORM%_values.csv
+
+echo -----------------------------------------------------------
+call fmusim cs20 fmu20\fmu\cs\%FMI_PLATFORM%\values.fmu 12 0.1 0 c %1
+move /Y result.csv result_cs20%FMI_PLATFORM%_values.csv
+
+endlocal
+
+rem keep window visible for user
+pause

+ 6 - 0
examples/mass_spring_damper/instructions.md

@@ -0,0 +1,6 @@
+# Installing FMU SDK
+
+1. Download MS Visual Studio 2015 community
+   1. You might need to subscribe to some stuff.
+1. When installing, go via custom installation, and select only `Visual Studio 2015 Update 3`.
+