OpenWAM
TMatlab.h
1 /*--------------------------------------------------------------------------------*\
2 ==========================|
3  \\ /\ /\ // O pen | OpenWAM: The Open Source 1D Gas-Dynamic Code
4  \\ | X | // W ave |
5  \\ \/_\/ // A ction | CMT-Motores Termicos / Universidad Politecnica Valencia
6  \\/ \// M odel |
7  ----------------------------------------------------------------------------------
8  License
9 
10  This file is part of OpenWAM.
11 
12  OpenWAM is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenWAM is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenWAM. If not, see <http://www.gnu.org/licenses/>.
24 
25 
26  \*--------------------------------------------------------------------------------*/
27 
28 //---------------------------------------------------------------------------
29 #ifndef TMatlabH
30 #define TMatlabH
31 //---------------------------------------------------------------------------
32 #include "engine.h"
33 #include <string.h>
34 #include <cstdio>
35 #include <iostream>
36 #ifdef __BORLANDC__
37 #include <vcl.h>
38 #endif
39 
40 enum nmVersionMatlab {
41  nmMatlab53 = 0, nmMatlab65 = 1
42 };
43 
44 class TMatlab {
45 //---------------------------------------------------------------------------
46 //---------------------------------------------------------------------------
47  private:
48  // VARIABLES
49  mxArray *FInputMatlab;
50  mxArray *FOutputMatlab;
51  Engine *ep;
52 
53  bool FOpenECU;
54 
55  int FNInputs;
56  int FNOutputs;
57  double *FInput;
58  double *FOutput;
59 
60  char Fdirtrab[256];
61  char Fworkspace[20];
62  char Fficheme[20];
63  nmVersionMatlab VersMatlab;
64 
65  void PutInput(int i, double valor);
66 
67 //---------------------------------------------------------------------------
68 //---------------------------------------------------------------------------
69  protected:
70 
71 //---------------------------------------------------------------------------
72 //---------------------------------------------------------------------------
73  public:
74  // VARIABLES
75  //__property double Input[int i]={write=PutInput};
76 
77 //FUNCIONES
78  double GetOutput(int i);
79 
80  // FUNCIONES
81 
82  TMatlab(int Inputs, int Outputs);
83 
84  ~TMatlab();
85 
86  void IniciaECU();
87 
88  void FinalizaECU();
89 
90  void CalculaECU();
91 
92  void LeeFicherosECU(FILE *fich);
93 
94 };
95 
96 #endif
97 
TMatlab
Definition: TMatlab.h:44