2002-09-23 19:55:10 +00:00
|
|
|
// system_mgr.cxx - manage aircraft systems.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#include "system_mgr.hxx"
|
2002-09-24 15:24:04 +00:00
|
|
|
#include "electrical.hxx"
|
2002-09-28 20:48:53 +00:00
|
|
|
#include "pitot.hxx"
|
2002-09-27 18:27:58 +00:00
|
|
|
#include "static.hxx"
|
2002-09-24 14:51:37 +00:00
|
|
|
#include "vacuum.hxx"
|
David Culp:
Right now the code is not very configurable, and there is only one submodel per airplane possible. It is implemented as an SGSubSystem, just like the electrics, vacuum, etc. systems. To make it work you need to make a release binding like this (for my joystick trigger):
<button n="0">
<desc>Trigger</desc>
<binding>
<command>property-assign</command>
<property>/systems/submodel/trigger</property>
<value type="bool">true</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/systems/submodel/trigger</property>
<value type="bool">false</value>
</binding>
</mod-up>
</button>
Then, each airplane that uses the system should have something like this added to its *-set.xml file (note that this does *not* go within the <sim></sim> tags):
<systems>
<submodel>
<serviceable type="bool">true</serviceable>
<amount type="int">70</amount>
</submodel>
</systems>
Future improvements will include:
1) more configurability, so the user can create multiple submodels, and can assign them different locations, and pitch and yaw adjustments, and nitial velocity.
2) sound?
3) a more accurate calculation of the submodels location at any pitch/roll/yaw.
4) a way to pre-load the model, so the AI code doesn't have to parse the model every time it creates an instance.
I think that's all of it.
2004-08-22 16:22:18 +00:00
|
|
|
#include "submodel.hxx"
|
2002-09-23 19:55:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
FGSystemMgr::FGSystemMgr ()
|
|
|
|
{
|
2003-05-27 19:25:27 +00:00
|
|
|
set_subsystem( "electrical", new FGElectricalSystem );
|
|
|
|
set_subsystem( "pitot", new PitotSystem );
|
|
|
|
set_subsystem( "static", new StaticSystem );
|
|
|
|
set_subsystem( "vacuum-l", new VacuumSystem(0) );
|
|
|
|
set_subsystem( "vacuum-r", new VacuumSystem(1) );
|
David Culp:
Right now the code is not very configurable, and there is only one submodel per airplane possible. It is implemented as an SGSubSystem, just like the electrics, vacuum, etc. systems. To make it work you need to make a release binding like this (for my joystick trigger):
<button n="0">
<desc>Trigger</desc>
<binding>
<command>property-assign</command>
<property>/systems/submodel/trigger</property>
<value type="bool">true</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/systems/submodel/trigger</property>
<value type="bool">false</value>
</binding>
</mod-up>
</button>
Then, each airplane that uses the system should have something like this added to its *-set.xml file (note that this does *not* go within the <sim></sim> tags):
<systems>
<submodel>
<serviceable type="bool">true</serviceable>
<amount type="int">70</amount>
</submodel>
</systems>
Future improvements will include:
1) more configurability, so the user can create multiple submodels, and can assign them different locations, and pitch and yaw adjustments, and nitial velocity.
2) sound?
3) a more accurate calculation of the submodels location at any pitch/roll/yaw.
4) a way to pre-load the model, so the AI code doesn't have to parse the model every time it creates an instance.
I think that's all of it.
2004-08-22 16:22:18 +00:00
|
|
|
// set_subsystem( "submodel", new SubmodelSystem() );
|
2002-09-23 19:55:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FGSystemMgr::~FGSystemMgr ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// end of system_manager.cxx
|