FG1000 bugfixes
- Simulate solid-state gyro for orientation - Improve behaviour restarting interfaces - Improve generic support through Debug menu.
This commit is contained in:
parent
01dc9d0b38
commit
d02ad7922b
5 changed files with 23 additions and 21 deletions
|
@ -91,7 +91,7 @@ addMFD : func(index=nil, targetcanvas=nil) {
|
|||
index = size(keys(me.displays));
|
||||
} else if (me.displays[index] != nil) {
|
||||
print("FG1000 Index " ~ index ~ " already exists!");
|
||||
return
|
||||
return index;
|
||||
}
|
||||
|
||||
if (targetcanvas == nil) {
|
||||
|
@ -117,7 +117,7 @@ addPFD : func(index=nil, targetcanvas=nil) {
|
|||
index = size(keys(me.displays));
|
||||
} else if (me.displays[index] != nil) {
|
||||
print("FG1000 Index " ~ index ~ " already exists!");
|
||||
return
|
||||
return index;
|
||||
}
|
||||
|
||||
if (targetcanvas == nil) {
|
||||
|
|
|
@ -41,15 +41,19 @@ var GenericADCPublisher =
|
|||
],
|
||||
};
|
||||
|
||||
# Air data comes from the airspeed indicator as for a non-glass panel aircraft.
|
||||
obj.addPropMap("ADCTrueAirspeed", "/instrumentation/airspeed-indicator/true-speed-kt");
|
||||
obj.addPropMap("ADCIndicatedAirspeed", "/instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
|
||||
obj.addPropMap("ADCPitchDeg", "/instrumentation/attitude-indicator/indicated-pitch-deg");
|
||||
obj.addPropMap("ADCRollDeg", "/instrumentation/attitude-indicator/indicated-roll-deg");
|
||||
# Assume an accurate solid-state magnetometer
|
||||
obj.addPropMap("ADCPitchDeg", "/orientation/pitch-deg");
|
||||
obj.addPropMap("ADCRollDeg", "/orientation/roll-deg");
|
||||
|
||||
# TODO: Replace these with real values - shouldn't rely on steam-powered gauges.
|
||||
obj.addPropMap("ADCTurnRate", "/instrumentation/turn-indicator/indicated-turn-rate");
|
||||
obj.addPropMap("ADCSlipSkid", "/instrumentation/slip-skid-ball/indicated-slip-skid");
|
||||
|
||||
# Assume an accurate solid-state compass
|
||||
# Assume an accurate solid-state magnetometer
|
||||
obj.addPropMap("ADCHeadingMagneticDeg", "/orientation/heading-magnetic-deg");
|
||||
obj.addPropMap("ADCMagneticVariationDeg", "/environment/magnetic-variation-deg");
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ var GenericInterfaceController = {
|
|||
|
||||
stop : func() {
|
||||
if (me.running == 0) return;
|
||||
|
||||
|
||||
foreach (var interface; GenericInterfaceController.INTERFACE_LIST) {
|
||||
io.load_nasal(nasal_dir ~ 'Interfaces/' ~ interface ~ '.nas', "fg1000");
|
||||
var code = 'me.' ~ interface ~ 'Instance.stop();';
|
||||
|
|
|
@ -159,7 +159,11 @@ var TriggeredPropertyPublisher =
|
|||
|
||||
stop : func() {
|
||||
foreach (var l; me._listeners) {
|
||||
removelistener(l);
|
||||
# In some circumstances we may not have a valid listener ID, so we
|
||||
# just ignore the problem.
|
||||
var err = [];
|
||||
call( func removelistener(l), nil, err);
|
||||
if (size(err)) print("Ignoring error : " ~ err[0]);
|
||||
}
|
||||
|
||||
if(me._timer != nil) me._timer.stop();
|
||||
|
|
|
@ -840,16 +840,13 @@
|
|||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericInterfaceController.nas', "fg1000");
|
||||
}
|
||||
|
||||
var fg1000system = fg1000.FG1000.getOrCreateInstance();
|
||||
var pfdindex = fg1000system.addPFD();
|
||||
fg1000system.displayGUI(pfdindex);
|
||||
|
||||
# Start the interface controller after the FG1000, as it will publish
|
||||
# immediately and update the NAV/COM data.
|
||||
var interfaceController = fg1000.GenericInterfaceController.getOrCreateInstance();
|
||||
interfaceController.stop();
|
||||
interfaceController.start();
|
||||
|
||||
var fg1000system = fg1000.FG1000.getOrCreateInstance();
|
||||
var pfdindex = fg1000system.addPFD(1);
|
||||
fg1000system.displayGUI(pfdindex);
|
||||
|
||||
</script>
|
||||
</binding>
|
||||
</item>
|
||||
|
@ -865,16 +862,13 @@
|
|||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericInterfaceController.nas', "fg1000");
|
||||
}
|
||||
|
||||
var fg1000system = fg1000.FG1000.getOrCreateInstance();
|
||||
var mfdindex = fg1000system.addMFD();
|
||||
fg1000system.displayGUI(mfdindex);
|
||||
|
||||
# Start the interface controller after the FG1000, as it will publish
|
||||
# immediately and update the NAV/COM data.
|
||||
var interfaceController = fg1000.GenericInterfaceController.getOrCreateInstance();
|
||||
interfaceController.stop();
|
||||
interfaceController.start();
|
||||
|
||||
var fg1000system = fg1000.FG1000.getOrCreateInstance();
|
||||
var mfdindex = fg1000system.addMFD(2);
|
||||
fg1000system.displayGUI(mfdindex);
|
||||
|
||||
</script>
|
||||
</binding>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue