Skip to content

Commit 673bb0d

Browse files
committed
Added flag to use TLC files in accelerator mode and added assignment of block name in TLC file so that warnings correctly output. Additionally fixed data file output format bug.
1 parent 0b5095b commit 673bb0d

24 files changed

+41
-18
lines changed

Trunk/TMATS_Library/MATLAB_Scripts/stripchar_TMATS.m

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
name(ii)= '_';
99
elseif strcmp(name(ii), '\o')
1010
name(ii)= '';
11+
elseif strcmp(name(ii), ' ')
12+
name(ii)= '_';
13+
elseif strcmp(name(ii), sprintf('\n'))
14+
name(ii)= '_';
1115
end
1216
ii= ii + 1;
1317
end;

Trunk/TMATS_Library/MEX/Ambient_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static void mdlInitializeSizes(SimStruct *S)
5050
ssSetSFcnParamTunable(S, i, 0);
5151
}
5252

53-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
53+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
54+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
5455

5556
ssSetNumContStates(S, 0);
5657
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Ambient_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
ambientStruct.C = %<LibBlockParameterSize(Y_A_TVec)[1]>;
5353

5454
ambientStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
55+
ambientStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
5556

5657
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
5758
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/Bleed_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ static void mdlInitializeSizes(SimStruct *S)
4444
ssSetSFcnParamTunable(S, i, 0);
4545
}
4646

47-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
47+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
48+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
4849

4950
ssSetNumContStates(S, 0);
5051
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Bleed_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
bleedStruct.WfracLen = %<LibBlockParameter(WfracLen,"","",0)>;
4343
bleedStruct.Wfrac = (double*)(%<LibBlockParameterBaseAddr(Wfrac)>);
4444
bleedStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
45+
bleedStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
4546

4647
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
4748
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/Burner_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ static void mdlInitializeSizes(SimStruct *S)
6767
ssSetNumModes(S, 0);
6868
ssSetNumNonsampledZCs(S, 0);
6969

70-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
70+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
71+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
7172

7273
/* Register reserved identifiers to avoid name conflict */
7374
if (ssRTWGenIsCodeGen(S) || ssGetSimMode(S)==SS_SIMMODE_EXTERNAL) {

Trunk/TMATS_Library/MEX/Compressor_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ static void mdlInitializeSizes(SimStruct *S)
7272
ssSetSFcnParamTunable(S, i, 0);
7373
}
7474

75-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
75+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
76+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
7677

7778
ssSetNumContStates(S, 0);
7879
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Compressor_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
compressorStruct.EffMapLay = %<LibBlockParameter(EffMapLay,"","",0)>;
7676

7777
compressorStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
78+
compressorStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
7879

7980
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
8081
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/DO_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static void mdlInitializeSizes(SimStruct *S)
4343
ssSetNumModes(S, 0);
4444
ssSetNumNonsampledZCs(S, 0);
4545

46-
46+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
47+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
4748
}
4849

4950
static void mdlInitializeSampleTimes(SimStruct *S)

Trunk/TMATS_Library/MEX/Mixer_TMATS_body.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ void Mixer_TMATS_body(double* y, const double* u, const MixerStruct* prm)
2222

2323
/*--------Define Constants-------*/
2424
double WOut, FARcOut, TtOut, Aphyout, PtOut;
25-
double Test;
2625
double E1, E2, Eout1, Eout2, A1calc, A2calc, Aoutcalc, Ps1g, Ps2g, Psoutg;
2726
double Rt1, ht1in, Ps1, S1in, Ts1, hs1, rhos1, V1, Ps1g_new, Ps1g_old, E1_old, MN1g, gammat1g, Ts1g;
2827
double Rt2, ht2in, Ps2, S2in, Ts2, hs2, rhos2, V2, Ps2g_new, Ps2g_old, E2_old, MN2g, gammat2g, Ts2g;
@@ -32,7 +31,7 @@ void Mixer_TMATS_body(double* y, const double* u, const MixerStruct* prm)
3231
double Aphy1, Aphy2;
3332
double Psp, Pss, Ttp, Tts, Ptp, Pts, Tsp, Tss, rhosp, rhoss, Vp, Vs, Ap, As, hsp, hss, htp, hts;
3433
double Ws, Wp, MNg, Sin;
35-
double FARp, FARs, Rtp, Rts, Rsp, Rss;
34+
double FARp, FARs, Rtp, Rts, Rsp;
3635
double rhosg, Vg, hsg;
3736
int iter, iter1, iter2, iter3a, iter3b, maxiter;
3837
int interpErr = 0;
@@ -255,7 +254,7 @@ void Mixer_TMATS_body(double* y, const double* u, const MixerStruct* prm)
255254

256255
if (V1 <= 0) {
257256
V1 = 0.00001;
258-
if(iter >= maxiter && *(prm->IWork+Er9)==0 ){
257+
if(iter1 >= maxiter && *(prm->IWork+Er9)==0 ){
259258
#ifdef MATLAB_MEX_FILE
260259
printf("Warning in %s, Input 1 flow velocity is zero\n", prm->BlkNm);
261260
#endif
@@ -316,7 +315,7 @@ void Mixer_TMATS_body(double* y, const double* u, const MixerStruct* prm)
316315
PcalcStat(Pt2In, Ps2g, Tt2In, ht2in, FARc2In, Rt2, &S2in, &Ts2, &hs2, &rhos2, &V2);
317316
if (V2 <= 0) {
318317
V2 = 0.00001;
319-
if(iter >= maxiter && *(prm->IWork+Er11)==0 ){
318+
if(iter2 >= maxiter && *(prm->IWork+Er11)==0 ){
320319
#ifdef MATLAB_MEX_FILE
321320
printf("Warning in %s, Input 2 flow velocity is zero\n", prm->BlkNm);
322321
#endif

Trunk/TMATS_Library/MEX/Mixer_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ static void mdlInitializeSizes(SimStruct *S)
114114
ssSetSFcnParamTunable(S, i, 0);
115115
}
116116

117-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
117+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
118+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
118119

119120
ssSetNumContStates(S, 0);
120121
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Mixer_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
mixerStruct.B = %<LibBlockParameterSize(X_M_TVec)[1]>;
5858

5959
mixerStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
60+
mixerStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
6061

6162
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
6263
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/Nozzle_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ static void mdlInitializeSizes(SimStruct *S)
6464
ssSetSFcnParamTunable(S, i, 0);
6565
}
6666

67-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
67+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
68+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
6869

6970
ssSetNumContStates(S, 0);
7071
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Nozzle_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
nozzleStruct.C = %<LibBlockParameterSize(X_N_TtVecTG)[1]>;
6161

6262
nozzleStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
63+
nozzleStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
6364

6465
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
6566
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/StaticCalc_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static void mdlInitializeSizes(SimStruct *S)
5050
ssSetSFcnParamTunable(S, i, 0);
5151
}
5252

53-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
53+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
54+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
5455

5556
ssSetNumContStates(S, 0);
5657
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Turbine_PSI_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ static void mdlInitializeSizes(SimStruct *S)
6565
ssSetSFcnParamTunable(S, i, 0);
6666
}
6767

68-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
68+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
69+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
6970

7071
ssSetNumContStates(S, 0);
7172
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Turbine_PSI_TMATS_new.tlc

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
turbine_PSIStruct.D = %<LibBlockParameterSize(X_T_PRwowVec)[1]>;
6363

6464
turbine_PSIStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
65-
65+
turbine_PSIStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
66+
6667
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
6768
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")
6869

Trunk/TMATS_Library/MEX/Turbine_TMATS_body.c

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void Turbine_TMATS_body(double* y, const double* u, const double* CoolFlow, cons
3838
double Ptcool[100];
3939
double FARcool[100];
4040
int Vtest, i;
41-
int *errFlags;
4241

4342
/* Verify input bleed vector is a multiple of 5 */
4443
Vtest = cfWidth/5;

Trunk/TMATS_Library/MEX/Turbine_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static void mdlInitializeSizes(SimStruct *S)
5959
ssSetSFcnParamTunable(S, i, 0);
6060
}
6161

62-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
62+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
63+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
6364

6465
ssSetNumContStates(S, 0);
6566
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Turbine_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
turbineStruct.EffMapRw = %<LibBlockParameter(EffMapRw,"","",0)>;
6161

6262
turbineStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
63+
turbineStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
6364

6465
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
6566
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/ValvePHY_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ static void mdlInitializeSizes(SimStruct *S)
4949
ssSetSFcnParamTunable(S, i, 0);
5050
}
5151

52-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
52+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
53+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
5354

5455
ssSetNumContStates(S, 0);
5556
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/ValvePHY_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
valvePHYStruct.B1 = %<LibBlockParameterSize(Y_V_Tt_vec)[1]>;
5151

5252
valvePHYStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
53+
valvePHYStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
5354

5455
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
5556
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

Trunk/TMATS_Library/MEX/Valve_TMATS_new.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ static void mdlInitializeSizes(SimStruct *S)
4747
ssSetSFcnParamTunable(S, i, 0);
4848
}
4949

50-
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE);
50+
ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE |
51+
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
5152

5253
ssSetNumContStates(S, 0);
5354
ssSetNumDiscStates(S, 0);

Trunk/TMATS_Library/MEX/Valve_TMATS_new.tlc

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
valveStruct.A = %<LibBlockParameterSize(X_V_PRVec)[1]>;
4848

4949
valveStruct.IWork = &%<LibBlockIWork(Errors,"","",0)>;
50+
valveStruct.BlkNm = "%<LibGetFormattedBlockPath(block)>";
5051

5152
%assign y_ptr = LibBlockOutputSignalAddr(0, "", "", 0)
5253
%assign y_dataType = LibBlockOutputSignalDataTypeName(0,"")

0 commit comments

Comments
 (0)