From 208da55c2349896d3096a3006fd5a8d632c6a00a Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 28 Nov 2012 20:34:36 +0000 Subject: [PATCH] Added: Pressurization dump switch Autopilot --- G940LEDControl/Forms/MainFrm.dfm | 7 +- G940LEDControl/G940LEDControl.dproj | 5 +- G940LEDControl/G940LEDControl.res | Bin 28524 -> 28524 bytes G940LEDControl/Units/FSXLEDStateProvider.pas | 159 +++++++++---------- G940LEDControl/Units/LEDFunctionMap.pas | 18 ++- 5 files changed, 97 insertions(+), 92 deletions(-) diff --git a/G940LEDControl/Forms/MainFrm.dfm b/G940LEDControl/Forms/MainFrm.dfm index ea9ac7a..f69ef25 100644 --- a/G940LEDControl/Forms/MainFrm.dfm +++ b/G940LEDControl/Forms/MainFrm.dfm @@ -28,7 +28,7 @@ object MainForm: TMainForm Margins.Top = 8 Margins.Right = 8 Margins.Bottom = 8 - ActivePage = tsAbout + ActivePage = tsFSX Align = alClient TabOrder = 1 object tsFSX: TTabSheet @@ -275,6 +275,10 @@ object MainForm: TMainForm Caption = 'Extra' ImageIndex = 1 TabVisible = False + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object GroupBox1: TGroupBox AlignWithMargins = True Left = 6 @@ -438,7 +442,6 @@ object MainForm: TMainForm object tsAbout: TTabSheet Caption = 'About' ImageIndex = 1 - ExplicitLeft = 12 object lblVersionCaption: TLabel Left = 16 Top = 67 diff --git a/G940LEDControl/G940LEDControl.dproj b/G940LEDControl/G940LEDControl.dproj index 4edf5e7..6346c56 100644 --- a/G940LEDControl/G940LEDControl.dproj +++ b/G940LEDControl/G940LEDControl.dproj @@ -81,9 +81,8 @@ RELEASE;$(DCC_Define) - 1 - 3 - 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= + 4 + 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= 1033 $(BDS)\bin\default_app.manifest diff --git a/G940LEDControl/G940LEDControl.res b/G940LEDControl/G940LEDControl.res index e8d7e2c259a05d3f1b33df851d077be8cacab5f3..2f3e5fdb991dc89fea9d3b952799645a41633f1f 100644 GIT binary patch delta 40 rcmaEJkMYet#t8+SEDR99vayn#k=2AjkHKJbD 0 then - Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, lsGreen) - else - Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, lsRed); + Consumer.SetStateByFunction(FUNCTION_FSX_AVIONICSMASTER, ONOFF_STATE[switchesData^.AvionicsSwitch <> 0]); + Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, ONOFF_STATE[switchesData^.BatterySwitch <> 0]); + Consumer.SetStateByFunction(FUNCTION_FSX_PRESSURIZATIONDUMPSWITCH, ONOFF_STATE[switchesData^.PressurizationDumpSwitch <> 0]); - if switchesData^.BatterySwitch <> 0 then - Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, lsGreen) +// if switchesData^.CarbHeatAvailable <> 0 then +// 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 - Consumer.SetStateByFunction(FUNCTION_FSX_BATTERYMASTER, lsRed); + Consumer.SetStateByFunction(FUNCTION_FSX_AUTOPILOT, lsOff); end; diff --git a/G940LEDControl/Units/LEDFunctionMap.pas b/G940LEDControl/Units/LEDFunctionMap.pas index 3d9dd83..2b68e7a 100644 --- a/G940LEDControl/Units/LEDFunctionMap.pas +++ b/G940LEDControl/Units/LEDFunctionMap.pas @@ -25,7 +25,8 @@ type procedure SetFunction(ALEDIndex, AFunction: 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 FindNext(AFunction: Integer; out ALEDIndex: Integer): Boolean; @@ -102,6 +103,21 @@ begin 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; var ledIndex: Integer;