norberttak / xpanel Goto Github PK
View Code? Open in Web Editor NEWXPlane 11/12 plugin to handle home cockpit panels
License: GNU General Public License v3.0
XPlane 11/12 plugin to handle home cockpit panels
License: GNU General Public License v3.0
Followup bug of #90
if I connect only 1 radio it works as expected, but if I connect all my 3 radio devices, all 3 devices's display show same things (Top-Left display of first, second and third devices shows same thing, top-right same thing on all 3 devices and so on) and 3 devices are setted as below:
device 1 upper: COM1
device 1 lower: COM 2
device 2 upper: NAV 1
device 2 lower: NAV 2
device 3 upper: ADF
device 3 lower: XPDR
If I turn device 1 knobs, sometimes display of device 1 change, sometimes display of device 2, sometimes display of device 3. Same thing if I use knobs of device 2 or device 3.
I think that now the plugin have to distinguish the device when there are multiple devices of the same type.
Move the generic USB HID device (Arduino based IO boards) configuration to a config file
an error occurred during any array type dataref.
need to modify the parser regexp to handle the [ ] characters right.
The install description doesn't contain instruction about board config and aircraft specific files.
The common configuration options (log level, script file, ACF file) shall be at the common part of the configuration file.
Describe the bug
With attached xpanel.ini and Saitek Radio Panel connected to USB, plugin crash and x-plane with it
To Reproduce
Steps to reproduce the behavior like this:
Expected behavior
Flight start
** X-Plane log file **
Log.txt
xpanel.ini content:
; Aircraft specific handler for Zibo 737 XPlane aircraft
log_level="DEBUG"
aircraft_acf="b738_4k.acf"
;---------------------- Saitek Radio Panel -------------------------
[device:id="saitek_radio"]
vid="6a3"
pid="d05"
[multi_display:id="RADIO_DISPLAY_ACTIVE_UP"]
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_freq_hz"
line="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_freq_hz"
line="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_freq_hz"
line="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_freq_hz"
line="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_freq_hz"
line="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code"
[multi_display:id="RADIO_DISPLAY_STBY_UP"]
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz"
line="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz"
line="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz"
line="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz"
line="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz"
[button:id="KNOB_UP_BIG_PLUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:100:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code:100:0:8888"
[button:id="KNOB_UP_BIG_MINUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-100:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-100:0:8888"
[button:id="KNOB_UP_SMALL_PLUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:1:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code:1:0:8888"
[button:id="KNOB_UP_SMALL_MINUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-1:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-1:0:8888"
[button:id="ACT_STBY_UP"]
on_push="on_select:SW_UP_COM1,commandref:sim/radios/com1_standy_flip:once"
on_push="on_select:SW_UP_COM2,commandref:sim/radios/com2_standy_flip:once"
on_push="on_select:SW_UP_NAV1,commandref:sim/radios/nav1_standy_flip:once"
on_push="on_select:SW_UP_NAV2,commandref:sim/radios/nav2_standy_flip:once"
on_push="on_select:SW_UP_ADF,commandref:sim/radios/adf1_standy_flip:once"
[multi_display:id="RADIO_DISPLAY_ACTIVE_DOWN"]
line="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_freq_hz"
line="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_freq_hz"
line="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_freq_hz"
line="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_freq_hz"
line="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_freq_hz"
line="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code"
[multi_display:id="RADIO_DISPLAY_STBY_DOWN"]
line="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz"
line="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz"
line="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz"
line="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz"
line="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz"
[button:id="KNOB_DOWN_BIG_PLUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:100:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code:100:0:8888"
[button:id="KNOB_DOWN_BIG_MINUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-100:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-100:0:8888"
[button:id="KNOB_DOWN_SMALL_PLUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:1:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code:1:0:8888"
[button:id="KNOB_DOWN_SMALL_MINUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-1:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-1:0:8888"
[button:id="ACT_STBY_DOWN"]
on_push="on_select:SW_DOWN_COM1,commandref:sim/radios/com1_standy_flip:once"
on_push="on_select:SW_DOWN_COM2,commandref:sim/radios/com2_standy_flip:once"
on_push="on_select:SW_DOWN_NAV1,commandref:sim/radios/nav1_standy_flip:once"
on_push="on_select:SW_DOWN_NAV2,commandref:sim/radios/nav2_standy_flip:once"
on_push="on_select:SW_DOWN_ADF,commandref:sim/radios/adf1_standy_flip:once"
List of usb devices connected before run X-Plane12
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1462:7d25 Micro Star International MYSTIC LIGHT
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 009: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 010: ID 058f:6364 Alcor Micro Corp. AU6477 Card Reader Controller
Bus 001 Device 033: ID 043e:9a10 LG Electronics USA, Inc. ASM107x
Bus 001 Device 034: ID 131d:0159 Natural Point
Bus 001 Device 041: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 042: ID 06a3:0d05 Saitek PLC Pro Flight Radio Panel
Bus 001 Device 043: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 044: ID 03f0:e807 HP, Inc HP Webcam HD 4310
Bus 001 Device 045: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 05e3:0616 Genesys Logic, Inc. hub
Desktop (please complete the following information):
Create user documentation with examples
If I can I'd like to give a suggestion:
when I select IDT/XPDR (where display is composed by 4 digit number), I'd like to view [blank]8888 on display instead 08888.
For all displays if I don't bind any dateref to the display, I'd like to view blank display instead "00000".
Is it possible to have this?
The expected behavior would be to overflow from 360-> 1 and 1->360
Describe the bug
When starting a new flight, the config doesn't clean up properly.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior like this:
Configure the plugin to display a dataref that has negative value.
Expected behavior
Negative number is displayed properly
The project has many different file name patterns. We need to rename files to use a single naming convention.
This LUA functions needs to be provided:
get_dataref(dataref_str)
set_dataref(dataref_str, value)
command_begin(commandref_str)
command_end(commandref_str)
command_once(commandref_str)
log(log_msg)
The set and get dataref functions shall store the bound datarefs to avoid the very expensive XPLMFind function calls.
These LUA global variables need to be set in the plugin:
AIRCRAFT_FILENAME
AIRCRAFT_PATH
If the Lua script defines (not mandatory) a callback function it shall be called by the plugin at every flight loop:
function flight_loop(time_since_last_call)
Describe the bug
The XPLMFindCommand call has its cost so we need to store the dataref. The LuaHelper has this facility but due to a mistake, it doesn't use the cached datarefs. It causes some extra load on the simulator side.
Hi
I came across your XPanel project and it seems like its what I was looking for.
I want to communicate between X_Plane to 3 G1000 PFD and MFD panels and 1 G1000 audio panel from brand TRC.
I received the hidapi protocol information from the manufacturer and made some scripts in lua ( Flywithlua ) to track button or rotary knob actions through hid_write and hid_read's and switch on LEDS. This works fine but at a huge FPS costs. I am now looking for a more efficient solution for this communication. I hesitate to start coding a plugin because I am not very current in c++.
Question: Could I used XPanel for this communication and does it need additional functionality or can that be done through the config options? The panels are not SAITEK or Arduino based but seem to me fairly straight forward hid-api devices.
Thanks and regards,.
Wilko
{{ project }}
Copyright (C) {{ year }} {{ organization }}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
As in the Title, it seems that plugin doesen't recognize the parameter "min_char_count".
Here an extract from config file:
[multi_display:id="RADIO_DISPLAY_ACTIVE_DOWN"]
line="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_freq_hz,dot_position:2"
line="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_freq_hz,dot_position:2"
line="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_freq_hz,dot_position:2"
line="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_freq_hz,dot_position:2"
line="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_freq_hz"
line="on_select:SW_DOWN_DME,dataref:sim/cockpit/radios/nav1_dme_dist_m"
line="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code,min_char_count:4"
and error returned:
XPanel [4709] [ERROR]:parser: invalid syntax (section starts at line: 200): on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code,min_char_count:4
XPanel [4709] [ERROR]:parser: error while processing key: line
XPanel [4714] [ERROR]:error parsing config file
XPanel [4714] [ERROR]:error during plugin init and start
Create a release package for the 1.0 release. This version will be supported only on Windows so don't need a multi-platform release package.
The release package shall be a zip file that contains
config parser doesn't accept the log level "ERROR"
LuaGet always returns with 0 which means an error at the lua script level.
If I try to get or set dataref of type double, plugin return me this error:
Invalid datareftype: 7
and if I try to assign it to variable like below
variable_1 = get_dataref("dataref_name")
variable_1 is setted to nil instead of value of dateref (verified with datarefTool)
There is a missing code line in /src/devices/fip/FIPLayer.h:
after line 9:
#include <fstream>
you have to add this line:
#include <cstdint>
With that build saccessful :-)
When Selector is setted to COM1, COM2, NAV1, NAV2 it would be useful to see on display value like "134.90" instead of "13490"
I think that it could be possible introducing a parameter in line statement
from
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_freq_hz"
to
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_freq_hz,dot_position:3"
where "dot_position" is the key and "3" is the digit after which is positioned the "." symbol.
Describe the bug
The board-config.ini file is placed into the plugin directory. The path of the directory shall be queried from Xplane.
Create configuration files for these aircraft:
Describe the bug
If device specified in config (xpanel.ini) is missing (es. not connected to usb port), plugin crash and x-plane with it
To Reproduce
Steps to reproduce the behavior like this:
attached log file
Log.txt
I think that in this case plugin hasn't to crash, but when all is loaded and ready into the aircraft, something have to be write into error dialog window or better: the plugin still working ignoring missing devices informing user about it in dialog window
The config parser shall be able to process the spaces in the configuration option lines.
At a minimum, starting a line with spaces or tabs will be valid. It can help improve the config file's readability by applying indentation.
The ideal solution would be to also allow the spaces inside the configuration lines.
A GUI window needs to be added to display any configuration or device errors and warnings inside the simulator.
Rotation knob needs to be speed up when moving more steps in a short time.
This will help to do big changes in heading, course, altitude, etc values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.