📄 weather.c
字号:
/* If: '<S37>/If' */
{
int8_T rtAction = -1;
if (rtb_From_Workspace2 < 0.1 || rtb_From_Workspace2 > 0.9) { /* (u1<a) | (u1>c) */
rtAction = 0;
weather_If_Action_Subsy_a(&rtB.Merge_g, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_y);
} else if (rtb_From_Workspace2 == 0.5) { /* u1==b */
rtAction = 1;
weather_If_Action_Subsy_a(&rtB.Merge_g, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_z);
} else if (rtb_From_Workspace2 < 0.5) { /* u1 < b */
rtAction = 2;
weather_If_Action_Subsy_b(rtb_From_Workspace2, &rtB.Merge_g,
&rtB.If_Action_aa, (rtP_weather_If_Action_Subsy_b *) &rtP.If_Action_aa);
} else {
rtAction = 3;
weather_If_Action_Subsy_c(rtb_From_Workspace2, &rtB.Merge_g,
&rtB.If_Action_ab, (rtP_weather_If_Action_Subsy_c *) &rtP.If_Action_ab);
}
rtDWork.If_g_ActiveSubsystem = rtAction;
}
/* MinMax: '<S9>/andorMethod' */
{
real_T rtmin = rtB.Merge_f;
rtmin = rt_MIN(rtB.Merge_b, rtmin);
rtmin = rt_MIN(rtB.Merge_g, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S9>/Weighting' incorporates:
* Constant: '<S9>/Weight'
*/
rtb_Weighting_d = rtP.Weight_d_Value * rtb_temp52;
/* MinMax: '<S10>/andorMethod' */
{
real_T rtmin = rtB.Merge_f;
rtmin = rt_MIN(rtB.Merge_d, rtmin);
rtmin = rt_MIN(rtB.Merge_g, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S10>/Weighting' incorporates:
* Constant: '<S10>/Weight'
*/
rtb_Weighting_e = rtP.Weight_e_Value * rtb_temp52;
/* MinMax: '<S11>/andorMethod' */
{
real_T rtmin = rtB.Merge_f;
rtmin = rt_MIN(rtB.Merge_e, rtmin);
rtmin = rt_MIN(rtB.Merge_g, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S11>/Weighting' incorporates:
* Constant: '<S11>/Weight'
*/
rtb_Weighting_f = rtP.Weight_f_Value * rtb_temp52;
/* If: '<S21>/If' */
{
int8_T rtAction = -1;
if (rtb_From_Workspace < 50.0 || rtb_From_Workspace > 150.0) { /* (u1<a) | (u1>c) */
rtAction = 0;
weather_If_Action_Subsy_a(&rtB.Merge_h, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_ac);
} else if (rtb_From_Workspace == 100.0) { /* u1==b */
rtAction = 1;
weather_If_Action_Subsy_a(&rtB.Merge_h, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_ad);
} else if (rtb_From_Workspace < 100.0) { /* u1 < b */
rtAction = 2;
weather_If_Action_Subsy_b(rtb_From_Workspace, &rtB.Merge_h,
&rtB.If_Action_ae, (rtP_weather_If_Action_Subsy_b *) &rtP.If_Action_ae);
} else {
rtAction = 3;
weather_If_Action_Subsy_c(rtb_From_Workspace, &rtB.Merge_h,
&rtB.If_Action_af, (rtP_weather_If_Action_Subsy_c *) &rtP.If_Action_af);
}
rtDWork.If_h_ActiveSubsystem = rtAction;
}
/* If: '<S35>/If' */
{
int8_T rtAction = -1;
if (rtb_From_Workspace2 < 0.5 || rtb_From_Workspace2 > 1.4) { /* (u1<a) | (u1>c) */
rtAction = 0;
weather_If_Action_Subsy_a(&rtB.Merge_i, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_ag);
} else if (rtb_From_Workspace2 == 1.0) { /* u1==b */
rtAction = 1;
weather_If_Action_Subsy_a(&rtB.Merge_i, (rtP_weather_If_Action_Subsy_a *)
&rtP.If_Action_ah);
} else if (rtb_From_Workspace2 < 1.0) { /* u1 < b */
rtAction = 2;
weather_If_Action_Subsy_b(rtb_From_Workspace2, &rtB.Merge_i,
&rtB.If_Action_ai, (rtP_weather_If_Action_Subsy_b *) &rtP.If_Action_ai);
} else {
rtAction = 3;
weather_If_Action_Subsy_c(rtb_From_Workspace2, &rtB.Merge_i,
&rtB.If_Action_aj, (rtP_weather_If_Action_Subsy_c *) &rtP.If_Action_aj);
}
rtDWork.If_i_ActiveSubsystem = rtAction;
}
/* MinMax: '<S12>/andorMethod' */
{
real_T rtmin = rtB.Merge_h;
rtmin = rt_MIN(rtB.Merge_b, rtmin);
rtmin = rt_MIN(rtB.Merge_i, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S12>/Weighting' incorporates:
* Constant: '<S12>/Weight'
*/
rtb_Weighting_g = rtP.Weight_g_Value * rtb_temp52;
/* MinMax: '<S13>/andorMethod' */
{
real_T rtmin = rtB.Merge_h;
rtmin = rt_MIN(rtB.Merge_d, rtmin);
rtmin = rt_MIN(rtB.Merge_i, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S13>/Weighting' incorporates:
* Constant: '<S13>/Weight'
*/
rtb_Weighting_h = rtP.Weight_h_Value * rtb_temp52;
/* MinMax: '<S14>/andorMethod' */
{
real_T rtmin = rtB.Merge_h;
rtmin = rt_MIN(rtB.Merge_e, rtmin);
rtmin = rt_MIN(rtB.Merge_i, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S14>/Weighting' incorporates:
* Constant: '<S14>/Weight'
*/
rtb_Weighting_i = rtP.Weight_i_Value * rtb_temp52;
/* MinMax: '<S6>/andorMethod' */
{
real_T rtmin = rtB.Merge_h;
rtmin = rt_MIN(rtB.Merge_e, rtmin);
rtmin = rt_MIN(rtB.Merge_g, rtmin);
rtb_temp52 = rtmin;
}
/* Product: '<S6>/Weighting' incorporates:
* Constant: '<S6>/Weight'
*/
rtb_Weighting_j = rtP.Weight_j_Value * rtb_temp52;
/* Switch: '<S2>/Switch' incorporates:
* RelationalOperator: '<S2>/Zero Firing Strength?'
* Sum: '<S2>/Total Firing Strength'
* Constant: '<S2>/Zero'
* Constant: '<S2>/MidRange'
*/
if (((rtb_Weighting_a + rtb_Weighting_b + rtb_Weighting_c + rtb_Weighting_d +
rtb_Weighting_e + rtb_Weighting_f + rtb_Weighting_g + rtb_Weighting_h +
rtb_Weighting_i + rtb_Weighting_j) > rtP.Zero_Value) >=
rtP.Switch_Threshold) {
/* MinMax: '<S5>/impMethod' incorporates:
* Constant: '<S19>/sun'
* Constant: '<S18>/high'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.sun_Value[0];
real_T *y0 = &rtb_impMethod_a[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_a;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.high_Value[0];
y0 = &rtb_impMethod_a[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_a;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S7>/impMethod' incorporates:
* Constant: '<S19>/sun'
* Constant: '<S18>/mid'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.sun_Value[0];
real_T *y0 = &rtb_impMethod_b[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_b;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.mid_Value[0];
y0 = &rtb_impMethod_b[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_b;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S8>/impMethod' incorporates:
* Constant: '<S19>/sun'
* Constant: '<S18>/low'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.sun_Value[0];
real_T *y0 = &rtb_impMethod_c[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_c;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.low_Value[0];
y0 = &rtb_impMethod_c[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_c;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S9>/impMethod' incorporates:
* Constant: '<S19>/cloudy'
* Constant: '<S18>/high'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.cloudy_Value[0];
real_T *y0 = &rtb_impMethod_d[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_d;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.high_Value[0];
y0 = &rtb_impMethod_d[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_d;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S10>/impMethod' incorporates:
* Constant: '<S19>/cloudy'
* Constant: '<S18>/mid'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.cloudy_Value[0];
real_T *y0 = &rtb_impMethod_e[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_e;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.mid_Value[0];
y0 = &rtb_impMethod_e[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_e;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S11>/impMethod' incorporates:
* Constant: '<S19>/cloudy'
* Constant: '<S18>/low'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.cloudy_Value[0];
real_T *y0 = &rtb_impMethod_f[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_f;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.low_Value[0];
y0 = &rtb_impMethod_f[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_f;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S12>/impMethod' incorporates:
* Constant: '<S19>/rainy'
* Constant: '<S18>/high'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.rainy_Value[0];
real_T *y0 = &rtb_impMethod_g[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_g;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.high_Value[0];
y0 = &rtb_impMethod_g[101];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_g;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
}
}
/* MinMax: '<S13>/impMethod' incorporates:
* Constant: '<S19>/rainy'
* Constant: '<S18>/mid'
*/
{
real_T rtmin;
{
int_T i1;
const real_T *u1 = &rtP.rainy_Value[0];
real_T *y0 = &rtb_impMethod_h[0];
for (i1=0; i1 < 101; i1++) {
rtmin = rtb_Weighting_h;
rtmin = rt_MIN(u1[i1], rtmin);
y0[i1] = rtmin;
}
u1 = &rtP.mid_Value[0];
y0 = &rtb_impMethod_h[101];
for (i1=0; i1 < 101; i1++) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -