Giter VIP home page Giter VIP logo

xpanel's People

Contributors

alltilla avatar mranno avatar norberttak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xpanel's Issues

[BUG] Multiple instances of same type HID devices are messed up

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.

[BUG] hid_send_feature_report error on Gentoo Linux

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:

  1. Attach saitek device
  2. Run X-Plane12 and select aircraft (ZIBO 4.01.9)
  3. Start flight
  4. X-Plane crash

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):

  • OS: Linux Gentoo
  • X-Plane version 12.09.rc5 (last available)

[BUG] Negative number display doesn't work

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

Consolidate file naming

The project has many different file name patterns. We need to rename files to use a single naming convention.

Add LUA support

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)

Question if XPanel could be used for communicating with my generic hidapi boards?

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

Add GPLv3 license text to each source file

{{ 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/.

[BUG] plugin doesen't recognize "min_char_count" parameter

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 release package

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

  1. plugin binary in the right directory structure
  2. dependency binaries (usbHID, lua)
  3. sample configuration files

[BUG] multiple datatype not managed

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)

[BUG] Build error for fip

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 :-)

[enhancement] Add "." (dot) symbol to radio display

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.

Create config files for some aircrafts

Create configuration files for these aircraft:

  • default C172
  • airfoillabs C172
  • airfoillabs C172 NG
  • Felis TU-154
  • Felis B747-200
  • Thrandra DHC2
  • Thrandra Quest
  • Morava
  • L410
  • Zibo 737

[BUG] Missing device crash the plugin and X-Plane

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:

  1. disconnect device
  2. start x-plane
  3. start fly with aircraft having xpanel.ini (in my case Zibo 4.01.9)
  4. x-plane crash

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

Allow spaces in the configuration file

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.

Dynamic speed for rotation knobs

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.