Merge pull request #1186 from EdgeTX/cpn-storage-fmts

Companion YaML support
This commit is contained in:
Raphael Coeffic
2022-01-02 13:06:01 +01:00
committed by GitHub
157 changed files with 7365 additions and 1217 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ if(SIMU_LUA_COMPILER)
endif()
if(Qt5Widgets_FOUND)
set(SIMULATOR_FLAVOUR opentx-${FLAVOUR})
set(SIMULATOR_FLAVOUR edgetx-${FLAVOUR})
set(SIMULATOR_TARGET ${SIMULATOR_FLAVOUR}-simulator)
add_definitions(-DSIMULATOR_FLAVOUR="${SIMULATOR_FLAVOUR}")
include_directories(${COMPANION_SRC_DIRECTORY} ${COMPANION_SRC_DIRECTORY}/simulation)
@@ -52,7 +52,7 @@ if(Qt5Widgets_FOUND)
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:${SIMULATOR_TARGET}>)
endif()
endif()
# Introduced at 2.5 - TODO replace with a code change
# When compiled shared simulators using libopenui and Companion have classes named MainWindow
+5 -5
View File
@@ -32,7 +32,7 @@
#define GET_SWITCH_BOOL(sw__) getSwitch((sw__), 0);
#define OTXS_DBG qDebug() << "(" << simuTimerMicros() << "us)"
#define ETXS_DBG qDebug() << "(" << simuTimerMicros() << "us)"
int16_t g_anas[Analogs::NUM_ANALOGS];
QVector<QIODevice *> OpenTxSimulator::tracebackDevices;
@@ -106,7 +106,7 @@ void OpenTxSimulator::init()
if (isRunning())
return;
OTXS_DBG;
ETXS_DBG;
if (!m_timer10ms) {
// make sure we create & control the timer from current thread
@@ -134,7 +134,7 @@ void OpenTxSimulator::start(const char * filename, bool tests)
{
if (isRunning())
return;
OTXS_DBG << "file:" << filename << "tests:" << tests;
ETXS_DBG << "file:" << filename << "tests:" << tests;
QMutexLocker lckr(&m_mtxSimuMain);
QMutexLocker slckr(&m_mtxSettings);
@@ -150,7 +150,7 @@ void OpenTxSimulator::stop()
{
if (!isRunning())
return;
OTXS_DBG;
ETXS_DBG;
setStopRequested(true);
@@ -380,7 +380,7 @@ void OpenTxSimulator::setTrainerTimeout(uint16_t ms)
void OpenTxSimulator::sendTelemetry(const QByteArray data)
{
//OTXS_DBG << data;
//ETXS_DBG << data;
sportProcessTelemetryPacket((uint8_t *)data.constData());
}
+12 -15
View File
@@ -124,23 +124,20 @@ bool redirectToSettingsDirectory(const std::string & path)
* model (*.bin) files in /MODELS directory
*/
if (!simuSettingsDirectory.empty()) {
#if defined(COLORLCD)
if (path == RADIO_MODELSLIST_PATH || path == RADIO_SETTINGS_PATH
#if defined(SDCARD_YAML)
|| path == MODELSLIST_YAML_PATH || path == RADIO_SETTINGS_YAML_PATH
#endif
) {
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
if (path == MODELS_PATH || path == RADIO_PATH) return true;
#if !defined(EEPROM_RLC)
if (path == RADIO_MODELSLIST_PATH || path == RADIO_SETTINGS_PATH)
return true;
}
#endif
if (startsWith(path, "/MODELS")
&& (endsWith(path, MODELS_EXT)
#if defined(SDCARD_YAML)
|| endsWith(path, YAML_EXT)
#endif
)) {
if (startsWith(path, MODELS_PATH) && endsWith(path, MODELS_EXT))
return true;
}
#endif
#endif
#if defined(SDCARD_YAML)
if (path == MODELSLIST_YAML_PATH || path == RADIO_SETTINGS_YAML_PATH)
return true;
if (startsWith(path, MODELS_PATH) && endsWith(path, YAML_EXT)) return true;
#endif
}
return false;
}