Companion 2.5 (#555)
* Introduce yaml in Companion * EdgeTX Companion Replace some OpenTX refs Data conversion to v220 Update Timers ui to cater for mode field split * Fix some simulators crashing when started from Companion * Disable firmware and app update checking and downloads from companion * Some more rebranding * Disable manual download actions and another rebrand * Fix cmake warning * Fix mode ON conversion gtests and enable switch in model edit * Stop update message when updates turned off * OpenTX #8580 Fixes missing negative sign for telemetry sources * OpenTX #8604 fix curves tooltip colors * OpenTX #8616 Fix release notes url references * OpenTX #8548 Align file sync folder references * OpenTX #8548 Link field once * OpenTX #8550 Confirmation prompt before write models and settings to radio * OpenTX #8550 Translate strings * Title and splash images * Change DEB package maintainer * Start NV14 * NV14 continued * NV14 sim * Timer countdownStart data conversion and ui fixes * Fix screen width * Merge OpenTX PR 8675 * NV14 sim add computer keys and mouse to activate some functions * Only allow supported protocols for each module on conversion * Clear mismatched modules on conversion * Replace colorlcd theme and layout blobs with detailed data structs in companion * NV14 has 2 topbar zones * Fix layout init * Fix layout init again * Reset to eepromimportexport.h to main branch * Import/export does not like enum fields * Model edit add custom screens tab for color and bw telemetry * Free memory
This commit is contained in:
@@ -13,6 +13,7 @@ set(storage_NAMES
|
||||
categorized
|
||||
sdcard
|
||||
otx
|
||||
yaml
|
||||
)
|
||||
|
||||
set(storage_SRCS
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
//! CPN_SETTINGS_VERSION is used for settings data version tracking.
|
||||
#define CPN_SETTINGS_VERSION ((VERSION_NUMBER << 8) | CPN_SETTINGS_REVISION)
|
||||
|
||||
#define COMPANY QStringLiteral("OpenTX")
|
||||
#define COMPANY_DOMAIN QStringLiteral("open-tx.org")
|
||||
#define COMPANY QStringLiteral("EdgeTX")
|
||||
#define COMPANY_DOMAIN QStringLiteral("edge-tx.org")
|
||||
#define PRODUCT QStringLiteral("Companion " QT_STRINGIFY(VERSION_MAJOR) "." QT_STRINGIFY(VERSION_MINOR))
|
||||
#define APP_COMPANION QStringLiteral("OpenTX Companion")
|
||||
#define APP_SIMULATOR QStringLiteral("OpenTX Simulator")
|
||||
#define APP_COMPANION QStringLiteral("EdgeTX Companion")
|
||||
#define APP_SIMULATOR QStringLiteral("EdgeTX Simulator")
|
||||
|
||||
//! Default location for OpenTX-related user documents (settigns, logs, etc)
|
||||
#define CPN_DOCUMENTS_LOCATION QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) % "/" % COMPANY
|
||||
@@ -58,7 +58,7 @@
|
||||
#define CPN_SETTINGS_INI_FILE QString(PRODUCT % " " % QCoreApplication::translate("Companion", "settings") % " %1.ini")
|
||||
#define CPN_SETTINGS_INI_PATH QString(CPN_SETTINGS_BACKUP_DIR % "/" % CPN_SETTINGS_INI_FILE)
|
||||
|
||||
#define CPN_URL_DOWNLOAD "https://downloads.open-tx.org/"
|
||||
#define CPN_URL_DOWNLOAD "https://downloads.edge-tx.org/"
|
||||
#define CPN_URL_DOWNLOAD_CUR_VERS CPN_URL_DOWNLOAD QT_STRINGIFY(VERSION_MAJOR) "." QT_STRINGIFY(VERSION_MINOR) "/"
|
||||
#define CPN_URL_DOWNLOAD_CUR_REL CPN_URL_DOWNLOAD_CUR_VERS "release/"
|
||||
#define CPN_URL_DOWNLOAD_CUR_RC CPN_URL_DOWNLOAD_CUR_VERS "rc/"
|
||||
@@ -573,8 +573,8 @@ class AppData: public CompStoreObj
|
||||
PROPERTY4(bool, jsSupport, "js_support", false)
|
||||
PROPERTY4(bool, showSplash, "show_splash", true)
|
||||
PROPERTY4(bool, snapToClpbrd, "snapshot_to_clipboard", false)
|
||||
PROPERTY4(bool, autoCheckApp, "startup_check_companion", true)
|
||||
PROPERTY4(bool, autoCheckFw, "startup_check_fw", true)
|
||||
PROPERTY4(bool, autoCheckApp, "startup_check_companion", false)
|
||||
PROPERTY4(bool, autoCheckFw, "startup_check_fw", false)
|
||||
PROPERTY4(bool, promptProfile, "startup_prompt_profile", false)
|
||||
|
||||
PROPERTY(bool, enableBackup, false)
|
||||
@@ -593,6 +593,9 @@ class AppData: public CompStoreObj
|
||||
PROPERTY(int, simuLastProfId, -1)
|
||||
PROPERTY(bool, simuSW, true)
|
||||
|
||||
// Message box confirmations
|
||||
PROPERTY(bool, confirmWriteModelsAndSettings, true)
|
||||
|
||||
bool firstUse;
|
||||
QString upgradeFromVersion;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "eepe.h"
|
||||
#include "otx.h"
|
||||
#include "sdcard.h"
|
||||
#include "yaml.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QFileInfo>
|
||||
@@ -41,6 +42,8 @@ StorageType getStorageType(const QString & filename)
|
||||
return STORAGE_TYPE_XML;
|
||||
else if (suffix == "OTX")
|
||||
return STORAGE_TYPE_OTX;
|
||||
else if (suffix == "YML")
|
||||
return STORAGE_TYPE_YML;
|
||||
else
|
||||
return STORAGE_TYPE_UNKNOWN;
|
||||
}
|
||||
@@ -61,6 +64,7 @@ void registerStorageFactories()
|
||||
registerStorageFactory(new DefaultStorageFactory<EepeFormat>("eepe"));
|
||||
registerStorageFactory(new DefaultStorageFactory<HexEepromFormat>("hex"));
|
||||
registerStorageFactory(new DefaultStorageFactory<OtxFormat>("otx"));
|
||||
registerStorageFactory(new DefaultStorageFactory<YamlFormat>("yml"));
|
||||
registerStorageFactory(new SdcardStorageFactory());
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ enum StorageType
|
||||
STORAGE_TYPE_EEPM,
|
||||
STORAGE_TYPE_XML,
|
||||
STORAGE_TYPE_SDCARD,
|
||||
STORAGE_TYPE_OTX
|
||||
STORAGE_TYPE_OTX,
|
||||
STORAGE_TYPE_YML
|
||||
};
|
||||
|
||||
StorageType getStorageType(const QString & filename);
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "yaml.h"
|
||||
#include "../../../radio/src/storage/yaml/yaml_tree_walker.h" // just to confirm valid compiler path
|
||||
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
bool YamlFormat::loadFile(QByteArray & filedata, const QString & filename)
|
||||
{
|
||||
QString path = this->filename + "/" + filename;
|
||||
QFile file(path);
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
setError(tr("Error opening file %1:\n%2.").arg(path).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
filedata = file.readAll();
|
||||
qDebug() << "File" << path << "read, size:" << filedata.size();
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool YamlFormat::writeFile(const QByteArray & filedata, const QString & filename)
|
||||
{
|
||||
QString path = this->filename + "/" + filename;
|
||||
QFile file(path);
|
||||
if (!file.open(QFile::WriteOnly)) {
|
||||
setError(tr("Error opening file %1 in write mode:\n%2.").arg(path).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
file.write(filedata.data(), filedata.size());
|
||||
file.close();
|
||||
qDebug() << "File" << path << "written, size:" << filedata.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool YamlFormat::load(RadioData & radioData)
|
||||
{
|
||||
QByteArray radioSettingsBuffer;
|
||||
if (!loadFile(radioSettingsBuffer, "RADIO/radio.yml")) {
|
||||
setError(tr("Can't extract RADIO/radio.yml"));
|
||||
return false;
|
||||
}
|
||||
|
||||
qDebug() << "Warning: format ignored - under development";
|
||||
return false; // force failure until fully developed
|
||||
}
|
||||
|
||||
bool YamlFormat::write(const RadioData & radioData)
|
||||
{
|
||||
/* Need this test in case of a new sdcard
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (!HAS_EEPROM_YAML(board)) {
|
||||
qDebug() << "Board does not support YAML format";
|
||||
return false;
|
||||
}
|
||||
|
||||
// ensure directories exist on sd card
|
||||
QDir dir(filename);
|
||||
dir.mkdir("RADIO");
|
||||
dir.mkdir("MODELS");
|
||||
*/
|
||||
|
||||
qDebug() << "Warning: format ignored - under development";
|
||||
return false; // force failure until fully developed
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "storage.h"
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
class YamlFormat : public StorageFormat
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(YamlFormat)
|
||||
|
||||
public:
|
||||
YamlFormat(const QString & filename):
|
||||
StorageFormat(filename)
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString name() { return "yml"; }
|
||||
virtual bool load(RadioData & radioData);
|
||||
virtual bool write(const RadioData & radioData);
|
||||
|
||||
protected:
|
||||
bool loadFile(QByteArray & fileData, const QString & fileName);
|
||||
bool writeFile(const QByteArray & fileData, const QString & fileName);
|
||||
};
|
||||
Reference in New Issue
Block a user