Changeset 20:89be93500e98 in xplra
- Timestamp:
- 02/03/13 14:58:36 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/multigettest.cc
r19 r20 51 51 bool dontregister = false; 52 52 for(int i = 1; i<argc; ++i) { 53 if (strcmp(argv[i], "dontregister") ) {53 if (strcmp(argv[i], "dontregister")==0) { 54 54 dontregister = true; 55 55 } … … 65 65 MultiGetter getter(xplane); 66 66 67 const size_t tailnumID = getter.addByteArray("sim/aircraft/view/acf_tailnum", 40); 68 const size_t daysID = getter.addInt("sim/time/local_date_days"); 69 const size_t zuluSecID = getter.addFloat("sim/time/zulu_time_sec"); 67 70 const size_t pausedID = getter.addInt("sim/time/paused"); 68 71 const size_t latitudeID = getter.addDouble("sim/flightmodel/position/latitude"); … … 99 102 const size_t altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting"); 100 103 const size_t qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic"); 104 const size_t navTypesID = getter.addIntArray("sim/cockpit/radios/nav_type", 6); 105 const size_t busVoltsID = getter.addFloatArray("sim/cockpit2/electrical/bus_volts", 4); 101 106 102 107 if (dontregister) { 103 108 getter.finalize(); 104 109 } else { 105 printf("Registering getter \n\n");110 printf("Registering getter...\n"); 106 111 getter.registerInXPlane(); 112 printf("Registered getter.\n\n"); 107 113 } 108 114 115 const int32_t& days = getter.getIntRef(daysID); 116 const float& zuluSec = getter.getFloatRef(zuluSecID); 117 printf("AAA2\n"); 109 118 const int32_t& paused = getter.getIntRef(pausedID); 110 119 const double& latitude = getter.getDoubleRef(latitudeID); … … 142 151 const float& altimeter = getter.getFloatRef(altimeterID); 143 152 const float& qnh = getter.getFloatRef(qnhID); 153 const int32_t* navTypes = getter.getIntArray(navTypesID); 154 const float* busVolts = getter.getFloatArray(busVoltsID); 144 155 145 156 while(true) { 146 157 getter.execute(); 158 printf("tail number: '%s', days: %d, zuluSec: %f\n", 159 getter.getString(tailnumID).c_str(), days, zuluSec); 147 160 printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n", 148 161 paused, replay, overspeed, stalled, onTheGround); … … 161 174 printf("altimeter: %f, qnh: %f\n", 162 175 altimeter, qnh); 176 printf("NAV types: %d %d %d %d %d %d\n", 177 navTypes[0], navTypes[1], navTypes[2], 178 navTypes[3], navTypes[4], navTypes[5]); 179 printf("bus voltages: %f %f %f %f\n", 180 busVolts[0], busVolts[1], busVolts[2], busVolts[3]); 163 181 printf("\n"); 164 182 Thread::sleep(1000);
Note:
See TracChangeset
for help on using the changeset viewer.