mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 00:35:14 +03:00
Merge pull request #703 from opentx/bsongis/standalone_simu
Bsongis/standalone simu
This commit is contained in:
commit
de3e0e802f
55 changed files with 4189 additions and 9554 deletions
|
@ -37,6 +37,47 @@ void getEEPROMString(char *dst, const char *src, int size)
|
|||
}
|
||||
}
|
||||
|
||||
float ValToTim(int value)
|
||||
{
|
||||
return ((value < -109 ? 129+value : (value < 7 ? (113+value)*5 : (53+value)*10))/10.0);
|
||||
}
|
||||
|
||||
int TimToVal(float value)
|
||||
{
|
||||
int temp;
|
||||
if (value>60) {
|
||||
temp=136+round((value-60));
|
||||
}
|
||||
else if (value>2) {
|
||||
temp=20+round((value-2.0)*2.0);
|
||||
}
|
||||
else {
|
||||
temp=round(value*10.0);
|
||||
}
|
||||
return (temp-129);
|
||||
}
|
||||
|
||||
QString getSignedStr(int value)
|
||||
{
|
||||
return value > 0 ? QString("+%1").arg(value) : QString("%1").arg(value);
|
||||
}
|
||||
|
||||
QString getGVarString(int16_t val, bool sign)
|
||||
{
|
||||
if (val >= -10000 && val <= 10000) {
|
||||
if (sign)
|
||||
return QString("%1%").arg(getSignedStr(val));
|
||||
else
|
||||
return QString("%1%").arg(val);
|
||||
}
|
||||
else {
|
||||
if (val<0)
|
||||
return QObject::tr("-GV%1").arg(-val-10000);
|
||||
else
|
||||
return QObject::tr("GV%1").arg(val-10000);
|
||||
}
|
||||
}
|
||||
|
||||
RawSourceRange RawSource::getRange(bool singleprec)
|
||||
{
|
||||
RawSourceRange result;
|
||||
|
@ -992,13 +1033,13 @@ void RegisterEepromInterfaces()
|
|||
{
|
||||
QSettings settings;
|
||||
int rev4a = settings.value("rev4asupport",0).toInt();
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_M128));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_GRUVIN9X));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_SKY9X));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_M128));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_GRUVIN9X));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_SKY9X));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_TARANIS));
|
||||
if (rev4a)
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS_REV4a));
|
||||
eepromInterfaces.push_back(new OpenTxInterface(BOARD_TARANIS_REV4a));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
|
||||
eepromInterfaces.push_back(new Ersky9xInterface());
|
||||
|
@ -1010,26 +1051,11 @@ QList<FirmwareInfo *> firmwares;
|
|||
FirmwareVariant default_firmware_variant;
|
||||
FirmwareVariant current_firmware_variant;
|
||||
|
||||
const char * ER9X_STAMP = "http://er9x.googlecode.com/svn/trunk/src/stamp-er9x.h";
|
||||
const char * ERSKY9X_STAMP = "http://ersky9x.googlecode.com/svn/trunk/src/stamp-ersky9x.h";
|
||||
|
||||
void RegisterFirmwares()
|
||||
{
|
||||
firmwares.push_back(new FirmwareInfo("th9x", QObject::tr("th9x"), new Th9xInterface(), "http://th9x.googlecode.com/svn/trunk/%1.bin", "http://th9x.googlecode.com/svn/trunk/src/stamp-th9x.h"));
|
||||
|
||||
firmwares.push_back(new FirmwareInfo("er9x", QObject::tr("er9x"), new Er9xInterface(), "http://er9x.googlecode.com/svn/trunk/%1.hex", ER9X_STAMP));
|
||||
FirmwareInfo * er9x = firmwares.last();
|
||||
|
||||
Option er9x_options[] = { { "noht", "", 0 }, { "frsky", "", 0 }, { "frsky-noht", "", 0 }, { "jeti", "", 0 }, { "ardupilot", "", 0 }, { "nmea", "", 0 }, { NULL } };
|
||||
er9x->addOptions(er9x_options);
|
||||
er9x->addOption("noht");
|
||||
|
||||
RegisterOpen9xFirmwares();
|
||||
#ifndef __APPLE__
|
||||
firmwares.push_back(new FirmwareInfo("ersky9x", QObject::tr("ersky9x"), new Ersky9xInterface(), "http://ersky9x.googlecode.com/svn/trunk/ersky9x_rom.bin", ERSKY9X_STAMP));
|
||||
#endif
|
||||
default_firmware_variant = GetFirmwareVariant("opentx-9x-heli-templates-en");
|
||||
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
RegisterEepromInterfaces();
|
||||
}
|
||||
|
||||
|
@ -1070,7 +1096,6 @@ FirmwareVariant GetFirmwareVariant(QString id)
|
|||
FirmwareVariant result;
|
||||
|
||||
foreach(FirmwareInfo * firmware, firmwares) {
|
||||
|
||||
if (id.contains(firmware->id+"-") || (!id.contains("-") && id.contains(firmware->id))) {
|
||||
result.id = id;
|
||||
result.firmware = firmware;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue