mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 21:05:26 +03:00
[Horus] Companion simulator
This commit is contained in:
parent
ab0272c16c
commit
6f774eb61a
24 changed files with 3916 additions and 81 deletions
|
@ -11,7 +11,9 @@ enum BoardEnum {
|
|||
BOARD_AR9X,
|
||||
BOARD_TARANIS,
|
||||
BOARD_TARANIS_PLUS,
|
||||
BOARD_TARANIS_X9E
|
||||
BOARD_TARANIS_X9E,
|
||||
BOARD_FLAMENCO,
|
||||
BOARD_HORUS
|
||||
};
|
||||
|
||||
#define C9X_MAX_MODELS 60
|
||||
|
|
|
@ -75,6 +75,10 @@ const char * OpenTxEepromInterface::getName()
|
|||
return "OpenTX for 9XR-PRO";
|
||||
case BOARD_AR9X:
|
||||
return "OpenTX for ar9x board / 9X";
|
||||
case BOARD_FLAMENCO:
|
||||
return "OpenTX for Flamenco experimental";
|
||||
case BOARD_HORUS:
|
||||
return "OpenTX for FrSky Horus";
|
||||
default:
|
||||
return "OpenTX for an unknown board";
|
||||
}
|
||||
|
@ -98,6 +102,8 @@ const int OpenTxEepromInterface::getEEpromSize()
|
|||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_FLAMENCO:
|
||||
case BOARD_HORUS:
|
||||
return EESIZE_TARANIS;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -403,6 +409,8 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
|||
case BOARD_SKY9X:
|
||||
case BOARD_AR9X:
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_FLAMENCO:
|
||||
case BOARD_HORUS:
|
||||
version = 218;
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
|
@ -1432,6 +1440,14 @@ void registerOpenTxFirmwares()
|
|||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Horus board */
|
||||
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
|
||||
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,16 @@ add_custom_target(about_lbm_taranis
|
|||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(about_lbm_flamenco
|
||||
make lbm PCB=FLAMENCO
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(about_lbm_horus
|
||||
make lbm PCB=HORUS
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(commondeps
|
||||
make stamp_header tra
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
|
@ -20,8 +30,11 @@ add_custom_target(commondeps
|
|||
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
|
||||
|
||||
add_custom_target(lua_exports
|
||||
make PCB=TARANIS lua_exports_taranis.inc
|
||||
add_custom_target(lua_exports
|
||||
COMMAND make PCB=TARANIS lua_exports_taranis.inc
|
||||
COMMAND make PCB=FLAMENCO lua_exports_flamenco.inc
|
||||
COMMAND make PCB=HORUS lua_exports_horus.inc
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
|
@ -84,6 +97,7 @@ add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
|||
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-horus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
|
@ -97,6 +111,7 @@ add_dependencies(opentx-ar9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
|||
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
add_dependencies(opentx-horus${SUFFIX}-simulator about_lbm_horus commondeps lua_exports)
|
||||
|
||||
set(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
|
@ -111,6 +126,7 @@ set(OPENTX_LIBRARIES
|
|||
opentx-taranis${SUFFIX}-simulator
|
||||
opentx-taranisplus${SUFFIX}-simulator
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
opentx-horus${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
@ -177,6 +193,11 @@ target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_
|
|||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Horus
|
||||
target_include_directories(opentx-horus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/Horus)
|
||||
target_compile_definitions(opentx-horus${SUFFIX}-simulator PRIVATE PCBHORUS CPUARM CPUSTM32 STM32F40_41xxx COLORLCD VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-horus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
|
|
|
@ -40,7 +40,11 @@
|
|||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBFLAMENCO) || defined(PCBHORUS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#elif defined(PCBTARANIS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
|
@ -97,6 +101,7 @@ namespace NAMESPACE {
|
|||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/storage/storage_common.cpp"
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "radio/src/storage/eeprom_common.cpp"
|
||||
#include "radio/src/storage/eeprom_rlc.cpp"
|
||||
|
@ -127,7 +132,79 @@ namespace NAMESPACE {
|
|||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/trainer_input.cpp"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
#include "radio/src/gui/Horus/bitmaps.cpp"
|
||||
#include "radio/src/gui/Horus/fonts.cpp"
|
||||
#include "radio/src/gui/Horus/widgets.cpp"
|
||||
#include "radio/src/gui/Horus/navigation.cpp"
|
||||
#include "radio/src/gui/Horus/popups.cpp"
|
||||
#include "radio/src/gui/Horus/helpers.cpp"
|
||||
#include "radio/src/gui/Horus/menus.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_custom_functions.cpp"
|
||||
// #include "radio/src/gui/Horus/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Horus/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/Horus/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Horus/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Horus/view_main.cpp"
|
||||
#include "radio/src/gui/Horus/view_statistics.cpp"
|
||||
#include "radio/src/gui/Horus/view_channels.cpp"
|
||||
#include "radio/src/gui/Horus/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Horus/view_text.cpp"
|
||||
#include "radio/src/gui/Horus/view_about.cpp"
|
||||
#include "radio/src/gui/Horus/lcd.cpp"
|
||||
#include "radio/src/gui/Horus/splash.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/gui/Flamenco/fonts.cpp"
|
||||
#include "radio/src/gui/Flamenco/widgets.cpp"
|
||||
#include "radio/src/gui/Flamenco/navigation.cpp"
|
||||
#include "radio/src/gui/Flamenco/popups.cpp"
|
||||
#include "radio/src/gui/Flamenco/helpers.cpp"
|
||||
#include "radio/src/gui/Flamenco/menus.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_custom_functions.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_main.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_statistics.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_channels.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_text.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_about.cpp"
|
||||
#include "radio/src/gui/Flamenco/lcd.cpp"
|
||||
#include "radio/src/gui/Flamenco/splash.cpp"
|
||||
#include "radio/src/targets/Flamenco/tw8823_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/Taranis/fonts.cpp"
|
||||
#include "radio/src/gui/Taranis/widgets.cpp"
|
||||
|
@ -224,7 +301,26 @@ namespace NAMESPACE {
|
|||
#include "radio/src/buzzer.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
#include "radio/src/targets/Horus/board_horus.cpp"
|
||||
#include "radio/src/targets/Horus/keys_driver.cpp"
|
||||
#include "radio/src/targets/Horus/audio_driver.cpp"
|
||||
#include "radio/src/targets/Horus/telemetry_driver.cpp"
|
||||
// #include "radio/src/targets/Horus/haptic_driver.cpp"
|
||||
#include "radio/src/targets/Horus/pulses_driver.cpp"
|
||||
// #include "radio/src/targets/Horus/rtc_driver.cpp"
|
||||
#include "radio/src/targets/Horus/trainer_driver.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/targets/Flamenco/board_flamenco.cpp"
|
||||
#include "radio/src/targets/Flamenco/keys_driver.cpp"
|
||||
#include "radio/src/targets/Flamenco/audio_driver.cpp"
|
||||
#include "radio/src/targets/Flamenco/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/Flamenco/eeprom_driver.cpp"
|
||||
// #include "radio/src/targets/Flamenco/haptic_driver.cpp"
|
||||
#include "radio/src/targets/Flamenco/pulses_driver.cpp"
|
||||
// #include "radio/src/targets/Flamenco/rtc_driver.cpp"
|
||||
#include "radio/src/targets/Flamenco/trainer_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/targets/Taranis/board_taranis.cpp"
|
||||
#include "radio/src/targets/Taranis/keys_driver.cpp"
|
||||
#include "radio/src/targets/Taranis/audio_driver.cpp"
|
||||
|
@ -255,7 +351,11 @@ namespace NAMESPACE {
|
|||
#elif defined(PCBMEGA2560)
|
||||
#include "radio/src/targets/Mega2560/board_mega2560.cpp"
|
||||
#else
|
||||
#include "../../../../../radio/src/targets/9x/board_stock.cpp"
|
||||
#include "radio/src/targets/9x/board_stock.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/gui_helpers.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/keys.cpp"
|
||||
|
@ -526,7 +626,11 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
|||
|
||||
virtual BoardEnum type()
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
return BOARD_HORUS;
|
||||
#elif defined(PCBFLAMENCO)
|
||||
return BOARD_FLAMENCO;
|
||||
#elif defined(PCBTARANIS)
|
||||
return BOARD_TARANIS;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
|
|
|
@ -19,7 +19,15 @@
|
|||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#if defined(PCBHORUS)
|
||||
#define FLAVOUR "horus"
|
||||
#define NAMESPACE HORUS
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#define FLAVOUR "flamenco"
|
||||
#define NAMESPACE FLAMENCO
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBTARANIS) && defined(REV9E)
|
||||
#define FLAVOUR "taranisx9e"
|
||||
#define NAMESPACE TaranisX9E
|
||||
#define EEPROM_VARIANT 0x8000
|
||||
|
|
|
@ -788,7 +788,13 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
|||
}
|
||||
BoardEnum board = GetCurrentFirmware()->getBoard();
|
||||
SimulatorDialog * sd;
|
||||
if (IS_TARANIS(board)) {
|
||||
if (board == BOARD_HORUS) {
|
||||
sd = new SimulatorDialogHorus(parent, si, flags);
|
||||
}
|
||||
else if (board == BOARD_FLAMENCO) {
|
||||
sd = new SimulatorDialogFlamenco(parent, si, flags);
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Pots); i++) {
|
||||
if (radioData.generalSettings.isPotAvailable(i)) {
|
||||
flags |= (SIMULATOR_FLAGS_S1 << i);
|
||||
|
|
|
@ -9,6 +9,8 @@ set(simulation_SRCS
|
|||
set(simulation_UIS
|
||||
simulatordialog-9x.ui
|
||||
simulatordialog-taranis.ui
|
||||
simulatordialog-horus.ui
|
||||
simulatordialog-flamenco.ui
|
||||
telemetrysimu.ui
|
||||
trainersimu.ui
|
||||
debugoutput.ui
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef lcd_widget_h
|
||||
#define lcd_widget_h
|
||||
#ifndef _LCD_WIDGET_H_
|
||||
#define _LCD_WIDGET_H_
|
||||
|
||||
#include <QWidget>
|
||||
#include "appdata.h"
|
||||
|
||||
class lcdWidget : public QWidget {
|
||||
class LcdWidget : public QWidget {
|
||||
public:
|
||||
lcdWidget(QWidget * parent = 0):
|
||||
LcdWidget(QWidget * parent = 0):
|
||||
QWidget(parent),
|
||||
lcdBuf(NULL),
|
||||
previousBuf(NULL),
|
||||
|
@ -30,10 +30,11 @@ class lcdWidget : public QWidget {
|
|||
{
|
||||
}
|
||||
|
||||
~lcdWidget()
|
||||
~LcdWidget()
|
||||
{
|
||||
if (previousBuf)
|
||||
if (previousBuf) {
|
||||
free(previousBuf);
|
||||
}
|
||||
}
|
||||
|
||||
void setData(unsigned char *buf, int width, int height, int depth=1)
|
||||
|
@ -43,7 +44,7 @@ class lcdWidget : public QWidget {
|
|||
lcdHeight = height;
|
||||
lcdDepth = depth;
|
||||
if (depth >= 8)
|
||||
lcdSize = (width * height) * (depth / 8);
|
||||
lcdSize = (width * height) * ((depth+7) / 8);
|
||||
else
|
||||
lcdSize = (width * ((height+7)/8)) * depth;
|
||||
previousBuf = (unsigned char *)malloc(lcdSize);
|
||||
|
@ -109,7 +110,17 @@ class lcdWidget : public QWidget {
|
|||
{
|
||||
QRgb rgb;
|
||||
|
||||
if (lcdDepth >= 8) {
|
||||
if (lcdDepth == 16) {
|
||||
for (int x=0; x<lcdWidth; x++) {
|
||||
for (int y=0; y<lcdHeight; y++) {
|
||||
uint16_t z = ((uint16_t *)lcdBuf)[y * lcdWidth + x];
|
||||
rgb = qRgb(255*((z&0xF800)>>11)/0x1F, 255*((z&0x07E0)>>5)/0x3F, 255*(z&0x001F)/0x1F);
|
||||
p.setPen(rgb);
|
||||
p.drawPoint(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lcdDepth == 12) {
|
||||
for (int x=0; x<lcdWidth; x++) {
|
||||
for (int y=0; y<lcdHeight; y++) {
|
||||
uint16_t z = ((uint16_t *)lcdBuf)[y * lcdWidth + x];
|
||||
|
@ -175,4 +186,4 @@ class lcdWidget : public QWidget {
|
|||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _LCD_WIDGET_H_
|
||||
|
|
|
@ -1305,7 +1305,7 @@ QPushButton:checked {
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="lcdWidget" name="lcd" native="true">
|
||||
<widget class="LcdWidget" name="lcd" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -1469,7 +1469,7 @@ QPushButton:checked {
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lcdWidget</class>
|
||||
<class>LcdWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>lcdwidget.h</header>
|
||||
<container>1</container>
|
||||
|
|
1663
companion/src/simulation/simulatordialog-flamenco.ui
Normal file
1663
companion/src/simulation/simulatordialog-flamenco.ui
Normal file
File diff suppressed because it is too large
Load diff
1663
companion/src/simulation/simulatordialog-horus.ui
Normal file
1663
companion/src/simulation/simulatordialog-horus.ui
Normal file
File diff suppressed because it is too large
Load diff
|
@ -146,7 +146,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="lcdWidget" name="lcd" native="true">
|
||||
<widget class="LcdWidget" name="lcd" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -1735,7 +1735,7 @@ QPushButton:checked {
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lcdWidget</class>
|
||||
<class>LcdWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>lcdwidget.h</header>
|
||||
<container>1</container>
|
||||
|
|
|
@ -217,6 +217,7 @@ SimulatorDialogTaranis::~SimulatorDialogTaranis()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
SimulatorDialog::~SimulatorDialog()
|
||||
{
|
||||
traceCallbackInstance = 0;
|
||||
|
@ -1134,3 +1135,6 @@ void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "simulatordialogflamenco.cpp"
|
||||
#include "simulatordialoghorus.cpp"
|
||||
|
|
|
@ -21,10 +21,12 @@
|
|||
namespace Ui {
|
||||
class SimulatorDialog9X;
|
||||
class SimulatorDialogTaranis;
|
||||
class SimulatorDialogFlamenco;
|
||||
class SimulatorDialogHorus;
|
||||
}
|
||||
|
||||
// TODO rename + move?
|
||||
class lcdWidget;
|
||||
class LcdWidget;
|
||||
class mySlider;
|
||||
|
||||
#define SIMULATOR_FLAGS_NOTX 1
|
||||
|
@ -38,6 +40,8 @@ class mySlider;
|
|||
#define SIMULATOR_FLAGS_S3_MULTI 256
|
||||
#define SIMULATOR_FLAGS_S4_MULTI 512 // reserved for the future
|
||||
|
||||
void traceCb(const char * text);
|
||||
|
||||
class SimulatorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -56,7 +60,7 @@ class SimulatorDialog : public QDialog
|
|||
virtual void updateBeepButton() { }
|
||||
|
||||
unsigned int flags;
|
||||
lcdWidget * lcd;
|
||||
LcdWidget * lcd;
|
||||
QGraphicsView * leftStick, * rightStick;
|
||||
QVector<QDial *> pots;
|
||||
QVector<QLabel *> potLabels;
|
||||
|
@ -205,4 +209,48 @@ class SimulatorDialogTaranis: public SimulatorDialog
|
|||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
class SimulatorDialogFlamenco: public SimulatorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatorDialogFlamenco(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||
virtual ~SimulatorDialogFlamenco();
|
||||
|
||||
protected:
|
||||
virtual void getValues();
|
||||
void saveSwitches(void);
|
||||
void restoreSwitches(void);
|
||||
|
||||
private:
|
||||
Ui::SimulatorDialogFlamenco * ui;
|
||||
static uint32_t switchstatus;
|
||||
|
||||
private slots:
|
||||
void resetSH();
|
||||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
class SimulatorDialogHorus: public SimulatorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatorDialogHorus(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||
virtual ~SimulatorDialogHorus();
|
||||
|
||||
protected:
|
||||
virtual void getValues();
|
||||
void saveSwitches(void);
|
||||
void restoreSwitches(void);
|
||||
|
||||
private:
|
||||
Ui::SimulatorDialogHorus * ui;
|
||||
static uint32_t switchstatus;
|
||||
|
||||
private slots:
|
||||
void resetSH();
|
||||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
#endif // SIMULATORDIALOG_H
|
||||
|
|
166
companion/src/simulation/simulatordialogflamenco.cpp
Normal file
166
companion/src/simulation/simulatordialogflamenco.cpp
Normal file
|
@ -0,0 +1,166 @@
|
|||
#include "simulatordialog.h"
|
||||
#include "ui_simulatordialog-flamenco.h"
|
||||
#include "helpers.h"
|
||||
|
||||
uint32_t SimulatorDialogFlamenco::switchstatus = 0;
|
||||
|
||||
SimulatorDialogFlamenco::SimulatorDialogFlamenco(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||
SimulatorDialog(parent, simulator, flags),
|
||||
ui(new Ui::SimulatorDialogFlamenco)
|
||||
{
|
||||
lcdWidth = 320;
|
||||
lcdHeight = 240;
|
||||
lcdDepth = 12;
|
||||
|
||||
initUi<Ui::SimulatorDialogFlamenco>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
// TODO dialP_4 = ui->dialP_4;
|
||||
|
||||
ui->lcd->setBackgroundColor(47, 123, 227);
|
||||
|
||||
//restore switches
|
||||
if (g.simuSW())
|
||||
restoreSwitches();
|
||||
|
||||
ui->trimHR_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHR_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVR_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVR_D->setText(QString::fromUtf8(downArrow));
|
||||
ui->trimHL_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHL_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
||||
|
||||
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->trimHR_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHR_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
}
|
||||
|
||||
SimulatorDialogFlamenco::~SimulatorDialogFlamenco()
|
||||
{
|
||||
saveSwitches();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::resetSH()
|
||||
{
|
||||
ui->switchH->setValue(0);
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::on_switchH_sliderReleased()
|
||||
{
|
||||
QTimer::singleShot(400, this, SLOT(resetSH()));
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::getValues()
|
||||
{
|
||||
TxInputs inputs = {
|
||||
{
|
||||
int(1024*nodeLeft->getX()), // LEFT HORZ
|
||||
int(-1024*nodeLeft->getY()), // LEFT VERT
|
||||
int(-1024*nodeRight->getY()), // RGHT VERT
|
||||
int(1024*nodeRight->getX()) // RGHT HORZ
|
||||
},
|
||||
|
||||
{
|
||||
-ui->dialP_1->value(),
|
||||
ui->dialP_2->value(),
|
||||
0,
|
||||
-ui->dialP_3->value(),
|
||||
ui->dialP_4->value()
|
||||
},
|
||||
|
||||
{
|
||||
ui->switchA->value() - 1,
|
||||
ui->switchB->value() - 1,
|
||||
ui->switchC->value() - 1,
|
||||
ui->switchD->value() - 1,
|
||||
ui->switchE->value() - 1,
|
||||
ui->switchF->value(),
|
||||
ui->switchG->value() - 1,
|
||||
ui->switchH->value(), 0, 0
|
||||
},
|
||||
|
||||
{
|
||||
buttonPressed == Qt::Key_PageUp,
|
||||
buttonPressed == Qt::Key_Escape,
|
||||
buttonPressed == Qt::Key_Enter,
|
||||
buttonPressed == Qt::Key_PageDown,
|
||||
buttonPressed == Qt::Key_Plus,
|
||||
buttonPressed == Qt::Key_Minus
|
||||
},
|
||||
|
||||
middleButtonPressed,
|
||||
|
||||
{
|
||||
trimPressed == TRIM_LH_L,
|
||||
trimPressed == TRIM_LH_R,
|
||||
trimPressed == TRIM_LV_DN,
|
||||
trimPressed == TRIM_LV_UP,
|
||||
trimPressed == TRIM_RV_DN,
|
||||
trimPressed == TRIM_RV_UP,
|
||||
trimPressed == TRIM_RH_L,
|
||||
trimPressed == TRIM_RH_R
|
||||
}
|
||||
};
|
||||
|
||||
simulator->setValues(inputs);
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::saveSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::saveSwitches()";
|
||||
switchstatus=ui->switchA->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchB->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchC->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchD->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchE->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchF->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchG->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchH->value();
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::restoreSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::restoreSwitches()";
|
||||
ui->switchH->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchG->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchF->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchE->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchD->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchC->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchB->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchA->setValue(switchstatus & 0x3);
|
||||
}
|
166
companion/src/simulation/simulatordialoghorus.cpp
Normal file
166
companion/src/simulation/simulatordialoghorus.cpp
Normal file
|
@ -0,0 +1,166 @@
|
|||
#include "simulatordialog.h"
|
||||
#include "ui_simulatordialog-horus.h"
|
||||
#include "helpers.h"
|
||||
|
||||
uint32_t SimulatorDialogHorus::switchstatus = 0;
|
||||
|
||||
SimulatorDialogHorus::SimulatorDialogHorus(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||
SimulatorDialog(parent, simulator, flags),
|
||||
ui(new Ui::SimulatorDialogHorus)
|
||||
{
|
||||
lcdWidth = 480;
|
||||
lcdHeight = 270;
|
||||
lcdDepth = 16;
|
||||
|
||||
initUi<Ui::SimulatorDialogHorus>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
// TODO dialP_4 = ui->dialP_4;
|
||||
|
||||
ui->lcd->setBackgroundColor(47, 123, 227);
|
||||
|
||||
//restore switches
|
||||
if (g.simuSW())
|
||||
restoreSwitches();
|
||||
|
||||
ui->trimHR_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHR_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVR_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVR_D->setText(QString::fromUtf8(downArrow));
|
||||
ui->trimHL_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHL_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
||||
|
||||
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->trimHR_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHR_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
}
|
||||
|
||||
SimulatorDialogHorus::~SimulatorDialogHorus()
|
||||
{
|
||||
saveSwitches();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::resetSH()
|
||||
{
|
||||
ui->switchH->setValue(0);
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::on_switchH_sliderReleased()
|
||||
{
|
||||
QTimer::singleShot(400, this, SLOT(resetSH()));
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::getValues()
|
||||
{
|
||||
TxInputs inputs = {
|
||||
{
|
||||
int(1024*nodeLeft->getX()), // LEFT HORZ
|
||||
int(-1024*nodeLeft->getY()), // LEFT VERT
|
||||
int(-1024*nodeRight->getY()), // RGHT VERT
|
||||
int(1024*nodeRight->getX()) // RGHT HORZ
|
||||
},
|
||||
|
||||
{
|
||||
-ui->dialP_1->value(),
|
||||
ui->dialP_2->value(),
|
||||
0,
|
||||
-ui->dialP_3->value(),
|
||||
ui->dialP_4->value()
|
||||
},
|
||||
|
||||
{
|
||||
ui->switchA->value() - 1,
|
||||
ui->switchB->value() - 1,
|
||||
ui->switchC->value() - 1,
|
||||
ui->switchD->value() - 1,
|
||||
ui->switchE->value() - 1,
|
||||
ui->switchF->value(),
|
||||
ui->switchG->value() - 1,
|
||||
ui->switchH->value(), 0, 0
|
||||
},
|
||||
|
||||
{
|
||||
buttonPressed == Qt::Key_PageUp,
|
||||
buttonPressed == Qt::Key_Escape,
|
||||
buttonPressed == Qt::Key_Enter,
|
||||
buttonPressed == Qt::Key_PageDown,
|
||||
buttonPressed == Qt::Key_Plus,
|
||||
buttonPressed == Qt::Key_Minus
|
||||
},
|
||||
|
||||
middleButtonPressed,
|
||||
|
||||
{
|
||||
trimPressed == TRIM_LH_L,
|
||||
trimPressed == TRIM_LH_R,
|
||||
trimPressed == TRIM_LV_DN,
|
||||
trimPressed == TRIM_LV_UP,
|
||||
trimPressed == TRIM_RV_DN,
|
||||
trimPressed == TRIM_RV_UP,
|
||||
trimPressed == TRIM_RH_L,
|
||||
trimPressed == TRIM_RH_R
|
||||
}
|
||||
};
|
||||
|
||||
simulator->setValues(inputs);
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::saveSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::saveSwitches()";
|
||||
switchstatus=ui->switchA->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchB->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchC->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchD->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchE->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchF->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchG->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchH->value();
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::restoreSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::restoreSwitches()";
|
||||
ui->switchH->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchG->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchF->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchE->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchD->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchC->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchB->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchA->setValue(switchstatus & 0x3);
|
||||
}
|
|
@ -50,7 +50,7 @@ if (inputs.rotenc) pind |= 0x20;
|
|||
if (inputs.rotenc) PIOB->PIO_PDSR &= ~0x40; else PIOB->PIO_PDSR |= 0x40;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#if defined(PCBFLAMENCO) || (defined(PCBTARANIS) && defined(REV9E))
|
||||
if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -160,7 +160,11 @@ int main(int argc, char *argv[])
|
|||
eepromFileName = QString("eeprom-%1.bin").arg(radioId);
|
||||
eepromFileName = eedir.filePath(eepromFileName.toAscii());
|
||||
SimulatorFactory *factory = getSimulatorFactory(firmwareId);
|
||||
if (factory->type() == BOARD_TARANIS)
|
||||
if (factory->type() == BOARD_HORUS)
|
||||
dialog = new SimulatorDialogHorus(NULL, factory->create());
|
||||
else if (factory->type() == BOARD_FLAMENCO)
|
||||
dialog = new SimulatorDialogFlamenco(NULL, factory->create());
|
||||
else if (factory->type() == BOARD_TARANIS)
|
||||
dialog = new SimulatorDialogTaranis(NULL, factory->create(), SIMULATOR_FLAGS_S1|SIMULATOR_FLAGS_S2);
|
||||
else
|
||||
dialog = new SimulatorDialog9X(NULL, factory->create());
|
||||
|
|
|
@ -35,56 +35,6 @@
|
|||
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define POS_MODEL_NAME 35
|
||||
#define POS_MODEL_SIZE 170
|
||||
|
||||
void onModelSelectMenu(const char *result)
|
||||
{
|
||||
int sub = m_posVert;
|
||||
|
||||
if (result == STR_SELECT_MODEL || result == STR_CREATE_MODEL) {
|
||||
selectModel(sub);
|
||||
}
|
||||
else if (result == STR_COPY_MODEL) {
|
||||
s_copyMode = COPY_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
else if (result == STR_MOVE_MODEL) {
|
||||
s_copyMode = MOVE_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
else if (result == STR_BACKUP_MODEL) {
|
||||
storageCheck(true); // force writing of current model data before this is changed
|
||||
POPUP_WARNING(eeBackupModel(sub));
|
||||
}
|
||||
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(MODELS_PATH, MODELS_EXT, MENU_LINE_LENGTH-1, NULL)) {
|
||||
POPUP_WARNING(STR_NO_MODELS_ON_SD);
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL);
|
||||
// SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), ZCHAR);
|
||||
}
|
||||
else {
|
||||
// The user choosed a file on SD to restore
|
||||
POPUP_WARNING(eeRestoreModel(sub, (char *)result));
|
||||
// if (!s_warning && g_eeGeneral.currModel == sub)
|
||||
// eeLoadModel(sub);
|
||||
}
|
||||
}
|
||||
|
||||
char *strAppendModelSize(char *dest, int size)
|
||||
{
|
||||
char s[8] = "---";
|
||||
if (size) sprintf(s, "%d", size);
|
||||
dest = strSetCursor(dest, POS_MODEL_SIZE-getTextWidth(s));
|
||||
return strAppend(dest, s);
|
||||
}
|
||||
|
||||
#define CATEGORIES_WIDTH 140
|
||||
|
||||
void menuModelSelect(evt_t event)
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef evt_t & check_event_t;
|
|||
|
||||
extern uint8_t menuPageIndex;
|
||||
extern uint8_t menuPageCount;
|
||||
extern uint16_t linesCount;
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
extern vertpos_t s_pgOfs;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "../../CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
|
||||
/** @addtogroup STM32F4xx_StdPeriph_Driver
|
||||
* @{
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "../../CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
|
||||
/** @addtogroup STM32F4xx_StdPeriph_Driver
|
||||
* @{
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "../../CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
|
||||
/** @addtogroup STM32F4xx_StdPeriph_Driver
|
||||
* @{
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "../../CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
|
||||
/** @addtogroup STM32F4xx_StdPeriph_Driver
|
||||
* @{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue