1
0
mirror of synced 2024-11-05 11:09:17 +00:00

Added Auto brake and Spoilers armed functions

Added search functionality for functions
Updated version of SimConnect Steam Edition
This commit is contained in:
Mark van Renswoude 2015-12-19 13:53:10 +00:00
parent b648821e7d
commit 7a1e4ed494
12 changed files with 480 additions and 121 deletions

View File

@ -40,8 +40,7 @@ object ButtonFunctionForm: TButtonFunctionForm
Margins.Bottom = 0 Margins.Bottom = 0
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 3 TabOrder = 2
ExplicitTop = 441
DesignSize = ( DesignSize = (
692 692
43) 43)
@ -76,42 +75,6 @@ object ButtonFunctionForm: TButtonFunctionForm
TabOrder = 1 TabOrder = 1
end end
end end
object vstFunctions: TVirtualStringTree
AlignWithMargins = True
Left = 8
Top = 60
Width = 257
Height = 450
Margins.Left = 8
Margins.Top = 8
Margins.Right = 0
Margins.Bottom = 0
Align = alLeft
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
IncrementalSearch = isAll
TabOrder = 1
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoSort, toAutoTristateTracking, toAutoDeleteMovedNodes]
TreeOptions.MiscOptions = [toAcceptOLEDrop, toFullRepaintOnResize, toInitOnSave, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowTreeLines, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnFocusChanged = vstFunctionsFocusChanged
OnGetText = vstFunctionsGetText
OnPaintText = vstFunctionsPaintText
OnIncrementalSearch = vstFunctionsIncrementalSearch
ExplicitHeight = 373
Columns = <
item
Position = 0
Width = 253
WideText = 'Available functions'
end>
end
object pnlFunction: TPanel object pnlFunction: TPanel
AlignWithMargins = True AlignWithMargins = True
Left = 273 Left = 273
@ -124,8 +87,7 @@ object ButtonFunctionForm: TButtonFunctionForm
Margins.Bottom = 0 Margins.Bottom = 0
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 2 TabOrder = 1
ExplicitHeight = 373
object pnlName: TPanel object pnlName: TPanel
Left = 0 Left = 0
Top = 0 Top = 0
@ -197,7 +159,6 @@ object ButtonFunctionForm: TButtonFunctionForm
Align = alClient Align = alClient
BorderStyle = bsNone BorderStyle = bsNone
TabOrder = 1 TabOrder = 1
ExplicitHeight = 276
end end
end end
object pnlHeader: TPanel object pnlHeader: TPanel
@ -266,4 +227,80 @@ object ButtonFunctionForm: TButtonFunctionForm
ParentFont = False ParentFont = False
end end
end end
object pnlFunctions: TPanel
AlignWithMargins = True
Left = 8
Top = 60
Width = 257
Height = 450
Margins.Left = 8
Margins.Top = 8
Margins.Right = 0
Margins.Bottom = 0
Align = alLeft
BevelOuter = bvNone
TabOrder = 3
ExplicitLeft = 265
ExplicitTop = 52
ExplicitHeight = 458
object vstFunctions: TVirtualStringTree
Left = 0
Top = 29
Width = 257
Height = 421
Align = alClient
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
IncrementalSearch = isAll
TabOrder = 1
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoSort, toAutoTristateTracking, toAutoDeleteMovedNodes]
TreeOptions.MiscOptions = [toAcceptOLEDrop, toFullRepaintOnResize, toInitOnSave, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowTreeLines, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnFocusChanged = vstFunctionsFocusChanged
OnGetText = vstFunctionsGetText
OnPaintText = vstFunctionsPaintText
OnIncrementalSearch = vstFunctionsIncrementalSearch
ExplicitTop = 8
ExplicitHeight = 450
Columns = <
item
Position = 0
Width = 253
WideText = 'Available functions'
end>
end
object edtSearch: TEdit
Tag = 1
AlignWithMargins = True
Left = 0
Top = 0
Width = 257
Height = 21
Margins.Left = 0
Margins.Top = 0
Margins.Right = 0
Margins.Bottom = 8
Align = alTop
Font.Charset = DEFAULT_CHARSET
Font.Color = clGrayText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
Text = 'Search...'
OnChange = edtSearchChange
OnEnter = edtSearchEnter
OnExit = edtSearchExit
ExplicitLeft = 72
ExplicitTop = 216
ExplicitWidth = 121
end
end
end end

View File

@ -43,6 +43,8 @@ type
lblCurrentFunction: TLabel; lblCurrentFunction: TLabel;
lblCurrentCategory: TLabel; lblCurrentCategory: TLabel;
bvlFooter: TBevel; bvlFooter: TBevel;
pnlFunctions: TPanel;
edtSearch: TEdit;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
@ -51,6 +53,9 @@ type
procedure vstFunctionsFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex); procedure vstFunctionsFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
procedure vstFunctionsIncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const SearchText: string; var Result: Integer); procedure vstFunctionsIncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const SearchText: string; var Result: Integer);
procedure btnOKClick(Sender: TObject); procedure btnOKClick(Sender: TObject);
procedure edtSearchChange(Sender: TObject);
procedure edtSearchEnter(Sender: TObject);
procedure edtSearchExit(Sender: TObject);
private private
FProfile: TProfile; FProfile: TProfile;
FButtonIndex: Integer; FButtonIndex: Integer;
@ -64,6 +69,7 @@ type
procedure Initialize(AProfile: TProfile; AButtonIndex: Integer); procedure Initialize(AProfile: TProfile; AButtonIndex: Integer);
procedure LoadFunctions; procedure LoadFunctions;
procedure ApplyFilter(const AFilter: string);
procedure SetFunction(AProvider: ILEDFunctionProvider; AFunction: ILEDFunction); procedure SetFunction(AProvider: ILEDFunctionProvider; AFunction: ILEDFunction);
procedure LoadStates(AProvider: ILEDFunctionProvider; AFunction: ILEDMultiStateFunction); procedure LoadStates(AProvider: ILEDFunctionProvider; AFunction: ILEDMultiStateFunction);
@ -99,6 +105,7 @@ type
implementation implementation
uses uses
System.Math, System.Math,
System.StrUtils,
System.SysUtils, System.SysUtils,
Winapi.Windows, Winapi.Windows,
@ -232,6 +239,55 @@ begin
end; end;
procedure TButtonFunctionForm.ApplyFilter(const AFilter: string);
var
hasFilter: Boolean;
categoryNode: PVirtualNode;
functionNode: PVirtualNode;
hasVisibleChildren: Boolean;
nodeData: PFunctionNodeData;
begin
hasFilter := (Length(AFilter) > 0);
vstFunctions.BeginUpdate;
try
categoryNode := vstFunctions.GetFirst;
while Assigned(categoryNode) do
begin
hasVisibleChildren := False;
functionNode := vstFunctions.GetFirstChild(categoryNode);
while Assigned(functionNode) do
begin
nodeData := vstFunctions.GetNodeData(functionNode);
if nodeData^.NodeType = ntFunction then
begin
if hasFilter and (not ContainsText(nodeData^.LEDFunction.GetDisplayName, AFilter)) then
Exclude(functionNode^.States, vsVisible)
else
Include(functionNode^.States, vsVisible);
end;
if vsVisible in functionNode^.States then
hasVisibleChildren := True;
functionNode := vstFunctions.GetNextSibling(functionNode);
end;
if hasVisibleChildren then
Include(categoryNode^.States, vsVisible)
else
Exclude(categoryNode^.States, vsVisible);
categoryNode := vstFunctions.GetNextSibling(categoryNode);
end;
finally
vstFunctions.EndUpdate;
end;
end;
procedure TButtonFunctionForm.SetFunction(AProvider: ILEDFunctionProvider; AFunction: ILEDFunction); procedure TButtonFunctionForm.SetFunction(AProvider: ILEDFunctionProvider; AFunction: ILEDFunction);
var var
multiStateFunction: ILEDMultiStateFunction; multiStateFunction: ILEDMultiStateFunction;
@ -476,6 +532,39 @@ begin
end; end;
procedure TButtonFunctionForm.edtSearchChange(Sender: TObject);
begin
if edtSearch.Tag = 1 then
ApplyFilter('')
else
ApplyFilter(Trim(edtSearch.Text));
end;
procedure TButtonFunctionForm.edtSearchEnter(Sender: TObject);
begin
if edtSearch.Tag = 1 then
begin
edtSearch.Text := '';
edtSearch.Font.Color := clWindowText;
edtSearch.Tag := 0;
end;
end;
procedure TButtonFunctionForm.edtSearchExit(Sender: TObject);
begin
if Length(Trim(edtSearch.Text)) = 0 then
begin
edtSearch.Tag := 1;
edtSearch.Text := 'Search...';
edtSearch.Font.Color := clGrayText;
end else
edtSearch.Tag := 0;
end;
{ TStateControlInfo } { TStateControlInfo }
constructor TStateControlInfo.Create(AState: ILEDState; AStateLabel: TLabel; AComboBox: TComboBox); constructor TStateControlInfo.Create(AState: ILEDState; AStateLabel: TLabel; AComboBox: TComboBox);
begin begin

View File

@ -1,7 +1,7 @@
object MainForm: TMainForm object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
ActiveControl = cbTrayIcon ActiveControl = cmbProfiles
BorderIcons = [biSystemMenu, biMinimize] BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle BorderStyle = bsSingle
Caption = 'G940 LED Control' Caption = 'G940 LED Control'
@ -30,15 +30,11 @@ object MainForm: TMainForm
Margins.Top = 8 Margins.Top = 8
Margins.Right = 8 Margins.Right = 8
Margins.Bottom = 8 Margins.Bottom = 8
ActivePage = tsConfiguration ActivePage = tsButtons
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
object tsButtons: TTabSheet object tsButtons: TTabSheet
Caption = ' Button assignment ' Caption = ' Button assignment '
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = ( DesignSize = (
442 442
452) 452)
@ -533,10 +529,6 @@ object MainForm: TMainForm
object tsAbout: TTabSheet object tsAbout: TTabSheet
Caption = 'About' Caption = 'About'
ImageIndex = 1 ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object lblVersionCaption: TLabel object lblVersionCaption: TLabel
Left = 16 Left = 16
Top = 67 Top = 67

View File

@ -13,6 +13,7 @@ uses
Vcl.StdCtrls, Vcl.StdCtrls,
Winapi.Messages, Winapi.Messages,
Winapi.Windows, Winapi.Windows,
Vcl.AppEvnts,
OtlComm, OtlComm,
OtlEventMonitor, OtlEventMonitor,
@ -27,7 +28,7 @@ uses
LEDStateConsumer, LEDStateConsumer,
Profile, Profile,
ProfileManager, ProfileManager,
Settings, Vcl.AppEvnts; Settings;
const const

View File

@ -8,7 +8,7 @@
<FrameworkType>VCL</FrameworkType> <FrameworkType>VCL</FrameworkType>
<ProjectVersion>13.4</ProjectVersion> <ProjectVersion>13.4</ProjectVersion>
<Base>True</Base> <Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config> <Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform> <Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms> <TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType> <AppType>Application</AppType>
@ -49,8 +49,7 @@
<Base>true</Base> <Base>true</Base>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''"> <PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_Build>1</VerInfo_Build> <VerInfo_Release>2</VerInfo_Release>
<VerInfo_Release>1</VerInfo_Release>
<VerInfo_MinorVer>1</VerInfo_MinorVer> <VerInfo_MinorVer>1</VerInfo_MinorVer>
<DCC_UsePackage>rtl;dbrtl;$(DCC_UsePackage)</DCC_UsePackage> <DCC_UsePackage>rtl;dbrtl;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_DcuOutput>Lib</DCC_DcuOutput> <DCC_DcuOutput>Lib</DCC_DcuOutput>
@ -60,7 +59,7 @@
<Manifest_File>None</Manifest_File> <Manifest_File>None</Manifest_File>
<Icon_MainIcon>G940LEDControl_Icon.ico</Icon_MainIcon> <Icon_MainIcon>G940LEDControl_Icon.ico</Icon_MainIcon>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace> <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=X²Software;FileDescription=G940 LED Control;FileVersion=1.1.1.1;InternalName=;LegalCopyright=© 2011 - 2015 X²Software;LegalTrademarks=;OriginalFilename=G940LEDControl.exe;ProductName=G940 LED Control;ProductVersion=1.1;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=X²Software;FileDescription=G940 LED Control;FileVersion=1.1.2.0;InternalName=;LegalCopyright=© 2011 - 2015 X²Software;LegalTrademarks=;OriginalFilename=G940LEDControl.exe;ProductName=G940 LED Control;ProductVersion=1.1;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''"> <PropertyGroup Condition="'$(Base_Win64)'!=''">
@ -98,7 +97,7 @@
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''"> <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<Debugger_RunParams>/restart</Debugger_RunParams> <Debugger_RunParams>/restart</Debugger_RunParams>
<VerInfo_IncludeVerInfo>false</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>false</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=0.2.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=0.2;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.1.1.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=0.2;Comments=</VerInfo_Keys>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -196,7 +195,8 @@
<VersionInfoKeys Name="Comments"/> <VersionInfoKeys Name="Comments"/>
</VersionInfoKeys> </VersionInfoKeys>
<Excluded_Packages> <Excluded_Packages>
<Excluded_Packages Name="F:\Components\bin\DXE2\win32\JvBDEDesign160.bpl">JVCL BDE Components</Excluded_Packages> <Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages> </Excluded_Packages>
</Delphi.Personality> </Delphi.Personality>
<Platforms> <Platforms>

Binary file not shown.

View File

@ -54,6 +54,13 @@ type
function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override; function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override;
end; end;
TFSXAutoBrakeFunction = class(TCustomFSXFunction)
protected
function GetCategoryName: string; override;
procedure RegisterStates; override;
function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override;
end;
TFSXPressDumpSwitchFunction = class(TCustomFSXInvertedOnOffFunction) TFSXPressDumpSwitchFunction = class(TCustomFSXInvertedOnOffFunction)
protected protected
function GetCategoryName: string; override; function GetCategoryName: string; override;
@ -120,6 +127,13 @@ type
function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override; function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override;
end; end;
TFSXSpoilersArmedFunction = class(TCustomFSXFunction)
protected
function GetCategoryName: string; override;
procedure RegisterStates; override;
function GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass; override;
end;
{ Lights } { Lights }
TCustomFSXLightFunction = class(TCustomFSXOnOffFunction) TCustomFSXLightFunction = class(TCustomFSXOnOffFunction)
@ -346,6 +360,27 @@ begin
end; end;
{ TFSXAutoBrakeFunction }
function TFSXAutoBrakeFunction.GetCategoryName: string;
begin
Result := FSXCategorySystems;
end;
procedure TFSXAutoBrakeFunction.RegisterStates;
begin
RegisterState(TLEDState.Create(FSXStateUIDAutoBrake0, FSXStateDisplayNameAutoBrake0, lcGreen));
RegisterState(TLEDState.Create(FSXStateUIDAutoBrake1, FSXStateDisplayNameAutoBrake1, lcAmber));
RegisterState(TLEDState.Create(FSXStateUIDAutoBrake2, FSXStateDisplayNameAutoBrake2, lcAmber));
RegisterState(TLEDState.Create(FSXStateUIDAutoBrake3, FSXStateDisplayNameAutoBrake3, lcAmber));
RegisterState(TLEDState.Create(FSXStateUIDAutoBrake4, FSXStateDisplayNameAutoBrake4, lcRed));
end;
function TFSXAutoBrakeFunction.GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass;
begin
Result := TFSXAutoBrakeFunctionWorker;
end;
{ TFSXPressDumpSwitchFunction } { TFSXPressDumpSwitchFunction }
function TFSXPressDumpSwitchFunction.GetCategoryName: string; function TFSXPressDumpSwitchFunction.GetCategoryName: string;
begin begin
@ -530,6 +565,27 @@ begin
end; end;
{ TFSXSpoilersArmedFunction }
function TFSXSpoilersArmedFunction.GetCategoryName: string;
begin
Result := FSXCategoryControlSurfaces;
end;
procedure TFSXSpoilersArmedFunction.RegisterStates;
begin
RegisterState(TLEDState.Create(FSXStateUIDSpoilersNotAvailable, FSXStateDisplayNameSpoilersNotAvailable, lcOff));
RegisterState(TLEDState.Create(FSXStateUIDOn, FSXStateDisplayNameOn, lcRed));
RegisterState(TLEDState.Create(FSXStateUIDOff, FSXStateDisplayNameOff, lcGreen));
end;
function TFSXSpoilersArmedFunction.GetWorkerClass: TCustomLEDMultiStateFunctionWorkerClass;
begin
Result := TFSXSpoilersArmedFunctionWorker;
end;
{ TFSXLightFunction } { TFSXLightFunction }
function TCustomFSXLightFunction.GetCategoryName: string; function TCustomFSXLightFunction.GetCategoryName: string;
begin begin

View File

@ -137,6 +137,7 @@ begin
RegisterFunction(TFSXExitDoorFunction.Create( Self, FSXFunctionDisplayNameExitDoor, FSXFunctionUIDExitDoor)); RegisterFunction(TFSXExitDoorFunction.Create( Self, FSXFunctionDisplayNameExitDoor, FSXFunctionUIDExitDoor));
RegisterFunction(TFSXGearFunction.Create( Self, FSXFunctionDisplayNameGear, FSXFunctionUIDGear)); RegisterFunction(TFSXGearFunction.Create( Self, FSXFunctionDisplayNameGear, FSXFunctionUIDGear));
RegisterFunction(TFSXParkingBrakeFunction.Create( Self, FSXFunctionDisplayNameParkingBrake, FSXFunctionUIDParkingBrake)); RegisterFunction(TFSXParkingBrakeFunction.Create( Self, FSXFunctionDisplayNameParkingBrake, FSXFunctionUIDParkingBrake));
RegisterFunction(TFSXAutoBrakeFunction.Create( Self, FSXFunctionDisplayNameAutoBrake, FSXFunctionUIDAutoBrake));
RegisterFunction(TFSXPressDumpSwitchFunction.Create( Self, FSXFunctionDisplayNamePressDumpSwitch, FSXFunctionUIDPressDumpSwitch)); RegisterFunction(TFSXPressDumpSwitchFunction.Create( Self, FSXFunctionDisplayNamePressDumpSwitch, FSXFunctionUIDPressDumpSwitch));
RegisterFunction(TFSXTailHookFunction.Create( Self, FSXFunctionDisplayNameTailHook, FSXFunctionUIDTailHook)); RegisterFunction(TFSXTailHookFunction.Create( Self, FSXFunctionDisplayNameTailHook, FSXFunctionUIDTailHook));
@ -152,6 +153,7 @@ begin
{ Control surfaces } { Control surfaces }
RegisterFunction(TFSXFlapsFunction.Create( Self, FSXFunctionDisplayNameFlaps, FSXFunctionUIDFlaps)); RegisterFunction(TFSXFlapsFunction.Create( Self, FSXFunctionDisplayNameFlaps, FSXFunctionUIDFlaps));
RegisterFunction(TFSXSpoilersFunction.Create( Self, FSXFunctionDisplayNameSpoilers, FSXFunctionUIDSpoilers)); RegisterFunction(TFSXSpoilersFunction.Create( Self, FSXFunctionDisplayNameSpoilers, FSXFunctionUIDSpoilers));
RegisterFunction(TFSXSpoilersArmedFunction.Create( Self, FSXFunctionDisplayNameSpoilersArmed, FSXFunctionUIDSpoilersArmed));
{ Lights } { Lights }
RegisterFunction(TFSXBeaconLightsFunction.Create( Self, FSXFunctionDisplayNameBeaconLights, FSXFunctionUIDBeaconLights)); RegisterFunction(TFSXBeaconLightsFunction.Create( Self, FSXFunctionDisplayNameBeaconLights, FSXFunctionUIDBeaconLights));

View File

@ -45,6 +45,12 @@ type
procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override; procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override;
end; end;
TFSXAutoBrakeFunctionWorker = class(TCustomFSXOnOffFunctionWorker)
protected
procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override;
procedure HandleData(AData: Pointer); override;
end;
TFSXPressDumpSwitchFunctionWorker = class(TCustomFSXOnOffFunctionWorker) TFSXPressDumpSwitchFunctionWorker = class(TCustomFSXOnOffFunctionWorker)
protected protected
procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override; procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override;
@ -103,6 +109,12 @@ type
procedure HandleData(AData: Pointer); override; procedure HandleData(AData: Pointer); override;
end; end;
TFSXSpoilersArmedFunctionWorker = class(TCustomFSXFunctionWorker)
protected
procedure RegisterVariables(ADefinition: IFSXSimConnectDefinition); override;
procedure HandleData(AData: Pointer); override;
end;
{ Lights } { Lights }
TFSXLightStatesFunctionWorker = class(TCustomFSXFunctionWorker) TFSXLightStatesFunctionWorker = class(TCustomFSXFunctionWorker)
@ -313,6 +325,36 @@ begin
end; end;
{ TFSXAutoBrakeFunctionWorker }
procedure TFSXAutoBrakeFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition);
begin
ADefinition.AddVariable('AUTO BRAKE SWITCH CB', FSX_UNIT_NUMBER, SIMCONNECT_DATAType_INT32);
end;
procedure TFSXAutoBrakeFunctionWorker.HandleData(AData: Pointer);
type
PAutoBrakeData = ^TAutoBrakeData;
TAutoBrakeData = packed record
Position: Cardinal;
end;
var
autoBrakeData: PAutoBrakeData;
begin
autoBrakeData := AData;
case autoBrakeData^.Position of
0: SetCurrentState(FSXStateUIDAutoBrake0);
1: SetCurrentState(FSXStateUIDAutoBrake1);
2: SetCurrentState(FSXStateUIDAutoBrake2);
3: SetCurrentState(FSXStateUIDAutoBrake3);
else
SetCurrentState(FSXStateUIDAutoBrake4);
end;
end;
{ TFSXPressDumpSwitchFunctionWorker } { TFSXPressDumpSwitchFunctionWorker }
procedure TFSXPressDumpSwitchFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition); procedure TFSXPressDumpSwitchFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition);
begin begin
@ -631,7 +673,7 @@ var
begin begin
spoilersData := AData; spoilersData := AData;
if SpoilersData^.SpoilersAvailable <> 0 then if spoilersData^.SpoilersAvailable <> 0 then
begin begin
case Trunc(SpoilersData^.SpoilersHandlePercent) of case Trunc(SpoilersData^.SpoilersHandlePercent) of
0..5: SetCurrentState(FSXStateUIDSpoilersRetracted); 0..5: SetCurrentState(FSXStateUIDSpoilersRetracted);
@ -643,6 +685,40 @@ begin
end; end;
{ TFSXSpoilersArmedFunctionWorker }
procedure TFSXSpoilersArmedFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition);
begin
ADefinition.AddVariable('SPOILER AVAILABLE', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
ADefinition.AddVariable('SPOILERS ARMED', FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
end;
procedure TFSXSpoilersArmedFunctionWorker.HandleData(AData: Pointer);
type
PSpoilersArmedData = ^TSpoilersArmedData;
TSpoilersArmedData = packed record
SpoilersAvailable: Cardinal;
SpoilersArmed: Cardinal;
end;
var
spoilersArmedData: PSpoilersArmedData;
begin
spoilersArmedData := AData;
if spoilersArmedData^.SpoilersAvailable <> 0 then
begin
if spoilersArmedData^.SpoilersArmed <> 0 then
SetCurrentState(FSXStateUIDOn)
else
SetCurrentState(FSXStateUIDOff);
end else
SetCurrentState(FSXStateUIDSpoilersNotAvailable);
end;
{ TFSXLightStatesFunctionWorker } { TFSXLightStatesFunctionWorker }
procedure TFSXLightStatesFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition); procedure TFSXLightStatesFunctionWorker.RegisterVariables(ADefinition: IFSXSimConnectDefinition);
begin begin

View File

@ -278,6 +278,26 @@ const
FSXStateDisplayNamePitotOnIceFull = 'Heat on - Fully iced'; FSXStateDisplayNamePitotOnIceFull = 'Heat on - Fully iced';
FSXFunctionUIDAutoBrake = 'autoBrake';
FSXFunctionDisplayNameAutoBrake = 'Auto brake';
FSXStateUIDAutoBrake0 = '0';
FSXStateUIDAutoBrake1 = '1';
FSXStateUIDAutoBrake2 = '2';
FSXStateUIDAutoBrake3 = '3';
FSXStateUIDAutoBrake4 = '4';
FSXStateDisplayNameAutoBrake0 = 'Off / not available';
FSXStateDisplayNameAutoBrake1 = '1';
FSXStateDisplayNameAutoBrake2 = '2';
FSXStateDisplayNameAutoBrake3 = '3';
FSXStateDisplayNameAutoBrake4 = '4';
FSXFunctionUIDSpoilersArmed = 'spoilersArmed';
FSXFunctionDisplayNameSpoilersArmed = 'Auto-spoilers armed';
FSXMenuProfiles = 'G940 Profile'; FSXMenuProfiles = 'G940 Profile';
FSXMenuProfileFormat = 'G940: %s'; FSXMenuProfileFormat = 'G940: %s';
FSXMenuProfileFormatCascaded = '%s'; FSXMenuProfileFormatCascaded = '%s';

View File

@ -1,62 +1,148 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{e15b9b2c-c6df-43f5-b397-01c1885281f4}</ProjectGuid> <ProjectGuid>{e15b9b2c-c6df-43f5-b397-01c1885281f4}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler> <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<DCC_DependencyCheckOutputName>G940Test.exe</DCC_DependencyCheckOutputName> <DCC_DependencyCheckOutputName>G940Test.exe</DCC_DependencyCheckOutputName>
<MainSource>G940Test.dpr</MainSource> <MainSource>G940Test.dpr</MainSource>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>13.4</ProjectVersion>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1043</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<Icon_MainIcon>G940Test_Icon1.ico</Icon_MainIcon>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Icon_MainIcon>G940Test_Icon1.ico</Icon_MainIcon>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<Version>7.0</Version> <Version>7.0</Version>
<DCC_DebugInformation>False</DCC_DebugInformation> <DCC_DebugInformation>False</DCC_DebugInformation>
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo> <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE</DCC_Define> <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<Version>7.0</Version> <Version>7.0</Version>
<DCC_Define>DEBUG</DCC_Define> <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DcuOutput>Lib</DCC_DcuOutput> <DCC_DcuOutput>Lib</DCC_DcuOutput>
<DCC_ObjOutput>Lib</DCC_ObjOutput> <DCC_ObjOutput>Lib</DCC_ObjOutput>
<DCC_HppOutput>Lib</DCC_HppOutput> <DCC_HppOutput>Lib</DCC_HppOutput>
<DCC_UnitSearchPath>..\DirectX;..\Shared</DCC_UnitSearchPath> <DCC_UnitSearchPath>..\DirectX;..\Shared;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_ResourcePath>..\DirectX;..\Shared</DCC_ResourcePath> <DCC_ResourcePath>..\DirectX;..\Shared;$(DCC_ResourcePath)</DCC_ResourcePath>
<DCC_ObjPath>..\DirectX;..\Shared</DCC_ObjPath> <DCC_ObjPath>..\DirectX;..\Shared;$(DCC_ObjPath)</DCC_ObjPath>
<DCC_IncludePath>..\DirectX;..\Shared</DCC_IncludePath> <DCC_IncludePath>..\DirectX;..\Shared;$(DCC_IncludePath)</DCC_IncludePath>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<Borland.Personality>Delphi.Personality</Borland.Personality> <Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType /> <Borland.ProjectType/>
<BorlandProject> <BorlandProject>
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1043</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">G940Test.dpr</Source></Source><Excluded_Packages> <Delphi.Personality>
<Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1043</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">G940Test.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="P:\algemeen\bin\D2007\wpViewPDF_D2007.bpl">WPViewPDF - PDFViewClass</Excluded_Packages> <Excluded_Packages Name="P:\algemeen\bin\D2007\wpViewPDF_D2007.bpl">WPViewPDF - PDFViewClass</Excluded_Packages>
<Excluded_Packages Name="P:\algemeen\bin\D2007\madExceptVcl_.bpl">madExceptVcl 2.0c - www.madshi.net</Excluded_Packages> <Excluded_Packages Name="P:\algemeen\bin\D2007\madExceptVcl_.bpl">madExceptVcl 2.0c - www.madshi.net</Excluded_Packages>
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\Delphi11\dclcxPivotGridOLAPD11.bpl">ExpressPivotGrid 2 OLAP by Developer Express Inc.</Excluded_Packages> <Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\Delphi11\dclcxPivotGridOLAPD11.bpl">ExpressPivotGrid 2 OLAP by Developer Express Inc.</Excluded_Packages>
</Excluded_Packages></Delphi.Personality></BorlandProject></BorlandProject> </Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win64">False</Platform>
<Platform value="Win32">True</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" /> <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<ItemGroup> <ItemGroup>
<DelphiCompile Include="G940Test.dpr"> <DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="Forms\MainFrm.pas"> <DCCReference Include="Forms\MainFrm.pas">
<Form>MainForm</Form> <Form>MainForm</Form>
</DCCReference> </DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup> </ItemGroup>
</Project> <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
</Project>