1 // bfi.cxx - Big Friendly Interface implementation
3 // Written by David Megginson, started February, 2000.
5 // Copyright (C) 2000 David Megginson - david@megginson.com
7 // THIS CLASS IS DEPRECATED; USE THE PROPERTY MANAGER INSTEAD.
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <simgear/constants.h>
28 #include <simgear/debug/logstream.hxx>
29 #include <simgear/ephemeris/ephemeris.hxx>
30 #include <simgear/math/sg_types.hxx>
31 #include <simgear/misc/props.hxx>
32 #include <simgear/timing/sg_time.hxx>
34 #include <Aircraft/aircraft.hxx>
35 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
36 #include <Controls/controls.hxx>
37 #include <Autopilot/newauto.hxx>
38 #include <Scenery/scenery.hxx>
39 #include <Time/light.hxx>
40 #include <Time/event.hxx>
41 #include <Time/sunpos.hxx>
42 #include <Time/tmp.hxx>
43 #include <Cockpit/radiostack.hxx>
44 #include <Cockpit/panel.hxx>
45 #ifndef FG_OLD_WEATHER
46 # include <WeatherCM/FGLocalWeatherDatabase.h>
48 # include <Weather/weather.hxx>
51 #include "globals.hxx"
52 #include "fg_init.hxx"
53 #include "fg_props.hxx"
55 FG_USING_NAMESPACE(std);
62 ////////////////////////////////////////////////////////////////////////
64 ////////////////////////////////////////////////////////////////////////
66 // Yech -- not thread-safe, etc. etc.
67 static bool _needReinit = false;
70 static inline void needReinit ()
77 * Reinitialize FGFS to use the new BFI settings.
82 // Save the state of everything
83 // that's going to get clobbered
84 // when we reinit the subsystems.
86 FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI reinit");
88 // TODO: add more AP stuff
89 bool apHeadingLock = FGBFI::getAPHeadingLock();
90 double apHeadingMag = FGBFI::getAPHeadingMag();
91 bool apAltitudeLock = FGBFI::getAPAltitudeLock();
92 double apAltitude = FGBFI::getAPAltitude();
93 bool gpsLock = FGBFI::getGPSLock();
94 // double gpsLatitude = FGBFI::getGPSTargetLatitude();
95 // double gpsLongitude = FGBFI::getGPSTargetLongitude();
99 // FIXME: this is wrong.
100 // All of these are scheduled events,
101 // and it should be possible to force
102 // them all to run once.
105 cur_light_params.Update();
107 fgUpdateWeatherDatabase();
108 current_radiostack->search();
110 // Restore all of the old states.
111 FGBFI::setAPHeadingLock(apHeadingLock);
112 FGBFI::setAPHeadingMag(apHeadingMag);
113 FGBFI::setAPAltitudeLock(apAltitudeLock);
114 FGBFI::setAPAltitude(apAltitude);
115 FGBFI::setGPSLock(gpsLock);
119 FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI reinit");
123 // Allow the view to be set from two axes (i.e. a joystick hat)
124 // This needs to be in FGViewer itself, somehow.
125 static double axisLong = 0.0;
126 static double axisLat = 0.0;
129 _set_view_from_axes ()
131 // Take no action when hat is centered
132 if (axisLong == 0 && axisLat == 0)
137 if (axisLong < 0) { // Longitudinal axis forward
140 else if (axisLat > 0)
144 } else if (axisLong > 0) { // Longitudinal axis backward
147 else if (axisLat > 0)
151 } else { // Longitudinal axis neutral
158 globals->get_current_view()->set_goal_view_offset(viewDir*DEG_TO_RAD);
159 // globals->get_current_view()->set_view_offset(viewDir*DEG_TO_RAD);
166 ////////////////////////////////////////////////////////////////////////
168 ////////////////////////////////////////////////////////////////////////
171 * Initialize the BFI by binding its functions to properties.
173 * TODO: perhaps these should migrate into the individual modules
174 * (i.e. they should register themselves).
179 FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI init");
182 fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
183 fgTie("/sim/time/gmt", getDateString, setDateString);
184 fgTie("/sim/time/gmt-string", getGMTString);
187 fgTie("/orientation/heading-magnetic", getHeadingMag);
190 fgTie("/engines/engine0/rpm", getRPM);
191 fgTie("/engines/engine0/egt", getEGT);
192 fgTie("/engines/engine0/cht", getCHT);
193 fgTie("/engines/engine0/mp", getMP);
196 fgTie("/autopilot/locks/altitude", getAPAltitudeLock, setAPAltitudeLock);
197 fgTie("/autopilot/settings/altitude", getAPAltitude, setAPAltitude);
198 fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
199 fgTie("/autopilot/settings/heading", getAPHeading, setAPHeading);
200 fgTie("/autopilot/settings/heading-dg", getAPHeadingDG, setAPHeadingDG);
201 fgTie("/autopilot/settings/heading-magnetic",
202 getAPHeadingMag, setAPHeadingMag);
203 fgTie("/autopilot/locks/nav1", getAPNAV1Lock, setAPNAV1Lock);
206 fgTie("/environment/visibility", getVisibility, setVisibility);
207 fgTie("/environment/wind-north", getWindNorth, setWindNorth);
208 fgTie("/environment/wind-east", getWindEast, setWindEast);
209 fgTie("/environment/wind-down", getWindDown, setWindDown);
212 fgTie("/sim/field-of-view", getFOV, setFOV);
213 fgTie("/sim/view/axes/long", (double(*)())0, setViewAxisLong);
214 fgTie("/sim/view/axes/lat", (double(*)())0, setViewAxisLat);
218 FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI init");
223 * Reinitialize FGFS if required.
225 * Some changes (especially those in aircraft position) require that
226 * FGFS be reinitialized afterwards. Rather than reinitialize after
227 * every change, the setter methods simply set a flag so that there
228 * can be a single reinit at the end of the frame.
233 _set_view_from_axes();
241 ////////////////////////////////////////////////////////////////////////
243 ////////////////////////////////////////////////////////////////////////
247 * Return the current aircraft directory (UIUC) as a string.
250 FGBFI::getAircraftDir ()
257 * Set the current aircraft directory (UIUC).
260 FGBFI::setAircraftDir (string dir)
262 if (getAircraftDir() != dir) {
270 * Return the current Zulu time.
273 FGBFI::getDateString ()
277 struct tm * t = globals->get_time_params()->getGmt();
278 sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
279 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
280 t->tm_hour, t->tm_min, t->tm_sec);
287 * Set the current Zulu time.
290 FGBFI::setDateString (string date_string)
291 // FGBFI::setTimeGMT (time_t time)
293 SGTime * st = globals->get_time_params();
294 struct tm * current_time = st->getGmt();
297 // Scan for basic ISO format
298 // YYYY-MM-DDTHH:MM:SS
299 int ret = sscanf(date_string.c_str(), "%d-%d-%dT%d:%d:%d",
300 &(new_time.tm_year), &(new_time.tm_mon),
301 &(new_time.tm_mday), &(new_time.tm_hour),
302 &(new_time.tm_min), &(new_time.tm_sec));
304 // Be pretty picky about this, so
305 // that strange things don't happen
306 // if the save file has been edited
309 FG_LOG(FG_INPUT, FG_ALERT, "Date/time string " << date_string
310 << " not in YYYY-MM-DDTHH:MM:SS format; skipped");
314 // OK, it looks like we got six
315 // values, one way or another.
316 new_time.tm_year -= 1900;
317 new_time.tm_mon -= 1;
319 // Now, tell flight gear to use
320 // the new time. This was far
321 // too difficult, by the way.
323 mktime(&new_time) - mktime(current_time) + globals->get_warp();
324 double lon = current_aircraft.fdm_state->get_Longitude();
325 double lat = current_aircraft.fdm_state->get_Latitude();
326 double alt = current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER;
327 globals->set_warp(warp);
328 st->update(lon, lat, warp);
329 fgUpdateSkyAndLightingParams();
334 * Return the GMT as a string.
337 FGBFI::getGMTString ()
341 struct tm * t = globals->get_time_params()->getGmt();
342 sprintf(buf, " %.2d:%.2d:%.2d",
343 t->tm_hour, t->tm_min, t->tm_sec);
350 ////////////////////////////////////////////////////////////////////////
352 ////////////////////////////////////////////////////////////////////////
356 * Return the current latitude in degrees (negative for south).
359 FGBFI::getLatitude ()
361 return current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
366 * Set the current latitude in degrees (negative for south).
369 FGBFI::setLatitude (double latitude)
371 current_aircraft.fdm_state->set_Latitude(latitude * DEG_TO_RAD);
376 * Return the current longitude in degrees (negative for west).
379 FGBFI::getLongitude ()
381 return current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
386 * Set the current longitude in degrees (negative for west).
389 FGBFI::setLongitude (double longitude)
391 current_aircraft.fdm_state->set_Longitude(longitude * DEG_TO_RAD);
396 * Return the current altitude in feet.
399 FGBFI::getAltitude ()
401 return current_aircraft.fdm_state->get_Altitude();
407 * Return the current altitude in above the terrain.
412 return current_aircraft.fdm_state->get_Altitude()
413 - (scenery.cur_elev * METER_TO_FEET);
418 * Set the current altitude in feet.
421 FGBFI::setAltitude (double altitude)
423 current_aircraft.fdm_state->set_Altitude(altitude);
428 ////////////////////////////////////////////////////////////////////////
430 ////////////////////////////////////////////////////////////////////////
434 * Return the current heading in degrees.
439 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG;
444 * Return the current heading in degrees.
447 FGBFI::getHeadingMag ()
449 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG - getMagVar();
454 * Set the current heading in degrees.
457 FGBFI::setHeading (double heading)
459 FGInterface * fdm = current_aircraft.fdm_state;
460 fdm->set_Euler_Angles(fdm->get_Phi(), fdm->get_Theta(),
461 heading * DEG_TO_RAD);
466 * Return the current pitch in degrees.
471 return current_aircraft.fdm_state->get_Theta() * RAD_TO_DEG;
476 * Set the current pitch in degrees.
479 FGBFI::setPitch (double pitch)
481 FGInterface * fdm = current_aircraft.fdm_state;
482 fdm->set_Euler_Angles(fdm->get_Phi(), pitch * DEG_TO_RAD, fdm->get_Psi());
487 * Return the current roll in degrees.
492 return current_aircraft.fdm_state->get_Phi() * RAD_TO_DEG;
497 * Set the current roll in degrees.
500 FGBFI::setRoll (double roll)
502 FGInterface * fdm = current_aircraft.fdm_state;
503 fdm->set_Euler_Angles(roll * DEG_TO_RAD, fdm->get_Theta(), fdm->get_Psi());
508 * Return the current engine0 rpm
513 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
514 return current_aircraft.fdm_state->get_engine(0)->get_RPM();
522 * Set the current engine0 rpm
525 FGBFI::setRPM (double rpm)
527 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
528 if (getRPM() != rpm) {
529 current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm );
536 * Return the current engine0 EGT.
541 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
542 return current_aircraft.fdm_state->get_engine(0)->get_EGT();
550 * Return the current engine0 CHT.
555 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
556 return current_aircraft.fdm_state->get_engine(0)->get_CHT();
564 * Return the current engine0 CHT.
569 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
570 return current_aircraft.fdm_state->get_engine(0)->get_Manifold_Pressure();
578 ////////////////////////////////////////////////////////////////////////
580 ////////////////////////////////////////////////////////////////////////
584 * Return the current airspeed in knots.
587 FGBFI::getAirspeed ()
589 // FIXME: should we add speed-up?
590 return current_aircraft.fdm_state->get_V_calibrated_kts();
595 * Set the calibrated airspeed in knots.
598 FGBFI::setAirspeed (double speed)
600 current_aircraft.fdm_state->set_V_calibrated_kts(speed);
605 * Return the current sideslip (FIXME: units unknown).
608 FGBFI::getSideSlip ()
610 return current_aircraft.fdm_state->get_Beta();
615 * Return the current climb rate in feet/minute
618 FGBFI::getVerticalSpeed ()
620 // What about meters?
621 return current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
626 * Get the current north velocity (units??).
629 FGBFI::getSpeedNorth ()
631 return current_aircraft.fdm_state->get_V_north();
636 // * Set the current north velocity (units??).
639 // FGBFI::setSpeedNorth (double speed)
641 // FGInterface * fdm = current_aircraft.fdm_state;
642 // // fdm->set_Velocities_Local(speed, fdm->get_V_east(), fdm->get_V_down());
647 * Get the current east velocity (units??).
650 FGBFI::getSpeedEast ()
652 return current_aircraft.fdm_state->get_V_east();
657 // * Set the current east velocity (units??).
660 // FGBFI::setSpeedEast (double speed)
662 // FGInterface * fdm = current_aircraft.fdm_state;
663 // // fdm->set_Velocities_Local(fdm->get_V_north(), speed, fdm->get_V_down());
668 * Get the current down velocity (units??).
671 FGBFI::getSpeedDown ()
673 return current_aircraft.fdm_state->get_V_down();
678 // * Set the current down velocity (units??).
681 // FGBFI::setSpeedDown (double speed)
683 // FGInterface * fdm = current_aircraft.fdm_state;
684 // // fdm->set_Velocities_Local(fdm->get_V_north(), fdm->get_V_east(), speed);
689 ////////////////////////////////////////////////////////////////////////
691 ////////////////////////////////////////////////////////////////////////
696 * Get the throttle setting, from 0.0 (none) to 1.0 (full).
699 FGBFI::getThrottle ()
701 // FIXME: add engine selector
702 return controls.get_throttle(0);
707 * Set the throttle, from 0.0 (none) to 1.0 (full).
710 FGBFI::setThrottle (double throttle)
712 // FIXME: allow engine selection
713 controls.set_throttle(0, throttle);
718 * Get the fuel mixture setting, from 0.0 (none) to 1.0 (full).
723 // FIXME: add engine selector
724 return controls.get_mixture(0);
729 * Set the fuel mixture, from 0.0 (none) to 1.0 (full).
732 FGBFI::setMixture (double mixture)
734 // FIXME: allow engine selection
735 controls.set_mixture(0, mixture);
740 * Get the propellor pitch setting, from 0.0 (none) to 1.0 (full).
743 FGBFI::getPropAdvance ()
745 // FIXME: add engine selector
746 return controls.get_prop_advance(0);
751 * Set the propellor pitch, from 0.0 (none) to 1.0 (full).
754 FGBFI::setPropAdvance (double pitch)
756 // FIXME: allow engine selection
757 controls.set_prop_advance(0, pitch);
762 * Get the flaps setting, from 0.0 (none) to 1.0 (full).
767 return controls.get_flaps();
772 * Set the flaps, from 0.0 (none) to 1.0 (full).
775 FGBFI::setFlaps (double flaps)
778 controls.set_flaps(flaps);
783 * Get the aileron, from -1.0 (left) to 1.0 (right).
788 return controls.get_aileron();
793 * Set the aileron, from -1.0 (left) to 1.0 (right).
796 FGBFI::setAileron (double aileron)
799 controls.set_aileron(aileron);
804 * Get the rudder setting, from -1.0 (left) to 1.0 (right).
809 return controls.get_rudder();
814 * Set the rudder, from -1.0 (left) to 1.0 (right).
817 FGBFI::setRudder (double rudder)
820 controls.set_rudder(rudder);
825 * Get the elevator setting, from -1.0 (down) to 1.0 (up).
828 FGBFI::getElevator ()
830 return controls.get_elevator();
835 * Set the elevator, from -1.0 (down) to 1.0 (up).
838 FGBFI::setElevator (double elevator)
841 controls.set_elevator(elevator);
846 * Get the elevator trim, from -1.0 (down) to 1.0 (up).
849 FGBFI::getElevatorTrim ()
851 return controls.get_elevator_trim();
856 * Set the elevator trim, from -1.0 (down) to 1.0 (up).
859 FGBFI::setElevatorTrim (double trim)
862 controls.set_elevator_trim(trim);
867 * Get the highest brake setting, from 0.0 (none) to 1.0 (full).
872 double b1 = getCenterBrake();
873 double b2 = getLeftBrake();
874 double b3 = getRightBrake();
875 return (b1 > b2 ? (b1 > b3 ? b1 : b3) : (b2 > b3 ? b2 : b3));
880 * Set all brakes, from 0.0 (none) to 1.0 (full).
883 FGBFI::setBrakes (double brake)
885 setCenterBrake(brake);
887 setRightBrake(brake);
892 * Get the center brake, from 0.0 (none) to 1.0 (full).
895 FGBFI::getCenterBrake ()
897 return controls.get_brake(2);
902 * Set the center brake, from 0.0 (none) to 1.0 (full).
905 FGBFI::setCenterBrake (double brake)
907 controls.set_brake(2, brake);
912 * Get the left brake, from 0.0 (none) to 1.0 (full).
915 FGBFI::getLeftBrake ()
917 return controls.get_brake(0);
922 * Set the left brake, from 0.0 (none) to 1.0 (full).
925 FGBFI::setLeftBrake (double brake)
927 controls.set_brake(0, brake);
932 * Get the right brake, from 0.0 (none) to 1.0 (full).
935 FGBFI::getRightBrake ()
937 return controls.get_brake(1);
942 * Set the right brake, from 0.0 (none) to 1.0 (full).
945 FGBFI::setRightBrake (double brake)
947 controls.set_brake(1, brake);
954 ////////////////////////////////////////////////////////////////////////
956 ////////////////////////////////////////////////////////////////////////
960 * Get the autopilot altitude lock (true=on).
963 FGBFI::getAPAltitudeLock ()
965 return current_autopilot->get_AltitudeEnabled();
970 * Set the autopilot altitude lock (true=on).
973 FGBFI::setAPAltitudeLock (bool lock)
975 current_autopilot->set_AltitudeMode(FGAutopilot::FG_ALTITUDE_LOCK);
976 current_autopilot->set_AltitudeEnabled(lock);
981 * Get the autopilot target altitude in feet.
984 FGBFI::getAPAltitude ()
986 return current_autopilot->get_TargetAltitude() * METER_TO_FEET;
991 * Set the autopilot target altitude in feet.
994 FGBFI::setAPAltitude (double altitude)
996 current_autopilot->set_TargetAltitude( altitude );
1001 * Get the autopilot heading lock (true=on).
1004 FGBFI::getAPHeadingLock ()
1007 (current_autopilot->get_HeadingEnabled() &&
1008 current_autopilot->get_HeadingMode() == FGAutopilot::FG_DG_HEADING_LOCK);
1013 * Set the autopilot heading lock (true=on).
1016 FGBFI::setAPHeadingLock (bool lock)
1019 // We need to do this so that
1020 // it's possible to lock onto a
1021 // heading other than the current
1023 double heading = getAPHeadingMag();
1024 current_autopilot->set_HeadingMode(FGAutopilot::FG_DG_HEADING_LOCK);
1025 current_autopilot->set_HeadingEnabled(true);
1026 setAPHeadingMag(heading);
1027 } else if (current_autopilot->get_HeadingMode() ==
1028 FGAutopilot::FG_DG_HEADING_LOCK) {
1029 current_autopilot->set_HeadingEnabled(false);
1035 * Get the autopilot target heading in degrees.
1038 FGBFI::getAPHeading ()
1040 return current_autopilot->get_TargetHeading();
1045 * Set the autopilot target heading in degrees.
1048 FGBFI::setAPHeading (double heading)
1050 current_autopilot->set_TargetHeading( heading );
1055 * Get the autopilot DG target heading in degrees.
1058 FGBFI::getAPHeadingDG ()
1060 return current_autopilot->get_DGTargetHeading();
1065 * Set the autopilot DG target heading in degrees.
1068 FGBFI::setAPHeadingDG (double heading)
1070 current_autopilot->set_DGTargetHeading( heading );
1075 * Get the autopilot target heading in degrees.
1078 FGBFI::getAPHeadingMag ()
1080 return current_autopilot->get_TargetHeading() - getMagVar();
1085 * Set the autopilot target heading in degrees.
1088 FGBFI::setAPHeadingMag (double heading)
1090 current_autopilot->set_TargetHeading( heading + getMagVar() );
1095 * Return true if the autopilot is locked to NAV1.
1098 FGBFI::getAPNAV1Lock ()
1101 (current_autopilot->get_HeadingEnabled() &&
1102 current_autopilot->get_HeadingMode() == FGAutopilot::FG_HEADING_NAV1);
1107 * Set the autopilot NAV1 lock.
1110 FGBFI::setAPNAV1Lock (bool lock)
1113 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_NAV1);
1114 current_autopilot->set_HeadingEnabled(true);
1115 } else if (current_autopilot->get_HeadingMode() ==
1116 FGAutopilot::FG_HEADING_NAV1) {
1117 current_autopilot->set_HeadingEnabled(false);
1123 ////////////////////////////////////////////////////////////////////////
1125 ////////////////////////////////////////////////////////////////////////
1129 * Get the autopilot GPS lock (true=on).
1132 FGBFI::getGPSLock ()
1134 return (current_autopilot->get_HeadingEnabled() &&
1135 (current_autopilot->get_HeadingMode() ==
1136 FGAutopilot::FG_HEADING_WAYPOINT ));
1141 * Set the autopilot GPS lock (true=on).
1144 FGBFI::setGPSLock (bool lock)
1147 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_WAYPOINT);
1148 current_autopilot->set_HeadingEnabled(true);
1149 } else if (current_autopilot->get_HeadingMode() ==
1150 FGAutopilot::FG_HEADING_WAYPOINT) {
1151 current_autopilot->set_HeadingEnabled(false);
1157 * Get the GPS target latitude in degrees (negative for south).
1160 FGBFI::getGPSTargetLatitude ()
1162 return current_autopilot->get_TargetLatitude();
1167 * Get the GPS target longitude in degrees (negative for west).
1170 FGBFI::getGPSTargetLongitude ()
1172 return current_autopilot->get_TargetLongitude();
1177 * Set the GPS target longitude in degrees (negative for west).
1180 FGBFI::setGPSTargetLongitude (double longitude)
1182 current_autopilot->set_TargetLongitude( longitude );
1188 ////////////////////////////////////////////////////////////////////////
1190 ////////////////////////////////////////////////////////////////////////
1194 * Get the current visibility (meters).
1197 FGBFI::getVisibility ()
1199 #ifndef FG_OLD_WEATHER
1200 return WeatherDatabase->getWeatherVisibility();
1202 return current_weather.get_visibility();
1208 * Set the current visibility (meters).
1211 FGBFI::setVisibility (double visibility)
1213 #ifndef FG_OLD_WEATHER
1214 WeatherDatabase->setWeatherVisibility(visibility);
1216 current_weather.set_visibility(visibility);
1222 * Get the current wind north velocity (feet/second).
1225 FGBFI::getWindNorth ()
1227 return current_aircraft.fdm_state->get_V_north_airmass();
1232 * Set the current wind north velocity (feet/second).
1235 FGBFI::setWindNorth (double speed)
1237 current_aircraft.fdm_state->set_Velocities_Local_Airmass(speed,
1244 * Get the current wind east velocity (feet/second).
1247 FGBFI::getWindEast ()
1249 return current_aircraft.fdm_state->get_V_east_airmass();
1254 * Set the current wind east velocity (feet/second).
1257 FGBFI::setWindEast (double speed)
1259 cout << "Set wind-east to " << speed << endl;
1260 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1267 * Get the current wind down velocity (feet/second).
1270 FGBFI::getWindDown ()
1272 return current_aircraft.fdm_state->get_V_down_airmass();
1277 * Set the current wind down velocity (feet/second).
1280 FGBFI::setWindDown (double speed)
1282 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1289 ////////////////////////////////////////////////////////////////////////
1291 ////////////////////////////////////////////////////////////////////////
1296 globals->get_current_view()->get_fov();
1300 FGBFI::setFOV (double fov)
1302 globals->get_current_view()->set_fov( fov );
1306 FGBFI::setViewAxisLong (double axis)
1312 FGBFI::setViewAxisLat (double axis)
1318 ////////////////////////////////////////////////////////////////////////
1320 ////////////////////////////////////////////////////////////////////////
1323 * Return the magnetic variation
1328 return globals->get_mag()->get_magvar() * RAD_TO_DEG;
1333 * Return the magnetic variation
1338 return globals->get_mag()->get_magdip() * RAD_TO_DEG;