Skip to content

Instantly share code, notes, and snippets.

@tasosxak
Last active January 17, 2022 19:51
Show Gist options
  • Save tasosxak/5aca0a0208d1dee9d732513f17570d7a to your computer and use it in GitHub Desktop.
Save tasosxak/5aca0a0208d1dee9d732513f17570d7a to your computer and use it in GitHub Desktop.
#include "Deploy.hpp"
#include <Launcher.hpp>
#include <fmi2Functions.h>
#include <fmi2FunctionTypes.h>
#include <Variables.hpp>
/*
* The "static" includes (the one we use inconditionnaly)
*/
int main(int argc, char **argv) {
int ret = EXIT_SUCCESS;
// deploy the system corresponding to the root component
//Component &component = *deploy(argc, argv);
// create an engine launcher
//Launcher launcher(argc, argv, component);
void * c = fmi2Instantiate("prModel", fmi2CoSimulation , "prModel", "resource/location", NULL, true, true);
inverted_map[112] = "ROOT.a._id__i";
const unsigned int vr[] = {112};
const int values[] = {0};
fmi2SetInteger(c, vr, 1, values);
fmi2Integer values2[] = {0};
// initialize the launcher (components, etc.)
//ret = launcher.initialize();
fmi2EnterInitializationMode(c);
int i=0;
while(i<10){
i++;
fmi2GetInteger(c, vr, 1, values2);
fmi2DoStep(c, 0.5,0.6, true);}
// run the engine
/*if (ret == EXIT_SUCCESS) {
//ret = launcher.launch();
while(1){
fmi2DoStep(c, 0.5,0.6, true);
}
}*/
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment