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 ////////////////////////////////////////////////////////////////////////
172 * Initialize the BFI by binding its functions to properties.
174 * TODO: perhaps these should migrate into the individual modules
175 * (i.e. they should register themselves).
180 FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI init");
183 fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
184 fgTie("/sim/time/gmt", getDateString, setDateString);
185 fgTie("/sim/time/gmt-string", getGMTString);
188 fgTie("/orientation/heading-magnetic", getHeadingMag);
191 fgTie("/engines/engine0/rpm", getRPM);
192 fgTie("/engines/engine0/egt", getEGT);
193 fgTie("/engines/engine0/cht", getCHT);
194 fgTie("/engines/engine0/mp", getMP);
197 fgTie("/autopilot/locks/altitude", getAPAltitudeLock, setAPAltitudeLock);
198 fgTie("/autopilot/settings/altitude", getAPAltitude, setAPAltitude);
199 fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
200 fgTie("/autopilot/settings/heading", getAPHeading, setAPHeading);
201 fgTie("/autopilot/settings/heading-dg", getAPHeadingDG, setAPHeadingDG, false);
202 fgTie("/autopilot/settings/heading-magnetic",
203 getAPHeadingMag, setAPHeadingMag);
204 fgTie("/autopilot/locks/nav1", getAPNAV1Lock, setAPNAV1Lock);
207 fgTie("/environment/visibility", getVisibility, setVisibility);
208 fgTie("/environment/wind-north", getWindNorth, setWindNorth);
209 fgTie("/environment/wind-east", getWindEast, setWindEast);
210 fgTie("/environment/wind-down", getWindDown, setWindDown);
213 fgTie("/sim/field-of-view", getFOV, setFOV);
214 fgTie("/sim/view/axes/long", (double(*)())0, setViewAxisLong);
215 fgTie("/sim/view/axes/lat", (double(*)())0, setViewAxisLat);
219 FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI init");
224 * Reinitialize FGFS if required.
226 * Some changes (especially those in aircraft position) require that
227 * FGFS be reinitialized afterwards. Rather than reinitialize after
228 * every change, the setter methods simply set a flag so that there
229 * can be a single reinit at the end of the frame.
234 _set_view_from_axes();
242 ////////////////////////////////////////////////////////////////////////
244 ////////////////////////////////////////////////////////////////////////
248 * Return the current aircraft directory (UIUC) as a string.
251 FGBFI::getAircraftDir ()
258 * Set the current aircraft directory (UIUC).
261 FGBFI::setAircraftDir (string dir)
263 if (getAircraftDir() != dir) {
271 * Return the current Zulu time.
274 FGBFI::getDateString ()
278 struct tm * t = globals->get_time_params()->getGmt();
279 sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
280 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
281 t->tm_hour, t->tm_min, t->tm_sec);
288 * Set the current Zulu time.
291 FGBFI::setDateString (string date_string)
292 // FGBFI::setTimeGMT (time_t time)
294 SGTime * st = globals->get_time_params();
295 struct tm * current_time = st->getGmt();
298 // Scan for basic ISO format
299 // YYYY-MM-DDTHH:MM:SS
300 int ret = sscanf(date_string.c_str(), "%d-%d-%dT%d:%d:%d",
301 &(new_time.tm_year), &(new_time.tm_mon),
302 &(new_time.tm_mday), &(new_time.tm_hour),
303 &(new_time.tm_min), &(new_time.tm_sec));
305 // Be pretty picky about this, so
306 // that strange things don't happen
307 // if the save file has been edited
310 FG_LOG(FG_INPUT, FG_ALERT, "Date/time string " << date_string
311 << " not in YYYY-MM-DDTHH:MM:SS format; skipped");
315 // OK, it looks like we got six
316 // values, one way or another.
317 new_time.tm_year -= 1900;
318 new_time.tm_mon -= 1;
320 // Now, tell flight gear to use
321 // the new time. This was far
322 // too difficult, by the way.
324 mktime(&new_time) - mktime(current_time) + globals->get_warp();
325 double lon = current_aircraft.fdm_state->get_Longitude();
326 double lat = current_aircraft.fdm_state->get_Latitude();
327 double alt = current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER;
328 globals->set_warp(warp);
329 st->update(lon, lat, warp);
330 fgUpdateSkyAndLightingParams();
335 * Return the GMT as a string.
338 FGBFI::getGMTString ()
342 struct tm * t = globals->get_time_params()->getGmt();
343 sprintf(buf, " %.2d:%.2d:%.2d",
344 t->tm_hour, t->tm_min, t->tm_sec);
351 ////////////////////////////////////////////////////////////////////////
353 ////////////////////////////////////////////////////////////////////////
357 * Return the current latitude in degrees (negative for south).
360 FGBFI::getLatitude ()
362 return current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
367 * Set the current latitude in degrees (negative for south).
370 FGBFI::setLatitude (double latitude)
372 current_aircraft.fdm_state->set_Latitude(latitude * DEG_TO_RAD);
377 * Return the current longitude in degrees (negative for west).
380 FGBFI::getLongitude ()
382 return current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
387 * Set the current longitude in degrees (negative for west).
390 FGBFI::setLongitude (double longitude)
392 current_aircraft.fdm_state->set_Longitude(longitude * DEG_TO_RAD);
397 * Return the current altitude in feet.
400 FGBFI::getAltitude ()
402 return current_aircraft.fdm_state->get_Altitude();
408 * Return the current altitude in above the terrain.
413 return current_aircraft.fdm_state->get_Altitude()
414 - (scenery.cur_elev * METER_TO_FEET);
419 * Set the current altitude in feet.
422 FGBFI::setAltitude (double altitude)
424 current_aircraft.fdm_state->set_Altitude(altitude);
429 ////////////////////////////////////////////////////////////////////////
431 ////////////////////////////////////////////////////////////////////////
435 * Return the current heading in degrees.
440 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG;
445 * Return the current heading in degrees.
448 FGBFI::getHeadingMag ()
450 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG - getMagVar();
455 * Set the current heading in degrees.
458 FGBFI::setHeading (double heading)
460 FGInterface * fdm = current_aircraft.fdm_state;
461 fdm->set_Euler_Angles(fdm->get_Phi(), fdm->get_Theta(),
462 heading * DEG_TO_RAD);
467 * Return the current pitch in degrees.
472 return current_aircraft.fdm_state->get_Theta() * RAD_TO_DEG;
477 * Set the current pitch in degrees.
480 FGBFI::setPitch (double pitch)
482 FGInterface * fdm = current_aircraft.fdm_state;
483 fdm->set_Euler_Angles(fdm->get_Phi(), pitch * DEG_TO_RAD, fdm->get_Psi());
488 * Return the current roll in degrees.
493 return current_aircraft.fdm_state->get_Phi() * RAD_TO_DEG;
498 * Set the current roll in degrees.
501 FGBFI::setRoll (double roll)
503 FGInterface * fdm = current_aircraft.fdm_state;
504 fdm->set_Euler_Angles(roll * DEG_TO_RAD, fdm->get_Theta(), fdm->get_Psi());
509 * Return the current engine0 rpm
514 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
515 return current_aircraft.fdm_state->get_engine(0)->get_RPM();
523 * Set the current engine0 rpm
526 FGBFI::setRPM (double rpm)
528 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
529 if (getRPM() != rpm) {
530 current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm );
537 * Return the current engine0 EGT.
542 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
543 return current_aircraft.fdm_state->get_engine(0)->get_EGT();
551 * Return the current engine0 CHT.
556 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
557 return current_aircraft.fdm_state->get_engine(0)->get_CHT();
565 * Return the current engine0 CHT.
570 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
571 return current_aircraft.fdm_state->get_engine(0)->get_Manifold_Pressure();
579 ////////////////////////////////////////////////////////////////////////
581 ////////////////////////////////////////////////////////////////////////
585 * Return the current airspeed in knots.
588 FGBFI::getAirspeed ()
590 // FIXME: should we add speed-up?
591 return current_aircraft.fdm_state->get_V_calibrated_kts();
596 * Set the calibrated airspeed in knots.
599 FGBFI::setAirspeed (double speed)
601 current_aircraft.fdm_state->set_V_calibrated_kts(speed);
606 * Return the current sideslip (FIXME: units unknown).
609 FGBFI::getSideSlip ()
611 return current_aircraft.fdm_state->get_Beta();
616 * Return the current climb rate in feet/minute
619 FGBFI::getVerticalSpeed ()
621 // What about meters?
622 return current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
627 * Get the current north velocity (units??).
630 FGBFI::getSpeedNorth ()
632 return current_aircraft.fdm_state->get_V_north();
637 // * Set the current north velocity (units??).
640 // FGBFI::setSpeedNorth (double speed)
642 // FGInterface * fdm = current_aircraft.fdm_state;
643 // // fdm->set_Velocities_Local(speed, fdm->get_V_east(), fdm->get_V_down());
648 * Get the current east velocity (units??).
651 FGBFI::getSpeedEast ()
653 return current_aircraft.fdm_state->get_V_east();
658 // * Set the current east velocity (units??).
661 // FGBFI::setSpeedEast (double speed)
663 // FGInterface * fdm = current_aircraft.fdm_state;
664 // // fdm->set_Velocities_Local(fdm->get_V_north(), speed, fdm->get_V_down());
669 * Get the current down velocity (units??).
672 FGBFI::getSpeedDown ()
674 return current_aircraft.fdm_state->get_V_down();
679 // * Set the current down velocity (units??).
682 // FGBFI::setSpeedDown (double speed)
684 // FGInterface * fdm = current_aircraft.fdm_state;
685 // // fdm->set_Velocities_Local(fdm->get_V_north(), fdm->get_V_east(), speed);
690 ////////////////////////////////////////////////////////////////////////
692 ////////////////////////////////////////////////////////////////////////
697 * Get the throttle setting, from 0.0 (none) to 1.0 (full).
700 FGBFI::getThrottle ()
702 // FIXME: add engine selector
703 return controls.get_throttle(0);
708 * Set the throttle, from 0.0 (none) to 1.0 (full).
711 FGBFI::setThrottle (double throttle)
713 // FIXME: allow engine selection
714 controls.set_throttle(0, throttle);
719 * Get the fuel mixture setting, from 0.0 (none) to 1.0 (full).
724 // FIXME: add engine selector
725 return controls.get_mixture(0);
730 * Set the fuel mixture, from 0.0 (none) to 1.0 (full).
733 FGBFI::setMixture (double mixture)
735 // FIXME: allow engine selection
736 controls.set_mixture(0, mixture);
741 * Get the propellor pitch setting, from 0.0 (none) to 1.0 (full).
744 FGBFI::getPropAdvance ()
746 // FIXME: add engine selector
747 return controls.get_prop_advance(0);
752 * Set the propellor pitch, from 0.0 (none) to 1.0 (full).
755 FGBFI::setPropAdvance (double pitch)
757 // FIXME: allow engine selection
758 controls.set_prop_advance(0, pitch);
763 * Get the flaps setting, from 0.0 (none) to 1.0 (full).
768 return controls.get_flaps();
773 * Set the flaps, from 0.0 (none) to 1.0 (full).
776 FGBFI::setFlaps (double flaps)
779 controls.set_flaps(flaps);
784 * Get the aileron, from -1.0 (left) to 1.0 (right).
789 return controls.get_aileron();
794 * Set the aileron, from -1.0 (left) to 1.0 (right).
797 FGBFI::setAileron (double aileron)
800 controls.set_aileron(aileron);
805 * Get the rudder setting, from -1.0 (left) to 1.0 (right).
810 return controls.get_rudder();
815 * Set the rudder, from -1.0 (left) to 1.0 (right).
818 FGBFI::setRudder (double rudder)
821 controls.set_rudder(rudder);
826 * Get the elevator setting, from -1.0 (down) to 1.0 (up).
829 FGBFI::getElevator ()
831 return controls.get_elevator();
836 * Set the elevator, from -1.0 (down) to 1.0 (up).
839 FGBFI::setElevator (double elevator)
842 controls.set_elevator(elevator);
847 * Get the elevator trim, from -1.0 (down) to 1.0 (up).
850 FGBFI::getElevatorTrim ()
852 return controls.get_elevator_trim();
857 * Set the elevator trim, from -1.0 (down) to 1.0 (up).
860 FGBFI::setElevatorTrim (double trim)
863 controls.set_elevator_trim(trim);
868 * Get the highest brake setting, from 0.0 (none) to 1.0 (full).
873 double b1 = getCenterBrake();
874 double b2 = getLeftBrake();
875 double b3 = getRightBrake();
876 return (b1 > b2 ? (b1 > b3 ? b1 : b3) : (b2 > b3 ? b2 : b3));
881 * Set all brakes, from 0.0 (none) to 1.0 (full).
884 FGBFI::setBrakes (double brake)
886 setCenterBrake(brake);
888 setRightBrake(brake);
893 * Get the center brake, from 0.0 (none) to 1.0 (full).
896 FGBFI::getCenterBrake ()
898 return controls.get_brake(2);
903 * Set the center brake, from 0.0 (none) to 1.0 (full).
906 FGBFI::setCenterBrake (double brake)
908 controls.set_brake(2, brake);
913 * Get the left brake, from 0.0 (none) to 1.0 (full).
916 FGBFI::getLeftBrake ()
918 return controls.get_brake(0);
923 * Set the left brake, from 0.0 (none) to 1.0 (full).
926 FGBFI::setLeftBrake (double brake)
928 controls.set_brake(0, brake);
933 * Get the right brake, from 0.0 (none) to 1.0 (full).
936 FGBFI::getRightBrake ()
938 return controls.get_brake(1);
943 * Set the right brake, from 0.0 (none) to 1.0 (full).
946 FGBFI::setRightBrake (double brake)
948 controls.set_brake(1, brake);
955 ////////////////////////////////////////////////////////////////////////
957 ////////////////////////////////////////////////////////////////////////
961 * Get the autopilot altitude lock (true=on).
964 FGBFI::getAPAltitudeLock ()
966 return current_autopilot->get_AltitudeEnabled();
971 * Set the autopilot altitude lock (true=on).
974 FGBFI::setAPAltitudeLock (bool lock)
976 current_autopilot->set_AltitudeMode(FGAutopilot::FG_ALTITUDE_LOCK);
977 current_autopilot->set_AltitudeEnabled(lock);
982 * Get the autopilot target altitude in feet.
985 FGBFI::getAPAltitude ()
987 return current_autopilot->get_TargetAltitude() * METER_TO_FEET;
992 * Set the autopilot target altitude in feet.
995 FGBFI::setAPAltitude (double altitude)
997 current_autopilot->set_TargetAltitude( altitude );
1002 * Get the autopilot heading lock (true=on).
1005 FGBFI::getAPHeadingLock ()
1008 (current_autopilot->get_HeadingEnabled() &&
1009 current_autopilot->get_HeadingMode() == FGAutopilot::FG_DG_HEADING_LOCK);
1014 * Set the autopilot heading lock (true=on).
1017 FGBFI::setAPHeadingLock (bool lock)
1020 // We need to do this so that
1021 // it's possible to lock onto a
1022 // heading other than the current
1024 double heading = getAPHeadingMag();
1025 current_autopilot->set_HeadingMode(FGAutopilot::FG_DG_HEADING_LOCK);
1026 current_autopilot->set_HeadingEnabled(true);
1027 setAPHeadingMag(heading);
1028 } else if (current_autopilot->get_HeadingMode() ==
1029 FGAutopilot::FG_DG_HEADING_LOCK) {
1030 current_autopilot->set_HeadingEnabled(false);
1036 * Get the autopilot target heading in degrees.
1039 FGBFI::getAPHeading ()
1041 return current_autopilot->get_TargetHeading();
1046 * Set the autopilot target heading in degrees.
1049 FGBFI::setAPHeading (double heading)
1051 current_autopilot->set_TargetHeading( heading );
1056 * Get the autopilot DG target heading in degrees.
1059 FGBFI::getAPHeadingDG ()
1061 return current_autopilot->get_DGTargetHeading();
1066 * Set the autopilot DG target heading in degrees.
1069 FGBFI::setAPHeadingDG (double heading)
1071 current_autopilot->set_DGTargetHeading( heading );
1076 * Get the autopilot target heading in degrees.
1079 FGBFI::getAPHeadingMag ()
1081 return current_autopilot->get_TargetHeading() - getMagVar();
1086 * Set the autopilot target heading in degrees.
1089 FGBFI::setAPHeadingMag (double heading)
1091 current_autopilot->set_TargetHeading( heading + getMagVar() );
1096 * Return true if the autopilot is locked to NAV1.
1099 FGBFI::getAPNAV1Lock ()
1102 (current_autopilot->get_HeadingEnabled() &&
1103 current_autopilot->get_HeadingMode() == FGAutopilot::FG_HEADING_NAV1);
1108 * Set the autopilot NAV1 lock.
1111 FGBFI::setAPNAV1Lock (bool lock)
1114 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_NAV1);
1115 current_autopilot->set_HeadingEnabled(true);
1116 } else if (current_autopilot->get_HeadingMode() ==
1117 FGAutopilot::FG_HEADING_NAV1) {
1118 current_autopilot->set_HeadingEnabled(false);
1124 ////////////////////////////////////////////////////////////////////////
1126 ////////////////////////////////////////////////////////////////////////
1130 * Get the autopilot GPS lock (true=on).
1133 FGBFI::getGPSLock ()
1135 return (current_autopilot->get_HeadingEnabled() &&
1136 (current_autopilot->get_HeadingMode() ==
1137 FGAutopilot::FG_HEADING_WAYPOINT ));
1142 * Set the autopilot GPS lock (true=on).
1145 FGBFI::setGPSLock (bool lock)
1148 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_WAYPOINT);
1149 current_autopilot->set_HeadingEnabled(true);
1150 } else if (current_autopilot->get_HeadingMode() ==
1151 FGAutopilot::FG_HEADING_WAYPOINT) {
1152 current_autopilot->set_HeadingEnabled(false);
1158 * Get the GPS target latitude in degrees (negative for south).
1161 FGBFI::getGPSTargetLatitude ()
1163 return current_autopilot->get_TargetLatitude();
1168 * Get the GPS target longitude in degrees (negative for west).
1171 FGBFI::getGPSTargetLongitude ()
1173 return current_autopilot->get_TargetLongitude();
1178 * Set the GPS target longitude in degrees (negative for west).
1181 FGBFI::setGPSTargetLongitude (double longitude)
1183 current_autopilot->set_TargetLongitude( longitude );
1189 ////////////////////////////////////////////////////////////////////////
1191 ////////////////////////////////////////////////////////////////////////
1195 * Get the current visibility (meters).
1198 FGBFI::getVisibility ()
1200 #ifndef FG_OLD_WEATHER
1201 return WeatherDatabase->getWeatherVisibility();
1203 return current_weather.get_visibility();
1209 * Set the current visibility (meters).
1212 FGBFI::setVisibility (double visibility)
1214 #ifndef FG_OLD_WEATHER
1215 WeatherDatabase->setWeatherVisibility(visibility);
1217 current_weather.set_visibility(visibility);
1223 * Get the current wind north velocity (feet/second).
1226 FGBFI::getWindNorth ()
1228 return current_aircraft.fdm_state->get_V_north_airmass();
1233 * Set the current wind north velocity (feet/second).
1236 FGBFI::setWindNorth (double speed)
1238 current_aircraft.fdm_state->set_Velocities_Local_Airmass(speed,
1245 * Get the current wind east velocity (feet/second).
1248 FGBFI::getWindEast ()
1250 return current_aircraft.fdm_state->get_V_east_airmass();
1255 * Set the current wind east velocity (feet/second).
1258 FGBFI::setWindEast (double speed)
1260 cout << "Set wind-east to " << speed << endl;
1261 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1268 * Get the current wind down velocity (feet/second).
1271 FGBFI::getWindDown ()
1273 return current_aircraft.fdm_state->get_V_down_airmass();
1278 * Set the current wind down velocity (feet/second).
1281 FGBFI::setWindDown (double speed)
1283 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1290 ////////////////////////////////////////////////////////////////////////
1292 ////////////////////////////////////////////////////////////////////////
1297 globals->get_current_view()->get_fov();
1301 FGBFI::setFOV (double fov)
1303 globals->get_current_view()->set_fov( fov );
1307 FGBFI::setViewAxisLong (double axis)
1313 FGBFI::setViewAxisLat (double axis)
1319 ////////////////////////////////////////////////////////////////////////
1321 ////////////////////////////////////////////////////////////////////////
1324 * Return the magnetic variation
1329 return globals->get_mag()->get_magvar() * RAD_TO_DEG;
1334 * Return the magnetic variation
1339 return globals->get_mag()->get_magdip() * RAD_TO_DEG;