The core types and functions of the SciNim ecosystem
scinim / fmu.nim Goto Github PK
View Code? Open in Web Editor NEWcreate your own multiplatform FMU (Functional Mock-up Interface) models with Nim
License: MIT License
create your own multiplatform FMU (Functional Mock-up Interface) models with Nim
License: MIT License
The file modelDescription.xml
:
<?xml version="1.0" encoding="UTF-8" ?>
<fmiModelDescription guid="{8c4e810f-3df3-4a00-8276-176fa3c9f008}"
numberOfEventIndicators="0"
modelName="inc"
fmiVersion="2.0">
<ModelExchange modelIdentifier="inc">
<SourceFiles>
<File name="inc.c" />
</SourceFiles>
</ModelExchange>
<LogCategories>
<Category name="logAll" />
<Category name="logError" />
<Category name="logFmiCall" />
<Category name="logEvent" />
</LogCategories>
<ModelVariables>
<ScalarVariable variability="discrete"
valueReference="0"
description="counts the seconds"
causality="output"
initial="exact"
name="counter">
<Integer start="1" />
</ScalarVariable>
</ModelVariables>
<ModelStructure>
<Outputs>
<Unknown index="1" />
</Outputs>
</ModelStructure>
</fmiModelDescription>
This is used in C compilation. For nim, we should tweak the exportc
.
Currently it is hardcoded the reference to index.html.
Make it more flexible.
Co-simulation is not yet supported
Create the XML file using Nim.
Create the folder structure using Nim rather than resusing the structure created by fmusdk
Create the build process in Nim, instead of depending on the build.sh
file
It would be great being able to create multiplatform FMU's using zig for compilation.
The symbol is hardcoded here.
Using OMEdit
you can import the model. Later you can instantiate it in a new model. The simulation raises:
Fallo en el proceso
[INFO][inc] [logFmiCall][FMU status:OK] fmi2Instantiate: GUID={8c4e810f-3df3-4a00-8276-176fa3c9f008} SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Fallo en el proceso Simulation process failed. Exited with code 11.
Convert the includes into imports, in order to make it behave more like a library.
When the model is instantiated, componentEnvironment
is passed by the simulation environment ħere as we can see in the this type declaration: fmi2CallbackFunctions.
The issue is clear when tested by fmuChecked.linux64
:
[ERROR][FMUCHK] FMU logger callback does not propagate component environment to the application
The issue is that, for some reason, functions.componentEnvironment == nil
in fmi2Instantiate
.
The reference to the source code is hard coded. It should be optional.
This error is reported by fmuCheck.linux64
. The issue seems to be here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.