Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7409 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Azam Zia
committed
Dec 15, 2010
1 parent
6281a28
commit a202e1c
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/****************************************************************************** | ||
*fmuTemplate.h | ||
******************************************************************************/ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <assert.h> | ||
#include "fmiModelFunctions.h" | ||
|
||
// macros used to define variables | ||
#define r(vr) comp->r[vr] | ||
#define i(vr) comp->i[vr] | ||
#define b(vr) comp->b[vr] | ||
#define s(vr) comp->s[vr] | ||
#define pos(z) comp->isPositive[z] | ||
#define copy(vr, value) setString(comp, vr, value) | ||
|
||
#define not_modelError (modelInstantiated|modelInitialized|modelTerminated) | ||
|
||
typedef enum { | ||
modelInstantiated = 1<<0, | ||
modelInitialized = 1<<1, | ||
modelTerminated = 1<<2, | ||
modelError = 1<<3 | ||
} ModelState; | ||
|
||
typedef struct { | ||
fmiReal *r; | ||
fmiInteger *i; | ||
fmiBoolean *b; | ||
fmiString *s; | ||
fmiBoolean *isPositive; | ||
fmiReal time; | ||
fmiString instanceName; | ||
fmiString GUID; | ||
fmiCallbackFunctions functions; | ||
fmiBoolean loggingOn; | ||
ModelState state; | ||
} ModelInstance; | ||
|
||
fmiStatus setString(fmiComponent comp, fmiValueReference vr, fmiString value){ | ||
return fmiSetString(comp, &vr, 1, &value); | ||
} | ||
|