You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

431 lines
15 KiB

  1. #include <stdlib.h>
  2. #include <stdbool.h>
  3. #include "assemblage.h"
  4. #include "assemblage_includes.h"
  5. double aircraft_dynamics495_Va_Va_filter_100449_Va[2];
  6. double Vz_control_50483_delta_e_c_elevator489_delta_e_c;
  7. double Va_filter_100449_Va_f_Va_control_50474_Va_f[2];
  8. double Vz_filter_100452_Vz_f_Va_control_50474_Vz_f[2];
  9. double q_filter_100455_q_f_Va_control_50474_q_f[2];
  10. double Va_c_Va_control_50474_Va_c;
  11. double h_filter_100446_h_f_altitude_hold_50464_h_f[2];
  12. double h_c_altitude_hold_50464_h_c;
  13. double Va_control_50474_delta_th_c_delta_th_c;
  14. double aircraft_dynamics495_az_az_filter_100458_az[2];
  15. double aircraft_dynamics495_Vz_Vz_filter_100452_Vz[2];
  16. double aircraft_dynamics495_q_q_filter_100455_q[2];
  17. double elevator489_delta_e_aircraft_dynamics495_delta_e[3]={0.0120096156525, 0.0120096156525, 0.0120096156525};
  18. double engine486_T_aircraft_dynamics495_T[3]={41813.9211946, 41813.9211946, 41813.9211946};
  19. double aircraft_dynamics495_h_h_filter_100446_h[2];
  20. double Va_control_50474_delta_th_c_engine486_delta_th_c;
  21. double Vz_filter_100452_Vz_f_Vz_control_50483_Vz_f[2];
  22. double altitude_hold_50464_Vz_c_Vz_control_50483_Vz_c;
  23. double q_filter_100455_q_f_Vz_control_50483_q_f[2];
  24. double az_filter_100458_az_f_Vz_control_50483_az_f[2];
  25. double Vz_control_50483_delta_e_c_delta_e_c;
  26. int Va_filter_100449_fun(void* args)
  27. {
  28. double Va_f;
  29. static int Va_rcell=0;
  30. const struct write_proto_t Va_f_Va_control_50474_Va_f_write =
  31. { NULL, 0, (int []){ true , false }, 2 };
  32. static int Va_f_Va_control_50474_Va_f_wcell=0;
  33. static int instance=0;
  34. Va_f=Va_filter_100(aircraft_dynamics495_Va_Va_filter_100449_Va[Va_rcell]);
  35. Va_rcell=(Va_rcell+1)%2;
  36. if(must_write(Va_f_Va_control_50474_Va_f_write,instance)) {
  37. Va_filter_100449_Va_f_Va_control_50474_Va_f[Va_f_Va_control_50474_Va_f_wcell]=Va_f;
  38. Va_f_Va_control_50474_Va_f_wcell=(Va_f_Va_control_50474_Va_f_wcell+1)%2;
  39. }
  40. instance++;
  41. return 0;
  42. }
  43. int elevator489_fun(void* args)
  44. {
  45. double delta_e;
  46. static int delta_e_aircraft_dynamics495_delta_e_wcell=1;
  47. static int instance=0;
  48. delta_e=elevator(Vz_control_50483_delta_e_c_elevator489_delta_e_c);
  49. elevator489_delta_e_aircraft_dynamics495_delta_e[delta_e_aircraft_dynamics495_delta_e_wcell]=delta_e;
  50. delta_e_aircraft_dynamics495_delta_e_wcell=(delta_e_aircraft_dynamics495_delta_e_wcell+1)%3;
  51. instance++;
  52. return 0;
  53. }
  54. int Va_control_50474_fun(void* args)
  55. {
  56. double delta_th_c;
  57. static int Va_f_rcell=0;
  58. static int Vz_f_rcell=0;
  59. static int q_f_rcell=0;
  60. static int instance=0;
  61. delta_th_c=Va_control_50(Va_filter_100449_Va_f_Va_control_50474_Va_f[Va_f_rcell],
  62. Vz_filter_100452_Vz_f_Va_control_50474_Vz_f[Vz_f_rcell],q_filter_100455_q_f_Va_control_50474_q_f[q_f_rcell],
  63. Va_c_Va_control_50474_Va_c);
  64. Va_f_rcell=(Va_f_rcell+1)%2;
  65. Vz_f_rcell=(Vz_f_rcell+1)%2;
  66. q_f_rcell=(q_f_rcell+1)%2;
  67. Va_control_50474_delta_th_c_engine486_delta_th_c=delta_th_c;
  68. Va_control_50474_delta_th_c_delta_th_c=delta_th_c;
  69. instance++;
  70. return 0;
  71. }
  72. int Va_c0_fun(void* args)
  73. {
  74. double Va_c;
  75. static int instance=0;
  76. Va_c=input_Va_c();
  77. Va_c_Va_control_50474_Va_c=Va_c;
  78. instance++;
  79. return 0;
  80. }
  81. int altitude_hold_50464_fun(void* args)
  82. {
  83. double Vz_c;
  84. static int h_f_rcell=0;
  85. static int instance=0;
  86. Vz_c=altitude_hold_50(h_filter_100446_h_f_altitude_hold_50464_h_f[h_f_rcell],
  87. h_c_altitude_hold_50464_h_c);
  88. h_f_rcell=(h_f_rcell+1)%2;
  89. altitude_hold_50464_Vz_c_Vz_control_50483_Vz_c=Vz_c;
  90. instance++;
  91. return 0;
  92. }
  93. int delta_th_c0_fun(void* args)
  94. {
  95. static int instance=0;
  96. output_delta_th_c(Va_control_50474_delta_th_c_delta_th_c);
  97. instance++;
  98. return 0;
  99. }
  100. int az_filter_100458_fun(void* args)
  101. {
  102. double az_f;
  103. static int az_rcell=0;
  104. const struct write_proto_t az_f_Vz_control_50483_az_f_write =
  105. { NULL, 0, (int []){ true , false }, 2 };
  106. static int az_f_Vz_control_50483_az_f_wcell=0;
  107. static int instance=0;
  108. az_f=az_filter_100(aircraft_dynamics495_az_az_filter_100458_az[az_rcell]);
  109. az_rcell=(az_rcell+1)%2;
  110. if(must_write(az_f_Vz_control_50483_az_f_write,instance)) {
  111. az_filter_100458_az_f_Vz_control_50483_az_f[az_f_Vz_control_50483_az_f_wcell]=az_f;
  112. az_f_Vz_control_50483_az_f_wcell=(az_f_Vz_control_50483_az_f_wcell+1)%2;
  113. }
  114. instance++;
  115. return 0;
  116. }
  117. int Vz_filter_100452_fun(void* args)
  118. {
  119. double Vz_f;
  120. static int Vz_rcell=0;
  121. const struct write_proto_t Vz_f_Va_control_50474_Vz_f_write =
  122. { NULL, 0, (int []){ true , false }, 2 };
  123. static int Vz_f_Va_control_50474_Vz_f_wcell=0;
  124. const struct write_proto_t Vz_f_Vz_control_50483_Vz_f_write =
  125. { NULL, 0, (int []){ true , false }, 2 };
  126. static int Vz_f_Vz_control_50483_Vz_f_wcell=0;
  127. static int instance=0;
  128. Vz_f=Vz_filter_100(aircraft_dynamics495_Vz_Vz_filter_100452_Vz[Vz_rcell]);
  129. Vz_rcell=(Vz_rcell+1)%2;
  130. if(must_write(Vz_f_Va_control_50474_Vz_f_write,instance)) {
  131. Vz_filter_100452_Vz_f_Va_control_50474_Vz_f[Vz_f_Va_control_50474_Vz_f_wcell]=Vz_f;
  132. Vz_f_Va_control_50474_Vz_f_wcell=(Vz_f_Va_control_50474_Vz_f_wcell+1)%2;
  133. }
  134. if(must_write(Vz_f_Vz_control_50483_Vz_f_write,instance)) {
  135. Vz_filter_100452_Vz_f_Vz_control_50483_Vz_f[Vz_f_Vz_control_50483_Vz_f_wcell]=Vz_f;
  136. Vz_f_Vz_control_50483_Vz_f_wcell=(Vz_f_Vz_control_50483_Vz_f_wcell+1)%2;
  137. }
  138. instance++;
  139. return 0;
  140. }
  141. int q_filter_100455_fun(void* args)
  142. {
  143. double q_f;
  144. static int q_rcell=0;
  145. const struct write_proto_t q_f_Va_control_50474_q_f_write =
  146. { NULL, 0, (int []){ true , false }, 2 };
  147. static int q_f_Va_control_50474_q_f_wcell=0;
  148. const struct write_proto_t q_f_Vz_control_50483_q_f_write =
  149. { NULL, 0, (int []){ true , false }, 2 };
  150. static int q_f_Vz_control_50483_q_f_wcell=0;
  151. static int instance=0;
  152. q_f=q_filter_100(aircraft_dynamics495_q_q_filter_100455_q[q_rcell]);
  153. q_rcell=(q_rcell+1)%2;
  154. if(must_write(q_f_Va_control_50474_q_f_write,instance)) {
  155. q_filter_100455_q_f_Va_control_50474_q_f[q_f_Va_control_50474_q_f_wcell]=q_f;
  156. q_f_Va_control_50474_q_f_wcell=(q_f_Va_control_50474_q_f_wcell+1)%2;
  157. }
  158. if(must_write(q_f_Vz_control_50483_q_f_write,instance)) {
  159. q_filter_100455_q_f_Vz_control_50483_q_f[q_f_Vz_control_50483_q_f_wcell]=q_f;
  160. q_f_Vz_control_50483_q_f_wcell=(q_f_Vz_control_50483_q_f_wcell+1)%2;
  161. }
  162. instance++;
  163. return 0;
  164. }
  165. int aircraft_dynamics495_fun(void* args)
  166. {
  167. struct aircraft_dynamics_outs_t aircraft_dynamics495_fun_outs;
  168. static int delta_e_rcell=0;
  169. static int T_rcell=0;
  170. const struct write_proto_t Va_Va_filter_100449_Va_write =
  171. { NULL, 0, (int []){ true , false }, 2 };
  172. static int Va_Va_filter_100449_Va_wcell=0;
  173. const struct write_proto_t Vz_Vz_filter_100452_Vz_write =
  174. { NULL, 0, (int []){ true , false }, 2 };
  175. static int Vz_Vz_filter_100452_Vz_wcell=0;
  176. const struct write_proto_t q_q_filter_100455_q_write =
  177. { NULL, 0, (int []){ true , false }, 2 };
  178. static int q_q_filter_100455_q_wcell=0;
  179. const struct write_proto_t az_az_filter_100458_az_write =
  180. { NULL, 0, (int []){ true , false }, 2 };
  181. static int az_az_filter_100458_az_wcell=0;
  182. const struct write_proto_t h_h_filter_100446_h_write =
  183. { NULL, 0, (int []){ true , false }, 2 };
  184. static int h_h_filter_100446_h_wcell=0;
  185. static int instance=0;
  186. aircraft_dynamics(elevator489_delta_e_aircraft_dynamics495_delta_e[delta_e_rcell],
  187. engine486_T_aircraft_dynamics495_T[T_rcell],&aircraft_dynamics495_fun_outs);
  188. delta_e_rcell=(delta_e_rcell+1)%3;
  189. T_rcell=(T_rcell+1)%3;
  190. if(must_write(Va_Va_filter_100449_Va_write,instance)) {
  191. aircraft_dynamics495_Va_Va_filter_100449_Va[Va_Va_filter_100449_Va_wcell]=aircraft_dynamics495_fun_outs.Va;
  192. Va_Va_filter_100449_Va_wcell=(Va_Va_filter_100449_Va_wcell+1)%2;
  193. }
  194. if(must_write(Vz_Vz_filter_100452_Vz_write,instance)) {
  195. aircraft_dynamics495_Vz_Vz_filter_100452_Vz[Vz_Vz_filter_100452_Vz_wcell]=aircraft_dynamics495_fun_outs.Vz;
  196. Vz_Vz_filter_100452_Vz_wcell=(Vz_Vz_filter_100452_Vz_wcell+1)%2;
  197. }
  198. if(must_write(q_q_filter_100455_q_write,instance)) {
  199. aircraft_dynamics495_q_q_filter_100455_q[q_q_filter_100455_q_wcell]=aircraft_dynamics495_fun_outs.q;
  200. q_q_filter_100455_q_wcell=(q_q_filter_100455_q_wcell+1)%2;
  201. }
  202. if(must_write(az_az_filter_100458_az_write,instance)) {
  203. aircraft_dynamics495_az_az_filter_100458_az[az_az_filter_100458_az_wcell]=aircraft_dynamics495_fun_outs.az;
  204. az_az_filter_100458_az_wcell=(az_az_filter_100458_az_wcell+1)%2;
  205. }
  206. if(must_write(h_h_filter_100446_h_write,instance)) {
  207. aircraft_dynamics495_h_h_filter_100446_h[h_h_filter_100446_h_wcell]=aircraft_dynamics495_fun_outs.h;
  208. h_h_filter_100446_h_wcell=(h_h_filter_100446_h_wcell+1)%2;
  209. }
  210. instance++;
  211. return 0;
  212. }
  213. int h_filter_100446_fun(void* args)
  214. {
  215. double h_f;
  216. static int h_rcell=0;
  217. const struct write_proto_t h_f_altitude_hold_50464_h_f_write =
  218. { NULL, 0, (int []){ true , false }, 2 };
  219. static int h_f_altitude_hold_50464_h_f_wcell=0;
  220. static int instance=0;
  221. h_f=h_filter_100(aircraft_dynamics495_h_h_filter_100446_h[h_rcell]);
  222. h_rcell=(h_rcell+1)%2;
  223. if(must_write(h_f_altitude_hold_50464_h_f_write,instance)) {
  224. h_filter_100446_h_f_altitude_hold_50464_h_f[h_f_altitude_hold_50464_h_f_wcell]=h_f;
  225. h_f_altitude_hold_50464_h_f_wcell=(h_f_altitude_hold_50464_h_f_wcell+1)%2;
  226. }
  227. instance++;
  228. return 0;
  229. }
  230. int engine486_fun(void* args)
  231. {
  232. double T;
  233. static int T_aircraft_dynamics495_T_wcell=1;
  234. static int instance=0;
  235. T=engine(Va_control_50474_delta_th_c_engine486_delta_th_c);
  236. engine486_T_aircraft_dynamics495_T[T_aircraft_dynamics495_T_wcell]=T;
  237. T_aircraft_dynamics495_T_wcell=(T_aircraft_dynamics495_T_wcell+1)%3;
  238. instance++;
  239. return 0;
  240. }
  241. int Vz_control_50483_fun(void* args)
  242. {
  243. double delta_e_c;
  244. static int Vz_f_rcell=0;
  245. static int q_f_rcell=0;
  246. static int az_f_rcell=0;
  247. static int instance=0;
  248. delta_e_c=Vz_control_50(Vz_filter_100452_Vz_f_Vz_control_50483_Vz_f[Vz_f_rcell],
  249. altitude_hold_50464_Vz_c_Vz_control_50483_Vz_c,q_filter_100455_q_f_Vz_control_50483_q_f[q_f_rcell],
  250. az_filter_100458_az_f_Vz_control_50483_az_f[az_f_rcell]);
  251. Vz_f_rcell=(Vz_f_rcell+1)%2;
  252. q_f_rcell=(q_f_rcell+1)%2;
  253. az_f_rcell=(az_f_rcell+1)%2;
  254. Vz_control_50483_delta_e_c_delta_e_c=delta_e_c;
  255. Vz_control_50483_delta_e_c_elevator489_delta_e_c=delta_e_c;
  256. instance++;
  257. return 0;
  258. }
  259. int delta_e_c0_fun(void* args)
  260. {
  261. static int instance=0;
  262. output_delta_e_c(Vz_control_50483_delta_e_c_delta_e_c);
  263. instance++;
  264. return 0;
  265. }
  266. int h_c0_fun(void* args)
  267. {
  268. double h_c;
  269. static int instance=0;
  270. h_c=input_h_c();
  271. h_c_altitude_hold_50464_h_c=h_c;
  272. instance++;
  273. return 0;
  274. }
  275. #define PLUD_TASK_NUMBER 15
  276. static struct nonencoded_task_params static_task_set[PLUD_TASK_NUMBER] = {
  277. { "h_c0", 1000, 0, 1, 1000, h_c0_fun },
  278. { "delta_e_c0", 200, 0, 1, 200, delta_e_c0_fun },
  279. { "Vz_control_50483", 200, 0, 1, 200, Vz_control_50483_fun },
  280. { "engine486", 50, 0, 1, 50, engine486_fun },
  281. { "h_filter_100446", 100, 0, 1, 100, h_filter_100446_fun },
  282. { "aircraft_dynamics495", 50, 0, 1, 50, aircraft_dynamics495_fun },
  283. { "q_filter_100455", 100, 0, 1, 100, q_filter_100455_fun },
  284. { "Vz_filter_100452", 100, 0, 1, 100, Vz_filter_100452_fun },
  285. { "az_filter_100458", 100, 0, 1, 100, az_filter_100458_fun },
  286. { "delta_th_c0", 200, 0, 1, 200, delta_th_c0_fun },
  287. { "altitude_hold_50464", 200, 0, 1, 200, altitude_hold_50464_fun },
  288. { "Va_c0", 1000, 0, 1, 1000, Va_c0_fun },
  289. { "Va_control_50474", 200, 0, 1, 200, Va_control_50474_fun },
  290. { "elevator489", 50, 0, 1, 50, elevator489_fun },
  291. { "Va_filter_100449", 100, 0, 1, 100, Va_filter_100449_fun }
  292. };
  293. void get_task_set (int* task_number, struct nonencoded_task_params** task_set)
  294. {
  295. *task_number = PLUD_TASK_NUMBER;
  296. *task_set=static_task_set;
  297. }
  298. static struct job_prec engine486_aircraft_dynamics495_pcpat[1] = { {0,1} };
  299. static struct job_prec Va_filter_100449_Va_control_50474_pcpat[1] = {
  300. {0,0} };
  301. static struct job_prec q_filter_100455_Va_control_50474_pcpat[1] = { {0,0} };
  302. static struct job_prec q_filter_100455_Vz_control_50483_pcpat[1] = { {0,0} };
  303. static struct job_prec aircraft_dynamics495_q_filter_100455_pcpat[1] = {
  304. {0,0} };
  305. static struct job_prec Va_c0_Va_control_50474_pcpat[1] = { {0,0} };
  306. static struct job_prec Vz_control_50483_delta_e_c0_pcpat[1] = { {0,0} };
  307. static struct job_prec Vz_control_50483_elevator489_pcpat[1] = { {0,0} };
  308. static struct job_prec Vz_filter_100452_Va_control_50474_pcpat[1] = {
  309. {0,0} };
  310. static struct job_prec Vz_filter_100452_Vz_control_50483_pcpat[1] = {
  311. {0,0} };
  312. static struct job_prec h_filter_100446_altitude_hold_50464_pcpat[1] = {
  313. {0,0} };
  314. static struct job_prec aircraft_dynamics495_az_filter_100458_pcpat[1] = {
  315. {0,0} };
  316. static struct job_prec elevator489_aircraft_dynamics495_pcpat[1] = { {0,1} };
  317. static struct job_prec aircraft_dynamics495_Vz_filter_100452_pcpat[1] = {
  318. {0,0} };
  319. static struct job_prec az_filter_100458_Vz_control_50483_pcpat[1] = {
  320. {0,0} };
  321. static struct job_prec h_c0_altitude_hold_50464_pcpat[1] = { {0,0} };
  322. static struct job_prec altitude_hold_50464_Vz_control_50483_pcpat[1] = {
  323. {0,0} };
  324. static struct job_prec aircraft_dynamics495_Va_filter_100449_pcpat[1] = {
  325. {0,0} };
  326. static struct job_prec aircraft_dynamics495_h_filter_100446_pcpat[1] = {
  327. {0,0} };
  328. static struct job_prec Va_control_50474_engine486_pcpat[1] = { {0,0} };
  329. static struct job_prec Va_control_50474_delta_th_c0_pcpat[1] = { {0,0} };
  330. #define PLUD_PREC_NUMBER 21
  331. static struct multirate_precedence static_prec_set[PLUD_PREC_NUMBER] = {
  332. { "engine486", "aircraft_dynamics495", 0, 1, NULL,
  333. engine486_aircraft_dynamics495_pcpat },
  334. { "Va_filter_100449", "Va_control_50474", 0, 1, NULL,
  335. Va_filter_100449_Va_control_50474_pcpat },
  336. { "q_filter_100455", "Va_control_50474", 0, 1, NULL,
  337. q_filter_100455_Va_control_50474_pcpat },
  338. { "q_filter_100455", "Vz_control_50483", 0, 1, NULL,
  339. q_filter_100455_Vz_control_50483_pcpat },
  340. { "aircraft_dynamics495", "q_filter_100455", 0, 1, NULL,
  341. aircraft_dynamics495_q_filter_100455_pcpat },
  342. { "Va_c0", "Va_control_50474", 0, 1, NULL, Va_c0_Va_control_50474_pcpat },
  343. { "Vz_control_50483", "delta_e_c0", 0, 1, NULL,
  344. Vz_control_50483_delta_e_c0_pcpat },
  345. { "Vz_control_50483", "elevator489", 0, 1, NULL,
  346. Vz_control_50483_elevator489_pcpat },
  347. { "Vz_filter_100452", "Va_control_50474", 0, 1, NULL,
  348. Vz_filter_100452_Va_control_50474_pcpat },
  349. { "Vz_filter_100452", "Vz_control_50483", 0, 1, NULL,
  350. Vz_filter_100452_Vz_control_50483_pcpat },
  351. { "h_filter_100446", "altitude_hold_50464", 0, 1, NULL,
  352. h_filter_100446_altitude_hold_50464_pcpat },
  353. { "aircraft_dynamics495", "az_filter_100458", 0, 1, NULL,
  354. aircraft_dynamics495_az_filter_100458_pcpat },
  355. { "elevator489", "aircraft_dynamics495", 0, 1, NULL,
  356. elevator489_aircraft_dynamics495_pcpat },
  357. { "aircraft_dynamics495", "Vz_filter_100452", 0, 1, NULL,
  358. aircraft_dynamics495_Vz_filter_100452_pcpat },
  359. { "az_filter_100458", "Vz_control_50483", 0, 1, NULL,
  360. az_filter_100458_Vz_control_50483_pcpat },
  361. { "h_c0", "altitude_hold_50464", 0, 1, NULL, h_c0_altitude_hold_50464_pcpat
  362. },
  363. { "altitude_hold_50464", "Vz_control_50483", 0, 1, NULL,
  364. altitude_hold_50464_Vz_control_50483_pcpat },
  365. { "aircraft_dynamics495", "Va_filter_100449", 0, 1, NULL,
  366. aircraft_dynamics495_Va_filter_100449_pcpat },
  367. { "aircraft_dynamics495", "h_filter_100446", 0, 1, NULL,
  368. aircraft_dynamics495_h_filter_100446_pcpat },
  369. { "Va_control_50474", "engine486", 0, 1, NULL,
  370. Va_control_50474_engine486_pcpat },
  371. { "Va_control_50474", "delta_th_c0", 0, 1, NULL,
  372. Va_control_50474_delta_th_c0_pcpat }
  373. };
  374. void get_precedence_set (int* prec_number, struct multirate_precedence** prec_set)
  375. {
  376. *prec_number = PLUD_PREC_NUMBER;
  377. *prec_set=static_prec_set;
  378. }