1
0
mirror of synced 2024-11-22 10:03:51 +00:00
Pressurization dump switch
Autopilot
This commit is contained in:
Mark van Renswoude 2012-11-28 20:34:36 +00:00
parent 25aa106abc
commit 208da55c23
5 changed files with 97 additions and 92 deletions

View File

@ -28,7 +28,7 @@ object MainForm: TMainForm
Margins.Top = 8 Margins.Top = 8
Margins.Right = 8 Margins.Right = 8
Margins.Bottom = 8 Margins.Bottom = 8
ActivePage = tsAbout ActivePage = tsFSX
Align = alClient Align = alClient
TabOrder = 1 TabOrder = 1
object tsFSX: TTabSheet object tsFSX: TTabSheet
@ -275,6 +275,10 @@ object MainForm: TMainForm
Caption = 'Extra' Caption = 'Extra'
ImageIndex = 1 ImageIndex = 1
TabVisible = False TabVisible = False
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object GroupBox1: TGroupBox object GroupBox1: TGroupBox
AlignWithMargins = True AlignWithMargins = True
Left = 6 Left = 6
@ -438,7 +442,6 @@ object MainForm: TMainForm
object tsAbout: TTabSheet object tsAbout: TTabSheet
Caption = 'About' Caption = 'About'
ImageIndex = 1 ImageIndex = 1
ExplicitLeft = 12
object lblVersionCaption: TLabel object lblVersionCaption: TLabel
Left = 16 Left = 16
Top = 67 Top = 67

View File

@ -81,9 +81,8 @@
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define> <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_Release>1</VerInfo_Release> <VerInfo_MinorVer>4</VerInfo_MinorVer>
<VerInfo_MinorVer>3</VerInfo_MinorVer> <VerInfo_Keys>CompanyName=X²Software;FileDescription=G940 LED Control;FileVersion=0.4.0.0;InternalName=;LegalCopyright=© 2011 X²Software;LegalTrademarks=;OriginalFilename=G940LEDControl.exe;ProductName=G940 LED Control;ProductVersion=0.4;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=X²Software;FileDescription=G940 LED Control;FileVersion=0.3.1.0;InternalName=;LegalCopyright=© 2011 X²Software;LegalTrademarks=;OriginalFilename=G940LEDControl.exe;ProductName=G940 LED Control;ProductVersion=0.3;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup> </PropertyGroup>

Binary file not shown.

View File

@ -31,6 +31,11 @@ const
FUNCTION_FSX_SPOILERS = FUNCTION_PROVIDER_OFFSET + 13; FUNCTION_FSX_SPOILERS = FUNCTION_PROVIDER_OFFSET + 13;
FUNCTION_FSX_PRESSURIZATIONDUMPSWITCH = FUNCTION_PROVIDER_OFFSET + 14;
FUNCTION_FSX_CARBHEAT = FUNCTION_PROVIDER_OFFSET + 15;
FUNCTION_FSX_AUTOPILOT = FUNCTION_PROVIDER_OFFSET + 16;
FUNCTION_FSX_FUELPUMP = FUNCTION_PROVIDER_OFFSET + 17;
type type
TFSXLEDStateProvider = class(TLEDStateProvider) TFSXLEDStateProvider = class(TLEDStateProvider)
@ -97,27 +102,6 @@ const
EVENT_ZOOM = 10; EVENT_ZOOM = 10;
FSX_VARIABLE_ISGEARRETRACTABLE = 'IS GEAR RETRACTABLE';
FSX_VARIABLE_GEARTOTALPCTEXTENDED = 'GEAR TOTAL PCT EXTENDED';
FSX_VARIABLE_LIGHTONSTATES = 'LIGHT ON STATES';
FSX_VARIABLE_PARKINGBRAKE = 'BRAKE PARKING INDICATOR';
FSX_VARIABLE_NUMBEROFENGINES = 'NUMBER OF ENGINES';
FSX_VARIABLE_ENGCOMBUSTION = 'GENERAL ENG COMBUSTION:%d';
FSX_VARIABLE_ENGFAILED = 'ENG FAILED:%d';
FSX_VARIABLE_ENGONFIRE = 'ENG ON FIRE:%d';
FSX_VARIABLE_ENGTHROTTLELEVERPOS = 'GENERAL ENG THROTTLE LEVER POSITION:%d';
FSX_VARIABLE_GEARDAMAGEBYSPEED = 'GEAR DAMAGE BY SPEED';
FSX_VARIABLE_GEARSPEEDEXCEEDED = 'GEAR SPEED EXCEEDED';
FSX_VARIABLE_CANOPYOPEN = 'CANOPY OPEN';
FSX_VARIABLE_FLAPSAVAILABLE = 'FLAPS AVAILABLE';
FSX_VARIABLE_FLAPSHANDLEPERCENT = 'FLAPS HANDLE PERCENT';
FSX_VARIABLE_AVIONICSMASTERSWITCH = 'AVIONICS MASTER SWITCH';
FSX_VARIABLE_ELECTRICALMASTERBATTERY = 'ELECTRICAL MASTER BATTERY';
FSX_VARIABLE_SPOILERSAVAILABLE = 'SPOILER AVAILABLE';
FSX_VARIABLE_SPOILERSHANDLEPOSITION = 'SPOILERS HANDLE POSITION';
FSX_UNIT_PERCENT = 'percent'; FSX_UNIT_PERCENT = 'percent';
FSX_UNIT_MASK = 'mask'; FSX_UNIT_MASK = 'mask';
FSX_UNIT_BOOL = 'bool'; FSX_UNIT_BOOL = 'bool';
@ -131,23 +115,6 @@ const
FSX_LIGHTON_CABIN = $0200; FSX_LIGHTON_CABIN = $0200;
CATEGORY_DYNAMIC = 'Dynamic';
FUNCTION_DESC_FSX_ENGINE = 'Engine';
FUNCTION_DESC_FSX_INSTRUMENTLIGHTS = 'Instrument lights';
FUNCTION_DESC_FSX_GEAR = 'Landing gear';
FUNCTION_DESC_FSX_LANDINGLIGHTS = 'Landing lights';
FUNCTION_DESC_FSX_PARKINGBRAKE = 'Parking brake';
FUNCTION_DESC_FSX_EXITDOOR = 'Exit door';
FUNCTION_DESC_FSX_STROBELIGHTS = 'Strobe lights';
FUNCTION_DESC_FSX_NAVLIGHTS = 'Nav lights';
FUNCTION_DESC_FSX_BEACONLIGHTS = 'Beacon lights';
FUNCTION_DESC_FSX_FLAPS = 'Flaps';
FUNCTION_DESC_FSX_BATTERYMASTER = 'Battery master switch';
FUNCTION_DESC_FSX_AVIONICSMASTER = 'Avionics master switch';
FUNCTION_DESC_FSX_SPOILERS = 'Spoilers (air brake)';
type type
TThrottleData = packed record TThrottleData = packed record
NumberOfEngines: Integer; NumberOfEngines: Integer;
@ -161,22 +128,25 @@ class procedure TFSXLEDStateProvider.EnumFunctions(AConsumer: IFunctionConsumer)
begin begin
inherited; inherited;
AConsumer.SetCategory(CATEGORY_DYNAMIC); AConsumer.SetCategory('Dynamic');
AConsumer.AddFunction(FUNCTION_FSX_ENGINE, FUNCTION_DESC_FSX_ENGINE);
AConsumer.AddFunction(FUNCTION_FSX_INSTRUMENTLIGHTS, FUNCTION_DESC_FSX_INSTRUMENTLIGHTS);
AConsumer.AddFunction(FUNCTION_FSX_GEAR, FUNCTION_DESC_FSX_GEAR);
AConsumer.AddFunction(FUNCTION_FSX_LANDINGLIGHTS, FUNCTION_DESC_FSX_LANDINGLIGHTS);
AConsumer.AddFunction(FUNCTION_FSX_PARKINGBRAKE, FUNCTION_DESC_FSX_PARKINGBRAKE);
AConsumer.AddFunction(FUNCTION_FSX_EXITDOOR, FUNCTION_DESC_FSX_EXITDOOR); AConsumer.AddFunction(FUNCTION_FSX_AUTOPILOT, 'Auto pilot (main)');
AConsumer.AddFunction(FUNCTION_FSX_STROBELIGHTS, FUNCTION_DESC_FSX_STROBELIGHTS); AConsumer.AddFunction(FUNCTION_FSX_AVIONICSMASTER, 'Avionics master switch');
AConsumer.AddFunction(FUNCTION_FSX_NAVLIGHTS, FUNCTION_DESC_FSX_NAVLIGHTS); AConsumer.AddFunction(FUNCTION_FSX_BATTERYMASTER, 'Battery master switch');
AConsumer.AddFunction(FUNCTION_FSX_BEACONLIGHTS, FUNCTION_DESC_FSX_BEACONLIGHTS); AConsumer.AddFunction(FUNCTION_FSX_BEACONLIGHTS, 'Beacon lights');
AConsumer.AddFunction(FUNCTION_FSX_FLAPS, FUNCTION_DESC_FSX_FLAPS); // AConsumer.AddFunction(FUNCTION_FSX_CARBHEAT, 'Carburator heat / anti-ice');
AConsumer.AddFunction(FUNCTION_FSX_BATTERYMASTER, FUNCTION_DESC_FSX_BATTERYMASTER); AConsumer.AddFunction(FUNCTION_FSX_ENGINE, 'Engine');
AConsumer.AddFunction(FUNCTION_FSX_AVIONICSMASTER, FUNCTION_DESC_FSX_AVIONICSMASTER); AConsumer.AddFunction(FUNCTION_FSX_EXITDOOR, 'Exit door');
AConsumer.AddFunction(FUNCTION_FSX_FLAPS, 'Flaps');
AConsumer.AddFunction(FUNCTION_FSX_SPOILERS, FUNCTION_DESC_FSX_SPOILERS); // AConsumer.AddFunction(FUNCTION_FSX_FUELPUMP, 'Fuel boost pump');
AConsumer.AddFunction(FUNCTION_FSX_GEAR, 'Landing gear');
AConsumer.AddFunction(FUNCTION_FSX_INSTRUMENTLIGHTS, 'Instrument lights');
AConsumer.AddFunction(FUNCTION_FSX_LANDINGLIGHTS, 'Landing lights');
AConsumer.AddFunction(FUNCTION_FSX_NAVLIGHTS, 'Nav lights');
AConsumer.AddFunction(FUNCTION_FSX_PARKINGBRAKE, 'Parking brake');
AConsumer.AddFunction(FUNCTION_FSX_PRESSURIZATIONDUMPSWITCH, 'Pressurization dump switch');
AConsumer.AddFunction(FUNCTION_FSX_SPOILERS, 'Spoilers (air brake)');
AConsumer.AddFunction(FUNCTION_FSX_STROBELIGHTS, 'Strobe lights');
end; end;
@ -267,44 +237,42 @@ begin
{ Gear } { Gear }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_GEAR) then if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_GEAR) then
begin begin
AddVariable(DEFINITION_GEAR, FSX_VARIABLE_ISGEARRETRACTABLE, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_GEAR, 'IS GEAR RETRACTABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_GEAR, FSX_VARIABLE_GEARTOTALPCTEXTENDED, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64); AddVariable(DEFINITION_GEAR, 'GEAR TOTAL PCT EXTENDED', FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
AddVariable(DEFINITION_GEAR, FSX_VARIABLE_GEARDAMAGEBYSPEED, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_GEAR, 'GEAR DAMAGE BY SPEED', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_GEAR, FSX_VARIABLE_GEARSPEEDEXCEEDED, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_GEAR, 'GEAR SPEED EXCEEDED', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddDefinition(DEFINITION_GEAR); AddDefinition(DEFINITION_GEAR);
end; end;
{ Lights } { Lights }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_LANDINGLIGHTS) or if Consumer.FunctionMap.HasFunction([FUNCTION_FSX_LANDINGLIGHTS, FUNCTION_FSX_INSTRUMENTLIGHTS,
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_INSTRUMENTLIGHTS) or FUNCTION_FSX_STROBELIGHTS, FUNCTION_FSX_NAVLIGHTS,
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_STROBELIGHTS) or FUNCTION_FSX_BEACONLIGHTS]) then
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_NAVLIGHTS) or
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_BEACONLIGHTS) then
begin begin
AddVariable(DEFINITION_LIGHTS, FSX_VARIABLE_LIGHTONSTATES, FSX_UNIT_MASK, SIMCONNECT_DATATYPE_INT32); AddVariable(DEFINITION_LIGHTS, 'LIGHT ON STATES', FSX_UNIT_MASK, SIMCONNECT_DATATYPE_INT32);
AddDefinition(DEFINITION_LIGHTS); AddDefinition(DEFINITION_LIGHTS);
end; end;
{ Parking brake } { Parking brake }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_PARKINGBRAKE) then if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_PARKINGBRAKE) then
begin begin
AddVariable(DEFINITION_PARKINGBRAKE, FSX_VARIABLE_PARKINGBRAKE, FSX_UNIT_BOOL, SIMCONNECT_DATATYPE_INT32); AddVariable(DEFINITION_PARKINGBRAKE, 'BRAKE PARKING INDICATOR', FSX_UNIT_BOOL, SIMCONNECT_DATATYPE_INT32);
AddDefinition(DEFINITION_PARKINGBRAKE); AddDefinition(DEFINITION_PARKINGBRAKE);
end; end;
{ Engine } { Engine }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_ENGINE) then if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_ENGINE) then
begin begin
AddVariable(DEFINITION_ENGINE, FSX_VARIABLE_NUMBEROFENGINES, FSX_UNIT_NUMBER, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_ENGINE, 'NUMBER OF ENGINES', FSX_UNIT_NUMBER, SIMCONNECT_DATAType_INT32);
for engineIndex := 1 to MAX_ENGINES do for engineIndex := 1 to MAX_ENGINES do
AddVariable(DEFINITION_ENGINE, Format(FSX_VARIABLE_ENGCOMBUSTION, [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_ENGINE, Format('GENERAL ENG COMBUSTION:%d', [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
for engineIndex := 1 to MAX_ENGINES do for engineIndex := 1 to MAX_ENGINES do
AddVariable(DEFINITION_ENGINE, Format(FSX_VARIABLE_ENGFAILED, [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_ENGINE, Format('ENG FAILED:%d', [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
for engineIndex := 1 to MAX_ENGINES do for engineIndex := 1 to MAX_ENGINES do
AddVariable(DEFINITION_ENGINE, Format(FSX_VARIABLE_ENGONFIRE, [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_ENGINE, Format('ENG ON FIRE:%d', [engineIndex]), FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddDefinition(DEFINITION_ENGINE); AddDefinition(DEFINITION_ENGINE);
end; end;
@ -312,27 +280,34 @@ begin
{ Exit door } { Exit door }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_EXITDOOR) then if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_EXITDOOR) then
begin begin
AddVariable(DEFINITION_EXITDOOR, FSX_VARIABLE_CANOPYOPEN, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64); AddVariable(DEFINITION_EXITDOOR, 'CANOPY OPEN', FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
AddDefinition(DEFINITION_EXITDOOR); AddDefinition(DEFINITION_EXITDOOR);
end; end;
{ Flaps & spoilers } { Flaps & spoilers }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_FLAPS) or if Consumer.FunctionMap.HasFunction([FUNCTION_FSX_FLAPS, FUNCTION_FSX_SPOILERS]) then
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_SPOILERS) then
begin begin
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_FLAPSAVAILABLE, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_FLAPSSPOILERS, 'FLAPS AVAILABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_FLAPSHANDLEPERCENT, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64); AddVariable(DEFINITION_FLAPSSPOILERS, 'FLAPS HANDLE PERCENT', FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_SPOILERSAVAILABLE, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_FLAPSSPOILERS, 'SPOILER AVAILABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_SPOILERSHANDLEPOSITION, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64); AddVariable(DEFINITION_FLAPSSPOILERS, 'SPOILERS HANDLE POSITION', FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
AddDefinition(DEFINITION_FLAPSSPOILERS); AddDefinition(DEFINITION_FLAPSSPOILERS);
end; end;
{ Master switches } { Master switches }
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_BATTERYMASTER) or if Consumer.FunctionMap.HasFunction([FUNCTION_FSX_BATTERYMASTER, FUNCTION_FSX_AVIONICSMASTER,
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_AVIONICSMASTER) then FUNCTION_FSX_PRESSURIZATIONDUMPSWITCH, FUNCTION_FSX_CARBHEAT,
FUNCTION_FSX_AUTOPILOT, FUNCTION_FSX_FUELPUMP]) then
begin begin
AddVariable(DEFINITION_SWITCHES, FSX_VARIABLE_AVIONICSMASTERSWITCH, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_SWITCHES, 'AVIONICS MASTER SWITCH', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_SWITCHES, FSX_VARIABLE_ELECTRICALMASTERBATTERY, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32); AddVariable(DEFINITION_SWITCHES, 'ELECTRICAL MASTER BATTERY', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_SWITCHES, 'PRESSURIZATION DUMP SWITCH', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
// AddVariable(DEFINITION_SWITCHES, 'CARB HEAT AVAILABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
// AddVariable(DEFINITION_SWITCHES, 'PANEL ANTI ICE SWITCH', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_SWITCHES, 'AUTOPILOT AVAILABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddVariable(DEFINITION_SWITCHES, 'AUTOPILOT MASTER', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
// AddVariable(DEFINITION_SWITCHES, 'fuel pump?', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
AddDefinition(DEFINITION_SWITCHES); AddDefinition(DEFINITION_SWITCHES);
end; end;
@ -567,11 +542,19 @@ end;
procedure TFSXLEDStateProvider.HandleSwitchesData(AData: Pointer); procedure TFSXLEDStateProvider.HandleSwitchesData(AData: Pointer);
const
ONOFF_STATE: array[Boolean] of TLEDState = (lsRed, lsGreen);
type type
PSwitchesData = ^TSwitchesData; PSwitchesData = ^TSwitchesData;
TSwitchesData = packed record TSwitchesData = packed record
AvionicsSwitch: Cardinal; AvionicsSwitch: Cardinal;
BatterySwitch: Cardinal; BatterySwitch: Cardinal;
PressurizationDumpSwitch: Cardinal;
// CarbHeatAvailable: Cardinal;
// AntiIceSwitch: Cardinal;
AutoPilotAvailable: Cardinal;
AutoPilotMaster: Cardinal;
end; end;
var var
@ -580,15 +563,19 @@ var
begin begin
switchesData := AData; switchesData := AData;
if switchesData^.AvionicsSwitch <> 0 then Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, ONOFF_STATE[switchesData^.AvionicsSwitch <> 0]);
Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, lsGreen) Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, ONOFF_STATE[switchesData^.BatterySwitch <> 0]);
else Consumer.SetStateByFunction(FUNCTION_FSX_PRESSURIZATIONDUMPSWITCH, ONOFF_STATE[switchesData^.PressurizationDumpSwitch <> 0]);
Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, lsRed);
if switchesData^.BatterySwitch <> 0 then // if switchesData^.CarbHeatAvailable <> 0 then
Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, lsGreen) // Consumer.SetStateByFunction(FUNCTION_FSX_CARBHEAT, ONOFF_STATE[switchesData^.AntiIceSwitch <> 0])
// else
// Consumer.SetStateByFunction(FUNCTION_FSX_CARBHEAT, lsOff);
if switchesData^.AutoPilotAvailable <> 0 then
Consumer.SetStateByFunction(FUNCTION_FSX_AUTOPILOT, ONOFF_STATE[switchesData^.AutoPilotMaster <> 0])
else else
Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, lsRed); Consumer.SetStateByFunction(FUNCTION_FSX_AUTOPILOT, lsOff);
end; end;

View File

@ -25,7 +25,8 @@ type
procedure SetFunction(ALEDIndex, AFunction: Integer); procedure SetFunction(ALEDIndex, AFunction: Integer);
function GetFunction(ALEDIndex: Integer): Integer; function GetFunction(ALEDIndex: Integer): Integer;
function HasFunction(AFunction: Integer): Boolean; function HasFunction(AFunction: Integer): Boolean; overload;
function HasFunction(AFunctions: array of Integer): Boolean; overload;
function FindFirst(AFunction: Integer; out ALEDIndex: Integer): Boolean; function FindFirst(AFunction: Integer; out ALEDIndex: Integer): Boolean;
function FindNext(AFunction: Integer; out ALEDIndex: Integer): Boolean; function FindNext(AFunction: Integer; out ALEDIndex: Integer): Boolean;
@ -102,6 +103,21 @@ begin
end; end;
function TLEDFunctionMap.HasFunction(AFunctions: array of Integer): Boolean;
var
functionNo: Integer;
begin
Result := False;
for functionNo in AFunctions do
begin
Result := HasFunction(functionNo);
if Result then
break;
end;
end;
function TLEDFunctionMap.HasFunction(AFunction: Integer): Boolean; function TLEDFunctionMap.HasFunction(AFunction: Integer): Boolean;
var var
ledIndex: Integer; ledIndex: Integer;