1
0
Fork 0
Commit graph

55 commits

Author SHA1 Message Date
curt
66650e4148 1. Added src/Main/fgfs.hxx as a standard, top-level include file for
FlightGear subsystems -- it isolates some of the config and #ifdef
stuff in a single place.

2. Added a new FGSubsystem interface, defined in fgfs.hxx; so far,
only FGControls implements it, but if that works, we can start letting
it propagate through the system and simplify the code in main.cxx and
fg_init.cxx (which is terrifyingly complex for anyone new to the
project).

3. Added new src/Main/fgfs_props.[hc]xx files with convenience
functions for tying properties under FlightGear.

4. Experimentally modified src/Controls/controls.cxx to tie properties
directly (rather than tying to BFI functions).  I'd appreciate it if
you could get this into CVS as soon as possible, so we can see if the
template stuff causes trouble for any other platforms before I add
properties to the other subsystems.

5. Miscellaneous superficial modifications to other files.


In addition, I've made a couple of further changes:


6. Modified BFI to add support for setting the view axes (i.e. with a
joystick hat).

7. Cleaned up bfi.cxx and removed all cout statements.
2001-01-05 17:38:58 +00:00
curt
3b88c71122 Applied changes relative to David Megginson's property manager rewrite. 2000-12-19 23:29:16 +00:00
curt
94fd1bd8f2 Blame this on David Megginson ... :-)
Save/restore seems to be working now, thanks to a couple of
unspeakable kludges:

1. Every time the altitude changes, pause the flight simulator for
five frames and then change it a second time.

2. Every time the latitude or longitude changes, wait five frames,
then invoke fgUpdateSkyAndLightingParams() a second time.
2000-12-08 17:36:07 +00:00
curt
6574e8f4f6 Updates to time parsing and setting by David Megginson. 2000-12-08 17:26:49 +00:00
curt
08fd9cc36d Moved fov and win_ration from FGOptions to FGViewer so we can control these
on a per view basis.
Fixed some compile warnings in Main/*.cxx
2000-11-01 23:27:32 +00:00
curt
6786cf9da4 src/GUI/gui.cxx:
- removed Toggle Clouds menu item

src/Main/options.cxx:
- (minor) added some code to sync up options with properties

src/Main/bfi.[ch]xx:
- removed (get|set)Clouds(ASL)?
- removed setSpeedNorth, setSpeedEast, and setSpeedDown -- these are
  all read-only now
- added setAirspeed (for calibrated kt)
- extensive rewrite to support Tony's FDM changes
- rearranged everything in bfi.hxx to mess up Curt's ediff examination
- added properties for setting initial panel position

src/Main/save.cxx:
- reinit the tile cache after restore
2000-11-01 04:51:55 +00:00
curt
81bb2f00d1 Added manifold pressure to the property manager. 2000-10-27 22:27:16 +00:00
curt
b83ad15313 Added CHT (cylinder head temp) to BFI and property manager. 2000-10-27 22:00:43 +00:00
curt
7cc98ad15f I tested:
LaRCsim c172 on-ground and in-air starts, reset: all work
UIUC Cessna172 on-ground and in-air starts work as expected, reset
results in an aircraft that is upside down but does not crash FG.   I
don't know what it was like before, so it may well be no change.
JSBSim c172 and X15 in-air starts work fine, resets now work (and are
trimmed), on-ground starts do not -- the c172 ends up on its back.  I
suspect this is no worse than before.

I did not test:
Balloon (the weather code returns nan's for the atmosphere data --this
is in the weather module and apparently is a linux only bug)
ADA (don't know how)
MagicCarpet  (needs work yet)
External (don't know how)

known to be broken:
LaRCsim c172 on-ground starts with a negative terrain altitude (this
happens at KPAO when the scenery is not present).   The FDM inits to
about 50 feet AGL and the model falls to the ground.  It does stay
upright, however, and seems to be fine once it settles out, FWIW.

To do:
--implement set_Model on the bus
--bring Christian's weather data into JSBSim
-- add default method to bus for updating things like the sin and cos of
latitude (for Balloon, MagicCarpet)
-- lots of cleanup

The files:
src/FDM/flight.cxx
src/FDM/flight.hxx
-- all data members now declared protected instead of private.
-- eliminated all but a small set of 'setters', no change to getters.
-- that small set is declared virtual, the default implementation
provided preserves the old behavior
-- all of the vector data members are now initialized.
-- added busdump() method -- FG_LOG's  all the bus data when called,
useful for diagnostics.

src/FDM/ADA.cxx
-- bus data members now directly assigned to

src/FDM/Balloon.cxx
-- bus data members now directly assigned to
-- changed V_equiv_kts to V_calibrated_kts

src/FDM/JSBSim.cxx
src/FDM/JSBSim.hxx
-- bus data members now directly assigned to
-- implemented the FGInterface virtual setters with JSBSim specific
logic
-- changed the static FDMExec to a dynamic fdmex (needed so that the
JSBSim object can be deleted when a model change is called for)
-- implemented constructor and destructor, moved some of the logic
formerly in init() to constructor
-- added logic to bring up FGEngInterface objects and set the RPM and
throttle values.

src/FDM/LaRCsim.cxx
src/FDM/LaRCsim.hxx
-- bus data members now directly assigned to
-- implemented the FGInterface virtual setters with LaRCsim specific
logic, uses LaRCsimIC
-- implemented constructor and destructor, moved some of the logic
formerly in init() to constructor
-- moved default inertias to here from fg_init.cxx
-- eliminated the climb rate calculation.  The equivalent, climb_rate =
-1*vdown, is now in copy_from_LaRCsim().

src/FDM/LaRCsimIC.cxx
src/FDM/LaRCsimIC.hxx
-- similar to FGInitialCondition, this class has all the logic needed to
turn data like Vc and Mach into the more fundamental quantities LaRCsim
needs to initialize.
-- put it in src/FDM since it is a class

src/FDM/MagicCarpet.cxx
 -- bus data members now directly assigned to

src/FDM/Makefile.am
-- adds LaRCsimIC.hxx and cxx

src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/JSBSim.cpp
-- changes to accomodate the new bus

src/FDM/LaRCsim/atmos_62.h
src/FDM/LaRCsim/ls_geodesy.h
-- surrounded prototypes with #ifdef __cplusplus ... #endif , functions
here are needed in LaRCsimIC

src/FDM/LaRCsim/c172_main.c
src/FDM/LaRCsim/cherokee_aero.c
src/FDM/LaRCsim/ls_aux.c
src/FDM/LaRCsim/ls_constants.h
src/FDM/LaRCsim/ls_geodesy.c
src/FDM/LaRCsim/ls_geodesy.h
src/FDM/LaRCsim/ls_step.c
src/FDM/UIUCModel/uiuc_betaprobe.cpp
-- changed PI to LS_PI, eliminates preprocessor naming conflict with
weather module

src/FDM/LaRCsim/ls_interface.c
src/FDM/LaRCsim/ls_interface.h
-- added function ls_set_model_dt()

src/Main/bfi.cxx
-- eliminated calls that set the NED speeds to body components.  They
are no longer needed and confuse the new bus.

src/Main/fg_init.cxx
-- eliminated calls that just brought the bus data up-to-date (e.g.
set_sin_cos_latitude). or set default values.   The bus now handles the
defaults and updates itself when the setters are called (for LaRCsim and
JSBSim).  A default method for doing this needs to be added to the bus.
-- added fgVelocityInit() to set the speed the user asked for.  Both
JSBSim and LaRCsim can now be initialized using any of:
vc,mach, NED components, UVW components.

src/Main/main.cxx
--eliminated call to fgFDMSetGroundElevation, this data is now 'pulled'
onto the bus every update()

src/Main/options.cxx
src/Main/options.hxx
-- added enum to keep track of the speed requested by the user
-- eliminated calls to set NED velocity properties to body speeds, they
are no longer needed.
-- added options for the NED components.

src/Network/garmin.cxx
src/Network/nmea.cxx
--eliminated calls that just brought the bus data up-to-date (e.g.
set_sin_cos_latitude).  The bus now updates itself when the setters are
called (for LaRCsim and JSBSim).  A default method for doing this needs
to be added to the bus.
-- changed set_V_equiv_kts to set_V_calibrated_kts.  set_V_equiv_kts no
longer exists ( get_V_equiv_kts still does, though)

src/WeatherCM/FGLocalWeatherDatabase.cpp
-- commented out the code to put the weather data on the bus, a
different scheme for this is needed.
2000-10-24 00:34:50 +00:00
curt
152a5902c8 Moved winWidth and winHeight out of FGViewer since these are set on a
per-application level.  We can have multiple viewers ...
Cleaned up fov mistake on startup with panel activated.
2000-10-19 23:09:33 +00:00
curt
01c44cbb99 Code clean ups relating to FGOptions ... and moved it into globals-> space. 2000-10-19 21:24:43 +00:00
curt
2eda8480e9 Some changes contributed by David Megginson to allow for more interesting
external views.
2000-10-18 21:19:30 +00:00
curt
df0228e019 Tweaks and massaging relative to the new waypoint route management system.
You can now specify waypoint on the command line with --wp=ID[,alt]
2000-10-12 01:08:09 +00:00
curt
1e5e2eb36e Changes to support new simgear waypoint module. 2000-10-11 00:18:26 +00:00
curt
c64a964956 Added keyboard mappings to move panel up/down/right/left. 2000-10-10 17:45:04 +00:00
curt
b2d7a4e27a Fixed a small bug in the engine lookup of bfi that is currently crashing
with jsbsim since no engine is currently created.  This will all have to be
revamped in the future, but jsbsim has the structure for doing engines so
that is good.
2000-10-09 21:17:39 +00:00
curt
599625eeec Fixed an altitude setting bug. 2000-10-09 20:33:53 +00:00
curt
b6d0402074 Properties:
- /engines/engine0/rpm changed to read-only
- /engines/engine0/egt added (read-only)
- /controls/mixture added
- /controls/propellor-pitch added (not used for C172)

BFI:

- getEGT() added
- getMixture() and setMixture() added
- getPropAdvance() and setPropAdvance() added (= pitch)
- cleaned up reinit function a bit
- force reinit only when values are actually changed; for example,
  setting the flight model to the current flight model will not cause
  a reinit

LaRCSim:

- hook up mixture and pitch to FGControls (they were hard-coded
  before)
2000-10-04 22:22:21 +00:00
curt
21a5886bcb Oct 2, 2000 JSBSim sync. 2000-10-02 23:07:30 +00:00
curt
1dc35581f5 MSVC compatibility changes and code tweaks for minor nits caught by the
MSVC compiler.
2000-10-02 21:49:04 +00:00
curt
8d1295119f Updates from David Megginson relating to the property manager. 2000-09-30 03:35:38 +00:00
curt
83d06fb4d6 Tie the engine0 rpm to the property manager. 2000-09-29 22:02:32 +00:00
curt
2c59508156 Renamed fg_types.hxx -> sg_types.hxx
Started work on an interactive property manager traverser/setter.
2000-09-26 23:39:29 +00:00
curt
a9ab25ddd1 Changes from David Megginson in support of an xml based configuration file. 2000-09-25 21:41:50 +00:00
curt
e7df2d5dc8 Sep. 22, 2000 panel updates from David Megginson to make the new config file
panel be the default (sp_panel.* RIP).
2000-09-22 17:20:56 +00:00
curt
f21847b3c2 bfi load/save fix from David.
Added an initial freeze on startup so that we can try to avoid bouncing the
plane on it's back during the very low frame rate / scenery loading startup
conditions.
2000-09-15 19:28:26 +00:00
curt
d60f4d4852 A couple tweaks from David Megginson relating to his new panel data file
support.
2000-09-06 00:09:32 +00:00
curt
5103729ca0 Updates to use new SGMagVar class from simgear. 2000-08-08 00:39:52 +00:00
curt
0c8c3ac0d6 David Megginson's changes:
src/Cockpit/radiostack.cxx
- extended VOR ranges to make them slightly more usable (pending some
  real radio code)

src/Cockpit/sp_panel.cxx
- fixed heading bug on gyro compass (sort-of -- the AP still doesn't
  work quite as expected)
- skid ball moves the right direction
- moved whiskey compass more to the co-pilot's side, as suggested by
  Alex a while back

src/Joystick/joystick.cxx
- included Norm's Windows patches
- renamed brake properties (see bfi.cxx, below)

src/Main/bfi.cxx
src/Main/bfi.hxx
- renamed getBrake and setBrake to getBrakes and setBrakes
- added getCenterBrake and setCenterBrake
- added getAPHeading (without mag correction, needed for the panel)
- renamed property /controls/brake to /controls/brakes/all
- renamed property /controls/left-brake to /controls/brakes/left (as
  requested by Alex)
- renamed property /controls/right-brake to /controls/brakes/right (as
  requested by Alex)
- added property /controls/brakes/center
- added property /autopilot/settings/heading
- fixed bug in setAltitude so that altitude will be property restored
  from a save file
- fixed getBrakes to return the highest of the three brake settings

src/Main/save.cxx
- call FGBFI::getBrakes instead of FGBFI::getBrake
2000-07-23 00:11:04 +00:00
curt
7a2ef1d57c Merged some of Alex's code changes.
Updates for better windows support in the Joystick module.
2000-07-20 04:16:59 +00:00
curt
4dcd4cda79 Joystick updates from David Megginson to add the beginnings of button support. 2000-07-14 15:46:27 +00:00
curt
b29a72a5bc SGTime tweaks. 2000-07-08 22:11:00 +00:00
curt
c65cd3254b More tidying up of SGTime. 2000-07-07 23:56:43 +00:00
curt
312626c5f0 Hopefully final time cleanups. 2000-07-07 21:52:45 +00:00
curt
436db30053 More SGTime tidying. 2000-07-07 20:28:51 +00:00
curt
f9b28c103d Updates to go along with SGTime tweaks in SimGear. 2000-07-07 17:27:37 +00:00
curt
0ffa19cd32 Updates to JSBsim from Jon's CVS.
Massaging some names inside of SimGear.
2000-07-06 22:13:24 +00:00
curt
d1e4a4bc6f A lot of code reorganization relating to moving some core code from
FlightGear into SimGear so it can be used by other projects.
2000-07-05 02:39:30 +00:00
curt
efe5654b8b Moved sky code over to simgear.
Added David Megginsons property manager.
2000-07-03 20:09:56 +00:00
curt
9adf2456e2 Updates from David Megginson:
1. I've modified src/Time/fg_time.cxx so that the --start-date-gmt
option works correctly, at least on my system.

2. I've modified src/Main/bfi.cxx to return the correct time from
FGBFI::getTimeGMT(), so that saving and reloading now keeps the time set
correctly again.

3. I've modified src/Main/main.cxx so that the engine still makes a
noise when it's idling (it sounded very strange when the engine simply
turned off at idle then magically turned on again with a little
throttle).
2000-06-17 03:41:03 +00:00
curt
2f22748275 Fixes from David Megginson for save/restore. 2000-05-19 16:14:37 +00:00
curt
90707efd3f Changes by David Megginson. 2000-05-16 18:21:08 +00:00
curt
9dc5c9ca22 Instrument panel updates from David Megginson.
- the panel uses much, much less texture memory, and draws much
  faster, at least on my hardware

- there is a wet (magnetic) compass at the top of the panel

- the gyro compass shows true heading again, but don't get used to it:
  we're going to set it up to drift soon

- there are TO/FROM flags on NAV1 and NAV2 (but no GS flag yet)

- the ADF looks a little more realistic (if you can forgive the ugly
  needle)

- when the HUD is not open, the framerate is moved to the right side
  of the screen so that it won't be obscured by the mag compass
2000-05-15 16:33:42 +00:00
curt
7863c607bf Heading bug (and bfi) now deals with magnetic compass heading rather than
true heading.  Internally, the sim (and the autopilot) still runs off of
true heading.
2000-05-14 04:18:12 +00:00
curt
db89ecfae8 Fixes to ILS approaches ... now takes into consideration actual GS and DME
locations.
2000-05-12 20:07:51 +00:00
curt
109088a84e Updated save file and bfi code from David Megginson. 2000-05-06 21:47:53 +00:00
curt
a975fd77c5 User-visible
- knobs now continue to rotate when you hold down the mouse
- the middle mouse button makes knobs rotate much faster
- there are NAV1, NAV2, and ADF radios that can be tuned using the mouse
- there are standby frequencies for NAV1 and NAV2, and buttons to swap
- there is a crude, rather silly-looking DME, hard-wired to NAV1
- there is a crude, rather silly-looking autopilot that can lock
  the heading (to the bug on the gyro), can lock to NAV1, and can lock
  the current altitude
- the knobs for changing the radials on NAV1 and NAV2 look much better
  and are in the right place
- tuning into an ILS frequency doesn't change the displayed radial for
  NAV1

Code

- I've created a new module, sp_panel.[ch]xx, that constructs the
  default single-prop panel; this works entirely outside of FGPanel,
  so it is possible to construct similar modules for other sorts of
  panels; all code specific to the default panel has been removed from
  panel.cxx
- current_panel is now a pointer
- radiostack.[ch]xx keeps track both of the actual radial and of the
  selected radial (they will differ with ILS); the NAV gauges should
  not spin around automatically to show the actual radial (we need to
  do something similar with the autopilot)
- the panel is initialized fairly early
- make sure that standby frequencies also get initialized
- I've started combining and clipping small textures to save texture
  memory; there's a lot more to do, but at least I've made a start
2000-05-02 18:26:00 +00:00
curt
921beb96d7 First stab at NAV1 and GS hold modes for the autopilot. 2000-04-30 22:21:47 +00:00
curt
3ecf1b8dce Autopilot "class-ification".
Separated out gui parts of autopilot control from the actual autopilot code.
2000-04-30 06:51:49 +00:00
curt
2aefd15f74 Added getAGL() 2000-04-28 20:08:22 +00:00