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 bool apAltitudeLock = FGBFI::getAPAltitudeLock();
91 double apAltitude = FGBFI::getAPAltitude();
92 bool gpsLock = FGBFI::getGPSLock();
93 // double gpsLatitude = FGBFI::getGPSTargetLatitude();
94 // double gpsLongitude = FGBFI::getGPSTargetLongitude();
98 // FIXME: this is wrong.
99 // All of these are scheduled events,
100 // and it should be possible to force
101 // them all to run once.
104 cur_light_params.Update();
106 fgUpdateWeatherDatabase();
107 current_radiostack->search();
109 // Restore all of the old states.
110 FGBFI::setAPHeadingLock(apHeadingLock);
111 FGBFI::setAPAltitudeLock(apAltitudeLock);
112 FGBFI::setAPAltitude(apAltitude);
113 FGBFI::setGPSLock(gpsLock);
117 FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI reinit");
121 // Allow the view to be set from two axes (i.e. a joystick hat)
122 // This needs to be in FGViewer itself, somehow.
123 static double axisLong = 0.0;
124 static double axisLat = 0.0;
127 _set_view_from_axes ()
129 // Take no action when hat is centered
130 if (axisLong == 0 && axisLat == 0)
135 if (axisLong < 0) { // Longitudinal axis forward
138 else if (axisLat > 0)
142 } else if (axisLong > 0) { // Longitudinal axis backward
145 else if (axisLat > 0)
149 } else { // Longitudinal axis neutral
156 globals->get_current_view()->set_goal_view_offset(viewDir*DEG_TO_RAD);
157 // globals->get_current_view()->set_view_offset(viewDir*DEG_TO_RAD);
164 ////////////////////////////////////////////////////////////////////////
166 ////////////////////////////////////////////////////////////////////////
170 * Initialize the BFI by binding its functions to properties.
172 * TODO: perhaps these should migrate into the individual modules
173 * (i.e. they should register themselves).
178 FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI init");
181 fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
182 fgTie("/sim/time/gmt", getDateString, setDateString);
183 fgTie("/sim/time/gmt-string", getGMTString);
186 fgTie("/orientation/heading-magnetic", getHeadingMag);
189 fgTie("/engines/engine0/rpm", getRPM);
190 fgTie("/engines/engine0/egt", getEGT);
191 fgTie("/engines/engine0/cht", getCHT);
192 fgTie("/engines/engine0/mp", getMP);
195 fgTie("/autopilot/locks/altitude", getAPAltitudeLock, setAPAltitudeLock);
196 fgTie("/autopilot/settings/altitude", getAPAltitude, setAPAltitude);
197 fgTie("/autopilot/settings/climb-rate", getAPClimb, setAPClimb, false);
198 fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
199 fgTie("/autopilot/settings/heading-bug", getAPHeadingBug, setAPHeadingBug,
201 fgTie("/autopilot/locks/wing-leveler", getAPWingLeveler, setAPWingLeveler);
202 fgTie("/autopilot/locks/nav1", getAPNAV1Lock, setAPNAV1Lock);
205 fgTie("/environment/visibility", getVisibility, setVisibility);
206 fgTie("/environment/wind-north", getWindNorth, setWindNorth);
207 fgTie("/environment/wind-east", getWindEast, setWindEast);
208 fgTie("/environment/wind-down", getWindDown, setWindDown);
211 fgTie("/sim/field-of-view", getFOV, setFOV);
212 fgTie("/sim/view/axes/long", (double(*)())0, setViewAxisLong);
213 fgTie("/sim/view/axes/lat", (double(*)())0, setViewAxisLat);
217 FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI init");
222 * Reinitialize FGFS if required.
224 * Some changes (especially those in aircraft position) require that
225 * FGFS be reinitialized afterwards. Rather than reinitialize after
226 * every change, the setter methods simply set a flag so that there
227 * can be a single reinit at the end of the frame.
232 _set_view_from_axes();
240 ////////////////////////////////////////////////////////////////////////
242 ////////////////////////////////////////////////////////////////////////
246 * Return the current aircraft directory (UIUC) as a string.
249 FGBFI::getAircraftDir ()
256 * Set the current aircraft directory (UIUC).
259 FGBFI::setAircraftDir (string dir)
261 if (getAircraftDir() != dir) {
269 * Return the current Zulu time.
272 FGBFI::getDateString ()
276 struct tm * t = globals->get_time_params()->getGmt();
277 sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
278 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
279 t->tm_hour, t->tm_min, t->tm_sec);
286 * Set the current Zulu time.
289 FGBFI::setDateString (string date_string)
290 // FGBFI::setTimeGMT (time_t time)
292 SGTime * st = globals->get_time_params();
293 struct tm * current_time = st->getGmt();
296 // Scan for basic ISO format
297 // YYYY-MM-DDTHH:MM:SS
298 int ret = sscanf(date_string.c_str(), "%d-%d-%dT%d:%d:%d",
299 &(new_time.tm_year), &(new_time.tm_mon),
300 &(new_time.tm_mday), &(new_time.tm_hour),
301 &(new_time.tm_min), &(new_time.tm_sec));
303 // Be pretty picky about this, so
304 // that strange things don't happen
305 // if the save file has been edited
308 FG_LOG(FG_INPUT, FG_ALERT, "Date/time string " << date_string
309 << " not in YYYY-MM-DDTHH:MM:SS format; skipped");
313 // OK, it looks like we got six
314 // values, one way or another.
315 new_time.tm_year -= 1900;
316 new_time.tm_mon -= 1;
318 // Now, tell flight gear to use
319 // the new time. This was far
320 // too difficult, by the way.
322 mktime(&new_time) - mktime(current_time) + globals->get_warp();
323 double lon = current_aircraft.fdm_state->get_Longitude();
324 double lat = current_aircraft.fdm_state->get_Latitude();
325 double alt = current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER;
326 globals->set_warp(warp);
327 st->update(lon, lat, warp);
328 fgUpdateSkyAndLightingParams();
333 * Return the GMT as a string.
336 FGBFI::getGMTString ()
340 struct tm * t = globals->get_time_params()->getGmt();
341 sprintf(buf, " %.2d:%.2d:%.2d",
342 t->tm_hour, t->tm_min, t->tm_sec);
349 ////////////////////////////////////////////////////////////////////////
351 ////////////////////////////////////////////////////////////////////////
355 * Return the current latitude in degrees (negative for south).
358 FGBFI::getLatitude ()
360 return current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
365 * Set the current latitude in degrees (negative for south).
368 FGBFI::setLatitude (double latitude)
370 current_aircraft.fdm_state->set_Latitude(latitude * DEG_TO_RAD);
375 * Return the current longitude in degrees (negative for west).
378 FGBFI::getLongitude ()
380 return current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
385 * Set the current longitude in degrees (negative for west).
388 FGBFI::setLongitude (double longitude)
390 current_aircraft.fdm_state->set_Longitude(longitude * DEG_TO_RAD);
395 * Return the current altitude in feet.
398 FGBFI::getAltitude ()
400 return current_aircraft.fdm_state->get_Altitude();
406 * Return the current altitude in above the terrain.
411 return current_aircraft.fdm_state->get_Altitude()
412 - (scenery.cur_elev * METER_TO_FEET);
417 * Set the current altitude in feet.
420 FGBFI::setAltitude (double altitude)
422 current_aircraft.fdm_state->set_Altitude(altitude);
427 ////////////////////////////////////////////////////////////////////////
429 ////////////////////////////////////////////////////////////////////////
433 * Return the current heading in degrees.
438 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG;
443 * Return the current heading in degrees.
446 FGBFI::getHeadingMag ()
448 return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG - getMagVar();
453 * Set the current heading in degrees.
456 FGBFI::setHeading (double heading)
458 FGInterface * fdm = current_aircraft.fdm_state;
459 fdm->set_Euler_Angles(fdm->get_Phi(), fdm->get_Theta(),
460 heading * DEG_TO_RAD);
465 * Return the current pitch in degrees.
470 return current_aircraft.fdm_state->get_Theta() * RAD_TO_DEG;
475 * Set the current pitch in degrees.
478 FGBFI::setPitch (double pitch)
480 FGInterface * fdm = current_aircraft.fdm_state;
481 fdm->set_Euler_Angles(fdm->get_Phi(), pitch * DEG_TO_RAD, fdm->get_Psi());
486 * Return the current roll in degrees.
491 return current_aircraft.fdm_state->get_Phi() * RAD_TO_DEG;
496 * Set the current roll in degrees.
499 FGBFI::setRoll (double roll)
501 FGInterface * fdm = current_aircraft.fdm_state;
502 fdm->set_Euler_Angles(roll * DEG_TO_RAD, fdm->get_Theta(), fdm->get_Psi());
507 * Return the current engine0 rpm
512 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
513 return current_aircraft.fdm_state->get_engine(0)->get_RPM();
521 * Set the current engine0 rpm
524 FGBFI::setRPM (double rpm)
526 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
527 if (getRPM() != rpm) {
528 current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm );
535 * Return the current engine0 EGT.
540 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
541 return current_aircraft.fdm_state->get_engine(0)->get_EGT();
549 * Return the current engine0 CHT.
554 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
555 return current_aircraft.fdm_state->get_engine(0)->get_CHT();
563 * Return the current engine0 CHT.
568 if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
569 return current_aircraft.fdm_state->get_engine(0)->get_Manifold_Pressure();
577 ////////////////////////////////////////////////////////////////////////
579 ////////////////////////////////////////////////////////////////////////
583 * Return the current airspeed in knots.
586 FGBFI::getAirspeed ()
588 // FIXME: should we add speed-up?
589 return current_aircraft.fdm_state->get_V_calibrated_kts();
594 * Set the calibrated airspeed in knots.
597 FGBFI::setAirspeed (double speed)
599 current_aircraft.fdm_state->set_V_calibrated_kts(speed);
604 * Return the current sideslip (FIXME: units unknown).
607 FGBFI::getSideSlip ()
609 return current_aircraft.fdm_state->get_Beta();
614 * Return the current climb rate in feet/minute
617 FGBFI::getVerticalSpeed ()
619 // What about meters?
620 return current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
625 * Get the current north velocity (units??).
628 FGBFI::getSpeedNorth ()
630 return current_aircraft.fdm_state->get_V_north();
635 // * Set the current north velocity (units??).
638 // FGBFI::setSpeedNorth (double speed)
640 // FGInterface * fdm = current_aircraft.fdm_state;
641 // // fdm->set_Velocities_Local(speed, fdm->get_V_east(), fdm->get_V_down());
646 * Get the current east velocity (units??).
649 FGBFI::getSpeedEast ()
651 return current_aircraft.fdm_state->get_V_east();
656 // * Set the current east velocity (units??).
659 // FGBFI::setSpeedEast (double speed)
661 // FGInterface * fdm = current_aircraft.fdm_state;
662 // // fdm->set_Velocities_Local(fdm->get_V_north(), speed, fdm->get_V_down());
667 * Get the current down velocity (units??).
670 FGBFI::getSpeedDown ()
672 return current_aircraft.fdm_state->get_V_down();
677 // * Set the current down velocity (units??).
680 // FGBFI::setSpeedDown (double speed)
682 // FGInterface * fdm = current_aircraft.fdm_state;
683 // // fdm->set_Velocities_Local(fdm->get_V_north(), fdm->get_V_east(), speed);
688 ////////////////////////////////////////////////////////////////////////
690 ////////////////////////////////////////////////////////////////////////
695 * Get the throttle setting, from 0.0 (none) to 1.0 (full).
698 FGBFI::getThrottle ()
700 // FIXME: add engine selector
701 return controls.get_throttle(0);
706 * Set the throttle, from 0.0 (none) to 1.0 (full).
709 FGBFI::setThrottle (double throttle)
711 // FIXME: allow engine selection
712 controls.set_throttle(0, throttle);
717 * Get the fuel mixture setting, from 0.0 (none) to 1.0 (full).
722 // FIXME: add engine selector
723 return controls.get_mixture(0);
728 * Set the fuel mixture, from 0.0 (none) to 1.0 (full).
731 FGBFI::setMixture (double mixture)
733 // FIXME: allow engine selection
734 controls.set_mixture(0, mixture);
739 * Get the propellor pitch setting, from 0.0 (none) to 1.0 (full).
742 FGBFI::getPropAdvance ()
744 // FIXME: add engine selector
745 return controls.get_prop_advance(0);
750 * Set the propellor pitch, from 0.0 (none) to 1.0 (full).
753 FGBFI::setPropAdvance (double pitch)
755 // FIXME: allow engine selection
756 controls.set_prop_advance(0, pitch);
761 * Get the flaps setting, from 0.0 (none) to 1.0 (full).
766 return controls.get_flaps();
771 * Set the flaps, from 0.0 (none) to 1.0 (full).
774 FGBFI::setFlaps (double flaps)
777 controls.set_flaps(flaps);
782 * Get the aileron, from -1.0 (left) to 1.0 (right).
787 return controls.get_aileron();
792 * Set the aileron, from -1.0 (left) to 1.0 (right).
795 FGBFI::setAileron (double aileron)
798 controls.set_aileron(aileron);
803 * Get the rudder setting, from -1.0 (left) to 1.0 (right).
808 return controls.get_rudder();
813 * Set the rudder, from -1.0 (left) to 1.0 (right).
816 FGBFI::setRudder (double rudder)
819 controls.set_rudder(rudder);
824 * Get the elevator setting, from -1.0 (down) to 1.0 (up).
827 FGBFI::getElevator ()
829 return controls.get_elevator();
834 * Set the elevator, from -1.0 (down) to 1.0 (up).
837 FGBFI::setElevator (double elevator)
840 controls.set_elevator(elevator);
845 * Get the elevator trim, from -1.0 (down) to 1.0 (up).
848 FGBFI::getElevatorTrim ()
850 return controls.get_elevator_trim();
855 * Set the elevator trim, from -1.0 (down) to 1.0 (up).
858 FGBFI::setElevatorTrim (double trim)
861 controls.set_elevator_trim(trim);
866 * Get the highest brake setting, from 0.0 (none) to 1.0 (full).
871 double b1 = getCenterBrake();
872 double b2 = getLeftBrake();
873 double b3 = getRightBrake();
874 return (b1 > b2 ? (b1 > b3 ? b1 : b3) : (b2 > b3 ? b2 : b3));
879 * Set all brakes, from 0.0 (none) to 1.0 (full).
882 FGBFI::setBrakes (double brake)
884 setCenterBrake(brake);
886 setRightBrake(brake);
891 * Get the center brake, from 0.0 (none) to 1.0 (full).
894 FGBFI::getCenterBrake ()
896 return controls.get_brake(2);
901 * Set the center brake, from 0.0 (none) to 1.0 (full).
904 FGBFI::setCenterBrake (double brake)
906 controls.set_brake(2, brake);
911 * Get the left brake, from 0.0 (none) to 1.0 (full).
914 FGBFI::getLeftBrake ()
916 return controls.get_brake(0);
921 * Set the left brake, from 0.0 (none) to 1.0 (full).
924 FGBFI::setLeftBrake (double brake)
926 controls.set_brake(0, brake);
931 * Get the right brake, from 0.0 (none) to 1.0 (full).
934 FGBFI::getRightBrake ()
936 return controls.get_brake(1);
941 * Set the right brake, from 0.0 (none) to 1.0 (full).
944 FGBFI::setRightBrake (double brake)
946 controls.set_brake(1, brake);
953 ////////////////////////////////////////////////////////////////////////
955 ////////////////////////////////////////////////////////////////////////
959 * Get the autopilot altitude lock (true=on).
962 FGBFI::getAPAltitudeLock ()
964 return current_autopilot->get_AltitudeEnabled();
969 * Set the autopilot altitude lock (true=on).
972 FGBFI::setAPAltitudeLock (bool lock)
974 current_autopilot->set_AltitudeMode(FGAutopilot::FG_ALTITUDE_LOCK);
975 current_autopilot->set_AltitudeEnabled(lock);
980 * Get the autopilot target altitude in feet.
983 FGBFI::getAPAltitude ()
985 return current_autopilot->get_TargetAltitude() * METER_TO_FEET;
990 * Set the autopilot target altitude in feet.
993 FGBFI::setAPAltitude (double altitude)
995 current_autopilot->set_TargetAltitude( altitude * FEET_TO_METER );
1000 * Get the autopilot target altitude in feet.
1003 FGBFI::getAPClimb ()
1005 return current_autopilot->get_TargetClimbRate() * METER_TO_FEET;
1010 * Set the autopilot target altitude in feet.
1013 FGBFI::setAPClimb (double rate)
1015 current_autopilot->set_TargetClimbRate( rate * FEET_TO_METER );
1020 * Get the autopilot heading lock (true=on).
1023 FGBFI::getAPHeadingLock ()
1026 (current_autopilot->get_HeadingEnabled() &&
1027 current_autopilot->get_HeadingMode() == FGAutopilot::FG_DG_HEADING_LOCK);
1032 * Set the autopilot heading lock (true=on).
1035 FGBFI::setAPHeadingLock (bool lock)
1038 current_autopilot->set_HeadingMode(FGAutopilot::FG_DG_HEADING_LOCK);
1039 current_autopilot->set_HeadingEnabled(true);
1041 current_autopilot->set_HeadingEnabled(false);
1047 * Get the autopilot heading bug in degrees.
1050 FGBFI::getAPHeadingBug ()
1052 return current_autopilot->get_DGTargetHeading();
1057 * Set the autopilot heading bug in degrees.
1060 FGBFI::setAPHeadingBug (double heading)
1062 current_autopilot->set_DGTargetHeading( heading );
1067 * Get the autopilot wing leveler lock (true=on).
1070 FGBFI::getAPWingLeveler ()
1073 (current_autopilot->get_HeadingEnabled() &&
1074 current_autopilot->get_HeadingMode() == FGAutopilot::FG_TC_HEADING_LOCK);
1079 * Set the autopilot wing leveler lock (true=on).
1082 FGBFI::setAPWingLeveler (bool lock)
1085 current_autopilot->set_HeadingMode(FGAutopilot::FG_TC_HEADING_LOCK);
1086 current_autopilot->set_HeadingEnabled(true);
1088 current_autopilot->set_HeadingEnabled(false);
1094 * Return true if the autopilot is locked to NAV1.
1097 FGBFI::getAPNAV1Lock ()
1100 (current_autopilot->get_HeadingEnabled() &&
1101 current_autopilot->get_HeadingMode() == FGAutopilot::FG_HEADING_NAV1);
1106 * Set the autopilot NAV1 lock.
1109 FGBFI::setAPNAV1Lock (bool lock)
1112 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_NAV1);
1113 current_autopilot->set_HeadingEnabled(true);
1114 } else if (current_autopilot->get_HeadingMode() ==
1115 FGAutopilot::FG_HEADING_NAV1) {
1116 current_autopilot->set_HeadingEnabled(false);
1122 ////////////////////////////////////////////////////////////////////////
1124 ////////////////////////////////////////////////////////////////////////
1128 * Get the autopilot GPS lock (true=on).
1131 FGBFI::getGPSLock ()
1133 return (current_autopilot->get_HeadingEnabled() &&
1134 (current_autopilot->get_HeadingMode() ==
1135 FGAutopilot::FG_HEADING_WAYPOINT ));
1140 * Set the autopilot GPS lock (true=on).
1143 FGBFI::setGPSLock (bool lock)
1146 current_autopilot->set_HeadingMode(FGAutopilot::FG_HEADING_WAYPOINT);
1147 current_autopilot->set_HeadingEnabled(true);
1148 } else if (current_autopilot->get_HeadingMode() ==
1149 FGAutopilot::FG_HEADING_WAYPOINT) {
1150 current_autopilot->set_HeadingEnabled(false);
1156 * Get the GPS target latitude in degrees (negative for south).
1159 FGBFI::getGPSTargetLatitude ()
1161 return current_autopilot->get_TargetLatitude();
1166 * Get the GPS target longitude in degrees (negative for west).
1169 FGBFI::getGPSTargetLongitude ()
1171 return current_autopilot->get_TargetLongitude();
1176 * Set the GPS target longitude in degrees (negative for west).
1179 FGBFI::setGPSTargetLongitude (double longitude)
1181 current_autopilot->set_TargetLongitude( longitude );
1187 ////////////////////////////////////////////////////////////////////////
1189 ////////////////////////////////////////////////////////////////////////
1193 * Get the current visibility (meters).
1196 FGBFI::getVisibility ()
1198 #ifndef FG_OLD_WEATHER
1199 return WeatherDatabase->getWeatherVisibility();
1201 return current_weather.get_visibility();
1207 * Set the current visibility (meters).
1210 FGBFI::setVisibility (double visibility)
1212 #ifndef FG_OLD_WEATHER
1213 WeatherDatabase->setWeatherVisibility(visibility);
1215 current_weather.set_visibility(visibility);
1221 * Get the current wind north velocity (feet/second).
1224 FGBFI::getWindNorth ()
1226 return current_aircraft.fdm_state->get_V_north_airmass();
1231 * Set the current wind north velocity (feet/second).
1234 FGBFI::setWindNorth (double speed)
1236 current_aircraft.fdm_state->set_Velocities_Local_Airmass(speed,
1243 * Get the current wind east velocity (feet/second).
1246 FGBFI::getWindEast ()
1248 return current_aircraft.fdm_state->get_V_east_airmass();
1253 * Set the current wind east velocity (feet/second).
1256 FGBFI::setWindEast (double speed)
1258 cout << "Set wind-east to " << speed << endl;
1259 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1266 * Get the current wind down velocity (feet/second).
1269 FGBFI::getWindDown ()
1271 return current_aircraft.fdm_state->get_V_down_airmass();
1276 * Set the current wind down velocity (feet/second).
1279 FGBFI::setWindDown (double speed)
1281 current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
1288 ////////////////////////////////////////////////////////////////////////
1290 ////////////////////////////////////////////////////////////////////////
1295 globals->get_current_view()->get_fov();
1299 FGBFI::setFOV (double fov)
1301 globals->get_current_view()->set_fov( fov );
1305 FGBFI::setViewAxisLong (double axis)
1311 FGBFI::setViewAxisLat (double axis)
1317 ////////////////////////////////////////////////////////////////////////
1319 ////////////////////////////////////////////////////////////////////////
1322 * Return the magnetic variation
1327 return globals->get_mag()->get_magvar() * RAD_TO_DEG;
1332 * Return the magnetic variation
1337 return globals->get_mag()->get_magdip() * RAD_TO_DEG;