Skip to content

Instantly share code, notes, and snippets.

View sjoelund's full-sized avatar

Martin Sjölund sjoelund

View GitHub Profile
@sjoelund
sjoelund / AdvancedNoise 1.0.0.diff
Last active July 2, 2021 08:56
OpenModelica conversion script 2021-04-26
diff -ur "/home/martin/.openmodelica/libraries/AdvancedNoise 1.0.0/Examples/InterpolateRandomNumbers.mo" "converted-libraries/AdvancedNoise 1.0.0/Examples/InterpolateRandomNumbers.mo"
--- "/home/martin/.openmodelica/libraries/AdvancedNoise 1.0.0/Examples/InterpolateRandomNumbers.mo" 2021-03-15 12:05:59.791863741 +0100
+++ "converted-libraries/AdvancedNoise 1.0.0/Examples/InterpolateRandomNumbers.mo" 2021-04-26 11:50:28.062565134 +0200
@@ -3,7 +3,7 @@
"Interpolate random numbers with the various interpolators"
extends Modelica.Icons.Example;
- parameter Modelica.SIunits.Time samplePeriod = 1.0
+ parameter Modelica.Units.SI.Time samplePeriod = 1.0
"Sample period for the generation of random numbers";
/*
* Converted Flat Modelica equation code to SCODE Congra format for:
* 'EMPHYSIS_TestCases.M04_DrivetrainTorqueControl.PlantModels.PlantForInversion'
* Generation Date: 2020-12-04T19:14:42.082449900
*/
package PlantForInversion;
@flows(F_Inverted_PlantForInversion)
system sys_PlantForInversion (@ description("(42): public input Real 'M_m';") @ geo(146, 504)
record R2
Integer i[:];
end R2;
record R
R2 r;
end R;
function f
output R2 r;
class VehicleInterfaces.Drivers.MinimalDriver "Constant acceleration Driver"
VehicleInterfaces.Mechanics.NormalisedRotational.Interfaces.Flange driverInterface.steeringWheel "virtual variable in expandable connector";
VehicleInterfaces.Mechanics.NormalisedTranslational.Interfaces.Flange driverInterface.acceleratorPedal "virtual variable in expandable connector";
VehicleInterfaces.Mechanics.NormalisedTranslational.Interfaces.Flange driverInterface.brakePedal "virtual variable in expandable connector";
Integer driverInterface.ignition "virtual variable in expandable connector";
Integer driverInterface.requestedGear "virtual variable in expandable connector";
Integer driverInterface.gearboxMode "virtual variable in expandable connector";
parameter Real initialAccelRequest(min = 0.0, max = 1.0) = 1.0 "Initial accelerator pedal position";
parameter Real initialBrakeRequest(min = 0.0, max = 1.0) = 0.0 "Initial brake pedal position";
parameter Real finalAccelRequest(min = 0.0, max = 1.0) = 1.0 "Fin
Classes not tested
==================
Modelica.Blocks.Interfaces.Adaptors.ReceiveBoolean
Modelica.Blocks.Interfaces.Adaptors.ReceiveInteger
Modelica.Blocks.Interfaces.Adaptors.ReceiveReal
Modelica.Blocks.Interfaces.Adaptors.SendBoolean
Modelica.Blocks.Interfaces.Adaptors.SendInteger
Modelica.Blocks.Interfaces.Adaptors.SendReal
Modelica.Blocks.Interfaces.BlockIcon
Modelica.Blocks.Interfaces.BooleanBlockIcon
import OMPython
omc = OMPython.OMCSessionZMQ()
assert(omc.sendExpression("loadModel(ModelicaTest)"))
assert(omc.sendExpression('setCommandLineOptions("-g=MetaModelica")'))
experiments = omc.sendExpression("list(cl for cl guard isExperiment(cl) in getClassNames(recursive=true))")
assert(omc.sendExpression('setCommandLineOptions("-g=Modelica -d=newInst")'))
s = ""
i = 1
for e in experiments:
<video style="width:100%" controls>
<source src="https://github.com/modelica/ModelicaSpecification/files/2732222/dymola_omedit.mp4.log" type="video/mp4">
Your browser does not support the video tag.
</video>
@sjoelund
sjoelund / osmc-pl-1.2.md
Last active October 5, 2023 10:33
OSMC-PL 1.2 License and Contributor Agreement

By making a contribution to this repository, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the OSMC-PL 1.2 license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the OSMC-PL 1.2 license; or

(yakkety-i386)root@builds:~# g++ -c -O2 -O2 -w -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WEBKITWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include -isystem /usr/include/i386-linux-gnu/qt5 -isystem /usr/include/i386-linux-gnu/qt5/QtPrintSupport -isystem /usr/include/i386-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/i386-linux-gnu/qt5/QtWidgets -isystem /usr/include/i386-linux-gnu/qt5/QtWebKit -isystem /usr/include/i386-linux-gnu/qt5/QtGui -isystem /usr/include/i386-linux-gnu/qt5/QtXml -isystem /usr/include/i386-linux-gnu/qt5/QtNetwork -isystem /usr/include/i386-linux-gnu/qt5/QtCore -I../generatedfiles/moc -I/usr/lib/i386-linux-gnu/qt5/mkspecs/linux-g++ b.cpp
In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
from /usr/include/c++/6/algorithm:62,
from b.cpp:1:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
model M
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2}), graphics = {Bitmap(origin = {-49, -5}, extent = {{-51, 39}, {149, 11}}, imageSource = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB3aWR0aD0iOTgzLjI4Njk5IgogICBoZWlnaHQ9IjEzMS45NjgiCiAgIGlkPSJzdmcyIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlua3NjYXBlOnZlcnNpb249IjAuNDguNCByOTkzOSIKICAgc