]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_recorder.cpp
Make sure sign is preserved for turbulence direction.
[flightgear.git] / src / FDM / UIUCModel / uiuc_recorder.cpp
1 /**********************************************************************
2  
3  FILENAME:     uiuc_recorder.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  outputs variables specified in input file to recorder 
8                file
9
10 ----------------------------------------------------------------------
11
12  STATUS:       alpha version
13
14 ----------------------------------------------------------------------
15
16  REFERENCES:   Liberty, Jesse.  "Sam's Teach Yourself C++ in 21 Days,"
17                3rd ed., 1999.
18
19 ----------------------------------------------------------------------
20
21  HISTORY:      01/31/2000   initial release
22                03/02/2000   (JS) added record options for 1D and 2D 
23                             interpolated variables
24                04/01/2000   (JS) added throttle, longitudinal, lateral, 
25                             and rudder inputs to record map
26                04/24/2000   (JS) added rest of variables in 
27                             ls_generic.h
28                07/06/2001   (RD) changed Flap handle output
29                07/20/2001   (RD) fixed Lat_control and Rudder_pedal
30                10/25/2001   (RD) Added new variables needed for the non-
31                             linear Twin Otter model at zero flaps
32                             (Cxfxxf0I)
33                11/12/2001   (RD) Added new variables needed for the non-
34                             linear Twin Otter model at zero flaps
35                             (CxfxxfI).  Removed zero flap variables.
36                             Added flap_pos and flap_cmd_deg.
37                02/13/2002   (RD) Added variables so linear aero model
38                             values can be recorded
39                03/03/2003   (RD) Added flap_cmd_record
40                03/16/2003   (RD) Added trigger record variables
41
42 ----------------------------------------------------------------------
43
44  AUTHOR(S):    Jeff Scott         http://www.jeffscott.net/
45                Robert Deters      <rdeters@uiuc.edu>
46                Michael Selig      <m-selig@uiuc.edu>
47 ----------------------------------------------------------------------
48
49  VARIABLES:
50
51 ----------------------------------------------------------------------
52
53  INPUTS:       n/a
54
55 ----------------------------------------------------------------------
56
57  OUTPUTS:      -variables recorded in uiuc_recorder.dat
58
59 ----------------------------------------------------------------------
60
61  CALLED BY:   uiuc_wrapper.cpp 
62
63 ----------------------------------------------------------------------
64
65  CALLS TO:     none
66
67 ----------------------------------------------------------------------
68
69  COPYRIGHT:    (C) 2000 by Michael Selig
70
71  This program is free software; you can redistribute it and/or
72  modify it under the terms of the GNU General Public License
73  as published by the Free Software Foundation.
74
75  This program is distributed in the hope that it will be useful,
76  but WITHOUT ANY WARRANTY; without even the implied warranty of
77  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
78  GNU General Public License for more details.
79
80  You should have received a copy of the GNU General Public License
81  along with this program; if not, write to the Free Software
82  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
83  USA or view http://www.gnu.org/copyleft/gpl.html.
84
85 **********************************************************************/
86
87 #ifdef HAVE_CONFIG_H
88 #  include <config.h>
89 #endif
90
91 #include <simgear/compiler.h>
92 #include <simgear/misc/sg_path.hxx>
93 #include <Aircraft/aircraft.hxx>
94 #include <Main/fg_props.hxx>
95
96 #include "uiuc_recorder.h"
97
98 SG_USING_STD(endl);             // -dw
99
100 void uiuc_recorder( double dt )
101 {
102   stack command_list;
103   string linetoken;
104   static int init = 0;
105   static int recordStep = 0;
106   string record_variables = "# ";
107
108   int modulus = recordStep % recordRate;
109
110   if ((recordStep % recordRate) == 0)
111     {
112       command_list = recordParts->getCommands();
113       fout << endl;
114
115       LIST command_line;
116       for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
117         record_variables += recordParts->getToken(*command_line,2) + "  ";
118
119       fout << record_variables << endl; 
120       for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
121         {
122           linetoken = recordParts->getToken(*command_line, 2); 
123
124           switch(record_map[linetoken])
125             {
126               /************************* Time ************************/
127             case Simtime_record:
128               {
129                 fout << Simtime << " ";
130                 break;
131               }
132             case dt_record:
133               {
134                 fout << dt << " ";
135                 break;
136               }
137
138               /************************* Mass ************************/
139             case Weight_record:
140               {
141                 fout << Weight << " ";
142                 break;
143               }
144             case Mass_record:
145               {
146                 fout << Mass << " ";
147                 break;
148               }
149             case I_xx_record:
150               {
151                 fout << I_xx << " ";
152                 break;
153               }
154             case I_yy_record:
155               {
156                 fout << I_yy << " ";
157                 break;
158               }
159             case I_zz_record:
160               {
161                 fout << I_zz << " ";
162                 break;
163               }
164             case I_xz_record:
165               {
166                 fout << I_xz << " ";
167                 break;
168               }
169
170               /*********************** Geometry **********************/
171             case Dx_pilot_record:
172               {
173                 fout << Dx_pilot << " ";
174                 break;
175               }
176             case Dy_pilot_record:
177               {
178                 fout << Dy_pilot << " ";
179                 break;
180               }
181             case Dz_pilot_record:
182               {
183                 fout << Dz_pilot << " ";
184                 break;
185               }
186             case Dx_cg_record:
187               {
188                 fout << Dx_cg << " ";
189                 break;
190               }
191             case Dy_cg_record:
192               {
193                 fout << Dy_cg << " ";
194                 break;
195               }
196             case Dz_cg_record:
197               {
198                 fout << Dz_cg << " ";
199                 break;
200               }
201
202               /********************** Positions **********************/
203             case Lat_geocentric_record:
204               {
205                 fout << Lat_geocentric << " ";
206                 break;
207               }
208             case Lon_geocentric_record:
209               {
210                 fout << Lon_geocentric << " ";
211                 break;
212               }
213             case Radius_to_vehicle_record:
214               {
215                 fout << Radius_to_vehicle << " ";
216                 break;
217               }
218             case Latitude_record:
219               {
220                 fout << Latitude << " ";
221                 break;
222               }
223             case Longitude_record:
224               {
225                 fout << Longitude << " ";
226                 break;
227               }
228             case Altitude_record:
229               {
230                 fout << Altitude << " ";
231                 break;
232               }
233             case Phi_record:
234               {
235                 fout << Phi << " ";
236                 break;
237               }
238             case Theta_record:
239               {
240                 fout << Theta << " ";
241                 break;
242               }
243             case Psi_record:
244               {
245                 fout << Psi << " ";
246                 break;
247               }
248
249               /******************** Accelerations ********************/
250             case V_dot_north_record:
251               {
252                 fout << V_dot_north << " ";
253                 break;
254               }
255             case V_dot_east_record:
256               {
257                 fout << V_dot_east << " ";
258                 break;
259               }
260             case V_dot_down_record:
261               {
262                 fout << V_dot_down << " ";
263                 break;
264               }
265             case U_dot_body_record:
266               {
267                 fout << U_dot_body << " ";
268                 break;
269               }
270             case V_dot_body_record:
271               {
272                 fout << V_dot_body << " ";
273                 break;
274               }
275             case W_dot_body_record:
276               {
277                 fout << W_dot_body << " ";
278                 break;
279               }
280             case A_X_pilot_record:
281               {
282                 fout << A_X_pilot << " ";
283                 break;
284               }
285             case A_Y_pilot_record:
286               {
287                 fout << A_Y_pilot << " ";
288                 break;
289               }
290             case A_Z_pilot_record:
291               {
292                 fout << A_Z_pilot << " ";
293                 break;
294               }
295             case A_X_cg_record:
296               {
297                 fout << A_X_cg << " ";
298                 break;
299               }
300             case A_Y_cg_record:
301               {
302                 fout << A_Y_cg << " ";
303                 break;
304               }
305             case A_Z_cg_record:
306               {
307                 fout << A_Z_cg << " ";
308                 break;
309               }
310             case N_X_pilot_record:
311               {
312                 fout << N_X_pilot << " ";
313                 break;
314               }
315             case N_Y_pilot_record:
316               {
317                 fout << N_Y_pilot << " ";
318                 break;
319               }
320             case N_Z_pilot_record:
321               {
322                 fout << N_Z_pilot << " ";
323                 break;
324               }
325             case N_X_cg_record:
326               {
327                 fout << N_X_cg << " ";
328                 break;
329               }
330             case N_Y_cg_record:
331               {
332                 fout << N_Y_cg << " ";
333                 break;
334               }
335             case N_Z_cg_record:
336               {
337                 fout << N_Z_cg << " ";
338                 break;
339               }
340             case P_dot_body_record:
341               {
342                 fout << P_dot_body << " ";
343                 break;
344               }
345             case Q_dot_body_record:
346               {
347                 fout << Q_dot_body << " ";
348                 break;
349               }
350             case R_dot_body_record:
351               {
352                 fout << R_dot_body << " ";
353                 break;
354               }
355
356               /********************** Velocities *********************/
357             case V_north_record:
358               {
359                 fout << V_north << " ";
360                 break;
361               }
362             case V_east_record:
363               {
364                 fout << V_east << " ";
365                 break;
366               }
367             case V_down_record:
368               {
369                 fout << V_down << " ";
370                 break;
371               }
372             case V_north_rel_ground_record:
373               {
374                 fout << V_north_rel_ground << " ";
375                 break;
376               }
377             case V_east_rel_ground_record:
378               {
379                 fout << V_east_rel_ground << " ";
380                 break;
381               }
382             case V_down_rel_ground_record:
383               {
384                 fout << V_down_rel_ground << " ";
385                 break;
386               }
387             case V_north_airmass_record:
388               {
389                 fout << V_north_airmass << " ";
390                 break;
391               }
392             case V_east_airmass_record:
393               {
394                 fout << V_east_airmass << " ";
395                 break;
396               }
397             case V_down_airmass_record:
398               {
399                 fout << V_down_airmass << " ";
400                 break;
401               }
402             case V_north_rel_airmass_record:
403               {
404                 fout << V_north_rel_airmass << " ";
405                 break;
406               }
407             case V_east_rel_airmass_record:
408               {
409                 fout << V_east_rel_airmass << " ";
410                 break;
411               }
412             case V_down_rel_airmass_record:
413               {
414                 fout << V_down_rel_airmass << " ";
415                 break;
416               }
417             case U_gust_record:
418               {
419                 fout << U_gust << " ";
420                 break;
421               }
422             case V_gust_record:
423               {
424                 fout << V_gust << " ";
425                 break;
426               }
427             case W_gust_record:
428               {
429                 fout << W_gust << " ";
430                 break;
431               }
432             case U_body_record:
433               {
434                 fout << U_body << " ";
435                 break;
436               }
437             case V_body_record:
438               {
439                 fout << V_body << " ";
440                 break;
441               }
442             case W_body_record:
443               {
444                 fout << W_body << " ";
445                 break;
446               }
447             case V_rel_wind_record:
448               {
449                 fout << V_rel_wind << " ";
450                 break;
451               }
452             case V_true_kts_record:
453               {
454                 fout << V_true_kts << " ";
455                 break;
456               }
457             case V_rel_ground_record:
458               {
459                 fout << V_rel_ground << " ";
460                 break;
461               }
462             case V_inertial_record:
463               {
464                 fout << V_inertial << " ";
465                 break;
466               }
467             case V_ground_speed_record:
468               {
469                 fout << V_ground_speed << " ";
470                 break;
471               }
472             case V_equiv_record:
473               {
474                 fout << V_equiv << " ";
475                 break;
476               }
477             case V_equiv_kts_record:
478               {
479                 fout << V_equiv_kts << " ";
480                 break;
481               }
482             case V_calibrated_record:
483               {
484                 fout << V_calibrated << " ";
485                 break;
486               }
487             case V_calibrated_kts_record:
488               {
489                 fout << V_calibrated_kts << " ";
490                 break;
491               }
492             case P_local_record:
493               {
494                 fout << P_local << " ";
495                 break;
496               }
497             case Q_local_record:
498               {
499                 fout << Q_local << " ";
500                 break;
501               }
502             case R_local_record:
503               {
504                 fout << R_local << " ";
505                 break;
506               }
507             case P_body_record:
508               {
509                 fout << P_body << " ";
510                 break;
511               }
512             case Q_body_record:
513               {
514                 fout << Q_body << " ";
515                 break;
516               }
517             case R_body_record:
518               {
519                 fout << R_body << " ";
520                 break;
521               }
522             case P_total_record:
523               {
524                 fout << P_total << " ";
525                 break;
526               }
527             case Q_total_record:
528               {
529                 fout << Q_total << " ";
530                 break;
531               }
532             case R_total_record:
533               {
534                 fout << R_total << " ";
535                 break;
536               }
537             case Phi_dot_record:
538               {
539                 fout << Phi_dot << " ";
540                 break;
541               }
542             case Theta_dot_record:
543               {
544                 fout << Theta_dot << " ";
545                 break;
546               }
547             case Psi_dot_record:
548               {
549                 fout << Psi_dot << " ";
550                 break;
551               }
552             case Latitude_dot_record:
553               {
554                 fout << Latitude_dot << " ";
555                 break;
556               }
557             case Longitude_dot_record:
558               {
559                 fout << Longitude_dot << " ";
560                 break;
561               }
562             case Radius_dot_record:
563               {
564                 fout << Radius_dot << " ";
565                 break;
566               }
567
568               /************************ Angles ***********************/
569             case Alpha_record:
570               {
571                 fout << Std_Alpha << " ";
572                 break;
573               }
574             case Alpha_deg_record:
575               {
576                 fout << Std_Alpha * RAD_TO_DEG << " ";
577                 break;
578               }
579             case Alpha_dot_record:
580               {
581                 fout << Std_Alpha_dot << " ";
582                 break;
583               }
584             case Alpha_dot_deg_record:
585               {
586                 fout << Std_Alpha_dot * RAD_TO_DEG << " ";
587                 break;
588               }
589             case Beta_record:
590               {
591                 fout << Std_Beta << " ";
592                 break;
593               }
594             case Beta_deg_record:
595               {
596                 fout << Std_Beta * RAD_TO_DEG << " ";
597                 break;
598               }
599             case Beta_dot_record:
600               {
601                 fout << Std_Beta_dot << " ";
602                 break;
603               }
604             case Beta_dot_deg_record:
605               {
606                 fout << Std_Beta_dot * RAD_TO_DEG << " ";
607                 break;
608               }
609             case Gamma_vert_record:
610               {
611                 fout << Gamma_vert_rad << " ";
612                 break;
613               }
614             case Gamma_vert_deg_record:
615               {
616                 fout << Gamma_vert_rad * RAD_TO_DEG << " ";
617                 break;
618               }
619             case Gamma_horiz_record:
620               {
621                 fout << Gamma_horiz_rad << " ";
622                 break;
623               }
624             case Gamma_horiz_deg_record:
625               {
626                 fout << Gamma_horiz_rad * RAD_TO_DEG << " ";
627                 break;
628               }
629
630               /**************** Atmospheric Properties ***************/
631             case Density_record:
632               {
633                 fout << Density << " ";
634                 break;
635               }
636             case V_sound_record:
637               {
638                 fout << V_sound << " ";
639                 break;
640               }
641             case Mach_number_record:
642               {
643                 fout << Mach_number << " ";
644                 break;
645               }
646             case Static_pressure_record:
647               {
648                 fout << Static_pressure << " ";
649                 break;
650               }
651             case Total_pressure_record:
652               {
653                 fout << Total_pressure << " ";
654                 break;
655               }
656             case Impact_pressure_record:
657               {
658                 fout << Impact_pressure << " ";
659                 break;
660               }
661             case Dynamic_pressure_record:
662               {
663                 fout << Dynamic_pressure << " ";
664                 break;
665               }
666             case Static_temperature_record:
667               {
668                 fout << Static_temperature << " ";
669                 break;
670               }
671             case Total_temperature_record:
672               {
673                 fout << Total_temperature << " ";
674                 break;
675               }
676
677               /******************** Earth Properties *****************/
678             case Gravity_record:
679               {
680                 fout << Gravity << " ";
681                 break;
682               }
683             case Sea_level_radius_record:
684               {
685                 fout << Sea_level_radius << " ";
686                 break;
687               }
688             case Earth_position_angle_record:
689               {
690                 fout << Earth_position_angle << " ";
691                 break;
692               }
693             case Runway_altitude_record:
694               {
695                 fout << Runway_altitude << " ";
696                 break;
697               }
698             case Runway_latitude_record:
699               {
700                 fout << Runway_latitude << " ";
701                 break;
702               }
703             case Runway_longitude_record:
704               {
705                 fout << Runway_longitude << " ";
706                 break;
707               }
708             case Runway_heading_record:
709               {
710                 fout << Runway_heading << " ";
711                 break;
712               }
713             case Radius_to_rwy_record:
714               {
715                 fout << Radius_to_rwy << " ";
716                 break;
717               }
718             case D_pilot_north_of_rwy_record:
719               {
720                 fout << D_pilot_north_of_rwy << " ";
721                 break;
722               }
723             case D_pilot_east_of_rwy_record:
724               {
725                 fout << D_pilot_east_of_rwy << " ";
726                 break;
727               }
728             case D_pilot_above_rwy_record:
729               {
730                 fout << D_pilot_above_rwy << " ";
731                 break;
732               }
733             case X_pilot_rwy_record:
734               {
735                 fout << X_pilot_rwy << " ";
736                 break;
737               }
738             case Y_pilot_rwy_record:
739               {
740                 fout << Y_pilot_rwy << " ";
741                 break;
742               }
743             case H_pilot_rwy_record:
744               {
745                 fout << H_pilot_rwy << " ";
746                 break;
747               }
748             case D_cg_north_of_rwy_record:
749               {
750                 fout << D_cg_north_of_rwy << " ";
751                 break;
752               }
753             case D_cg_east_of_rwy_record:
754               {
755                 fout << D_cg_east_of_rwy << " ";
756                 break;
757               }
758             case D_cg_above_rwy_record:
759               {
760                 fout << D_cg_above_rwy << " ";
761                 break;
762               }
763             case X_cg_rwy_record:
764               {
765                 fout << X_cg_rwy << " ";
766                 break;
767               }
768             case Y_cg_rwy_record:
769               {
770                 fout << Y_cg_rwy << " ";
771                 break;
772               }
773             case H_cg_rwy_record:
774               {
775                 fout << H_cg_rwy << " ";
776                 break;
777               }
778
779               /********************* Engine Inputs *******************/
780             case Throttle_3_record:
781               {
782                 fout << Throttle[3] << " ";
783                 break;
784               }
785             case Throttle_pct_record:
786               {
787                 fout << Throttle_pct << " ";
788                 break;
789               }
790
791               /************************ Controls ***********************/
792             case Long_control_record:
793               {
794                 fout << Long_control << " ";
795                 break;
796               }
797             case Long_trim_record:
798               {
799                 fout << Long_trim << " ";
800                 break;
801               }
802             case Long_trim_deg_record:
803               {
804                 fout << Long_trim * RAD_TO_DEG << " ";
805                 break;
806               }
807             case elevator_record:
808               {
809                 fout << elevator << " ";
810                 break;
811               }
812             case elevator_deg_record:
813               {
814                 fout << elevator * RAD_TO_DEG << " ";
815                 break;
816               }
817             case Lat_control_record:
818               {
819                 fout << Lat_control << " ";
820                 break;
821               }
822             case aileron_record:
823               {
824                 fout << aileron << " ";
825                 break;
826               }
827             case aileron_deg_record:
828               {
829                 fout << aileron * RAD_TO_DEG << " ";
830                 break;
831               }
832             case Rudder_pedal_record:
833               {
834                 fout << Rudder_pedal << " ";
835                 break;
836               }
837             case rudder_record:
838               {
839                 fout << rudder << " ";
840                 break;
841               }
842             case rudder_deg_record:
843               {
844                 fout << rudder * RAD_TO_DEG << " ";
845                 break;
846               }
847             case Flap_handle_record:
848               {
849                 fout << Flap_handle << " ";
850                 break;
851               }
852             case flap_record:
853               {
854                 fout << flap << " ";
855                 break;
856               }
857             case flap_cmd_record:
858               {
859                 fout << flap_cmd << " ";
860                 break;
861               }
862             case flap_cmd_deg_record:
863               {
864                 fout << flap_cmd * RAD_TO_DEG << " ";
865                 break;
866               }
867             case flap_pos_record:
868               {
869                 fout << flap_pos << " ";
870                 break;
871               }
872             case flap_pos_deg_record:
873               {
874                 fout << flap_pos * RAD_TO_DEG << " ";
875                 break;
876               }
877             case Spoiler_handle_record:
878               {
879                 fout << Spoiler_handle << " ";
880                 break;
881               }
882             case spoiler_cmd_deg_record:
883               {
884                 fout << spoiler_cmd_deg << " ";
885                 break;
886               }
887             case spoiler_pos_deg_record:
888               {
889                 fout << spoiler_pos_deg << " ";
890                 break;
891               }
892             case spoiler_pos_norm_record:
893               {
894                 fout << spoiler_pos_norm << " ";
895                 break;
896               }
897             case spoiler_pos_record:
898               {
899                 fout << spoiler_pos << " ";
900                 break;
901               }
902
903               /****************** Aero Coefficients ******************/
904             case CD_record:
905               {
906                 fout << CD << " ";
907                 break;
908               }
909             case CDfaI_record:
910               {
911                 fout << CDfaI << " ";
912                 break;
913               }
914             case CDfCLI_record:
915               {
916                 fout << CDfCLI << " ";
917                 break;
918               }
919             case CDfadeI_record:
920               {
921                 fout << CDfadeI << " ";
922                 break;
923               }
924             case CDfdfI_record:
925               {
926                 fout << CDfdfI << " ";
927                 break;
928               }
929             case CDfadfI_record:
930               {
931                 fout << CDfadfI << " ";
932                 break;
933               }
934             case CX_record:
935               {
936                 fout << CX << " ";
937                 break;
938               }
939             case CXfabetafI_record:
940               {
941                 fout << CXfabetafI << " ";
942                 break;
943               }
944             case CXfadefI_record:
945               {
946                 fout << CXfadefI << " ";
947                 break;
948               }
949             case CXfaqfI_record:
950               {
951                 fout << CXfaqfI << " ";
952                 break;
953               }
954             case CDo_save_record:
955               {
956                 fout << CDo_save << " ";
957                 break;
958               }
959             case CDK_save_record:
960               {
961                 fout << CDK_save << " ";
962                 break;
963               }
964             case CLK_save_record:
965               {
966                 fout << CLK_save << " ";
967                 break;
968               }
969             case CD_a_save_record:
970               {
971                 fout << CD_a_save << " ";
972                 break;
973               }
974             case CD_adot_save_record:
975               {
976                 fout << CD_adot_save << " ";
977                 break;
978               }
979             case CD_q_save_record:
980               {
981                 fout << CD_q_save << " ";
982                 break;
983               }
984             case CD_ih_save_record:
985               {
986                 fout << CD_ih_save << " ";
987                 break;
988               }
989             case CD_de_save_record:
990               {
991                 fout << CD_de_save << " ";
992                 break;
993               }
994             case CD_dr_save_record:
995               {
996                 fout << CD_dr_save << " ";
997                 break;
998               }
999             case CD_da_save_record:
1000               {
1001                 fout << CD_da_save << " ";
1002                 break;
1003               }
1004             case CD_beta_save_record:
1005               {
1006                 fout << CD_beta_save << " ";
1007                 break;
1008               }
1009             case CD_df_save_record:
1010               {
1011                 fout << CD_df_save << " ";
1012                 break;
1013               }
1014             case CD_ds_save_record:
1015               {
1016                 fout << CD_ds_save << " ";
1017                 break;
1018               }
1019             case CD_dg_save_record:
1020               {
1021                 fout << CD_dg_save << " ";
1022                 break;
1023               }
1024             case CXo_save_record:
1025               {
1026                 fout << CXo_save << " ";
1027                 break;
1028               }
1029             case CXK_save_record:
1030               {
1031                 fout << CXK_save << " ";
1032                 break;
1033               }
1034             case CX_a_save_record:
1035               {
1036                 fout << CX_a_save << " ";
1037                 break;
1038               }
1039             case CX_a2_save_record:
1040               {
1041                 fout << CX_a2_save << " ";
1042                 break;
1043               }
1044             case CX_a3_save_record:
1045               {
1046                 fout << CX_a3_save << " ";
1047                 break;
1048               }
1049             case CX_adot_save_record:
1050               {
1051                 fout << CX_adot_save << " ";
1052                 break;
1053               }
1054             case CX_q_save_record:
1055               {
1056                 fout << CX_q_save << " ";
1057                 break;
1058               }
1059             case CX_de_save_record:
1060               {
1061                 fout << CX_de_save << " ";
1062                 break;
1063               }
1064             case CX_dr_save_record:
1065               {
1066                 fout << CX_dr_save << " ";
1067                 break;
1068               }
1069             case CX_df_save_record:
1070               {
1071                 fout << CX_df_save << " ";
1072                 break;
1073               }
1074             case CX_adf_save_record:
1075               {
1076                 fout << CX_adf_save << " ";
1077                 break;
1078               }
1079             case CL_record:
1080               {
1081                 fout << CL << " ";
1082                 break;
1083               }
1084             case CLfaI_record:
1085               {
1086                 fout << CLfaI << " ";
1087                 break;
1088               }
1089             case CLfadeI_record:
1090               {
1091                 fout << CLfadeI << " ";
1092                 break;
1093               }
1094             case CLfdfI_record:
1095               {
1096                 fout << CLfdfI << " ";
1097                 break;
1098               }
1099             case CLfadfI_record:
1100               {
1101                 fout << CLfadfI << " ";
1102                 break;
1103               }
1104             case CZ_record:
1105               {
1106                 fout << CZ << " ";
1107                 break;
1108               }
1109             case CZfaI_record:
1110               {
1111                 fout << CZfaI << " ";
1112                 break;
1113               }
1114             case CZfabetafI_record:
1115               {
1116                 fout << CZfabetafI << " ";
1117                 break;
1118               }
1119             case CZfadefI_record:
1120               {
1121                 fout << CZfadefI << " ";
1122                 break;
1123               }
1124             case CZfaqfI_record:
1125               {
1126                 fout << CZfaqfI << " ";
1127                 break;
1128               }
1129             case CLo_save_record:
1130               {
1131                 fout << CLo_save << " ";
1132                 break;
1133               }
1134             case CL_a_save_record:
1135               {
1136                 fout << CL_a_save << " ";
1137                 break;
1138               }
1139             case CL_adot_save_record:
1140               {
1141                 fout << CL_adot_save << " ";
1142                 break;
1143               }
1144             case CL_q_save_record:
1145               {
1146                 fout << CL_q_save << " ";
1147                 break;
1148               }
1149             case CL_ih_save_record:
1150               {
1151                 fout << CL_ih_save << " ";
1152                 break;
1153               }
1154             case CL_de_save_record:
1155               {
1156                 fout << CL_de_save << " ";
1157                 break;
1158               }
1159             case CL_df_save_record:
1160               {
1161                 fout << CL_df_save << " ";
1162                 break;
1163               }
1164             case CL_ds_save_record:
1165               {
1166                 fout << CL_ds_save << " ";
1167                 break;
1168               }
1169             case CL_dg_save_record:
1170               {
1171                 fout << CL_dg_save << " ";
1172                 break;
1173               }
1174             case CZo_save_record:
1175               {
1176                 fout << CZo_save << " ";
1177                 break;
1178               }
1179             case CZ_a_save_record:
1180               {
1181                 fout << CZ_a_save << " ";
1182                 break;
1183               }
1184             case CZ_a2_save_record:
1185               {
1186                 fout << CZ_a2_save << " ";
1187                 break;
1188               }
1189             case CZ_a3_save_record:
1190               {
1191                 fout << CZ_a3_save << " ";
1192                 break;
1193               }
1194             case CZ_adot_save_record:
1195               {
1196                 fout << CZ_adot_save << " ";
1197                 break;
1198               }
1199             case CZ_q_save_record:
1200               {
1201                 fout << CZ_q_save << " ";
1202                 break;
1203               }
1204             case CZ_de_save_record:
1205               {
1206                 fout << CZ_de_save << " ";
1207                 break;
1208               }
1209             case CZ_deb2_save_record:
1210               {
1211                 fout << CZ_deb2_save << " ";
1212                 break;
1213               }
1214             case CZ_df_save_record:
1215               {
1216                 fout << CZ_df_save << " ";
1217                 break;
1218               }
1219             case CZ_adf_save_record:
1220               {
1221                 fout << CZ_adf_save << " ";
1222                 break;
1223               }
1224             case Cm_record:
1225               {
1226                 fout << Cm << " ";
1227                 break;
1228               }
1229             case CmfaI_record:
1230               {
1231                 fout << CmfaI << " ";
1232                 break;
1233               }
1234             case CmfadeI_record:
1235               {
1236                 fout << CmfadeI << " ";
1237                 break;
1238               }
1239             case CmfdfI_record:
1240               {
1241                 fout << CmfdfI << " ";
1242                 break;
1243               }
1244             case CmfadfI_record:
1245               {
1246                 fout << CmfadfI << " ";
1247                 break;
1248               }
1249             case CmfabetafI_record:
1250               {
1251                 fout << CmfabetafI << " ";
1252                 break;
1253               }
1254             case CmfadefI_record:
1255               {
1256                 fout << CmfadefI << " ";
1257                 break;
1258               }
1259             case CmfaqfI_record:
1260               {
1261                 fout << CmfaqfI << " ";
1262                 break;
1263               }
1264             case Cmo_save_record:
1265               {
1266                 fout << Cmo_save << " ";
1267                 break;
1268               }
1269             case Cm_a_save_record:
1270               {
1271                 fout << Cm_a_save << " ";
1272                 break;
1273               }
1274             case Cm_a2_save_record:
1275               {
1276                 fout << Cm_a2_save << " ";
1277                 break;
1278               }
1279             case Cm_adot_save_record:
1280               {
1281                 fout << Cm_adot_save << " ";
1282                 break;
1283               }
1284             case Cm_q_save_record:
1285               {
1286                 fout << Cm_q_save << " ";
1287                 break;
1288               }
1289             case Cm_ih_save_record:
1290               {
1291                 fout << Cm_ih_save << " ";
1292                 break;
1293               }
1294             case Cm_de_save_record:
1295               {
1296                 fout << Cm_de_save << " ";
1297                 break;
1298               }
1299             case Cm_b2_save_record:
1300               {
1301                 fout << Cm_b2_save << " ";
1302                 break;
1303               }
1304             case Cm_r_save_record:
1305               {
1306                 fout << Cm_r_save << " ";
1307                 break;
1308               }
1309             case Cm_df_save_record:
1310               {
1311                 fout << Cm_df_save << " ";
1312                 break;
1313               }
1314             case Cm_ds_save_record:
1315               {
1316                 fout << Cm_ds_save << " ";
1317                 break;
1318               }
1319             case Cm_dg_save_record:
1320               {
1321                 fout << Cm_dg_save << " ";
1322                 break;
1323               }
1324             case CY_record:
1325               {
1326                 fout << CY  << " ";
1327                 break;
1328               }
1329             case CYfadaI_record:
1330               {
1331                 fout << CYfadaI << " ";
1332                 break;
1333               }
1334             case CYfbetadrI_record:
1335               {
1336                 fout << CYfbetadrI << " ";
1337                 break;
1338               }
1339             case CYfabetafI_record:
1340               {
1341                 fout << CYfabetafI << " ";
1342                 break;
1343               }
1344             case CYfadafI_record:
1345               {
1346                 fout << CYfadafI << " ";
1347                 break;
1348               }
1349             case CYfadrfI_record:
1350               {
1351                 fout << CYfadrfI << " ";
1352                 break;
1353               }
1354             case CYfapfI_record:
1355               {
1356                 fout << CYfapfI << " ";
1357                 break;
1358               }
1359             case CYfarfI_record:
1360               {
1361                 fout << CYfarfI << " ";
1362                 break;
1363               }
1364             case CYo_save_record:
1365               {
1366                 fout << CYo_save << " ";
1367                 break;
1368               }
1369             case CY_beta_save_record:
1370               {
1371                 fout << CY_beta_save << " ";
1372                 break;
1373               }
1374             case CY_p_save_record:
1375               {
1376                 fout << CY_p_save << " ";
1377                 break;
1378               }
1379             case CY_r_save_record:
1380               {
1381                 fout << CY_r_save << " ";
1382                 break;
1383               }
1384             case CY_da_save_record:
1385               {
1386                 fout << CY_da_save << " ";
1387                 break;
1388               }
1389             case CY_dr_save_record:
1390               {
1391                 fout << CY_dr_save << " ";
1392                 break;
1393               }
1394             case CY_dra_save_record:
1395               {
1396                 fout << CY_dra_save << " ";
1397                 break;
1398               }
1399             case CY_bdot_save_record:
1400               {
1401                 fout << CY_bdot_save << " ";
1402                 break;
1403               }
1404             case Cl_record:
1405               {
1406                 fout << Cl << " ";
1407                 break;
1408               }
1409             case ClfadaI_record:
1410               {
1411                 fout << ClfadaI << " ";
1412                 break;
1413               }
1414             case ClfbetadrI_record:
1415               {
1416                 fout << ClfbetadrI << " ";
1417                 break;
1418               }
1419             case ClfabetafI_record:
1420               {
1421                 fout << ClfabetafI << " ";
1422                 break;
1423               }
1424             case ClfadafI_record:
1425               {
1426                 fout << ClfadafI << " ";
1427                 break;
1428               }
1429             case ClfadrfI_record:
1430               {
1431                 fout << ClfadrfI << " ";
1432                 break;
1433               }
1434             case ClfapfI_record:
1435               {
1436                 fout << ClfapfI << " ";
1437                 break;
1438               }
1439             case ClfarfI_record:
1440               {
1441                 fout << ClfarfI << " ";
1442                 break;
1443               }
1444             case Clo_save_record:
1445               {
1446                 fout << Clo_save << " ";
1447                 break;
1448               }
1449             case Cl_beta_save_record:
1450               {
1451                 fout << Cl_beta_save << " ";
1452                 break;
1453               }
1454             case Cl_p_save_record:
1455               {
1456                 fout << Cl_p_save << " ";
1457                 break;
1458               }
1459             case Cl_r_save_record:
1460               {
1461                 fout << Cl_r_save << " ";
1462                 break;
1463               }
1464             case Cl_da_save_record:
1465               {
1466                 fout << Cl_da_save << " ";
1467                 break;
1468               }
1469             case Cl_dr_save_record:
1470               {
1471                 fout << Cl_dr_save << " ";
1472                 break;
1473               }
1474             case Cl_daa_save_record:
1475               {
1476                 fout << Cl_daa_save << " ";
1477                 break;
1478               }
1479             case Cn_record:
1480               {
1481                 fout << Cn << " ";
1482                 break;
1483               }
1484             case CnfadaI_record:
1485               {
1486                 fout << CnfadaI << " ";
1487                 break;
1488               }
1489             case CnfbetadrI_record:
1490               {
1491                 fout << CnfbetadrI << " ";
1492                 break;
1493               }
1494             case CnfabetafI_record:
1495               {
1496                 fout << CnfabetafI << " ";
1497                 break;
1498               }
1499             case CnfadafI_record:
1500               {
1501                 fout << CnfadafI << " ";
1502                 break;
1503               }
1504             case CnfadrfI_record:
1505               {
1506                 fout << CnfadrfI << " ";
1507                 break;
1508               }
1509             case CnfapfI_record:
1510               {
1511                 fout << CnfapfI << " ";
1512                 break;
1513               }
1514             case CnfarfI_record:
1515               {
1516                 fout << CnfarfI << " ";
1517                 break;
1518               }
1519             case Cno_save_record:
1520               {
1521                 fout << Cno_save << " ";
1522                 break;
1523               }
1524             case Cn_beta_save_record:
1525               {
1526                 fout << Cn_beta_save << " ";
1527                 break;
1528               }
1529             case Cn_p_save_record:
1530               {
1531                 fout << Cn_p_save << " ";
1532                 break;
1533               }
1534             case Cn_r_save_record:
1535               {
1536                 fout << Cn_r_save << " ";
1537                 break;
1538               }
1539             case Cn_da_save_record:
1540               {
1541                 fout << Cn_da_save << " ";
1542                 break;
1543               }
1544             case Cn_dr_save_record:
1545               {
1546                 fout << Cn_dr_save << " ";
1547                 break;
1548               }
1549             case Cn_q_save_record:
1550               {
1551                 fout << Cn_q_save << " ";
1552                 break;
1553               }
1554             case Cn_b3_save_record:
1555               {
1556                 fout << Cn_b3_save << " ";
1557                 break;
1558               }
1559
1560               /******************** Ice Detection ********************/
1561             case CL_clean_record:
1562               {
1563                 fout << CL_clean << " ";
1564                 break;
1565               }
1566             case CL_iced_record:
1567               {
1568                 fout << CL_iced << " ";
1569                 break;
1570               }
1571             case CD_clean_record:
1572               {
1573                 fout << CD_clean << " ";
1574                 break;
1575               }
1576             case CD_iced_record:
1577               {
1578                 fout << CD_iced << " ";
1579                 break;
1580               }
1581             case Cm_clean_record:
1582               {
1583                 fout << Cm_clean << " ";
1584                 break;
1585               }
1586             case Cm_iced_record:
1587               {
1588                 fout << Cm_iced << " ";
1589                 break;
1590               }
1591             case Ch_clean_record:
1592               {
1593                 fout << Ch_clean << " ";
1594                 break;
1595               }
1596             case Ch_iced_record:
1597               {
1598                 fout << Ch_iced << " ";
1599                 break;
1600               }
1601             case Cl_clean_record:
1602               {
1603                 fout << Cl_clean << " ";
1604                 break;
1605               }
1606             case Cl_iced_record:
1607               {
1608                 fout << Cl_iced << " ";
1609                 break;
1610               }
1611             case CLclean_wing_record:
1612               {
1613                 fout << CLclean_wing << " ";
1614                 break;
1615               }
1616             case CLiced_wing_record:
1617               {
1618                 fout << CLiced_wing << " ";
1619                 break;
1620               }
1621             case CLclean_tail_record:
1622               {
1623                 fout << CLclean_tail << " ";
1624                 break;
1625               }
1626             case CLiced_tail_record:
1627               {
1628                 fout << CLiced_tail << " ";
1629                 break;
1630               }
1631             case Lift_clean_wing_record:
1632               {
1633                 fout << Lift_clean_wing << " ";
1634                 break;
1635               }
1636             case Lift_iced_wing_record:
1637               {
1638                 fout << Lift_iced_wing << " ";
1639                 break;
1640               }
1641             case Lift_clean_tail_record:
1642               {
1643                 fout << Lift_clean_tail << " ";
1644                 break;
1645               }
1646             case Lift_iced_tail_record:
1647               {
1648                 fout << Lift_iced_tail << " ";
1649                 break;
1650               }
1651             case Gamma_clean_wing_record:
1652               {
1653                 fout << Gamma_clean_wing << " ";
1654                 break;
1655               }
1656             case Gamma_iced_wing_record:
1657               {
1658                 fout << Gamma_iced_wing << " ";
1659                 break;
1660               }
1661             case Gamma_clean_tail_record:
1662               {
1663                 fout << Gamma_clean_tail << " ";
1664                 break;
1665               }
1666             case Gamma_iced_tail_record:
1667               {
1668                 fout << Gamma_iced_tail << " ";
1669                 break;
1670               }
1671             case w_clean_wing_record:
1672               {
1673                 fout << w_clean_wing << " ";
1674                 break;
1675               }
1676             case w_iced_wing_record:
1677               {
1678                 fout << w_iced_wing << " ";
1679                 break;
1680               }
1681             case w_clean_tail_record:
1682               {
1683                 fout << w_clean_tail << " ";
1684                 break;
1685               }
1686             case w_iced_tail_record:
1687               {
1688                 fout << w_iced_tail << " ";
1689                 break;
1690               }
1691             case V_total_clean_wing_record:
1692               {
1693                 fout << V_total_clean_wing << " ";
1694                 break;
1695               }
1696             case V_total_iced_wing_record:
1697               {
1698                 fout << V_total_iced_wing << " ";
1699                 break;
1700               }
1701             case V_total_clean_tail_record:
1702               {
1703                 fout << V_total_clean_tail << " ";
1704                 break;
1705               }
1706             case V_total_iced_tail_record:
1707               {
1708                 fout << V_total_iced_tail << " ";
1709                 break;
1710               }
1711             case beta_flow_clean_wing_record:
1712               {
1713                 fout << beta_flow_clean_wing << " ";
1714                 break;
1715               }
1716             case beta_flow_clean_wing_deg_record:
1717               {
1718                 fout << beta_flow_clean_wing * RAD_TO_DEG << " ";
1719                 break;
1720               }
1721             case beta_flow_iced_wing_record:
1722               {
1723                 fout << beta_flow_iced_wing << " ";
1724                 break;
1725               }
1726             case beta_flow_iced_wing_deg_record:
1727               {
1728                 fout << beta_flow_iced_wing * RAD_TO_DEG << " ";
1729                 break;
1730               }
1731             case beta_flow_clean_tail_record:
1732               {
1733                 fout << beta_flow_clean_tail << " ";
1734                 break;
1735               }
1736             case beta_flow_clean_tail_deg_record:
1737               {
1738                 fout << beta_flow_clean_tail * RAD_TO_DEG << " ";
1739                 break;
1740               }
1741             case beta_flow_iced_tail_record:
1742               {
1743                 fout << beta_flow_iced_tail << " ";
1744                 break;
1745               }
1746             case beta_flow_iced_tail_deg_record:
1747               {
1748                 fout << beta_flow_iced_tail * RAD_TO_DEG << " ";
1749                 break;
1750               }
1751             case Dbeta_flow_wing_record:
1752               {
1753                 fout << Dbeta_flow_wing << " ";
1754                 break;
1755               }
1756             case Dbeta_flow_wing_deg_record:
1757               {
1758                 fout << Dbeta_flow_wing * RAD_TO_DEG << " ";
1759                 break;
1760               }
1761             case Dbeta_flow_tail_record:
1762               {
1763                 fout << Dbeta_flow_tail << " ";
1764                 break;
1765               }
1766             case Dbeta_flow_tail_deg_record:
1767               {
1768                 fout << Dbeta_flow_tail * RAD_TO_DEG << " ";
1769                 break;
1770               }
1771             case pct_beta_flow_wing_record:
1772               {
1773                 fout << pct_beta_flow_wing << " ";
1774                 break;
1775               }
1776             case pct_beta_flow_tail_record:
1777               {
1778                 fout << pct_beta_flow_tail << " ";
1779                 break;
1780               }
1781             case eta_ice_record:
1782               {
1783                 fout << eta_ice << " ";
1784                 break;
1785               }
1786             case eta_wing_left_record:
1787               {
1788                 fout << eta_wing_left << " ";
1789                 break;
1790               }
1791             case eta_wing_right_record:
1792               {
1793                 fout << eta_wing_right << " ";
1794                 break;
1795               }
1796             case eta_tail_record:
1797               {
1798                 fout << eta_tail << " ";
1799                 break;
1800               }
1801             case delta_CL_record:
1802               {
1803                 fout << delta_CL << " ";
1804                 break;
1805               }
1806             case delta_CD_record:
1807               {
1808                 fout << delta_CD << " ";
1809                 break;
1810               }
1811             case delta_Cm_record:
1812               {
1813                 fout << delta_Cm << " ";
1814                 break;
1815               }
1816             case delta_Cl_record:
1817               {
1818                 fout << delta_Cl << " ";
1819                 break;
1820               }
1821             case delta_Cn_record:
1822               {
1823                 fout << delta_Cn << " ";
1824                 break;
1825               }
1826             case boot_cycle_tail_record:
1827               {
1828                 fout << boot_cycle_tail << " ";
1829                 break;
1830               }
1831             case boot_cycle_wing_left_record:
1832               {
1833                 fout << boot_cycle_wing_left << " ";
1834                 break;
1835               }
1836             case boot_cycle_wing_right_record:
1837               {
1838                 fout << boot_cycle_wing_right << " ";
1839                 break;
1840               }
1841             case autoIPS_tail_record:
1842               {
1843                 fout << autoIPS_tail << " ";
1844                 break;
1845               }
1846             case autoIPS_wing_left_record:
1847               {
1848                 fout << autoIPS_wing_left << " ";
1849                 break;
1850               }
1851             case autoIPS_wing_right_record:
1852               {
1853                 fout << autoIPS_wing_right << " ";
1854                 break;
1855               }
1856             case eps_pitch_input_record:
1857               {
1858                 fout << eps_pitch_input << " ";
1859                 break;
1860               }
1861             case eps_alpha_max_record:
1862               {
1863                 fout << eps_alpha_max << " ";
1864                 break;
1865               }
1866             case eps_pitch_max_record:
1867               {
1868                 fout << eps_pitch_max << " ";
1869                 break;
1870               }
1871             case eps_pitch_min_record:
1872               {
1873                 fout << eps_pitch_min << " ";
1874                 break;
1875               }
1876             case eps_roll_max_record:
1877               {
1878                 fout << eps_roll_max << " ";
1879                 break;
1880               }
1881             case eps_thrust_min_record:
1882               {
1883                 fout << eps_thrust_min << " ";
1884                 break;
1885               }
1886             case eps_flap_max_record:
1887               {
1888                 fout << eps_flap_max << " ";
1889                 break;
1890               }
1891             case eps_airspeed_max_record:
1892               {
1893                 fout << eps_airspeed_max << " ";
1894                 break;
1895               }
1896             case eps_airspeed_min_record:
1897               {
1898                 fout << eps_airspeed_min << " ";
1899                 break;
1900               }
1901             case tactilefadefI_record:
1902               {
1903                 fout << tactilefadefI << " ";
1904                 break;
1905               }
1906
1907               /*******************Autopilot***************************/
1908             case ap_Theta_ref_deg_record:
1909               {
1910                 fout << ap_Theta_ref_deg << " ";
1911                 break;
1912               }
1913             case ap_pah_on_record:
1914               {
1915                 fout << ap_pah_on << " ";
1916                 break;
1917               }
1918
1919               /************************ Forces ***********************/
1920             case F_X_wind_record:
1921               {
1922                 fout << F_X_wind << " ";
1923                 break;
1924               }
1925             case F_Y_wind_record:
1926               {
1927                 fout << F_Y_wind << " ";
1928                 break;
1929               }
1930             case F_Z_wind_record:
1931               {
1932                 fout << F_Z_wind << " ";
1933                 break;
1934               }
1935             case F_X_aero_record:
1936               {
1937                 fout << F_X_aero << " ";
1938                 break;
1939               }
1940             case F_Y_aero_record:
1941               {
1942                 fout << F_Y_aero << " ";
1943                 break;
1944               }
1945             case F_Z_aero_record:
1946               {
1947                 fout << F_Z_aero << " ";
1948                 break;
1949               }
1950             case F_X_engine_record:
1951               {
1952                 fout << F_X_engine << " ";
1953                 break;
1954               }
1955             case F_Y_engine_record:
1956               {
1957                 fout << F_Y_engine << " ";
1958                 break;
1959               }
1960             case F_Z_engine_record:
1961               {
1962                 fout << F_Z_engine << " ";
1963                 break;
1964               }
1965             case F_X_gear_record:
1966               {
1967                 fout << F_X_gear << " ";
1968                 break;
1969               }
1970             case F_Y_gear_record:
1971               {
1972                 fout << F_Y_gear << " ";
1973                 break;
1974               }
1975             case F_Z_gear_record:
1976               {
1977                 fout << F_Z_gear << " ";
1978                 break;
1979               }
1980             case F_X_record:
1981               {
1982                 fout << F_X << " ";
1983                 break;
1984               }
1985             case F_Y_record:
1986               {
1987                 fout << F_Y << " ";
1988                 break;
1989               }
1990             case F_Z_record:
1991               {
1992                 fout << F_Z << " ";
1993                 break;
1994               }
1995             case F_north_record:
1996               {
1997                 fout << F_north << " ";
1998                 break;
1999               }
2000             case F_east_record:
2001               {
2002                 fout << F_east << " ";
2003                 break;
2004               }
2005             case F_down_record:
2006               {
2007                 fout << F_down << " ";
2008                 break;
2009               }
2010
2011               /*********************** Moments ***********************/
2012             case M_l_aero_record:
2013               {
2014                 fout << M_l_aero << " ";
2015                 break;
2016               }
2017             case M_m_aero_record:
2018               {
2019                 fout << M_m_aero << " ";
2020                 break;
2021               }
2022             case M_n_aero_record:
2023               {
2024                 fout << M_n_aero << " ";
2025                 break;
2026               }
2027             case M_l_engine_record:
2028               {
2029                 fout << M_l_engine << " ";
2030                 break;
2031               }
2032             case M_m_engine_record:
2033               {
2034                 fout << M_m_engine << " ";
2035                 break;
2036               }
2037             case M_n_engine_record:
2038               {
2039                 fout << M_n_engine << " ";
2040                 break;
2041               }
2042             case M_l_gear_record:
2043               {
2044                 fout << M_l_gear << " ";
2045                 break;
2046               }
2047             case M_m_gear_record:
2048               {
2049                 fout << M_m_gear << " ";
2050                 break;
2051               }
2052             case M_n_gear_record:
2053               {
2054                 fout << M_n_gear << " ";
2055                 break;
2056               }
2057             case M_l_rp_record:
2058               {
2059                 fout << M_l_rp << " ";
2060                 break;
2061               }
2062             case M_m_rp_record:
2063               {
2064                 fout << M_m_rp << " ";
2065                 break;
2066               }
2067             case M_n_rp_record:
2068               {
2069                 fout << M_n_rp << " ";
2070                 break;
2071               }
2072
2073               /********************* flapper variables *********************/
2074             case flapper_freq_record:
2075               {
2076                 fout << flapper_freq << " ";
2077                 break;
2078               }
2079             case flapper_phi_record:
2080               {
2081                 fout << flapper_phi << " ";
2082                 break;
2083               }
2084             case flapper_phi_deg_record:
2085               {
2086                 fout << flapper_phi*RAD_TO_DEG << " ";
2087                 break;
2088               }
2089             case flapper_Lift_record:
2090               {
2091                 fout << flapper_Lift << " ";
2092                 break;
2093               }
2094             case flapper_Thrust_record:
2095               {
2096                 fout << flapper_Thrust << " ";
2097                 break;
2098               }
2099             case flapper_Inertia_record:
2100               {
2101                 fout << flapper_Inertia << " ";
2102                 break;
2103               }
2104             case flapper_Moment_record:
2105               {
2106                 fout << flapper_Moment << " ";
2107                 break;
2108               }
2109               /********* MSS debug and other data *******************/
2110               /* debug variables for use in probing data            */
2111               /* comment out old lines, and add new                 */
2112               /* only remove code that you have written             */
2113             case debug1_record:
2114               {
2115                 // eta_q term check
2116                 // fout << eta_q_Cm_q_fac << " ";
2117                 // fout << eta_q_Cm_adot_fac << " ";
2118                 // fout << eta_q_Cmfade_fac << " ";
2119                 // fout << eta_q_Cl_dr_fac << " ";
2120                 // fout << eta_q_Cm_de_fac << " ";
2121                 // eta on tail
2122                 // fout << eta_q  << " ";
2123                 // engine RPM
2124                 // fout << engineOmega * 60 / (2 * LS_PI)<< " ";
2125                 // vertical climb rate in fpm
2126                 fout << V_down * 60 << " ";
2127                 // vertical climb rate in fps
2128                 // fout << V_down << " ";
2129                 // w_induced downwash at tail due to wing
2130                 // fout << gammaWing   << " ";
2131                 //fout << outside_control << " ";
2132                 break;
2133               }
2134             case debug2_record:
2135               {
2136                 // Lift to drag ratio 
2137                 // fout <<  V_ground_speed/V_down_rel_ground << " ";
2138                 // g's through the c.g. of the aircraft
2139                 fout << (-A_Z_cg/32.174) << " ";
2140                 // L/D via forces (used in 201 class for L/D)
2141                 // fout << (F_Z_wind/F_X_wind) << " ";
2142                 // gyroscopic moment (see uiuc_wrapper.cpp)
2143                 // fout << (polarInertia * engineOmega * Q_body) << " ";
2144                 // downwashAngle at tail
2145                 // fout << downwashAngle * 57.29 << " ";
2146                 // w_induced from engine
2147                 // fout << w_induced << " ";
2148                 break;
2149               }
2150             case debug3_record:
2151               {
2152                 // die off function for eta_q
2153                 // fout << (Cos_alpha * Cos_alpha)       << " ";
2154                 // gyroscopic moment (see uiuc_wrapper.cpp)
2155                 // fout << (-polarInertia * engineOmega * R_body) << " ";
2156                 // eta on tail
2157                 // fout << eta_q << " ";
2158                 // flapper cycle percentage
2159                 fout << (sin(flapper_phi - 3 * LS_PI / 2)) << " ";
2160                 break;
2161               }
2162               /********* RD debug and other data *******************/
2163               /* debug variables for use in probing data            */
2164               /* comment out old lines, and add new                 */
2165               /* only remove code that you have written             */
2166             case debug4_record:
2167               {
2168                 // flapper F_X_aero_flapper
2169                 fout << F_X_aero_flapper << " ";
2170                 break;
2171               }
2172             case debug5_record:
2173               {
2174                 // flapper F_Z_aero_flapper
2175                 //fout << F_Z_aero_flapper << " ";
2176                 // gear_rate
2177                 fout << gear_rate << " ";
2178                 break;
2179               }
2180             case debug6_record:
2181               {
2182                 //gear_max
2183                 fout << gear_max << " ";
2184                 break;
2185               }
2186             case V_down_fpm_record:
2187               {
2188                 fout << V_down * 60 << " ";
2189                 break;
2190               }
2191             case eta_q_record:
2192               {
2193                 fout << eta_q << " ";
2194                 break;
2195               }
2196             case rpm_record:
2197               {
2198                 fout << (engineOmega * 60 / (2 * LS_PI)) << " ";
2199                 break;
2200               }
2201             case elevator_sas_deg_record:
2202               {
2203                 fout << elevator_sas * RAD_TO_DEG << " ";
2204                 break;
2205               }
2206             case aileron_sas_deg_record:
2207               {
2208                 fout << aileron_sas * RAD_TO_DEG << " ";
2209                 break;
2210               }
2211             case rudder_sas_deg_record:
2212               {
2213                 fout << rudder_sas * RAD_TO_DEG << " ";
2214                 break;
2215               }
2216             case w_induced_record:
2217               {
2218                 fout << w_induced << " ";
2219                 break;
2220               }
2221             case downwashAngle_deg_record:
2222               {
2223                 fout << downwashAngle * RAD_TO_DEG << " ";
2224                 break;
2225               }
2226             case alphaTail_deg_record:
2227               {
2228                 fout << alphaTail * RAD_TO_DEG << " ";
2229                 break;
2230               }
2231             case gammaWing_record:
2232               {
2233                 fout << gammaWing << " ";
2234                 break;
2235               }
2236             case LD_record:
2237               {
2238                 fout << V_ground_speed/V_down_rel_ground  << " ";
2239                 break;
2240               }
2241             case gload_record:
2242               {
2243                 fout << -A_Z_cg/32.174 << " ";
2244                 break;
2245               }
2246             case gyroMomentQ_record:
2247               {
2248                 fout << polarInertia * engineOmega * Q_body << " ";
2249                 break;
2250               }
2251             case gyroMomentR_record:
2252               {
2253                 fout << -polarInertia * engineOmega * R_body << " ";
2254                 break;
2255               }
2256             case Gear_handle_record:
2257               {
2258                 fout << Gear_handle << " ";
2259                 break;
2260               }
2261             case gear_cmd_norm_record:
2262               {
2263                 fout << gear_cmd_norm << " ";
2264                 break;
2265               }
2266             case gear_pos_norm_record:
2267               {
2268                 fout << gear_pos_norm << " ";
2269                 break;
2270               }
2271               /****************Trigger Variables*******************/
2272             case trigger_on_record:
2273               {
2274                 fout << trigger_on << " ";
2275                 break;
2276               }
2277             case trigger_num_record:
2278               {
2279                 fout << trigger_num << " ";
2280                 break;
2281               }
2282             case trigger_toggle_record:
2283               {
2284                 fout << trigger_toggle << " ";
2285                 break;
2286               }
2287             case trigger_counter_record:
2288               {
2289                 fout << trigger_counter << " ";
2290                 break;
2291               }
2292             };
2293         } // end record map
2294     }
2295   recordStep++;
2296 }
2297
2298 // end uiuc_recorder.cpp