Skip to main content

Software for integrating DCS: F/A-18C, F-16C and Ka-50 with Logitech G13

Project description

image Build Status Coverage Status Codacy Badge BCH compliance image License

dcspy

This is a software designed to put information from DCS aircraft to Logitech G-series keyboards. Developed for Logitech G13, but should also work with any other Logitech device with 160x43 px monochrome display, like G15 and G510.

  • F/A-18C Hornet's Up Front Controller (UFC)
  • F-16C DED display - some parts are missing
  • Ka-50 PVI-800 - under development

dcspylogo

Requirements

Credits

This project has been heavily inspired by specelUFC, and I want to thank specel, the author of that project for his work and the inspiring ideas. This software uses:

Installation

Package is available on PyPI, open Command Prompt and type:

pip install dcspy

or use attached wheel file:

pip install dcspy-0.9.2-py3-none-any.whl

Usage

pip should install into you python installation directory: i.e.:

  • d:\python38\dcspy_data\dcspy.ico
  • d:\python38\scripts\dcspy.exe

You can drag and drop dcspy.exe to desktop and make shortcut (with custom icon). After successful connect attempt, G13 display should update.

New ideas

I have lots of plans and new ideas how to improve it internally and form user's perspective, but don't hesitate to contact me. Maybe it will motivate me to implement some new stuff. Please open issue if you find bug or have any crazy idea.

Development

  • dcspy.py is responsible for initialise parser, G13 handler, as well as running connection with DCS.
  • logitech.py is responsible for initialise aircraft specific file and handling G13 display and buttons
  • aircrafts.py are define all supported aircrafts with details how to handle and display data from DCS, draws bitmap that will be passed to G13 handler and returns input data for buttons under G13 display

If you want to modify or write something by yourself, here's a quick walkthrough:

  • Each plan has special dict:
self.bios_data = {
    'ScratchpadStr1': {'addr': 0x744e, 'len': 2, 'val': ''},
    'FuelTotal': {'addr': 0x748a, 'len': 6, 'val': ''}}

which describe data to be fetch from DCS-BIOS. For required address and data length, look up in C:\Users\xxx\Saved Games\DCS.openbeta\Scripts\DCS-BIOS\doc\control-reference.html

  • Then after detecting current plane G13 will load instance of aircraft as plane
plane: Aircraft = getattr(import_module('dcspy.aircrafts'), plane_name)(self.width, self.height)
  • and "subscribe" for changes with callback for all fields define in 'plane' instance
for field_name, proto_data in plane.bios_data.items():
    StringBuffer(self.parser, proto_data['addr'], proto_data['len'], partial(plane.set_bios, field_name))
  • Then, receive byte and use parser:
dcs_bios_resp = sock.recv(1)
parser.process_byte(dcs_bios_resp)

which calls back function in G13Handler set_bios() with appropriate parameters and update display content, by creating bitmap and passing it through LCD SDK to device display

  • You can also use 4 button below display, just check their state with g13.check_buttons() which one is pressed and send packet with command you wish to use. Again, look it up in control-reference.html, for example, to rotate COMM1 knob right in F/A-18C:
sock.send(bytes('UFC_COMM1_CHANNEL_SELECT INC\n', 'utf-8'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dcspy-0.9.2.tar.gz (38.2 kB view hashes)

Uploaded Source

Built Distribution

dcspy-0.9.2-py3-none-any.whl (36.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page