Skip to content

Commit

Permalink
Merge pull request #44 from norberttak/fip-support
Browse files Browse the repository at this point in the history
Add FIP device support to xpanel plugin
  • Loading branch information
norberttak authored Nov 19, 2022
2 parents af7ac54 + 86f588c commit f5fbbd9
Show file tree
Hide file tree
Showing 58 changed files with 3,258 additions and 319 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
run: |
cp LUA/lua54.dll built-plugin/plugins/XPanel/64/
cp hidapi/lib/hidapi.dll built-plugin/plugins/XPanel/64/
cp FIP-SDK/lib/DirectOutput.dll built-plugin/plugins/XPanel/64/
- name: Create release plugin zip
run: |
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include(CTest)
add_subdirectory(hidapi)
add_subdirectory(LUA)
add_subdirectory(SDK)
add_subdirectory(FIP-SDK)

add_subdirectory(src)
add_subdirectory(test)
Expand Down
12 changes: 12 additions & 0 deletions FIP-SDK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
add_library(FIPSDK::FIPSDK INTERFACE IMPORTED GLOBAL)

if (WIN32)
target_include_directories(FIPSDK::FIPSDK INTERFACE include)
set_target_properties(FIPSDK::FIPSDK PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/DirectOutput.dll
)

install(FILES lib/DirectOutput.dll DESTINATION ${PLUGIN_INSTALL_DIR})
else()
# Linux/Mac versions are not yet avaliable
endif()
455 changes: 455 additions & 0 deletions FIP-SDK/include/DirectOutput.h

Large diffs are not rendered by default.

Binary file added FIP-SDK/lib/DirectOutput.dll
Binary file not shown.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ This is a plugin for [XPlane 11](https://www.x-plane.com/) flight simulator. If

It has a configuration file where you can define the logical connections between hardware elements (buttons, switches, displays, etc) and the internal [dataref](https://developer.x-plane.com/sdk/) of XPlane.

Currently, it supports two types of USB devices:
Currently, it supports four types of USB devices:

1. [Saitek Multi Panel](https://www.saitek.com/uk/prod-bak/multi.html) This is a device that mainly contains the buttons associated with the autopilot functions.
1. [Saitek Multi Panel](https://www.saitek.com/uk/prod-bak/multi.html) This is a device that mainly contains the buttons associated with the autopilot functions
2. [Saitek Radio Panel](https://www.saitek.com/uk/prod-bak/radio.html) Device to conrol radio functions of your airplane
3. Arduino based USB HID device which can simulate switches and displays customized on your own.
3. [Logitech/Saitek Flight Instrument Panel](https://www.saitek.com/uk/prod-bak/fip.html) Device with a graphical screen to display aircraft instruments (supported only on Windows)
4. Arduino based USB HID device which can simulate switches and displays customized on your own.

## Configuration syntax
For configuration file syntax please see the document [here](doc/configuration.md)
Expand Down
18 changes: 15 additions & 3 deletions XPanel.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WINVER=0x0601;_CRT_SECURE_NO_WARNINGS=1;_WIN32_WINNT=0x0601;_WIN32_WINDOWS=0x0601;WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMDATA_EXPORTS;IBM=1;XPLM200=1;XPLM210=1;XPLM300=1;XPLM301=1;XPLM302=1;PLUGIN_SIGNATURE="xpanel";PLUGIN_VERSION="1.2";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)\hidapi\headers;$(SolutionDir)\LUA\include;$(SolutionDir)\SDK\CHeaders\XPLM;$(SolutionDir)\SDK\CHeaders\Widgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\hidapi\headers;$(SolutionDir)\LUA\include;$(SolutionDir)\SDK\CHeaders\XPLM;$(SolutionDir)\FIP-SDK\include;$(SolutionDir)\SDK\CHeaders\Widgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<SupportJustMyCode>false</SupportJustMyCode>
<LanguageStandard>stdcpp17</LanguageStandard>
Expand All @@ -148,7 +148,7 @@
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS=1;IBM=1;XPLM200=1;XPLM210=1;XPLM300=1;XPLM301=1;XPLM302=1;PLUGIN_SIGNATURE="xpanel";PLUGIN_VERSION="1.2";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)\hidapi\headers;$(SolutionDir)\LUA\include;$(SolutionDir)\SDK\CHeaders\XPLM;$(SolutionDir)\SDK\CHeaders\Widgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\FIP-SDK\include;$(SolutionDir)\hidapi\headers;$(SolutionDir)\LUA\include;$(SolutionDir)\SDK\CHeaders\XPLM;$(SolutionDir)\SDK\CHeaders\Widgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AssemblerListingLocation>.\Release\64\</AssemblerListingLocation>
<ObjectFileName>.\Release\64\</ObjectFileName>
<DebugInformationFormat>None</DebugInformationFormat>
Expand All @@ -165,6 +165,12 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\GenericDisplay.cpp" />
<ClCompile Include="src\FIPDevice.cpp" />
<ClCompile Include="src\GenericScreen.cpp" />
<ClCompile Include="src\FIPDriver.cpp" />
<ClCompile Include="src\FIPPage.cpp" />
<ClCompile Include="src\FIPScreen.cpp" />
<ClCompile Include="src\RawBMP.cpp" />
<ClCompile Include="src\SaitekRadioPanel.cpp" />
<ClCompile Include="src\LuaHelper.cpp" />
<ClCompile Include="src\MultiPurposeDisplay.cpp" />
Expand All @@ -187,6 +193,12 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\GenericDisplay.h" />
<ClInclude Include="src\FIPDevice.h" />
<ClInclude Include="src\GenericScreen.h" />
<ClInclude Include="src\FIPDriver.h" />
<ClInclude Include="src\FIPPage.h" />
<ClInclude Include="src\FIPScreen.h" />
<ClInclude Include="src\RawBMP.h" />
<ClInclude Include="src\SaitekRadioPanel.h" />
<ClInclude Include="src\LuaHelper.h" />
<ClInclude Include="src\MessageWindow.h" />
Expand All @@ -204,4 +216,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
36 changes: 36 additions & 0 deletions XPanel.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@
<ClCompile Include="src\GenericDisplay.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FIPPage.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FIPScreen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\RawBMP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FIPDriver.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\GenericScreen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FIPDevice.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\ConfigParser.h">
Expand Down Expand Up @@ -112,5 +130,23 @@
<ClInclude Include="src\GenericDisplay.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\FIPPage.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\FIPScreen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\RawBMP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\FIPDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\GenericScreen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\FIPDevice.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
Binary file not shown.
Binary file added config/default c172/fip-images/Adf_needle.bmp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added config/default c172/fip-images/dir_gyro_ga.dds
Binary file not shown.
Binary file added config/default c172/fip-images/vor_gs_adf_ag.dds
Binary file not shown.
29 changes: 29 additions & 0 deletions config/default c172/xpanel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,32 @@ on_push="on_select:SW_CRS,commandref:sim/radios/obs1_up:once"
[button:id="KNOB_MINUS"]
on_push="on_select:SW_HDG,commandref:sim/autopilot/heading_down:once"
on_push="on_select:SW_CRS,commandref:sim/radios/obs1_down:once"

;---------------------------------------------------------------
[device:id="saitek_fip_screen"]
serial="MZB05779E2"

[page:id="ADF"]
[layer:image="fip-images/Adf_Kompass_Ring.bmp,ref_x:120,ref_y:120,base_rot=0"]
offset_x="const:200"
offset_y="const:120"
rotation="dataref:sim/cockpit/radios/adf1_cardinal_dir,scale:-1"
[layer:image="fip-images/adf_needle.bmp,ref_x:90,ref_y:8,base_rot=-90"]
offset_x="const:200"
offset_y="const:120"
rotation="dataref:sim/cockpit2/radios/indicators/adf1_relative_bearing_deg,scale:1"

[button:id="LEFT_KNOB_PLUS"]
on_push="commandref:sim/radios/adf1_card_up:once"

[button:id="LEFT_KNOB_MINUS"]
on_push="commandref:sim/radios/adf1_card_down:once"

[button:id="S1"]
on_push="on_select:PAGE_ADF,commandref:sim/autopilot/servos_off_any:once"

[light:id="S1_L"]
trigger_lit="dataref:sim/cockpit/autopilot/autopilot_mode:2"
trigger_blink="dataref:sim/cockpit/autopilot/autopilot_mode:1"
trigger_unlit="dataref:sim/cockpit/autopilot/autopilot_mode:0"

Binary file added doc/Adf_Kompass_Ring.bmp
Binary file not shown.
Binary file added doc/Adf_needle.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ you can define a simple display device in the configuration like this:
line="dataref:sim/test/altimeter"
```

## Flight Istrument Panel (FIP) devices
The configuration options for the FIP graphical devices can be found [here](doc/fip-screen.md)

## Example configuration file
```ini
log_level="TRACE"
Expand Down
Binary file added doc/fip-coordinates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f5fbbd9

Please sign in to comment.