Fix to use renamed /controls properties.
This commit is contained in:
parent
726d97be3c
commit
7ba6807736
5 changed files with 24 additions and 23 deletions
|
@ -408,7 +408,7 @@ FGControls::bind ()
|
||||||
fgTie("/controls/gear/parking-brake", this,
|
fgTie("/controls/gear/parking-brake", this,
|
||||||
&FGControls::get_parking_brake,
|
&FGControls::get_parking_brake,
|
||||||
&FGControls::set_parking_brake);
|
&FGControls::set_parking_brake);
|
||||||
fgSetArchivable("/controls/parking-brake");
|
fgSetArchivable("/controls/gear/parking-brake");
|
||||||
|
|
||||||
fgTie("/controls/gear/steering", this,
|
fgTie("/controls/gear/steering", this,
|
||||||
&FGControls::get_steering, &FGControls::set_steering);
|
&FGControls::get_steering, &FGControls::set_steering);
|
||||||
|
|
|
@ -38,10 +38,10 @@ FGFDM::FGFDM()
|
||||||
{
|
{
|
||||||
_nextEngine = 0;
|
_nextEngine = 0;
|
||||||
|
|
||||||
// Map /controls/elevator to the approach elevator control. This
|
// Map /controls/flight/elevator to the approach elevator control. This
|
||||||
// should probably be settable, but there are very few aircraft
|
// should probably be settable, but there are very few aircraft
|
||||||
// who trim their approaches using things other than elevator.
|
// who trim their approaches using things other than elevator.
|
||||||
_airplane.setElevatorControl(parseAxis("/controls/elevator-trim"));
|
_airplane.setElevatorControl(parseAxis("/controls/flight/elevator-trim"));
|
||||||
}
|
}
|
||||||
|
|
||||||
FGFDM::~FGFDM()
|
FGFDM::~FGFDM()
|
||||||
|
@ -90,7 +90,7 @@ void FGFDM::init()
|
||||||
|
|
||||||
// This has a nasty habit of being false at startup. That's not
|
// This has a nasty habit of being false at startup. That's not
|
||||||
// good.
|
// good.
|
||||||
fgSetBool("/controls/gear-down", true);
|
fgSetBool("/controls/gear/gear-down", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not the worlds safest parser. But it's short & sweet.
|
// Not the worlds safest parser. But it's short & sweet.
|
||||||
|
|
|
@ -70,13 +70,13 @@ SG_USING_STD(map);
|
||||||
* <pre>
|
* <pre>
|
||||||
* void MySubsystem::bind ()
|
* void MySubsystem::bind ()
|
||||||
* {
|
* {
|
||||||
* fgTie("/controls/elevator", &_elevator);
|
* fgTie("/controls/flight/elevator", &_elevator);
|
||||||
* fgSetArchivable("/controls/elevator");
|
* fgSetArchivable("/controls/flight/elevator");
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* void MySubsystem::unbind ()
|
* void MySubsystem::unbind ()
|
||||||
* {
|
* {
|
||||||
* fgUntie("/controls/elevator");
|
* fgUntie("/controls/flight/elevator");
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -706,45 +706,45 @@ bool FGATC610x::do_analog_in() {
|
||||||
// aileron
|
// aileron
|
||||||
tmp = scale( ailerons_center->getIntValue(), ailerons_min->getIntValue(),
|
tmp = scale( ailerons_center->getIntValue(), ailerons_min->getIntValue(),
|
||||||
ailerons_max->getIntValue(), analog_in_data[0] );
|
ailerons_max->getIntValue(), analog_in_data[0] );
|
||||||
fgSetFloat( "/controls/aileron", tmp );
|
fgSetFloat( "/controls/flight/aileron", tmp );
|
||||||
// cout << "aileron = " << analog_in_data[0] << " = " << tmp;
|
// cout << "aileron = " << analog_in_data[0] << " = " << tmp;
|
||||||
// elevator
|
// elevator
|
||||||
tmp = -scale( elevator_center->getIntValue(), elevator_min->getIntValue(),
|
tmp = -scale( elevator_center->getIntValue(), elevator_min->getIntValue(),
|
||||||
elevator_max->getIntValue(), analog_in_data[5] );
|
elevator_max->getIntValue(), analog_in_data[5] );
|
||||||
fgSetFloat( "/controls/elevator", tmp );
|
fgSetFloat( "/controls/flight/elevator", tmp );
|
||||||
// cout << "trim = " << analog_in_data[4] << " = " << tmp;
|
// cout << "trim = " << analog_in_data[4] << " = " << tmp;
|
||||||
|
|
||||||
// elevator trim
|
// elevator trim
|
||||||
tmp = scale( trim_center->getIntValue(), trim_min->getIntValue(),
|
tmp = scale( trim_center->getIntValue(), trim_min->getIntValue(),
|
||||||
trim_max->getIntValue(), analog_in_data[4] );
|
trim_max->getIntValue(), analog_in_data[4] );
|
||||||
fgSetFloat( "/controls/elevator-trim", tmp );
|
fgSetFloat( "/controls/flight/elevator-trim", tmp );
|
||||||
// cout << " elev = " << analog_in_data[5] << " = " << tmp << endl;
|
// cout << " elev = " << analog_in_data[5] << " = " << tmp << endl;
|
||||||
|
|
||||||
// mixture
|
// mixture
|
||||||
tmp = scale( mixture_min->getIntValue(), mixture_max->getIntValue(),
|
tmp = scale( mixture_min->getIntValue(), mixture_max->getIntValue(),
|
||||||
analog_in_data[6] );
|
analog_in_data[6] );
|
||||||
fgSetFloat( "/controls/mixture[0]", tmp );
|
fgSetFloat( "/controls/engines/engine[0]/mixture", tmp );
|
||||||
fgSetFloat( "/controls/mixture[1]", tmp );
|
fgSetFloat( "/controls/engines/engine[1]/mixture", tmp );
|
||||||
|
|
||||||
// throttle
|
// throttle
|
||||||
tmp = scale( throttle_min->getIntValue(), throttle_max->getIntValue(),
|
tmp = scale( throttle_min->getIntValue(), throttle_max->getIntValue(),
|
||||||
analog_in_data[8] );
|
analog_in_data[8] );
|
||||||
fgSetFloat( "/controls/throttle[0]", tmp );
|
fgSetFloat( "/controls/engines/engine[0]/throttle", tmp );
|
||||||
fgSetFloat( "/controls/throttle[1]", tmp );
|
fgSetFloat( "/controls/engines/engine[1]/throttle", tmp );
|
||||||
// cout << "throttle = " << tmp << endl;
|
// cout << "throttle = " << tmp << endl;
|
||||||
|
|
||||||
// rudder
|
// rudder
|
||||||
tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
|
tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
|
||||||
rudder_max->getIntValue(), analog_in_data[10] );
|
rudder_max->getIntValue(), analog_in_data[10] );
|
||||||
fgSetFloat( "/controls/rudder", -tmp );
|
fgSetFloat( "/controls/flight/rudder", -tmp );
|
||||||
|
|
||||||
// toe brakes
|
// toe brakes
|
||||||
tmp = scale( brake_left_min->getIntValue(), brake_left_max->getIntValue(),
|
tmp = scale( brake_left_min->getIntValue(), brake_left_max->getIntValue(),
|
||||||
analog_in_data[20] );
|
analog_in_data[20] );
|
||||||
fgSetFloat( "/controls/brakes[0]", tmp );
|
fgSetFloat( "/controls/gear/wheel[0]/brake", tmp );
|
||||||
tmp = scale( brake_right_min->getIntValue(), brake_right_max->getIntValue(),
|
tmp = scale( brake_right_min->getIntValue(), brake_right_max->getIntValue(),
|
||||||
analog_in_data[21] );
|
analog_in_data[21] );
|
||||||
fgSetFloat( "/controls/brakes[1]", tmp );
|
fgSetFloat( "/controls/gear/wheel[1]/brake", tmp );
|
||||||
|
|
||||||
// nav1 volume
|
// nav1 volume
|
||||||
tmp = (float)analog_in_data[25] / 1024.0f;
|
tmp = (float)analog_in_data[25] / 1024.0f;
|
||||||
|
@ -1767,18 +1767,19 @@ bool FGATC610x::do_switches() {
|
||||||
mag2 = mag1;
|
mag2 = mag1;
|
||||||
mag1 = magnetos;
|
mag1 = magnetos;
|
||||||
if ( mag1 == mag2 && mag2 == mag3 ) {
|
if ( mag1 == mag2 && mag2 == mag3 ) {
|
||||||
fgSetInt( "/controls/magnetos[0]", magnetos );
|
fgSetInt( "/controls/engines/engine[0]/magneto", magnetos );
|
||||||
}
|
}
|
||||||
static bool start1, start2, start3;
|
static bool start1, start2, start3;
|
||||||
start3 = start2;
|
start3 = start2;
|
||||||
start2 = start1;
|
start2 = start1;
|
||||||
start1 = starter;
|
start1 = starter;
|
||||||
if ( start1 == start2 && start2 == start3 ) {
|
if ( start1 == start2 && start2 == start3 ) {
|
||||||
fgSetBool( "/controls/starter[0]", starter );
|
fgSetBool( "/controls/engines/engine[0]/starter", starter );
|
||||||
}
|
}
|
||||||
|
|
||||||
// other toggle switches
|
// other toggle switches
|
||||||
fgSetBool( "/controls/fuel-pump[0]", switch_matrix[board][0][2] );
|
fgSetBool( "/controls/engines/engine[0]/fuel-pump",
|
||||||
|
switch_matrix[board][0][2] );
|
||||||
fgSetBool( "/controls/switches/flashing-beacon",
|
fgSetBool( "/controls/switches/flashing-beacon",
|
||||||
switch_matrix[board][1][2] );
|
switch_matrix[board][1][2] );
|
||||||
fgSetBool( "/controls/switches/landing-light", switch_matrix[board][2][2] );
|
fgSetBool( "/controls/switches/landing-light", switch_matrix[board][2][2] );
|
||||||
|
@ -1807,7 +1808,7 @@ bool FGATC610x::do_switches() {
|
||||||
flap2 = flap1;
|
flap2 = flap1;
|
||||||
flap1 = flaps;
|
flap1 = flaps;
|
||||||
if ( flap1 == flap2 && flap2 == flap3 ) {
|
if ( flap1 == flap2 && flap2 == flap3 ) {
|
||||||
fgSetFloat( "/controls/flaps", flaps );
|
fgSetFloat( "/controls/flight/flaps", flaps );
|
||||||
}
|
}
|
||||||
|
|
||||||
// fuel selector (also filtered)
|
// fuel selector (also filtered)
|
||||||
|
@ -1864,7 +1865,7 @@ bool FGATC610x::do_switches() {
|
||||||
fgSetBool( "/controls/circuit-breakers/annunciators", true );
|
fgSetBool( "/controls/circuit-breakers/annunciators", true );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fgSetDouble( "/controls/parking-brake",
|
fgSetDouble( "/controls/gear/parking-brake",
|
||||||
switch_matrix[board][7][3] );
|
switch_matrix[board][7][3] );
|
||||||
fgSetDouble( "/radios/marker-beacon/power-btn",
|
fgSetDouble( "/radios/marker-beacon/power-btn",
|
||||||
switch_matrix[board][6][1] );
|
switch_matrix[board][6][1] );
|
||||||
|
|
|
@ -51,7 +51,7 @@ FGOpenGC::FGOpenGC() :
|
||||||
p_elevator_trim(fgGetNode("surface-positions/elevator_trim-pos-norm", true)),
|
p_elevator_trim(fgGetNode("surface-positions/elevator_trim-pos-norm", true)),
|
||||||
p_rudder(fgGetNode("surface-positions/rudder-pos-norm", true)),
|
p_rudder(fgGetNode("surface-positions/rudder-pos-norm", true)),
|
||||||
p_flaps(fgGetNode("surface-positions/flap-pos-norm", true)),
|
p_flaps(fgGetNode("surface-positions/flap-pos-norm", true)),
|
||||||
p_flaps_cmd(fgGetNode("/controls/flaps", true)),
|
p_flaps_cmd(fgGetNode("/controls/flight/flaps", true)),
|
||||||
p_alphadot(fgGetNode("/fdm/jsbsim/aero/alphadot-radsec", true)),
|
p_alphadot(fgGetNode("/fdm/jsbsim/aero/alphadot-radsec", true)),
|
||||||
p_betadot(fgGetNode("/fdm/jsbsim/aero/betadot-radsec", true))
|
p_betadot(fgGetNode("/fdm/jsbsim/aero/betadot-radsec", true))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue