1 /**********************************************************************
3 FILENAME: uiuc_menu_misc.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: reads input data for specified aircraft and creates
8 approporiate data storage space
10 ----------------------------------------------------------------------
14 ----------------------------------------------------------------------
16 REFERENCES: based on "menu reader" format of Michael Selig
18 ----------------------------------------------------------------------
20 HISTORY: 04/04/2003 initial release
21 06/30/2003 (RD) replaced istrstream with istringstream
22 to get rid of the annoying warning about
23 using the strstream header
25 ----------------------------------------------------------------------
27 AUTHOR(S): Robert Deters <rdeters@uiuc.edu>
28 Michael Selig <m-selig@uiuc.edu>
30 ----------------------------------------------------------------------
34 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
42 ----------------------------------------------------------------------
44 CALLED BY: uiuc_menu()
46 ----------------------------------------------------------------------
48 CALLS TO: check_float() if needed
54 ----------------------------------------------------------------------
56 COPYRIGHT: (C) 2003 by Michael Selig
58 This program is free software; you can redistribute it and/or
59 modify it under the terms of the GNU General Public License
60 as published by the Free Software Foundation.
62 This program is distributed in the hope that it will be useful,
63 but WITHOUT ANY WARRANTY; without even the implied warranty of
64 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65 GNU General Public License for more details.
67 You should have received a copy of the GNU General Public License
68 along with this program; if not, write to the Free Software
69 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
71 **********************************************************************/
73 #include <simgear/compiler.h>
80 #include "uiuc_menu_misc.h"
90 void parse_misc( const string& linetoken2, const string& linetoken3,
91 const string& linetoken4, const string& linetoken5,
92 const string& linetoken6, const string& linetoken7,
93 const string& linetoken8, const string& linetoken9,
94 const string& linetoken10, const string& aircraft_directory,
97 istringstream token3(linetoken3.c_str());
98 istringstream token4(linetoken4.c_str());
99 istringstream token5(linetoken5.c_str());
100 istringstream token6(linetoken6.c_str());
101 istringstream token7(linetoken7.c_str());
102 istringstream token8(linetoken8.c_str());
103 istringstream token9(linetoken9.c_str());
104 istringstream token10(linetoken10.c_str());
106 switch(misc_map[linetoken2])
108 case simpleHingeMomentCoef_flag:
110 if (check_float(linetoken3))
111 token3 >> token_value;
113 uiuc_warnings_errors(1, *command_line);
115 simpleHingeMomentCoef = token_value;
118 //case dfTimefdf_flag:
120 //dfTimefdf = linetoken3;
121 /* call 1D File Reader with file name (dfTimefdf);
122 function returns array of dfs (dfArray) and
123 corresponding time values (TimeArray) and max
124 number of terms in arrays (ndf) */
125 //uiuc_1DdataFileReader(dfTimefdf,
126 // dfTimefdf_dfArray,
127 // dfTimefdf_TimeArray,
135 flap_file = aircraft_directory + "flap.dat";
136 flapper_model = true;
137 flapper_data = new FlapData(flap_file.c_str());
140 case flapper_phi_init_flag:
142 if (check_float(linetoken3))
143 token3 >> token_value;
145 uiuc_warnings_errors(1, *command_line);
147 flapper_phi_init = token_value*DEG_TO_RAD;
152 if (ignore_unknown_keywords) {
155 // print error message
156 uiuc_warnings_errors(2, *command_line);