-
Notifications
You must be signed in to change notification settings - Fork 0
/
OMSimulator_omc.c
1122 lines (969 loc) · 37.3 KB
/
OMSimulator_omc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <stdio.h>
#include <stdbool.h>
#include "settingsimpl.h"
#include "meta_modelica.h"
#include "ModelicaUtilities.h"
#include "omc_config.h"
#if defined WIN32
#include <windows.h>
static HINSTANCE OMSimulatorDLL = NULL;
#define AddressOf GetProcAddress
#define freeDLL FreeLibrary
#else
#include <dlfcn.h>
static void * OMSimulatorDLL = NULL;
#define AddressOf dlsym
#define freeDLL dlclose
#endif
typedef int (*fnptr_oms_addBus)(const char*);
static fnptr_oms_addBus oms_addBus = NULL;
typedef int (*fnptr_oms_addConnection)(const char*,const char*);
static fnptr_oms_addConnection oms_addConnection = NULL;
typedef int (*fnptr_oms_addConnector)(const char*,int,int);
static fnptr_oms_addConnector oms_addConnector = NULL;
typedef int (*fnptr_oms_addConnectorToBus)(const char*,const char*);
static fnptr_oms_addConnectorToBus oms_addConnectorToBus = NULL;
typedef int (*fnptr_oms_addConnectorToTLMBus)(const char*,const char*,const char*);
static fnptr_oms_addConnectorToTLMBus oms_addConnectorToTLMBus = NULL;
typedef int (*fnptr_oms_addDynamicValueIndicator)(const char*,const char*,const char*,double);
static fnptr_oms_addDynamicValueIndicator oms_addDynamicValueIndicator = NULL;
typedef int (*fnptr_oms_addEventIndicator)(const char*);
static fnptr_oms_addEventIndicator oms_addEventIndicator = NULL;
typedef int (*fnptr_oms_addExternalModel)(const char*,const char*,const char*);
static fnptr_oms_addExternalModel oms_addExternalModel = NULL;
typedef int (*fnptr_oms_addSignalsToResults)(const char*,const char*);
static fnptr_oms_addSignalsToResults oms_addSignalsToResults = NULL;
typedef int (*fnptr_oms_addStaticValueIndicator)(const char*,double,double,double);
static fnptr_oms_addStaticValueIndicator oms_addStaticValueIndicator = NULL;
typedef int (*fnptr_oms_addSubModel)(const char*,const char*);
static fnptr_oms_addSubModel oms_addSubModel = NULL;
typedef int (*fnptr_oms_addSystem)(const char*,int);
static fnptr_oms_addSystem oms_addSystem = NULL;
typedef int (*fnptr_oms_addTimeIndicator)(const char*);
static fnptr_oms_addTimeIndicator oms_addTimeIndicator = NULL;
typedef int (*fnptr_oms_addTLMBus)(const char*,int,const int,const oms_tlm_interpolation_t);
static fnptr_oms_addTLMBus oms_addTLMBus = NULL;
typedef int (*fnptr_oms_addTLMConnection)(const char*,const char*,double,double,double,double);
static fnptr_oms_addTLMConnection oms_addTLMConnection = NULL;
typedef int (*fnptr_oms_cancelSimulation_asynchronous)(const char*);
static fnptr_oms_cancelSimulation_asynchronous oms_cancelSimulation_asynchronous = NULL;
typedef int (*fnptr_oms_compareSimulationResults)(const char*,const char*,const char*,double,double);
static fnptr_oms_compareSimulationResults oms_compareSimulationResults = NULL;
typedef int (*fnptr_oms_copySystem)(const char*,const char*);
static fnptr_oms_copySystem oms_copySystem = NULL;
typedef int (*fnptr_oms_delete)(const char*);
static fnptr_oms_delete oms_delete = NULL;
typedef int (*fnptr_oms_deleteConnection)(const char*,const char*);
static fnptr_oms_deleteConnection oms_deleteConnection = NULL;
typedef int (*fnptr_oms_deleteConnectorFromBus)(const char*,const char*);
static fnptr_oms_deleteConnectorFromBus oms_deleteConnectorFromBus = NULL;
typedef int (*fnptr_oms_deleteConnectorFromTLMBus)(const char*,const char*);
static fnptr_oms_deleteConnectorFromTLMBus oms_deleteConnectorFromTLMBus = NULL;
typedef int (*fnptr_oms_export)(const char*,const char*);
static fnptr_oms_export oms_export = NULL;
typedef int (*fnptr_oms_exportDependencyGraphs)(const char*,const char*,const char*);
static fnptr_oms_exportDependencyGraphs oms_exportDependencyGraphs = NULL;
typedef int (*fnptr_oms_extractFMIKind)(const char*,int);
static fnptr_oms_extractFMIKind oms_extractFMIKind = NULL;
typedef int (*fnptr_oms_getBoolean)(const char*,bool*);
static fnptr_oms_getBoolean oms_getBoolean = NULL;
typedef int (*fnptr_oms_getFixedStepSize)(const char*,double*);
static fnptr_oms_getFixedStepSize oms_getFixedStepSize = NULL;
typedef int (*fnptr_oms_getInteger)(const char*,int*);
static fnptr_oms_getInteger oms_getInteger = NULL;
typedef int (*fnptr_oms_getModelState)(const char*,oms_modelState_enu_t*);
static fnptr_oms_getModelState oms_getModelState = NULL;
typedef int (*fnptr_oms_getReal)(const char*,double*);
static fnptr_oms_getReal oms_getReal = NULL;
typedef int (*fnptr_oms_getSolver)(const char*,oms_solver_enu_t*);
static fnptr_oms_getSolver oms_getSolver = NULL;
typedef int (*fnptr_oms_getStartTime)(const char*,double*);
static fnptr_oms_getStartTime oms_getStartTime = NULL;
typedef int (*fnptr_oms_getStopTime)(const char*,double*);
static fnptr_oms_getStopTime oms_getStopTime = NULL;
typedef int (*fnptr_oms_getSubModelPath)(const char*,char**);
static fnptr_oms_getSubModelPath oms_getSubModelPath = NULL;
typedef int (*fnptr_oms_getSystemType)(const char*,oms_system_enu_t*);
static fnptr_oms_getSystemType oms_getSystemType = NULL;
typedef int (*fnptr_oms_getTolerance)(const char*,double*,double*);
static fnptr_oms_getTolerance oms_getTolerance = NULL;
typedef int (*fnptr_oms_getVariableStepSize)(const char*,double*,double*,double*);
static fnptr_oms_getVariableStepSize oms_getVariableStepSize = NULL;
typedef int (*fnptr_oms_faultInjection)(const char*,int,double);
static fnptr_oms_faultInjection oms_faultInjection = NULL;
typedef int (*fnptr_oms_importFile)(const char*,char**);
static fnptr_oms_importFile oms_importFile = NULL;
typedef int (*fnptr_oms_initialize)(const char*);
static fnptr_oms_initialize oms_initialize = NULL;
typedef int (*fnptr_oms_instantiate)(const char*);
static fnptr_oms_instantiate oms_instantiate = NULL;
typedef int (*fnptr_oms_list)(const char*,char**);
static fnptr_oms_list oms_list = NULL;
typedef int (*fnptr_oms_listUnconnectedConnectors)(const char*,char**);
static fnptr_oms_listUnconnectedConnectors oms_listUnconnectedConnectors = NULL;
typedef int (*fnptr_oms_loadSnapshot)(const char*,const char*);
static fnptr_oms_loadSnapshot oms_loadSnapshot = NULL;
typedef int (*fnptr_oms_newModel)(const char*);
static fnptr_oms_newModel oms_newModel = NULL;
typedef int (*fnptr_oms_parseModelName)(const char*,char**);
static fnptr_oms_parseModelName oms_parseModelName = NULL;
typedef int (*fnptr_oms_removeSignalsFromResults)(const char*,const char*);
static fnptr_oms_removeSignalsFromResults oms_removeSignalsFromResults = NULL;
typedef int (*fnptr_oms_rename)(const char*,const char*);
static fnptr_oms_rename oms_rename = NULL;
typedef int (*fnptr_oms_reset)(const char*);
static fnptr_oms_reset oms_reset = NULL;
typedef int (*fnptr_oms_RunFile)(const char*);
static fnptr_oms_RunFile oms_RunFile = NULL;
typedef int (*fnptr_oms_setBoolean)(const char*,bool);
static fnptr_oms_setBoolean oms_setBoolean = NULL;
typedef int (*fnptr_oms_setCommandLineOption)(const char*);
static fnptr_oms_setCommandLineOption oms_setCommandLineOption = NULL;
typedef int (*fnptr_oms_setFixedStepSize)(const char*,double);
static fnptr_oms_setFixedStepSize oms_setFixedStepSize = NULL;
typedef int (*fnptr_oms_setInteger)(const char*,int);
static fnptr_oms_setInteger oms_setInteger = NULL;
typedef int (*fnptr_oms_setLogFile)(const char*);
static fnptr_oms_setLogFile oms_setLogFile = NULL;
typedef int (*fnptr_oms_setLoggingInterval)(const char*,double);
static fnptr_oms_setLoggingInterval oms_setLoggingInterval = NULL;
typedef int (*fnptr_oms_setLoggingLevel)(int);
static fnptr_oms_setLoggingLevel oms_setLoggingLevel = NULL;
typedef int (*fnptr_oms_setReal)(const char*,double);
static fnptr_oms_setReal oms_setReal = NULL;
typedef int (*fnptr_oms_setRealInputDerivative)(const char*,double);
static fnptr_oms_setRealInputDerivative oms_setRealInputDerivative = NULL;
typedef int (*fnptr_oms_setResultFile)(const char*,const char*,int);
static fnptr_oms_setResultFile oms_setResultFile = NULL;
typedef int (*fnptr_oms_setSignalFilter)(const char*,const char*);
static fnptr_oms_setSignalFilter oms_setSignalFilter = NULL;
typedef int (*fnptr_oms_setSolver)(const char*,int);
static fnptr_oms_setSolver oms_setSolver = NULL;
typedef int (*fnptr_oms_setStartTime)(const char*,double);
static fnptr_oms_setStartTime oms_setStartTime = NULL;
typedef int (*fnptr_oms_setStopTime)(const char*,double);
static fnptr_oms_setStopTime oms_setStopTime = NULL;
typedef int (*fnptr_oms_setTempDirectory)(const char*);
static fnptr_oms_setTempDirectory oms_setTempDirectory = NULL;
typedef int (*fnptr_oms_setTLMPositionAndOrientation)(const char*,double,double,double,double,double,double,double,double,double,double,double,double);
static fnptr_oms_setTLMPositionAndOrientation oms_setTLMPositionAndOrientation = NULL;
typedef int (*fnptr_oms_setTLMSocketData)(const char*,const char*,int,int);
static fnptr_oms_setTLMSocketData oms_setTLMSocketData = NULL;
typedef int (*fnptr_oms_setTolerance)(const char*,double,double);
static fnptr_oms_setTolerance oms_setTolerance = NULL;
typedef int (*fnptr_oms_setVariableStepSize)(const char*,double,double,double);
static fnptr_oms_setVariableStepSize oms_setVariableStepSize = NULL;
typedef int (*fnptr_oms_setWorkingDirectory)(const char*);
static fnptr_oms_setWorkingDirectory oms_setWorkingDirectory = NULL;
typedef int (*fnptr_oms_simulate)(const char*);
static fnptr_oms_simulate oms_simulate = NULL;
typedef int (*fnptr_oms_stepUntil)(const char*,double);
static fnptr_oms_stepUntil oms_stepUntil = NULL;
typedef int (*fnptr_oms_terminate)(const char*);
static fnptr_oms_terminate oms_terminate = NULL;
void resolveFunctionNames()
{
oms_addBus = (fnptr_oms_addBus)AddressOf(OMSimulatorDLL, "oms_addBus");
oms_addConnection = (fnptr_oms_addConnection)AddressOf(OMSimulatorDLL, "oms_addConnection");
oms_addConnector = (fnptr_oms_addConnector)AddressOf(OMSimulatorDLL, "oms_addConnector");
oms_addConnectorToBus = (fnptr_oms_addConnectorToBus)AddressOf(OMSimulatorDLL, "oms_addConnectorToBus");
oms_addConnectorToTLMBus = (fnptr_oms_addConnectorToTLMBus)AddressOf(OMSimulatorDLL, "oms_addConnectorToTLMBus");
oms_addDynamicValueIndicator = (fnptr_oms_addDynamicValueIndicator)AddressOf(OMSimulatorDLL, "oms_addDynamicValueIndicator");
oms_addEventIndicator = (fnptr_oms_addEventIndicator)AddressOf(OMSimulatorDLL, "oms_addEventIndicator");
oms_addExternalModel = (fnptr_oms_addExternalModel)AddressOf(OMSimulatorDLL, "oms_addExternalModel");
oms_addSignalsToResults = (fnptr_oms_addSignalsToResults)AddressOf(OMSimulatorDLL, "oms_addSignalsToResults");
oms_addStaticValueIndicator = (fnptr_oms_addStaticValueIndicator)AddressOf(OMSimulatorDLL, "oms_addStaticValueIndicator");
oms_addSubModel = (fnptr_oms_addSubModel)AddressOf(OMSimulatorDLL, "oms_addSubModel");
oms_addSystem = (fnptr_oms_addSystem)AddressOf(OMSimulatorDLL, "oms_addSystem");
oms_addTimeIndicator = (fnptr_oms_addTimeIndicator)AddressOf(OMSimulatorDLL, "oms_addTimeIndicator");
oms_addTLMBus = (fnptr_oms_addTLMBus)AddressOf(OMSimulatorDLL, "oms_addTLMBus");
oms_addTLMConnection = (fnptr_oms_addTLMConnection)AddressOf(OMSimulatorDLL, "oms_addTLMConnection");
oms_cancelSimulation_asynchronous = (fnptr_oms_cancelSimulation_asynchronous)AddressOf(OMSimulatorDLL, "oms_cancelSimulation_asynchronous");
oms_compareSimulationResults = (fnptr_oms_compareSimulationResults)AddressOf(OMSimulatorDLL, "oms_compareSimulationResults");
oms_copySystem = (fnptr_oms_copySystem)AddressOf(OMSimulatorDLL, "oms_copySystem");
oms_delete = (fnptr_oms_delete)AddressOf(OMSimulatorDLL, "oms_delete");
oms_deleteConnection = (fnptr_oms_deleteConnection)AddressOf(OMSimulatorDLL, "oms_deleteConnection");
oms_deleteConnectorFromBus = (fnptr_oms_deleteConnectorFromBus)AddressOf(OMSimulatorDLL, "oms_deleteConnectorFromBus");
oms_deleteConnectorFromTLMBus = (fnptr_oms_deleteConnectorFromTLMBus)AddressOf(OMSimulatorDLL, "oms_deleteConnectorFromTLMBus");
oms_export = (fnptr_oms_export)AddressOf(OMSimulatorDLL, "oms_export");
oms_exportDependencyGraphs = (fnptr_oms_exportDependencyGraphs)AddressOf(OMSimulatorDLL, "oms_exportDependencyGraphs");
oms_extractFMIKind = (fnptr_oms_extractFMIKind)AddressOf(OMSimulatorDLL, "oms_extractFMIKind");
oms_getBoolean = (fnptr_oms_getBoolean)AddressOf(OMSimulatorDLL, "oms_getBoolean");
oms_getFixedStepSize = (fnptr_oms_getFixedStepSize)AddressOf(OMSimulatorDLL, "oms_getFixedStepSize");
oms_getInteger = (fnptr_oms_getInteger)AddressOf(OMSimulatorDLL, "oms_getInteger");
oms_getModelState = (fnptr_oms_getModelState)AddressOf(OMSimulatorDLL, "oms_getModelState");
oms_getReal = (fnptr_oms_getReal)AddressOf(OMSimulatorDLL, "oms_getReal");
oms_getSolver = (fnptr_oms_getSolver)AddressOf(OMSimulatorDLL, "oms_getSolver");
oms_getStartTime = (fnptr_oms_getStartTime)AddressOf(OMSimulatorDLL, "oms_getStartTime");
oms_getStopTime = (fnptr_oms_getStopTime)AddressOf(OMSimulatorDLL, "oms_getStopTime");
oms_getSubModelPath = (fnptr_oms_getSubModelPath)AddressOf(OMSimulatorDLL, "oms_getSubModelPath");
oms_getSystemType = (fnptr_oms_getSystemType)AddressOf(OMSimulatorDLL, "oms_getSystemType");
oms_getTolerance = (fnptr_oms_getTolerance)AddressOf(OMSimulatorDLL, "oms_getTolerance");
oms_getVariableStepSize = (fnptr_oms_getVariableStepSize)AddressOf(OMSimulatorDLL, "oms_getVariableStepSize");
oms_faultInjection = (fnptr_oms_faultInjection)AddressOf(OMSimulatorDLL, "oms_faultInjection");
oms_importFile = (fnptr_oms_importFile)AddressOf(OMSimulatorDLL, "oms_importFile");
oms_initialize = (fnptr_oms_initialize)AddressOf(OMSimulatorDLL, "oms_initialize");
oms_instantiate = (fnptr_oms_instantiate)AddressOf(OMSimulatorDLL, "oms_instantiate");
oms_list = (fnptr_oms_list)AddressOf(OMSimulatorDLL, "oms_list");
oms_listUnconnectedConnectors = (fnptr_oms_listUnconnectedConnectors)AddressOf(OMSimulatorDLL, "oms_listUnconnectedConnectors");
oms_loadSnapshot = (fnptr_oms_loadSnapshot)AddressOf(OMSimulatorDLL, "oms_loadSnapshot");
oms_newModel = (fnptr_oms_newModel)AddressOf(OMSimulatorDLL, "oms_newModel");
oms_parseModelName = (fnptr_oms_parseModelName)AddressOf(OMSimulatorDLL, "oms_parseModelName");
oms_removeSignalsFromResults = (fnptr_oms_removeSignalsFromResults)AddressOf(OMSimulatorDLL, "oms_removeSignalsFromResults");
oms_rename = (fnptr_oms_rename)AddressOf(OMSimulatorDLL, "oms_rename");
oms_reset = (fnptr_oms_reset)AddressOf(OMSimulatorDLL, "oms_reset");
oms_RunFile = (fnptr_oms_RunFile)AddressOf(OMSimulatorDLL, "oms_RunFile");
oms_setBoolean = (fnptr_oms_setBoolean)AddressOf(OMSimulatorDLL, "oms_setBoolean");
oms_setCommandLineOption = (fnptr_oms_setCommandLineOption)AddressOf(OMSimulatorDLL, "oms_setCommandLineOption");
oms_setFixedStepSize = (fnptr_oms_setFixedStepSize)AddressOf(OMSimulatorDLL, "oms_setFixedStepSize");
oms_setInteger = (fnptr_oms_setInteger)AddressOf(OMSimulatorDLL, "oms_setInteger");
oms_setLogFile = (fnptr_oms_setLogFile)AddressOf(OMSimulatorDLL, "oms_setLogFile");
oms_setLoggingInterval = (fnptr_oms_setLoggingInterval)AddressOf(OMSimulatorDLL, "oms_setLoggingInterval");
oms_setLoggingLevel = (fnptr_oms_setLoggingLevel)AddressOf(OMSimulatorDLL, "oms_setLoggingLevel");
oms_setReal = (fnptr_oms_setReal)AddressOf(OMSimulatorDLL, "oms_setReal");
oms_setRealInputDerivative = (fnptr_oms_setRealInputDerivative)AddressOf(OMSimulatorDLL, "oms_setRealInputDerivative");
oms_setResultFile = (fnptr_oms_setResultFile)AddressOf(OMSimulatorDLL, "oms_setResultFile");
oms_setSignalFilter = (fnptr_oms_setSignalFilter)AddressOf(OMSimulatorDLL, "oms_setSignalFilter");
oms_setSolver = (fnptr_oms_setSolver)AddressOf(OMSimulatorDLL, "oms_setSolver");
oms_setStartTime = (fnptr_oms_setStartTime)AddressOf(OMSimulatorDLL, "oms_setStartTime");
oms_setStopTime = (fnptr_oms_setStopTime)AddressOf(OMSimulatorDLL, "oms_setStopTime");
oms_setTempDirectory = (fnptr_oms_setTempDirectory)AddressOf(OMSimulatorDLL, "oms_setTempDirectory");
oms_setTLMPositionAndOrientation = (fnptr_oms_setTLMPositionAndOrientation)AddressOf(OMSimulatorDLL, "oms_setTLMPositionAndOrientation");
oms_setTLMSocketData = (fnptr_oms_setTLMSocketData)AddressOf(OMSimulatorDLL, "oms_setTLMSocketData");
oms_setTolerance = (fnptr_oms_setTolerance)AddressOf(OMSimulatorDLL, "oms_setTolerance");
oms_setVariableStepSize = (fnptr_oms_setVariableStepSize)AddressOf(OMSimulatorDLL, "oms_setVariableStepSize");
oms_setWorkingDirectory = (fnptr_oms_setWorkingDirectory)AddressOf(OMSimulatorDLL, "oms_setWorkingDirectory");
oms_simulate = (fnptr_oms_simulate)AddressOf(OMSimulatorDLL, "oms_simulate");
oms_stepUntil = (fnptr_oms_stepUntil)AddressOf(OMSimulatorDLL, "oms_stepUntil");
oms_terminate = (fnptr_oms_terminate)AddressOf(OMSimulatorDLL, "oms_terminate");
}
extern const int OMSimulator_oms_addBus(const char* cref)
{
if(!oms_addBus)
{
printf("Could not Locate the Function oms_addBus\n");
exit(0);
}
int status = oms_addBus(cref);
return status;
}
extern const int OMSimulator_oms_addConnection(const char* crefA, const char* crefB)
{
if(!oms_addConnection)
{
printf("Could not Locate the Function oms_addConnection\n");
exit(0);
}
int status = oms_addConnection(crefA,crefB);
return status;
}
extern const int OMSimulator_oms_addConnector(const char* cref, int causality, int type)
{
if(!oms_addConnector)
{
printf("Could not Locate the Function oms_addConnector\n");
exit(0);
}
int status = oms_addConnector(cref,causality,type);
return status;
}
extern const int OMSimulator_oms_addConnectorToBus(const char* busCref, const char* connectorCref)
{
if(!oms_addConnectorToBus)
{
printf("Could not Locate the Function oms_addConnectorToBus\n");
exit(0);
}
int status = oms_addConnectorToBus(busCref,connectorCref);
return status;
}
extern const int OMSimulator_oms_addConnectorToTLMBus(const char* busCref, const char* connectorCref, const char* type)
{
if(!oms_addConnectorToTLMBus)
{
printf("Could not Locate the Function oms_addConnectorToTLMBus\n");
exit(0);
}
int status = oms_addConnectorToTLMBus(busCref,connectorCref,type);
return status;
}
extern const int OMSimulator_oms_addDynamicValueIndicator(const char* signal, const char* lower, const char* upper, double stepSize)
{
if(!oms_addDynamicValueIndicator)
{
printf("Could not Locate the Function oms_addDynamicValueIndicator\n");
exit(0);
}
int status = oms_addDynamicValueIndicator(signal,lower,upper,stepSize);
return status;
}
extern const int OMSimulator_oms_addEventIndicator(const char* signal)
{
if(!oms_addEventIndicator)
{
printf("Could not Locate the Function oms_addEventIndicator\n");
exit(0);
}
int status = oms_addEventIndicator(signal);
return status;
}
extern const int OMSimulator_oms_addExternalModel(const char* cref, const char* path, const char* startscript)
{
if(!oms_addExternalModel)
{
printf("Could not Locate the Function oms_addExternalModel\n");
exit(0);
}
int status = oms_addExternalModel(cref,path,startscript);
return status;
}
extern const int OMSimulator_oms_addSignalsToResults(const char* cref, const char* regex)
{
if(!oms_addSignalsToResults)
{
printf("Could not Locate the Function oms_addSignalsToResults\n");
exit(0);
}
int status = oms_addSignalsToResults(cref,regex);
return status;
}
extern const int OMSimulator_oms_addStaticValueIndicator(const char* signal, double lower, double upper, double stepSize)
{
if(!oms_addStaticValueIndicator)
{
printf("Could not Locate the Function oms_addStaticValueIndicator\n");
exit(0);
}
int status = oms_addStaticValueIndicator(signal,lower,upper,stepSize);
return status;
}
extern const int OMSimulator_oms_addSubModel(const char* cref, const char* fmuPath)
{
if(!oms_addSubModel)
{
printf("Could not Locate the Function oms_addSubModel\n");
exit(0);
}
int status = oms_addSubModel(cref,fmuPath);
return status;
}
extern const int OMSimulator_oms_addSystem(const char* cref, int type)
{
if(!oms_addSystem)
{
printf("Could not Locate the Function oms_addSystem\n");
exit(0);
}
int status = oms_addSystem(cref,type);
return status;
}
extern const int OMSimulator_oms_addTimeIndicator(const char* signal)
{
if(!oms_addTimeIndicator)
{
printf("Could not Locate the Function oms_addTimeIndicator\n");
exit(0);
}
int status = oms_addTimeIndicator(signal);
return status;
}
extern const int OMSimulator_oms_addTLMBus(const char* cref, int domain, const int dimensions, const oms_tlm_interpolation_t interpolation)
{
if(!oms_addTLMBus)
{
printf("Could not Locate the Function oms_addTLMBus\n");
exit(0);
}
int status = oms_addTLMBus(cref,domain,dimensions,interpolation);
return status;
}
extern const int OMSimulator_oms_addTLMConnection(const char* crefA, const char* crefB, double delay, double alpha, double linearimpedance, double angularimpedance)
{
if(!oms_addTLMConnection)
{
printf("Could not Locate the Function oms_addTLMConnection\n");
exit(0);
}
int status = oms_addTLMConnection(crefA,crefB,delay,alpha,linearimpedance,angularimpedance);
return status;
}
extern const int OMSimulator_oms_cancelSimulation_asynchronous(const char* cref)
{
if(!oms_cancelSimulation_asynchronous)
{
printf("Could not Locate the Function oms_cancelSimulation_asynchronous\n");
exit(0);
}
int status = oms_cancelSimulation_asynchronous(cref);
return status;
}
extern const int OMSimulator_oms_compareSimulationResults(const char* filenameA, const char* filenameB, const char* var, double relTol, double absTol)
{
if(!oms_compareSimulationResults)
{
printf("Could not Locate the Function oms_compareSimulationResults\n");
exit(0);
}
int status = oms_compareSimulationResults(filenameA,filenameB,var,relTol,absTol);
return status;
}
extern const int OMSimulator_oms_copySystem(const char* source, const char* target)
{
if(!oms_copySystem)
{
printf("Could not Locate the Function oms_copySystem\n");
exit(0);
}
int status = oms_copySystem(source,target);
return status;
}
extern const int OMSimulator_oms_delete(const char* cref)
{
if(!oms_delete)
{
printf("Could not Locate the Function oms_delete\n");
exit(0);
}
int status = oms_delete(cref);
return status;
}
extern const int OMSimulator_oms_deleteConnection(const char* crefA, const char* crefB)
{
if(!oms_deleteConnection)
{
printf("Could not Locate the Function oms_deleteConnection\n");
exit(0);
}
int status = oms_deleteConnection(crefA,crefB);
return status;
}
extern const int OMSimulator_oms_deleteConnectorFromBus(const char* busCref, const char* connectorCref)
{
if(!oms_deleteConnectorFromBus)
{
printf("Could not Locate the Function oms_deleteConnectorFromBus\n");
exit(0);
}
int status = oms_deleteConnectorFromBus(busCref,connectorCref);
return status;
}
extern const int OMSimulator_oms_deleteConnectorFromTLMBus(const char* busCref, const char* connectorCref)
{
if(!oms_deleteConnectorFromTLMBus)
{
printf("Could not Locate the Function oms_deleteConnectorFromTLMBus\n");
exit(0);
}
int status = oms_deleteConnectorFromTLMBus(busCref,connectorCref);
return status;
}
extern const int OMSimulator_oms_export(const char* cref, const char* filename)
{
if(!oms_export)
{
printf("Could not Locate the Function oms_export\n");
exit(0);
}
int status = oms_export(cref,filename);
return status;
}
extern const int OMSimulator_oms_exportDependencyGraphs(const char* cref, const char* initialization, const char* simulation)
{
if(!oms_exportDependencyGraphs)
{
printf("Could not Locate the Function oms_exportDependencyGraphs\n");
exit(0);
}
int status = oms_exportDependencyGraphs(cref,initialization,simulation);
return status;
}
extern const int OMSimulator_oms_extractFMIKind(const char* filename, int kind)
{
if(!oms_extractFMIKind)
{
printf("Could not Locate the Function oms_extractFMIKind\n");
exit(0);
}
int status = oms_extractFMIKind(filename,kind);
return status;
}
extern const int OMSimulator_oms_getBoolean(const char* cref, bool* value)
{
if(!oms_getBoolean)
{
printf("Could not Locate the Function oms_getBoolean\n");
exit(0);
}
int status = oms_getBoolean(cref,value);
return status;
}
extern const int OMSimulator_oms_getFixedStepSize(const char* cref, double* stepSize)
{
if(!oms_getFixedStepSize)
{
printf("Could not Locate the Function oms_getFixedStepSize\n");
exit(0);
}
int status = oms_getFixedStepSize(cref,stepSize);
return status;
}
extern const int OMSimulator_oms_getInteger(const char* cref, int* value)
{
if(!oms_getInteger)
{
printf("Could not Locate the Function oms_getInteger\n");
exit(0);
}
int status = oms_getInteger(cref,value);
return status;
}
extern const int OMSimulator_oms_getModelState(const char* cref, oms_modelState_enu_t* modelState)
{
if(!oms_getModelState)
{
printf("Could not Locate the Function oms_getModelState\n");
exit(0);
}
int status = oms_getModelState(cref,modelState);
return status;
}
extern const int OMSimulator_oms_getReal(const char* cref, double* value)
{
if(!oms_getReal)
{
printf("Could not Locate the Function oms_getReal\n");
exit(0);
}
int status = oms_getReal(cref,value);
return status;
}
extern const int OMSimulator_oms_getSolver(const char* cref, oms_solver_enu_t* solver)
{
if(!oms_getSolver)
{
printf("Could not Locate the Function oms_getSolver\n");
exit(0);
}
int status = oms_getSolver(cref,solver);
return status;
}
extern const int OMSimulator_oms_getStartTime(const char* cref, double* startTime)
{
if(!oms_getStartTime)
{
printf("Could not Locate the Function oms_getStartTime\n");
exit(0);
}
int status = oms_getStartTime(cref,startTime);
return status;
}
extern const int OMSimulator_oms_getStopTime(const char* cref, double* stopTime)
{
if(!oms_getStopTime)
{
printf("Could not Locate the Function oms_getStopTime\n");
exit(0);
}
int status = oms_getStopTime(cref,stopTime);
return status;
}
extern const int OMSimulator_oms_getSubModelPath(const char* cref, char** path)
{
if(!oms_getSubModelPath)
{
printf("Could not Locate the Function oms_getSubModelPath\n");
exit(0);
}
int status = oms_getSubModelPath(cref,path);
return status;
}
extern const int OMSimulator_oms_getSystemType(const char* cref, oms_system_enu_t* type)
{
if(!oms_getSystemType)
{
printf("Could not Locate the Function oms_getSystemType\n");
exit(0);
}
int status = oms_getSystemType(cref,type);
return status;
}
extern const int OMSimulator_oms_getTolerance(const char* cref, double* absoluteTolerance, double* relativeTolerance)
{
if(!oms_getTolerance)
{
printf("Could not Locate the Function oms_getTolerance\n");
exit(0);
}
int status = oms_getTolerance(cref,absoluteTolerance,relativeTolerance);
return status;
}
extern const int OMSimulator_oms_getVariableStepSize(const char* cref, double* initialStepSize, double* minimumStepSize, double* maximumStepSize)
{
if(!oms_getVariableStepSize)
{
printf("Could not Locate the Function oms_getVariableStepSize\n");
exit(0);
}
int status = oms_getVariableStepSize(cref,initialStepSize,minimumStepSize,maximumStepSize);
return status;
}
extern const int OMSimulator_oms_faultInjection(const char* signal, int faultType, double faultValue)
{
if(!oms_faultInjection)
{
printf("Could not Locate the Function oms_faultInjection\n");
exit(0);
}
int status = oms_faultInjection(signal,faultType,faultValue);
return status;
}
extern const int OMSimulator_oms_importFile(const char* filename, char** cref)
{
if(!oms_importFile)
{
printf("Could not Locate the Function oms_importFile\n");
exit(0);
}
int status = oms_importFile(filename,cref);
return status;
}
extern const int OMSimulator_oms_initialize(const char* cref)
{
if(!oms_initialize)
{
printf("Could not Locate the Function oms_initialize\n");
exit(0);
}
int status = oms_initialize(cref);
return status;
}
extern const int OMSimulator_oms_instantiate(const char* cref)
{
if(!oms_instantiate)
{
printf("Could not Locate the Function oms_instantiate\n");
exit(0);
}
int status = oms_instantiate(cref);
return status;
}
extern const int OMSimulator_oms_list(const char* cref, char** contents)
{
if(!oms_list)
{
printf("Could not Locate the Function oms_list\n");
exit(0);
}
int status = oms_list(cref,contents);
return status;
}
extern const int OMSimulator_oms_listUnconnectedConnectors(const char* cref, char** contents)
{
if(!oms_listUnconnectedConnectors)
{
printf("Could not Locate the Function oms_listUnconnectedConnectors\n");
exit(0);
}
int status = oms_listUnconnectedConnectors(cref,contents);
return status;
}
extern const int OMSimulator_oms_loadSnapshot(const char* cref, const char* snapshot)
{
if(!oms_loadSnapshot)
{
printf("Could not Locate the Function oms_loadSnapshot\n");
exit(0);
}
int status = oms_loadSnapshot(cref,snapshot);
return status;
}
extern const int OMSimulator_oms_newModel(const char* cref)
{
if(!oms_newModel)
{
printf("Could not Locate the Function oms_newModel\n");
exit(0);
}
int status = oms_newModel(cref);
return status;
}
extern const int OMSimulator_oms_parseModelName(const char* contents, char** cref)
{
if(!oms_parseModelName)
{
printf("Could not Locate the Function oms_parseModelName\n");
exit(0);
}
int status = oms_parseModelName(contents,cref);
return status;
}
extern const int OMSimulator_oms_removeSignalsFromResults(const char* cref, const char* regex)
{
if(!oms_removeSignalsFromResults)
{
printf("Could not Locate the Function oms_removeSignalsFromResults\n");
exit(0);
}
int status = oms_removeSignalsFromResults(cref,regex);
return status;
}
extern const int OMSimulator_oms_rename(const char* cref, const char* newCref)
{
if(!oms_rename)
{
printf("Could not Locate the Function oms_rename\n");
exit(0);
}
int status = oms_rename(cref,newCref);
return status;
}
extern const int OMSimulator_oms_reset(const char* cref)
{
if(!oms_reset)
{
printf("Could not Locate the Function oms_reset\n");
exit(0);
}
int status = oms_reset(cref);
return status;
}
extern const int OMSimulator_oms_RunFile(const char* filename)
{
if(!oms_RunFile)
{
printf("Could not Locate the Function oms_RunFile\n");
exit(0);
}
int status = oms_RunFile(filename);
return status;
}
extern const int OMSimulator_oms_setBoolean(const char* cref, bool value)
{
if(!oms_setBoolean)
{
printf("Could not Locate the Function oms_setBoolean\n");
exit(0);
}
int status = oms_setBoolean(cref,value);
return status;
}
extern const int OMSimulator_oms_setCommandLineOption(const char* cmd)
{
if(!oms_setCommandLineOption)
{
printf("Could not Locate the Function oms_setCommandLineOption\n");
exit(0);
}
int status = oms_setCommandLineOption(cmd);
return status;
}
extern const int OMSimulator_oms_setFixedStepSize(const char* cref, double stepSize)
{
if(!oms_setFixedStepSize)
{
printf("Could not Locate the Function oms_setFixedStepSize\n");
exit(0);
}
int status = oms_setFixedStepSize(cref,stepSize);
return status;
}
extern const int OMSimulator_oms_setInteger(const char* cref, int value)
{
if(!oms_setInteger)
{
printf("Could not Locate the Function oms_setInteger\n");
exit(0);
}
int status = oms_setInteger(cref,value);
return status;
}
extern const int OMSimulator_oms_setLogFile(const char* filename)
{
if(!oms_setLogFile)
{
printf("Could not Locate the Function oms_setLogFile\n");
exit(0);
}
int status = oms_setLogFile(filename);
return status;
}
extern const int OMSimulator_oms_setLoggingInterval(const char* cref, double loggingInterval)
{
if(!oms_setLoggingInterval)
{
printf("Could not Locate the Function oms_setLoggingInterval\n");
exit(0);
}
int status = oms_setLoggingInterval(cref,loggingInterval);
return status;
}
extern const int OMSimulator_oms_setLoggingLevel(int logLevel)
{
if(!oms_setLoggingLevel)
{
printf("Could not Locate the Function oms_setLoggingLevel\n");
exit(0);
}
int status = oms_setLoggingLevel(logLevel);
return status;
}
extern const int OMSimulator_oms_setReal(const char* cref, double value)
{
if(!oms_setReal)
{
printf("Could not Locate the Function oms_setReal\n");
exit(0);
}
int status = oms_setReal(cref,value);
return status;
}
extern const int OMSimulator_oms_setRealInputDerivative(const char* cref, double value)
{
if(!oms_setRealInputDerivative)
{
printf("Could not Locate the Function oms_setRealInputDerivative\n");
exit(0);
}
int status = oms_setRealInputDerivative(cref,value);
return status;
}
extern const int OMSimulator_oms_setResultFile(const char* cref, const char* filename, int bufferSize)
{
if(!oms_setResultFile)
{
printf("Could not Locate the Function oms_setResultFile\n");
exit(0);
}
int status = oms_setResultFile(cref,filename,bufferSize);
return status;
}
extern const int OMSimulator_oms_setSignalFilter(const char* cref, const char* regex)
{
if(!oms_setSignalFilter)
{
printf("Could not Locate the Function oms_setSignalFilter\n");
exit(0);
}
int status = oms_setSignalFilter(cref,regex);
return status;
}
extern const int OMSimulator_oms_setSolver(const char* cref, int solver)
{
if(!oms_setSolver)
{
printf("Could not Locate the Function oms_setSolver\n");
exit(0);
}
int status = oms_setSolver(cref,solver);
return status;
}