emcek / dcspy Goto Github PK
View Code? Open in Web Editor NEWSoftware for integrating DCS Planes with Logitech keyboards (with and without LCD), mice and headphones.
License: MIT License
Software for integrating DCS Planes with Logitech keyboards (with and without LCD), mice and headphones.
License: MIT License
The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.
The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.
Consider replace flake and pylint with ruff.
Use *.pyw extension to hide console at start
Describe the bug
Extra fail notification during start when loading empty/basic aircraft.
Problem is in BasicAircraft._load_plane_yaml()
To Reproduce
Steps to reproduce the behavior:
Logs and Screenshots
DEBUG | Starting thread <Thread(dcspy-app, initial)> for: {'lcd_type': 'G13', 'event': <threading.Event at 0x1f1ccc36d50: unset>, 'fonts_cfg': FontsConfig(name='consola.ttf', small=9, medium=11, large=16), 'dcs_bios': 'D:\\Users\\mplic\\Saved Games\\DCS.openbeta\\Scripts\\DCS-BIOS'}
WARNING | FileNotFoundError: C:\Users\mplic\AppData\Local\dcspy\.yaml.
Traceback (most recent call last):
File "D:\Projects\dcspy_dev\dcspy\utils.py", line 66, in load_yaml
with open(file=full_path, encoding='utf-8') as yaml_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\mplic\\AppData\\Local\\dcspy\\.yaml'
DEBUG | [Errno 2] No such file or directory: 'C:\\Users\\mplic\\AppData\\Local\\dcspy\\.yaml'
INFO | Loading: G13: 160x43
packaging > 21.3
ReleaseInfo
from utilsversion.LegacyVersion
Check if it make sense to allow update LCD just with 4 lines of text (need new general function for mono and color) or stick with generated image
logi_lcd_mono_set_text(line_no: int, text: str)
https://github.com/emcek/dcspy/blob/master/dcspy/lcd_sdk.py#L144
logi_lcd_color_set_title(text: str, rgb: Tuple[int, int, int] = (255, 255, 255))
https://github.com/emcek/dcspy/blob/master/dcspy/lcd_sdk.py#L179
update_display(image: Image) -> None:
https://github.com/emcek/dcspy/blob/master/dcspy/lcd_sdk.py#L216
https://github.com/emcek/dcspy/blob/master/dcspy/logitech.py#L67
https://github.com/emcek/dcspy/blob/master/dcspy/starter.py#L77
Add way to start DCSpy without GUI, selecting LCD, editing setting, etc.
Research the best way (or both):
- [ ] by CLI parameter
Allow download new version.
Try detect the way dcspy was executes:
Act accordingly:
Check implementation of ReleaseInfo
:
Add System tray icon.
https://github.com/moses-palmer/pystray
Pay attention to:
https://pystray.readthedocs.io/en/latest/usage.html#displaying-notifications
Especially useful when when GUI is hide by default.
Consider remove (or make optional CLI) after implement this feature.
customtkinter==5.0.3 cause dcspy icon disappear form upper left corner of all windows and dialogs
Try logging migration phase
2024-01-13 23:43:40,429 | dcspy | DEBUG | MainThread |
############################################################
Start session: 2024-01-13 23:43:40.429839
############################################################ / config_logger:28
2024-01-13 23:43:40,430 | dcspy | INFO | MainThread | Log file store at: C:\Users\mplic\AppData\Local\Temp\dcspy.log / config_logger:29
2024-01-13 23:43:40,430 | dcspy | DEBUG | MainThread | Arch: nt / win32 / 64bit / WindowsPE / <module>:21
2024-01-13 23:43:40,430 | dcspy | DEBUG | MainThread | Python: CPython-3.12.0 / <module>:22
2024-01-13 23:43:40,430 | dcspy | DEBUG | MainThread | Python exec: D:\Projects\venvs\dcspy_312\Scripts\python.exe / <module>:23
2024-01-13 23:43:40,486 | dcspy | DEBUG | MainThread | uname_result(system='Windows', node='ARMIKROG', release='10', version='10.0.19045', machine='AMD64') / <module>:24
2024-01-13 23:43:40,486 | dcspy | DEBUG | MainThread | Configuration: {'api_ver': '3.1.2', 'autostart': False, 'check_bios': False, 'check_ver': False, 'completer_items': 20, 'current_plane': 'A-10C', 'dcs': 'C:/Program Files/Eagle Dynamics/DCS World OpenBeta', 'dcsbios': 'D:/Users/mplic/Saved Games/DCS.openbeta/Scripts/DCS-BIOS', 'f16_ded_font': True, 'font_color_l': 32, 'font_color_m': 22, 'font_color_s': 18, 'font_mono_l': 16, 'font_mono_m': 11, 'font_mono_s': 9, 'font_name': 'consola.ttf', 'git_bios': True, 'git_bios_ref': 'master', 'gkeys_area': 2, 'gkeys_float': False, 'keyboard': 'G13', 'save_lcd': False, 'show_gui': True, 'toolbar_area': 4, 'toolbar_style': 0, 'verbose': True} from: C:\Users\mplic\AppData\Local\dcspy\config.yaml / <module>:25
2024-01-13 23:43:40,486 | dcspy | INFO | MainThread | dcspy 3.1.2 https://github.com/emcek/dcspy / <module>:26
2024-01-13 23:43:40,487 | dcspy | INFO | MainThread | DCS openbeta ver: 2.9.2.49940 / <module>:28
2024-01-13 23:43:40,530 | dcspy.sdk | DEBUG | MainThread | Selected DLL: C:\Program Files\Logitech Gaming Software\SDK\LCD\x64\LogitechLcd.dll / load_dll:50
2024-01-13 23:43:40,565 | dcspy.sdk | INFO | MainThread | Loading of LCD SDK success / load_dll:54
2024-01-13 23:43:40,567 | dcspy.sdk | DEBUG | MainThread | Selected DLL: C:\Program Files\Logitech Gaming Software\SDK\G-key\x64\LogitechGkey.dll / load_dll:50
2024-01-13 23:43:40,571 | dcspy.sdk | INFO | MainThread | Loading of Gkey SDK success / load_dll:54
2024-01-13 23:43:40,678 | dcspy.qt_gui | DEBUG | MainThread | QThreadPool with 8 thread(s) / __init__:56
Describe the bug
Read form plane's YMAL:
G6_M1: ICP_COM2_BTN CUSTOM ICP_COM2_BTN INC|ICP_COM2_BTN DEC|
Set in G-Keys tab as Inc type instead of custom
Add progress bar for long duration processes
Remove Python 3.6 and add Python 3.10 support:
LcdSize
utils.py
TypedDict
NamedTuple
Verbose flag should impact file and console logs.
Speed up starting timetime by start long tasks after loading main window
def showEvent(self, event):
super().showEvent(event)
QTimer.singleShot(100, self.show_initial_message_box)
def show_initial_message_box(self):
QMessageBox.information(self, "Title", "Your message here.")
Snippet:
from git import Repo, BadName
commit_hash = 'abcde' # Replace this with the actual hash
repo = Repo('.') # Use the repository in the current directory
try:
commit = repo.commit(commit_hash)
print(f"The commit {commit_hash} exists in the local repository.")
except BadName:
print(f"The commit {commit_hash} is not found in the local repository.")
use custom message boxes:
https://github.com/Akascape/CTkMessagebox
To Reproduce
Steps to reproduce the behavior:
Introduce Logitech Gaming G-key SDK
https://coderslegacy.com/structs-with-python-ctypes/
https://gist.github.com/Overdrivr/cdd58cea15d7e28c50ea
To support extra buttons:
When stated radio button should be disabled and enabled when stopped.
The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.
Attach: Saved Games\DCS.openbeta\Logs\dcs.log
for collecting troubleshooting data
Describe the bug
Check migration for 3.0.0 from perspective 3.1.2 and try cleanup:
'font_color_s' -> 'font_color_m'
'font_color_xs' -> 'font_color_s'
'font_mono_s' -> 'font_mono_m'
'font_mono_xs' -> 'font_mono_s'
Generate new splash screen with background.
Add presets for A-10C all radios
Allow update/refresh About tab
Describe the bug
File F-4E-45MC.yaml
is missing from release version
Check if it is good idea to extract code into LcdSize (NamedTuple)
https://github.com/emcek/dcspy/blob/master/dcspy/aircrafts.py#L178
https://github.com/emcek/dcspy/blob/master/dcspy/logitech.py#L205
img = Image.new(mode='RGBA', size=(self.lcd.width, self.lcd.height), color=(0, 0, 0, 0))
Describe the bug
Not all keys for G19 are handled for F-16C Viper
To Reproduce
Steps to reproduce the behavior:
Logs and Screenshots
Exception in thread dcspy-app:
Traceback (most recent call last):
File "D:\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "D:\Python310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "D:\Python310\lib\site-packages\dcspy\starter.py", line 108, in dcspy_run
_handle_connection(lcd, parser, dcs_sock, event)
File "D:\Python310\lib\site-packages\dcspy\starter.py", line 41, in _handle_connection
lcd.button_handle(sock)
File "D:\Python310\lib\site-packages\dcspy\logitech.py", line 141, in button_handle
sock.sendto(bytes(self.plane.button_request(button), 'utf-8'), SEND_ADDR)
File "D:\Python310\lib\site-packages\dcspy\aircraft.py", line 301, in button_request
button_bios_name = button_map[button]
KeyError: <LcdButton.menu: 16384>
Add Button at about tab
Add types_Pillow
and correct all mis-types
img_for_lcd
use self.lcd.mode
, maybe can be clever and it not neededDescribe the bug
After stop there is no way to start DCSpy again
ToDo:
Describe the bug
Empty string as keyboard name.
Setting:
keyboard: ''
sas weird side effects
DEBUG | QThreadPool with 8 thread(s)
Critical error: 'DcsPyQtGui' object has no attribute 'rb_'
Traceback (most recent call last):
File "D:\Projects\dcspy_dev\dcspy\run.py", line 25, in run
window = DcsPyQtGui()
^^^^^^^^^^^^
File "D:\Projects\dcspy_dev\dcspy\qt_gui.py", line 85, in __init__
self.apply_configuration(cfg=self.config)
File "D:\Projects\dcspy_dev\dcspy\qt_gui.py", line 1057, in apply_configuration
getattr(self, f'rb_{cfg["keyboard"].lower().replace(" ", "")}').toggle()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DcsPyQtGui' object has no attribute 'rb_'
use 'cffi' instead of 'ctypes'
https://eli.thegreenplace.net/2013/03/09/python-ffi-with-ctypes-and-cffi/
I can be better to use external cffi
instead of built-in ctypes
Check what with unit test of led_sdk
and lcd_sdk
When LogitechLcd.dll
can not be located (LGS not installed)
ERROR | Failed to load dynlib/dll 'C:\\Program Files\\Logitech Gaming Software\\SDK\\LCD\\x64\\LogitechLcd.dll'. Most likely this dynlib/dll was not found when the application was frozen.
Traceback (most recent call last):
File "PyInstaller\loader\pyimod03_ctypes.py", line 53, in __init__
File "ctypes\__init__.py", line 376, in __init__
FileNotFoundError: Could not find module 'C:\Program Files\Logitech Gaming Software\SDK\LCD\x64\LogitechLcd.dll' (or one of its dependencies). Try using the full path with constructor syntax.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "dcspy\sdk\__init__.py", line 36, in load_dll
dll = _init_dll(lib_type)
^^^^^^^^^^^^^^^^^^^
File "dcspy\sdk\__init__.py", line 25, in _init_dll
return CDLL(dll_path)
^^^^^^^^^^^^^^
File "PyInstaller\loader\pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'C:\\Program Files\\Logitech Gaming Software\\SDK\\LCD\\x64\\LogitechLcd.dll'. Most likely this dynlib/dll was not found when the application was frozen.
To fix this, add to exception handling to load_dll()
except Exception as ex:
LOG.error(f'{type(ex).__name__=}')
LOG.error(f'{ex.msg=}')
return None
dcspy
start thread or update status barRight now it hardcoded let add option to disable it, it can speed up a bit dcspy
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.