Added support for spoilers (air brake)
Now checks if flaps/spoilers are available
This commit is contained in:
parent
b01ca9b9e7
commit
9e2fa518aa
@ -87,8 +87,7 @@ type
|
|||||||
procedure btnFSXToggleZoomClick(Sender: TObject);
|
procedure btnFSXToggleZoomClick(Sender: TObject);
|
||||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||||
procedure FunctionComboBoxChange(Sender: TObject);
|
procedure FunctionComboBoxChange(Sender: TObject);
|
||||||
procedure lblLinkLinkClick(Sender: TObject; const Link: string;
|
procedure lblLinkLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType);
|
||||||
LinkType: TSysLinkType);
|
|
||||||
private
|
private
|
||||||
FEventMonitor: TOmniEventMonitor;
|
FEventMonitor: TOmniEventMonitor;
|
||||||
FStateConsumerTask: IOmniTaskControl;
|
FStateConsumerTask: IOmniTaskControl;
|
||||||
|
@ -49,8 +49,16 @@
|
|||||||
<Base>true</Base>
|
<Base>true</Base>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Base)'!=''">
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<DCC_DcuOutput>Lib</DCC_DcuOutput>
|
||||||
|
<VerInfo_MajorVer>0</VerInfo_MajorVer>
|
||||||
|
<DCC_ExeOutput>Bin</DCC_ExeOutput>
|
||||||
|
<DCC_UnitSearchPath>..\Shared;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<VerInfo_MinorVer>2</VerInfo_MinorVer>
|
||||||
|
<Manifest_File>None</Manifest_File>
|
||||||
|
<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=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
<VerInfo_Keys>CompanyName=X²Software;FileDescription=G940 LED Control;FileVersion=0.2.0.0;InternalName=;LegalCopyright=© 2011 X²Software;LegalTrademarks=;OriginalFilename=G940LEDControl.exe;ProductName=G940 LED Control;ProductVersion=0.2;Comments=</VerInfo_Keys>
|
||||||
<VerInfo_Locale>1043</VerInfo_Locale>
|
<VerInfo_Locale>1043</VerInfo_Locale>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||||
@ -61,8 +69,6 @@
|
|||||||
<DCC_PACKAGE_NO_LINK>false</DCC_PACKAGE_NO_LINK>
|
<DCC_PACKAGE_NO_LINK>false</DCC_PACKAGE_NO_LINK>
|
||||||
<DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
|
<DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
|
||||||
<DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
|
<DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
|
||||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
|
||||||
<Icon_MainIcon>G940LEDControl_Icon.ico</Icon_MainIcon>
|
|
||||||
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||||
<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>
|
||||||
@ -75,17 +81,17 @@
|
|||||||
<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_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
<VerInfo_Release>1</VerInfo_Release>
|
||||||
|
<VerInfo_MinorVer>3</VerInfo_MinorVer>
|
||||||
|
<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>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
<Version>7.0</Version>
|
<Version>7.0</Version>
|
||||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
<DCC_ExeOutput>Bin</DCC_ExeOutput>
|
|
||||||
<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>
|
|
||||||
<DCC_ResourcePath>..\DirectX;..\Shared;$(DCC_ResourcePath)</DCC_ResourcePath>
|
<DCC_ResourcePath>..\DirectX;..\Shared;$(DCC_ResourcePath)</DCC_ResourcePath>
|
||||||
<DCC_ObjPath>..\DirectX;..\Shared;$(DCC_ObjPath)</DCC_ObjPath>
|
<DCC_ObjPath>..\DirectX;..\Shared;$(DCC_ObjPath)</DCC_ObjPath>
|
||||||
<DCC_IncludePath>..\DirectX;..\Shared;$(DCC_IncludePath)</DCC_IncludePath>
|
<DCC_IncludePath>..\DirectX;..\Shared;$(DCC_IncludePath)</DCC_IncludePath>
|
||||||
@ -93,10 +99,8 @@
|
|||||||
<DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
|
<DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||||
<VerInfo_MinorVer>2</VerInfo_MinorVer>
|
<VerInfo_IncludeVerInfo>false</VerInfo_IncludeVerInfo>
|
||||||
<VerInfo_MajorVer>0</VerInfo_MajorVer>
|
|
||||||
<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=0.2.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=0.2;Comments=</VerInfo_Keys>
|
||||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
|
||||||
<Manifest_File>F:\Components\X2Utils\Resources\VistaManAsInvoker.manifest</Manifest_File>
|
<Manifest_File>F:\Components\X2Utils\Resources\VistaManAsInvoker.manifest</Manifest_File>
|
||||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Binary file not shown.
@ -29,6 +29,8 @@ const
|
|||||||
FUNCTION_FSX_BATTERYMASTER = FUNCTION_PROVIDER_OFFSET + 11;
|
FUNCTION_FSX_BATTERYMASTER = FUNCTION_PROVIDER_OFFSET + 11;
|
||||||
FUNCTION_FSX_AVIONICSMASTER = FUNCTION_PROVIDER_OFFSET + 12;
|
FUNCTION_FSX_AVIONICSMASTER = FUNCTION_PROVIDER_OFFSET + 12;
|
||||||
|
|
||||||
|
FUNCTION_FSX_SPOILERS = FUNCTION_PROVIDER_OFFSET + 13;
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TFSXLEDStateProvider = class(TLEDStateProvider)
|
TFSXLEDStateProvider = class(TLEDStateProvider)
|
||||||
@ -90,7 +92,7 @@ const
|
|||||||
DEFINITION_ENGINE = 5;
|
DEFINITION_ENGINE = 5;
|
||||||
DEFINITION_THROTTLE = 6;
|
DEFINITION_THROTTLE = 6;
|
||||||
DEFINITION_EXITDOOR = 7;
|
DEFINITION_EXITDOOR = 7;
|
||||||
DEFINITION_FLAPS = 8;
|
DEFINITION_FLAPSSPOILERS = 8;
|
||||||
DEFINITION_SWITCHES = 9;
|
DEFINITION_SWITCHES = 9;
|
||||||
|
|
||||||
EVENT_ZOOM = 10;
|
EVENT_ZOOM = 10;
|
||||||
@ -107,9 +109,12 @@ const
|
|||||||
FSX_VARIABLE_GEARDAMAGEBYSPEED = 'GEAR DAMAGE BY SPEED';
|
FSX_VARIABLE_GEARDAMAGEBYSPEED = 'GEAR DAMAGE BY SPEED';
|
||||||
FSX_VARIABLE_GEARSPEEDEXCEEDED = 'GEAR SPEED EXCEEDED';
|
FSX_VARIABLE_GEARSPEEDEXCEEDED = 'GEAR SPEED EXCEEDED';
|
||||||
FSX_VARIABLE_CANOPYOPEN = 'CANOPY OPEN';
|
FSX_VARIABLE_CANOPYOPEN = 'CANOPY OPEN';
|
||||||
|
FSX_VARIABLE_FLAPSAVAILABLE = 'FLAPS AVAILABLE';
|
||||||
FSX_VARIABLE_FLAPSHANDLEPERCENT = 'FLAPS HANDLE PERCENT';
|
FSX_VARIABLE_FLAPSHANDLEPERCENT = 'FLAPS HANDLE PERCENT';
|
||||||
FSX_VARIABLE_AVIONICSMASTERSWITCH = 'AVIONICS MASTER SWITCH';
|
FSX_VARIABLE_AVIONICSMASTERSWITCH = 'AVIONICS MASTER SWITCH';
|
||||||
FSX_VARIABLE_ELECTRICALMASTERBATTERY = 'ELECTRICAL MASTER BATTERY';
|
FSX_VARIABLE_ELECTRICALMASTERBATTERY = 'ELECTRICAL MASTER BATTERY';
|
||||||
|
FSX_VARIABLE_SPOILERSAVAILABLE = 'SPOILER AVAILABLE';
|
||||||
|
FSX_VARIABLE_SPOILERSHANDLEPOSITION = 'SPOILERS HANDLE POSITION';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -141,6 +146,8 @@ const
|
|||||||
FUNCTION_DESC_FSX_BATTERYMASTER = 'Battery master switch';
|
FUNCTION_DESC_FSX_BATTERYMASTER = 'Battery master switch';
|
||||||
FUNCTION_DESC_FSX_AVIONICSMASTER = 'Avionics 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;
|
||||||
@ -168,6 +175,8 @@ begin
|
|||||||
AConsumer.AddFunction(FUNCTION_FSX_FLAPS, FUNCTION_DESC_FSX_FLAPS);
|
AConsumer.AddFunction(FUNCTION_FSX_FLAPS, FUNCTION_DESC_FSX_FLAPS);
|
||||||
AConsumer.AddFunction(FUNCTION_FSX_BATTERYMASTER, FUNCTION_DESC_FSX_BATTERYMASTER);
|
AConsumer.AddFunction(FUNCTION_FSX_BATTERYMASTER, FUNCTION_DESC_FSX_BATTERYMASTER);
|
||||||
AConsumer.AddFunction(FUNCTION_FSX_AVIONICSMASTER, FUNCTION_DESC_FSX_AVIONICSMASTER);
|
AConsumer.AddFunction(FUNCTION_FSX_AVIONICSMASTER, FUNCTION_DESC_FSX_AVIONICSMASTER);
|
||||||
|
|
||||||
|
AConsumer.AddFunction(FUNCTION_FSX_SPOILERS, FUNCTION_DESC_FSX_SPOILERS);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -307,11 +316,15 @@ begin
|
|||||||
AddDefinition(DEFINITION_EXITDOOR);
|
AddDefinition(DEFINITION_EXITDOOR);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Flaps }
|
{ Flaps & spoilers }
|
||||||
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_FLAPS) then
|
if Consumer.FunctionMap.HasFunction(FUNCTION_FSX_FLAPS) or
|
||||||
|
Consumer.FunctionMap.HasFunction(FUNCTION_FSX_SPOILERS) then
|
||||||
begin
|
begin
|
||||||
AddVariable(DEFINITION_FLAPS, FSX_VARIABLE_FLAPSHANDLEPERCENT, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
|
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_FLAPSAVAILABLE, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
|
||||||
AddDefinition(DEFINITION_FLAPS);
|
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_FLAPSHANDLEPERCENT, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
|
||||||
|
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_SPOILERSAVAILABLE, FSX_UNIT_BOOL, SIMCONNECT_DATAType_INT32);
|
||||||
|
AddVariable(DEFINITION_FLAPSSPOILERS, FSX_VARIABLE_SPOILERSHANDLEPOSITION, FSX_UNIT_PERCENT, SIMCONNECT_DATAType_FLOAT64);
|
||||||
|
AddDefinition(DEFINITION_FLAPSSPOILERS);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Master switches }
|
{ Master switches }
|
||||||
@ -363,7 +376,7 @@ begin
|
|||||||
DEFINITION_PARKINGBRAKE: HandleParkingBrakeData(data);
|
DEFINITION_PARKINGBRAKE: HandleParkingBrakeData(data);
|
||||||
DEFINITION_ENGINE: HandleEngineData(data);
|
DEFINITION_ENGINE: HandleEngineData(data);
|
||||||
DEFINITION_EXITDOOR: HandleExitDoorData(data);
|
DEFINITION_EXITDOOR: HandleExitDoorData(data);
|
||||||
DEFINITION_FLAPS: HandleFlapsData(data);
|
DEFINITION_FLAPSSPOILERS: HandleFlapsData(data);
|
||||||
DEFINITION_SWITCHES: HandleSwitchesData(data);
|
DEFINITION_SWITCHES: HandleSwitchesData(data);
|
||||||
{
|
{
|
||||||
DEFINITION_THROTTLE:
|
DEFINITION_THROTTLE:
|
||||||
@ -397,7 +410,7 @@ procedure TFSXLEDStateProvider.HandleGearData(AData: Pointer);
|
|||||||
type
|
type
|
||||||
PGearData = ^TGearData;
|
PGearData = ^TGearData;
|
||||||
TGearData = packed record
|
TGearData = packed record
|
||||||
IsGearRetractable: Integer;
|
IsGearRetractable: Cardinal;
|
||||||
TotalPctExtended: Double;
|
TotalPctExtended: Double;
|
||||||
DamageBySpeed: Integer;
|
DamageBySpeed: Integer;
|
||||||
SpeedExceeded: Integer;
|
SpeedExceeded: Integer;
|
||||||
@ -418,9 +431,9 @@ begin
|
|||||||
else if gearData^.IsGearRetractable <> 0 then
|
else if gearData^.IsGearRetractable <> 0 then
|
||||||
begin
|
begin
|
||||||
case Trunc(gearData ^.TotalPctExtended * 100) of
|
case Trunc(gearData ^.TotalPctExtended * 100) of
|
||||||
0: Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsRed);
|
0: Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsRed);
|
||||||
100: Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsGreen);
|
95..100: Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsGreen);
|
||||||
else Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsAmber);
|
else Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsAmber);
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsOff);
|
Consumer.SetStateByFunction(FUNCTION_FSX_GEAR, lsOff);
|
||||||
@ -508,9 +521,9 @@ begin
|
|||||||
exitDoorData := AData;
|
exitDoorData := AData;
|
||||||
|
|
||||||
case Trunc(exitDoorData^.PercentOpen) of
|
case Trunc(exitDoorData^.PercentOpen) of
|
||||||
0: Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsGreen);
|
0: Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsGreen);
|
||||||
100: Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsRed);
|
95..100: Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsRed);
|
||||||
else Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsAmber);
|
else Consumer.SetStateByFunction(FUNCTION_FSX_EXITDOOR, lsAmber);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -519,7 +532,10 @@ procedure TFSXLEDStateProvider.HandleFlapsData(AData: Pointer);
|
|||||||
type
|
type
|
||||||
PFlapsData = ^TFlapsData;
|
PFlapsData = ^TFlapsData;
|
||||||
TFlapsData = packed record
|
TFlapsData = packed record
|
||||||
HandlePercent: Double;
|
FlapsAvailable: Cardinal;
|
||||||
|
FlapsHandlePercent: Double;
|
||||||
|
SpoilersAvailable: Cardinal;
|
||||||
|
SpoilersHandlePercent: Double;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -528,11 +544,25 @@ var
|
|||||||
begin
|
begin
|
||||||
flapsData := AData;
|
flapsData := AData;
|
||||||
|
|
||||||
case Trunc(flapsData^.HandlePercent) of
|
if flapsData^.FlapsAvailable <> 0 then
|
||||||
0: Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsGreen);
|
begin
|
||||||
100: Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsRed);
|
case Trunc(flapsData^.FlapsHandlePercent) of
|
||||||
else Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsAmber);
|
0: Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsGreen);
|
||||||
end;
|
95..100: Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsRed);
|
||||||
|
else Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsAmber);
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
Consumer.SetStateByFunction(FUNCTION_FSX_FLAPS, lsOff);
|
||||||
|
|
||||||
|
if flapsData^.SpoilersAvailable <> 0 then
|
||||||
|
begin
|
||||||
|
case Trunc(flapsData^.SpoilersHandlePercent) of
|
||||||
|
0: Consumer.SetStateByFunction(FUNCTION_FSX_SPOILERS, lsGreen);
|
||||||
|
95..100: Consumer.SetStateByFunction(FUNCTION_FSX_SPOILERS, lsRed);
|
||||||
|
else Consumer.SetStateByFunction(FUNCTION_FSX_SPOILERS, lsAmber);
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
Consumer.SetStateByFunction(FUNCTION_FSX_SPOILERS, lsOff);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user