Commit Graph
46 Commits
Author SHA1 Message Date
Neil HorneandGitHub a0da434dc2 feat(cpn): simulator allow manually setting transmitter battery voltage (#5763) 2025-01-13 09:19:53 +10:00
Nigel WilliamsandGitHub 9109d4f46f feat(simu): cross-platform connection of host serial ports to simu radio (#5584) 2024-12-16 20:00:42 +10:00
Neil HorneandGitHub 149e1a2df0 feat(cpn): add support for surface radios inc Radiomaster MT12 (#5381) 2024-09-26 20:39:51 +10:00
Nigel WilliamsandGitHub 982660e8c8 feat(cpn): update telemetry simulation to include FrSky Hub (#5475) 2024-08-26 09:44:35 +10:00
Nigel WilliamsandGitHub 005bd19588 feat(cpn): support more than just FrSky S.Port telemetry simulation (#5410) 2024-08-20 20:43:44 +10:00
Peter FeerickandGitHub ca459bb91c chore: replace all instances of outdated header (#5336) 2024-07-29 09:35:40 +10:00
Neil HorneandGitHub f800447cd5 feat(cpn): Radio types can reference any libsim and/or firmware download id (#3432)
* Radio profiles reference any libsim and/or firmware download id

* Revert files filter for now
2023-05-07 18:01:14 +10:00
Raphael CoefficandGitHub a00975d3e5 fix(simulator): fixed LCD flush sync with QT simulator (#2030) 2022-06-12 11:28:05 +02:00
Raphael Coeffic 1b57e415be Add touch support to simulation 2021-09-13 12:39:33 +02:00
Bertrand Songis 82b519d1e2 Cosmetics 2019-10-14 13:40:32 +02:00
Max PapernoandAndre Bernet 9e4a0680ab [Simulator] Add mixes display to Radio Outputs widget (#5811)
* [Simulator] Add mixes output display to RadioOutputsWidget (closes #2655).

* Add proper limits reporting & representation for channel and mix values in RadioOutputsWidget.
2018-04-12 22:02:27 +04:00
Max PapernoandBertrand Songis 59a835b1b3 [Companion] Radio data refactoring (#5551)
* [Companion] Refactor radio data classes to own files, out of eeprominterface.cpp.  No functional changes.

* Move files related to refactoring. No functional or code changes.

* Fix clang warning and an include path.

* Fix indents on curvereference.cpp. [ci skip]
2017-12-20 13:31:43 +01:00
Max PapernoandBertrand Songis 7759403f3e [Simulator] Quick fix for showing gvars with precision and unit in Radio Outputs view (fixes #5360). (#5384) 2017-11-19 11:21:20 +01:00
Max Paperno 077a651dc3 [Simulator] Fix intermittent crc errors with telemetry simulator. 2017-04-11 21:21:09 -04:00
Max PapernoandBertrand Songis 57dc0159d6 [Simulator] Asynchronous SimulatorInterface & a few new features. (#4738)
* [Simulator] Create RadioKeyWidget class for UI buttons & refactor ButtonsWidget; Refactor SimulatedUIWidget (and subtypes) to use new RadioKeyWidgets/ButtonsWidget; Centralize help text for key mappings and get creative with some icons; Simplify some radio UI setups with rectangular buttons.

* [Simulator] Convert all simulator data I/O to signals/slots mechanism:
    * SimulatorInterface/OpenTxSimulator:
       - Now inherits from QObject to allow signal/slot interface;
       - Allows data exchange on a per-item basis (eg. each I/O value is treated separately instead of sending whole arrays or structs of data);
       - Checks for data changes and only emits signals when change is detected (GUI can now assume only new values are being sent);
       - Manages its own 10ms timer (doesn't rely on GUI to do that);
       - Sends "heartbeat" signals @ 1Hz for status monitoring;
    * Simulator GUI:
       - All data is exchanged between GUI elements as well as SimulatorInterface via signals/slots using standardized methods;
       - Data is sent immediately, and only, when actually changed (eg. a control is moved) instead of in bulk at specific time intervals;
       - Similarly, an asynchronous method is used for reading incoming data, w/out timers or loops;
       - Improve VirtualJoystickWidget to be more encapsulated and configurable;
       - Pause telemetry simulator if window is hidden;

* [Simulator] Move SimulatorInterface instance to separate thread, ensure safe asynchronous operations & proper timer interactions; Protect/remove some functions, & reorganize the order (cosmetics).

* [Simulator] Traces are now delivered to OpenTxSimulator and one or more QIODevice(s) can be added as recipient(s); Add SimulatorInterface::getCapability() for compile-time settings; Remove reversed POT1/SLIDER1 mixer exception (Taranis) requirement for SIMU; Fix plus/minus key delay on wheel event w/out encoder.

* [Simulator] Add current knob/slider/trim input value in tool-tips (KnobWidget and SliderWidget).

* [Simulator] Fix trims widget internal value not properly updating, and remove trim influence on virtual joystick X/Y value display (closes #4671).

* [SimulatorInterface] Add handling of transmitter input voltage, including a rough conversion of volts to ADC value for different boards, and default battery volts lookup function; Clear analogs array before starting.

* [Simulator] Add SimulatorInterface::init() method to separate pre-startup tasks; Report actual trim range, not just extended on/off; Change how radio widget states are restored; VirtualJoystickWidget: Connect trim changes directly from simulator, connect joystick events directly, report stick mode directly instead of setting values/constraints externally.

* [Simulator] Calculate default Tx V input based on configured range in radio settings (or warning V+2 for radios which don't support a range).

* [Simulator] Add functional aux. trims for Horus (closes #4699).

* [Companion] Remove problematic QMessageLogContext from AppDebugMessageHandler::messageOutput().

* [Simulator] Prevent trim change via slider if disabled for flight mode (closes #4600).

* [OpenTxSimulator] Fixes for Qt < 5.4.

* [OpenTxSimulator] Fix slot name.
2017-04-02 12:17:37 +02:00
Bertrand Songis c9df941ee6 Conversion issues #4570 and #4264 2017-03-27 19:56:55 +02:00
Max PapernoandBertrand Songis f5ab145d2f [Companion] Show custom control names throughout the UI (& internal refactoring) (#4693)
* [Companion] Introduce new Boards class to further consolidate hardware metadata and remove some globals.

* [Companion] * RawSource::toString() and RawSwitch::toString() can now return custom hardware names (if given a GeneralSettings object) for the following types (respectively):
    SOURCE_TYPE_STICK, SOURCE_TYPE_SWITCH, SWITCH_TYPE_SWITCH, & SWITCH_TYPE_MULTIPOS_POT;
* RawSource::isPot() and isSlider() can now return their own index position in potConfig[]/sliderConfig[];
* Switch indicator strings can be localized if necessary.

* [Companion] Refactor model printers to use new RawSource/RawSwitch capabilities; Simplify model-to-printer mapping scheme in multimodelprinter; Use const ModelData pointer.

* [Companion] Refactor how RawSource and RawSwitch selection combo boxes are populated, using cache-able data models instead of direct manipulation; Refactor some other Helpers function into their own namespace.

* Cosmetics & forgotten qualifier.
2017-03-27 19:02:19 +02:00
Max PapernoandBertrand Songis d68778ec81 [Simulator] Virtual joystick tweaks. (#4666)
* [Simulator] Create a reusable RadioTrimWidget; Move all trim-related enums to boards.h; Make sure aux trims are accounted for in SimulatorInterface; Trims now use toolbuttons with icons instead of pushbuttons with text.

* [Simulator] New buttons & icons for virtual joystick axis hold/fix toggles; Joystick ball is now slightly scaled to stick area.

* [Simulator] Virtual joystick now "follows" mouse clicks within the stick area (left-click on empty space will attract the control node).
2017-03-22 21:05:27 +01:00
Max PapernoandBertrand Songis e48b1fd07d {Companion] Unload simulator libraries after each use -- reset all statically initialized firmware variables. (#4655)
* [simulatormainwindow] Move sub-window destructors to main destructor.

* [simulation] Move SimulatorInterface creation/ownership to SimulatorMainWindow.

* [simulation] Add option to unload simulator libraries after each use (eg. from Companion) so as to properly reset all statically initialized firmware variables; Introduce new SimulatorLoader class.
2017-03-21 19:48:25 +01:00
Max PapernoandBertrand Songis 3a026a80f2 [Simulator] Add ability to update .otx files. (#4422)
* [SimulatorInterface] Add ability to read eeprom data back from simulator instance.

* [Simulator] If started with .otx file, Simulator will now update (or create) the file upon exit using current radio/model data; Consolidate internal startup and shutdown code for handling various data sources.
2017-02-07 22:15:18 +01:00
Bertrand Songis de49d155c6 [Companion] Compilation fix 2017-01-24 22:06:28 +01:00
Bertrand Songis 57aafeb062 [Companion] Refactoring - fixes the X9E=>X7 conversion segfault 2017-01-24 20:08:48 +01:00
Max PapernoandBertrand Songis 17a03e6c18 [Simulator] Dyanamic Simulator virtual hardware generation and many other improvements (#4260)
* Move simulator widgets to subfolder (no code changes).

* [Simulator] Major Simulator re-structuring to reduce code redundancies and allow for fully dynamic simulated hardware setup:
    SimulatorDialog is no longer sub-classed by individual radio UIs, instead a new class is added which handles just the "skin," LCD, and navigation controls (also makes setting up new models much quicker);
    All radio switches/knobs/sliders are populated dynamically based on loaded hardware configuration data (eeprom/bin), including control types and names (in case of no hardware config data, reasonable "factory defaults" are loaded);
    Starting Horus sim with alternate path for RADIO and MODEL data folders is now supported (.otx file is WIP);
    6-way switch now works properly and various other inconsistencies addressed (eg. some Horus analogs were backwards).

* Add missing OpenTX headers to new files.

* [Simulator] Fix loading of Horus hardware settings from Companion simulation.

* Update Travis CI build environment to Qt 5.7.

* [Simulator] Fix 9X missing colored side LCD images, an #include fix, and some cleanup.

* [TravisCI] Set up for parallel Travis builds and use Qt5.7 (#4263)

* Fix starting Simulator with non-existing file/folder structure (now properly creates new ones as needed, including Horus directories with default radio/model);  Temporarily remove option for using .otx file with Horus (until that feature is added).

* Load correct simulator skin for X7 when launching from Companion.

* X7 hardware defaults changed to match production hardware

* Fix minor compiler warning in mdichild.cpp, and some cleanup in eeprominterface.cpp.

* [Simulator] Centralize radio UI flavor determination.

* [Simulator] Updates:
    Add X7 UI flavor;
    Centralize LCD settings;
    Simplify drawing curved UI widgets;
    LCD color can be changed for any 1/4-bit display radio;
    Slight change on default LCD "off" color;
    Refactor LcdWidget to not use globals.

* [Companion] X7 EEPROM import fix

+ cosmetics
+ compilation error fixed on Manjaro

* [Companion] 9XR-PRO EEPROM import fix

+ cosmetics
+ compilation error fixed on Manjaro

* Navigation fix
French translations

* [X7] Main view cosmetics

* Fix switch/ana custom name import

* [Simulator] Add white border above/below X7 bezel, and use white-colored padding on sides; Adjust X7 default LCD color.

* Does this work? (#4269)

Read an Horus SD card produces a temporary .otx file now

* Bsongis/companion warning before automatic conversions (#4271)

* Does this work?

* Warning before automatic conversions

* Force different file name after conversion (#4272)

* Force different file name after conversion

* More detailed instructions

* [Companion] Files automatically named during XXX => Horus conversions
2017-01-24 07:54:12 +01:00
Damjan AdamicandBertrand Songis f7543e3220 Projectkk2glider/simu tmp sd path (#4231)
* Re #4224: Introduced settingsPath and use std::string for paths in simpgmspace.

* Re #4224: Relevant parts of simpgmspace.cpp moved into simufatfs.cpp and simudisk.cpp

* Removed "/" from "mask_monitor_logsw.png"

* Re #4224: findTrueFileName() refactoring

* Faster gtests (less waiting for eeprom operations to finish)

* Re #4224: Radio settings and models directories now taken from alternate path (if set) [simu]

* Fixes #3322: together with previous changes to the SD browser this prevents the simulator from browsing higher than SD card root path.

* f_chdir() debug traces
2017-01-15 21:53:18 +01:00
Bertrand Songis 0ca0785912 [Companion] Another simplification 2016-11-24 07:24:49 +01:00
Bertrand Songis b0f5b646af [Companion] Copyright added to all files 2016-11-23 16:40:47 +01:00
Bertrand Songis 5f9737fc70 [Companion] Old EEPROM support removed 2016-11-23 16:40:47 +01:00
Bertrand Songis 5f03924b5f Compilation error fixed 2016-06-30 22:44:16 +02:00
Andre Bernet d207a600e8 Attempt at getting the simu interface usable with the extra trims 2016-04-02 17:03:24 +04:00
Bertrand Songis 4daf15869b Simulators refactoring 2016-03-11 20:24:27 +01:00
Damjan Adamic a3fac6049f Fixes #3207: proper sensor instance generation in Telemetry Simulator (ported from master #3213) 2016-01-11 18:58:41 +01:00
David S. Beach 3e409a0371 Next branch fixes #3141 Fx key to reload scripts 2015-12-27 11:53:29 -05:00
David S. Beach 3ebc6bb86c Ported simulator enhancements to next 2015-12-13 11:22:33 -05:00
Damjan Adamic 2a54bee20b Simulators and firmwares unregistered when application ends (fixes memory leaks) 2015-10-24 20:10:17 +02:00
Damjan Adamic 67cd321400 Re #2260: class Profile dependency removed from simulatorinterface 2015-06-01 21:37:25 +02:00
Damjan Adamic 70ff6b06ed Fixes #2260: added volumeGain in simulator (ported from master) 2015-05-31 15:59:31 +02:00
bsongis 2817866ad2 Directories FatFS / CoOS / STM32 libs moved to thirdparty 2015-03-14 11:56:24 +01:00
Damjan Adamic bb921a0a7f Ported from master to next:
#1489: TRACE() output intercepted and shown in Companion (shortcut F6)
#1270: simple Trainer Simulator (shortcut F5)
#1466: telemetry simulator (shorcut F5)
2015-01-04 20:07:39 +01:00
bsongis 970cebb9bd A couple of TODOs removed (hardcoded values instead of constants) 2014-05-15 10:25:07 +02:00
bsongis 2c2278a9ed Fixes #1086 2014-05-13 11:57:36 +02:00
Damjan Adamic 0145bcfd6c Fixes #500.
Graphical presentation could be better, I am not very familiar with Qt.
2014-05-11 18:12:03 +02:00
Damjan Adamic 533000ddcd Fixes #1042 2014-05-11 15:06:02 +02:00
Damjan Adamic df954ae483 Fixed many memory leaks 2014-04-14 20:25:17 +02:00
Andre Bernet d33d2b7ae6 Add trim keys to Taranis simu 2014-04-06 22:25:34 +02:00
Andre Bernet 78f36a02b4 Fixes #793 2014-03-15 16:30:33 +01:00
Bertrand Songis e0a03f6728 Simu renamed to simulator, in the same directory as companion 2014-02-20 12:11:10 +01:00