diff --git a/DONATIONS.txt b/DONATIONS.txt index f3bf27e41..c85c6de97 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -325,3 +325,5 @@ Reginald H Millsom Emanuel Stassar Pierluigi Sommaruga Rafael Eric Suarez Nordlow +A Harris +Stefan Grunenberg diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 8efcf0ab4..5ac12bd16 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -96,102 +96,103 @@ include_directories( add_subdirectory(modeledit) add_subdirectory(simulation) -SET( companion_SRCS - eeprominterface.cpp - hexinterface.cpp - flashinterface.cpp - file.cpp - xmlinterface.cpp - ${PROJECT_BINARY_DIR}/radio.cxx - firmwares/th9x/th9xeeprom.cpp - firmwares/th9x/th9xinterface.cpp - firmwares/er9x/er9xeeprom.cpp - firmwares/er9x/er9xinterface.cpp - firmwares/gruvin9x/gruvin9xeeprom.cpp - firmwares/gruvin9x/gruvin9xinterface.cpp - firmwares/opentx/opentxeeprom.cpp - firmwares/opentx/open9xStockeeprom.cpp - firmwares/opentx/open9xGruvin9xeeprom.cpp - firmwares/opentx/open9xSky9xeeprom.cpp - firmwares/opentx/opentxinterface.cpp - firmwares/opentx/opentxTaranisSimulator.cpp - firmwares/opentx/opentxSky9xsimulator.cpp - firmwares/opentx/opentxGruvin9xsimulator.cpp - firmwares/opentx/opentxM128simulator.cpp - firmwares/opentx/opentxsimulator.cpp - firmwares/ersky9x/ersky9xeeprom.cpp - firmwares/ersky9x/ersky9xinterface.cpp - ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm - helpers.cpp - mdichild.cpp - generaledit.cpp - modelslist.cpp - mountlist.cpp - avroutputdialog.cpp - apppreferencesdialog.cpp - fwpreferencesdialog.cpp - burnconfigdialog.cpp - comparedialog.cpp - contributorsdialog.cpp - customizesplashdialog.cpp - burndialog.cpp - printdialog.cpp - fusesdialog.cpp - logsdialog.cpp - downloaddialog.cpp - splashlibrary.cpp - mainwindow.cpp - main.cpp - modelconfigdialog.cpp - qcustomplot.cpp +set(companion_SRCS + eeprominterface.cpp + hexinterface.cpp + flashinterface.cpp + file.cpp + xmlinterface.cpp + ${PROJECT_BINARY_DIR}/radio.cxx + firmwares/th9x/th9xeeprom.cpp + firmwares/th9x/th9xinterface.cpp + firmwares/er9x/er9xeeprom.cpp + firmwares/er9x/er9xinterface.cpp + firmwares/gruvin9x/gruvin9xeeprom.cpp + firmwares/gruvin9x/gruvin9xinterface.cpp + firmwares/opentx/opentxeeprom.cpp + firmwares/opentx/open9xStockeeprom.cpp + firmwares/opentx/open9xGruvin9xeeprom.cpp + firmwares/opentx/open9xSky9xeeprom.cpp + firmwares/opentx/opentxinterface.cpp + firmwares/opentx/opentxTaranisSimulator.cpp + firmwares/opentx/opentxSky9xsimulator.cpp + firmwares/opentx/opentxGruvin9xsimulator.cpp + firmwares/opentx/opentxM128simulator.cpp + firmwares/opentx/opentxsimulator.cpp + firmwares/ersky9x/ersky9xeeprom.cpp + firmwares/ersky9x/ersky9xinterface.cpp + ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm + appdata.cpp + helpers.cpp + mdichild.cpp + generaledit.cpp + modelslist.cpp + mountlist.cpp + avroutputdialog.cpp + apppreferencesdialog.cpp + fwpreferencesdialog.cpp + burnconfigdialog.cpp + comparedialog.cpp + contributorsdialog.cpp + customizesplashdialog.cpp + burndialog.cpp + printdialog.cpp + fusesdialog.cpp + logsdialog.cpp + downloaddialog.cpp + splashlibrary.cpp + mainwindow.cpp + companion.cpp + modelconfigdialog.cpp + qcustomplot.cpp ) -SET( companion_MOC_HDRS - avroutputdialog.h - apppreferencesdialog.h - fwpreferencesdialog.h - burnconfigdialog.h - comparedialog.h - printdialog.h - fusesdialog.h - logsdialog.h - contributorsdialog.h - customizesplashdialog.h - splashlibrary.h - splashlabel.h - burndialog.h - downloaddialog.h - generaledit.h - modelslist.h - mdichild.h - mainwindow.h - modelconfigdialog.h - qcustomplot.h - helpers.h +set(companion_MOC_HDRS + avroutputdialog.h + apppreferencesdialog.h + fwpreferencesdialog.h + burnconfigdialog.h + comparedialog.h + printdialog.h + fusesdialog.h + logsdialog.h + contributorsdialog.h + customizesplashdialog.h + splashlibrary.h + splashlabel.h + burndialog.h + downloaddialog.h + generaledit.h + modelslist.h + mdichild.h + mainwindow.h + modelconfigdialog.h + qcustomplot.h + helpers.h ) -SET( companion_UIS - mdichild.ui - avroutputdialog.ui - comparedialog.ui - fusesdialog.ui - logsdialog.ui - apppreferencesdialog.ui - fwpreferencesdialog.ui - burnconfigdialog.ui - downloaddialog.ui - generaledit.ui - printdialog.ui - contributorsdialog.ui - customizesplashdialog.ui - splashlibrary.ui - burndialog.ui - modelconfigdialog.ui +set(companion_UIS + mdichild.ui + avroutputdialog.ui + comparedialog.ui + fusesdialog.ui + logsdialog.ui + apppreferencesdialog.ui + fwpreferencesdialog.ui + burnconfigdialog.ui + downloaddialog.ui + generaledit.ui + printdialog.ui + contributorsdialog.ui + customizesplashdialog.ui + splashlibrary.ui + burndialog.ui + modelconfigdialog.ui ) -SET( companion_RCS - companion.qrc - ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc +set(companion_RCS + companion.qrc + ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc ) MACRO (TODAY RESULT) @@ -315,7 +316,8 @@ set(simu_SRCS file.cpp # TODO not needed modeledit/node.cpp modeledit/edge.cpp # TODO not needed - simulation/main.cpp + appdata.cpp + simulator.cpp ) set(simu_HDRS diff --git a/companion/src/appdata.cpp b/companion/src/appdata.cpp new file mode 100644 index 000000000..ec634da4d --- /dev/null +++ b/companion/src/appdata.cpp @@ -0,0 +1,678 @@ +// Companion Application Data Class Definition. +// Author Kjell Kernen + +#include "appdata.h" + +// Global data and storage object +AppData g; + +// ** CompStoreObj class******************** +void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3) +{ + QSettings settings(PRODUCT, COMPANY); + if (tag2.isEmpty()) + { + settings.remove(tag1); + } + else if (tag3.isEmpty()) + { + settings.beginGroup(tag1); + settings.remove(tag2); + settings.endGroup(); + } + else + { + settings.beginGroup(tag1); + settings.beginGroup(tag2); + settings.remove(tag3); + settings.endGroup(); + settings.endGroup(); + } +} + +void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + settings.setValue(tag, newArray); + array = newArray; + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + settings.setValue(tag, newSList); + stringList = newSList; + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + settings.setValue(tag, newString); + string = newString; + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + settings.setValue(tag, newTruth); + truth = newTruth; + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + settings.setValue(tag, newNumber); + number = newNumber; + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +// Retrieval functions +void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + array = settings.value(tag, def).toByteArray(); + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + stringList = settings.value(tag, def).toStringList(); + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + string = settings.value(tag, def).toString(); + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + truth = settings.value(tag, def).toBool(); + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 ) +{ + QSettings settings(PRODUCT, COMPANY); + if (!group1.isEmpty()) settings.beginGroup(group1); + if (!group2.isEmpty()) settings.beginGroup(group2); + + number = settings.value(tag, def).toInt(); + + if (!group1.isEmpty()) settings.endGroup(); + if (!group2.isEmpty()) settings.endGroup(); +} + +// Retrieve and Store functions +void CompStoreObj::getset( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + retrieve( array, tag, def, group1, group2); + store(array, array, tag, group1, group2); +} + +void CompStoreObj::getset( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + retrieve( stringList, tag, def, group1, group2); + store(stringList, stringList, tag, group1, group2); +} + +void CompStoreObj::getset( QString &string, const QString tag, const QString def, const QString group1, const QString group2 ) +{ + retrieve( string, tag, def, group1, group2); + store(string, string, tag, group1, group2); +} + +void CompStoreObj::getset( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 ) +{ + retrieve( truth, tag, def, group1, group2); + store(truth, truth, tag, group1, group2); +} + +void CompStoreObj::getset( int &number, const QString tag, const int def, const QString group1, const QString group2 ) +{ + retrieve( number, tag, def, group1, group2); + store(number, number, tag, group1, group2); +} + +// ** FwRevision class******************** +int FwRevision::get( const QString fwType ) +{ + QString result; + retrieve( result, fwType, "", "FwRevisions" ); + return result.toInt(); +} + +void FwRevision::set( const QString fwType, const int fwRevision ) +{ + QString tempString= QString("%1").arg(fwRevision); + store( tempString, tempString, fwType, "FwRevisions" ); +} + +void FwRevision::remove( const QString tag ) +{ + clear( "FwRevisions", tag ); +} + +// ** JStickData class******************** +// Get declarations +int JStickData::stick_axe() { return _stickAxe; } +int JStickData::stick_min() { return _stickMin; } +int JStickData::stick_med() { return _stickMed; } +int JStickData::stick_max() { return _stickMax; } +int JStickData::stick_inv() { return _stickInv; } + +// Set declarations +void JStickData::stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );} +void JStickData::stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );} +void JStickData::stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );} +void JStickData::stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );} +void JStickData::stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );} + +// Constructor +JStickData::JStickData() +{ + index = -1; +} + +void JStickData::remove() +{ + // Remove all JStickData values from settings file + QSettings settings(PRODUCT, COMPANY); + settings.beginGroup( "JsCalibration" ); + settings.remove( QString( "stick%1_axe").arg(index) ); + settings.remove( QString( "stick%1_min").arg(index) ); + settings.remove( QString( "stick%1_med").arg(index) ); + settings.remove( QString( "stick%1_max").arg(index) ); + settings.remove( QString( "stick%1_inv").arg(index) ); + settings.endGroup(); + + // Reset all JStickData variables to initial values + init(index); +} + +bool JStickData::existsOnDisk() +{ + QSettings settings(PRODUCT, COMPANY); + settings.beginGroup("JsCalibration"); + int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt(); + settings.endGroup(); + + return (axe > -1); +} + +void JStickData::init(int newIndex) +{ + index = newIndex; + _stickAxe = -1; + _stickMin = -32767; + _stickMed = 0; + _stickMax = 0; + _stickInv = 0; + + // Do not write empty joystick calibrations to disk. + if ( !existsOnDisk() ) + return; + + flush(); +} + +void JStickData::flush() +{ + getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" ); + getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" ); + getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" ); + getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" ); + getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" ); +} + +// ** Profile class******************** +// Get declarations +QString Profile::fwName() const { return _fwName; } +QString Profile::fwType() const { return _fwType; } +QString Profile::name() const { return _name; } +QString Profile::sdPath() const { return _sdPath; } +QString Profile::splashFile() const { return _splashFile; } +bool Profile::burnFirmware() const { return _burnFirmware; } +bool Profile::renameFwFiles() const { return _renameFwFiles; } +int Profile::channelOrder() const { return _channelOrder; } +int Profile::defaultMode() const { return _defaultMode; } + +QString Profile::beeper() const { return _beeper; } +QString Profile::countryCode() const { return _countryCode; } +QString Profile::display() const { return _display; } +QString Profile::haptic() const { return _haptic; } +QString Profile::speaker() const { return _speaker; } +QString Profile::stickPotCalib() const { return _stickPotCalib; } +QString Profile::trainerCalib() const { return _trainerCalib; } +int Profile::currentCalib() const { return _currentCalib; } +int Profile::gsStickMode() const { return _gsStickMode; } +int Profile::ppmMultiplier() const { return _ppmMultiplier; } +int Profile::vBatCalib() const { return _vBatCalib; } +int Profile::vBatWarn() const { return _vBatWarn; } + +// Set declarations +void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));} +void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));} +void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));} +void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));} +void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));} +void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));} +void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));} +void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));} +void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));} + +void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));} +void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));} +void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));} +void Profile::haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));} +void Profile::speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));} +void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));} +void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));} +void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));} +void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));} +void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));} +void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));} +void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));} + +// Constructor +Profile::Profile() +{ + index = -1; +} + +// The default copy operator can not be used since the index variable would be destroyed +Profile& Profile::operator=(const Profile& rhs) +{ + name ( rhs.name() ); + fwName ( rhs.fwName() ); + fwType ( rhs.fwType() ); + sdPath ( rhs.sdPath() ); + splashFile ( rhs.splashFile() ); + burnFirmware ( rhs.burnFirmware() ); + renameFwFiles( rhs.renameFwFiles() ); + channelOrder ( rhs.channelOrder() ); + defaultMode ( rhs.defaultMode() ); + beeper ( rhs.beeper() ); + countryCode ( rhs.countryCode() ); + display ( rhs.display() ); + haptic ( rhs.haptic() ); + speaker ( rhs.speaker() ); + stickPotCalib( rhs.stickPotCalib() ); + trainerCalib ( rhs.trainerCalib() ); + currentCalib ( rhs.currentCalib() ); + gsStickMode ( rhs.gsStickMode() ); + ppmMultiplier( rhs.ppmMultiplier() ); + vBatCalib ( rhs.vBatCalib() ); + vBatWarn ( rhs.vBatWarn() ); + + return *this; +} + +void Profile::remove() +{ + // Remove all profile values from settings file + QSettings settings(PRODUCT, COMPANY); + settings.beginGroup("Profiles"); + settings.remove(QString("profile%1").arg(index)); + settings.endGroup(); + + // Reset all profile variables to initial values + init(index); +} + +bool Profile::existsOnDisk() +{ + QSettings settings(PRODUCT, COMPANY); + settings.beginGroup("Profiles"); + settings.beginGroup(QString("profile%1").arg(index)); + QStringList keyList = settings.allKeys(); + settings.endGroup(); + settings.endGroup(); + + return (keyList.length() > 0); +} + +void Profile::init(int newIndex) +{ + index = newIndex; + + _fwName = ""; + _fwType = ""; + _name = ""; + _sdPath = ""; + _splashFile = ""; + _burnFirmware = false; + _renameFwFiles = false; + _channelOrder = 0; + _defaultMode = 1; + + _beeper = ""; + _countryCode = ""; + _display = ""; + _haptic = ""; + _speaker = ""; + _stickPotCalib = ""; + _trainerCalib = ""; + + _currentCalib = 0; + _gsStickMode = 0; + _ppmMultiplier = 0; + _vBatCalib = 0; + _vBatWarn = 0; + + // Do not write empty profiles to disk except the default (0) profile. + if ( index > 0 && !existsOnDisk()) + return; + + flush(); +} + +void Profile::flush() +{ + // Load and store all variables. Use default values if setting values are missing + getset( _fwName, "fwName" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index)); + getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index)); + getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index)); + getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index)); + + getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index)); + getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index)); + getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index)); + getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index)); + getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index)); + getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index)); +} + + +// ** AppData class******************** + +// Get declarations +QStringList AppData::recentFiles() { return _recentFiles; } +QByteArray AppData::mainWinGeo() { return _mainWinGeo; } +QByteArray AppData::mainWinState() { return _mainWinState; } +QByteArray AppData::modelEditGeo() { return _modelEditGeo; } + +QString AppData::armMcu() { return _armMcu; } +QString AppData::avrArguments() { return _avrArguments; } +QString AppData::avrPort() { return _avrPort; } +QString AppData::avrdudeLocation() { return _avrdudeLocation; } +QString AppData::compileServer() { return _compileServer; } +QString AppData::cpuId() { return _cpuId; } +QString AppData::dfuArguments() { return _dfuArguments; } +QString AppData::dfuLocation() { return _dfuLocation; } +QString AppData::locale() { return _locale; } +QString AppData::mcu() { return _mcu; } +QString AppData::programmer() { return _programmer; } +QString AppData::sambaLocation() { return _sambaLocation; } +QString AppData::sambaPort() { return _sambaPort; } + +QString AppData::backupDir() { return _backupDir; } +QString AppData::gePath() { return _gePath; } +QString AppData::eepromDir() { return _eepromDir; } +QString AppData::flashDir() { return _flashDir; } +QString AppData::imagesDir() { return _imagesDir; } +QString AppData::logDir() { return _logDir; } +QString AppData::libDir() { return _libDir; } +QString AppData::snapshotDir() { return _snapshotDir; } +QString AppData::updatesDir() { return _updatesDir; } + +bool AppData::enableBackup() { return _enableBackup; } +bool AppData::backupOnFlash() { return _backupOnFlash; } +bool AppData::jsSupport() { return _jsSupport; } +bool AppData::rev4aSupport() { return _rev4aSupport; } +bool AppData::maximized() { return _maximized; } +bool AppData::showSplash() { return _showSplash; } +bool AppData::snapToClpbrd() { return _snapToClpbrd; } +bool AppData::autoCheckApp() { return _autoCheckApp; } +bool AppData::autoCheckFw() { return _autoCheckFw; } +bool AppData::simuSW() { return _simuSW; } +bool AppData::enableWizard() { return _enableWizard; } + +int AppData::backLight() { return _backLight; } +int AppData::embedSplashes() { return _embedSplashes; } +int AppData::fwServerFails() { return _fwServerFails; } +int AppData::generalEditTab() { return _generalEditTab; } +int AppData::iconSize() { return _iconSize; } +int AppData::historySize() { return _historySize; } +int AppData::jsCtrl() { return _jsCtrl; } +int AppData::modelEditTab() { return _modelEditTab; } +int AppData::id() { return _id; } +int AppData::theme() { return _theme; } +int AppData::warningId() { return _warningId; } + +// Set declarations +void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );} +void AppData::mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );} +void AppData::mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );} +void AppData::modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );} + +void AppData::armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );} +void AppData::avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );} +void AppData::avrPort (const QString x) { store(x, _avrPort, "avr_port" );} +void AppData::avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );} +void AppData::compileServer (const QString x) { store(x, _compileServer, "compilation-server" );} +void AppData::cpuId (const QString x) { store(x, _cpuId, "cpu_id" );} +void AppData::dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );} +void AppData::dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );} +void AppData::locale (const QString x) { store(x, _locale, "locale" );} +void AppData::mcu (const QString x) { store(x, _mcu, "mcu" );} +void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );} +void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );} +void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );} + +void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );} +void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );} +void AppData::eepromDir (const QString x) { store(x, _eepromDir, "lastDir" );} +void AppData::flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );} +void AppData::imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );} +void AppData::logDir (const QString x) { store(x, _logDir, "lastLogDir" );} +void AppData::libDir (const QString x) { store(x, _libDir, "libraryPath" );} +void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );} +void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );} + +void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );} +void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );} +void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );} +void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );} +void AppData::rev4aSupport (const bool x) { store(x, _rev4aSupport, "rev4asupport" );} +void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );} +void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );} +void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );} +void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );} +void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );} +void AppData::enableWizard (const bool x) { store(x, _enableWizard, "wizardEnable" );} + +void AppData::backLight (const int x) { store(x, _backLight, "backLight" );} +void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );} +void AppData::fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );} +void AppData::generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );} +void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );} +void AppData::historySize (const int x) { store(x, _historySize, "history_size" );} +void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );} +void AppData::modelEditTab (const int x) { store(x, _modelEditTab, "modelEditTab" );} +void AppData::id (const int x) { store(x, _id, "profileId" );} +void AppData::theme (const int x) { store(x, _theme, "theme" );} +void AppData::warningId (const int x) { store(x, _warningId, "warningId" );} + +// Constructor +AppData::AppData() +{ + //Initialize the profiles + for (int i=0; i +#include +#include +#include + +#define COMPANY "OpenTX Companion" +#define PRODUCT "OpenTX" + +#define MAX_PROFILES 15 +#define MAX_JOYSTICKS 8 + +class CompStoreObj +{ + public: + void clear (const QString tag1="", const QString tag2="", const QString tag3=""); + void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" ); + void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" ); + void store(const QString newString, QString &string, const QString tag, const QString group1="", const QString group2="" ); + void store(const bool newTruth, bool &truth, const QString tag, const QString group1="", const QString group2="" ); + void store(const int newNumber, int &number, const QString tag, const QString group1="", const QString group2="" ); + + // Retrieval functions + void retrieve( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void retrieve( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void retrieve( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" ); + void retrieve( int &number, const QString tag, const int def, const QString group1="", const QString group2="" ); + + // Retrieve and Store functions + void getset( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void getset( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" ); + void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" ); + void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" ); +}; + +class FwRevision: protected CompStoreObj +{ + public: + int get( const QString); + void set( const QString, const int ); + void remove( const QString ); +}; + +class JStickData: protected CompStoreObj +{ + private: + int index; + + int _stickAxe; + int _stickMin; + int _stickMed; + int _stickMax; + int _stickInv; + + public: + // All the get definitions + int stick_axe(); + int stick_min(); + int stick_med(); + int stick_max(); + int stick_inv(); + + // All the set definitions + void stick_axe(const int); + void stick_min(const int); + void stick_med(const int); + void stick_max(const int); + void stick_inv(const int); + + JStickData(); + void remove(); + bool existsOnDisk(); + void init(int index); + void flush(); +}; + +class Profile: protected CompStoreObj +{ + private: + // Class Internal Variable + int index; + + // Application Variables + QString _fwName; + QString _fwType; + QString _name; + QString _sdPath; + QString _splashFile; + bool _burnFirmware; + bool _renameFwFiles; + int _channelOrder; + int _defaultMode; + + // Firmware Variables + QString _beeper; + QString _countryCode; + QString _display; + QString _haptic; + QString _speaker; + QString _stickPotCalib; + QString _trainerCalib; + int _currentCalib; + int _gsStickMode; + int _ppmMultiplier; + int _vBatCalib; + int _vBatWarn; + + public: + // All the get definitions + QString fwName() const; + QString fwType() const; + QString name() const; + QString sdPath() const; + QString splashFile() const; + bool burnFirmware() const; + bool renameFwFiles() const; + int channelOrder() const; + int defaultMode() const; + + QString beeper() const; + QString countryCode() const; + QString display() const; + QString haptic() const; + QString speaker() const; + QString stickPotCalib() const; + QString trainerCalib() const; + int currentCalib() const; + int gsStickMode() const; + int ppmMultiplier() const; + int vBatCalib() const; + int vBatWarn() const; + + // All the set definitions + void name (const QString); + void fwName (const QString); + void fwType (const QString); + void sdPath (const QString); + void splashFile (const QString); + void burnFirmware (const bool); + void renameFwFiles (const bool); + void channelOrder (const int); + void defaultMode (const int); + + void beeper (const QString); + void countryCode (const QString); + void display (const QString); + void haptic (const QString); + void speaker (const QString); + void stickPotCalib (const QString); + void trainerCalib (const QString); + void currentCalib (const int); + void gsStickMode (const int); + void ppmMultiplier (const int); + void vBatCalib (const int); + void vBatWarn (const int); + + Profile(); + Profile& operator=(const Profile&); + void remove(); + bool existsOnDisk(); + void init(int newIndex); + void flush(); +}; + +class AppData: protected CompStoreObj +{ + // All the global variables + public: + Profile profile[MAX_PROFILES]; + JStickData joystick[MAX_JOYSTICKS]; + FwRevision fwRev; + + private: + QStringList _recentFiles; + QByteArray _mainWinGeo; + QByteArray _mainWinState; + QByteArray _modelEditGeo; + + QString _armMcu; + QString _avrArguments; + QString _avrPort; + QString _avrdudeLocation; + QString _compileServer; + QString _cpuId; + QString _dfuArguments; + QString _dfuLocation; + QString _locale; + QString _mcu; + QString _programmer; + QString _sambaLocation; + QString _sambaPort; + + QString _backupDir; + QString _gePath; + QString _eepromDir; + QString _flashDir; + QString _imagesDir; + QString _logDir; + QString _libDir; + QString _snapshotDir; + QString _updatesDir; + + bool _enableBackup; + bool _backupOnFlash; + bool _maximized; + bool _jsSupport; + bool _rev4aSupport; + bool _showSplash; + bool _snapToClpbrd; + bool _autoCheckApp; + bool _autoCheckFw; + bool _simuSW; + bool _enableWizard; + + int _backLight; + int _embedSplashes; + int _fwServerFails; + int _generalEditTab; + int _iconSize; + int _jsCtrl; + int _historySize; + int _modelEditTab; + int _id; + int _theme; + int _warningId; + + public: + // All the get definitions + QStringList recentFiles(); + QByteArray mainWinGeo(); + QByteArray mainWinState(); + QByteArray modelEditGeo(); + + QString armMcu(); + QString avrArguments(); + QString avrPort(); + QString avrdudeLocation(); + QString compileServer(); + QString cpuId(); + QString dfuArguments(); + QString dfuLocation(); + QString lastFw(); + QString locale(); + QString mcu(); + QString programmer(); + QString sambaLocation(); + QString sambaPort(); + + QString backupDir(); + QString gePath(); + QString eepromDir(); + QString flashDir(); + QString imagesDir(); + QString logDir(); + QString libDir(); + QString snapshotDir(); + QString updatesDir(); + + bool enableBackup(); + bool backupOnFlash(); + bool jsSupport(); + bool rev4aSupport(); + bool maximized(); + bool showSplash(); + bool snapToClpbrd(); + bool autoCheckApp(); + bool autoCheckFw(); + bool simuSW(); + bool enableWizard(); + + int backLight(); + int embedSplashes(); + int fwServerFails(); + int generalEditTab(); + int iconSize(); + int historySize(); + int jsCtrl(); + int modelEditTab(); // This variable is unused an can be removed + int id(); + int theme(); + int warningId(); + + // All the set definitions + void recentFiles (const QStringList x); + void mainWinGeo (const QByteArray); + void mainWinState (const QByteArray); + void modelEditGeo (const QByteArray); + + void armMcu (const QString); + void avrArguments (const QString); + void avrPort (const QString); + void avrdudeLocation (const QString); + void compileServer (const QString); + void cpuId (const QString); + void dfuArguments (const QString); + void dfuLocation (const QString); + void lastFw (const QString); + void locale (const QString); + void mcu (const QString); + void programmer (const QString); + void sambaLocation (const QString); + void sambaPort (const QString); + + void backupDir (const QString); + void gePath (const QString); + void eepromDir (const QString); + void flashDir (const QString); + void imagesDir (const QString); + void logDir (const QString); + void libDir (const QString); + void snapshotDir (const QString); + void updatesDir (const QString); + + void enableBackup (const bool); + void backupOnFlash (const bool); + void maximized (const bool); + void jsSupport (const bool); + void rev4aSupport (const bool); + void showSplash (const bool); + void snapToClpbrd (const bool); + void autoCheckApp (const bool); + void autoCheckFw (const bool); + void simuSW (const bool); + void enableWizard (const bool); + + void backLight (const int); + void embedSplashes (const int); + void fwServerFails (const int); + void generalEditTab (const int); + void iconSize (const int); + void historySize (const int); + void jsCtrl (const int); + void modelEditTab (const int); + void id (const int); + void theme (const int); + void warningId (const int); + + // Constructor + AppData(); +}; + +extern AppData g; + +#endif // COMPANION_APPDATA_H diff --git a/companion/src/apppreferencesdialog.cpp b/companion/src/apppreferencesdialog.cpp index cfcb0b3de..96f5268c3 100644 --- a/companion/src/apppreferencesdialog.cpp +++ b/companion/src/apppreferencesdialog.cpp @@ -1,6 +1,7 @@ #include "apppreferencesdialog.h" #include "ui_apppreferencesdialog.h" #include "mainwindow.h" +#include "appdata.h" #include "helpers.h" #include "flashinterface.h" #ifdef JOYSTICKS @@ -35,101 +36,85 @@ appPreferencesDialog::~appPreferencesDialog() void appPreferencesDialog::writeValues() { - QSettings settings; - settings.setValue("startup_check_companion", ui->startupCheck_companion9x->isChecked()); - settings.setValue("startup_check_fw", ui->startupCheck_fw->isChecked()); - settings.setValue("wizardEnable", ui->wizardEnable_ChkB->isChecked()); - settings.setValue("show_splash", ui->showSplash->isChecked()); - settings.setValue("simuSW", ui->simuSW->isChecked()); - settings.setValue("history_size", ui->historySize->value()); - settings.setValue("backLight", ui->backLightColor->currentIndex()); - settings.setValue("libraryPath", ui->libraryPath->text()); - settings.setValue("gePath", ui->ge_lineedit->text()); - settings.setValue("embedded_splashes", ui->splashincludeCB->currentIndex()); - settings.setValue("backupEnable", ui->backupEnable->isChecked()); + g.autoCheckApp(ui->startupCheck_companion9x->isChecked()); + g.autoCheckFw(ui->startupCheck_fw->isChecked()); + g.enableWizard(ui->wizardEnable_ChkB->isChecked()); + g.showSplash(ui->showSplash->isChecked()); + g.simuSW(ui->simuSW->isChecked()); + g.historySize(ui->historySize->value()); + g.backLight(ui->backLightColor->currentIndex()); + g.libDir(ui->libraryPath->text()); + g.gePath(ui->ge_lineedit->text()); + g.embedSplashes(ui->splashincludeCB->currentIndex()); + g.enableBackup(ui->backupEnable->isChecked()); if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) { - settings.setValue("js_support", ui->joystickChkB ->isChecked()); - settings.setValue("js_ctrl", ui->joystickCB ->currentIndex()); + g.jsSupport(ui->joystickChkB ->isChecked()); + g.jsCtrl(ui->joystickCB ->currentIndex()); } else { - settings.remove("js_support"); - settings.remove("js_ctrl"); + g.jsSupport(false); + g.jsCtrl(0); } - - settings.setValue("default_channel_order", ui->channelorderCB->currentIndex()); - settings.setValue("default_mode", ui->stickmodeCB->currentIndex()); - settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked()); - settings.setValue("burnFirmware", ui->burnFirmware->isChecked()); - settings.setValue("profileId", ui->profileIndexLE->text()); - settings.setValue("Name", ui->profileNameLE->text()); - settings.setValue("sdPath", ui->sdPath->text()); - settings.setValue("SplashFileName", ui->SplashFileName->text()); - if (!ui->SplashFileName->text().isEmpty()) - settings.setValue("SplashImage", ""); - settings.setValue("firmware", ui->firmwareLE->text()); + g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex()); + g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex()); + g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked()); + g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked()); + g.profile[g.id()].name(ui->profileNameLE->text()); + g.profile[g.id()].sdPath(ui->sdPath->text()); + g.profile[g.id()].splashFile(ui->SplashFileName->text()); + g.profile[g.id()].fwName(ui->fwNameLE->text()); + g.profile[g.id()].fwType(ui->fwTypeLE->text()); saveProfile(); } void appPreferencesDialog::on_snapshotPathButton_clicked() { - QSettings settings; - QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), settings.value("snapshotPath").toString()); + QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir()); if (!fileName.isEmpty()) { - settings.setValue("snapshotpath", fileName); - settings.setValue("snapshot_to_clipboard", false); + g.snapshotDir(fileName); + g.snapToClpbrd(false); ui->snapshotPath->setText(fileName); } } void appPreferencesDialog::initSettings() { - QSettings settings; - ui->snapshotClipboardCKB->setChecked(settings.value("snapshot_to_clipboard", false).toBool()); - ui->burnFirmware->setChecked(settings.value("burnFirmware", true).toBool()); - - QString Path=settings.value("snapshotPath", "").toString(); - if (QDir(Path).exists()) { - ui->snapshotPath->setText(Path); - ui->snapshotPath->setReadOnly(true); - } - if (ui->snapshotClipboardCKB->isChecked()) { + ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd()); + ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware()); + ui->snapshotPath->setText(g.snapshotDir()); + ui->snapshotPath->setReadOnly(true); + if (ui->snapshotClipboardCKB->isChecked()) + { ui->snapshotPath->setDisabled(true); ui->snapshotPathButton->setDisabled(true); } - ui->startupCheck_companion9x->setChecked(settings.value("startup_check_companion", true).toBool()); - ui->startupCheck_fw->setChecked(settings.value("startup_check_fw", true).toBool()); - ui->wizardEnable_ChkB->setChecked(settings.value("wizardEnable", true).toBool()); - ui->showSplash->setChecked(settings.value("show_splash", true).toBool()); - ui->historySize->setValue(settings.value("history_size", 10).toInt()); - ui->backLightColor->setCurrentIndex(settings.value("backLight", 0).toInt()); - ui->simuSW->setChecked(settings.value("simuSW", false).toBool()); + ui->startupCheck_companion9x->setChecked(g.autoCheckApp()); + ui->startupCheck_fw->setChecked(g.autoCheckFw()); + ui->wizardEnable_ChkB->setChecked(g.enableWizard()); + ui->showSplash->setChecked(g.showSplash()); + ui->historySize->setValue(g.historySize()); + ui->backLightColor->setCurrentIndex(g.backLight()); + ui->simuSW->setChecked(g.simuSW()); + ui->libraryPath->setText(g.libDir()); + ui->ge_lineedit->setText(g.gePath()); - Path=settings.value("libraryPath", "").toString(); - if (QDir(Path).exists()) { - ui->libraryPath->setText(Path); - } - Path=settings.value("gePath", "").toString(); - if (QFile(Path).exists()) { - ui->ge_lineedit->setText(Path); - } - Path=settings.value("backupPath", "").toString(); - if (!Path.isEmpty()) { - if (QDir(Path).exists()) { - ui->backupPath->setText(Path); + if (!g.backupDir().isEmpty()) { + if (QDir(g.backupDir()).exists()) { + ui->backupPath->setText(g.backupDir()); ui->backupEnable->setEnabled(true); - ui->backupEnable->setChecked(settings.value("backupEnable", true).toBool()); + ui->backupEnable->setChecked(g.enableBackup()); } else { ui->backupEnable->setDisabled(true); } } else { ui->backupEnable->setDisabled(true); } - ui->splashincludeCB->setCurrentIndex(settings.value("embedded_splashes", 0).toInt()); + ui->splashincludeCB->setCurrentIndex(g.embedSplashes()); #ifdef JOYSTICKS - ui->joystickChkB->setChecked(settings.value("js_support", false).toBool()); + ui->joystickChkB->setChecked(g.jsSupport()); if (ui->joystickChkB->isChecked()) { QStringList joystickNames; joystickNames << tr("No joysticks found"); @@ -147,7 +132,7 @@ void appPreferencesDialog::initSettings() } ui->joystickCB->clear(); ui->joystickCB->insertItems(0, joystickNames); - ui->joystickCB->setCurrentIndex(settings.value("js_ctrl", 0).toInt()); + ui->joystickCB->setCurrentIndex(g.jsCtrl()); } else { ui->joystickCB->clear(); @@ -156,58 +141,46 @@ void appPreferencesDialog::initSettings() } #endif // Profile Tab Inits - ui->channelorderCB->setCurrentIndex(settings.value("default_channel_order", 0).toInt()); - ui->stickmodeCB->setCurrentIndex(settings.value("default_mode", 1).toInt()); - ui->renameFirmware->setChecked(settings.value("rename_firmware_files", false).toBool()); - Path=settings.value("sdPath", "").toString(); - if (QDir(Path).exists()) { - ui->sdPath->setText(Path); - } - ui->profileIndexLE->setText(settings.value("profileId", "").toString()); - ui->profileNameLE->setText(settings.value("Name", "").toString()); + ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder()); + ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode()); + ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles()); + ui->sdPath->setText(g.profile[g.id()].sdPath()); + ui->profileNameLE->setText(g.profile[g.id()].name()); + ui->fwNameLE->setText(g.profile[g.id()].fwName()); + ui->fwTypeLE->setText(g.profile[g.id()].fwType()); + ui->SplashFileName->setText(g.profile[g.id()].splashFile()); - QString fileName=settings.value("SplashFileName","").toString(); - if (!fileName.isEmpty()) { - QFile file(fileName); - if (file.exists()){ - ui->SplashFileName->setText(fileName); - displayImage( fileName ); - } - } - ui->firmwareLE->setText(settings.value("firmware","").toString()); + displayImage( g.profile[g.id()].splashFile() ); } void appPreferencesDialog::on_libraryPathButton_clicked() { - QSettings settings; - QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), settings.value("libraryPath").toString()); + QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir()); if (!fileName.isEmpty()) { - settings.setValue("libraryPath", fileName); + g.libDir(fileName); ui->libraryPath->setText(fileName); } } void appPreferencesDialog::on_snapshotClipboardCKB_clicked() { - QSettings settings; if (ui->snapshotClipboardCKB->isChecked()) { ui->snapshotPath->setDisabled(true); ui->snapshotPathButton->setDisabled(true); - settings.setValue("snapshot_to_clipboard", true); + g.snapToClpbrd(true); } else { ui->snapshotPath->setEnabled(true); ui->snapshotPath->setReadOnly(true); ui->snapshotPathButton->setEnabled(true); - settings.setValue("snapshot_to_clipboard", false); + g.snapToClpbrd(false); } } void appPreferencesDialog::on_backupPathButton_clicked() { - QSettings settings; - QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), settings.value("backupPath").toString()); + QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir()); if (!fileName.isEmpty()) { - settings.setValue("backupPath", fileName); + g.backupDir(fileName); ui->backupPath->setText(fileName); } ui->backupEnable->setEnabled(true); @@ -215,7 +188,6 @@ void appPreferencesDialog::on_backupPathButton_clicked() void appPreferencesDialog::on_ge_pathButton_clicked() { - QSettings settings; QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text()); if (!fileName.isEmpty()) { ui->ge_lineedit->setText(fileName); @@ -259,8 +231,7 @@ void appPreferencesDialog::on_joystickcalButton_clicked() { void appPreferencesDialog::on_sdPathButton_clicked() { - QSettings settings; - QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), settings.value("sdPath").toString()); + QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath()); if (!fileName.isEmpty()) { ui->sdPath->setText(fileName); } @@ -268,118 +239,49 @@ void appPreferencesDialog::on_sdPathButton_clicked() void appPreferencesDialog::saveProfile() { - QSettings settings; + // The profile name may NEVER be empty + if (ui->profileNameLE->text().isEmpty()) + ui->profileNameLE->setText("----"); - QString profile=QString("profile") + settings.value("profileId").toString(); - QString name=ui->profileNameLE->text(); - if (name.isEmpty()) { - name = profile; - ui->profileNameLE->setText(name); - } - settings.beginGroup("Profiles"); - settings.beginGroup(profile); - settings.setValue("Name",name); - settings.setValue("default_channel_order", ui->channelorderCB->currentIndex()); - settings.setValue("default_mode", ui->stickmodeCB->currentIndex()); - settings.setValue("burnFirmware", ui->burnFirmware->isChecked()); - settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked()); - settings.setValue("sdPath", ui->sdPath->text()); - settings.setValue("SplashFileName", ui->SplashFileName->text()); - settings.setValue("firmware", ui->firmwareLE->text()); - settings.endGroup(); - settings.endGroup(); -} - -void appPreferencesDialog::loadProfileString(QString profile, QString label) -{ - QSettings settings; - QString value; - - settings.beginGroup("Profiles"); - settings.beginGroup(profile); - value = settings.value(label).toString(); - settings.endGroup(); - settings.endGroup(); - - settings.setValue( label, value ); -} - -void appPreferencesDialog::loadProfile() -{ - QSettings settings; - QString profile=QString("profile") + settings.value("profileId").toString(); - - loadProfileString( profile, "Name" ); - loadProfileString( profile, "default_channel_order" ); - loadProfileString( profile, "default_mode" ); - loadProfileString( profile, "burnFirmware" ); - loadProfileString( profile, "rename_firmware_files" ); - loadProfileString( profile, "sdPath" ); - loadProfileString( profile, "SplashFileName" ); - loadProfileString( profile, "firmware" ); + g.profile[g.id()].name( ui->profileNameLE->text() ); + g.profile[g.id()].channelOrder( ui->channelorderCB->currentIndex()); + g.profile[g.id()].defaultMode( ui->stickmodeCB->currentIndex()); + g.profile[g.id()].burnFirmware( ui->burnFirmware->isChecked()); + g.profile[g.id()].renameFwFiles( ui->renameFirmware->isChecked()); + g.profile[g.id()].sdPath( ui->sdPath->text()); + g.profile[g.id()].splashFile( ui->SplashFileName->text()); + g.profile[g.id()].fwName( ui->fwNameLE->text()); + g.profile[g.id()].fwType( ui->fwTypeLE->text()); } void appPreferencesDialog::on_removeProfileButton_clicked() { - QSettings settings; - QString profileId = settings.value("profileId").toString(); - if ( profileId == "1" ) + if ( g.id() == 0 ) QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed.")); else { - QString profile=QString("profile") + profileId; - settings.beginGroup("Profiles"); - settings.remove(profile); - settings.endGroup(); - settings.setValue("profileId", "1"); - - loadProfile(); + g.profile[g.id()].remove(); + g.id( 0 ); initSettings(); } } bool appPreferencesDialog::displayImage( QString fileName ) { - QSettings settings; + // Start by clearing the pixmap + ui->imageLabel->setPixmap(QPixmap()); QImage image(fileName); if (image.isNull()) return false; -// This code below just figures out if the width of the latest firmware is 128 or 212. It works , but... - QString filePath1 = settings.value("lastFlashDir", "").toString() + "/" + settings.value("firmware", "").toString() + ".bin"; - QString filePath2 = settings.value("lastFlashDir", "").toString() + "/" + settings.value("firmware", "").toString() + ".hex"; - QFile file(filePath1); - if (!file.exists()) - filePath1 = filePath2; + // Use the firmware name to determine splash width int width = SPLASH_WIDTH; - FlashInterface flash(filePath1); - if (flash.hasSplash()) - width = flash.getSplashWidth(); // Returns SPLASHX9D_HEIGHT if filePath1 does not exist! -// There must be a cleaner way of finding out the width of the firmware splash! - - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(width, SPLASH_HEIGHT))); - if (width==SPLASHX9D_WIDTH) { - image=image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray, height = image.height(); - for (int i = 0; i < width; ++i) { - for (int j = 0; j < height; ++j) { - col = image.pixel(i, j); - gray = qGray(col); - image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - ui->imageLabel->setPixmap(QPixmap::fromImage(image)); - } - else { - ui->imageLabel->setPixmap(QPixmap::fromImage(image.convertToFormat(QImage::Format_Mono))); - } - if (width == SPLASH_WIDTH) - ui->imageLabel->setFixedSize(SPLASH_WIDTH, SPLASH_HEIGHT); - else - ui->imageLabel->setFixedSize(SPLASHX9D_WIDTH, SPLASHX9D_HEIGHT); - + if (g.profile[g.id()].fwType().contains("taranis")) + width = SPLASHX9D_WIDTH; + + ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType())); + ui->imageLabel->setFixedSize(width, SPLASH_HEIGHT); return true; } @@ -390,15 +292,14 @@ void appPreferencesDialog::on_SplashSelect_clicked() supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex]; } - QSettings settings; QString fileName = QFileDialog::getOpenFileName(this, - tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats)); + tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats)); - if (!fileName.isEmpty()) { - settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath()); - - if (displayImage(fileName)) - ui->SplashFileName->setText(fileName); + if (!fileName.isEmpty()){ + g.imagesDir(QFileInfo(fileName).dir().absolutePath()); + + displayImage(fileName); + ui->SplashFileName->setText(fileName); } } diff --git a/companion/src/apppreferencesdialog.h b/companion/src/apppreferencesdialog.h index b6f6c3896..18ce2f1e3 100644 --- a/companion/src/apppreferencesdialog.h +++ b/companion/src/apppreferencesdialog.h @@ -26,7 +26,7 @@ private: bool displayImage( QString fileName ); void saveProfile(); void loadProfileString(QString profile, QString label); - void loadProfile(); + void loadFromProfile(); private slots: void writeValues(); diff --git a/companion/src/apppreferencesdialog.ui b/companion/src/apppreferencesdialog.ui index 9a7680a42..bdaaff9d4 100644 --- a/companion/src/apppreferencesdialog.ui +++ b/companion/src/apppreferencesdialog.ui @@ -7,7 +7,7 @@ 0 0 685 - 462 + 442 @@ -26,12 +26,21 @@ Edit Settings + + 6 + + + 6 + + + 6 + + + 6 + 2 - - 6 - @@ -124,12 +133,12 @@ - Include companion splashes + Only show user splash images - Only user defined splashes + Show user and companion splash images @@ -490,10 +499,10 @@ - Radio Settings + Radio Settings Profile - + @@ -547,7 +556,7 @@ Mode 4: - + @@ -697,14 +706,7 @@ This is used by the templated to determine which channel goes to what number out - - - - Qt::Horizontal - - - - + @@ -720,11 +722,11 @@ This is used by the templated to determine which channel goes to what number out - Settings Profile + Profile Name - + Qt::Vertical @@ -737,7 +739,7 @@ This is used by the templated to determine which channel goes to what number out - + @@ -750,7 +752,7 @@ This is used by the templated to determine which channel goes to what number out - + @@ -766,14 +768,14 @@ This is used by the templated to determine which channel goes to what number out - + Append version number to FW file name - + @@ -789,7 +791,7 @@ This is used by the templated to determine which channel goes to what number out - + true @@ -800,12 +802,18 @@ This is used by the templated to determine which channel goes to what number out 0 + + + 350 + 16777215 + + true - + Qt::Horizontal @@ -818,88 +826,113 @@ This is used by the templated to determine which channel goes to what number out - + Offer to write FW to Tx after download - + Remove Profile - + Open Folder - - - - - 0 - 0 - - - - - + Qt::Horizontal - + true - 0 + 350 0 + + + 350 + 16777215 + + true - - + + + + Firmware Variant + + + + + false + + + 350 + 0 + + - 30 + 350 16777215 - - + + - Firmware + Select Image - - - - false + + + + Clear Image - + + + + + 350 + 0 + + + + + 350 + 16777215 + + + + + @@ -923,7 +956,10 @@ This is used by the templated to determine which channel goes to what number out QFrame::Panel - QFrame::Raised + QFrame::Plain + + + 1 @@ -933,17 +969,36 @@ This is used by the templated to determine which channel goes to what number out - - - - Select Image + + + + Qt::Horizontal - - + + - Clear Image + Firmware File + + + + + + + false + + + + 350 + 0 + + + + + 350 + 16777215 + diff --git a/companion/src/burnconfigdialog.cpp b/companion/src/burnconfigdialog.cpp index e0ea4a63e..a2d08fd21 100644 --- a/companion/src/burnconfigdialog.cpp +++ b/companion/src/burnconfigdialog.cpp @@ -3,6 +3,7 @@ #include "avroutputdialog.h" #include "eeprominterface.h" #include "helpers.h" +#include "appdata.h" #include #if !defined WIN32 && defined __GNUC__ @@ -83,33 +84,42 @@ burnConfigDialog::~burnConfigDialog() void burnConfigDialog::getSettings() { - QSettings settings; + avrLoc = g.avrdudeLocation(); + sambaLoc = g.sambaLocation(); + dfuLoc = g.dfuLocation(); + #if defined WIN32 || !defined __GNUC__ - avrLoc = settings.value("avrdude_location", QFileInfo("avrdude.exe").absoluteFilePath()).toString(); - sambaLoc = settings.value("samba_location", QFileInfo("sam-ba.exe").absoluteFilePath()).toString(); - dfuLoc = settings.value("dfu_location", QFileInfo("dfu-util.exe").absoluteFilePath()).toString(); + if ( avrLoc.isEmpty()) + avrLoc = QFileInfo("avrdude.exe").absoluteFilePath(); + if ( sambaLoc.isEmpty()) + sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath(); + if ( dfuLoc.isEmpty()) + dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath(); #elif defined __APPLE__ - avrLoc = settings.value("avrdude_location", "/usr/local/bin/avrdude").toString(); - sambaLoc = settings.value("samba_location", "/usr/local/bin/sam-ba").toString(); - dfuLoc = settings.value("dfu_location", QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath()).toString(); + if ( avrLoc.isEmpty()) + avrLoc = "/usr/local/bin/avrdude"; + if ( sambaLoc.isEmpty()) + sambaLoc = "/usr/local/bin/sam-ba"; + if ( dfuLoc.isEmpty()) + dfuLoc = QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath(); #else - avrLoc = settings.value("avrdude_location", "/usr/bin/avrdude").toString(); - sambaLoc = settings.value("samba_location", "/usr/bin/sam-ba").toString(); - dfuLoc = settings.value("dfu_location", QFileInfo("/usr/bin/dfu-util").absoluteFilePath()).toString(); + if ( avrLoc.isEmpty()) + avrLoc = "/usr/bin/avrdude"; + if ( sambaLoc.isEmpty()) + sambaLoc = "/usr/bin/sam-ba"; + if ( dfuLoc.isEmpty()) + dfuLoc = QFileInfo("/usr/bin/dfu-util").absoluteFilePath(); #endif - QString str = settings.value("avr_arguments").toString(); - avrArgs = str.split(" ", QString::SkipEmptyParts); - avrProgrammer = settings.value("programmer", QString("usbasp")).toString(); - avrMCU = settings.value("mcu", QString("m64")).toString(); - armMCU = settings.value("arm_mcu", QString("at91sam3s4-9x")).toString(); + dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts); + avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts); + avrProgrammer = g.programmer(); + avrPort = g.avrPort(); + avrMCU = g.mcu(); + armMCU = g.armMcu(); + sambaPort = g.sambaPort(); - avrPort = settings.value("avr_port", "").toString(); - sambaPort = settings.value("samba_port", "\\USBserial\\COM23").toString(); - - str = settings.value("dfu_arguments", "-a 0").toString(); - dfuArgs = str.split(" ", QString::SkipEmptyParts); ui->avrdude_location->setText(getAVRDUDE()); ui->avrArgs->setText(getAVRArgs().join(" ")); @@ -137,17 +147,16 @@ void burnConfigDialog::getSettings() void burnConfigDialog::putSettings() { - QSettings settings; - settings.setValue("avrdude_location", avrLoc); - settings.setValue("programmer", avrProgrammer); - settings.setValue("mcu", avrMCU); - settings.setValue("avr_port", avrPort); - settings.setValue("avr_arguments", avrArgs.join(" ")); - settings.setValue("samba_location", sambaLoc); - settings.setValue("samba_port", sambaPort); - settings.setValue("arm_mcu", armMCU); - settings.setValue("dfu_location", dfuLoc); - settings.setValue("dfu_arguments", dfuArgs.join(" ")); + g.avrdudeLocation( avrLoc ); + g.programmer( avrProgrammer); + g.mcu( avrMCU ); + g.avrPort( avrPort ); + g.avrArguments( avrArgs.join(" ") ); + g.sambaLocation( sambaLoc ); + g.sambaPort( sambaPort ); + g.armMcu( armMCU ); + g.dfuLocation( dfuLoc ); + g.dfuArguments( dfuArgs.join(" ") ); } void burnConfigDialog::populateProgrammers() diff --git a/companion/src/burndialog.cpp b/companion/src/burndialog.cpp index bfdf0bc76..617c7ea9e 100644 --- a/companion/src/burndialog.cpp +++ b/companion/src/burndialog.cpp @@ -7,7 +7,9 @@ #include "splashlibrary.h" #include "flashinterface.h" #include "hexinterface.h" +#include "appdata.h" +// Type 1 = Burn EEPROM, Type 2= Burn Flash burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName): QDialog(parent), ui(new Ui::burnDialog), @@ -16,17 +18,25 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac hexType(Type) { ui->setupUi(this); - ui->libraryButton->setIcon(CompanionIcon("library.png")); + + if(!g.profile[g.id()].splashFile().isEmpty()){ + imageSource=PROFILE; + imageFile=g.profile[g.id()].splashFile(); + } + else{ + ui->useProfileImageCB->setDisabled(true); + imageSource=FIRMWARE; + imageFile=""; + } ui->SplashFrame->hide(); ui->FramFWInfo->hide(); ui->EEbackupCB->hide(); ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked); - if (Type == 2) { + if (Type == FLASH_FILE_TYPE ) { ui->EEpromCB->hide(); ui->profile_label->hide(); ui->patchcalib_CB->hide(); ui->patchhw_CB->hide(); - ui->InvertColorButton->setDisabled(true); setWindowTitle(tr("Write firmware to TX")); if (IS_TARANIS(GetEepromInterface()->getBoard())) { ui->EEbackupCB->hide(); @@ -38,12 +48,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac ui->patchcalib_CB->hide(); ui->patchhw_CB->hide(); ui->EEpromCB->hide(); - ui->ImageLoadButton->setDisabled(true); - ui->libraryButton->setDisabled(true); - ui->InvertColorButton->setDisabled(true); ui->BurnFlashButton->setDisabled(true); - ui->ImageFileName->clear(); - ui->FwImage->clear(); ui->FWFileName->clear(); ui->DateField->clear(); ui->SVNField->clear(); @@ -58,38 +63,23 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac else { setWindowTitle(tr("Write Models and Settings in %1 to TX").arg(DocName)); } - QSettings settings; - int profileid=settings.value("profileId", 1).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profileid); - settings.beginGroup(profile); - QString Name=settings.value("Name","").toString(); - settings.endGroup(); - settings.endGroup(); - ui->profile_label->setText(tr("Current profile")+QString(": ")+Name); + ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name()); } if (!hexfileName->isEmpty()) { ui->FWFileName->setText(*hexfileName); - if (Type==2) { + if (Type==FLASH_FILE_TYPE) { checkFw(*hexfileName); } else { burnraw=false; if (checkeEprom(*hexfileName)) { - QSettings settings; - int profileid=settings.value("profileId", 1).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profileid); - settings.beginGroup(profile); - QString Name=settings.value("Name","").toString(); - QString calib=settings.value("StickPotCalib","").toString(); - QString trainercalib=settings.value("TrainerCalib","").toString(); - QString DisplaySet=settings.value("Display","").toString(); - QString BeeperSet=settings.value("Beeper","").toString(); - QString HapticSet=settings.value("Haptic","").toString(); - QString SpeakerSet=settings.value("Speaker","").toString(); - settings.endGroup(); - settings.endGroup(); + QString Name = g.profile[g.id()].name(); + QString calib = g.profile[g.id()].stickPotCalib(); + QString trainercalib = g.profile[g.id()].trainerCalib(); + QString DisplaySet = g.profile[g.id()].display(); + QString BeeperSet = g.profile[g.id()].beeper(); + QString HapticSet = g.profile[g.id()].haptic(); + QString SpeakerSet = g.profile[g.id()].speaker(); if (!Name.isEmpty()) { ui->profile_label->show(); ui->patchcalib_CB->show(); @@ -118,15 +108,14 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac ui->FlashLoadButton->hide(); hexfileName->clear(); } - else if (Type==2) { - QSettings settings; - QString FileName; - FileName = settings.value("lastFw").toString(); + else if (Type==FLASH_FILE_TYPE) { + QString FileName = g.profile[g.id()].fwName(); QFile file(FileName); if (file.exists()) { checkFw(FileName); } } + updateUI(); resize(0, 0); } @@ -138,13 +127,8 @@ burnDialog::~burnDialog() void burnDialog::on_FlashLoadButton_clicked() { QString fileName; - QSettings settings; - ui->ImageLoadButton->setDisabled(true); - ui->libraryButton->setDisabled(true); - ui->InvertColorButton->setDisabled(true); + ui->BurnFlashButton->setDisabled(true); - ui->ImageFileName->clear(); - ui->FwImage->clear(); ui->FWFileName->clear(); ui->DateField->clear(); ui->SVNField->clear(); @@ -154,12 +138,14 @@ void burnDialog::on_FlashLoadButton_clicked() ui->BurnFlashButton->setDisabled(true); ui->EEbackupCB->hide(); QTimer::singleShot(0, this, SLOT(shrink())); - if (hexType==2) { - fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER); + if (hexType==FLASH_FILE_TYPE) { + fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER); + if(fileName.isEmpty()) + return; checkFw(fileName); } else { - QString fileName = QFileDialog::getOpenFileName(this,tr("Choose file to load Models and Settings from"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER)); + QString fileName = QFileDialog::getOpenFileName(this,tr("Choose file to load Models and Settings from"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER)); if (checkeEprom(fileName)) { if (burnraw==false) { ui->BurnFlashButton->setEnabled(true); @@ -184,6 +170,7 @@ void burnDialog::on_FlashLoadButton_clicked() QTimer::singleShot(0, this, SLOT(shrink())); } } + updateUI(); } void burnDialog::checkFw(QString fileName) @@ -191,7 +178,7 @@ void burnDialog::checkFw(QString fileName) if (fileName.isEmpty()) { return; } - QSettings settings; + if (!IS_TARANIS(GetEepromInterface()->getBoard())) { ui->EEbackupCB->show(); } @@ -206,61 +193,19 @@ void burnDialog::checkFw(QString fileName) ui->DateField->setText(flash.getDate() + " " + flash.getTime()); ui->SVNField->setText(flash.getSvn()); ui->ModField->setText(flash.getBuild()); - ui->BurnFlashButton->setEnabled(true); - ui->BurnFlashButton->setText(tr("Write to TX")); + + ui->SplashFrame->hide(); if (flash.hasSplash()) { ui->SplashFrame->show(); - ui->ImageLoadButton->setEnabled(true); - ui->libraryButton->setEnabled(true); - ui->FwImage->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight()); ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight()); - ui->FwImage->show(); - ui->FwImage->setPixmap(QPixmap::fromImage(flash.getSplash())); - QString ImageStr = settings.value("SplashImage", "").toString(); - bool PatchFwCB = settings.value("patchImage", false).toBool(); - if (!ImageStr.isEmpty()) { - QImage Image = qstring2image(ImageStr); - ui->imageLabel->setPixmap(QPixmap::fromImage(Image.convertToFormat(flash.getSplashFormat()))); - ui->InvertColorButton->setEnabled(true); - ui->PreferredImageCB->setChecked(true); - ui->PatchFWCB->setChecked(PatchFwCB); - } - else { - QString fileName=ui->ImageFileName->text(); - if (!fileName.isEmpty()) { - QImage image(fileName); - if (!image.isNull()) { - ui->InvertColorButton->setEnabled(true); - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(flash.getSplashFormat()))); - ui->PatchFWCB->setEnabled(true); - ui->PatchFWCB->setChecked(PatchFwCB); - } - else { - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - ui->PreferredImageCB->setDisabled(true); - } - } - else { - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - ui->PreferredImageCB->setDisabled(true); - } - } - } - else { - ui->FwImage->hide(); - ui->ImageFileName->setText(""); - ui->SplashFrame->hide(); } } else { - QMessageBox::warning(this, tr("Warning"), tr("%1 is not a known firmware").arg(fileName)); - ui->BurnFlashButton->setText(tr("Burn anyway !")); - ui->BurnFlashButton->setEnabled(true); + QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName)); } + ui->BurnFlashButton->setEnabled(true); QTimer::singleShot(0, this, SLOT(shrink())); - settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath()); + g.flashDir( QFileInfo(fileName).dir().absolutePath() ); } bool burnDialog::checkeEprom(QString fileName) @@ -353,52 +298,92 @@ bool burnDialog::checkeEprom(QString fileName) return true; } -void burnDialog::on_ImageLoadButton_clicked() +void burnDialog::displaySplash() +{ + QImage image; + if (imageSource == FIRMWARE){ + FlashInterface flash(ui->FWFileName->text()); + image = flash.getSplash(); + } + else{ + image.load(imageFile); + } + if (image.isNull()) { + return; + } + ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType())); +} + +void burnDialog::updateUI() +{ + if (hexType==EEPROM_FILE_TYPE) + return; + + ui->useProfileImageCB->setChecked( imageSource == PROFILE ); + ui->useFwImageCB->setChecked( imageSource == FIRMWARE ); + ui->useLibraryImageCB->setChecked( imageSource == LIBRARY ); + ui->useAnotherImageCB->setChecked( imageSource == ANOTHER ); + + displaySplash(); +} + +void burnDialog::on_useFwImageCB_clicked() +{ + QString fileName = ui->FWFileName->text(); + FlashInterface flash(fileName); + if (!flash.isValid()) { + QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." )); + } + else { + if (!flash.hasSplash()) { + QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." )); + } + else{ + imageSource = FIRMWARE; + imageFile = fileName; + } + } + updateUI(); +} + +void burnDialog::on_useProfileImageCB_clicked() +{ + QString fileName = g.profile[g.id()].splashFile(); + if (!fileName.isEmpty()){ + QImage image(fileName); + if (image.isNull()) { + QMessageBox::critical(this, tr("Error"), tr("The profile image %1 does not contain an image.").arg(fileName)); + } + else { + imageSource = PROFILE; + imageFile = fileName; + } + } + updateUI(); +} + +void burnDialog::on_useAnotherImageCB_clicked() { QString supportedImageFormats; for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) { supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex]; } - - QSettings settings; - QString fileName = QFileDialog::getOpenFileName(this, - tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats)); - - if (!fileName.isEmpty()) { - settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath()); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as Tx start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats)); + if (!fileName.isEmpty()){ + g.imagesDir( QFileInfo(fileName).dir().absolutePath() ); QImage image(fileName); if (image.isNull()) { - QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName)); - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - ui->InvertColorButton->setDisabled(true); - return; + QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName)); } - ui->ImageFileName->setText(fileName); - ui->InvertColorButton->setEnabled(true); - if (ui->imageLabel->width()!=128) { - image=image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray; - int width = image.width(); - int height = image.height(); - for (int i = 0; i < width; ++i) { - for (int j = 0; j < height; ++j) { - col = image.pixel(i, j); - gray = qGray(col); - image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()))); - } - else { - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(QImage::Format_Mono))); - } - ui->PatchFWCB->setEnabled(true); + else{ + imageSource = ANOTHER; + imageFile = fileName; + } } + updateUI(); } -void burnDialog::on_libraryButton_clicked() +void burnDialog::on_useLibraryImageCB_clicked() { QString fileName; splashLibrary *ld = new splashLibrary(this,&fileName); @@ -406,50 +391,26 @@ void burnDialog::on_libraryButton_clicked() if (!fileName.isEmpty()) { QImage image(fileName); if (image.isNull()) { - QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName)); - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - ui->InvertColorButton->setDisabled(true); - return; + QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded")); } - ui->ImageFileName->setText(fileName); - ui->InvertColorButton->setEnabled(true); - if (ui->imageLabel->width()!=128) { - image=image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray; - int width = image.width(); - int height = image.height(); - for (int i = 0; i < width; ++i) - { - for (int j = 0; j < height; ++j) - { - col = image.pixel(i, j); - gray = qGray(col); - image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()))); - } else { - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(QImage::Format_Mono))); + else{ + imageSource = LIBRARY; + imageFile = fileName; } - ui->PatchFWCB->setEnabled(true); } + updateUI(); } void burnDialog::on_BurnFlashButton_clicked() { - if (hexType==2) { + if (hexType==FLASH_FILE_TYPE) { QString fileName=ui->FWFileName->text(); if (!fileName.isEmpty()) { - QSettings settings; - settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath()); - settings.setValue("lastFw", fileName); - if (ui->PatchFWCB->isChecked()) { - settings.setValue("patchImage", true); + g.flashDir( QFileInfo(fileName).dir().absolutePath() ); + if (!ui->useFwImageCB->isChecked()) { QImage image = ui->imageLabel->pixmap()->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height()); if (!image.isNull()) { - QString tempDir = QDir::tempPath(); + QString tempDir = QDir::tempPath(); QString tempFile; if (getFileType(fileName) == FILE_TYPE_HEX) tempFile = tempDir + "/flash.hex"; @@ -469,7 +430,6 @@ void burnDialog::on_BurnFlashButton_clicked() QMessageBox::critical(this, tr("Warning"), tr("Custom image not found")); } } else { - settings.setValue("patchImage", false); hexfileName->clear(); hexfileName->append(fileName); } @@ -478,27 +438,20 @@ void burnDialog::on_BurnFlashButton_clicked() hexfileName->clear(); } } - if (hexType==1) { - QSettings settings; - int profileid=settings.value("profileId", 1).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profileid); - settings.beginGroup(profile); - QString calib=settings.value("StickPotCalib","").toString(); - QString trainercalib=settings.value("TrainerCalib","").toString(); + if (hexType==EEPROM_FILE_TYPE) { + QString calib = g.profile[g.id()].stickPotCalib(); + QString trainercalib = g.profile[g.id()].trainerCalib(); int potsnum=GetEepromInterface()->getCapability(Pots); - int8_t vBatCalib=(int8_t)settings.value("VbatCalib", radioData.generalSettings.vBatCalib).toInt(); - int8_t currentCalib=(int8_t)settings.value("currentCalib", radioData.generalSettings.currentCalib).toInt(); - int8_t PPM_Multiplier=(int8_t)settings.value("PPM_Multiplier", radioData.generalSettings.PPM_Multiplier).toInt(); - uint8_t GSStickMode=(uint8_t)settings.value("GSStickMode", radioData.generalSettings.stickMode).toUInt(); - uint8_t vBatWarn=(uint8_t)settings.value("vBatWarn",radioData.generalSettings.vBatWarn).toUInt(); + int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib(); + int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib(); + int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier(); + uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode(); + uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn(); - QString DisplaySet=settings.value("Display","").toString(); - QString BeeperSet=settings.value("Beeper","").toString(); - QString HapticSet=settings.value("Haptic","").toString(); - QString SpeakerSet=settings.value("Speaker","").toString(); - settings.endGroup(); - settings.endGroup(); + QString DisplaySet= g.profile[g.id()].display(); + QString BeeperSet= g.profile[g.id()].beeper(); + QString HapticSet= g.profile[g.id()].haptic(); + QString SpeakerSet= g.profile[g.id()].speaker(); bool patch=false; if (ui->patchcalib_CB->isChecked()) { if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) { @@ -634,99 +587,9 @@ void burnDialog::on_cancelButton_clicked() this->close(); } -void burnDialog::on_InvertColorButton_clicked() -{ - if (ui->imageLabel->pixmap()) { - QImage image = ui->imageLabel->pixmap()->toImage(); - image.invertPixels(); - ui->imageLabel->setPixmap(QPixmap::fromImage(image)); - } -} - void burnDialog::on_EEpromCB_toggled(bool checked) { - if (ui->EEpromCB->isChecked()) { - *backup=true; - } else { - *backup=false; - } -} - -void burnDialog::on_PreferredImageCB_toggled(bool checked) -{ - QString tmpFileName; - if (checked) { - QSettings settings; - QString ImageStr = settings.value("SplashImage", "").toString(); - if (!ImageStr.isEmpty()) { - QImage Image = qstring2image(ImageStr); - if (ui->imageLabel->width()!=128) { - Image=Image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray; - int width = Image.width(); - int height = Image.height(); - for (int i = 0; i < width; ++i) - { - for (int j = 0; j < height; ++j) - { - col = Image.pixel(i, j); - gray = qGray(col); - Image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - } else { - Image=Image.convertToFormat(QImage::Format_Mono); - } - ui->imageLabel->setPixmap(QPixmap::fromImage(Image)); - ui->InvertColorButton->setEnabled(true); - ui->PreferredImageCB->setChecked(true); - ui->ImageFileName->setDisabled(true); - ui->ImageLoadButton->setDisabled(true); - ui->libraryButton->setDisabled(true); - ui->PatchFWCB->setEnabled(true); - } - } else { - ui->imageLabel->clear(); - ui->ImageLoadButton->setEnabled(true); - ui->libraryButton->setEnabled(true); - tmpFileName = ui->ImageFileName->text(); - if (!tmpFileName.isEmpty()) { - QImage image(tmpFileName); - if (!image.isNull()) { - if (ui->imageLabel->width()!=128) { - image=image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray; - int width = image.width(); - int height = image.height(); - for (int i = 0; i < width; ++i) - { - for (int j = 0; j < height; ++j) - { - col = image.pixel(i, j); - gray = qGray(col); - image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - } else { - image=image.convertToFormat(QImage::Format_Mono); - } - ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()))); - ui->InvertColorButton->setEnabled(true); - ui->ImageFileName->setEnabled(true); - ui->PatchFWCB->setDisabled(false); - } else { - ui->InvertColorButton->setDisabled(true); - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - } - } else { - ui->InvertColorButton->setDisabled(true); - ui->PatchFWCB->setDisabled(true); - ui->PatchFWCB->setChecked(false); - } - } + *backup = ui->EEpromCB->isChecked(); } void burnDialog::shrink() @@ -736,9 +599,5 @@ void burnDialog::shrink() void burnDialog::on_EEbackupCB_clicked() { - if (ui->EEbackupCB->isChecked()) { - *backup=true; - } else { - *backup=false; - } + *backup = ui->EEbackupCB->isChecked(); } diff --git a/companion/src/burndialog.h b/companion/src/burndialog.h index 40068f3ac..1ffac2b92 100644 --- a/companion/src/burndialog.h +++ b/companion/src/burndialog.h @@ -19,6 +19,8 @@ #define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE" #define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE" #define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE" +#define EEPROM_FILE_TYPE 1 +#define FLASH_FILE_TYPE 2 namespace Ui @@ -36,18 +38,22 @@ public: private slots: void on_FlashLoadButton_clicked(); - void on_ImageLoadButton_clicked(); - void on_libraryButton_clicked(); void on_BurnFlashButton_clicked(); void on_cancelButton_clicked(); - void on_InvertColorButton_clicked(); void on_EEbackupCB_clicked(); - void on_PreferredImageCB_toggled(bool checked); - void on_EEpromCB_toggled(bool checked); - void checkFw(QString fileName); + void on_EEpromCB_toggled(bool checked); bool checkeEprom(QString fileName); + void on_useProfileImageCB_clicked(); + void on_useFwImageCB_clicked(); + void on_useLibraryImageCB_clicked(); + void on_useAnotherImageCB_clicked(); + + void checkFw(QString fileName); + void displaySplash(); + void updateUI(); void shrink(); + private: Ui::burnDialog *ui; QString * hexfileName; @@ -55,6 +61,9 @@ private: int hexType; RadioData radioData; bool burnraw; + enum ImageSource {FIRMWARE, PROFILE, LIBRARY, ANOTHER}; + ImageSource imageSource; + QString imageFile; }; #endif // BURNDIALOG_H diff --git a/companion/src/burndialog.ui b/companion/src/burndialog.ui index e86634e9a..772304390 100644 --- a/companion/src/burndialog.ui +++ b/companion/src/burndialog.ui @@ -7,7 +7,7 @@ 0 0 440 - 418 + 423 @@ -30,21 +30,8 @@ :/icon.png:/icon.png - + - - - - Qt::Vertical - - - - 20 - 0 - - - - @@ -71,19 +58,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -100,19 +74,6 @@ - - - - Qt::Horizontal - - - - 48 - 20 - - - - @@ -152,56 +113,22 @@ QFrame::Raised - - - - - 0 - 0 - - - - - 128 - 64 - - - - - 212 - 64 - - - - QFrame::Panel - - - QFrame::Raised - - - - - - true - - - - - + + true - - + + - Date & Time + Variant - - + + true @@ -214,17 +141,17 @@ - - - - true + + + + Date & Time - - - - Variant + + + + true @@ -325,17 +252,10 @@ - - - - - - - Invert Color - - - - + + + + @@ -359,7 +279,7 @@ QFrame::Panel - QFrame::Raised + QFrame::Plain @@ -369,10 +289,50 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - + + + Use firmware start screen + + + + + + + Use another start screen + + + + + 0 @@ -380,86 +340,14 @@ - Use image in settings - - - - - - - Substitute image in firmware + Use profile start screen - - - Qt::Vertical - - - - 20 - 13 - - - - - - - - Qt::Vertical - - - - 20 - 13 - - - - - - - - - - - - true - - - - 0 - 0 - - - - true - - - - - - - false - + - Load Image - - - - - - - Open Splash Library - - - ... - - - - 16 - 16 - + Use library start screen @@ -470,18 +358,37 @@ + + + + Qt::Vertical + + + + 20 + 0 + + + + + BurnFlashButton FWFileName FlashLoadButton - ImageFileName - ImageLoadButton - libraryButton + DateField + SVNField + ModField + useProfileImageCB + useFwImageCB + useLibraryImageCB + useAnotherImageCB EEbackupCB + patchcalib_CB + patchhw_CB EEpromCB cancelButton - BurnFlashButton diff --git a/companion/src/main.cpp b/companion/src/companion.cpp similarity index 72% rename from companion/src/main.cpp rename to companion/src/companion.cpp index ffaea6801..37a988273 100644 --- a/companion/src/main.cpp +++ b/companion/src/companion.cpp @@ -45,12 +45,12 @@ #include #include #include -#include #include #include #include #include "mainwindow.h" #include "eeprominterface.h" +#include "appdata.h" #if defined WIN32 || !defined __GNUC__ #include @@ -86,46 +86,30 @@ int main(int argc, char *argv[]) app.setStyle(new MyProxyStyle); #endif - // Start by borrowing any left over settings from companion9x - QSettings c9x_settings("companion9x", "companion9x"); - QSettings settings; - - if (!settings.contains("pos")) { - QStringList keys = c9x_settings.allKeys(); - for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++) { - settings.setValue(*i, c9x_settings.value(*i)); - } - } - - QString dir; - if (argc) dir = QFileInfo(argv[0]).canonicalPath() + "/lang"; - - QString locale = settings.value("locale",QLocale::system().name()).toString(); - bool showSplash = settings.value("show_splash", true).toBool(); - QTranslator companionTranslator; - companionTranslator.load(":/companion_" + locale); + companionTranslator.load(":/companion_" + g.locale()); QTranslator qtTranslator; - qtTranslator.load((QString)"qt_" + locale.left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + qtTranslator.load((QString)"qt_" + g.locale().left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); app.installTranslator(&companionTranslator); app.installTranslator(&qtTranslator); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); - QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString(); - firmware_id.replace("open9x", "opentx"); - firmware_id.replace("x9da", "taranis"); + if (g.profile[g.id()].fwType().isEmpty()){ + g.profile[g.id()].fwType(default_firmware_variant.id); + g.profile[g.id()].fwName(""); + } + - QPixmap pixmap = QPixmap(firmware_id.contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png"); + QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png"); QSplashScreen *splash = new QSplashScreen(pixmap); RegisterFirmwares(); - settings.setValue("firmware", firmware_id); - current_firmware_variant = GetFirmwareVariant(firmware_id); + current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType()); MainWindow *mainWin = new MainWindow(); - if (showSplash) { + if (g.showSplash()) { splash->show(); QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close())); QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show())); diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index 1c4550d1a..c6246f314 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -168,131 +168,57 @@ images/library/00009.png images/library/00010.png images/library/00011.png - images/library/00012.png images/library/00013.png images/library/00014.png images/library/00015.png images/library/00016.png - images/library/01001.png - images/library/01002.png - images/library/01003.png - images/library/01004.png - images/library/01005.png - images/library/01006.png - images/library/01007.png - images/library/01008.png + images/library/00017.png + images/library/00018.png + images/library/00019.png + images/library/00020.png + images/library/00021.png + images/library/00022.png + images/library/00023.png + images/library/00024.png + images/library/00051.png + images/library/00100.png + images/library/00101.png + images/library/00102.png + images/library/00103.png + images/library/00104.png + images/library/00105.png + images/library/00106.png + images/library/00201.png + images/library/00202.png + images/library/00203.png + images/library/00204.png + images/library/00301.png + images/library/00302.png + images/library/00303.png + images/library/00304.png + images/library/00401.png + images/library/00402.png + images/library/00403.png + images/library/00404.png + images/library/00501.png images/library/10001.png images/library/10002.png images/library/10003.png - images/library/10004.png - images/library/10005.png - images/library/10006.png - images/library/10007.png - images/library/10008.png - images/library/10009.png - images/library/10010.png - images/library/10011.png - images/library/10012.png - images/library/10013.png - images/library/10014.png - images/library/10015.png - images/library/10016.png - images/library/10017.png - images/library/10018.png - images/library/10019.png - images/library/10020.png - images/library/10021.png - images/library/10022.png - images/library/10023.png - images/library/10024.png - images/library/10033.png - images/library/10034.png - images/library/10035.png - images/library/10036.png - images/library/10049.png - images/library/10050.png - images/library/10051.png - images/library/10052.png - images/library/10037.png - images/library/10038.png - images/library/10039.png - images/library/10040.png - images/library/10053.png - images/library/10054.png - images/library/10055.png - images/library/10056.png - images/library/10025.png - images/library/10026.png - images/library/10027.png - images/library/10028.png - images/library/10029.png - images/library/10030.png - images/library/10031.png - images/library/10032.png - images/library/10041.png - images/library/10042.png - images/library/10043.png - images/library/10044.png - images/library/10057.png - images/library/10058.png - images/library/10059.png - images/library/10060.png - images/library/10045.png - images/library/10046.png - images/library/10047.png - images/library/10048.png - images/library/10061.png - images/library/10062.png - images/library/10063.png - images/library/10064.png - images/library/10065.png - images/library/10066.png - images/library/10067.png - images/library/10068.png - images/library/10081.png - images/library/10082.png - images/library/10083.png - images/library/10084.png - images/library/10069.png - images/library/10070.png - images/library/10071.png - images/library/10072.png - images/library/10085.png - images/library/10086.png - images/library/10087.png - images/library/10088.png - images/library/10073.png - images/library/10074.png - images/library/10075.png - images/library/10076.png - images/library/10089.png - images/library/10090.png - images/library/10091.png - images/library/10092.png - images/library/10077.png - images/library/10078.png - images/library/10079.png - images/library/10080.png - images/library/10093.png - images/library/10094.png - images/library/10095.png - images/library/10096.png - images/library/10097.png - images/library/10098.png - images/library/10099.png - images/library/10100.png images/library/10101.png images/library/10102.png images/library/10103.png - images/library/10104.png - images/library/20001.png - images/library/20002.png - images/library/20003.png - images/library/20004.png - images/library/30001.png - images/library/30002.png - images/library/30003.png - images/library/30004.png + images/library/10501.png + images/library/10502.png + images/library/10503.png + images/library/10504.png + images/library/10505.png + images/library/10506.png + images/library/10508.png + images/library/10601.png + images/library/10701.png + images/library/10702.png + images/library/10801.png + images/library/10802.png themes/monochrome/16/paintbrush.png themes/monochrome/16/open.png themes/monochrome/16/edit.png diff --git a/companion/src/customizesplashdialog.cpp b/companion/src/customizesplashdialog.cpp index bd284a3d6..42bf463da 100644 --- a/companion/src/customizesplashdialog.cpp +++ b/companion/src/customizesplashdialog.cpp @@ -2,6 +2,7 @@ #include "ui_customizesplashdialog.h" #include +#include "appdata.h" #include "helpers.h" #include "burndialog.h" #include "splashlibrary.h" @@ -13,11 +14,21 @@ Side::Side(){ imageLabel = 0; fileNameEdit = 0; saveButton = 0; + loadFwButton=0; + loadPictButton = 0; + loadProfileButton = 0; saveToFileName = new QString(""); source = new Source(UNDEFINED); format = new LCDFormat(LCDTARANIS); } +void Side::markSourceButton() +{ + loadFwButton->setChecked(*source == FW ? true : false ); + loadPictButton->setChecked(*source == PICT ? true : false ); + loadProfileButton->setChecked(*source == PROFILE ? true : false ); +} + void Side::copyImage( Side side ) { if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED)) @@ -28,66 +39,56 @@ bool Side::displayImage( QString fileName, Source pictSource ) { QImage image; - if (fileName.isEmpty()) { + if (fileName.isEmpty()) return false; - } + + // Determine which picture format to use if (pictSource == FW ){ FlashInterface flash(fileName); if (!flash.hasSplash()) return false; else image = flash.getSplash(); - *format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X); + *format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X); } else { - image.load(fileName); - if (pictSource== PICT) - *format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X; + image.load(fileName); + if (pictSource== PICT) + *format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X; + else if (pictSource == PROFILE) + *format = (g.profile[g.id()].fwType().contains("taranis")) ? LCDTARANIS : LCD9X; } if (image.isNull()) { return false; } + // Load image if (*format==LCDTARANIS) { - image=image.convertToFormat(QImage::Format_RGB32); - QRgb col; - int gray; - int width = image.width(); - int height = image.height(); - for (int i = 0; i < width; ++i) { - for (int j = 0; j < height; ++j) { - col = image.pixel(i, j); - gray = qGray(col); - image.setPixel(i, j, qRgb(gray, gray, gray)); - } - } - imageLabel->setPixmap(QPixmap::fromImage(image.scaled(imageLabel->width()/2, imageLabel->height()/2))); + imageLabel->setPixmap( makePixMap( image, "taranis" )); + imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2); } - else - imageLabel->setPixmap(QPixmap::fromImage(image.scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Mono))); - - if (*format == LCD9X) - imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2); - else - imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2); - + else { + imageLabel->setPixmap( makePixMap( image, "9x" )); + imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2); + } + switch (pictSource){ - case FW: - fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName)); - *saveToFileName = fileName; - *source=FW; - break; - case PICT: - fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName)); - *saveToFileName = fileName; - *source=PICT; - break; - case PROFILE: - fileNameEdit->setText(QObject::tr("Profile image")); - *saveToFileName = fileName; - *source=PROFILE; - break; - default: - break; + case FW: + fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName)); + *saveToFileName = fileName; + *source=FW; + break; + case PICT: + fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName)); + *saveToFileName = fileName; + *source=PICT; + break; + case PROFILE: + fileNameEdit->setText(QObject::tr("Profile image")); + *saveToFileName = fileName; + *source=PROFILE; + break; + default: + break; } saveButton->setEnabled(true); libraryButton->setEnabled(true); @@ -102,8 +103,6 @@ bool Side::refreshImage() bool Side::saveImage() { - QSettings settings; - if (*source == FW ) { FlashInterface flash(*saveToFileName); @@ -112,7 +111,7 @@ bool Side::saveImage() } QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight()); if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) { - settings.setValue("lastFlashDir", QFileInfo(*saveToFileName).dir().absolutePath()); + g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() ); } else { return false; @@ -121,7 +120,7 @@ bool Side::saveImage() else if (*source == PICT) { QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8); if (image.save(*saveToFileName)) { - settings.setValue("lastImagesDir", QFileInfo(*saveToFileName).dir().absolutePath()); + g.imagesDir( QFileInfo(*saveToFileName).dir().absolutePath() ); } else { return false; @@ -157,8 +156,17 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) : right.libraryButton = ui->rightLibraryButton; left.invertButton = ui->leftInvertButton; right.invertButton = ui->rightInvertButton; + + left.loadFwButton = ui->leftLoadFwButton; + right.loadFwButton = ui->rightLoadFwButton; + left.loadPictButton = ui->leftLoadPictButton; + right.loadPictButton = ui->rightLoadPictButton; + left.loadProfileButton = ui->leftLoadProfileButton; + right.loadProfileButton = ui->rightLoadProfileButton; loadProfile(left); + left.markSourceButton(); + resize(0,0); } @@ -179,14 +187,14 @@ void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);} void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);} void customizeSplashDialog::loadFirmware(Side side) { - QSettings settings; - QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER); if (!fileName.isEmpty()) { if (!side.displayImage( fileName, FW )) - QMessageBox::critical(this, tr("Error"), tr("Cannot load embedded FW image from %1.").arg(fileName)); + QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName)); else - settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath()); + g.flashDir( QFileInfo(fileName).dir().absolutePath() ); } + side.markSourceButton(); } void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);} @@ -197,29 +205,29 @@ void customizeSplashDialog::loadPicture(Side side) for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) { supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex]; } - QSettings settings; QString fileName = QFileDialog::getOpenFileName(this, - tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats)); + tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats)); if (!fileName.isEmpty()) { if (!side.displayImage( fileName, PICT )) QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName)); else - settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath()); + g.imagesDir( QFileInfo(fileName).dir().absolutePath() ); } + side.markSourceButton(); } void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);} void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);} void customizeSplashDialog::loadProfile(Side side) { - QSettings settings; - QString fileName=settings.value("SplashFileName","").toString(); + QString fileName=g.profile[g.id()].splashFile(); if (!fileName.isEmpty()) { if (!side.displayImage( fileName, PROFILE )) QMessageBox::critical(this, tr("Error"), tr("Cannot load the profile image %1.").arg(fileName)); } + side.markSourceButton(); } void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);} diff --git a/companion/src/customizesplashdialog.h b/companion/src/customizesplashdialog.h index 21155dede..c931005b2 100644 --- a/companion/src/customizesplashdialog.h +++ b/companion/src/customizesplashdialog.h @@ -22,6 +22,7 @@ class Side { public: Side(); + void markSourceButton(); void copyImage( Side ); bool displayImage( QString fileName, Source source ); bool saveImage(); @@ -32,6 +33,9 @@ public: QPushButton *saveButton; QPushButton *invertButton; QToolButton *libraryButton; + QPushButton *loadFwButton; + QPushButton *loadPictButton; + QPushButton *loadProfileButton; QString *saveToFileName; diff --git a/companion/src/customizesplashdialog.ui b/companion/src/customizesplashdialog.ui index de4d68f24..72b241276 100644 --- a/companion/src/customizesplashdialog.ui +++ b/companion/src/customizesplashdialog.ui @@ -258,6 +258,9 @@ Load Profile + + true + @@ -265,6 +268,9 @@ Load FW + + true + @@ -272,6 +278,9 @@ Load Pict + + true + @@ -554,6 +563,9 @@ Load Profile + + true + @@ -564,6 +576,9 @@ Load FW + + true + @@ -571,6 +586,9 @@ Load Pict + + true + diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index d127bb04a..1df1f4e98 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -6,7 +6,7 @@ #include "firmwares/gruvin9x/gruvin9xinterface.h" #include "firmwares/opentx/opentxinterface.h" #include "firmwares/ersky9x/ersky9xinterface.h" -#include "qsettings.h" +#include "appdata.h" #include "helpers.h" QString EEPROMWarnings; @@ -772,34 +772,25 @@ GeneralSettings::GeneralSettings() calibSpanNeg[i] = 0x180; calibSpanPos[i] = 0x180; } - QSettings settings; - templateSetup = settings.value("default_channel_order", 0).toInt(); - stickMode = settings.value("default_mode", 1).toInt(); - int profile_id = settings.value("profileId", 0).toInt(); - if (profile_id>0) { - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profile_id); - settings.beginGroup(profile); - QString t_calib=settings.value("StickPotCalib","").toString(); + templateSetup = g.profile[g.id()].channelOrder(); + stickMode = g.profile[g.id()].defaultMode(); + + QString t_calib=g.profile[g.id()].stickPotCalib(); int potsnum=GetEepromInterface()->getCapability(Pots); if (t_calib.isEmpty()) { - settings.endGroup(); - settings.endGroup(); return; } else { - QString t_trainercalib=settings.value("TrainerCalib","").toString(); - int8_t t_vBatCalib=(int8_t)settings.value("VbatCalib", vBatCalib).toInt(); - int8_t t_currentCalib=(int8_t)settings.value("currentCalib", currentCalib).toInt(); - int8_t t_PPM_Multiplier=(int8_t)settings.value("PPM_Multiplier", PPM_Multiplier).toInt(); - uint8_t t_stickMode=(uint8_t)settings.value("GSStickMode", stickMode).toUInt(); - uint8_t t_vBatWarn=(uint8_t)settings.value("vBatWarn",vBatWarn).toUInt(); - QString t_DisplaySet=settings.value("Display","").toString(); - QString t_BeeperSet=settings.value("Beeper","").toString(); - QString t_HapticSet=settings.value("Haptic","").toString(); - QString t_SpeakerSet=settings.value("Speaker","").toString(); - QString t_CountrySet=settings.value("countryCode","").toString(); - settings.endGroup(); - settings.endGroup(); + QString t_trainercalib=g.profile[g.id()].trainerCalib(); + int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib(); + int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib(); + int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier(); + uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode(); + uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn(); + QString t_DisplaySet=g.profile[g.id()].display(); + QString t_BeeperSet=g.profile[g.id()].beeper(); + QString t_HapticSet=g.profile[g.id()].haptic(); + QString t_SpeakerSet=g.profile[g.id()].speaker(); + QString t_CountrySet=g.profile[g.id()].countryCode(); if ((t_calib.length()==(NUM_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) { QString Byte; @@ -881,7 +872,7 @@ GeneralSettings::GeneralSettings() } } } - } + } ModelData::ModelData() @@ -1031,14 +1022,12 @@ ModelData ModelData::removeGlobalVars() QList eepromInterfaces; void RegisterEepromInterfaces() { - QSettings settings; - int rev4a = settings.value("rev4asupport",0).toInt(); 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) + if (g.rev4aSupport()) eepromInterfaces.push_back(new OpenTxInterface(BOARD_TARANIS_REV4a)); eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK)); eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X)); diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index a6f1075b2..8a845d9b8 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -74,7 +74,7 @@ const uint8_t modn12x3[4][4]= { #define C9X_MAX_ENCODERS 2 #define C9X_NUM_CHNOUT 32 // number of real output channels #define C9X_NUM_CSW 32 // number of custom switches -#define C9X_MAX_CUSTOM_FUNCTIONS 32 // number of functions assigned to switches +#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches #define C9X_NUM_MODULES 2 #define STK_RUD 1 @@ -859,7 +859,7 @@ class ModuleData { void clear() { memset(this, 0, sizeof(ModuleData)); } }; -#define C9X_MAX_SCRIPTS 3 +#define C9X_MAX_SCRIPTS 7 #define C9X_MAX_SCRIPT_INPUTS 10 class ScriptData { public: diff --git a/companion/src/firmwares/er9x/er9xinterface.cpp b/companion/src/firmwares/er9x/er9xinterface.cpp index 90df5e51b..a45e5088b 100644 --- a/companion/src/firmwares/er9x/er9xinterface.cpp +++ b/companion/src/firmwares/er9x/er9xinterface.cpp @@ -19,6 +19,7 @@ #include "er9xeeprom.h" #include "er9xsimulator.h" #include "file.h" +#include "appdata.h" #define FILE_TYP_GENERAL 1 #define FILE_TYP_MODEL 2 @@ -44,8 +45,7 @@ const char * Er9xInterface::getName() const int Er9xInterface::getEEpromSize() { - QSettings settings; - QString avrMCU = settings.value("mcu", QString("m64")).toString(); + QString avrMCU = g.mcu(); if (avrMCU==QString("m128")) { return 2*EESIZE_STOCK; } diff --git a/companion/src/firmwares/gruvin9x/gruvin9xinterface.cpp b/companion/src/firmwares/gruvin9x/gruvin9xinterface.cpp index c3d52923f..a7d1d6f1a 100644 --- a/companion/src/firmwares/gruvin9x/gruvin9xinterface.cpp +++ b/companion/src/firmwares/gruvin9x/gruvin9xinterface.cpp @@ -18,6 +18,7 @@ #include "gruvin9xinterface.h" #include "gruvin9xeeprom.h" #include "file.h" +#include "appdata.h" #define FILE_TYP_GENERAL 1 #define FILE_TYP_MODEL 2 @@ -47,8 +48,7 @@ const char * Gruvin9xInterface::getName() const int Gruvin9xInterface::getEEpromSize() { if (board == BOARD_STOCK) { - QSettings settings; - QString avrMCU = settings.value("mcu", QString("m64")).toString(); + QString avrMCU = g.mcu(); if (avrMCU==QString("m128")) { return EESIZE_STOCK*2; } diff --git a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp index dbe13b6d8..e17a14be3 100644 --- a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp @@ -16,6 +16,7 @@ #include "opentxSky9xsimulator.h" #include "opentxinterface.h" +#include "appdata.h" #define SIMU #define SIMU_EXCEPTIONS @@ -135,8 +136,7 @@ using namespace Open9xSky9x; Open9xSky9xSimulator::Open9xSky9xSimulator(OpenTxInterface * open9xInterface): open9xInterface(open9xInterface) { - QSettings settings; - QString path=settings.value("sdPath", ".").toString()+"/"; + QString path=g.profile[g.id()].sdPath()+"/"; int i=0; for (i=0; i< std::min(path.length(),1022); i++) { simuSdDirectory[i]=path.at(i).toAscii(); diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 4ce1bed6e..13db450d7 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -16,6 +16,7 @@ #include "opentxTaranisSimulator.h" #include "opentxinterface.h" +#include "appdata.h" #define SIMU #define SIMU_EXCEPTIONS @@ -181,8 +182,7 @@ OpentxTaranisSimulator::OpentxTaranisSimulator(OpenTxInterface * open9xInterface open9xInterface(open9xInterface) { taranisSimulatorBoard = GetEepromInterface()->getBoard(); - QSettings settings; - QString path=settings.value("sdPath", ".").toString()+"/"; + QString path=g.profile[g.id()].sdPath()+"/"; int i=0; for (i=0; i< std::min(path.length(),1022); i++) { simuSdDirectory[i]=path.at(i).toAscii(); diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 3e740b630..c39de4fc6 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -20,7 +20,7 @@ #define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16) #define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14)) #define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 15 : 12)) -#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 24 : 16)) +#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16)) #define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES) #define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5) @@ -164,7 +164,7 @@ class SourcesConversionTable: public ConversionTable { if (IS_TARANIS(board) && version >= 216) { for (int i=0; i<32; i++) addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++); - for (int i=0; i<3; i++) { + for (int i=0; i<7; i++) { for (int j=0; j<6; j++) { addConversion(RawSource(SOURCE_TYPE_LUA_INPUT, i*16+j), val++); } @@ -896,7 +896,12 @@ class ExpoField: public TransformedField { virtual void afterImport() { - expo.weight = smallGvarToC9x(_weight); + if (IS_TARANIS(board) && version < 216) { + expo.srcRaw = RawSource(SOURCE_TYPE_STICK, expo.chn); + } + + expo.weight = smallGvarToC9x(_weight); + if (!IS_TARANIS(board) || version < 216) { if (!_curveMode) expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam)); @@ -1424,7 +1429,9 @@ class ArmCustomFunctionField: public TransformedField { internalField.Append(new SwitchField<8>(fn.swtch, board, version)); internalField.Append(new ConversionField< UnsignedField<8> >((unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); - if (IS_TARANIS(board)) + if (IS_TARANIS(board) && version >= 216) + internalField.Append(new CharField<8>(_param, false)); + else if (IS_TARANIS(board)) internalField.Append(new CharField<10>(_param, false)); else internalField.Append(new CharField<6>(_param, false)); @@ -2203,7 +2210,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u } if (IS_TARANIS(board) && version >= 216) { - for (int i=0; i<3; i++) { + for (int i=0; i<7; i++) { ScriptData & script = modelData.scriptData[i]; internalField.Append(new ZCharField<10>(script.filename)); internalField.Append(new ZCharField<10>(script.name)); diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 420127df4..2f4b0409b 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -26,6 +26,7 @@ #include "opentxSky9xsimulator.h" #include "opentxTaranisSimulator.h" #include "file.h" +#include "appdata.h" #define FILE_TYP_GENERAL 1 #define FILE_TYP_MODEL 2 @@ -516,7 +517,7 @@ int OpenTxInterface::getCapability(const Capability capability) return (IS_TARANIS(board) ? 22 : 9); case CustomFunctions: if (IS_ARM(board)) - return 32; + return 64; else if (board==BOARD_GRUVIN9X||board==BOARD_M128) return 24; else @@ -549,7 +550,7 @@ int OpenTxInterface::getCapability(const Capability capability) case VoicesAsNumbers: return (IS_ARM(board) ? 0 : 1); case VoicesMaxLength: - return (IS_ARM(board) ? (IS_TARANIS(board) ? 10 : 6) : 0); + return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : 0); case MultiLangVoice: return (IS_ARM(board) ? 1 : 0); case SoundPitch: @@ -934,9 +935,11 @@ bool OpenTxInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esiz QString geturl( int board) { - QSettings settings; - QString url = settings.value("compilation-server", OPENTX_FIRMWARE_DOWNLOADS).toString(); - + QString url = g.compileServer(); + if (url.isEmpty()){ + url= OPENTX_FIRMWARE_DOWNLOADS; + g.compileServer(url); + } switch(board) { case BOARD_STOCK: case BOARD_M128: @@ -957,8 +960,11 @@ QString geturl( int board) QString getstamp( int board) { - QSettings settings; - QString url = settings.value("compilation-server", OPENTX_FIRMWARE_DOWNLOADS).toString(); + QString url = g.compileServer(); + if (url.isEmpty()){ + url= OPENTX_FIRMWARE_DOWNLOADS; + g.compileServer(url); + } url.append("/stamp-opentx-"); switch(board) { case BOARD_STOCK: @@ -986,8 +992,11 @@ QString getstamp( int board) QString getrnurl( int board) { - QSettings settings; - QString url = settings.value("compilation-server", OPENTX_FIRMWARE_DOWNLOADS).toString(); + QString url = g.compileServer(); + if (url.isEmpty()){ + url= OPENTX_FIRMWARE_DOWNLOADS; + g.compileServer(url); + } url.append("/releasenotes-"); switch(board) { case BOARD_STOCK: @@ -1213,9 +1222,7 @@ void RegisterOpen9xFirmwares() open9x->addOptions(fai_options); firmwares.push_back(open9x); - QSettings settings; - int rev4a = settings.value("rev4asupport",0).toInt(); - if (rev4a) { + if (g.rev4aSupport()) { open9x = new Open9xFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), new OpenTxInterface(BOARD_TARANIS_REV4a), geturl(BOARD_TARANIS_REV4a), getstamp(BOARD_TARANIS_REV4a),getrnurl(BOARD_TARANIS), true); open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu")); diff --git a/companion/src/firmwares/th9x/th9xinterface.cpp b/companion/src/firmwares/th9x/th9xinterface.cpp index 306d83797..c0f4f7c4e 100644 --- a/companion/src/firmwares/th9x/th9xinterface.cpp +++ b/companion/src/firmwares/th9x/th9xinterface.cpp @@ -19,6 +19,7 @@ #include "th9xeeprom.h" #include "th9xsimulator.h" #include "file.h" +#include "appdata.h" #define FILE_TYP_GENERAL 1 #define FILE_TYP_MODEL 2 @@ -44,8 +45,7 @@ const char * Th9xInterface::getName() const int Th9xInterface::getEEpromSize() { - QSettings settings; - QString avrMCU = settings.value("mcu", QString("m64")).toString(); + QString avrMCU = g.mcu(); if (avrMCU==QString("m128")) { return 2*EESIZE_STOCK; } diff --git a/companion/src/fwpreferencesdialog.cpp b/companion/src/fwpreferencesdialog.cpp index 735e18acc..ec2585ddc 100644 --- a/companion/src/fwpreferencesdialog.cpp +++ b/companion/src/fwpreferencesdialog.cpp @@ -3,6 +3,7 @@ #include "mainwindow.h" #include "eeprominterface.h" #include "helpers.h" +#include "appdata.h" #include #include @@ -187,11 +188,8 @@ void fwPreferencesDialog::firmwareChanged() ui->CPU_ID_LE->hide(); ui->CPU_ID_LABEL->hide(); } - QSettings settings; - settings.beginGroup("FwRevisions"); - int fwrev = settings.value(variant.id, -1).toInt(); - settings.endGroup(); - if (fwrev != -1) { + int fwrev = g.fwRev.get(variant.id); + if (fwrev != 0) { ui->FwInfo->setText(tr("Last downloaded release: %1").arg(fwrev)); if (!stamp.isEmpty()) { ui->checkFWUpdates->show(); @@ -213,11 +211,9 @@ void fwPreferencesDialog::firmwareChanged() void fwPreferencesDialog::writeValues() { - QSettings settings; - - settings.setValue("cpu_id", ui->CPU_ID_LE->text()); + g.cpuId( ui->CPU_ID_LE->text() ); current_firmware_variant = getFirmwareVariant(); - settings.setValue("firmware", current_firmware_variant.id); + g.profile[g.id()].fwType( current_firmware_variant.id ); } void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware) @@ -275,9 +271,7 @@ void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware) void fwPreferencesDialog::initSettings() { - QSettings settings; - - ui->CPU_ID_LE->setText(settings.value("cpu_id", "").toString()); + ui->CPU_ID_LE->setText(g.cpuId()); FirmwareInfo * current_firmware = GetCurrentFirmware(); foreach(FirmwareInfo * firmware, firmwares) { @@ -293,12 +287,10 @@ void fwPreferencesDialog::initSettings() void fwPreferencesDialog::on_checkFWUpdates_clicked() { - QSettings settings; - FirmwareVariant variant = getFirmwareVariant(); - if (settings.value("burnFirmware", true).toBool()) { + if (g.profile[g.id()].burnFirmware()) { current_firmware_variant = variant; - settings.setValue("firmware", variant.id); + g.profile[g.id()].fwType( variant.id ); } MainWindow * mw = (MainWindow *)this->parent(); mw->checkForUpdates(true, variant.id); @@ -307,14 +299,13 @@ void fwPreferencesDialog::on_checkFWUpdates_clicked() void fwPreferencesDialog::on_fw_dnld_clicked() { - QSettings settings; MainWindow * mw = (MainWindow *)this->parent(); FirmwareVariant variant = getFirmwareVariant(); writeValues(); if (!variant.firmware->getUrl(variant.id).isNull()) { - if (settings.value("burnFirmware", true).toBool()) { + if (g.profile[g.id()].burnFirmware()) { current_firmware_variant = getFirmwareVariant(); - settings.setValue("firmware", current_firmware_variant.id); + g.profile[g.id()].fwType( current_firmware_variant.id ); } mw->downloadLatestFW(current_firmware_variant.firmware, current_firmware_variant.id); } diff --git a/companion/src/generaledit.cpp b/companion/src/generaledit.cpp index ebd443e6b..8cccc654c 100644 --- a/companion/src/generaledit.cpp +++ b/companion/src/generaledit.cpp @@ -1,9 +1,9 @@ #include "generaledit.h" #include "ui_generaledit.h" #include "helpers.h" +#include "appdata.h" #include -#define MAX_PROFILES 10 #define BIT_WARN_THR ( 0x01 ) #define BIT_WARN_SW ( 0x02 ) #define BIT_WARN_MEM ( 0x04 ) @@ -20,18 +20,12 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : ui->setupUi(this); this->setWindowIcon(CompanionIcon("open.png")); - QSettings settings; - QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString(); - ui->tabWidget->setCurrentIndex(settings.value("generalEditTab", 0).toInt()); - int profile_id=settings.value("profileId", 0).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profile_id); - settings.beginGroup(profile); - QString name=settings.value("Name","").toString(); + QString firmware_id = g.profile[g.id()].fwType(); + ui->tabWidget->setCurrentIndex( g.generalEditTab() ); + QString name=g.profile[g.id()].name(); if (name.isEmpty()) { ui->calstore_PB->setDisabled(true); } - settings.endGroup(); EEPROMInterface *eepromInterface = GetEepromInterface(); QLabel * pmsl[] = {ui->ro_label,ui->ro1_label,ui->ro2_label,ui->ro3_label,ui->ro4_label,ui->ro5_label,ui->ro6_label,ui->ro7_label,ui->ro8_label, NULL}; QSlider * tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL}; @@ -76,18 +70,14 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : } ui->profile_CB->clear(); for ( int i = 0; i < MAX_PROFILES; ++i) { - QString profile=QString("profile%1").arg(i+1); - settings.beginGroup(profile); - QString name=settings.value("Name","").toString(); + QString name=g.profile[i].name(); if (!name.isEmpty()) { - ui->profile_CB->addItem(name, i+1); - if ((i+1)==profile_id) { + ui->profile_CB->addItem(name, i); + if (i==g.id()) { ui->profile_CB->setCurrentIndex(ui->profile_CB->count()-1); } } - settings.endGroup(); } - settings.endGroup(); QRegExp rx(CHAR_FOR_NAMES_REGEX); ui->ownerNameLE->setValidator(new QRegExpValidator(rx, this)); @@ -970,9 +960,7 @@ void GeneralEdit::on_PPM4_editingFinished() void GeneralEdit::on_tabWidget_currentChanged(int index) { - // TODO why er9x here - QSettings settings; - settings.setValue("generalEditTab",index);//ui->tabWidget->currentIndex()); + g.generalEditTab(index); } @@ -1220,31 +1208,23 @@ void GeneralEdit::on_swGEAChkB_stateChanged(int ) void GeneralEdit::on_calretrieve_PB_clicked() { - QSettings settings; int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profile_id); - settings.beginGroup(profile); - QString calib=settings.value("StickPotCalib","").toString(); + QString calib=g.profile[profile_id].stickPotCalib(); int potsnum=GetEepromInterface()->getCapability(Pots); if (calib.isEmpty()) { - settings.endGroup(); - settings.endGroup(); return; } else { - QString trainercalib=settings.value("TrainerCalib","").toString(); - int8_t vBatCalib=(int8_t)settings.value("VbatCalib", g_eeGeneral.vBatCalib).toInt(); - int8_t currentCalib=(int8_t)settings.value("currentCalib", g_eeGeneral.currentCalib).toInt(); - int8_t PPM_Multiplier=(int8_t)settings.value("PPM_Multiplier", g_eeGeneral.PPM_Multiplier).toInt(); - uint8_t GSStickMode=(uint8_t)settings.value("GSStickMode", g_eeGeneral.stickMode).toUInt(); - uint8_t vBatWarn=(uint8_t)settings.value("vBatWarn",g_eeGeneral.vBatWarn).toUInt(); - QString DisplaySet=settings.value("Display","").toString(); - QString BeeperSet=settings.value("Beeper","").toString(); - QString HapticSet=settings.value("Haptic","").toString(); - QString SpeakerSet=settings.value("Speaker","").toString(); - QString CountrySet=settings.value("countryCode","").toString(); - settings.endGroup(); - settings.endGroup(); + QString trainercalib = g.profile[profile_id].trainerCalib(); + int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib(); + int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib(); + int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier(); + uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode(); + uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn(); + QString DisplaySet = g.profile[profile_id].display(); + QString BeeperSet = g.profile[profile_id].beeper(); + QString HapticSet = g.profile[profile_id].haptic(); + QString SpeakerSet = g.profile[profile_id].speaker(); + QString CountrySet = g.profile[profile_id].countryCode(); if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) { QString Byte; @@ -1337,27 +1317,20 @@ void GeneralEdit::on_calretrieve_PB_clicked() void GeneralEdit::on_calstore_PB_clicked() { - QSettings settings; int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profile_id); - settings.beginGroup(profile); - QString name=settings.value("Name","").toString(); + + QString name=g.profile[profile_id].name(); int potsnum=GetEepromInterface()->getCapability(Pots); if (name.isEmpty()) { ui->calstore_PB->setDisabled(true); - settings.endGroup(); - settings.endGroup(); return; } else { - QString calib=settings.value("StickPotCalib","").toString(); + QString calib=g.profile[profile_id].stickPotCalib(); if (!(calib.isEmpty())) { int ret = QMessageBox::question(this, "Companion", tr("Do you want to store calibration in %1 profile
overwriting existing calibration?").arg(name) , QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::No) { - settings.endGroup(); - settings.endGroup(); return; } } @@ -1367,24 +1340,22 @@ void GeneralEdit::on_calstore_PB_clicked() calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanNeg[i], 4, 16, QChar('0'))); calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanPos[i], 4, 16, QChar('0'))); } - settings.setValue("StickPotCalib",calib); + g.profile[profile_id].stickPotCalib( calib ); calib.clear(); for (int i=0; i< 4; i++) { calib.append(QString("%1").arg((uint16_t)g_eeGeneral.trainer.calib[i], 4, 16, QChar('0'))); } - settings.setValue("TrainerCalib",calib); - settings.setValue("VbatCalib",g_eeGeneral.vBatCalib); - settings.setValue("currentCalib",g_eeGeneral.currentCalib); - settings.setValue("vBatWarn",g_eeGeneral.vBatWarn); - settings.setValue("PPM_Multiplier",g_eeGeneral.PPM_Multiplier); - settings.setValue("GSStickMode",g_eeGeneral.stickMode); - settings.setValue("Display",QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0'))); - settings.setValue("Beeper",QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0'))); - settings.setValue("Haptic",QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0'))); - settings.setValue("Speaker",QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0'))); - settings.setValue("countryCode",QString("%1%2%3").arg((uint8_t)g_eeGeneral.countryCode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.imperial, 2, 16, QChar('0')).arg(g_eeGeneral.ttsLanguage)); - settings.endGroup(); - settings.endGroup(); + g.profile[profile_id].trainerCalib( calib ); + g.profile[profile_id].vBatCalib( g_eeGeneral.vBatCalib ); + g.profile[profile_id].currentCalib( g_eeGeneral.currentCalib ); + g.profile[profile_id].vBatWarn( g_eeGeneral.vBatWarn ); + g.profile[profile_id].ppmMultiplier( g_eeGeneral.PPM_Multiplier ); + g.profile[profile_id].gsStickMode( g_eeGeneral.stickMode ); + g.profile[profile_id].display( QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0')) ); + g.profile[profile_id].beeper( QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0'))); + g.profile[profile_id].haptic( QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0'))); + g.profile[profile_id].speaker( QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0'))); + g.profile[profile_id].countryCode( QString("%1%2%3").arg((uint8_t)g_eeGeneral.countryCode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.imperial, 2, 16, QChar('0')).arg(g_eeGeneral.ttsLanguage)); QMessageBox::information(this, "Companion", tr("Calibration and HW parameters saved.")); } } diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 6b3a54220..2c7f9fc0c 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -1,6 +1,8 @@ #include +#include "appdata.h" #include "helpers.h" #include "simulatordialog.h" +#include "flashinterface.h" QString getPhaseName(int val, char * phasename) { @@ -693,6 +695,14 @@ QString image2qstring(QImage image) return ImageStr; } +// TODO KKERNEN 20140222 +// I am sure that this code has had some kind of function, but now it only seems to cause +// problems. I think it is an attempt to open an image file from a double byte string which +// is first converted to a single byte string. Only used in burndialog.cpp +// It doesn't work for me in 2.0. I do not know why. I doubt it has ever worked for files or +// file paths containing non-english characters. +// Code can be removed ,when 2.0 is tested. + QImage qstring2image(QString imagestr) { bool ok; @@ -875,8 +885,7 @@ QString getCenterBeep(ModelData * g_model) QString getTheme() { - QSettings settings; - int theme_set = settings.value("theme", 1).toInt(); + int theme_set = g.theme(); QString Theme; switch(theme_set) { case 0: @@ -938,3 +947,24 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx) QObject::tr("Simulator for this firmware is not yet available")); } } + +QPixmap makePixMap( QImage image, QString firmwareType ) +{ + if (firmwareType.contains( "taranis" )) { + image = image.convertToFormat(QImage::Format_RGB32); + QRgb col; + int gray; + for (int i = 0; i < image.width(); ++i) { + for (int j = 0; j < image.height(); ++j) { + col = image.pixel(i, j); + gray = qGray(col); + image.setPixel(i, j, qRgb(gray, gray, gray)); + } + } + image = image.scaled(SPLASHX9D_WIDTH, SPLASHX9D_HEIGHT); + } + else { + image = image.scaled(SPLASH_WIDTH, SPLASH_HEIGHT).convertToFormat(QImage::Format_Mono); + } + return(QPixmap::fromImage(image)); +} diff --git a/companion/src/helpers.h b/companion/src/helpers.h index fdebcb170..5d667e5d8 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -128,4 +128,6 @@ QString getFrSkySrc(int index); void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx); +QPixmap makePixMap( QImage image, QString firmwareType ); + #endif // HELPERS_H diff --git a/companion/src/images/library/00001.png b/companion/src/images/library/00001.png index 57c8485a9..43cd387dc 100644 Binary files a/companion/src/images/library/00001.png and b/companion/src/images/library/00001.png differ diff --git a/companion/src/images/library/00002.png b/companion/src/images/library/00002.png index d7f9c54b0..37b24b0d7 100644 Binary files a/companion/src/images/library/00002.png and b/companion/src/images/library/00002.png differ diff --git a/companion/src/images/library/00003.png b/companion/src/images/library/00003.png index 9f3c5d78e..a179deadf 100644 Binary files a/companion/src/images/library/00003.png and b/companion/src/images/library/00003.png differ diff --git a/companion/src/images/library/00004.png b/companion/src/images/library/00004.png index 60858b556..5982d425c 100644 Binary files a/companion/src/images/library/00004.png and b/companion/src/images/library/00004.png differ diff --git a/companion/src/images/library/00005.png b/companion/src/images/library/00005.png index 6d5a1d93d..802e9885a 100644 Binary files a/companion/src/images/library/00005.png and b/companion/src/images/library/00005.png differ diff --git a/companion/src/images/library/00006.png b/companion/src/images/library/00006.png index 64eca2f66..802e9885a 100644 Binary files a/companion/src/images/library/00006.png and b/companion/src/images/library/00006.png differ diff --git a/companion/src/images/library/00007.png b/companion/src/images/library/00007.png index fa384d1e6..802e9885a 100644 Binary files a/companion/src/images/library/00007.png and b/companion/src/images/library/00007.png differ diff --git a/companion/src/images/library/00008.png b/companion/src/images/library/00008.png index ed7a1c01f..802e9885a 100644 Binary files a/companion/src/images/library/00008.png and b/companion/src/images/library/00008.png differ diff --git a/companion/src/images/library/00009.png b/companion/src/images/library/00009.png index 6d199bb6f..802e9885a 100644 Binary files a/companion/src/images/library/00009.png and b/companion/src/images/library/00009.png differ diff --git a/companion/src/images/library/00010.png b/companion/src/images/library/00010.png index 2b2081c88..0218d0570 100644 Binary files a/companion/src/images/library/00010.png and b/companion/src/images/library/00010.png differ diff --git a/companion/src/images/library/00012.png b/companion/src/images/library/00012.png index f054a15d8..64eca2f66 100644 Binary files a/companion/src/images/library/00012.png and b/companion/src/images/library/00012.png differ diff --git a/companion/src/images/library/00017.png b/companion/src/images/library/00017.png new file mode 100644 index 000000000..678355ae0 Binary files /dev/null and b/companion/src/images/library/00017.png differ diff --git a/companion/src/images/library/00018.png b/companion/src/images/library/00018.png new file mode 100644 index 000000000..fa384d1e6 Binary files /dev/null and b/companion/src/images/library/00018.png differ diff --git a/companion/src/images/library/00019.png b/companion/src/images/library/00019.png new file mode 100644 index 000000000..6d5a1d93d Binary files /dev/null and b/companion/src/images/library/00019.png differ diff --git a/companion/src/images/library/00020.png b/companion/src/images/library/00020.png new file mode 100644 index 000000000..9f3c5d78e Binary files /dev/null and b/companion/src/images/library/00020.png differ diff --git a/companion/src/images/library/00021.png b/companion/src/images/library/00021.png new file mode 100644 index 000000000..f054a15d8 Binary files /dev/null and b/companion/src/images/library/00021.png differ diff --git a/companion/src/images/library/00022.png b/companion/src/images/library/00022.png new file mode 100644 index 000000000..ed7a1c01f Binary files /dev/null and b/companion/src/images/library/00022.png differ diff --git a/companion/src/images/library/00023.png b/companion/src/images/library/00023.png new file mode 100644 index 000000000..6d199bb6f Binary files /dev/null and b/companion/src/images/library/00023.png differ diff --git a/companion/src/images/library/00024.png b/companion/src/images/library/00024.png new file mode 100644 index 000000000..2b2081c88 Binary files /dev/null and b/companion/src/images/library/00024.png differ diff --git a/companion/src/images/library/00031.png b/companion/src/images/library/00031.png new file mode 100644 index 000000000..4a92323e5 Binary files /dev/null and b/companion/src/images/library/00031.png differ diff --git a/companion/src/images/library/00051.png b/companion/src/images/library/00051.png new file mode 100644 index 000000000..c1f70cd82 Binary files /dev/null and b/companion/src/images/library/00051.png differ diff --git a/companion/src/images/library/00100.png b/companion/src/images/library/00100.png new file mode 100644 index 000000000..12fd5b70f Binary files /dev/null and b/companion/src/images/library/00100.png differ diff --git a/companion/src/images/library/00101.png b/companion/src/images/library/00101.png new file mode 100644 index 000000000..277f90714 Binary files /dev/null and b/companion/src/images/library/00101.png differ diff --git a/companion/src/images/library/00102.png b/companion/src/images/library/00102.png new file mode 100644 index 000000000..5319738e6 Binary files /dev/null and b/companion/src/images/library/00102.png differ diff --git a/companion/src/images/library/00103.png b/companion/src/images/library/00103.png new file mode 100644 index 000000000..ededfb8ac Binary files /dev/null and b/companion/src/images/library/00103.png differ diff --git a/companion/src/images/library/00104.png b/companion/src/images/library/00104.png new file mode 100644 index 000000000..c2649499d Binary files /dev/null and b/companion/src/images/library/00104.png differ diff --git a/companion/src/images/library/00105.png b/companion/src/images/library/00105.png new file mode 100644 index 000000000..c109f03f1 Binary files /dev/null and b/companion/src/images/library/00105.png differ diff --git a/companion/src/images/library/00106.png b/companion/src/images/library/00106.png new file mode 100644 index 000000000..01476b196 Binary files /dev/null and b/companion/src/images/library/00106.png differ diff --git a/companion/src/images/library/00201.png b/companion/src/images/library/00201.png new file mode 100644 index 000000000..a5e6349a3 Binary files /dev/null and b/companion/src/images/library/00201.png differ diff --git a/companion/src/images/library/10011.png b/companion/src/images/library/00202.png similarity index 100% rename from companion/src/images/library/10011.png rename to companion/src/images/library/00202.png diff --git a/companion/src/images/library/10007.png b/companion/src/images/library/00203.png similarity index 100% rename from companion/src/images/library/10007.png rename to companion/src/images/library/00203.png diff --git a/companion/src/images/library/10015.png b/companion/src/images/library/00204.png similarity index 100% rename from companion/src/images/library/10015.png rename to companion/src/images/library/00204.png diff --git a/companion/src/images/library/10094.png b/companion/src/images/library/00301.png similarity index 100% rename from companion/src/images/library/10094.png rename to companion/src/images/library/00301.png diff --git a/companion/src/images/library/10096.png b/companion/src/images/library/00302.png similarity index 100% rename from companion/src/images/library/10096.png rename to companion/src/images/library/00302.png diff --git a/companion/src/images/library/10070.png b/companion/src/images/library/00303.png similarity index 100% rename from companion/src/images/library/10070.png rename to companion/src/images/library/00303.png diff --git a/companion/src/images/library/00304.png b/companion/src/images/library/00304.png new file mode 100644 index 000000000..936732b2e Binary files /dev/null and b/companion/src/images/library/00304.png differ diff --git a/companion/src/images/library/00401.png b/companion/src/images/library/00401.png new file mode 100644 index 000000000..553abc70b Binary files /dev/null and b/companion/src/images/library/00401.png differ diff --git a/companion/src/images/library/00402.png b/companion/src/images/library/00402.png new file mode 100644 index 000000000..ec94b1a34 Binary files /dev/null and b/companion/src/images/library/00402.png differ diff --git a/companion/src/images/library/00403.png b/companion/src/images/library/00403.png new file mode 100644 index 000000000..71e3824f6 Binary files /dev/null and b/companion/src/images/library/00403.png differ diff --git a/companion/src/images/library/00404.png b/companion/src/images/library/00404.png new file mode 100644 index 000000000..9715eb04c Binary files /dev/null and b/companion/src/images/library/00404.png differ diff --git a/companion/src/images/library/00501.png b/companion/src/images/library/00501.png new file mode 100644 index 000000000..44bb7ad5a Binary files /dev/null and b/companion/src/images/library/00501.png differ diff --git a/companion/src/images/library/01001.png b/companion/src/images/library/01001.png deleted file mode 100644 index 47fec20ff..000000000 Binary files a/companion/src/images/library/01001.png and /dev/null differ diff --git a/companion/src/images/library/01002.png b/companion/src/images/library/01002.png deleted file mode 100644 index e83381a48..000000000 Binary files a/companion/src/images/library/01002.png and /dev/null differ diff --git a/companion/src/images/library/01003.png b/companion/src/images/library/01003.png deleted file mode 100644 index 88f5676db..000000000 Binary files a/companion/src/images/library/01003.png and /dev/null differ diff --git a/companion/src/images/library/01004.png b/companion/src/images/library/01004.png deleted file mode 100644 index bc2a06103..000000000 Binary files a/companion/src/images/library/01004.png and /dev/null differ diff --git a/companion/src/images/library/01005.png b/companion/src/images/library/01005.png deleted file mode 100644 index b4aea5dfe..000000000 Binary files a/companion/src/images/library/01005.png and /dev/null differ diff --git a/companion/src/images/library/01006.png b/companion/src/images/library/01006.png deleted file mode 100644 index 448f590da..000000000 Binary files a/companion/src/images/library/01006.png and /dev/null differ diff --git a/companion/src/images/library/01007.png b/companion/src/images/library/01007.png deleted file mode 100644 index cb9a53702..000000000 Binary files a/companion/src/images/library/01007.png and /dev/null differ diff --git a/companion/src/images/library/01008.png b/companion/src/images/library/01008.png deleted file mode 100644 index da3346f7d..000000000 Binary files a/companion/src/images/library/01008.png and /dev/null differ diff --git a/companion/src/images/library/10001.png b/companion/src/images/library/10001.png index 51e85006a..8abdaba2a 100644 Binary files a/companion/src/images/library/10001.png and b/companion/src/images/library/10001.png differ diff --git a/companion/src/images/library/10002.png b/companion/src/images/library/10002.png index 47b108be9..ac46509c2 100644 Binary files a/companion/src/images/library/10002.png and b/companion/src/images/library/10002.png differ diff --git a/companion/src/images/library/10003.png b/companion/src/images/library/10003.png index ad62abd01..0fa584dbb 100644 Binary files a/companion/src/images/library/10003.png and b/companion/src/images/library/10003.png differ diff --git a/companion/src/images/library/10004.png b/companion/src/images/library/10004.png deleted file mode 100644 index 1a93226b7..000000000 Binary files a/companion/src/images/library/10004.png and /dev/null differ diff --git a/companion/src/images/library/10005.png b/companion/src/images/library/10005.png deleted file mode 100644 index b25163b8c..000000000 Binary files a/companion/src/images/library/10005.png and /dev/null differ diff --git a/companion/src/images/library/10006.png b/companion/src/images/library/10006.png deleted file mode 100644 index ca77bbd87..000000000 Binary files a/companion/src/images/library/10006.png and /dev/null differ diff --git a/companion/src/images/library/10008.png b/companion/src/images/library/10008.png deleted file mode 100644 index 9616e2c12..000000000 Binary files a/companion/src/images/library/10008.png and /dev/null differ diff --git a/companion/src/images/library/10009.png b/companion/src/images/library/10009.png deleted file mode 100644 index 1919fc94b..000000000 Binary files a/companion/src/images/library/10009.png and /dev/null differ diff --git a/companion/src/images/library/10010.png b/companion/src/images/library/10010.png deleted file mode 100644 index 0ef805645..000000000 Binary files a/companion/src/images/library/10010.png and /dev/null differ diff --git a/companion/src/images/library/10012.png b/companion/src/images/library/10012.png deleted file mode 100644 index 6007e75d4..000000000 Binary files a/companion/src/images/library/10012.png and /dev/null differ diff --git a/companion/src/images/library/10013.png b/companion/src/images/library/10013.png deleted file mode 100644 index dc8a5efc7..000000000 Binary files a/companion/src/images/library/10013.png and /dev/null differ diff --git a/companion/src/images/library/10014.png b/companion/src/images/library/10014.png deleted file mode 100644 index 6a306d3b2..000000000 Binary files a/companion/src/images/library/10014.png and /dev/null differ diff --git a/companion/src/images/library/10016.png b/companion/src/images/library/10016.png deleted file mode 100644 index d02cb5ceb..000000000 Binary files a/companion/src/images/library/10016.png and /dev/null differ diff --git a/companion/src/images/library/10017.png b/companion/src/images/library/10017.png deleted file mode 100644 index 13f6ed481..000000000 Binary files a/companion/src/images/library/10017.png and /dev/null differ diff --git a/companion/src/images/library/10018.png b/companion/src/images/library/10018.png deleted file mode 100644 index 552c96540..000000000 Binary files a/companion/src/images/library/10018.png and /dev/null differ diff --git a/companion/src/images/library/10019.png b/companion/src/images/library/10019.png deleted file mode 100644 index fcdc73964..000000000 Binary files a/companion/src/images/library/10019.png and /dev/null differ diff --git a/companion/src/images/library/10020.png b/companion/src/images/library/10020.png deleted file mode 100644 index c40348ee7..000000000 Binary files a/companion/src/images/library/10020.png and /dev/null differ diff --git a/companion/src/images/library/10021.png b/companion/src/images/library/10021.png deleted file mode 100644 index 69ea3ad14..000000000 Binary files a/companion/src/images/library/10021.png and /dev/null differ diff --git a/companion/src/images/library/10022.png b/companion/src/images/library/10022.png deleted file mode 100644 index cb746eb74..000000000 Binary files a/companion/src/images/library/10022.png and /dev/null differ diff --git a/companion/src/images/library/10023.png b/companion/src/images/library/10023.png deleted file mode 100644 index 784dbf355..000000000 Binary files a/companion/src/images/library/10023.png and /dev/null differ diff --git a/companion/src/images/library/10024.png b/companion/src/images/library/10024.png deleted file mode 100644 index 4066cd8e0..000000000 Binary files a/companion/src/images/library/10024.png and /dev/null differ diff --git a/companion/src/images/library/10025.png b/companion/src/images/library/10025.png deleted file mode 100644 index 8a1562e52..000000000 Binary files a/companion/src/images/library/10025.png and /dev/null differ diff --git a/companion/src/images/library/10026.png b/companion/src/images/library/10026.png deleted file mode 100644 index 704865b0c..000000000 Binary files a/companion/src/images/library/10026.png and /dev/null differ diff --git a/companion/src/images/library/10027.png b/companion/src/images/library/10027.png deleted file mode 100644 index b872dd0b2..000000000 Binary files a/companion/src/images/library/10027.png and /dev/null differ diff --git a/companion/src/images/library/10028.png b/companion/src/images/library/10028.png deleted file mode 100644 index 842a14dd5..000000000 Binary files a/companion/src/images/library/10028.png and /dev/null differ diff --git a/companion/src/images/library/10029.png b/companion/src/images/library/10029.png deleted file mode 100644 index 800465056..000000000 Binary files a/companion/src/images/library/10029.png and /dev/null differ diff --git a/companion/src/images/library/10030.png b/companion/src/images/library/10030.png deleted file mode 100644 index 705741cea..000000000 Binary files a/companion/src/images/library/10030.png and /dev/null differ diff --git a/companion/src/images/library/10031.png b/companion/src/images/library/10031.png deleted file mode 100644 index 41d3a526f..000000000 Binary files a/companion/src/images/library/10031.png and /dev/null differ diff --git a/companion/src/images/library/10032.png b/companion/src/images/library/10032.png deleted file mode 100644 index 1ed9a3801..000000000 Binary files a/companion/src/images/library/10032.png and /dev/null differ diff --git a/companion/src/images/library/10033.png b/companion/src/images/library/10033.png deleted file mode 100644 index 1e39ed5b4..000000000 Binary files a/companion/src/images/library/10033.png and /dev/null differ diff --git a/companion/src/images/library/10034.png b/companion/src/images/library/10034.png deleted file mode 100644 index cc8b37afb..000000000 Binary files a/companion/src/images/library/10034.png and /dev/null differ diff --git a/companion/src/images/library/10035.png b/companion/src/images/library/10035.png deleted file mode 100644 index 2e14bc941..000000000 Binary files a/companion/src/images/library/10035.png and /dev/null differ diff --git a/companion/src/images/library/10036.png b/companion/src/images/library/10036.png deleted file mode 100644 index e4eb4667f..000000000 Binary files a/companion/src/images/library/10036.png and /dev/null differ diff --git a/companion/src/images/library/10037.png b/companion/src/images/library/10037.png deleted file mode 100644 index 7e85d9fb4..000000000 Binary files a/companion/src/images/library/10037.png and /dev/null differ diff --git a/companion/src/images/library/10038.png b/companion/src/images/library/10038.png deleted file mode 100644 index 69425a5d3..000000000 Binary files a/companion/src/images/library/10038.png and /dev/null differ diff --git a/companion/src/images/library/10039.png b/companion/src/images/library/10039.png deleted file mode 100644 index 586fae0a5..000000000 Binary files a/companion/src/images/library/10039.png and /dev/null differ diff --git a/companion/src/images/library/10040.png b/companion/src/images/library/10040.png deleted file mode 100644 index a6f575c6f..000000000 Binary files a/companion/src/images/library/10040.png and /dev/null differ diff --git a/companion/src/images/library/10041.png b/companion/src/images/library/10041.png deleted file mode 100644 index d7c509449..000000000 Binary files a/companion/src/images/library/10041.png and /dev/null differ diff --git a/companion/src/images/library/10042.png b/companion/src/images/library/10042.png deleted file mode 100644 index 6f4aa2b68..000000000 Binary files a/companion/src/images/library/10042.png and /dev/null differ diff --git a/companion/src/images/library/10043.png b/companion/src/images/library/10043.png deleted file mode 100644 index 7ff6f4bc7..000000000 Binary files a/companion/src/images/library/10043.png and /dev/null differ diff --git a/companion/src/images/library/10044.png b/companion/src/images/library/10044.png deleted file mode 100644 index 0f5ec33dc..000000000 Binary files a/companion/src/images/library/10044.png and /dev/null differ diff --git a/companion/src/images/library/10045.png b/companion/src/images/library/10045.png deleted file mode 100644 index 4e195cbb4..000000000 Binary files a/companion/src/images/library/10045.png and /dev/null differ diff --git a/companion/src/images/library/10046.png b/companion/src/images/library/10046.png deleted file mode 100644 index 99cbb9bb7..000000000 Binary files a/companion/src/images/library/10046.png and /dev/null differ diff --git a/companion/src/images/library/10047.png b/companion/src/images/library/10047.png deleted file mode 100644 index 263ef7508..000000000 Binary files a/companion/src/images/library/10047.png and /dev/null differ diff --git a/companion/src/images/library/10048.png b/companion/src/images/library/10048.png deleted file mode 100644 index 4f1ddcb8f..000000000 Binary files a/companion/src/images/library/10048.png and /dev/null differ diff --git a/companion/src/images/library/10049.png b/companion/src/images/library/10049.png deleted file mode 100644 index 1b00b73b3..000000000 Binary files a/companion/src/images/library/10049.png and /dev/null differ diff --git a/companion/src/images/library/10050.png b/companion/src/images/library/10050.png deleted file mode 100644 index 13f2c3748..000000000 Binary files a/companion/src/images/library/10050.png and /dev/null differ diff --git a/companion/src/images/library/10051.png b/companion/src/images/library/10051.png deleted file mode 100644 index 00ef00a9e..000000000 Binary files a/companion/src/images/library/10051.png and /dev/null differ diff --git a/companion/src/images/library/10052.png b/companion/src/images/library/10052.png deleted file mode 100644 index 00adf5621..000000000 Binary files a/companion/src/images/library/10052.png and /dev/null differ diff --git a/companion/src/images/library/10054.png b/companion/src/images/library/10054.png deleted file mode 100644 index 149e35ada..000000000 Binary files a/companion/src/images/library/10054.png and /dev/null differ diff --git a/companion/src/images/library/10055.png b/companion/src/images/library/10055.png deleted file mode 100644 index 52ae8827b..000000000 Binary files a/companion/src/images/library/10055.png and /dev/null differ diff --git a/companion/src/images/library/10056.png b/companion/src/images/library/10056.png deleted file mode 100644 index 7c9be6730..000000000 Binary files a/companion/src/images/library/10056.png and /dev/null differ diff --git a/companion/src/images/library/10057.png b/companion/src/images/library/10057.png deleted file mode 100644 index ffe4fd58b..000000000 Binary files a/companion/src/images/library/10057.png and /dev/null differ diff --git a/companion/src/images/library/10058.png b/companion/src/images/library/10058.png deleted file mode 100644 index b8a0117fb..000000000 Binary files a/companion/src/images/library/10058.png and /dev/null differ diff --git a/companion/src/images/library/10059.png b/companion/src/images/library/10059.png deleted file mode 100644 index 3d5e9bfc0..000000000 Binary files a/companion/src/images/library/10059.png and /dev/null differ diff --git a/companion/src/images/library/10060.png b/companion/src/images/library/10060.png deleted file mode 100644 index 2837c5398..000000000 Binary files a/companion/src/images/library/10060.png and /dev/null differ diff --git a/companion/src/images/library/10061.png b/companion/src/images/library/10061.png deleted file mode 100644 index 2aec8a703..000000000 Binary files a/companion/src/images/library/10061.png and /dev/null differ diff --git a/companion/src/images/library/10062.png b/companion/src/images/library/10062.png deleted file mode 100644 index 810efb9a9..000000000 Binary files a/companion/src/images/library/10062.png and /dev/null differ diff --git a/companion/src/images/library/10063.png b/companion/src/images/library/10063.png deleted file mode 100644 index 2cd293505..000000000 Binary files a/companion/src/images/library/10063.png and /dev/null differ diff --git a/companion/src/images/library/10064.png b/companion/src/images/library/10064.png deleted file mode 100644 index 6354a2a18..000000000 Binary files a/companion/src/images/library/10064.png and /dev/null differ diff --git a/companion/src/images/library/10065.png b/companion/src/images/library/10065.png deleted file mode 100644 index 87010d65e..000000000 Binary files a/companion/src/images/library/10065.png and /dev/null differ diff --git a/companion/src/images/library/10066.png b/companion/src/images/library/10066.png deleted file mode 100644 index db4917113..000000000 Binary files a/companion/src/images/library/10066.png and /dev/null differ diff --git a/companion/src/images/library/10067.png b/companion/src/images/library/10067.png deleted file mode 100644 index f188c03a8..000000000 Binary files a/companion/src/images/library/10067.png and /dev/null differ diff --git a/companion/src/images/library/10068.png b/companion/src/images/library/10068.png deleted file mode 100644 index b70eb70d7..000000000 Binary files a/companion/src/images/library/10068.png and /dev/null differ diff --git a/companion/src/images/library/10069.png b/companion/src/images/library/10069.png deleted file mode 100644 index 3eb68b5b2..000000000 Binary files a/companion/src/images/library/10069.png and /dev/null differ diff --git a/companion/src/images/library/10071.png b/companion/src/images/library/10071.png deleted file mode 100644 index fa9c6cde7..000000000 Binary files a/companion/src/images/library/10071.png and /dev/null differ diff --git a/companion/src/images/library/10072.png b/companion/src/images/library/10072.png deleted file mode 100644 index 82189cd46..000000000 Binary files a/companion/src/images/library/10072.png and /dev/null differ diff --git a/companion/src/images/library/10073.png b/companion/src/images/library/10073.png deleted file mode 100644 index 37f11ea34..000000000 Binary files a/companion/src/images/library/10073.png and /dev/null differ diff --git a/companion/src/images/library/10074.png b/companion/src/images/library/10074.png deleted file mode 100644 index abf8c3ae2..000000000 Binary files a/companion/src/images/library/10074.png and /dev/null differ diff --git a/companion/src/images/library/10075.png b/companion/src/images/library/10075.png deleted file mode 100644 index e17abfdf7..000000000 Binary files a/companion/src/images/library/10075.png and /dev/null differ diff --git a/companion/src/images/library/10076.png b/companion/src/images/library/10076.png deleted file mode 100644 index 30bd5f62f..000000000 Binary files a/companion/src/images/library/10076.png and /dev/null differ diff --git a/companion/src/images/library/10077.png b/companion/src/images/library/10077.png deleted file mode 100644 index 5cdddbb0b..000000000 Binary files a/companion/src/images/library/10077.png and /dev/null differ diff --git a/companion/src/images/library/10078.png b/companion/src/images/library/10078.png deleted file mode 100644 index 3dc842400..000000000 Binary files a/companion/src/images/library/10078.png and /dev/null differ diff --git a/companion/src/images/library/10079.png b/companion/src/images/library/10079.png deleted file mode 100644 index 387dc81be..000000000 Binary files a/companion/src/images/library/10079.png and /dev/null differ diff --git a/companion/src/images/library/10080.png b/companion/src/images/library/10080.png deleted file mode 100644 index 46a46e9a4..000000000 Binary files a/companion/src/images/library/10080.png and /dev/null differ diff --git a/companion/src/images/library/10081.png b/companion/src/images/library/10081.png deleted file mode 100644 index 66019bb70..000000000 Binary files a/companion/src/images/library/10081.png and /dev/null differ diff --git a/companion/src/images/library/10082.png b/companion/src/images/library/10082.png deleted file mode 100644 index 5ba72eb8f..000000000 Binary files a/companion/src/images/library/10082.png and /dev/null differ diff --git a/companion/src/images/library/10083.png b/companion/src/images/library/10083.png deleted file mode 100644 index 4619aba26..000000000 Binary files a/companion/src/images/library/10083.png and /dev/null differ diff --git a/companion/src/images/library/10084.png b/companion/src/images/library/10084.png deleted file mode 100644 index d82770ff4..000000000 Binary files a/companion/src/images/library/10084.png and /dev/null differ diff --git a/companion/src/images/library/10085.png b/companion/src/images/library/10085.png deleted file mode 100644 index 644b1d006..000000000 Binary files a/companion/src/images/library/10085.png and /dev/null differ diff --git a/companion/src/images/library/10086.png b/companion/src/images/library/10086.png deleted file mode 100644 index 2f16b8b80..000000000 Binary files a/companion/src/images/library/10086.png and /dev/null differ diff --git a/companion/src/images/library/10087.png b/companion/src/images/library/10087.png deleted file mode 100644 index dedee12ff..000000000 Binary files a/companion/src/images/library/10087.png and /dev/null differ diff --git a/companion/src/images/library/10088.png b/companion/src/images/library/10088.png deleted file mode 100644 index b24fe1a05..000000000 Binary files a/companion/src/images/library/10088.png and /dev/null differ diff --git a/companion/src/images/library/10089.png b/companion/src/images/library/10089.png deleted file mode 100644 index 133c90972..000000000 Binary files a/companion/src/images/library/10089.png and /dev/null differ diff --git a/companion/src/images/library/10090.png b/companion/src/images/library/10090.png deleted file mode 100644 index d45f27e5b..000000000 Binary files a/companion/src/images/library/10090.png and /dev/null differ diff --git a/companion/src/images/library/10091.png b/companion/src/images/library/10091.png deleted file mode 100644 index 192d3304e..000000000 Binary files a/companion/src/images/library/10091.png and /dev/null differ diff --git a/companion/src/images/library/10093.png b/companion/src/images/library/10093.png deleted file mode 100644 index cff628eb3..000000000 Binary files a/companion/src/images/library/10093.png and /dev/null differ diff --git a/companion/src/images/library/10095.png b/companion/src/images/library/10095.png deleted file mode 100644 index 5c03253c8..000000000 Binary files a/companion/src/images/library/10095.png and /dev/null differ diff --git a/companion/src/images/library/10097.png b/companion/src/images/library/10097.png deleted file mode 100644 index 88aecde84..000000000 Binary files a/companion/src/images/library/10097.png and /dev/null differ diff --git a/companion/src/images/library/10098.png b/companion/src/images/library/10098.png deleted file mode 100644 index 0d4249608..000000000 Binary files a/companion/src/images/library/10098.png and /dev/null differ diff --git a/companion/src/images/library/10099.png b/companion/src/images/library/10099.png deleted file mode 100644 index 2d99e224f..000000000 Binary files a/companion/src/images/library/10099.png and /dev/null differ diff --git a/companion/src/images/library/10100.png b/companion/src/images/library/10100.png deleted file mode 100644 index 14001a79a..000000000 Binary files a/companion/src/images/library/10100.png and /dev/null differ diff --git a/companion/src/images/library/10101.png b/companion/src/images/library/10101.png index 1f21c62ea..073c3197b 100644 Binary files a/companion/src/images/library/10101.png and b/companion/src/images/library/10101.png differ diff --git a/companion/src/images/library/10102.png b/companion/src/images/library/10102.png index 28ef0617b..7bfefdce6 100644 Binary files a/companion/src/images/library/10102.png and b/companion/src/images/library/10102.png differ diff --git a/companion/src/images/library/10103.png b/companion/src/images/library/10103.png index 8fd5c2897..d44f974b5 100644 Binary files a/companion/src/images/library/10103.png and b/companion/src/images/library/10103.png differ diff --git a/companion/src/images/library/10104.png b/companion/src/images/library/10104.png deleted file mode 100644 index 17b0c12a0..000000000 Binary files a/companion/src/images/library/10104.png and /dev/null differ diff --git a/companion/src/images/library/10501.png b/companion/src/images/library/10501.png new file mode 100644 index 000000000..51e85006a Binary files /dev/null and b/companion/src/images/library/10501.png differ diff --git a/companion/src/images/library/10502.png b/companion/src/images/library/10502.png new file mode 100644 index 000000000..47b108be9 Binary files /dev/null and b/companion/src/images/library/10502.png differ diff --git a/companion/src/images/library/10503.png b/companion/src/images/library/10503.png new file mode 100644 index 000000000..1ba8ec880 Binary files /dev/null and b/companion/src/images/library/10503.png differ diff --git a/companion/src/images/library/10504.png b/companion/src/images/library/10504.png new file mode 100644 index 000000000..e64ecb348 Binary files /dev/null and b/companion/src/images/library/10504.png differ diff --git a/companion/src/images/library/10505.png b/companion/src/images/library/10505.png new file mode 100644 index 000000000..a623d3376 Binary files /dev/null and b/companion/src/images/library/10505.png differ diff --git a/companion/src/images/library/10506.png b/companion/src/images/library/10506.png new file mode 100644 index 000000000..2fbda686e Binary files /dev/null and b/companion/src/images/library/10506.png differ diff --git a/companion/src/images/library/10508.png b/companion/src/images/library/10508.png new file mode 100644 index 000000000..ed3ce466d Binary files /dev/null and b/companion/src/images/library/10508.png differ diff --git a/companion/src/images/library/10601.png b/companion/src/images/library/10601.png new file mode 100644 index 000000000..782dd9653 Binary files /dev/null and b/companion/src/images/library/10601.png differ diff --git a/companion/src/images/library/10092.png b/companion/src/images/library/10701.png similarity index 100% rename from companion/src/images/library/10092.png rename to companion/src/images/library/10701.png diff --git a/companion/src/images/library/10053.png b/companion/src/images/library/10702.png similarity index 100% rename from companion/src/images/library/10053.png rename to companion/src/images/library/10702.png diff --git a/companion/src/images/library/10801.png b/companion/src/images/library/10801.png new file mode 100644 index 000000000..1ad61712b Binary files /dev/null and b/companion/src/images/library/10801.png differ diff --git a/companion/src/images/library/10802.png b/companion/src/images/library/10802.png new file mode 100644 index 000000000..bbf26657e Binary files /dev/null and b/companion/src/images/library/10802.png differ diff --git a/companion/src/images/library/20001.png b/companion/src/images/library/20001.png deleted file mode 100644 index aaed01ccc..000000000 Binary files a/companion/src/images/library/20001.png and /dev/null differ diff --git a/companion/src/images/library/20002.png b/companion/src/images/library/20002.png deleted file mode 100644 index 3f3d21866..000000000 Binary files a/companion/src/images/library/20002.png and /dev/null differ diff --git a/companion/src/images/library/20003.png b/companion/src/images/library/20003.png deleted file mode 100644 index 166fd4c94..000000000 Binary files a/companion/src/images/library/20003.png and /dev/null differ diff --git a/companion/src/images/library/20004.png b/companion/src/images/library/20004.png deleted file mode 100644 index df09efa35..000000000 Binary files a/companion/src/images/library/20004.png and /dev/null differ diff --git a/companion/src/images/library/30001.png b/companion/src/images/library/30001.png deleted file mode 100644 index a699fad95..000000000 Binary files a/companion/src/images/library/30001.png and /dev/null differ diff --git a/companion/src/images/library/30002.png b/companion/src/images/library/30002.png deleted file mode 100644 index b90ee4ca8..000000000 Binary files a/companion/src/images/library/30002.png and /dev/null differ diff --git a/companion/src/images/library/30003.png b/companion/src/images/library/30003.png deleted file mode 100644 index fe4548967..000000000 Binary files a/companion/src/images/library/30003.png and /dev/null differ diff --git a/companion/src/images/library/30004.png b/companion/src/images/library/30004.png deleted file mode 100644 index 4db2f79bb..000000000 Binary files a/companion/src/images/library/30004.png and /dev/null differ diff --git a/companion/src/images/library/30005.png b/companion/src/images/library/30005.png deleted file mode 100644 index ceeb0b358..000000000 Binary files a/companion/src/images/library/30005.png and /dev/null differ diff --git a/companion/src/images/library/30006.png b/companion/src/images/library/30006.png deleted file mode 100644 index de6493b1c..000000000 Binary files a/companion/src/images/library/30006.png and /dev/null differ diff --git a/companion/src/logsdialog.cpp b/companion/src/logsdialog.cpp index fe7137506..f39a41171 100644 --- a/companion/src/logsdialog.cpp +++ b/companion/src/logsdialog.cpp @@ -1,4 +1,5 @@ #include "logsdialog.h" +#include "appdata.h" #include "ui_logsdialog.h" #include "qcustomplot.h" #include "helpers.h" @@ -40,8 +41,7 @@ logsDialog::logsDialog(QWidget *parent) : ui->customPlot->legend->setSelectedFont(legendFont); ui->customPlot->legend->setSelectable(QCPLegend::spItems); // legend box shall not be selectable, only legend items ui->customPlot->legend->setVisible(false); - QSettings settings; - QString Path=settings.value("gePath", "").toString(); + QString Path=g.gePath(); if (Path.isEmpty() || !QFile(Path).exists()) { ui->mapsButton->hide(); } @@ -204,8 +204,7 @@ void logsDialog::on_mapsButton_clicked() { ,F_F,F_F,F_F,F_F,I_F,I_F,I_F,I_F\ ,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F,I_F}; - QSettings settings; - QString gePath=settings.value("gePath", "").toString(); + QString gePath=g.gePath(); if (gePath.isEmpty() || !QFile(gePath).exists()) { ui->FieldsTW->setDisabled(false); ui->logTable->setDisabled(false); @@ -587,10 +586,9 @@ void logsDialog::moveLegend() void logsDialog::on_fileOpen_BT_clicked() { - QSettings settings; - QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), settings.value("lastLogDir").toString()); + QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.logDir()); if (!fileName.isEmpty()) { - settings.setValue("lastLogDir", fileName); + g.logDir( fileName ); ui->FileName_LE->setText(fileName); if (cvsFileParse()) { ui->FieldsTW->clear(); diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index b553bdb8a..596f6b78c 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -49,7 +49,6 @@ #include "avroutputdialog.h" #include "comparedialog.h" #include "logsdialog.h" -#include "preferencesdialog.h" #include "apppreferencesdialog.h" #include "fwpreferencesdialog.h" #include "flashinterface.h" @@ -63,6 +62,7 @@ #include "hexinterface.h" #include "warnings.h" #include "helpers.h" +#include "appdata.h" #include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include #define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2" @@ -90,23 +90,17 @@ MainWindow::MainWindow(): mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setCentralWidget(mdiArea); - connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), - this, SLOT(updateMenus())); + connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(updateMenus())); windowMapper = new QSignalMapper(this); - connect(windowMapper, SIGNAL(mapped(QWidget*)), - this, SLOT(setActiveSubWindow(QWidget*))); + connect(windowMapper, SIGNAL(mapped(QWidget*)), this, SLOT(setActiveSubWindow(QWidget*))); - MaxRecentFiles=MAX_RECENT; - QSettings settings; - - restoreGeometry(settings.value("mainWindowGeometry").toByteArray()); createActions(); - createMenus(); createToolBars(); createStatusBar(); updateMenus(); - readSettings(); + + restoreState(g.mainWinState()); setUnifiedTitleAndToolBarOnMac(true); this->setWindowIcon(QIcon(":/icon.png")); @@ -116,7 +110,7 @@ MainWindow::MainWindow(): // give time to the splash to disappear and main window to open before starting updates int updateDelay = 1000; - bool showSplash = settings.value("show_splash", true).toBool(); + bool showSplash = g.showSplash(); if (showSplash) { updateDelay += (SPLASH_TIME*1000); } @@ -169,8 +163,7 @@ MainWindow::MainWindow(): void MainWindow::displayWarnings() { - QSettings settings; - int warnId=settings.value("warningId", 0 ).toInt(); + int warnId=g.warningId(); if (warnId0) { @@ -181,10 +174,10 @@ void MainWindow::displayWarnings() res = QMessageBox::question(this, "Companion",tr("Display previous message again at startup ?"),QMessageBox::Yes | QMessageBox::No); } if (res == QMessageBox::No) { - settings.setValue("warningId", WARNING_ID); + g.warningId(WARNING_ID); } } else if (warnId==0) { - settings.setValue("warningId", WARNING_ID); + g.warningId(WARNING_ID); } } @@ -203,12 +196,11 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId) showcheckForUpdatesResult = ignoreSettings; check1done = true; check2done = true; - QSettings settings; fwToUpdate = fwId; QString stamp = GetFirmware(fwToUpdate)->stamp; if (!stamp.isEmpty()) { - if (checkFW || ignoreSettings) { + if (g.autoCheckFw() || ignoreSettings) { check1done=false; manager1 = new QNetworkAccessManager(this); connect(manager1, SIGNAL(finished(QNetworkReply*)), this, SLOT(reply1Finished(QNetworkReply*))); @@ -219,7 +211,7 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId) } } - if (checkCompanion || ignoreSettings) { + if (g.autoCheckApp() || ignoreSettings) { check2done = false; manager2 = new QNetworkAccessManager(this); connect(manager2, SIGNAL(finished(QNetworkReply*)),this, SLOT(checkForUpdateFinished(QNetworkReply*))); @@ -269,16 +261,14 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply) "Would you like to download it?").arg(version) , QMessageBox::Yes | QMessageBox::No); - QSettings settings; - if (ret == QMessageBox::Yes) { #if defined __APPLE__ - QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastUpdatesDir").toString() + QString(C9X_INSTALLER).arg(version)); + QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version)); #else - QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastUpdatesDir").toString() + QString(C9X_INSTALLER).arg(version), tr("Executable (*.exe)")); + QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version), tr("Executable (*.exe)")); #endif if (!fileName.isEmpty()) { - settings.setValue("lastUpdatesDir", QFileInfo(fileName).dir().absolutePath()); + g.updatesDir(QFileInfo(fileName).dir().absolutePath()); downloadDialog * dd = new downloadDialog(this, QString(OPENTX_COMPANION_DOWNLOADS C9X_INSTALLER).arg(version), fileName); installer_fileName = fileName; connect(dd, SIGNAL(accepted()), this, SLOT(updateDownloaded())); @@ -311,20 +301,19 @@ void MainWindow::updateDownloaded() void MainWindow::downloadLatestFW(FirmwareInfo * firmware, const QString & firmwareId) { QString url, ext, cpuid; - QSettings settings; url = firmware->getUrl(firmwareId); - cpuid=settings.value("cpuid","").toString(); + cpuid=g.cpuId(); ext = url.mid(url.lastIndexOf(".")); - QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastFlashDir").toString() + "/" + firmwareId + ext); + QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + firmwareId + ext); if (!fileName.isEmpty()) { downloadedFW = firmwareId; needRename=true; - downloadedFWFilename = fileName; + g.profile[g.id()].fwName( fileName ); if (!cpuid.isEmpty()) { url.append("&cpuid="); url.append(cpuid); } - settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath()); + g.flashDir(QFileInfo(fileName).dir().absolutePath()); downloadDialog * dd = new downloadDialog(this, url, fileName); connect(dd, SIGNAL(accepted()), this, SLOT(reply1Accepted())); dd->exec(); @@ -334,9 +323,7 @@ void MainWindow::downloadLatestFW(FirmwareInfo * firmware, const QString & firmw void MainWindow::reply1Accepted() { QString errormsg; - QSettings settings; - settings.beginGroup("FwRevisions"); - if (downloadedFWFilename.isEmpty()) { + if (g.profile[g.id()].fwName().isEmpty()) { if (!(downloadedFW.isEmpty())) { QFile file(downloadedFW); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file @@ -370,19 +357,18 @@ void MainWindow::reply1Accepted() } file.close(); QMessageBox::critical(this, tr("Error"), errormsg); - settings.endGroup(); return; } file.close(); currentFWrev = currentFWrev_temp; - settings.setValue(downloadedFW, currentFWrev); + g.fwRev.set(downloadedFW, currentFWrev); } } else { - QFile file(downloadedFWFilename); + QFile file(g.profile[g.id()].fwName()); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file QMessageBox::critical(this, tr("Error"), tr("Error opening file %1:\n%2.") - .arg(downloadedFWFilename) + .arg(g.profile[g.id()].fwName()) .arg(file.errorString())); return; } @@ -410,17 +396,16 @@ void MainWindow::reply1Accepted() } file.close(); QMessageBox::critical(this, tr("Error"), errormsg); - settings.endGroup(); return; } file.close(); - FlashInterface flash(downloadedFWFilename); + FlashInterface flash(g.profile[g.id()].fwName()); QString rev=flash.getSvn(); int pos=rev.lastIndexOf("-r"); if (pos>0) { currentFWrev=rev.mid(pos+2).toInt(); - if (settings.value("rename_firmware_files", false).toBool() && needRename) { - QFileInfo fi(downloadedFWFilename); + if (g.profile[g.id()].renameFwFiles() && needRename) { + QFileInfo fi(g.profile[g.id()].fwName()); QString path=fi.path()+QDir::separator (); path.append(fi.completeBaseName()); path.append(rev.mid(pos)); @@ -428,19 +413,18 @@ void MainWindow::reply1Accepted() path.append(fi.suffix()); QDir qd; qd.remove(path); - qd.rename(downloadedFWFilename,path); - downloadedFWFilename=path; + qd.rename(g.profile[g.id()].fwName(),path); + g.profile[g.id()].fwName(path); } - settings.setValue(downloadedFW, currentFWrev); - if (settings.value("burnFirmware", true).toBool()) { + g.fwRev.set(downloadedFW, currentFWrev); + if (g.profile[g.id()].burnFirmware()) { int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::Yes) { - writeFlash(downloadedFWFilename); + writeFlash(g.profile[g.id()].fwName()); } } } } - settings.endGroup(); } void MainWindow::reply1Finished(QNetworkReply * reply) @@ -456,8 +440,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply) // TODO delete downloadDialog_forWait? } - QSettings settings; - cpuid=settings.value("cpuid","").toString(); + cpuid=g.cpuId(); QByteArray qba = reply->readAll(); int i = qba.indexOf("SVN_VERS"); int warning = qba.indexOf("WARNING"); @@ -471,17 +454,13 @@ void MainWindow::reply1Finished(QNetworkReply * reply) if(!cres) { QMessageBox::warning(this, "Companion", tr("Unable to check for updates.")); - int server = settings.value("fwserver",0).toInt(); - server++; - settings.setValue("fwserver",server); + g.fwServerFails(g.fwServerFails()+1); return; } if(rev>0) { NewFwRev=rev; - settings.beginGroup("FwRevisions"); - OldFwRev = settings.value(fwToUpdate, 0).toInt(); - settings.endGroup(); + OldFwRev = g.fwRev.get(fwToUpdate); QMessageBox msgBox; QSpacerItem* horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); QGridLayout* layout = (QGridLayout*)msgBox.layout(); @@ -552,9 +531,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply) if (ignore) { int res = QMessageBox::question(this, "Companion",tr("Ignore this version (r%1)?").arg(rev), QMessageBox::Yes | QMessageBox::No); if (res==QMessageBox::Yes) { - settings.beginGroup("FwRevisions"); - settings.setValue(fwToUpdate, NewFwRev); - settings.endGroup(); + g.fwRev.set(fwToUpdate, NewFwRev); } } else if (download == true) { if (warning>0) { @@ -571,20 +548,20 @@ void MainWindow::reply1Finished(QNetworkReply * reply) QString url = GetFirmware(fwToUpdate)->getUrl(fwToUpdate); QString ext = url.mid(url.lastIndexOf(".")); needRename=false; - bool addversion=settings.value("rename_firmware_files", false).toBool(); + bool addversion=g.profile[g.id()].renameFwFiles(); QString fileName; if (addversion) { - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastFlashDir").toString() + "/" + fwToUpdate + newrev + ext); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + fwToUpdate + newrev + ext); } else { - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastFlashDir").toString() + "/" + fwToUpdate + ext); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + fwToUpdate + ext); } if (!fileName.isEmpty()) { if (!cpuid.isEmpty()) { url.append("&cpuid="); url.append(cpuid); } - downloadedFWFilename = fileName; - settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath()); + g.profile[g.id()].fwName( fileName ); + g.flashDir(QFileInfo(fileName).dir().absolutePath()); downloadDialog * dd = new downloadDialog(this, url, fileName); currentFWrev_temp = NewFwRev; connect(dd, SIGNAL(accepted()), this, SLOT(reply1Accepted())); @@ -598,9 +575,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply) } else { if(check1done && check2done) { QMessageBox::warning(this, "Companion", tr("Unable to check for updates.")); - int server = settings.value("fwserver",0).toInt(); - server++; - settings.setValue("fwserver",server); + g.fwServerFails(g.fwServerFails()+1); return; } } @@ -608,9 +583,8 @@ void MainWindow::reply1Finished(QNetworkReply * reply) void MainWindow::closeEvent(QCloseEvent *event) { - QSettings settings; - settings.setValue("mainWindowGeometry", saveGeometry()); - settings.setValue("mainWindowState", saveState()); + g.mainWinGeo(saveGeometry()); + g.mainWinState(saveState()); mdiArea->closeAllSubWindows(); if (mdiArea->currentSubWindow()) { event->ignore(); @@ -622,8 +596,7 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::setLanguage(QString langString) { - QSettings settings; - settings.setValue("locale", langString ); + g.locale( langString ); QMessageBox msgBox; msgBox.setText(tr("The selected language will be used the next time you start Companion.")); @@ -634,8 +607,7 @@ void MainWindow::setLanguage(QString langString) void MainWindow::setTheme(int index) { - QSettings settings; - settings.setValue("theme", index ); + g.theme( index ); QMessageBox msgBox; msgBox.setText(tr("The new theme will be loaded the next time you start Companion.")); @@ -646,8 +618,7 @@ void MainWindow::setTheme(int index) void MainWindow::setIconThemeSize(int index) { - QSettings settings; - settings.setValue("icon_size", index ); + g.iconSize( index ); QMessageBox msgBox; msgBox.setText(tr("The icon size will be used the next time you start Companion.")); @@ -671,10 +642,9 @@ void MainWindow::openDocURL() void MainWindow::openFile() { - QSettings settings; - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), settings.value("lastDir").toString(),tr(EEPROM_FILES_FILTER)); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), g.eepromDir(), tr(EEPROM_FILES_FILTER)); if (!fileName.isEmpty()) { - settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); + g.eepromDir(QFileInfo(fileName).dir().absolutePath()); QMdiSubWindow *existing = findMdiChild(fileName); if (existing) { @@ -704,11 +674,9 @@ void MainWindow::saveAs() void MainWindow::openRecentFile() { - QSettings settings; QAction *action = qobject_cast(sender()); if (action) { QString fileName=action->data().toString(); - // settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); QMdiSubWindow *existing = findMdiChild(fileName); if (existing) { @@ -724,42 +692,17 @@ void MainWindow::openRecentFile() } } -void MainWindow::loadProfile() +void MainWindow::loadProfile() //TODO Load all variables - Also HW! { - QSettings settings; QAction *action = qobject_cast(sender()); if (action) { + // Set the new profile number int profnum=action->data().toInt(); - QSettings settings; - settings.setValue("profileId",profnum); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profnum); - settings.beginGroup(profile); - QString profileName=settings.value("Name", "").toString(); - int chord=settings.value("default_channel_order", 0).toInt(); - int defmod=settings.value("default_mode", 0).toInt(); - bool burnfw=settings.value("burnFirmware", false).toBool(); - QString sdPath=settings.value("sdPath", ".").toString(); - bool renfw=settings.value("rename_firmware_files", false).toBool(); - QString SplashFileName=settings.value("SplashFileName","").toString(); - QString SplashImage=settings.value("SplashImage", "").toString(); - QString firmware_id=settings.value("firmware", default_firmware_variant.id).toString(); - firmware_id.replace("open9x","opentx"); - firmware_id.replace("x9da","taranis"); - settings.setValue("firmware", firmware_id); - settings.endGroup(); - settings.endGroup(); - settings.setValue("Name", profileName ); - settings.setValue("default_channel_order", chord); - settings.setValue("default_mode", defmod); - settings.setValue("burnFirmware", burnfw); - settings.setValue("rename_firmware_files", renfw); - settings.setValue("sdPath", sdPath); - settings.setValue("SplashFileName", SplashFileName); - settings.setValue("SplashImage", SplashImage); - settings.setValue("firmware", firmware_id); - current_firmware_variant = GetFirmwareVariant(firmware_id); + g.id( profnum ); + + // TODO Get rid of this global variable - The profile.firmware is the real source + current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType()); foreach (QMdiSubWindow *window, mdiArea->subWindowList()) { MdiChild *mdiChild = qobject_cast(window->widget()); @@ -1107,20 +1050,19 @@ void MainWindow::readEeprom() void MainWindow::writeFileToEeprom() { - QSettings settings; QString fileName; bool backup = false; burnDialog *cd = new burnDialog(this, 1, &fileName, &backup); cd->exec(); if (!fileName.isEmpty()) { - settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); + g.eepromDir(QFileInfo(fileName).dir().absolutePath()); int ret = QMessageBox::question(this, "Companion", tr("Write Models and settings from %1 to the Tx?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No); if (ret != QMessageBox::Yes) return; if (!isValidEEPROM(fileName)) ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No); if (ret != QMessageBox::Yes) return; - bool backupEnable = settings.value("backupEnable", true).toBool(); - QString backupPath = settings.value("backupPath", "").toString(); + bool backupEnable = g.enableBackup(); + QString backupPath = g.backupDir(); if (!backupPath.isEmpty()) { if (!QDir(backupPath).exists()) { if (backupEnable) { @@ -1361,9 +1303,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString void MainWindow::writeFlash(QString fileToFlash) { - QSettings settings; QString fileName; - bool backup = settings.value("backupOnFlash", false).toBool(); + bool backup = g.backupOnFlash(); if(!fileToFlash.isEmpty()) fileName = fileToFlash; burnDialog *cd = new burnDialog(this, 2, &fileName, &backup); @@ -1371,12 +1312,12 @@ void MainWindow::writeFlash(QString fileToFlash) if (IS_TARANIS(GetEepromInterface()->getBoard())) backup=false; if (!fileName.isEmpty()) { - settings.setValue("backupOnFlash", backup); + g.backupOnFlash(backup); if (backup) { QString tempDir = QDir::tempPath(); QString backupFile = tempDir + "/backup.bin"; - bool backupEnable=settings.value("backupEnable", true).toBool(); - QString backupPath=settings.value("backupPath", "").toString(); + bool backupEnable=g.enableBackup(); + QString backupPath=g.backupDir(); if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) { if (!QDir(backupPath).exists()) { if (backupEnable) { @@ -1430,8 +1371,8 @@ void MainWindow::writeFlash(QString fileToFlash) } } else { - bool backupEnable=settings.value("backupEnable", true).toBool(); - QString backupPath=settings.value("backupPath", "").toString(); + bool backupEnable=g.enableBackup(); + QString backupPath=g.backupDir(); if (!QDir(backupPath).exists()) { if (backupEnable) { QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist")); @@ -1460,8 +1401,7 @@ void MainWindow::writeFlash(QString fileToFlash) void MainWindow::readEepromToFile() { - QSettings settings; - QString fileName = QFileDialog::getSaveFileName(this, tr("Save transmitter Models and Settings to File"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER)); + QString fileName = QFileDialog::getSaveFileName(this, tr("Save transmitter Models and Settings to File"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER)); if (!fileName.isEmpty()) { EEPROMInterface *eepromInterface = GetEepromInterface(); if (IS_TARANIS(eepromInterface->getBoard())) { @@ -1480,7 +1420,7 @@ void MainWindow::readEepromToFile() } } else { - settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); + g.eepromDir(QFileInfo(fileName).dir().absolutePath()); QStringList str = GetReceiveEEpromCommand(fileName); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx")); ad->setWindowIcon(CompanionIcon("read_eeprom.png")); @@ -1492,14 +1432,13 @@ void MainWindow::readEepromToFile() void MainWindow::readFlash() { - QSettings settings; - QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), settings.value("lastFlashDir").toString(),tr(FLASH_FILES_FILTER)); + QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), g.flashDir(),tr(FLASH_FILES_FILTER)); if (!fileName.isEmpty()) { QFile file(fileName); if (file.exists()) { file.remove(); } - settings.setValue("lastFlashDir",QFileInfo(fileName).dir().absolutePath()); + g.flashDir(QFileInfo(fileName).dir().absolutePath()); QStringList str = GetReceiveFlashCommand(fileName); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx"); ad->setWindowIcon(CompanionIcon("read_flash.png")); @@ -1579,8 +1518,7 @@ void MainWindow::updateMenus() updateIconSizeActions(); updateIconThemeActions(); - QSettings settings; - setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg(settings.value("profileId").toString())); + setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg( g.profile[g.id()].name() )); } MdiChild *MainWindow::createMdiChild() @@ -1631,7 +1569,7 @@ void MainWindow::createActions() separatorAct = new QAction(this); separatorAct->setSeparator(true); - for (int i = 0; i < MaxRecentFiles; ++i) { + for (int i = 0; i < MAX_RECENT; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile())); @@ -1648,17 +1586,17 @@ void MainWindow::createActions() } updateProfilesActions(); - newAct = addAct("new.png", tr("New"), tr("Create a new file"), QKeySequence::New, SLOT(newFile())); - openAct = addAct("open.png", tr("Open..."), tr("Open an existing file"), QKeySequence::Open, SLOT(openFile())); - saveAct = addAct("save.png", tr("Save..."), tr("Save the document to disk"), QKeySequence::Save, SLOT(save())); - saveAsAct = addAct("saveas.png", tr("Save As..."), tr("Save the document to disk"), QKeySequence::SaveAs, SLOT(saveAs())); - exitAct = addAct("exit.png", tr("Exit"), tr("Exit the application"), QKeySequence::Quit, SLOT(newFile())); - cutAct = addAct("cut.png", tr("Cut"), tr("Cut current selection to the clipboard"), QKeySequence::Cut, SLOT(cut())); - copyAct = addAct("copy.png", tr("Copy..."), tr("Copy current selection to the clipboard"), QKeySequence::Copy, SLOT(copy())); - pasteAct = addAct("paste.png", tr("Paste..."), tr("Paste clipboard into current selection"), QKeySequence::Paste, SLOT(paste())); + newAct = addAct("new.png", tr("New Models+Settings"), tr("Create a new Models and Settings file"), QKeySequence::New, SLOT(newFile())); + openAct = addAct("open.png", tr("Open Models+Settings..."), tr("Open Models and Settings file"), QKeySequence::Open, SLOT(openFile())); + saveAct = addAct("save.png", tr("Save Models+Settings..."), tr("Save Models and Settings file"), QKeySequence::Save, SLOT(save())); + saveAsAct = addAct("saveas.png", tr("Save Models+Settings as..."), tr("Save Models and Settings file"), QKeySequence::SaveAs, SLOT(saveAs())); + exitAct = addAct("exit.png", tr("Exit"), tr("Exit the application"), QKeySequence::Quit, SLOT(newFile())); + cutAct = addAct("cut.png", tr("Cut Model"), tr("Cut current model to the clipboard"), QKeySequence::Cut, SLOT(cut())); + copyAct = addAct("copy.png", tr("Copy Model..."), tr("Copy current model to the clipboard"), QKeySequence::Copy, SLOT(copy())); + pasteAct = addAct("paste.png", tr("Paste Model..."), tr("Paste model from clipboard"), QKeySequence::Paste, SLOT(paste())); QActionGroup *themeAlignGroup = new QActionGroup(this); - classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classical Companion icon theme"), SLOT(setClassicTheme())); + classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classic companion9x icon theme"), SLOT(setClassicTheme())); yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme())); monoThemeAct = addAct( themeAlignGroup, tr("Monochrome"), tr("A monochrome black icon theme"), SLOT(setMonochromeTheme())); monoWhiteAct = addAct( themeAlignGroup, tr("MonoWhite"), tr("A monochrome white icon theme"), SLOT(setMonoWhiteTheme())); @@ -1684,30 +1622,30 @@ void MainWindow::createActions() swedishLangAct = addAct( langAlignGroup, tr("Swedish"), tr("Use Swedish in menus"), SLOT(setSELanguage())); russianLangAct = addAct( langAlignGroup, tr("Russian"), tr("Use Russian in menus"), SLOT(setRULanguage())); - aboutAct = addAct("information.png", tr("About"), tr("Show the application's About box"), SLOT(about())); - printAct = addAct("print.png", tr("Print"), tr("Print current model"), SLOT(print())); - simulateAct = addAct("simulate.png", tr("Simulate"), tr("Simulate selected model"), SLOT(simulate())); - loadbackupAct = addAct("open.png", tr("loadBackup..."), tr("Load backup from file"), SLOT(loadBackup())); - logsAct = addAct("logs.png", tr("Logs"), tr("Open log file"), SLOT(logFile())); - appPrefsAct = addAct("apppreferences.png",tr("Setting..."), tr("Edit Settings"), SLOT(appPrefs())); - fwPrefsAct = addAct("fwpreferences.png", tr("Downloads..."), tr("Download firmware and voice files"), SLOT(fwPrefs())); - checkForUpdatesAct = addAct("update.png", tr("Check for updates..."), tr("Check OpenTX and Companion updates"), SLOT(doUpdates())); - changelogAct = addAct("changelog.png", tr("ChangeLog..."), tr("Show Companion changelog"), SLOT(changelog())); - fwchangelogAct = addAct("changelog.png", tr("Firmware ChangeLog..."), tr("Show firmware changelog"), SLOT(fwchangelog())); - compareAct = addAct("compare.png", tr("Compare..."), tr("Compare models"), SLOT(compare())); - editSplashAct = addAct("paintbrush.png", tr("Edit Tx Splash Image..."),tr("edit the splash screen of your TX"), SLOT(customizeSplash())); - burnListAct = addAct("list.png", tr("List programmers"), tr("List available programmers"), SLOT(burnList())); - burnFusesAct = addAct("fuses.png", tr("Fuses..."), tr("Show fuses dialog"), SLOT(burnFuses())); - readFlashAct = addAct("read_flash.png", tr("Read Firmware"), tr("Read firmware from transmitter"), SLOT(readFlash())); - writeFlashAct = addAct("write_flash.png", tr("Write Firmware"), tr("Write firmware to transmitter"), SLOT(writeFlash())); - createProfileAct = addAct("", tr("New Profile"), tr("Create a new Radio Setting Profile"), SLOT(createProfile())); + aboutAct = addAct("information.png", tr("About..."), tr("Show the application's About box"), SLOT(about())); + printAct = addAct("print.png", tr("Print..."), tr("Print current model"), SLOT(print())); + simulateAct = addAct("simulate.png", tr("Simulate..."), tr("Simulate current model"), SLOT(simulate())); + loadbackupAct = addAct("open.png", tr("Load Backup..."), tr("Load backup from file"), SLOT(loadBackup())); + logsAct = addAct("logs.png", tr("View Log File..."), tr("Open and view log file"), SLOT(logFile())); + appPrefsAct = addAct("apppreferences.png",tr("Settings..."), tr("Edit Settings"), SLOT(appPrefs())); + fwPrefsAct = addAct("fwpreferences.png", tr("Download..."), tr("Download firmware and voice files"), SLOT(fwPrefs())); + checkForUpdatesAct = addAct("update.png", tr("Check for Updates..."), tr("Check OpenTX and Companion updates"), SLOT(doUpdates())); + changelogAct = addAct("changelog.png", tr("Companion Changes..."), tr("Show Companion change log"), SLOT(changelog())); + fwchangelogAct = addAct("changelog.png", tr("Firmware Changes..."), tr("Show firmware change log"), SLOT(fwchangelog())); + compareAct = addAct("compare.png", tr("Compare Models..."), tr("Compare models"), SLOT(compare())); + editSplashAct = addAct("paintbrush.png", tr("Edit Tx Splash Image..."), tr("Edit the splash image of your TX"), SLOT(customizeSplash())); + burnListAct = addAct("list.png", tr("List programmers..."), tr("List available programmers"), SLOT(burnList())); + burnFusesAct = addAct("fuses.png", tr("Fuses..."), tr("Show fuses dialog"), SLOT(burnFuses())); + readFlashAct = addAct("read_flash.png", tr("Read Firmware"), tr("Read firmware from transmitter"), SLOT(readFlash())); + writeFlashAct = addAct("write_flash.png", tr("Write Firmware"), tr("Write firmware to transmitter"), SLOT(writeFlash())); + createProfileAct = addAct("", tr("Add Radio Profile"), tr("Create a new Radio Setting Profile"), SLOT(createProfile())); openDocURLAct = addAct("", tr("Manuals and other Documents"), tr("Open the OpenTX document page in a web browser"), SLOT(openDocURL())); writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Tx"), tr("Write Models and Settings to transmitter"), SLOT(writeEeprom())); readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Tx"), tr("Read Models and Settings from transmitter"), SLOT(readEeprom())); - burnConfigAct = addAct("configure.png", tr("Configure connection software..."), tr("Configure software for reading from and writing to the transmitter"), SLOT(burnConfig())); - writeFileToEepromAct = addAct("write_eeprom_file.png", tr("Write Models and Settings from file to Tx"), tr("Write Models and Settings from file to transmitter"), SLOT(writeFileToEeprom())); - readEepromToFileAct = addAct("read_eeprom_file.png", tr("Save Tx Models and Settings to file"), tr("Save the Models and Settings from the transmitter to a file"), SLOT(readEepromToFile())); - contributorsAct = addAct("contributors.png", tr("Contributors"), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors())); + burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with the transmitter"), SLOT(burnConfig())); + writeFileToEepromAct = addAct("write_eeprom_file.png", tr("Write Models and Settings from file to Tx"), tr("Write Models and Settings from file to transmitter"), SLOT(writeFileToEeprom())); + readEepromToFileAct = addAct("read_eeprom_file.png", tr("Save Tx Models and Settings to file"), tr("Save the Models and Settings from the transmitter to a file"), SLOT(readEepromToFile())); + contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors())); compareAct->setEnabled(false); simulateAct->setEnabled(false); @@ -1717,7 +1655,7 @@ void MainWindow::createActions() void MainWindow::createMenus() { - QMenu *recentFileMenu=new QMenu(tr("Recent Files")); + QMenu *recentFileMenu=new QMenu(tr("Recent Models+Settings")); QMenu *languageMenu=new QMenu(tr("Set Menu Language")); QMenu *themeMenu=new QMenu(tr("Set Icon Theme")); QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size")); @@ -1729,17 +1667,16 @@ void MainWindow::createMenus() fileMenu->addAction(saveAsAct); fileMenu->addMenu(recentFileMenu); recentFileMenu->setIcon(CompanionIcon("recentdocument.png")); - for (int i=0; iaddAction(recentFileActs[i]); fileMenu->addSeparator(); fileMenu->addAction(logsAct); + fileMenu->addAction(fwPrefsAct); fileMenu->addSeparator(); fileMenu->addAction(simulateAct); fileMenu->addAction(printAct); fileMenu->addAction(compareAct); fileMenu->addSeparator(); - fileMenu->addAction(fwPrefsAct); - fileMenu->addMenu(createProfilesMenu()); fileMenu->addAction(exitAct); editMenu = menuBar()->addMenu(tr("Edit")); @@ -1775,6 +1712,7 @@ void MainWindow::createMenus() iconThemeSizeMenu->addAction(hugeIconAct); settingsMenu->addSeparator(); settingsMenu->addAction(appPrefsAct); + settingsMenu->addMenu(createProfilesMenu()); settingsMenu->addAction(editSplashAct); settingsMenu->addAction(burnConfigAct); @@ -1811,20 +1749,20 @@ void MainWindow::createMenus() QMenu *MainWindow::createRecentFileMenu() { QMenu *recentFileMenu = new QMenu(this); - for ( int i = 0; i < MaxRecentFiles; ++i) + for ( int i = 0; i < MAX_RECENT; ++i) recentFileMenu->addAction(recentFileActs[i]); return recentFileMenu; } QMenu *MainWindow::createProfilesMenu() { - QMenu *profilesMenu=new QMenu(tr("Radio Settings Profiles")); + QMenu *profilesMenu=new QMenu(tr("Radio Settings Profile")); int i; for ( i = 0; i < MAX_PROFILES; ++i) { profilesMenu->addAction(profileActs[i]); } - if ( i>0 ) - profilesMenu->addSeparator(); + profilesMenu->addSeparator(); + profilesMenu->addAction(createProfileAct); profilesMenu->setIcon(CompanionIcon("profiles.png")); return profilesMenu; @@ -1832,10 +1770,8 @@ QMenu *MainWindow::createProfilesMenu() void MainWindow::createToolBars() { - QSettings settings; - int icon_size=settings.value("icon_size",2 ).toInt(); QSize size; - switch(icon_size) { + switch(g.iconSize()) { case 0: size=QSize(16,16); break; @@ -1862,25 +1798,26 @@ void MainWindow::createToolBars() recentToolButton->setPopupMode(QToolButton::InstantPopup); recentToolButton->setMenu(createRecentFileMenu()); recentToolButton->setIcon(CompanionIcon("recentdocument.png")); - recentToolButton->setToolTip(tr("Recent Files")); - recentToolButton->setStatusTip(tr("Show a selection list of recent documents")); + recentToolButton->setToolTip(tr("Recent Models+Settings")); + recentToolButton->setStatusTip(tr("Show recent Models+Settings documents")); fileToolBar->addWidget(recentToolButton); fileToolBar->addAction(saveAct); + fileToolBar->addSeparator(); fileToolBar->addAction(logsAct); + fileToolBar->addAction(fwPrefsAct); fileToolBar->addSeparator(); fileToolBar->addAction(appPrefsAct); - fileToolBar->addAction(fwPrefsAct); - fileToolBar->addAction(editSplashAct); QToolButton * profileButton = new QToolButton; profileButton->setPopupMode(QToolButton::InstantPopup); profileButton->setMenu(createProfilesMenu()); profileButton->setIcon(CompanionIcon("profiles.png")); - profileButton->setToolTip(tr("Radio Profiles")); + profileButton->setToolTip(tr("Radio Settings Profile")); profileButton->setStatusTip(tr("Show a selection list of radio settings profiles")); fileToolBar->addWidget(profileButton); + fileToolBar->addAction(editSplashAct); fileToolBar->addSeparator(); fileToolBar->addAction(simulateAct); fileToolBar->addAction(printAct); @@ -1920,20 +1857,6 @@ void MainWindow::createStatusBar() statusBar()->showMessage(tr("Ready")); } -void MainWindow::readSettings() -{ - QSettings settings; - restoreState(settings.value("mainWindowState").toByteArray()); - checkCompanion = settings.value("startup_check_companion", true).toBool(); - checkFW = settings.value("startup_check_fw", true).toBool(); - MaxRecentFiles =settings.value("history_size",10).toInt(); - if (settings.value("profileId",0).toInt() == 0) - { - createProfile(); - settings.setValue("profileId", "1"); - } -} - MdiChild *MainWindow::activeMdiChild() { if (QMdiSubWindow *activeSubWindow = mdiArea->activeSubWindow()) @@ -1962,27 +1885,31 @@ void MainWindow::setActiveSubWindow(QWidget *window) void MainWindow::updateRecentFileActions() { - int i,j, numRecentFiles; - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); + int i, numRecentFiles; - numRecentFiles = qMin(files.size(), (int)MaxRecentFiles); + // Hide all document slots + for ( i=0 ; i < g.historySize(); i++) + recentFileActs[i]->setVisible(false); + + // Fill slots with content and unhide them + QStringList files = g.recentFiles(); + numRecentFiles = qMin(files.size(), g.historySize()); - for ( i = 0; i < numRecentFiles; ++i) { - QString text = tr("&%1 %2").arg(i + 1).arg(strippedName(files[i])); - recentFileActs[i]->setText(text); - recentFileActs[i]->setData(files[i]); - recentFileActs[i]->setVisible(true); + for ( i = 0; i < numRecentFiles; i++) { + QString text = strippedName(files[i]); + if (!text.trimmed().isEmpty()) + { + recentFileActs[i]->setText(text); + recentFileActs[i]->setData(files[i]); + recentFileActs[i]->setVisible(true); + } } - for ( j = numRecentFiles; j < MaxRecentFiles; ++j) - recentFileActs[j]->setVisible(false); } void MainWindow::updateIconSizeActions() { - QSettings settings; - int size = settings.value("icon_size","0").toInt(); - switch (size){ + switch (g.iconSize()) + { case 0: smallIconAct->setChecked(true); break; case 1: normalIconAct->setChecked(true); break; case 2: bigIconAct->setChecked(true); break; @@ -1992,8 +1919,7 @@ void MainWindow::updateIconSizeActions() void MainWindow::updateLanguageActions() { - QSettings settings; - QString langId = settings.value("locale","").toString(); + QString langId = g.locale(); if (langId=="") sysLangAct->setChecked(true); @@ -2023,9 +1949,8 @@ void MainWindow::updateLanguageActions() void MainWindow::updateIconThemeActions() { - QSettings settings; - int size = settings.value("theme","1").toInt(); - switch (size){ + switch (g.theme()) + { case 0: classicThemeAct->setChecked(true); break; case 1: yericoThemeAct->setChecked(true); break; case 2: monoWhiteAct->setChecked(true); break; @@ -2036,53 +1961,36 @@ void MainWindow::updateIconThemeActions() void MainWindow::updateProfilesActions() { - int i; - QSettings settings; - int activeProfile = settings.value("profileId").toInt(); - - settings.beginGroup("Profiles"); - for (i=0; isetText(text); - profileActs[i]->setData(i+1); + profileActs[i]->setData(i); profileActs[i]->setVisible(true); - if ((i+1) == activeProfile) + if (i == g.id()) profileActs[i]->setChecked(true); } - else { + else + { profileActs[i]->setVisible(false); } - settings.endGroup(); } } void MainWindow::createProfile() -{ - int firstFreeIndex = 0; - QSettings settings; - settings.beginGroup("Profiles"); - for (int i=0; firstFreeIndex ==0 && i #if defined WIN32 || !defined __GNUC__ @@ -160,8 +161,7 @@ void MdiChild::OpenEditWindow(bool wizard=false) } if (isNew && !wizard) { int ret; - QSettings settings; - bool wizardEnable=settings.value("wizardEnable", true).toBool(); + bool wizardEnable=g.enableWizard(); if (wizardEnable) { ret = QMessageBox::question(this, tr("Companion"), tr("Do you want to use model wizard? "), QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::Yes) { @@ -170,7 +170,7 @@ void MdiChild::OpenEditWindow(bool wizard=false) qSleep(500); ret = QMessageBox::question(this, tr("Companion"), tr("Ask this question again ? "), QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::No) { - settings.setValue("wizardEnable", false); + g.enableWizard( false ); } } } @@ -327,34 +327,33 @@ bool MdiChild::save() bool MdiChild::saveAs(bool isNew) { - QSettings settings; QString fileName; if (GetEepromInterface()->getBoard() == BOARD_SKY9X) { curFile.replace(".eepe", ".bin"); QFileInfo fi(curFile); #ifdef __APPLE__ - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastDir").toString() + "/" +fi.fileName()); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName()); #else - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastDir").toString() + "/" +fi.fileName(), tr(BIN_FILES_FILTER)); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(BIN_FILES_FILTER)); #endif } else { QFileInfo fi(curFile); #ifdef __APPLE__ - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastDir").toString() + "/" +fi.fileName()); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName()); #else - fileName = QFileDialog::getSaveFileName(this, tr("Save As"), settings.value("lastDir").toString() + "/" +fi.fileName(), tr(EEPROM_FILES_FILTER)); + fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(EEPROM_FILES_FILTER)); #endif } if (fileName.isEmpty()) return false; if (fileName.contains("rev4a")) { - settings.setValue("rev4asupport", 1); + g.rev4aSupport( true ); } if (fileName.contains("norev4a")) { - settings.setValue("rev4asupport", 0); + g.rev4aSupport( false ); } - settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); + g.eepromDir( QFileInfo(fileName).dir().absolutePath() ); if (isNew) return saveFile(fileName); else @@ -471,15 +470,14 @@ void MdiChild::setCurrentFile(const QString &fileName) fileChanged = false; setWindowModified(false); updateTitle(); - QSettings settings; - int MaxRecentFiles =settings.value("history_size",10).toInt(); - QStringList files = settings.value("recentFileList").toStringList(); + int MaxRecentFiles = g.historySize(); + QStringList files = g.recentFiles(); files.removeAll(fileName); files.prepend(fileName); while (files.size() > MaxRecentFiles) files.removeLast(); - settings.setValue("recentFileList", files); + g.recentFiles( files ); } QString MdiChild::strippedName(const QString &fullFileName) @@ -489,9 +487,8 @@ QString MdiChild::strippedName(const QString &fullFileName) void MdiChild::writeEeprom() // write to Tx { - QSettings settings; - bool backupEnable=settings.value("backupEnable", true).toBool(); - QString backupPath=settings.value("backupPath", "").toString(); + bool backupEnable=g.enableBackup(); + QString backupPath=g.backupDir(); if (!backupPath.isEmpty()) { if (!QDir(backupPath).exists()) { if (backupEnable) { @@ -502,13 +499,7 @@ void MdiChild::writeEeprom() // write to Tx } else { backupEnable=false; } - int profileid=settings.value("profileId", 1).toInt(); - settings.beginGroup("Profiles"); - QString profile=QString("profile%1").arg(profileid); - settings.beginGroup(profile); - QString stickCal=settings.value("StickPotCalib","").toString(); - settings.endGroup(); - settings.endGroup(); + QString stickCal=g.profile[g.id()].stickPotCalib(); burnConfigDialog bcd; QString tempDir = QDir::tempPath(); QString tempFile = tempDir + "/temp.bin"; @@ -530,12 +521,14 @@ void MdiChild::writeEeprom() // write to Tx if (path.isEmpty()) { QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify the eeprom disk is connected.")); return; - } else { + } + else { QStringList str; str << path << backupFile; avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->exec(); + delete ad; sleep(1); } } @@ -558,10 +551,9 @@ void MdiChild::writeEeprom() // write to Tx sleep(1); QString restoreFile = tempDir + "/compat.bin"; if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) { - int ret = QMessageBox::question(this, "Error", tr("Cannot check eeprom compatibility! Continue anyway?") , - QMessageBox::Yes | QMessageBox::No); - if (ret==QMessageBox::No) - return; + int ret = QMessageBox::question(this, tr("Error"), tr("Cannot check eeprom compatibility! Continue anyway?"), QMessageBox::Yes | QMessageBox::No); + if (ret == QMessageBox::No) + return; } else { int rev=((MainWindow *)this->parent())->getEpromVersion(restoreFile); @@ -600,6 +592,7 @@ void MdiChild::writeEeprom() // write to Tx } } } + if (IS_TARANIS(eepromInterface->getBoard())) { QString path=((MainWindow *)this->parent())->FindTaranisPath(); if (path.isEmpty()) { @@ -611,7 +604,7 @@ void MdiChild::writeEeprom() // write to Tx str << tempFile << path; avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN); ad->setWindowIcon(CompanionIcon("read_eeprom.png")); - ad->show(); + ad->exec(); delete ad; sleep(1); } @@ -620,7 +613,7 @@ void MdiChild::writeEeprom() // write to Tx QStringList str = ((MainWindow *)this->parent())->GetSendEEpromCommand(tempFile); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE); ad->setWindowIcon(CompanionIcon("write_eeprom.png")); - ad->show(); + ad->exec(); delete ad; } } @@ -658,8 +651,7 @@ void MdiChild::setEEpromAvail(int eavail) bool MdiChild::loadBackup() { - QSettings settings; - QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastDir").toString(),tr(EEPROM_FILES_FILTER)); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open backup Models and Settings file"), g.eepromDir(),tr(EEPROM_FILES_FILTER)); if (fileName.isEmpty()) return false; QFile file(fileName); diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 2422477bc..b1805df46 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -6,6 +6,7 @@ #include #include #include "helpers.h" +#include "appdata.h" RepeatComboBox::RepeatComboBox(QWidget *parent, int & repeatParam): QComboBox(parent), @@ -74,8 +75,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, } } - QSettings settings; - QString path = settings.value("sdPath", ".").toString(); + QString path = g.profile[g.id()].sdPath(); path.append("/SOUNDS/"); QString lang = generalSettings.ttsLanguage; if (lang.isEmpty()) @@ -162,7 +162,8 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, #ifdef PHONON playBT[i] = new QPushButton(this); - playBT[i]->setObjectName(QString("play_%1").arg(i)); + playBT[i]->setProperty("index", i); + playBT[i]->setProperty("state", "play"); playBT[i]->setIcon(CompanionIcon("play.png")); paramLayout->addWidget(playBT[i]); connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic())); @@ -222,44 +223,43 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta void CustomFunctionsPanel::playMusic() { - QPushButton *playButton = qobject_cast(sender()); - int index=playButton->objectName().mid(5,2).toInt(); - QString function=playButton->objectName().left(4); - QSettings settings; - QString path = settings.value("sdPath", ".").toString(); + QPushButton * button = qobject_cast(sender()); + int index = button->property("index").toInt(); + QString function = button->property("state").toString(); + QString path = g.profile[g.id()].sdPath(); QDir qd(path); QString track; if (qd.exists()) { if (GetEepromInterface()->getCapability(VoicesAsNumbers)) { - track=path+QString("/%1.wav").arg(int(fswtchParam[index]->value()),4,10,(const QChar)'0'); + track = path + QString("/%1.wav").arg(int(fswtchParam[index]->value()), 4, 10, (const QChar)'0'); } else { path.append("/SOUNDS/"); QString lang = generalSettings.ttsLanguage; if (lang.isEmpty()) - lang="en"; + lang = "en"; path.append(lang); - if (fswtchParamArmT[index]->currentText()!="----") { - track=path+"/"+fswtchParamArmT[index]->currentText()+".wav"; + if (fswtchParamArmT[index]->currentText() != "----") { + track = path + "/" + fswtchParamArmT[index]->currentText() + ".wav"; } } QFile file(track); if (!file.exists()) { QMessageBox::critical(this, tr("Error"), tr("Unable to find sound file %1!").arg(track)); - track.clear(); + return; } #ifdef PHONON - if (function=="play" && !track.isEmpty()) { + if (function=="play") { clickObject->clear(); clickObject->setCurrentSource(Phonon::MediaSource(track)); clickObject->play(); - playBT[index]->setObjectName(QString("stop_%1").arg(index)); + playBT[index]->setProperty("state", "stop"); playBT[index]->setIcon(CompanionIcon("stop.png")); } else { clickObject->stop(); clickObject->clear(); - playBT[index]->setObjectName(QString("play_%1").arg(index)); + playBT[index]->setProperty("state", "play"); playBT[index]->setIcon(CompanionIcon("play.png")); } #endif diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 870ab81b7..c140585ee 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -83,7 +83,10 @@ void InputsPanel::update() curDest = md->chn; } else { - str = " "; + if (GetEepromInterface()->getCapability(VirtualInputs)) + str = " "; + else + str = " "; } if (GetEepromInterface()->getCapability(VirtualInputs)) { diff --git a/companion/src/modeledit/modeledit.cpp b/companion/src/modeledit/modeledit.cpp index 0013877c5..c3c24b14b 100644 --- a/companion/src/modeledit/modeledit.cpp +++ b/companion/src/modeledit/modeledit.cpp @@ -11,6 +11,7 @@ #include "customswitches.h" #include "customfunctions.h" #include "telemetry.h" +#include "appdata.h" #include ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool isNew, QWidget *parent) : @@ -21,8 +22,7 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i generalSettings(radioData.generalSettings) { ui->setupUi(this); - QSettings settings; - restoreGeometry(settings.value("modelEditGeometry").toByteArray()); + restoreGeometry(g.modelEditGeo()); ui->pushButton->setIcon(CompanionIcon("simulate.png")); addTab(new Setup(this, model), tr("Setup")); addTab(new HeliPanel(this, model), tr("Heli")); @@ -45,8 +45,7 @@ ModelEdit::~ModelEdit() void ModelEdit::closeEvent(QCloseEvent *event) { - QSettings settings; - settings.setValue("modelEditGeometry", saveGeometry()); + g.modelEditGeo( saveGeometry() ); } class VerticalScrollArea : public QScrollArea diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index 8042ccfe3..6dd46c3e0 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -3,6 +3,7 @@ #include "ui_setup_timer.h" #include "ui_setup_module.h" #include "helpers.h" +#include "appdata.h" TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer): ModelPanel(parent, model), @@ -347,8 +348,7 @@ Setup::Setup(QWidget *parent, ModelData & model): if (GetEepromInterface()->getCapability(ModelImage)) { QStringList items; items.append(""); - QSettings settings; - QString path = settings.value("sdPath", ".").toString(); + QString path = g.profile[g.id()].sdPath(); path.append("/BMP/"); QDir qd(path); int vml = GetEepromInterface()->getCapability(VoicesMaxLength)+4; @@ -476,7 +476,7 @@ void Setup::on_extendedLimits_toggled(bool checked) void Setup::on_throttleWarning_toggled(bool checked) { - model.disableThrottleWarning = checked; + model.disableThrottleWarning = !checked; emit modified(); } @@ -515,8 +515,7 @@ void Setup::on_image_currentIndexChanged(int index) { if (!lock) { strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength)); - QSettings settings; - QString path=settings.value("sdPath", ".").toString(); + QString path=g.profile[g.id()].sdPath(); path.append("/BMP/"); QDir qd(path); if (qd.exists()) { @@ -550,7 +549,7 @@ void Setup::update() ui->throttleReverse->setChecked(model.throttleReversed); populateTTraceCB(ui->throttleSource, model.thrTraceSrc); - ui->throttleWarning->setChecked(model.disableThrottleWarning); + ui->throttleWarning->setChecked(!model.disableThrottleWarning); //trim inc, thro trim, thro expo, instatrim ui->trimIncrement->setCurrentIndex(model.trimInc+2); diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index 1b5fd285f..e06fe96a3 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -3,6 +3,7 @@ #include "ui_telemetry_analog.h" #include "ui_telemetry_customscreen.h" #include "helpers.h" +#include "appdata.h" TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog): QWidget(parent), @@ -456,8 +457,7 @@ TelemetryPanel::~TelemetryPanel() void TelemetryPanel::setup() { - QSettings settings; - QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString(); + QString firmware_id = g.profile[g.id()].fwType(); lock=true; diff --git a/companion/src/preferencesdialog.cpp b/companion/src/preferencesdialog.cpp deleted file mode 100644 index 7b4ce1707..000000000 --- a/companion/src/preferencesdialog.cpp +++ /dev/null @@ -1,827 +0,0 @@ -#include "preferencesdialog.h" -#include "ui_preferencesdialog.h" -#include "mainwindow.h" -#include "eeprominterface.h" -#include "splashlibrary.h" -#include "helpers.h" -#ifdef JOYSTICKS -#include "joystick.h" -#include "joystickdialog.h" -#endif -#include -#include - -preferencesDialog::preferencesDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::preferencesDialog), - updateLock(false) -{ - ui->setupUi(this); - setWindowIcon(CompanionIcon("preferences.png")); - ui->splashLibraryButton->setIcon(CompanionIcon("library.png")); - ui->clearImageButton->setIcon(CompanionIcon("clear.png")); - - QCheckBox * OptionCheckBox[]= { - ui->optionCheckBox_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7, - ui->optionCheckBox_8, ui->optionCheckBox_9, ui->optionCheckBox_10, ui->optionCheckBox_11, ui->optionCheckBox_12, ui->optionCheckBox_13, ui->optionCheckBox_14, - ui->optionCheckBox_15,ui->optionCheckBox_16, ui->optionCheckBox_17, ui->optionCheckBox_18, ui->optionCheckBox_19, ui->optionCheckBox_20, ui->optionCheckBox_21, - ui->optionCheckBox_22, ui->optionCheckBox_23, ui->optionCheckBox_24, ui->optionCheckBox_25, ui->optionCheckBox_26, ui->optionCheckBox_27, ui->optionCheckBox_28, - ui->optionCheckBox_29, ui->optionCheckBox_30, ui->optionCheckBox_31, ui->optionCheckBox_32, ui->optionCheckBox_33, ui->optionCheckBox_34, ui->optionCheckBox_35, - ui->optionCheckBox_36, ui->optionCheckBox_37, ui->optionCheckBox_38, ui->optionCheckBox_39, ui->optionCheckBox_40, ui->optionCheckBox_41, ui->optionCheckBox_42, - NULL }; - - voice=NULL; - - connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged())); - connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged())); - - for (int i=0; OptionCheckBox[i]; i++) { - optionsCheckBoxes.push_back(OptionCheckBox[i]); - connect(OptionCheckBox[i], SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool))); - } - - initSettings(); - connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged())); - connect(this, SIGNAL(accepted()), this, SLOT(writeValues())); -#ifndef JOYSTICKS - ui->joystickCB->hide(); - ui->joystickCB->setDisabled(true); - ui->joystickcalButton->hide(); - ui->joystickChkB->hide(); - ui->label_11->hide(); -#endif - resize(0,0); -} - - -preferencesDialog::~preferencesDialog() -{ - delete ui; -} - -void preferencesDialog::baseFirmwareChanged() -{ - QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); - voice=NULL; - foreach(FirmwareInfo * firmware, firmwares) { - if (firmware->id == selected_firmware) { - if (firmware->voice) { - ui->voiceLabel->show(); - ui->voiceCombo->show(); - ui->voice_dnld->show(); - ui->sdPathButton->show(); - ui->sdPath->show(); - ui->sdPathLabel->show(); - ui->voiceLabel->setEnabled(true); - ui->voiceCombo->setEnabled(true); - ui->voice_dnld->setEnabled(true); - ui->sdPathButton->setEnabled(true); - ui->sdPath->setEnabled(true); - ui->ge_label->show(); - ui->ge_lineedit->show(); - ui->ge_pathButton->show(); - } else { - ui->voiceLabel->hide(); - ui->voiceCombo->hide(); - ui->voice_dnld->hide(); - ui->sdPathButton->hide(); - ui->sdPath->hide(); - ui->sdPathLabel->hide(); - ui->ge_label->hide(); - ui->ge_lineedit->hide(); - ui->ge_pathButton->hide(); - } - populateFirmwareOptions(firmware); - int width=firmware->eepromInterface->getCapability(LCDWidth); - ui->imageLabel->setFixedWidth(width); - break; - } - } - firmwareChanged(); -} - -FirmwareVariant preferencesDialog::getFirmwareVariant() -{ - QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); - bool voice=false; - foreach(FirmwareInfo * firmware, firmwares) { - if (firmware->id == selected_firmware) { - QString id = firmware->id; - foreach(QCheckBox *cb, optionsCheckBoxes) { - if (cb->isChecked()) { - if (cb->text()=="voice" && cb->isChecked()) - voice=true; - id += QString("-") + cb->text(); - } - } - if (! firmware->eepromInterface->getCapability(MultiLangVoice)) { - if (ui->voiceCombo->count() && (voice || firmware->voice)) - id += QString("-tts") + ui->voiceCombo->currentText(); - } - if (ui->langCombo->count()) - id += QString("-") + ui->langCombo->currentText(); - - return GetFirmwareVariant(id); - } - } - - // Should never occur... - return default_firmware_variant; -} - -void preferencesDialog::firmwareLangChanged() -{ - firmwareChanged(); -} - -void preferencesDialog::firmwareOptionChanged(bool state) -{ - QCheckBox *cb = qobject_cast(sender()); - FirmwareInfo * firmware=NULL; - if (cb && state) { - QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); - foreach(firmware, firmwares) { - if (firmware->id == selected_firmware) { - foreach(QList
- + + + QLayout::SetNoConstraint + - + 0 0 @@ -72,7 +75,7 @@ - 130 + 214 66 @@ -105,7 +108,7 @@ - + 0 0 @@ -113,55 +116,12 @@ 130 - 66 + 0 - 130 - 66 - - - - true - - - border:1px; - - - QFrame::Panel - - - QFrame::Plain - - - 0 - - - - - - true - - - - - - - - 0 - 0 - - - - - 130 - 66 - - - - - 130 + 214 66 @@ -191,7 +151,7 @@ - + 0 0 @@ -199,12 +159,12 @@ 130 - 66 + 0 - 130 + 214 66 @@ -234,20 +194,20 @@ - + 0 0 - 130 + 0 66 - 130 + 214 66 @@ -277,20 +237,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -320,20 +274,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -363,20 +311,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -406,20 +348,20 @@ - + 0 0 - 130 + 0 66 - 130 + 214 66 @@ -449,20 +391,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -492,20 +428,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -535,20 +465,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -578,20 +502,20 @@ - + 0 0 - 130 + 0 66 - 130 + 214 66 @@ -621,20 +545,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -664,20 +582,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -707,20 +619,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -750,20 +656,20 @@ - + 0 0 - 130 + 0 66 - 130 + 214 66 @@ -793,20 +699,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -836,20 +736,14 @@ - + 0 0 - - - 130 - 66 - - - 130 + 214 66 @@ -879,7 +773,44 @@ - + + 0 + 0 + + + + + 214 + 66 + + + + true + + + border:1px; + + + QFrame::Panel + + + QFrame::Plain + + + 0 + + + + + + true + + + + + + + 0 0 @@ -887,12 +818,12 @@ 130 - 66 + 0 - 130 + 214 66 @@ -921,7 +852,7 @@ - + false @@ -934,10 +865,16 @@ - 50 + 34 0 + + + 34 + 16777215 + + ... @@ -949,6 +886,32 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + +
diff --git a/companion/src/themes/monochrome/24/fwpreferences.png b/companion/src/themes/monochrome/24/fwpreferences.png index 1f4d9bf05..2d322e73d 100644 Binary files a/companion/src/themes/monochrome/24/fwpreferences.png and b/companion/src/themes/monochrome/24/fwpreferences.png differ diff --git a/companion/src/themes/monochrome/32/fwpreferences.png b/companion/src/themes/monochrome/32/fwpreferences.png index ad10a252c..17d781fb3 100644 Binary files a/companion/src/themes/monochrome/32/fwpreferences.png and b/companion/src/themes/monochrome/32/fwpreferences.png differ diff --git a/companion/src/themes/monochrome/48/fwpreferences.png b/companion/src/themes/monochrome/48/fwpreferences.png index 55e6e6a75..aed3ed5ef 100644 Binary files a/companion/src/themes/monochrome/48/fwpreferences.png and b/companion/src/themes/monochrome/48/fwpreferences.png differ diff --git a/companion/src/themes/monowhite/16/fwpreferences.png b/companion/src/themes/monowhite/16/fwpreferences.png index b8e5ad449..63fb581eb 100644 Binary files a/companion/src/themes/monowhite/16/fwpreferences.png and b/companion/src/themes/monowhite/16/fwpreferences.png differ diff --git a/companion/src/translations/companion_pl.ts b/companion/src/translations/companion_pl.ts index 8f9fde66b..ab649090f 100644 --- a/companion/src/translations/companion_pl.ts +++ b/companion/src/translations/companion_pl.ts @@ -57,22 +57,22 @@ CurveGroup - + Diff Róźnicowość - + Expo Expo - + Func Funkcja - + Curve Krzywa @@ -143,22 +143,22 @@ CustomFunctionsPanel - + Switch Przełącznik - + Action Akcja - + Parameters Parametry - + Enable Włączone @@ -168,7 +168,7 @@ FS%1 - + ON Włącz @@ -183,42 +183,42 @@ Nie mogę odnaleźć pliku dźwiękowego %1! - + &Delete &Wykasuj - + Delete Wykasuj - + &Copy &Kopiuj - + Ctrl+C Ctrl+C - + &Cut &Wytnij - + Ctrl+X Ctrl+X - + &Paste &Wklej - + Ctrl+V Ctrl+V @@ -600,49 +600,49 @@ p, li { white-space: pre-wrap; } Główne ustawienia - + Store calib. and hw settings in selected profile Zapamiętanie kalibracji i ustawień HW w wybranym profilu - + Retrieve calib. and hw settings from profile Odtworzenie kalibracji i ustawień HW z profilu - + General settings used throught the transmitter. These will be relevant for all models in the same EEPROM. Główne ustawienia radia. Będą one obowiązywać dla wszystkich modeli w tym samym EEPROM-ie. - + Setup Ustawienia - + Timer Beeps Pikanie timerów - + Contrast Kontrast - + Channel Order (For Templates) Kolejność kanałów (dla szablonów) - + Owner Name Imię użytkownika - + Mode selection: Mode 1: @@ -683,95 +683,95 @@ Mode 4: - + Mode 1 (RUD ELE THR AIL) Mod 1 (SK.SW.Gaz.Lot) - + Mode 2 (RUD THR ELE AIL) Mod 2 (SK.Gaz.SW.Lot) - + Mode 3 (AIL ELE THR RUD) Mod 3 (Lot.SW.Gaz.SK) - + Mode 4 (AIL THR ELE RUD) Mod 4 (Lot.Gaz.SW.SK) - - + + Quiet Cichy - + Only Alarms Tylko Alarmy - - + + No Keys Bez przycisków - - + + All Wszystkie - + MAVLink Baud Rate Prędkość przesyłu MAVLink - + 4800 Baud 4800 bps - + 9600 Baud 9600 bps - + 14400 Baud 14400 bps - + 19200 Baud 19200 bps - + 38400 Baud 38400 bps - + 57600 Baud 57600 bps - + 76800 Baud 76800 bps - + 115200 Baud 115200 bps - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -784,22 +784,22 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Jedno piknięcie co każdą pełną minutę</span></p></body></html> - + Every Minute Co minutę - + Beeps at 30, 15, 10, and down from5 seconds Sygnały w 30s, 15s, 10s i odliczanie od 5 sekund do 0 - + Count Down to Zero Odliczanie do zera - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -812,38 +812,38 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Błyśnij podświetlaniem przy piknięciu timera</span></p></body></html> - + Flash on beep Błyskanie w czasie sygnału - + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. Jeśli ta wartość jest różna od 0, każde naciśnięcie klawisza włączy podświetlenie, które zgaśnie po ustalonej liczbie sekund. - - + + sec s - + Input Filter Wprowadź filtr - - - - - - - - - - - + + + + + + + + + + + Beeper volume 0 - Quiet. No beeps at all. @@ -860,16 +860,16 @@ p, li { white-space: pre-wrap; } 4 - Bardzo głośna. - + Alarms Only Tylko alarmy - - - - - + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -894,21 +894,21 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ostrzeżenie cichej pracy - będzie ostrzegało gdy pikanie jest ustawione na cicho(0)</p></body></html> - + Beeper Mode Tryb pikania - - - - + + + + Off Wyłączony - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -923,42 +923,42 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Wartości z zakresu 20-45</span></p></body></html> - + Memory Startup Warning Ostrzeżenie o małym zapasie pamięci - - + + X-Short Bardzo krótka - - + + Short Krótka - - + + Normal Normalna - - + + Long Długa - - + + X-Long Bardzo długa - + Battery warning voltage. This is the threashhold where the battery warning sounds. @@ -969,160 +969,160 @@ Ustala próg ostrzeżenia. Dopuszczalne wartości 5v-10v - + Battery Warning Ostrzeżenie o zasilaniu - + THR Gaz - + RUD SK - + ELE SW - + AIL Lotki - + GEA - + ID0 - + ID1 - + ID2 - + Sound Mode Tryb dźwiękowy - + Pot Scrolling Enable Przewijanie potencjometrem włączone - + Battery Calibration Kalibracja zasilania - + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. Radio zasygnalizuje dźwiękiem brak aktywności po określonej liczbie minut. 0- wyłącza tę funkcję. - + min Min - - + + Show splash screen on startup Pokazuj ekran startowy z logo - + Battery calibration: This value will be added to the measured battery voltage. Use this value to calibrate the meter with an external meter. Kalibracja zasilania: Ta wartość będzie dodana do zmierzonej wartości napięcia zasilania. Użyj tej wartości w celu kalibracji wyświetlanego napięcia aby było zgodne z napięciem wskazywanym przez miernik. - + Single Pojedynczy - + Oversample - + Filter Filtr - + Show Splash Screen on Startup Pokazuj ekran startowy z logo - + Inactivity Timer Timer bezczynności - + Beeper Pikanie - + Speaker Głośnik - + BeeperVoice Pikanie i głosy - + SpeakerVoice Głośnik i głosy - + Beeper Length Długość piknięcia - + GPS Coordinates Koordynaty GPS - + hh° (N/S) mm' ss''.dd hh° (N/S) mm' ss''.dd - + NMEA - + Timeshift from UTC Strefa czasowa względem UTC - + Channel order This is used by the templated to determine which channel goes to what number output. @@ -1131,610 +1131,610 @@ This is used by the templated to determine which channel goes to what number out To ustawienie jest używane przez szablony, określa jakie wyjście przypisane jest do kanału. - + Speaker Pitch (spkr only) Wysokość tonów (tylko dźwięki) - + Haptic Mode Tryb wibracji - + Stick Mode Mod drążków - + Show Owner Name on Splash Pokaż imię pilota na ekranie - + Telemetry NO DATA Alarm Telemetria: Alarm braku danych - + LCD Display Type Typ ekranu LCD - + Standard Standard - + Optrex - + This is the switch selectrion for turning on the backlight (if installed). To jest przełącznik do włączenia podświetlenia (jeśli zainstalowane). - + Speaker Volume Głośność dźwięków - + Haptic Length Długość wibracji - + Haptic Strength Siła wibracji - + BackLight Brightness Jasność podświetlenia - + Alarm Warning Ostrzeżenie alarmowe - + BackLight Auto OFF after Podświetlenie. Automatyczne wyłącznie po - + Bandgap Measuring Enable Włączone pomiary pasma - + RotEnc Navigation Nawigacja pokrętłem - + BackLight Switch Przełącznik podświetlania - + BackLight On Stick Move Podświetlenie włączone przy ruchu drążka - + BackLight Invert Odwróć podświetlanie - + Country Code Kod kraju - + Europe Europa - + Japan Japonia - + America Ameryka - + Metric Metryczne - + Imperial Imperialne - + Measurement Units Jednostki miar - + FrSky Internal Alarm Wewnętrzny alarm FrSky - + StickScroll Przewijanie drążkiem - + PPMSim - + Voice Language Język komunikatów - + CrossTrim Trymery krzyżowe - + Beep volume Głośność sygnałów - + Wav volume Głośność WAV - + Vario volume Głośność wariometru - + Background volume Głośność tła - + FAI Mode Tryb FAI - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Jeśli uaktywnisz tryb FAI, utracisz informacje o wariometrze, funkcje odtwarzania i ekrany telemetrii. Ten tryb nie może być dezaktywowany. - + R E T A K W G L - + R E A T K W L G - + R T E A K G W L - + R T A E K G L W - + R A E T K L W G - + R A T E K L G W - + E R T A W K G L - + E R A T W K L G - + E T R A W G K L - + E T A R W G L K - + E A R T W L K G - + E A T R W L G K - + T R E A G K W L - + T R A E G K L W - + T E R A G W K L - + T E A R G W L K - + T A R E G L K W - + T A E R G L W K - + A R E T L K W G - + A R T E L R G W - + A E R T L W K G - + A E T R L W G K - + A T R E L G K W - + A T E R L G W K - + Readonly Unlock Odblokuj "Tylko do odczytu" - + SC - + SE - + SA - + SF - + SH - + SD - + SB - + SG - + Trainer Trener - + Mode Tryb - + Input Wejście - + Weight Waga - + Switch Przełącznik - - + + PPM 1 PPM 1 - - - - + + + + chn1 Kanał 01 - - - - + + + + chn2 Kanał 02 - - - - + + + + chn3 Kanał 03 - - - - + + + + chn4 Kanał 04 - - + + PPM 2 PPM 2 - - + + PPM 3 PPM 3 - - + + PPM 4 PPM 4 - + Telemetry Telemetria - + RSSI Alarm 1 Alarm RSSI 1 - - + + ---- ---- - - + + Yellow Żółty - - + + Orange Pomarańczowy - - + + Red Czerwony - + RSSI Alarm 2 Alarm RSSI 2 - + NO DATA Alarm Alarm braku danych - + Calibration Kalibracja - + POT 4 Potencjometr 04 - + STICK 3 Drążek 03 - - + + Negative span Ujemny zakres - - + + Mid value Wartość środkowa - - + + Positive span Dodatni zakres - + STICK 1 Drążek 01 - + STICK 2 Drążek 02 - + STICK 4 Drążek 04 - - + + Pot (normal) Potencjometr (std) - - + + Multipos Switch Przeł. wielopoz - + S1 Type Typ P1 - + S2 Type Typ P2 - + POT 1 Potencjometr 01 - + POT 2 Potencjometr 02 - + POT 3 Potencjometr 03 - - - - + + + + += (Sum) += (Suma) - - - - + + + + := (Replace) := (Zastąpienie) - + Battery Zasilanie - + v V - + PPM Multiplier Mnożnik PPM - + Current Natężenie - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Are you sure ? @@ -1743,28 +1743,28 @@ funkcje odtwarzania i ekrany telemetrii. Ten tryb nie może być dezaktywowany. Jesteś pewien ? - - + + Warning Ostrzeżenie - + Wrong data in profile, radio calibration was not retrieved Błędne dane w profilu, kalibracja nie została odzyskana - + Wrong data in profile, hw related parameters were not retrieved Błędne dane w profilu, parametry HW nie zostały odzyskana - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Chcesz zapamiętać dane kalibracji profilu %1<br> Zastąpią one aktualne dane kalibracji? - + Calibration and HW parameters saved. Kalibracja i parametry HW zapamiętane. @@ -1841,25 +1841,25 @@ Jesteś pewien ? InputsPanel - + Move Up W górę - + Ctrl+Up Ctrl+Up - + Move Down W dół - + Ctrl+Down Ctrl+Down @@ -1869,112 +1869,112 @@ Jesteś pewien ? Wyczyść wszytkie ustawienia - + Source(%1) Źródło(%1) - + No Trim Bez trymera - + Weight(%1) Waga(%1) - + Switch(%1) Przełącznik(%1) - + Not enough available inputs! Za mało dostępnych wejść! - + Delete Selected Inputs? Skasować Wybrane Wejścia? - + &Add &Dodaj - + Ctrl+A Ctrl+A - + &Edit &Edycja - + Enter Enter - + &Delete &Wykasuj - + Delete Wykasuj - + &Copy &Kopiuj - + Ctrl+C Ctrl+C - + &Cut &Wytnij - + Ctrl+X Ctrl+X - + &Paste &Wklej - + Ctrl+V Ctrl+V - + Du&plicate &Zduplikuj - + Ctrl+U Ctrl+U - + Clear Inputs? Wyczyść Wejścia? - + Really clear all the inputs? Czy na pewno wyczyścić wszystkie wejścia? @@ -2061,119 +2061,119 @@ Jesteś pewien ? MainWindow - - - - + + + + File loaded Plik załadowany - + Display previous warning again at startup ? Wyświetlić poprzednie ostrzeżenie przy uruchomieniu? - + Checking for updates Sprawdź aktualizacje - - - - - + + + + + Unable to check for updates. Nie mogę sprawdzić aktualizacji. - - - - - + + + + + Save As Zapisz jako - + Executable (*.exe) Wykonywalny (*.exe) - + New release available Dostępne jest nowe wydanie - - + + No updates available at this time. Brak aktualizacji dostępnych teraz. - + Would you like to launch the installer? Chcesz uruchomić instalator? - - - - - - - - - - - - - + + + + + + + + + + + + + Error Błąd - - - - - + + + + + Error opening file %1: %2. Błąd otwarcia pliku %1: %2. - + Compilation server termporary failure, try later Serwer kompilacji chwilowo nieczynny, spróbuj później - + Display previous message again at startup ? Czy ponownie wyświetlić poprzednią informację przy uruchomieniu? - + Compilation server temporary failure, try later Serwer kompilacji chwilowo nieczynny, spróbuj później - - + + Compilation server too busy, try later Serwer kompilacji zbyt zajęty, spróbuj później - - + + Unknown server failure, try later Nieznany błąd serwera, spróbuj później - + Firmware %1 does not seem to have ever been downloaded. Version %2 is available. Do you want to download it now ? @@ -2183,31 +2183,31 @@ Pobrać teraz? - - + + Yes Tak - - + + No Nie - - + + Release Notes Informacje o wydaniu - - + + Do you want to download release %1 now ? Chcesz pobrać wydanie %1 teraz? - + A new version of %1 firmware is available (current %2 - newer %3). Do you want to download it now ? Jest dostępna nowa wersja firmware %1 @@ -2215,519 +2215,533 @@ Do you want to download it now ? Chcesz pobrać teraz? - + Ignore this version (r%1)? Zignorować wersję (r%1)? - + Release notes contain very important informations. Do you want to see them now ? Opis wydania zawiera bardzo ważne informacje. Chcesz je przeczytać teraz? - - + + File saved Plik zapisany - + Firmware updates Aktualizacja firmware - + Current firmware does not provide release notes informations. Aktualny firmware nie zawiera opisu wydania. - + Cannot write file %1: %2. Nie mogę zapisać pliku %1: %2. - - - - - + + + + + Taranis radio not found Nie znaleziono Radia Taranis - - - - + + + + Impossible to identify the radio on your system, please verify the eeprom disk is connected. Identyfikacja radia niemożliwa w Twoim systemie, proszę sprawdzić podłączony dysk eeprom. - - - + + + Backup is impossible Backup jest niemożliwy do wykonania - - - + + + The backup dir set in preferences does not exist Brak ustawień ścieżki backupu - - + + Warning Ostrzeżenie - + Conversion failed Konwersja nieudana - + Restore failed Zapis nieudany - + Backup failed Backup nieudany - + Copyright - + OpenTX Companion - FW: %1 - Profile: %2 OpenTX Companion - FW: %1 - Profil: %2 - &Setting... - &Ustawienia... + + About... + O aplikacji... - + + Print... + Drukuj... + + + + Simulate... + Symulacja... + + + + Simulate current model + Symulacja aktualnego modelu + + + + Load Backup... + Załaduj backup... + + + + View Log File... + Obejrzyj plik logów... + + + + Open and view log file + Otwórz i obejrzyj plik logów + + + Edit Settings Edycja Ustawień - &Downloads... - &Pobieranie... + + Settings... + Ustawienia... - + Download firmware and voice files Pobierz firmware i pliki dźwiękowe - Configure transmitter start screen... - Ustawienia ekranu startowego radia... - - - &Configure connection software... - &Ustawienia oprogramowania łączącego... - - - - New Profile - Nowy Profil - - - + Create a new Radio Setting Profile Utwórz nowy Profil Ustawień Radia - Classic - Klasyczna - - - The multicolor classical Companion icon theme - Wielokolorowy klasyczny wygląd ikon Companion - - - + A monochrome black icon theme Monochromatyczny czarny wygląd ikon - + + + Open Models and Settings file + Otwórz plik Modeli i Ustawień + + + + New Models+Settings + Nowe Modele+Ustawienia + + + + Create a new Models and Settings file + Utwórz nowy plik Modeli i Ustawień + + + + Open Models+Settings... + Otwórz Modele i Ustawienia... + + + + Save Models+Settings... + Zapisz Modele i Ustawienia... + + + + + Save Models and Settings file + Zapisz plik Modeli i Ustawień + + + + Save Models+Settings as... + Zapisz Modele+Ustawienia jako... + + + + Cut Model + Wytnij Model + + + + Cut current model to the clipboard + Wytnij aktualny model do schowka + + + + Copy Model... + Kopiuj Model... + + + + Copy current model to the clipboard + Wytnij aktualny model do schowka + + + + Paste Model... + Wklej Model... + + + + Paste model from clipboard + Wklaj Model ze schowka + + + + The classic companion9x icon theme + Klasyczny zestaw ikon Companion + + + A monochrome white icon theme Monochromatyczny biały wygląd ikon - + A monochrome blue icon theme Monochromatyczny niebieski wygląd ikon - + Small Małe - + Use small toolbar icons Użyj małych ikon paska narzędzi - + Use normal size toolbar icons Użyj normalnych ikon paska narzędzi - + Normal Normalne - + Use big toolbar icons Użyj dużych ikon paska narzędzi - + Big Duże - + Use huge toolbar icons Użyj olbrzymich ikon paska narzędzi - + Huge Olbrzymie - System default language - Podstawowy język systemu - - - Use system default language in menus - Użyj podstawowego języka systemu w menu - - - + Czech Czeski - + Use Czech in menus Użyj Czeskiego w menu - + German Niemiecki - + Use German in menus Użyj Niemieckiego w menu - + English Angielski - + Use English in menus Użyj Angielskiego w menu - + + Finnish + Fiński + + + + Use Finnish in menus + Użyj Fińskiego w menu + + + French Francuski - + Use French in menus Użyj Francuskiego w menu - + Italian Włoski - + Use Italian in menus Użyj Włoskiego w menu - + Hebrew Hebrajski - + Use Hebrew in menus Użyj Hebrajskiego w menu - + Polish Polski - + Use Polish in menus Użyj Polskiego w menu - + Portuguese Portugalski - + Use Portuguese in menus Użyj Portualskiego w menu - + Swedish Szwedzki - + Use Swedish in menus Użyj Szwedzkiego w menu - + Russian Rosyjski - + Use Russian in menus Użyj Rosyjskiego w menu - - About - O aplikacji + + + Radio Settings Profile + Profil Ustawień Radia - - Print - Drukuj + + Show recent Models+Settings documents + Pokaż ostatanie dokumenty Modeli i Ustawień - + Print current model Drukuj aktualny model - - Simulate - Symulacja - - - - Simulate selected model - Symulacja wybranego modelu - - - - loadBackup... - Załaduj backup... - - - - Logs - Logi - - - - Setting... - Ustawienia... - - - - Downloads... - Pobieranie... - - - - Check for updates... - Sprawdź aktualizacje... - - - + Check OpenTX and Companion updates Sprawdź aktualizacje OpenTX i Companion - + Edit Tx Splash Image... Edytor erkanu startowego radia... - - edit the splash screen of your TX - Edytuj ekran startowy swojego radia - - - - List programmers - Lista programatorów - - - + Fuses... Bezpieczniki... - + Manuals and other Documents Podręcznik i dokumentacja - + Open the OpenTX document page in a web browser Otwórz stronę dokumentacji OpenTX w przeglądarce - - Configure connection software... - Ustawienia oprogramowania łączącego... - - - + Save Tx Models and Settings to file Zapisz modele radia i ustawienia do pliku - - Contributors - Współpracownicy - - - + A tribute to those who have contributed to OpenTX and Companion Hołd dla tych, którzy przyczynili się do rozwoju OpenTX i Companion - + + Contributors... + Współpracownicy... + + + + + Recent Models+Settings + Ostatnie Modele+Ustawienia + + + Set Icon Theme Ustaw wygląd ikon - + Set Icon Size Ustaw wielkość ikon - &Settings - &Ustawienia - - - - Radio Settings Profiles - Profile Ustawień Radia - - - - - &%1 %2 - - - - Companion - Models and Settings Editor - %1 - profile %2 - Companion - Edytor Modeli i Ustawień - %1 - profil %2 - - - Companion - Models and Settings Editor - %1 - Companion - Edytor Modeli i Ustawień - %1 - - - + A new version of Companion is available (version %1)<br>Would you like to download it? Dostępna jest nowy Companion (wersja %1)<br>Chcesz ją pobrać ? - + A new release of Companion is available please check the OpenTX website! Nowe wydanie Companion jest dostępne, proszę sprawdzić stronę OpenTX! - + Firmware does not longer fit in the Tx, due to selected firmware options Firmware już nie mieści się w pamięci radia ze względu na wybrane parametry - - + + Compilation server requires registration, please check OpenTX web site Serwer kompilacji wymaga rejestracji, proszę odwiedzić stronę OpenTX - + Firmware does not fit in the Tx, due to selected firmware options Firmware już nie mieści się w pamięci radia ze względu na wybrane parametry - + Do you want to write the firmware to the transmitter now ? Chcesz wgrać firmware do radia teraz? - + The selected language will be used the next time you start Companion. Wybrany język będzie użyty po ponownym uruchomieniu Comapnion. - - - + + + OK OK - + The new theme will be loaded the next time you start Companion. Wybrany wygląd będzie użyty po ponownym uruchomieniu Comapnion. - + The icon size will be used the next time you start Companion. Wybrana wiekość ikon będzie użyta po ponownym uruchomieniu Comapnion. - - Open - Otwórz - - - - - - - + + + + + Read Models and Settings From Tx Wczytaj Modele i Ustawienia z radia - + Write Models and settings from %1 to the Tx? Czy zapisać Modele i Ustawienia z %1 do radia ? - + The file %1 has not been recognized as a valid Models and Settings file Write anyway ? @@ -2736,580 +2750,363 @@ nie został rozpoznany jako prawidłowy pli Modeli i Ustawień. Czy mimo wszystko zapisać? - - - - - - + + + + + + Backup Models and Settings From Tx Zbakupuj Modele i Ustawienia z radia - + Cannot check Models and Settings compatibility! Continue anyway? Nie mogę potwierdzić kompatybilności Modeli i Ustawień. Kontynuować? - + The transmitter firmware belongs to another product family, check file and preferences! Firmwqare radia nalezy do innej rodziny produktów, sprawdź plik i preferencje ! - + The transmitter firmware is outdated, please upgrade! Firmware radia jest przestarzały, proszę zaktualizować! - - + + Write Models and Settings To Tx Zapisz Modele i Ustawienia do radia - - + + Write Firmware To Tx Zapisz firmware do radia - + Cannot convert Models and Settings for use with this firmware, original data will be used Nie mogę skonwertować Modeli i Ustawień na ten rodzaj firmware, zostaną użyte oryginalne dane - + Restore Models and Settings To Tx Odtwórz Modele i Ustawienia do radia - + Could not restore Models and Settings to TX. The models and settings data file can be found at: %1 Nie mogę odtworzyć Modeli i Ustawień do radia. Plik modeli i ustawień mozna znaleźć w: %1 - + Firmware write failed Zapis firmawe nie powiódł się - + Could not write firmware to to transmitter. The models and settings data file can be found at: %1 Nie mogę zapisać Firmware do radia. Plik modeli i ustawień mozna znaleźć w: %1 - + Cannot backup existing Models and Settings from TX. Firmware write process aborted Nie mogę zbackupować Modeli i Ustawień z radia, Zapis Firmawe przerwany - + Save transmitter Models and Settings to File Zapisz Modele i Ustawienia z radia do pliku - + Impossible to identify the radio on your system, please verify that the eeprom disk is connected. Identyfikacja radia niemożliwa w Twoim systemie, proszę sprawdzić podłączony dysk eeprom. - + Read Tx Firmware to File Odczytaj firmware z radia do pliku - + OpenTX Home Page: <a href='%1'>%1</a> Strona domowa OpenTX: <a href='%1'>%1</a> - + The OpenTX Companion project was originally forked from <a href='%2'>eePe</a> Projekt Companion odłączony z oryginalnego <a href='%2'>eePe</a> - + If you've found this program useful, please support by <a href='%1'>donating</a> Jeśli uważasz, że ten program jest użyteczny, wesprzyj poprzez <a href='%1'>donację</a> - + Version %1, %3 Wersja %1, %3 - + About Companion O aplikacji Companion - &New - &Nowy - - - - Create a new file - Utwórz nowy plik - - - &Open... - &Otwórz... - - - - Open an existing file - Otwórz istniejący plik - - - &loadBackup... - &Załaduj backup... - - - + Load backup from file Załaduj backup z pliku - &Save - &Zapisz - - - - - Save the document to disk - Zapisz dokument na dysku - - - Save &As... - Zapisz j&ako... - - - Save the document under a new name - Zapisz dokument pod nową nazwą - - - Lo&gs - Lo&gi - - - - Open log file - Otwórz plik logów - - - &Downloads and Profiles... - &Pobrania i profile... - - - Firmware and voice file downloads as well as profile definition. - Pobrania plików Firmware i głosów jak również definicje profili. - - - &Check for updates... - &Sprawdź aktualizacje... - - - Check for new version of Companion - Sprawdź nową wersję Companion - - - Show Companion contributors list - Pokaz listę twórców Companion - - - - Show Companion changelog - Zobacz zmiany w Companion - - - &Write Models and Settings To Tx - &Zapisz Modele i Ustawienia do radia - - - + Write Models and Settings to transmitter Zapisz Modele i Ustawienia do radia - &Read Models and Settings From Tx - &Wczytaj Modele i Ustawienia z radia - - - + Read Models and Settings from transmitter Wczytaj Modele i Ustawienia z radia - + Write Firmware Zapisz firmware - - Open... - Otwórz... - - - - Save... - Zapisz... - - - - Save As... - Zapisz jako... - - - + Exit Zakończ - - Cut - Wytnij - - - - Cut current selection to the clipboard - Wytnij zaznaczenie do schowka - - - - Copy... - Kopiuj... - - - - Copy current selection to the clipboard - Wytnij zaznaczenie do schowka - - - - Paste... - Wklej... - - - - Paste clipboard into current selection - Wytnij zaznaczenie do schowka - - - - The new Companion 2 icon theme - Nowy zestaw ikon Companion 2 - - - + Monochrome Monochromatyczny - + MonoWhite MonoBiały - + MonoBlue MonoNiebieski - + System language Język systemu - + Use system language in menus Użyj języka systemu w menu - + + Download... + Pobieranie... + + + + Check for Updates... + Sprawdź aktualizacje... + + + + Companion Changes... + Zmiany w Companion... + + + + Show Companion change log + Pokaż log zmian Companion + + + + Firmware Changes... + Zmiany w Firmware... + + + + Show firmware change log + Pokaż log zmian Firmware + + + + Compare Models... + Porównaj modele... + + + + Edit the splash image of your TX + Edytuj ekran startowy swojego radia + + + + List programmers... + Lista programistów... + + + Write firmware to transmitter Zapisz firmware do radia - + + Add Radio Profile + Dodaj profil radia + + + + Configure Communications... + Ustaw komunikację... + + + + Configure software for communicating with the transmitter + Ustaw oprogramowanie komunikacyjne z radiem + + + Write Models and Settings from file to Tx Zapisz Modele i Ustawienia z pliku do radia - + Write Models and Settings from file to transmitter Zapisz Modele i Ustawienia z pliku do radia - Save transmitter Models and Settings to file - Zapisz Modele i Ustawienia do pliku - - - + Save the Models and Settings from the transmitter to a file Zapisz Modele i Ustawienia z radia do pliku - + Read Firmware Wczytaj Firmware - + + Yerico + + + + + Yellow round honey sweet icon theme + Żółty zaokrąglony miodiowy motyw ikon + + + Read firmware from transmitter Wczytaj Firmware z radia - - Configure software for reading from and writing to the transmitter - Ustawienia oprogramowania do odczytu i zapisu radia - - - &Read/Write - &Odczyt/Zapis - - - + Write Zapis - - + + %2 + %2 + + + + Invalid Models and Settings File %1 Błędny plik %1 Modeli i Ustawień - + Invalid binary Models and Settings File %1 Błędny binarny plik %1 Modeli i Ustawień - Contributors &List... - &Lista twórców... - - - &Old Preferences Dialog... - &Stary ekran preferencji... - - - Used the old Preferences Dialog - Użyty stary ekran preferencji - - - &Application Preferences... - Preferencje &Aplikacji... - - - Edit application preferences - Edycja preferencji aplikacji - - - - ChangeLog... - Zmiany... - - - - Firmware ChangeLog... - Zmiany firmware... - - - - Show firmware changelog - Zobacz zmiany w firmware - - - - Compare... - Porównaj... - - - + Compare models Porównaj modele - Customize the splash screen of your TX - Personalizuj obrazek na swoim radiu - - - E&xit - Za&kończ - - - + Exit the application Zakończ aplikację companion9x - Cu&t - &Wytnij - - - Cut the current selection's contents to the clipboard - Wytnij zaznaczenie do schowka - - - &Copy - &Kopiuj - - - Copy the current selection's contents to the clipboard - Kopiuj zaznaczenie do schowka - - - &Paste - &Wklej - - - Paste the clipboard's contents into the current selection - Wklej zawartość schowka na aktualnej pozycji - - - &List programmers - &Lista programatorów - - - + List available programmers Lista dostępnych programatorów - &Fuses... - Ustawienia &mikro-kontrolera... - - - + Show fuses dialog Pokaż okno ustawień mikro-kontrolera - &Simulate - &Symulator - - - Simulate selected model. - Symulacja wybranego modelu. - - - &Print - &Drukuj - - - Print current model. - Wydrukuj aktualny model. - - - &About - &O aplikacji - - - + Show the application's About box O aplikacji companion9x - + Classical Klasyczny - - The classical Companion icon theme - Klasyczny zestaw ikon Companion - - - - - New - Nowy - - - The Companion 2.0 colored icon theme - Kolowy zestaw ikon Companion 2.0 - - - - - Recent Files - Poprzednie pliki - - - Firmware Profiles - Profile firmware - - - + Set Menu Language Ustaw język menu - &File - &Plik - - - &Edit - &Edycja - - - &Help - &Pomoc - - - - + + File Plik - - + + Edit Edycja - + Settings Ustawienia - + Read/Write Odczyt/Zapis - - + + Help Pomoc - - Show a selection list of recent documents - Pokaż listę wyboru poprzednich dokumentów - - - - Radio Profiles - Profile Radia - - - + Show a selection list of radio settings profiles Pokaż listę wyboru profili ustawiań radia - + Ready Gotowe - + Unable to find file %1! Nie mogę znaleźć pliku %1! - + Error reading file %1: %2. Błąd odczytu pliku %1: @@ -3324,187 +3121,188 @@ Czy mimo wszystko zapisać? wolna pamięć[B] - + Editing model %1: Edycja modelu %1: + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + Error Błąd - - + + Unable to find file %1! Nie mogę odnaleźć pliku %1! - - - - + + + + Error opening file %1: %2. Błąd otwarcia pliku %1: %2. - - + + Invalid EEPROM File %1 Zły plik EEPROM %1 - + Invalid binary EEPROM File %1 Nieprawidłowy plik binarny EEPROM %1 - - - - + + + + Save As Zapisz jako - - - - + + + + Cannot write file %1: %2. Nie mogę zapisać pliku %1: %2. - - + + Error writing file %1: %2. Błąd zapisu pliku %1: %2. - + Do you want to use model wizard? Czy chcesz użyć konfiguratora modelu? - - - + + + Companion Companion - + Ask this question again ? Czy ponownie zapytać ? - - + + Error reading file %1: %2. Błąd odczytu pliku %1: %2. - + %1 has been modified. Do you want to save your changes? %1 został zmieniony. Zapisać? - + Backup is impossible Backup jest niemożliwy - + The backup dir set in preferences does not exist Ustawienia preferencji katalogu backupu nie istnieją - + Cannot write temporary file! Nie mogę zapisać pliku tymczasowego! - - - + + + Taranis radio not found Nie odnaleziono Radia Taranis - - - + + + Impossible to identify the radio on your system, please verify the eeprom disk is connected. Identyfikacja radia w Twoim systemie nie jest możliwa, sprawdź dysk eeprom podpięty do komputera. - - - + + + Backup EEPROM From Tx Backup EEPROM z radia - + Cannot check eeprom compatibility! Continue anyway? Nie mogę sprawdzić kompatybilności EEprom! Kontynuować ? - - + + Warning Ostrzeżenie - + Firmware in radio is of a different family of eeprom written, check file and preferences! Firmware w radiu jest różny od zapisanego eepromu, sprawdź plik i ustawienia! - + Firmware in flash is outdated, please upgrade! Firmware w radiu jest przestarzały. Proszę zaktualizować! - + Write EEPROM To Tx Zapis EEPROM do radia - - Open - Otwórz + + Open backup Models and Settings file + Otwórz plik backupu Modeli i Ustawień - + Invalid binary backup File %1 nieprawidłowy binarny plik %1 @@ -4286,17 +4084,17 @@ p, li { white-space: pre-wrap; } ModulePanel - + Trainer Output Wyjśćie Trenera - + Internal Radio System Wenętrzny moduł radiowy - + External Radio Module External Radio Module - Internal Radio System - zaznaczyć by opisać spójność nazw angielskich @@ -4306,918 +4104,713 @@ p, li { white-space: pre-wrap; } QObject - - + + Rud SK - - + + Ele SW - - + + Thr Gaz - - + + Ail Lotki - - - + + + P1 Potencjometr 1 - - - + + + P2 Potencjometr 2 - - - + + + P3 Potencjometr 3 - - + + S1 Potencjometr 1 - - + + S2 Potencjometr 2 - - + + LS Lewy suwak - - + + RS Prawy suwak - + TrmR Trymer SK - + TrmE Trymer SW - + TrmT Trymer gazu - + TrmA Trymer lotek - - - + + + REa Pokrętło :a - - - + + + REb Pokrętło :b - + Batt Bateria - + A1 Sygnał telemetrii A1 - + A2 Sygnał telemetrii A2 - + Alt Wysokość - + Rpm Obroty - + Fuel Paliwo - + T1 - + Tx - + Rx - + SWR SWR - + RSSI - + T2 - + Speed Prędkość - + Dist Odległość - + GPS Alt Wysokość GPS - + Cell Cela - + Cels Cele - + Vfas - + Curr Natężenie - + Cnsp - + Powr Moc - + AccX - + AccY - + AccZ - + HDG - + VSpd - + A1- - + A2- - + Alt- - + Alt+ - + Rpm+ - + T1+ - + T2+ - + Spd+ - + Dst+ - + Cur+ - + ACC - + Time - + Pwr+ - - + + LS1 PL1 - - + + LS2 PL2 - - + + LS3 PL3 - - + + LS4 PL4 - - + + LS5 PL5 - - + + LS6 PL6 - - + + LS7 PL7 - - + + LS8 PL8 - - + + LS9 PL9 - - + + LSA PLA - - + + LSB PLB - - + + LSC PLC - - + + LSD PLD - - + + LSE PLE - - + + LSF PLF - - + + LSG PLG - - + + LSH PLH - - + + LSI PLI - - + + LSJ PLJ - - + + LSK PLK - - + + LSL PLL - - + + LSM PLM, - - + + LSN PLN - - + + LSO PLO - - + + LSP PLP - - + + LSQ PLQ - - + + LSR PLR - - + + LSS PLS - - + + LST PLT - - + + LSU PLU - - + + LSV PLV - - + + LSW PLW - + Input %1 Wejście %1 - + MAX - + S11 P11 - + S12 P12 - + S13 P13 - + S14 P14 - + S15 P15 - + S16 P16 - + S21 P21 - + S22 P22 - + S23 P23 - + S24 P24 - + S25 P25 - + S26 P26 - + CYC%1 - + PPM%1 - + CH%1%2 Kan %1%2 - + X%1 - - - - + + + + ---- - - + + THR THR - - + + ON Włącz - - - + + + OFF Wyłącz - + Diff(%1) Róźnicowość(%1) - + Expo(%1) Expo(%1) - + Function(%1) Funkcja(%1) - + Curve(%1) Krzywa(%1) - + !Curve(%1) !Krzywa(%1) - - th9x - - - - - er9x - - - - - + + Support for frsky telemetry mod Wsparcie dla telemetrii FrSky - - + + Support for jeti telemetry mod Wsparcie telemetrii JETI - - + + Support for receiving ardupilot data Wsparcie dla otrzymywania danych ardupilota - - + + Support for receiving NMEA data Wsparcie dla otrzymywania danych NMEA - + Support for telemetry easy board Wsparcie dla platformy TelemetrEZ - - + + Support for MAVLINK devices Wsparcie urządzeń MAVLINK - + Rotary Encoder use in menus navigation Użycie pokrętła do nawigacji w menu - + Possibility to enable FAI MODE at field Umożliwienie uaktywniania tryb FAI w menu - + FAI MODE always enabled Tryb FAI zawsze aktywny - - - - - - - Enable heli menu and cyclic mix support - Uaktywnione menu Heli i wsparcie dla cyklicznych mikserów - - - - - - - - - Enable TEMPLATES menu - Uaktywnienie menu szablonów - - - - - - - No splash screen - Bez loga na ekranie - - - - - - - - - No flight modes - Firmware bez menu faz lotu - - - - - - - - - In model setup menus automatically set source by moving some of them - W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim - - - - - - - - - - - Use alternative SQT5 font - Użyj alternatywnego fontu SQT5 - - - - EEprom write progress bar - Pasek postępu wgrywania EEPROMu - - - - - No Winged Shadow How High support - Bez wsparcia - Winged Shadow How High - - - - - No vario support - Bez wsparcia wario - - - - - No GPS support - Bez wsparcia GPS - - - - - No gauges in the custom telemetry screen - Bez graficznych wskazań telemetrii - - - - Allow compensating for offset errors in FrSky FAS current sensors - Pozwolenie na kompensację błędów w czujnikach natężenia FrSky FAS - - - - OpenTX for FrSky Taranis Rev4a - OpenTX dla platformy FrSky Taranis Rev4a - - - - Use FrSky Taranis sticks in a 9X/9XR - Użyj drążków Taranisa w 9X/9XR - - - - OpenTX for FrSky Taranis - OpenTX dla platformy FrSky Taranis - - - - - Disable HELI menu and cyclic mix support - Dezaktywowane menu Heli i wsparcie dla cyklicznych mikserów - - - - - Disable TEMPLATES menu - Dezaktywowane menu szablonów - - - - - Disable Global variables - dezaktywowane zmienne globalne - - - - - - - - - Disable curves menus - Bez menu krzywych - - - - - - - Support for radio modified with regular speaker - Wsparcie dla modyfikacji radia zwykłym głośnikiem - - - - - - - - Used if you have modified your radio with voice mode - Używane jeśli radio jest zmodyfikowane w calu użycia komunikatów głosowych - - - - - - - Used if you have modified your radio with haptic mode - Używane jeśli radio jest zmodyfikowane do użycia wibracji - - - - - - - - - Battery graph - Grafika baterii - - - - - - - Enable the throttle trace in Statistics - Uaktywnić śledzenie gazu w statystykach - - - - Support of FrSky PXX protocol - Wsparcie dla protokołu Frsky PXX - - - - - - - - Support for DSM2 modules - wsparcie modułu DSM2 - - - - Your radio probably uses a wrong firmware, - eeprom size is 4096 but only the first 2048 are used - Twoje radio prawdopodobnie używa złego firmware, - wielkość eepromu jest 4096 ale tylko pierwsze 2048 jest używane - - - - PPM center adjustment in limits - Limit dostrojenia centrowania PPM + + Enable heli menu and cyclic mix support + Uaktywnione menu Heli i wsparcie dla cyklicznych mikserów - - - - - PPM values displayed in us - Wartości PPM wyświetlane w us (mikrosekundy) + + + Enable TEMPLATES menu + Uaktywnienie menu szablonów + + + + + + + No splash screen + Bez loga na ekranie @@ -5225,45 +4818,240 @@ p, li { white-space: pre-wrap; } - - Symetrical Limits - Limity symetryczne + + No flight modes + Firmware bez menu faz lotu - + + + + + + + In model setup menus automatically set source by moving some of them + W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim + + + + + + + + + + + Use alternative SQT5 font + Użyj alternatywnego fontu SQT5 + + + + EEprom write progress bar + Pasek postępu wgrywania EEPROMu + + + + + No Winged Shadow How High support + Bez wsparcia - Winged Shadow How High + + + + + No vario support + Bez wsparcia wario + + + + + No GPS support + Bez wsparcia GPS + + + + + No gauges in the custom telemetry screen + Bez graficznych wskazań telemetrii + + + + Allow compensating for offset errors in FrSky FAS current sensors + Pozwolenie na kompensację błędów w czujnikach natężenia FrSky FAS + + + + OpenTX for FrSky Taranis Rev4a + OpenTX dla platformy FrSky Taranis Rev4a + + + + Use FrSky Taranis sticks in a 9X/9XR + Użyj drążków Taranisa w 9X/9XR + + + + OpenTX for FrSky Taranis + OpenTX dla platformy FrSky Taranis + + + + + Disable HELI menu and cyclic mix support + Dezaktywowane menu Heli i wsparcie dla cyklicznych mikserów + + + + + Disable TEMPLATES menu + Dezaktywowane menu szablonów + + + + + Disable Global variables + dezaktywowane zmienne globalne + + + + - - Pots use in menus navigation - Użycie potencjometrów do nawigacji w menu - - - - OpenTX for 9X board - OpenTX dla platformy 9X + + Disable curves menus + Bez menu krzywych - SmartieParts 2.2 Backlight support - Wsparcie podświetlenia SmartieParts 2.2 + + + Support for radio modified with regular speaker + Wsparcie dla modyfikacji radia zwykłym głośnikiem + + + + + + + + Used if you have modified your radio with voice mode + Używane jeśli radio jest zmodyfikowane w calu użycia komunikatów głosowych - - - - + + + Used if you have modified your radio with haptic mode + Używane jeśli radio jest zmodyfikowane do użycia wibracji + + + + + + + + + Battery graph + Grafika baterii + + + + + + + Enable the throttle trace in Statistics + Uaktywnić śledzenie gazu w statystykach + + + + Support of FrSky PXX protocol + Wsparcie dla protokołu Frsky PXX + + + + + + + + Support for DSM2 modules + wsparcie modułu DSM2 + + + + Your radio probably uses a wrong firmware, + eeprom size is 4096 but only the first 2048 are used + Twoje radio prawdopodobnie używa złego firmware, + wielkość eepromu jest 4096 ale tylko pierwsze 2048 jest używane + + + + + + + + + PPM center adjustment in limits + Limit dostrojenia centrowania PPM + + + + + + + + + + + PPM values displayed in us + Wartości PPM wyświetlane w us (mikrosekundy) + + + + + + + + + Symetrical Limits + Limity symetryczne + + + + + + + + Pots use in menus navigation + Użycie potencjometrów do nawigacji w menu + + + + OpenTX for 9X board + OpenTX dla platformy 9X + + + + + SmartieParts 2.2 Backlight support + Wsparcie podświetlenia SmartieParts 2.2 + + + + + + + + In model setup menus automatically set switch by moving some of them W menu modelu automatyczne wybranie przełącznika w przez jego poruszenie - - - - + + + + Enable resetting values by pressing up and down at the same time Szybkie nastawianie wartości (+) a (-) neguje wartość @@ -5272,838 +5060,834 @@ p, li { white-space: pre-wrap; } (UP) a (DN) ustawia 0 - - - - - - + + + + + + No graphical check boxes and sliders Brak graficznych chekboxów i sliderów - - - - - - + + + + + + Don't use bold font for highlighting active items Nie używaj podświetlenia dla wybranych aktywnych elementów, mikserów, krzywych, expo, etc - + OpenTX for M128 / 9X board OpenTX dla platformy M128 / 9X - - - - + + + + EEprom write Progress bar Pasek postępu zapisywania EEPROM - - - - - + + + + + Imperial units Imperialne jednostki w telemetrii - + Bluetooth interface Interface Bluetooth - - - - - - + + + + + + Global variables Globalne zmienne - + OpenTX for 9XR OpenTX dla platformy 9XR - + OpenTX for 9XR with M128 chip OpenTX dla platformy 9X z układem M128 - + OpenTX for Gruvin9x board / 9X ie: OpenTX dla platformy Gruvin9X / 9X - + Support for SD memory card Wsparcie karty SD - + Support for DSM2 modules using ppm instead of true serial Wsparcie modułu DSM2 przez użycie PPM zamiast prawdziwego szeregowego - + OpenTX for Sky9x board / 9X OpenTX dla platformy Sky9x / 9X - + Enable HELI menu and cyclic mix support Uaktywnij menu HELI i cyklicznych mikserów - - ersky9x - - - - - - - + + Warning Ostrzeżenie - + EEPROM saved with these warnings: EEPROM zapisany z tymi ostrzeżeniami: - - + + FM%1 FP%1 FM%1 - + Input%1 Wejście %1 - + English Angielski - + French Francuski - + Italian Włoski - + German Niemiecki - + Czech Czeski - + Slovak Słowacki - + Spanish Hiszpański - + Portuguese Portugalski - + Polish Polski - + + Finnish + Fiński + + + No Nie - + RotEnc A Pokrętło :A - + Rot Enc B Pokrętło :B - + Rot Enc C Pokrętło :C - + Rot Enc D Pokrętło :D - + Rot Enc E Pokrętło :E - - + + No repeat Bez powtórzeń - + %1 sec %1 s - + Safety %1 Bezpieczny %1 - + ASpd - + ASpd - + dTE - + dTE - + Cel- - + Cel- - + Vfs- - + Vfs- - + RudTrim Left SK Trymer lewy - + RudTrim Right SK Trymer prawy - + EleTrim Down SW Trymer w dół - + EleTrim Up SW Trymer w górę - + ThrTrim Down Gaz Trymer w dół - + ThrTrim Up Gaz Trymer w gorę - + AilTrim Left Lotki trymer w lewo - + AilTrim Right Lotki trymer w prawo - + ABS - + ABS - + THs - + THs - + TH% - + TH% - + THt - + THt - + ??? ??? - + a>x a>x - + a<x a<x - + |a|>x |a|>x - + |a|<x |a|<x - + AND I (logiczne) - + OR Lub (logiczne) - + XOR XOR (Logiczne) - + a=b a=b - + a!=b a!=b - + a>b a>b - + a<b a<b - + a>=b a>=b - + a<=b a<=b - + d>=x d>=x - + |d|>=x |d|>=x - + a~x a~x - + Timer Timer - + Sticky - + Stay Utrzymuj - + Unknown Nieznane - + STAY(%1, [%2:%3]) Utrzymuj(%1, [%2:%3]) - + STICKY(%1, %2) - + TIMER(%1, %2) TIMER(%1, %2) - + Trainer Trener - + Trainer RUD Trener - SK - + Trainer ELE Trener - SW - + Trainer THR Trener - Gaz - + Trainer AIL Trener - Lotki - + Instant Trim Natychmiastowe trymowanie - + Play Sound Odtwórz dźwięk - + Play Haptic Wibruj - + Reset Zresetuj - + Set Timer %1 Ustaw Timer %1 - + Vario Wariometr - + Play Both Odtwórz oba - + Play Value Odtwórz wartość - + Start Logs Start logowania - + Volume Głośność - + Backlight Podświetlenie - + Adjust GV%1 Ustaw ZG%1 - - - - - - + + + + + + <font color=red><b>Inconsistent parameter</b></font> Niespójny parametr <font color=red><b>Niespójny parametr</b></font> - + Rotary Encoder Pokrętło - + !Flight mode %1 !Faza lotu %1 - + Flight mode %1 Faza lotu %1 - + Yellow Żółty - + Orange Pomarańczowy - + Red Czerwony - + Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (nie obsługiwane) - + FrSky Sensor Hub Hub sensora FrSky - - + + None Żaden - + Imperial Imperialne - + Metric Metryczne - + Extra Fine Bardzo dokładne - + Fine Dokładne - + Medium Średni - + Coarse Gruby - + Exponential Eksponencjalny - + Count Up Licz - + Count Down Odliczaj - + %1:%2, - + : %1 Channels, %2usec Delay :Kanały %1, opóźnienie %2usX - + Flight modes(%1) Fazy lotu(%1) - + Flight mode(%1) Faza lotu (%1) - + Rudder SK - + Elevator SW - + Throttle Gaz - + Aileron Lotki - + Play Track Odtwórz ścieżkę - - - + + + --- - + Rud Trim Trymer SK - + Ele Trim Trymer SW - + Thr Trim Trymer gazu - + Ail Trim Trymer lotek - + Rot Enc Pokrętło - + Swedish Szwedzki - + CH%1 Kan %1 - + Background Music Muzyka tła - + Background Music Pause Muzyka tła - pauza - + Delay %1 sec Opóźnienie %1sec - + Duration %1 sec Czas trwania %1 sec - - - - + + + + Timer1 - - - - + + + + Timer2 - - - + + + All Wszystkie - - - + + + Telemetry Telemetria - - + + Value Wartość - - + + Decr: Zmniejsz: - - + + Incr: Zwiększ: - + Played once, not during startup Otwarzaj raz, nie w trakcie uruchomienia - + %1s - + Value Wartość - + Source Źródło - + GVAR Zmienna - + Increment Zwiększanie - + Own value Własny Wartość - + Flight mode %1 value Flight phase %1 value Wartość Fazy lotu FL%1 - + Keys Przyciski - + Sticks Drążki - + Keys + Sticks Przyciski i Drążki - - + + -GV%1 -ZG%1 - - - + + + GV%1 ZG%1 - - - + Simulator for this firmware is not yet available Nie jest dostępny symulator dla tego firmware @@ -6114,26 +5898,26 @@ p, li { white-space: pre-wrap; } Równoległe użycie expo i krzywych nie jest dłużej wspierane - + openTx only accepts %1 points in all curves openTx dopuszcza tylko %1 punktów dla wszystkich krzywych - - - - + + + + OpenTX on this board doesn't accept this function OpenTX na tej platformie nie dopuszcza tej funkcji - - + + OpenTX doesn't accept this protocol OpenTX nie obsługuje tego protokołu - + OpenTX doesn't allow this number of channels OpenTX nie obsługuje tej ilości kanałów @@ -6181,17 +5965,17 @@ Zespół OpenTX/Companion. Użyj trymerów dla Fazy Lotu %1 + Własne trymery jako offset - + FW: %1 FW:%1 - + Pict: %1 Obrazek:%1 - + Profile image Obrazek Profilu @@ -6223,10 +6007,6 @@ Zespół OpenTX/Companion. Throttle Source Źródło gazu - - Switch startup Warning - Ostrzeżenie o przełącznikach przy uruchomieniu - Center beep @@ -6237,19 +6017,11 @@ Zespół OpenTX/Companion. Trim Increment Kroki trymera - - ON - Włącz - OFF Wyłącz - - Check - Sprawdzenie - Model Image @@ -6341,6 +6113,296 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również Automatyczne + + SimulatorDialog + + + + Warning + Ostrzeżenie + + + + Joystick enabled but not configured correctly + Joystick uaktywniony ale nieprawidłowo skonfigurowany + + + + Cannot open joystick, joystick disabled + Nie mogę otworzyć joysticka, dezaktywowany + + + + Simulating Tx (%1) + Symulacja Tx (%1) + + + + Firmware %1 error: %2 + Firmware %1 błąd: %2 + + + + SimulatorDialog9X + + + Companion Simulator + Symulator Companion + + + + + + + Right Double Click to Reset + Powójne kliknięcie PPM w celu zresetowania + + + + THR + Gaz + + + + RUD + SK + + + + ELE + SW + + + + AIL + Lotki + + + + + Hold X + Przytrzymaj X + + + + + Fix X + Zablokuj X + + + + + Fix Y + Zablokuj Y + + + + + Hold Y + Przytrzymaj Y + + + + + + + TextLabel + Etykieta + + + + TRN + TRN + + + + GEA + GEA + + + + ID0 + ID0 + + + + ID1 + DI1 + + + + ID2 + ID2 + + + + BEEP + Dźwięk + + + + P1 + Potencjometr1 + + + + + + 0 % + + + + + P2 + Potencjometr2 + + + + P3 + Potencjometr 3 + + + + 9x Simulator + Symulator 9x + + + + Outputs + Wyjścia + + + + SimulatorDialogTaranis + + + Companion Simulator + Symulator Companion + + + + + Hold Y + Przytrzymaj Y + + + + + Fix Y + Zablokuj Y + + + + + Fix X + Zablokuj X + + + + + Hold X + Przytrzymaj X + + + + + SD + SD + + + + + SC + SC + + + + + + + Right Double Click to Reset + Powójne kliknięcie PPM w celu zresetowania + + + + + S2 + S2 + + + + + SG + SG + + + + + RS + RS + + + + + SH + SH + + + + + + + TextLabel + Etykieta + + + + + S1 + S1 + + + + + SB + SB + + + + + SA + SA + + + + + SE + SE + + + + + + SF + SF + + + + + LS + LS + + + + Taranis Simulator + Symulator Taranis + + + + Outputs + Wyjścia + + Telemetry @@ -6684,7 +6746,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również miliAmpery (mA) - + Range Zasięg @@ -6735,7 +6797,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również TelemetryPanel - + Telemetry screen %1 Panel Telemetrii %1 @@ -6786,17 +6848,17 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również TimerPanel - + None Żaden - + Beeps Dźwięk - + Countdown Odlicznie @@ -6804,29 +6866,25 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również appPreferencesDialog - Application Preferences - Preferencje Aplikacji - - - + Simulator capture folder Katalog zapisu symulatora - + Remember simulator switch values Zapamiętaj ustawienia przełączników w symulatorze - - - - + + + + Open Folder Otwórz katalog - + User Splash Screens Użyj ekranu powitalnego @@ -6836,47 +6894,52 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również Edycja Ustawień - + Application Settings Ustawienia Aplikacji - + + Only show user splash images + Pokaż tylko ekrany powitalne użytkownika + + + + Show user and companion splash images + Pokaż ekrany powitalne użytkownika i Companion + + + Simulator Settings Ustawienia Symulatora - + Blue Niebieskie - + Green Zielone - + Red Czerwone - + Orange Pomarańczowe - + Yellow Żółte - - Radio Settings - Ustawienia Radia - - - + Mode selection: Mode 1: @@ -6899,27 +6962,27 @@ Mode 4: - + Mode 1 (RUD ELE THR AIL) Mod 1 (SK.SW.Gaz.Lot) - + Mode 2 (RUD THR ELE AIL) Mod 2 (SK.Gaz.SW.Lot) - + Mode 3 (AIL ELE THR RUD) - + Mode 4 (AIL THR ELE RUD) Mod 4 (Lot.Gaz.SW.SK) - + Channel order This is used by the templated to determine which channel goes to what number output. @@ -6928,321 +6991,317 @@ This is used by the templated to determine which channel goes to what number out To ustawienie jest używane przez szablony, określa jakie wyjście przypisane jest do kanału. - + R E T A K W G L - + R E A T K W L G - + R T E A - + R T A E K G L W - + R A E T K L W G - + R A T E K L G W - + E R T A W K G L - + E R A T W K L G - + E T R A W G K L - + E T A R W G L K - + E A R T W L K G - + E A T R W L G K - + T R E A G K W L - + T R A E G K L W - + T E R A G W K L - + T E A R G W L K - + T A R E G L K W - + T A E R G L W K - + A R E T L K W G - + A R T E L R G W - + A E R T L W K G - + A E T R L W G K - + A T R E L G K W - + A T E R L G W K - + Default Stick Mode Bazowy mod drążków - - Settings Profile - Ustawienia Profilu - - - + Splash Screen Ekran startowy - + Channel Order Kolejność kanałów - + Append version number to FW file name Dodaj numer Firmware do nazwy pliku - + SD Structure path Struktura karty SD - + + Firmware Variant + Wariant Firmware + + + Select Image Wybierz obrazek - + + Firmware File + Plik Firmware + + + Offer to write FW to Tx after download Zaproponuj zapisanie FirmWare do radia po pobraniu - + + Radio Settings Profile + Profil Ustawień Radia + + + + Profile Name + Nazwa profilu + + + Remove Profile Usuń Profil - + Clear Image Wyczyść obrazek - Firmware - Firmware + Firmware - - Include companion splashes - Załącz ekrany powitalne - - - - Only user defined splashes - Tylko własne ekrany powitalne - - - + Splash Screen Library Biblioteka ekranół powitalnych - + Files to keep Pkili to zapamiętania - + Simulator BackLight Podświetlenie symularota - + Automatic Backup Folder Automatyczny Katalog Backupów - + Only capture to clipboard Przechwyć tylko do schowka - + Joystick Joystick - + Find Executable Znajdź plik wykonywalny - + Google Earth Executable Plik wykonywalny Google Earth - + Calibrate Kalibracja - + Enable Aktywowany - + Show splash screen when Companion starts Pokaz ekran startowy przy uruchamianiu Companion - + Automatic check for OpenTX firmware updates Automatycznie sprawdź aktualizacje firmware OpenTX - + Automatic check for Companion updates Automatycznie sprawdź aktualizacje Companion - + Offer to use wizard for new models Zaproponuj użycie konfiguratora dla nowych modeli - + Enable automatic backup before writing firmware Uaktywnij automatyczny backup przed zapisem firmware - + Select your snapshot folder Katalog zrzutów - - + + No joysticks found Brak oysticka - + Select your library folder Wybierz katalog bibliteki - + Select your Models and Settings backup folder Wybierz folder do backupowania Modeli i Ustawień - + Select Google Earth executable Wybierz wykonywalny plik Google Earth - + Select the folder replicating your SD structure Wybierz folder do zreplikowania struktury Twojej karty SD - + Not possible to remove profile Usunięcie profilu jest niemożliwe - + The default profile can not be removed. Podstawowy profil nie moze być usunięty. - Error - Błąd - - - Cannot load %1. - Nie mogę załadować %1. - - - + Open Image to load Otwórz obrazek do załadowania - + Images (%1) Obrazki (%1) @@ -7580,40 +7639,40 @@ m2560 dla platformy V4 Port szeregowy sam-ba - + DFU-UTIL Configuration Konfiguracja DFU-UTIL - + SAM-BA Configuration Konfiguracja SAM-BA - + AVRDUDE Configuration Konfiguracja AVRDUDE - - - + + + Select Location Wybierz położenie - - + + Companion Companion - + <b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue? <b><u>UWAGA!</u></b><br>U zresetuje bezpieczniki %1 do fabrycznych ustawień.<br>Zapis bezpieczników może uszkodzić twoje radio.<br>Zrób to tylko jeśli jesteś pewien że są złe!<br>Jesteś pewien by kontynuować? - + <b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent. <b><u>Ostrzeżenie!</u></b><br>Normalnie typ procesora jest wybierany automatycznie zgodnie z wybranym firmware.<br>Jeśli zmienisz typ procesora dla EEpromu rezultaty mogą być nieprzewidywalne. @@ -7626,250 +7685,292 @@ m2560 dla platformy V4 Własne logo - - + Write to TX Zapisz do radia - + <html><head/><body><p>Modify calibration parameters using settings from current profile</p></body></html> <html><head/><body><p>Zmiana parametrów kalibracji przy użyciu aktualnego profilu</p></body></html> - + Patch calibration setting from profile Zamień ustawienia kalibracji wartościami z profilu - + <html><head/><body><p>Modify HW parameters using settings from current profile</p></body></html> <html><head/><body><p>Zmień ustawiania parametrów HW przy pomocy wartości z aktualnego profilu</p></body></html> - + Patch HW setting from profile Zmień ustawiania parametrów HW wartościami z profilu - + Date & Time Data i Czas - + + Use firmware start screen + Użyj ekranu startowego z firmware + + + + Use another start screen + Użyj innego ekranu startowego + + + + Use profile start screen + Użyj ekranu startowego z profilu + + + + Use library start screen + Użyj ekranu startowego z biblioteki + + + SVN - + Variant Wariant - Invert Color - Odwróć kolory + Odwróć kolory - Load Image - Otwórz logo + Otwórz logo - Open Splash Library - Otwórz bibliotekę obrazków + Otwórz bibliotekę obrazków - - ... - - - - Substitute image in firmware - Zmień logo w firmware + Zmień logo w firmware - - + + Browse for file Przeglądaj pliki - + Allows Companion to write to older version of the firmware Pozwól Companion na zapis do starszej wersji firmware - + Backup and restore Models and Settings Zbakupuj i odtwórz Modele i Ustawienia - Use image in settings - Użyj Logo w ustawieniach + Użyj Logo w ustawieniach - + Check Firmware compatibility Sprawdź kompatybilność firmware - + Current Profile Aktualny profil - + Cancel Przerwij - + Write firmware to TX Zapisz firmware do radia - + Current profile Aktualny profil - - Open - Otwórz - - - - - - - - + + + + + + Warning Ostrzeżenie - %1 is not a known firmware - %1 nie jest znanym firmware + %1 nie jest znanym firmware - Burn anyway ! - Wypiecz mimo wszystko ! + Wypiecz mimo wszystko ! - - - - - - - - - - + + + + + + + + + + + + + Error Błąd - + Unable to find file %1! Nie mogę odnaleźć pliku %1! - - - + + + Error opening file %1: %2. Błąd otwarcia pliku %1: %2. - + Write Models and Settings to TX Zapisz Modele i Ustawienia do radia - + Write Models and Settings in %1 to TX Zapisz Modele i Ustawienia w %1 do radia - + + Open Firmware File + Otwórz plik Firmware + + + Choose file to load Models and Settings from Wybierz plik Modeli i Ustawien do wczytania - - - + + %1 may not be a valid firmware file + %1 moze nie być prawidłowym plikiem firmware + + + + + Invalid binary Models and Settings File %1, Proceed anyway ? Nieprawidłowy plik Modeli i Ustawień : %1. Kontynuować ? - + Error reading file %1: %2. Błąd odczytu pliku %1: %2. - - Open Image to load - Otwórz plik z logo + + The firmware file is not valid. + Plik firmware jest błedny. - + + There is no start screen image in the firmware file. + Brak obrazka ekranu startowego w firmware. + + + + The profile image %1 does not contain an image. + Obraz profilu %1 nie zawiera obrazka. + + + + Open image file to use as Tx start screen + Otwórz plik obrazka by użyć go jako ekran startowy radia + + + + Image could not be loaded from %1 + Obrazek nie moze być załadowany z %1 + + + + The library image could not be loaded + Obrazek z biblioteki nie może być załadowany + + + Open Image to load + Otwórz plik z logo + + + Images (%1) Obrazki (%1) - - Cannot load %1. - Nie mogę załadować %1. + Nie mogę załadować %1. - + Cannot save customized firmware Nie mogę zapisać przystosowanego firmware - + Custom image not found Własny obrazek nie odnaleziony - + No firmware selected Brak wyboru firmware - + Wrong radio calibration data in profile, Settings not patched Błędna kalibracja radia w profilu, Ustawienia nie spatchowane - + Wrong radio setting data in profile, Settings not patched Błędne ustawienia radia w profilu, Ustawienia nie spatchowane - - + + Cannot write file %1: %2. Nie mogę zapisać pliku %1: %2. - + Error writing file %1: %2. Błąd zapisu pliku %1: @@ -7880,514 +7981,514 @@ m2560 dla platformy V4 compareDialog - Dialog - + Compare Models + Porównaj modele - + Drag first model here Przeciągnij tutaj pierwszy model - + Drag second model here Przeciągnij tutaj drugi model - + Close Zamknij - + Print Drukuj - + Print to file Drukuj do pliku - + General Model Settings Główne ustawienia modelu - - - + + + Name Nazwa - - + + EEprom Size Wielkość EEPROM - - + + Timer1 - - + + Timer2 - - + + Protocol Protokół - - + + Pulse Polarity Polaryzacja impulsu - - + + Throttle Trim Trymer gazu - - - - + + + + Enabled Włączone - - - - + + + + Disabled Wyłączone - - + + Throttle Expo Expo gazu - - + + Trim Increment Krok trymera - - + + Center Beep Dźwięk centrowania - + Flight modes Settings Flight Phases Settings Ustawiania faz lotu - - + + Fades Przejścia - - + + Trims Trymery - - - - - - - - + + + + + + + + Switch Przełącznik - - + + IN (+) - - + + OUT (-) - - - - - - - - - - + + + + + + + + + + FM FP FL - - + + Gvars Gl-Zm - - + + Rot. Enc. Pokrętło. - + Limits Limity - - - - - - - + + + + + + + Offset Ofset - - - - - + + + + + Min - - - - - + + + + + Max Maks - - - + + + Invert Odwróć - - - - - + + + + + CH Kanał - - + + INV Odwr - - + + NOR --- - + Global Variables Zmienne globalne - - + + GV ZG - + Expo/Dr Settings Expo/Ustawienia DR - - + + Weight Waga - - + + Curve Krzywa - + Mixers Miksery - - + + noTrim Bez trymera - - + + Delay(u%1:d%2) Opóźnienie(u%1:d%2) - - + + Slow(u%1:d%2) Spowolnienie(u%1:d%2) - - + + Warn Ostrzeżenie - - + + No name Model bez nazwy - - - - + + + + DISABLED Wyłączone - + Curves Krzywe - + 5 Points Curves 5-cio punktowe Krzywe - - - - + + + + pt %1 punkt %1 - + 9 Points Curves 9-cio punktowe Krzywe - - + + Function Funkcja - - + + Param Parametr - - + + Enable Włączone - + Telemetry Settings Ustawienia telemetrii - - + + Analog Analogowy - - + + Unit Jednostki - - + + Scale Skala - - - - + + + + A%1 - - + + Alarm 1 - - + + Alarm 2 - - - - - - Type - Typ - - Condition - Warunek + Type + Typ + Condition + Warunek + + + + + + Value Wartość - - - - + + + + Flight mode name Nazwa fazy lotu - - - - + + + + Flight modes Fazy lotu - - - - + + + + Flight mode Faza lotu - - + + Repeat Powtórz - - + + RSSI Alarm Alarm RSSI - - + + Telemetry Bars Wskaźniki telemetryczne - - + + Bar Number Numer wskaźnika - - + + Source Źródło - - + + Custom Telemetry View Własny ekran telemetrii - + Logical Switches Przełączniki Logiczne - - + + LS L suwak - + Switch Assignment Przypisanie Przełączników - + CF FS - + Print Document Drukuj dokument - + Select PDF output file Wybierz plik docelowy PDF @@ -8400,37 +8501,37 @@ m2560 dla platformy V4 - + People who have contributed to this project Ludzie związani z tym projektem - + Coders Programiści - + Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe) Specjalne podziękowania Rafałowi Tomczakowi (RadioClone), Thomasowi Husteterowi (th9x) a także Erazowi Ravivowi(er9x i eePe) - + Companion Release Notes Informacje o wydaniu Companion - + Thank you all !!! Wszystkim wam dziękujemy !!! - + Contributors Współpracownicy - + OpenTX Release Notes Informacje o wydaniu OpenTX @@ -8443,138 +8544,122 @@ m2560 dla platformy V4 Edytor ekrany startowego radia - - + + Invert Odwróć - - + + Load FW Otwórz firmware - - + + Load Pict Otwórz obrazek - - + + Load Profile Załaduj profil - - + + Save Zapisz - - + + Open Splash Library Otwórz bibliotekę obrazków - - - - + + + + ... - - Open - Otwórz - - - - - - + + + + Error Błąd - - Cannot load embedded FW image from %1. - Nie mogę załadować wstawionego obrazu FW z %1. - - - + Cannot load the image file %1. Nie mogę załadować pliku obrazka %1. - + Cannot load the profile image %1. Nie mogę załadować obrazu Profilu %1. - + Cannot load the library image %1. Nie mogę załadować obrazu biblioteki %1. - + File Saved Plik Zapisany - + The image was saved to the file %1 Obraz został zapisany do pliku %1 - + Image Refresh Error Błąd odświeżenia obrazka - + Failed to refresh image from file %1 Nieudane odswieżenie obrazka z pliku %1 - + File Save Error Błąd zapisu pliku - + Failed to write image to %1 Nieudany zapis obrazka do %1 - Could not find bitmap to replace in file - Nie mogę znaleźć bitmapy w celu zastąpienia pliku - - - + Open Image to load Otwórz obrazek do załadowania - + + Open Firmware File + Otwórz plik Firmware + + + + Can not load embedded image from firmware file %1. + Nie mogę załądować wbudowanego obrazka z pliku Firmware %1. + + + Images (%1) Obrazki (%1) - - Cannot load %1. - Nie mogę wczytać %1. - - - Could not store image in firmware file %1 - Nie mogę zapamiętać obrazka w pliku firmware %1 - - - The image file %1 could not be stored - Nie mogę zapamiętać pliku %1 - downloadDialog @@ -8584,17 +8669,17 @@ m2560 dla platformy V4 Pobierz: - + Unable to save the file %1: %2. Nie mogę zapisać pliku %1: %2. - + Companion Companion - + Download failed: %1. Pobieranie nieudane: %1. @@ -8607,7 +8692,7 @@ m2560 dla platformy V4 Bezpieczniki - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -8636,12 +8721,12 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">EEPROM wyczyszczenie ustawionego bezpiecznika: D7, 19, FC</span></p></body></html> - + Read Fuses Odczytaj bezpieczniki - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -8674,14 +8759,14 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Jeśli urządzeni zostanie zablokowane przeszukaj google w celu znalezienia &quot;Jak naprawić Fuse BRICK &quot;.</span></p></body></html> - + Reset Fuses EEPROM - PROTECT Zresetuj bezpieczniki EEPROM jest chroniony - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -8714,14 +8799,14 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Jeśli urządzeni zostanie zablokowane przeszukaj google w celu znalezienia &quot;Jak naprawić Fuse BRICK &quot;.</span></p></body></html> - + Reset Fuses EEPROM - DELETE Zresetuj bezpieczniki EEPROM będzie skasowany - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -8800,60 +8885,16 @@ May be different from firmware language Ustaw język komuniaktów głosowych (). Moze być inny od języka firmware - - SD Structure path - Struktura karty SD - Processor ID ID procesora - - Default Stick Mode - Bazowy mod drążków - - - Channel Order - Kolejność kanałów - - - Mode 1 (RUD ELE THR AIL) - Mod 1 (SK.SW.Gaz.Lot) - - - Mode 2 (RUD THR ELE AIL) - Mod 2 (SK.Gaz.SW.Lot) - - - Mode 4 (AIL THR ELE RUD) - Mod 4 (Lot.Gaz.SW.SK) - Options Opcje - - Channel order - -This is used by the templated to determine which channel goes to what number output. - Kolejność kanałów - -To ustawienie jest używane przez szablony, określa jakie wyjście przypisane jest do kanału. - - - Open Folder - Otwórz katalog - - - Offer to write FW to Tx after download - Zaproponuj zapisanie FirmWare do radia po pobraniu - - - Save Profile - Zapisz profil - Menu Language @@ -8869,136 +8910,16 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Firmware Type TYp Firmware - - Append version number to FW file name - Dodaj numer Firmware do nazwy pliku - Download Voice Pobierz Głos - - Downloads and Profiles - Pobrania i profile - FwInfo Informacje o Firmware - - R E T A - K W G L - - - R E A T - K W L G - - - R T E A - K W G L - - - R T A E - K G L W - - - R A E T - K W L G - - - R A T E - K G L W - - - E R T A - W K G L - - - E R A T - W K L G - - - E T R A - W G K L - - - E T A R - W G L K - - - E A R T - W L K G - - - E A T R - W L G K - - - T R E A - G K W L - - - T R A E - G K L W - - - T E R A - G W K L - - - T E A R - G W L K - - - T A R E - G L K W - - - T A E R - G L W K - - - A R E T - L K W G - - - A R T E - L R G W - - - A E R T - L W K G - - - A E T R - L W G K - - - A T R E - L G K W - - - A T E R - L G W K - - - Profile - Profile - - - Open Image - Otwórz obrazek - - - Splash Screen - Ekran startowy - - - Clear Image - Wyczyść obrazek - Download FW @@ -9010,268 +8931,244 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Sprawdź aktualizacje - + Last downloaded release: %1 Ostatnie pobrane wydanie: %1 - + The selected firmware has never been downloaded by Companion. Wybrany firmware nie został nigdy pobrany przez Companion. - + The selected firmware cannot be downloaded by Companion. Companion nie moze pobrac wybranego firmware. - - Select the folder replicating your SD structure - Wybierz folder do zreplikowania struktury Twojej karty SD - - - Profile name is empty, profile slot %1 will be deleted.<br>Are you sure ? - Nazwa profilu jest pusta, slot %1 będzie skasowany.<br>Jesteś pewien ? - - - Open Image to load - Otwórz obrazek do załadowania - - - Images (%1) - Obrazki (%1) - - - Error - Błąd - - - Cannot load %1. - Nie mogę załadować %1. - joystickDialog - + Configure Joystick Ustaw joystick - + Ch2 Kanał 02 - - - - - - - - + + + + + + + + Not Assigned Nie przydzielono - - - - - - - - + + + + + + + + Right Vertical Prawy pionowy - - - - - - - - + + + + + + + + Right Horizontal Prawy poziomy - - - - - - - - + + + + + + + + Left Vertical Lewy pionowy - - - - - - - - + + + + + + + + Left Horizontal Lewy poziomy - - - - - - - - + + + + + + + + P1 Potencjometr 1 - - - - - - - - + + + + + + + + P2 Potencjometr 2 - - - - - - - - + + + + + + + + P3/LS Potencjometr 3 /Lewy suwak - - - - - - - - + + + + + + + + RS Prawy suwak - + Ch1 Kanał 01 - + Ch4 Kanał 04 - + Ch6 Kanał 06 - + Ch3 Kanał 03 - + Ch5 Kanał 05 - + Ch7 Kanał 07 - + Ch8 Kanał 08 - + Instructions Instrukcja - + Cancel Przerwij - + Next Następny - + Ok OK - + Move sticks and pots in every direction making full movement Press next when finished Poruszaj drązkami i potencjometrami w pełnym możliwym zakresie. Naciśnij Dalej po skończeniu - - + + Error Błąd - + Cannot open joystick. Nie mogę otwórz joysticka. - + Place sticks and pots in middle position. Press next when done Ustaw drążki i potencjometry w środku. Naciśnij Dalej po skończeniu - + Map joystick channels to controls using comboboxes. Press next when done Zmapuj kanały joysticka używają comboboxów. Naciśnij Dalej po skończeniu - + Check inversion checkbox to get maximum at top-right position. Press next when done Sprawdż checkbox rewersu w celu uzyskania maksimum w górnej prawej pozycji. Naciśnij Dalej po skończeniu - + Press ok to save configuration Press cancel to abort joystick calibration Naciśnij OK w celu zapisu, Anuluj w celu przerwania kalibracji joysticka. Tlačítkem Zrušit přerušíte kalibraci - + Duplicated stick assignement Duplicitní přiřazení Drążki @@ -9284,52 +9181,52 @@ Tlačítkem Zrušit přerušíte kalibraci Companion - przegląd logów - + Filename nazwa pliku - + Open LogFile Otwórz plik logu - + Zoom Przybliżenie - + X X - + Y Y - + Fly sessions Loty - + Telemetry logs Logi Telemetrii - + Time Czas - + Error Błąd - + Cannot write file %1: %2. Nie mogę zapisać pliku %1: @@ -9354,7 +9251,7 @@ Tlačítkem Zrušit přerušíte kalibraci mdiChild - + Simulate Tx Symulacja radia @@ -9367,431 +9264,431 @@ Tlačítkem Zrušit přerušíte kalibraci Kreator ustawień modelu - + Engine Silnik - + Model Type Typ modelu - + Airplane Samolot - + Helicopter Heli - + Glider Szybowiec - + Wing Skrzydła - + Aileron controls Lotki - + No Ailerons Bez lotek - + 1 Servo (or Y) Jedno serwo (lub odwracający Y kabel) - - - + + + 2 Servos Dwa serwa - + Flaps controls Klapy - + No Flaps Bez klap - + 1 Servo (or inverting Y) Jedno serwo (lub Y kabel) - + Spoilers Przerywacze - + No Spoilers/Airbrakes Bez przerywaczy/hamulców - + 1 Servo (or Y or inverting Y) Jedno serwo (lub Y kabel) - + Swash Plate Tarcza - + Swash plate Tarcza - + 90° / Fixed / Coax - + 120° - + 120X° - + 140° - + FlyBarLess - + Tail Ogon - + Tail controls Kontrola ogona - + 1 Servo Elevator / 1 Servo Rudder 1x serwo SW / 1x serwo SK - + V Tail Deltamix (Usterzenie motylkowe) - + 2 Servos Elevator / 1 Servo Rudder 2x serwo SW / 1x serwo SK - + Gyroscope Gyro - + NoGyro Bez gyra - + Switch control Kontrola przełącznikem - + Pot control Kontrola potencjometrem - + Channel style Styl kanału - + Open9x Style Styl Open9x - + Futaba Style Styl Futaba - + 2 - + 3 - + 4 - + 5 - + 6 - + 7 - + 8 - + 9 - + 1 - + 10 - + Ele2 SW2 - + Use advanced controls Użyj zaawansowanych ustawień - + Spoiler2 Przerywacz2 - + Flap2 Klapa2 - + Flap1 Klapa1 - + Rud2 SK2 - - - - - - - + + + + + + + AUTO - - - - - - - + + + + + + + CH01 Kanał 01 - - - - - - - + + + + + + + CH02 Kanał 01 - - - - - - - + + + + + + + CH03 Kanał 03 - - - - - - - + + + + + + + CH04 Kanał 04 - - - - - - - + + + + + + + CH05 Kanał 05 - - - - - - - + + + + + + + CH06 Kanał 06 - - - - - - - + + + + + + + CH07 Kanał 07 - - - - - - - + + + + + + + CH08 Kanał 08 - - - - - - - + + + + + + + CH09 Kanał 09 - - - - - - - + + + + + + + CH10 Kanał 10 - + Ail2 Lotka2 - + Spoiler 1 Przerywacz1 - + Delta wing Skrzydło delta - - + + Not present Brak - + Present Jest - + Rudder SK - + Single rudder Pojedynczy SK - + Dual rudder (with 2 servos) Podwójny SK (dwa serwa) - + Apply configuration ? Zastosować konfigurację ? - + Apply configuration deleting existing model ? Zastosować konfigurację kasując instniejący model ? @@ -10314,100 +10211,6 @@ Mode 4: Use clipboard only Użycie schowka do kopiowania - - - Last downloaded release: %1 - Ostatnie pobrane wydanie: %1 - - - - Image stored in settings - Logo zapamietane w ustawieniach - - - - - No joysticks found - Brak oysticka - - - - Select the folder replicating your SD structure - Wybierz folder do zreplikowania struktury Twojej karty SD - - - - Profile name is empty, profile slot %1 will be deleted.<br>Are you sure ? - Nazwa profilu jest pusta, slot %1 będzie skasowany.<br>Jesteś pewien ? - - - - Select your library folder - Support for SD memory card - Wybierz katalog bibliteki - - - - Select your snapshot folder - Katalog obrazków dla symulatora - - - - The selected firmware has never been downloaded by Companion. - Wybrany firmware nie został nigdy pobrany przez Companion. - - - - The selected firmware cannot be downloaded by Companion. - Companion nie moze pobrac wybranego firmware. - - - - Select your Models and Settings backup folder - Wybierz folder do backupowania Modeli i Ustawień - - - - Select Google Earth executable - Wybierz wykonywalny plik Google Earth - - - - - Error - Błąd - - - - - Cannot load %1. - nie mogę wczytać %1. - - - - Export profile As - Wyeksportuj profil jako - - - - Profile slot is not empty, profile slot %1 will we overwritten.<br>Are you sure ? - Slot profilu nie jest pusty, slot %1 zostanie zapisany.<br>Jesteś pewien ? - - - - Open Profile to import - Otworzyć PRofil do zaimportowania - - - - Open Image to load - Otworzyć obrazek - - - - Images (%1) - Obrazki (%1) - printDialog @@ -10417,878 +10220,452 @@ Mode 4: - + Close Zamknij - + Print Drukuj - + Print to file Drukuj do pliku - + Setup for: Ustawianie: - + printed on: %1 Wydrukowanno na: %1 - + General Model Settings Główne ustawienia modelu - - - - + + + + Name Nazwa - + EEprom Size Rozmiar EEPROM - + Timer1 - + Timer2 - + Protocol Protokół - + Pulse Polarity Polaryzacja pulsu - + Throttle Trim Trymer gazu - - + + Enabled Włączone - + Disabled Wyłaczone - + Throttle Expo Expo gazu - + Trim Increment Krok trymera - + Center Beep Sygnał centrowania - + Flight modes Settings Flight Phases Settings Uztawienie faz lotu - + Fades Przejścia - + Trims Trymery - + Gvars Zmienne globalne - + Rot.Enc. Pokrętło. - - - - + + + + Switch Przełącznik - + Logical Switches Przełączniki Logiczne - - + + LS PL - + Switch Assignments Przypisanie Przełączników - + IN (+) - + OUT (-) - - - - + + + + FM FP LR - + Expo/Dr Settings Ustawienia Expo/DR - + Weight Vaga - - - + + + Curve Krzywa - + Mixers Miksery - - - - + + + + CH Kanał - + noTrim Bez trimu - - - - - + + + + + Offset Ofset - + Delay(u%1:d%2) Opóżnienie(u%1:d%2) - + Slow(u%1:d%2) Spowolnienie(u%1:d%2) - + Warn Ostrzeżenie - - + + DISABLED Wyłączone - + Limits Limity - - - - + + + + Min - - - - + + + + Max Maks - - - + + + Invert Odwrócenie - - - + + + INV Odwr - - - + + + NOR --- - + Curves Krzywe - + pt %1 pkt %1 - + Global Variables Zmienne globalne - + GV GZ - - + + Value Wartość - + Function Funkcja - + Parameter Parametr - + Repeat Powtórz - + Telemetry Settings Ustawienia telemetrii - - + + Alarm 1 Alarm 1 - - + + Alarm 2 Alarm 2 - + Analog Analog - + Unit Jednostki - + Scale Skala - - + + Type Typ - - + + Condition Warunek - + A%1 - + RSSI Alarm Alarm RSSI - + Frsky serial protocol Protokół szeregowy Frsky - + System of units System jednostek - + Propeller blades Łopaty śmigła - + Telemetry Bars Belki telemetrii - + Bar Number Numer belki - + Source Źródło - + ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*) pliki ODF (*.odt);;pliki PDF (*.pdf);;pliki HTML (*.htm *.html);;Wszystkie pliki (*) - - + + Custom Telemetry View Widok telemetrii użytkownika - + Flight mode name Nazwa trybu lotu - - + + Flight modes Tryby lotu - - + + Flight mode Tryb lotu - + Print Document Drukuj dokument - + Select PDF output file Wybierz docelowy plik PDF - - simulatorDialog - - - - - - Right Double Click to Reset - Powójne kliknięcie RP myszy w celu zresetowania - - - - THR - Gaz - - - - RUD - SK - - - - ELE - SW - - - - AIL - Lot - - - - - Hold X - Przytrzymaj X - - - - - Fix X - Zablokuj X - - - - - Fix Y - Zablokuj Y - - - - - Hold Y - Zablokuj Y - - - - - - - TextLabel - - - - - TRN - - - - - GEA - - - - - ID0 - - - - - ID1 - - - - - ID2 - - - - - P1 - Potencjometr1 - - - - - - 0 % - - - - - P2 - Potencjometr2 - - - - P3 - Potencjometr3 - - - - 9x Simulator - Symulator 9x - - - - Outputs - Wyjścia - - - - LS1 - PL1 - - - - LS2 - PL2 - - - - LS3 - PL3 - - - - LS4 - PL4 - - - - LS5 - PL5 - - - - LS6 - PL6 - - - - LS7 - PL7 - - - - LS8 - PL8 - - - - LS9 - PL9 - - - - LSA - PLA - - - - LSB - PLB - - - - LSC - PLC - - - - LSD - PLD - - - - LSE - PLE - - - - LSF - PLF - - - - LSG - PLG - - - - LSH - PLH - - - - LSI - PLI - - - - LSJ - PLJ - - - - LSK - PLK - - - - LSL - PLL - - - - LSM - PLM, - - - - LSN - PLN - - - - LSO - PLO - - - - LSP - PLP - - - - LSQ - PLQ - - - - LSR - PLR - - - - LSS - PLS - - - - LST - PLT - - - - LSU - PLU - - - - LSV - PLV - - - - LSW - PLW - - - - BEEP - Zvuk - - - - Companion Simulator - Symulator Companion - - - - CH1 - Kanał 01 - - - - - - - - - - - - - - - - - - - -100.1 - - - - - CH9 - Kanał 09 - - - - CH2 - Kanał 02 - - - - CH10 - Kanał 10 - - - - CH3 - Kanał 03 - - - - CH11 - Kanał 11 - - - - CH4 - Kanał 04 - - - - CH12 - Kanał 12 - - - - CH5 - Kanał 05 - - - - CH13 - Kanał 13 - - - - CH6 - Kanał 06 - - - - CH14 - Kanał 14 - - - - CH7 - Kanał 07 - - - - CH15 - Kanał 15 - - - - CH8 - Kanał 08 - - - - CH16 - Kanał 16 - - - - - Warning - Ostrzeżnie - - - - Joystick enabled but not configured correctly - Joystick uaktywniony ale nieprawidłowo skonfigurowany - - - - Cannot open joystick, joystick disabled - Nie mogę otworzyć joysticka, dezaktywowany - - - - Firmware %1 error: %2 - Firmware %1 błąd: %2 - - - - - Flight mode: %1(%2) - - Tryb lotu: %1(%2) - - - - Simulating Tx (%1) - Symulacja Tx (%1) - - - - Simulating - Symulacja - - splashLibrary - - + + ... @@ -11298,451 +10675,24 @@ Mode 4: Biblioteka obrazków - strona %1 z %2 - + Warning Ostrzeżenie - + Invalid image in library %1 Nieprawidłowy obrazek w bibliotece %1 - + Information Informacja - + No valid image found in library, check your settings Nie znaleziono prawodłowego obrazka w biblitece, sprawdź ustawienia - - xsimulatorDialog - - - - - SF - - - - - - SE - - - - - - SA - - - - - - SB - - - - - - - - Right Double Click to Reset - Podwójne klikniecie RP myszy w celu zresetowania - - - - - - - TextLabel - - - - - - Hold X - Przytrzymaj X - - - - - Fix X - Zablokuj X - - - - - Fix Y - Zablokuj Y - - - - - Hold Y - Przytrzymaj Y - - - - - SH - - - - - - SG - - - - - - SD - - - - - - SC - - - - - - S2 - Poten 2 - - - - - RS - P suwak - - - - - S1 - Poten 1 - - - - - LS - L suwak - - - - Outputs - Wyjścia - - - - CH1 - Kanał 01 - - - - Taranis Simulator - Symulator Taranis - - - - Companion Simulator - Symulator Companion - - - - - - - - - - - - - - - - - - - -100.1 - - - - - CH9 - Kanał 09 - - - - CH2 - Kanał 02 - - - - CH10 - Kanał 10 - - - - CH3 - Kanał 03 - - - - CH11 - Kanał 11 - - - - CH4 - Kanał 04 - - - - CH12 - Kanał 12 - - - - CH5 - Kanał 05 - - - - CH13 - Kanał 13 - - - - CH6 - Kanał 06 - - - - CH14 - Kanał 14 - - - - CH7 - Kanał 07 - - - - CH15 - Kanał 15 - - - - CH8 - Kanał 08 - - - - CH16 - Kanał 16 - - - - LSK - PLK - - - - LSC - PLC - - - - LSD - PLD - - - - LS7 - PL7 - - - - LSL - PLL - - - - LSB - PLB - - - - LS1 - PL1 - - - - LSH - PLH - - - - LSG - PLG - - - - LSE - PLE - - - - LSF - PLF - - - - LS8 - PL8 - - - - LS9 - PL9 - - - - LSA - PLA - - - - LSM - PLM, - - - - LSJ - PLJ - - - - LSI - PLI - - - - LS4 - PL4 - - - - LS5 - PL5 - - - - LS2 - PL2 - - - - LS3 - PL3 - - - - LS6 - PL6 - - - - LSN - PLN - - - - LSO - PLO - - - - LSP - PLP - - - - LSQ - PLQ - - - - LSR - PLR - - - - LSS - PLS - - - - LST - PLT - - - - LSU - PLU - - - - LSV - PLV - - - - LSW - PLW - - - - - Warning - Osrzeżenie - - - - Joystick enabled but not configured correctly - Joystick aktywny ale nie skonfogurowany prawidłowo - - - - Cannot open joystick, joystick disabled - Nie mogę otworzyć joystika, Joystik wyłaczony - - - - Firmware %1 error: %2 - Firmware %1 bład: %2 - - - - - Flight mode: %1(%2) - - Tryb lotu: %1(%2) - - - - Simulating Tx (%1) - Symulacja Tx (%1) - - - - Simulating - Symulacja - - diff --git a/companion/src/translations/companion_sv.ts b/companion/src/translations/companion_sv.ts index 9b2636f07..091cd0560 100644 --- a/companion/src/translations/companion_sv.ts +++ b/companion/src/translations/companion_sv.ts @@ -57,7 +57,7 @@ CurveGroup - + Diff Diff @@ -143,7 +143,7 @@ CustomFunctionsPanel - + Switch Brytare @@ -163,17 +163,17 @@ Effekt - + CF%1 - + - + ON På - + Error Fel @@ -183,7 +183,7 @@ Kan inte hitta ljudfilen %1! - + &Delete &Ta bort @@ -601,7 +601,7 @@ Om fältet lämnas tomt så är filtret aktivt hela tiden. Allmänna inställningar - + General settings used throught the transmitter. These will be relevant for all models in the same EEPROM. Allmänna inställningar för sändaren @@ -1541,7 +1541,7 @@ Mode 4: Spänning - + Warning Varning @@ -1557,12 +1557,12 @@ Mode 4: Felaktig information i profilen, hårdvaruinställningar lästes inte in - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Vill du skriva över existerande kalibreringsdata<br>i profilen %1 med de nuvarande? - + Calibration and HW parameters saved. Kalibrering ojch hårdvaruinställningar sparades. @@ -1677,7 +1677,7 @@ Mode 4: PPMSim - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Are you sure ? @@ -1844,25 +1844,25 @@ FAI-funktionen kan inte slås av i sändaren. InputsPanel - + Move Up Flytta uppåt - - + + Ctrl+Up Ctrl+Up - - + + Move Down Flytta nedåt - - + + Ctrl+Down Ctrl+Down @@ -1887,12 +1887,12 @@ FAI-funktionen kan inte slås av i sändaren. Brytare(%1) - + Clear All Settings Radera alla inställningar - + Not enough available inputs! För få filter är tillgängliga! @@ -2064,39 +2064,39 @@ FAI-funktionen kan inte slås av i sändaren. MainWindow - - - - + + + + File loaded Filen har laddats - + - - + + Save As Spara Som - - + + No updates available at this time. Inga updateringar finns tillgängliga. - - - - + + + + Unable to check for updates. Det gick inte att söka efter uppdateringar. - + Executable (*.exe) Program (*.exe) @@ -2106,110 +2106,96 @@ FAI-funktionen kan inte slås av i sändaren. Vill du starta installationsprogrammet? - + Do you want to write the firmware to the transmitter now ? Vill du skriva firmware till sändaren nu? - + A new version of %1 firmware is available (current %2 - newer %3). Do you want to download it now ? En ny version finns tillgänglig av %1 fimware (Din version %2 - Ny version %3). Vill du ladda ned den nya versionen nu ? - Open - Öppna + Öppna - + File saved Filen sparades - + Copyright Copyright - New - Ny + Ny - Open... - Öppna... + Öppna... - Save... - Spara... + Spara... - Save As... - Spara Som... + Spara Som... - + Exit Avsluta - Cut - Klipp Ut + Klipp Ut - Cut current selection to the clipboard - Klipp ut markeringens innehåll till klippbordet + Klipp ut markeringens innehåll till klippbordet - Copy... - Kopiera... + Kopiera... - Copy current selection to the clipboard - Kopiera markeringens innehåll till klippbordet + Kopiera markeringens innehåll till klippbordet - Paste... - Klistra In... + Klistra In... - Paste clipboard into current selection - Klistra in klippbokens innehåll i det valda avsnittet + Klistra in klippbokens innehåll i det valda avsnittet - + Classical Klassiskt - The classical Companion icon theme - Det klassiska Companion-temat + Det klassiska Companion-temat - The new Companion 2 icon theme - Det nya Companion2-temat + Det nya Companion2-temat - Companion2 - Companion2 + Companion2 - + Monochrome Monokromt @@ -2234,137 +2220,119 @@ Vill du ladda ned den nya versionen nu ? Använd systemspråket i menyerna - About - Om + Om - Print - Skriv ut + Skriv ut - + Print current model Skriv ut modell - Simulate - Simulera + Simulera - Simulate selected model - Simulera modell + Simulera modell loadBackup... Ladda backup från fil... - Logs - Loggar + Loggar - Setting... - Inställningar... + Inställningar... - Downloads... - Nedladdningar... + Nedladdningar... - Check for updates... - Sök efter uppdateringar... + Sök efter uppdateringar... - + Edit Tx Splash Image... Startbildsredigerare... - edit the splash screen of your TX - Editera startbilder för din sändare + Editera startbilder för din sändare - List programmers - Programmerare + Programmerare - + Fuses... Säkringar... - Configure connection software... - Inställningar för kommunikation... + Inställningar för kommunikation... - + Save Tx Models and Settings to file Spara sändarens Modeller och Inställningar till fil - Contributors - Bidragande + Bidragande - + A tribute to those who have contributed to OpenTX and Companion Ett tack till alla de som bidragit till OpenTX och Companion - + Settings Inställningar - + Read/Write Läs/Skriv - - &%1 %2 - &%1 %2 + &%1 %2 &New &Ny - Create a new file - Skapa ny fil + Skapa ny fil &Open... &Öppna... - Open an existing file - Öppna en existerande fil + Öppna en existerande fil &Save &Spara - - Save the document to disk - Spara dokumentet till fil + Spara dokumentet till fil Save &As... @@ -2379,12 +2347,12 @@ Vill du ladda ned den nya versionen nu ? &Sök efter uppdateringar... - + Display previous message again at startup ? Skall föregående varning visas igen vid uppstart ? - + Firmware does not longer fit in the Tx, due to selected firmware options Firmware får inte rum i minnet på grund av att för många funktioner aktiverats @@ -2394,12 +2362,12 @@ Vill du ladda ned den nya versionen nu ? Tillfälligt fel i byggservern. Försök igen senare - + Firmware does not fit in the Tx, due to selected firmware options Firmware får inte rum i minnet på grund av att för många funktioner aktiverats - + Firmware %1 does not seem to have ever been downloaded. Version %2 is available. Do you want to download it now ? @@ -2408,12 +2376,12 @@ Version %2 finns tillgänglig. Vill du ladda ned den nu ? - + Write Models and settings from %1 to the Tx? Skriv Modeller och Inställningar från %1 till sändaren? - + Conversion failed Konverteringen misslyckades @@ -2428,7 +2396,7 @@ Vill du ladda ned den nu ? Säkerhetskopieringen misslyckades - + OpenTX Companion - FW: %1 - Profile: %2 OpenTX Companion - FW: %1 - Profil: %2 @@ -2437,7 +2405,7 @@ Vill du ladda ned den nu ? &Inställningar... - + Edit Settings Redigera Inställningar @@ -2459,7 +2427,7 @@ Vill du ladda ned den nu ? &Avsluta - + Exit the application Avsluta programmet @@ -2496,16 +2464,15 @@ Vill du ladda ned den nu ? Ctrl+Alt+R - Configure software for reading from and writing to the transmitter - Inställningar för mjukvaran som kommunicerar med sändaren + Inställningar för mjukvaran som kommunicerar med sändaren &List programmers &Programmerare - + List available programmers Lista upp tillgängliga prorammerare @@ -2552,10 +2519,8 @@ Vill du ladda ned den nu ? Visa information om programmet - - Recent Files - Senaste Filer + Senaste Filer &File @@ -2570,22 +2535,22 @@ Vill du ladda ned den nu ? Companion - Editor för Modeller och Inställningar - %1 - + Checking for updates Letar efter uppdateringar - + A new release of Companion is available please check the OpenTX website! En ny version av Companion finns tillgänglig. Var god kontrollera OpenTX webbsida! - + Ignore this version (r%1)? Ladda inte ned versionen (r%1)? - + OpenTX Home Page: <a href='%1'>%1</a> OpenTX Hemsida: <a href='%1'>%1</a> @@ -2621,16 +2586,15 @@ Vill du ladda ned den nu ? Redigera programmets inställningar - Show Companion changelog - Visa en lista med förändringar av Companion + Visa en lista med förändringar av Companion &Write Models and Settings To Tx &Skriv Modeller och Inställningar till sändaren - + Write Models and Settings to transmitter Skriv Modeller och Inställningar till sändaren @@ -2648,8 +2612,84 @@ Vill du ladda ned den nu ? Write Firmware Skriv Firmware + + + New Models+Settings + Ny Modeller+Inställningar + + Create a new Models and Settings file + Skapa en ny Modeller och Inställningar-fil + + + + Open Models+Settings... + Öppna MOdeller+Inställningar... + + + + Save Models+Settings... + Spara Modeller+Inställningar... + + + + + Save Models and Settings file + Spara Modeller och Inställningar-fil + + + + Save Models+Settings as... + Spara Modeller+Inställningar som... + + + + Cut Model + Klipp ut Modell + + + + Cut current model to the clipboard + Klipp ut vald modell till klippbordet + + + + Copy Model... + Kopera Modell... + + + + Copy current model to the clipboard + Kopiera vald modell till klippbordet + + + + Paste Model... + Klistra in Modell... + + + + Paste model from clipboard + Klistra in modell från klippbordet + + + + The classic companion9x icon theme + Det klassiska companion9x-temat + + + + Yerico + Yerico + + + + Yellow round honey sweet icon theme + Yellow round honey sweet icon theme + + + Write firmware to transmitter Skriv firmware till sändaren @@ -2697,24 +2737,40 @@ Vill du ladda ned den nu ? - + File Arkiv - + Edit Redigera - - + + Help Hjälp - + + + Radio Settings Profile + Radioprofil + + + + Show recent Models+Settings documents + Visa senaste Modeller+Inställningar-dokument + + + + Show a selection list of radio settings profiles + Visa en lista med radioprofiler + + + Ready Redo @@ -2723,17 +2779,17 @@ Vill du ladda ned den nu ? &Bidragsgivare... - + Display previous warning again at startup ? SKall föregående varning visas igen vid uppstart ? - + - + - - + + @@ -2745,21 +2801,21 @@ Vill du ladda ned den nu ? Fel - + Cannot write file %1: %2. Filen %1 kunde inte skrivas: %2. - + New release available En ny version finns tillgänglig - - - + + + Error opening file %1: @@ -2768,68 +2824,72 @@ Vill du ladda ned den nu ? %2. - + Compilation server termporary failure, try later Tillfälligt fel i byggservern. Försök igen senare - - + + Compilation server too busy, try later Byggservern är upptagen. Försök igen senare - - + + Unknown server failure, try later Okänt server-fel. Försök igen senare - Compare... - Jämför... + Jämför... - + Compare models Jämför modeller - - + + Backup is impossible Säkerhetskopiering kan inte utföras - - + + The backup dir set in preferences does not exist Foldern för säkerhetskopior existerar inte - + Warning Varning - Firmware Profiles - Profiler för Firmware + Profiler för Firmware &Read/Write &Läs/Skriv - + Write Skriv - + + %2 + %2 + + + + Unable to find file %1! Kan inte hitta filen %1 ! @@ -2845,7 +2905,7 @@ Vill du ladda ned den nu ? ladda&Backup... - + Load backup from file Ladda backup från fil @@ -2858,46 +2918,45 @@ Vill du ladda ned den nu ? Ctrl+G - Open log file - Öppna loggfil + Öppna loggfil - - + + - + Taranis radio not found Hittade inte någon Taranis-sändare - - + + Impossible to identify the radio on your system, please verify the eeprom disk is connected. Det går inte att identifiera sändaren. Verifiera att EEPOROM-skivan är ansluteten. - + Yes Ja - + A new version of Companion is available (version %1)<br>Would you like to download it? An ny version av Companion finns tillgänglig (version %1)<br>Vill du ladda ned den? - - + + Compilation server requires registration, please check OpenTX web site Byggservern kräver registrering. Var god kontrollera OpenTX webbsida - + No Nej @@ -2915,34 +2974,40 @@ Vill du ladda ned den nu ? Vill du ladda ned firmware %1 nu ? - + Release notes contain very important informations. Do you want to see them now ? Release notes innehåller väldigt viktig information. Vill du läsa dem nu? - + The selected language will be used the next time you start Companion. Språket som valts kommer att användas nästa gång Companion startas. - - + + OK OK - + The new theme will be loaded the next time you start Companion. De nya ikonerna kommer att användas nästa gång Companion startas. - + The icon size will be used the next time you start Companion. Ikonernas storlek kommer att justeras nästa gång Companion startas. - + + + Open Models and Settings file + Öppna Modeller och Inställningar-fil + + + Firmware updates Firmware-uppdatering @@ -2954,14 +3019,14 @@ Vill du ladda ned den nu ? - + Read Models and Settings From Tx Läs Modeller och Inställningar från sändaren - + The file %1 has not been recognized as a valid Models and Settings file Write anyway ? @@ -2974,13 +3039,13 @@ Starta skrivningen i alla fall ? - + Backup Models and Settings From Tx Säkerhetskopiera Modeller och Inställningar från sändaren - + Cannot check Models and Settings compatibility! Continue anyway? Det går inte att verifiera att Modeller och Inställningar är kompatibla. Fortsätt i alla fall? @@ -2996,12 +3061,12 @@ Starta skrivningen i alla fall ? - + Write Models and Settings To Tx Skriv Modeller och Inställningar till sändaren - + Write Firmware To Tx Skriv firmware till sändaren @@ -3037,7 +3102,7 @@ Starta skrivningen i alla fall ? Det gick inte att säkerhetskopiera sändarens Modeller och Inställningar. Skrikvningen av firmware avbröts - + Save transmitter Models and Settings to File Spara sändarens Modeller och Inställningar till en fil @@ -3047,12 +3112,12 @@ Starta skrivningen i alla fall ? Det går inte att identifiera sändaren. - + Read Tx Firmware to File Läs Sändarens Firmware till Fil - + About Companion Om Companion @@ -3065,28 +3130,24 @@ Starta skrivningen i alla fall ? Ladda ned firmware och röstfiler. Definera profildata. - Check for new version of Companion - Sök efter ny version av Companion + Sök efter ny version av Companion Show Companion contributors list Visa vilka som bidragit till Companion - ChangeLog... - Förändringar... + Förändringar... - Firmware ChangeLog... - Firmware-förändringar... + Firmware-förändringar... - Show firmware changelog - Visa firmware-förändringar + Visa firmware-förändringar Configure transmitter start screen... @@ -3097,12 +3158,11 @@ Starta skrivningen i alla fall ? Inställningar för &kommunikation... - New Profile - Ny Profil + Ny Profil - + Create a new Radio Setting Profile Lägg till en ny profil med radio-inställningar @@ -3115,7 +3175,7 @@ Starta skrivningen i alla fall ? Det flerfärgade klassiska Companion-temat - + A monochrome black icon theme Ett monokromt svart tema @@ -3207,6 +3267,16 @@ Starta skrivningen i alla fall ? Use English in menus Använd Engelska i menyerna + + + Finnish + Finska + + + + Use Finnish in menus + Använd Finska i menyerna + French @@ -3278,12 +3348,102 @@ Starta skrivningen i alla fall ? Använd Ryska i menyerna - + + About... + Om... + + + + Print... + Skriv Ut... + + + + Simulate... + Simulera... + + + + Simulate current model + Simulera vald modell + + + Load Backup... Ladda backup från fil... - + + View Log File... + Visa loggfil... + + + + Open and view log file + Öppna och visa loggfil + + + + Settings... + Inställningar... + + + + Download... + Nedladdning... + + + + Check for Updates... + Sök efter uppdateringar... + + + + Check OpenTX and Companion updates + Sök efter uppdateringar av Companion och OpenTX + + + + Companion Changes... + Förändringar i Companion... + + + + Show Companion change log + Visa en lista med förändringar av Companion + + + + Firmware Changes... + OpenTX-förändringar... + + + + Show firmware change log + Visa en lista med förändringar av OpenTX + + + + Compare Models... + Jämför modeller... + + + + Edit the splash image of your TX + Editera startbilden' för din sändare + + + + List programmers... + Visa programmerare... + + + + Add Radio Profile + Lägg till Radioprofil + + + Manuals and other Documents Manualer och andra Dokument @@ -3293,7 +3453,28 @@ Starta skrivningen i alla fall ? Öppna OpenTX dokumentsida i en webbläsare - + + Configure Communications... + Kommunikations-inställningar... + + + + Configure software for communicating with the transmitter + Ställ in mjukvara för kommunikation med sändaren + + + + Contributors... + Bidragande... + + + + + Recent Models+Settings + Senaste Modell+Inställnings-filer + + + Set Icon Theme Ställ in Ikontema @@ -3307,12 +3488,11 @@ Starta skrivningen i alla fall ? &Inställningar - Radio Settings Profiles - Profiler för Radioinställningar + Profiler för Radioinställningar - + Invalid Models and Settings File %1 Filen innehåller inte Modeller och Inställningar: %1 @@ -3326,7 +3506,7 @@ Starta skrivningen i alla fall ? MdiChild - + @@ -3334,14 +3514,15 @@ Starta skrivningen i alla fall ? - + - - + + + @@ -3349,36 +3530,36 @@ Starta skrivningen i alla fall ? Fel - + Editing model %1: Redigera modell %1: - + Unable to find file %1! Kan inte hitta filen %1 ! - - + + Error reading file %1: %2. Fel vid inläsning från filen %1: %2. - + - + Error opening file %1: %2. Fel vid öppning av filen %1: %2. - + @@ -3404,12 +3585,12 @@ Starta skrivningen i alla fall ? %2. - + free bytes bytes lediga - + Invalid EEPROM File %1 Ogiltig modelldatafil %1 @@ -3420,48 +3601,48 @@ Starta skrivningen i alla fall ? Ogiltig binär modelldatafil %1 - + %1 has been modified. Do you want to save your changes? %1 har förändrats. Vill du spara förändringarna? - + Cannot write temporary file! En temporär fil kunde inte skrivas! - + Backup is impossible Säkerhetskopierin kan ej utföras - + - + Companion Companion - + The backup dir set in preferences does not exist Den katalog som konfigurerats för säkerhetskopiering existerar inte - - - + + + Backup EEPROM From Tx Säkerhetskopiera modelldata från sändaren - + Cannot check eeprom compatibility! Continue anyway? Det går inte att veriifiera att modelldata är kompatibla. Fortsätt i alla fall? - + Warning Varning @@ -3477,9 +3658,13 @@ Vill du spara förändringarna? Firmware i flashminnet är föråldrat. Var god uppgradera! - + + Open backup Models and Settings file + Öppna Modeller och Inställningar-fil + + Open - Öppna + Öppna @@ -3487,16 +3672,16 @@ Vill du spara förändringarna? Den binära backupfilen är felaktig %1 - - - + + + Taranis radio not found Taranis-sändaren hittades ej - - - + + + Impossible to identify the radio on your system, please verify the eeprom disk is connected. Det går inte att identifiera sändaren. Verifiera att EEPOROM-skivan är ansluteten. @@ -3506,7 +3691,7 @@ Vill du spara förändringarna? Skriv EEPROM till sändaren - + Do you want to use model wizard? Vill du använda modell-guiden? @@ -4295,7 +4480,7 @@ p, li { white-space: pre-wrap; } ModulePanel - + Trainer Output TrainerUttag @@ -4313,7 +4498,7 @@ p, li { white-space: pre-wrap; } QObject - + P1 @@ -4359,17 +4544,15 @@ p, li { white-space: pre-wrap; } T2 - th9x - th9x + th9x - er9x - er9x + er9x - + Trainer Trainer @@ -4457,10 +4640,8 @@ p, li { white-space: pre-wrap; } Timer2 - - - - + + Warning Varning @@ -4470,19 +4651,16 @@ p, li { white-space: pre-wrap; } Modelldata sparades, men med dessa varningar: - ersky9x - ersky9x + ersky9x - - - + Simulator for this firmware is not yet available Det finns ännu ingen simulator för denna typ av firmware - + REa @@ -4738,7 +4916,7 @@ p, li { white-space: pre-wrap; } PPM%1 - + THR GAS @@ -4972,7 +5150,7 @@ p, li { white-space: pre-wrap; } Det går inte att använda Expo på en specialkurva i open9x - + Support for frsky telemetry mod Stöd för FrSky telemeri @@ -5088,12 +5266,12 @@ p, li { white-space: pre-wrap; } Stöd för FrSky PXX-protokoll - + OpenTX for FrSky Taranis Rev4a OpenTX för FrSky Taranis Rev4a - + @@ -5232,21 +5410,21 @@ p, li { white-space: pre-wrap; } X%1 - + + - GV%1 GV%1 - - + + --- ---- - + Rud Trim Rod.Trim @@ -5316,8 +5494,8 @@ p, li { white-space: pre-wrap; } Eget värde - - + + -GV%1 -GV%1 @@ -5334,18 +5512,18 @@ p, li { white-space: pre-wrap; } - + PPM values displayed in us PPM-värden visade i ms - + Bluetooth interface Blåtandsinterface - - + + S1 S1 @@ -5697,7 +5875,7 @@ p, li { white-space: pre-wrap; } Ökning - + Yellow Gul @@ -5933,7 +6111,7 @@ p, li { white-space: pre-wrap; } !Kurva(%1) - + FM%1 FM%1 @@ -5983,6 +6161,11 @@ p, li { white-space: pre-wrap; } Portuguese Portugisiska + + + Finnish + Finska + !Flight mode %1 @@ -5999,7 +6182,7 @@ p, li { white-space: pre-wrap; } Flygläge %1 värde - + openTx only accepts %1 points in all curves openTX accepterar bar %1 punkter i alla kurvor @@ -6023,14 +6206,14 @@ p, li { white-space: pre-wrap; } OpenTX accepterar inte detta antal kanaler - + Your radio probably uses a wrong firmware, eeprom size is 4096 but only the first 2048 are used Din sändare har antagligen laddats med felaktig programvara. eeprom-storleken är 4096, men enbart den första hälften används - + Support for MAVLINK devices Stöd för MAVLINK-enheter @@ -6063,12 +6246,12 @@ eeprom-storleken är 4096, men enbart den första hälften används - + Use alternative SQT5 font Använd SQT5-typsnittet - + @@ -6121,24 +6304,24 @@ eeprom-storleken är 4096, men enbart den första hälften används - + Disable HELI menu and cyclic mix support Slå av HELI-menyn och stöd för cykliska mixar - - + + Disable TEMPLATES menu Slå av menyn för Mallar - - + + Disable Global variables Slå av Globala Variabler - + Possibility to enable FAI MODE at field Möjlighet att slå på FAI-LÄGE före pflygning @@ -6181,7 +6364,7 @@ Gruppen bakom OpenTX/Companion. Använd trim från flygläge %1 + Eget trim som offset - + FW: %1 FW: %1 @@ -6342,6 +6525,296 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga Automatiska + + SimulatorDialog + + + + Warning + Varning + + + + Joystick enabled but not configured correctly + Joysticken påslagen, men ej rätt inställd + + + + Cannot open joystick, joystick disabled + Joysticken kan inte hittas. Joysticken stängs av + + + + Simulating Tx (%1) + Simulerar sändare (%1) + + + + Firmware %1 error: %2 + Firmware %1 fel: %2 + + + + SimulatorDialog9X + + + Companion Simulator + Companion Simulator + + + + + + + Right Double Click to Reset + Höger dubbelklick nollställer + + + + THR + GAS + + + + RUD + ROD + + + + ELE + HÖJ + + + + AIL + SKE + + + + + Hold X + Håll X + + + + + Fix X + Fixera X + + + + + Fix Y + Fixera Y + + + + + Hold Y + Håll Y + + + + + + + TextLabel + Textettikett + + + + TRN + TRN + + + + GEA + LAN + + + + ID0 + ID0 + + + + ID1 + ID1 + + + + ID2 + ID2 + + + + BEEP + Summer + + + + P1 + P1 + + + + + + 0 % + 0 % + + + + P2 + P2 + + + + P3 + P3 + + + + 9x Simulator + Simulator för 9x + + + + Outputs + Utgångar + + + + SimulatorDialogTaranis + + + Companion Simulator + Companion Simulator + + + + + Hold Y + Håll Y + + + + + Fix Y + Fixera Y + + + + + Fix X + Fixera X + + + + + Hold X + Håll X + + + + + SD + SD + + + + + SC + SC + + + + + + + Right Double Click to Reset + Höger dubbelklick nollställer + + + + + S2 + S2 + + + + + SG + SG + + + + + RS + RS + + + + + SH + SH + + + + + + + TextLabel + Textettikett + + + + + S1 + S1 + + + + + SB + SB + + + + + SA + SA + + + + + SE + SE + + + + + + SF + SF + + + + + LS + LS + + + + Taranis Simulator + Taranissimulator + + + + Outputs + Utgångar + + Telemetry @@ -6685,7 +7158,7 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga mAmpere (mA) - + Range Räckvidd @@ -6741,7 +7214,7 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga Telemetriskärm %1 - + Winged Shadow How High Winged Shadow How High @@ -6809,7 +7282,7 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga Programmets Inställningar - + Simulator capture folder Lagra simulatorbilder i @@ -6822,27 +7295,37 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga - + Open Folder Öppna katalog - + User Splash Screens Egna Startbilder - + Edit Settings Redigera Inställningar - + Application Settings Programmet - + + Only show user splash images + Enbart användarens bilder + + + + Show user and companion splash images + Både användarens bilder och Companion-bilder + + + Simulator Settings Simulatorn @@ -6872,12 +7355,11 @@ Gasen reverseras om alternativet väljs. Tomgång ligger då uppåt. Trim och ga Gul - Radio Settings - Radion + Radion - + Mode selection: Mode 1: @@ -7067,17 +7549,21 @@ Detta används av mallen för att koppla kanal till output-nummer. S G H R - + Default Stick Mode Spaktilldelning - - Settings Profile - Profil + + Firmware File + Firmware - + Settings Profile + Profil + + + Splash Screen Startbild @@ -7097,42 +7583,54 @@ Detta används av mallen för att koppla kanal till output-nummer. Sökväg till SD-struktur - + + Firmware Variant + Firmware-typ + + + Select Image Välj Bild - + Offer to write FW to Tx after download Skriv FW till Tx efter nedladdning - + + Radio Settings Profile + Radioprofile + + + + Profile Name + Profilnamn + + + Remove Profile Ta bort Profil - + Clear Image Ta bort Bild - Firmware - Firmware + Firmware - Include companion splashes - Användarens bilder och Companion-bilder + Användarens bilder och Companion-bilder - Only user defined splashes - Enbart användarens bilder + Enbart användarens bilder - + Splash Screen Library Bibliotek för startbilder @@ -7207,38 +7705,38 @@ Detta används av mallen för att koppla kanal till output-nummer. Säkerhetskopiera innan firmware-skrivning - + Select your snapshot folder Välj katalog för snapshots av Tx-simulatorn - - + + No joysticks found Ingen joystick hittades - + Select your library folder Välj bibliotekskatalog - + Select your Models and Settings backup folder Välj folder för automatisk säkerhetskopiering - + Select Google Earth executable Sökväg till Google Earth - + Select the folder replicating your SD structure Välj katalog med en kopia av din SD-struktur - + Not possible to remove profile Det går inte att ta bort profilen @@ -7256,7 +7754,7 @@ Detta används av mallen för att koppla kanal till output-nummer. Det går inte att ladda %1. - + Open Image to load Öppna bild för laddning @@ -7531,7 +8029,7 @@ OBS. Fyll enbart i detta fällt om du är säker på vad du gör. Ingen kontroll Sökväg till AVRDUDE - + Select Location @@ -7617,7 +8115,7 @@ m2560 för v4.1-kort Inställningar för Programmerare - + DFU-UTIL Configuration Inställningar för DFU-UTIL @@ -7632,7 +8130,7 @@ m2560 för v4.1-kort Inställningar för AVRDUDE - + Companion Companion @@ -7646,12 +8144,12 @@ m2560 för v4.1-kort Välj Sändarens Startbild - + Date & Time Dag & Tid - + SVN Subversion @@ -7661,102 +8159,95 @@ m2560 för v4.1-kort Tillåter Companon att skriva till äldre firmware-versioner - Load Image - Ladda Bild + Ladda Bild - Open Splash Library - Öppna bildbibliotek + Öppna bildbibliotek - ... - ... + ... - Substitute image in firmware - Byt ut bilden i firmware-filen + Byt ut bilden i firmware-filen - - + Write to TX Skriv till sändaren - Use image in settings - Använd bilden från inställningarna + Använd bilden från inställningarna - Invert Color - Invertera Bilden + Invertera Bilden - + Check Firmware compatibility Kontrollera att firmware-filen är kompatibel - + Cancel Avbryt - + Write firmware to TX Skriv firmware till sändaren - Open - Öppna + Öppna - - + + - - + + Warning Varning - Burn anyway ! - Starta bränningen! + Starta bränningen! - Open Image to load - Öppna bilden som skall laddas + Öppna bilden som skall laddas - + Images (%1) Bilder (%1) - + - - - + + + + + + Error Fel - + Write Models and Settings to TX Skriv Modeller och Inställningar till sändaren @@ -7766,25 +8257,23 @@ m2560 för v4.1-kort Skriv Modeller och Inställningar från %1 till sändaren - + Choose file to load Models and Settings from Välj fil att ladda Modeller och Inställningar från - + Invalid binary Models and Settings File %1, Proceed anyway ? Ogiltig binärfil med Modeller och Inställningar: %1. Fortsätt i alla fall ? - - Cannot load %1. - Det går inte att ladda %1. + Det går inte att ladda %1. - + Cannot save customized firmware Det gick inte att spara den modifierade firmware-filen @@ -7794,12 +8283,12 @@ m2560 för v4.1-kort Bildfilen hittades inte - + No firmware selected Ingen firmware har valts - + Wrong radio calibration data in profile, Settings not patched Felaktig information i profilen, sändarens-kalibrering kunde inte läsas in @@ -7809,12 +8298,11 @@ m2560 för v4.1-kort Felaktig information i profilen, sändarens inställningar kunde inte läsas in - %1 is not a known firmware - %1 är inte en fimware-fil + %1 är inte en fimware-fil - + <html><head/><body><p>Modify calibration parameters using settings from current profile</p></body></html> <html><head/><body><p>Uppdatera kalibrerings-parametrarna med data från nuvarande profil</p></body></html> @@ -7834,8 +8322,8 @@ m2560 för v4.1-kort Uppdatera med HW-inställningar från profilen - - + + Browse for file Välj fil @@ -7850,12 +8338,42 @@ m2560 för v4.1-kort Nuvarande Profil - + + Use firmware start screen + Använd firmware-startskärmen + + + + Use another start screen + Använd en annan startskärm + + + + Use profile start screen + Använd profilens startskärm + + + + Use library start screen + Använd biblioteks-startskärm + + + Current profile Nuvarande profil - + + Open Firmware File + Öppna firmware-fil + + + + %1 may not be a valid firmware file + %1 är kanske inte en giltig firmware-fil + + + Unable to find file %1! Kan inte hitta filen %1 ! @@ -7876,7 +8394,37 @@ m2560 för v4.1-kort %2. - + + The firmware file is not valid. + Firmware-filen är inte giltig. + + + + There is no start screen image in the firmware file. + Firmware-filen innehåller inte någon startbild. + + + + The profile image %1 does not contain an image. + Profil-bilden %1 innehåller inte någon startbild. + + + + Open image file to use as Tx start screen + Öppna bildfil för användning som radions startsskärm + + + + Image could not be loaded from %1 + Det gick inte att ladda en bild från %1 + + + + The library image could not be loaded + Bild-biblioteket kunde inte öppnas + + + Cannot write file %1: %2. @@ -7891,7 +8439,7 @@ m2560 för v4.1-kort %2. - + Variant Variant @@ -7899,12 +8447,16 @@ m2560 för v4.1-kort compareDialog - Dialog - Dialog + Dialog - + + Compare Models + Jämför Modeller + + + Drag first model here Dra hit första modellen @@ -7929,7 +8481,7 @@ m2560 för v4.1-kort Skriv till fil - + General Model Settings Generella modell-inställningar @@ -8418,7 +8970,7 @@ m2560 för v4.1-kort Dialog - + People who have contributed to this project De som har bidragit till detta projekt @@ -8428,12 +8980,12 @@ m2560 för v4.1-kort Programmerare - + Companion Release Notes Companion Release Notes - + Thank you all !!! Tack till er alla !!! @@ -8448,7 +9000,7 @@ m2560 för v4.1-kort Bidragande - + OpenTX Release Notes OpenTX Release Notes @@ -8461,58 +9013,66 @@ m2560 för v4.1-kort Startbildsredigerare - - + + Invert Invertera - - + + Load FW Ladda FW - - + + Load Pict Ladda Bild - - + + Load Profile Ladda Profil - - + + Save Spara - - + + Open Splash Library Öppna bildbibliotek - Open - Öppna + Öppna - + - + Error Fel - Cannot load embedded FW image from %1. - Det gick inte att ladda bild från FW-filen %1. + Det gick inte att ladda bild från FW-filen %1. + + + + Open Firmware File + Öppna firmware-fil + + + + Can not load embedded image from firmware file %1. + Det gick inte att ladda bild från firmware-filen %1. @@ -8525,7 +9085,7 @@ m2560 för v4.1-kort Det gick inte att ladda profilbilden %1. - + Cannot load the library image %1. Det gick inte att ladda biblioteks-bilden %1. @@ -8564,7 +9124,7 @@ m2560 för v4.1-kort Det finns ingen bild att byta i firmware-filen - + Open Image to load Öppna bild för laddning @@ -8586,9 +9146,10 @@ m2560 för v4.1-kort Det gick inte att spara bilden i filen %1 - - - + + + + ... ... @@ -8601,7 +9162,7 @@ m2560 för v4.1-kort Nedladdning: - + Unable to save the file %1: %2. Kan ej spara filen %1: %2. @@ -8624,7 +9185,7 @@ m2560 för v4.1-kort Säkringar - + Read Fuses Läs in säkringarna @@ -8760,7 +9321,12 @@ p, li { white-space: pre-wrap; } fwPreferencesDialog - + + Downloads + Nedladdningar + + + @@ -8907,16 +9473,15 @@ Används av mallarna för att koppla ihop kanaler med numrerade utgångar.Skriv FW till Tx efter nedladdning - Downloads and Profiles - Nedladdning och Profiler + Nedladdning och Profiler Save Profile Spara Profil - + Menu Language Menyspråk @@ -8967,7 +9532,7 @@ Används av mallarna för att koppla ihop kanaler med numrerade utgångar.Sök efter uppdateringar - + Last downloaded release: %1 Senast nedladdade release: %1 @@ -9009,7 +9574,7 @@ Används av mallarna för att koppla ihop kanaler med numrerade utgångar. joystickDialog - + Configure Joystick Ställ in Joystick @@ -9158,7 +9723,7 @@ Används av mallarna för att koppla ihop kanaler med numrerade utgångar.OK - + Move sticks and pots in every direction making full movement Press next when finished Rör spakar och pottentiometrar. Ge fulla utslag. @@ -9209,7 +9774,7 @@ Tryck på Avbryt för att avburyta kalibreringen Dubblerad koppling av spak - + @@ -9241,7 +9806,7 @@ Tryck på Avbryt för att avburyta kalibreringen Companion Logg-läsare - + Filename Filnamn @@ -9251,7 +9816,7 @@ Tryck på Avbryt för att avburyta kalibreringen Öppna Loggfil - + Zoom Zoom @@ -9266,7 +9831,7 @@ Tryck på Avbryt för att avburyta kalibreringen Y - + Telemetry logs Telemetriloggar @@ -9276,7 +9841,7 @@ Tryck på Avbryt för att avburyta kalibreringen Tid - + Error Fel @@ -9288,7 +9853,7 @@ Tryck på Avbryt för att avburyta kalibreringen %2. - + Select your log file Välj loggfil @@ -9311,7 +9876,7 @@ Tryck på Avbryt för att avburyta kalibreringen mdiChild - + Simulate Tx Simulera sändare @@ -9324,7 +9889,7 @@ Tryck på Avbryt för att avburyta kalibreringen Guide för modellkonfiguaration - + Engine Motor @@ -9738,7 +10303,7 @@ Tryck på Avbryt för att avburyta kalibreringen Dubbla Sidoroder (med 2 servon) - + Apply configuration ? Tillämpa inställningarna? @@ -10155,62 +10720,48 @@ Mode 4: Firmware-info - Last downloaded release: %1 - Senast nedladdade release: %1 + Senast nedladdade release: %1 - - No joysticks found - Ingen joystick hittades + Ingen joystick hittades - Select your Models and Settings backup folder - Välj folder för automatisk säkerhetskopiering + Välj folder för automatisk säkerhetskopiering - Select Google Earth executable - Sökväg till Google Earth + Sökväg till Google Earth - Open Image to load - Öppna bild för laddning + Öppna bild för laddning - Images (%1) - Bilder (%1) + Bilder (%1) - - Error - Fel + Fel - The selected firmware has never been downloaded by Companion. - Firmware-filen har aldrig laddats ned av Companion. + Firmware-filen har aldrig laddats ned av Companion. - The selected firmware cannot be downloaded by Companion. - Firmware-filen kan inte laddas ned av Companion. + Firmware-filen kan inte laddas ned av Companion. - - Cannot load %1. - %1 kunde inte laddas. + %1 kunde inte laddas. - Image stored in settings - Bilden lagras i inställningar + Bilden lagras i inställningar @@ -10261,12 +10812,11 @@ Mode 4: säkerhetskopiera innan skrivning - Select your library folder - Välj bibliotekskatalog + Välj bibliotekskatalog - + Export Profile Exportera Profil @@ -10293,19 +10843,16 @@ May be different from firmware language Får skilja från språket för mjukvaran - Export profile As - Exportera profil som + Exportera profil som - Profile slot is not empty, profile slot %1 will we overwritten.<br>Are you sure ? - Det finns redan en profil i position %1,. Den kommer att skrivas över.<br> Är du säker ? + Det finns redan en profil i position %1,. Den kommer att skrivas över.<br> Är du säker ? - Open Profile to import - Öppna profil för import + Öppna profil för import @@ -10331,14 +10878,12 @@ Får skilja från språket för mjukvaran Använd bara clipboard - Select your snapshot folder - Välj katalog för snapshots + Välj katalog för snapshots - Profile name is empty, profile slot %1 will be deleted.<br>Are you sure ? - Profilnamn saknas, profilplats %1 kommer att raderas.<br> Är du säker? + Profilnamn saknas, profilplats %1 kommer att raderas.<br> Är du säker? @@ -10361,9 +10906,8 @@ Får skilja från språket för mjukvaran Sökväg till SD-struktur - Select the folder replicating your SD structure - Välj katalog som härmar din SD-struktur + Välj katalog som härmar din SD-struktur @@ -10374,7 +10918,7 @@ Får skilja från språket för mjukvaran Dialog - + Close Stäng @@ -10389,7 +10933,7 @@ Får skilja från språket för mjukvaran Skriv till fil - + Setup for: Inställningar för: @@ -10816,434 +11360,327 @@ Får skilja från språket för mjukvaran simulatorDialog - P1 - P1 + P1 - P2 - P2 + P2 - P3 - P3 + P3 - THR - GAS + GAS - RUD - ROD + ROD - ELE - HÖJ + HÖJ - AIL - SKE + SKE - - Hold X - Håll X + Håll X - - Fix X - Fixera X + Fixera X - - Fix Y - Fixera Y + Fixera Y - - Hold Y - Håll Y + Håll Y - - - - TextLabel - Textettikett + Textettikett - TRN - TRN + TRN - GEA - LAN + LAN - ID0 - ID0 + ID0 - ID1 - ID1 + ID1 - ID2 - ID2 + ID2 - BEEP - Summer + Summer - - - - Right Double Click to Reset - Höger dubbelklick nollställer + Höger dubbelklick nollställer - Companion Simulator - Companion Simulator + Companion Simulator - 9x Simulator - Simulator för 9x + Simulator för 9x - Outputs - Utgångar + Utgångar - LS1 - LB1 + LB1 - LS2 - LB2 + LB2 - LS3 - LB3 + LB3 - LS4 - LB4 + LB4 - LS5 - LB5 + LB5 - LS6 - LB6 + LB6 - LS7 - LB7 + LB7 - LS8 - LB8 + LB8 - LS9 - LB9 + LB9 - LSA - LBA + LBA - LSB - LBB + LBB - LSC - LBC + LBC - LSD - LBD + LBD - LSE - LBE + LBE - LSF - LBF + LBF - LSG - LBG + LBG - LSH - LBH + LBH - LSI - LBI + LBI - LSJ - LBJ + LBJ - LSK - LBK + LBK - LSL - LBL + LBL - LSM - LBM + LBM - LSN - LBN + LBN - LSO - LBO + LBO - LSP - LBP + LBP - LSQ - LBQ + LBQ - LSR - LBR + LBR - LSS - LBS + LBS - LST - LBT + LBT - LSU - LBU + LBU - LSV - LBV + LBV - LSW - LBW + LBW - CH1 - KN1 + KN1 - CH9 - KN9 + KN9 - CH2 - KN2 + KN2 - CH10 - KN10 + KN10 - CH3 - KN3 + KN3 - CH11 - KN11 + KN11 - CH4 - KN4 + KN4 - CH12 - KN12 + KN12 - CH5 - KN5 + KN5 - CH13 - KN13 + KN13 - CH6 - KN6 + KN6 - CH14 - KN14 + KN14 - CH7 - KN7 + KN7 - CH15 - KN15 + KN15 - CH8 - KN8 + KN8 - CH16 - KN16 + KN16 - - - - - - - - - - - - - - - - -100.1 - -100.1 + -100.1 - - Warning - Varning + Varning - Joystick enabled but not configured correctly - Joysticken påslagen, men ej rätt inställd + Joysticken påslagen, men ej rätt inställd - Cannot open joystick, joystick disabled - Joysticken kan inte hittas. Joysticken stängs av + Joysticken kan inte hittas. Joysticken stängs av - Firmware %1 error: %2 - Firmware %1 fel: %2 + Firmware %1 fel: %2 - Simulating Tx (%1) - Simulerar sändare (%1) + Simulerar sändare (%1) - Simulating - Simulerar + Simulerar - - - 0 % - 0 % + 0 % - - Flight mode: %1(%2) - - Fligmod: %1(%2) + - Fligmod: %1(%2) splashLibrary - - + + ... ... @@ -11253,7 +11690,7 @@ Får skilja från språket för mjukvaran Bildbibliotek - Sida %1 av %2 - + Warning Varning @@ -11276,428 +11713,312 @@ Får skilja från språket för mjukvaran xsimulatorDialog - - SE - SE + SE - - SA - SA + SA - - SB - SB + SB - - - - Right Double Click to Reset - Höger dubbelklick nollställer + Höger dubbelklick nollställer - - - - TextLabel - Textettikett + Textettikett - - Hold X - Håll X + Håll X - - Fix X - Fixera X + Fixera X - - Fix Y - Fixera Y + Fixera Y - - Hold Y - Håll Y + Håll Y - - SH - SH + SH - - SG - SG + SG - Companion Simulator - Companion Simulator + Companion Simulator - - SD - SD + SD - - SC - SC + SC - Outputs - Utgångar + Utgångar - CH1 - KN1 + KN1 - - - - - - - - - - - - - - - - -100.1 - -100.1 + -100.1 - CH9 - KN9 + KN9 - CH2 - KN2 + KN2 - CH10 - KN10 + KN10 - CH3 - KN3 + KN3 - CH11 - KN11 + KN11 - CH4 - KN4 + KN4 - CH12 - KN12 + KN12 - CH5 - KN5 + KN5 - CH13 - KN13 + KN13 - CH6 - KN6 + KN6 - CH14 - KN14 + KN14 - CH7 - KN7 + KN7 - CH15 - KN15 + KN15 - CH8 - KN8 + KN8 - CH16 - KN16 + KN16 - LSK - LBK + LBK - LSC - LBC + LBC - LSD - LBD + LBD - LS7 - LB7 + LB7 - LSL - LBL + LBL - LSB - LBB + LBB - LS1 - LB1 + LB1 - LSH - LBH + LBH - LSG - LBG + LBG - LSE - LBE + LBE - LSF - LBF + LBF - LS8 - LB8 + LB8 - LS9 - LB9 + LB9 - LSA - LBA + LBA - LSM - LBM + LBM - LSJ - LBJ + LBJ - LSI - LBI + LBI - LS4 - LB4 + LB4 - LS5 - LB5 + LB5 - LS2 - LB2 + LB2 - LS3 - LB3 + LB3 - LS6 - LB6 + LB6 - LSN - LBN + LBN - LSO - LBO + LBO - LSP - LBP + LBP - LSQ - LBQ + LBQ - LSR - LBR + LBR - LSS - LBS + LBS - LST - LBT + LBT - LSU - LBU + LBU - LSV - LBV + LBV - LSW - LBW + LBW - - Warning - Varning + Varning - Joystick enabled but not configured correctly - Joysticken påslagen, men ej rätt inställd + Joysticken påslagen, men ej rätt inställd - Cannot open joystick, joystick disabled - Joysticken kan inte hittas. Joysticken stängs av + Joysticken kan inte hittas. Joysticken stängs av - Firmware %1 error: %2 - Firmware %1 fel: %2 + Firmware %1 fel: %2 - Simulating Tx (%1) - Simulerar sändare (%1) + Simulerar sändare (%1) - Simulating - Simulerar + Simulerar - - - SF - SF + SF - - S2 - S2 + S2 - - RS - RS + RS - - S1 - S1 + S1 - - LS - LS + LS - Taranis Simulator - Taranissimulator + Taranissimulator - - Flight mode: %1(%2) - - Fligmod: %1(%2) + - Fligmod: %1(%2) diff --git a/radio/src/Makefile b/radio/src/Makefile index 79c36fcce..8380a747e 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -67,6 +67,14 @@ EXT = STD # Values = YES, NO, CHOICE FAI = NO +# the latests deliveries for Turnigy 9x transmitters (since 2 years now, 2014) do not stop sending if no pulses are generated. +# This fact totally breaks the nice throttle and switch warning concept, because even we prevent sending pulses the +# transmitter modul ignores this, and continous to send the last value or 0 at beginning. And 0 means in the middle of throttle -> 50%. +# To cope with this situation, we need a new concept how to handle throttle and switch warnings. +# if you have a 0 value (50% ) for throttle, while throttle warning is active, you should activate this switch +# Values = YES, NO +TURNIGY_TRANSMITTER_FIX = NO + # Enable heli menu # Values = YES, NO HELI = NO @@ -761,6 +769,14 @@ ifeq ($(NAVIGATION), ROTENC) CPPDEFS += -DROTARY_ENCODER_NAVIGATION endif +ifeq ($(TURNIGY_TRANSMITTER_FIX), YES) + ifeq ($(PCB), TARANIS) + $(warning TURNIGY_TRANSMITTER_FIX is not available on Taranis) + else + CPPDEFS += -DMODULE_ALWAYS_SEND_PULSES + endif +endif + ifeq ($(AUTOSWITCH), YES) CPPDEFS += -DAUTOSWITCH endif diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index ba0c4ed94..9f5b07289 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -204,130 +204,257 @@ const char * audioFilenames[] = { }; uint64_t sdAvailableSystemAudioFiles = 0; -uint8_t sdAvailablePhaseAudioFiles[MAX_PHASES] = { 0 }; -uint8_t sdAvailableMixerAudioFiles[MAX_MIXERS] = { 0 }; +uint32_t sdAvailablePhaseAudioFiles = 0; +uint64_t sdAvailableSwitchAudioFiles = 0; +uint64_t sdAvailableLogicalSwitchAudioFiles = 0; -void refreshSystemAudioFiles() +#define MASK_SYSTEM_AUDIO_FILE(index) ((uint64_t)1 << index) +#define MASK_PHASE_AUDIO_FILE(index, event) ((uint32_t)1 << (2*index+event)) +#define MASK_SWITCH_AUDIO_FILE(index) ((uint64_t)1 << index) +#define MASK_LOGICAL_SWITCH_AUDIO_FILE(index, event) ((uint64_t)1 << (2*index+event)) + +bool isFileAvailable(const char * filename) { FILINFO info; -#if _USE_LFN TCHAR lfn[_MAX_LFN + 1]; info.lfname = lfn; info.lfsize = sizeof(lfn); -#endif + return f_stat(filename, &info) == FR_OK; +} - char filename[32] = SYSTEM_SOUNDS_PATH "/"; - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); +char * getAudioPath(char * path) +{ + strcpy(path, SOUNDS_PATH "/"); + strncpy(path+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); + return path + sizeof(SOUNDS_PATH); +} + +char * getSystemAudioPath(char * path) +{ + char * str = getAudioPath(path); + strcpy(str, SYSTEM_SUBDIR "/"); + return str + sizeof(SYSTEM_SUBDIR); +} + +void getSystemAudioFile(char * filename, int index) +{ + char * str = getSystemAudioPath(filename); + strcpy(str, audioFilenames[index]); + strcat(str, SOUNDS_EXT); +} + +void referenceSystemAudioFiles() +{ + char path[AUDIO_FILENAME_MAXLEN+1]; + FILINFO fno; + DIR dir; + char *fn; /* This function is assuming non-Unicode cfg. */ + TCHAR lfn[_MAX_LFN + 1]; + fno.lfname = lfn; + fno.lfsize = sizeof(lfn); + + uint64_t availableAudioFiles = 0; assert(sizeof(audioFilenames)==AU_FRSKY_FIRST*sizeof(char *)); assert(sizeof(sdAvailableSystemAudioFiles)*8 >= AU_FRSKY_FIRST); - uint64_t availableAudioFiles = 0; + char * filename = getSystemAudioPath(path); + *(filename-1) = '\0'; - for (uint32_t i=0; iid, 2); + char * result = strcat_modelname(path+sizeof(SOUNDS_PATH), g_eeGeneral.currModel); + *result++ = '/'; + *result = '\0'; return result; } -void refreshModelAudioFiles() +void getPhaseAudioFile(char * filename, int index, unsigned int event) { - FILINFO info; + char * str = getModelPath(filename); + char * tmp = strcat_phasename(str, index); + strcpy(tmp, suffixes[event]); + strcat(tmp, SOUNDS_EXT); + } + +void getSwitchAudioFile(char * filename, int index) +{ + char * str = getModelPath(filename); + int len = STR_VSWITCHES[0]; + strncpy(str, &STR_VSWITCHES[1+len*index], len); + str += len-1; + if (*str == '\300') { + strcpy(str, "-up"); + str += 3; +} + else if (*str == '-') { + strcpy(str, "-mid"); + str += 4; + } + else if (*str == '\301') { + strcpy(str, "-down"); + str += 5; + } + else { + str += 1; + } + strcat(str, SOUNDS_EXT); +} + +void getLogicalSwitchAudioFile(char * filename, int index, unsigned int event) +{ + char * str = getModelPath(filename); + int len = STR_VSWITCHES[0]; + strncpy(str, &STR_VSWITCHES[1+len*(index+SWSRC_FIRST_CSW-1)], len); + str += len; + strcpy(str, suffixes[event]); + strcat(str, SOUNDS_EXT); +} + +void referenceModelAudioFiles() +{ + char path[AUDIO_FILENAME_MAXLEN+1]; + FILINFO fno; + DIR dir; + char *fn; /* This function is assuming non-Unicode cfg. */ TCHAR lfn[_MAX_LFN + 1]; - info.lfname = lfn; - info.lfsize = sizeof(lfn); + fno.lfname = lfn; + fno.lfsize = sizeof(lfn); - char filename[AUDIO_FILENAME_MAXLEN+1] = SOUNDS_PATH "/"; - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); + sdAvailablePhaseAudioFiles = 0; + sdAvailableSwitchAudioFiles = 0; + sdAvailableLogicalSwitchAudioFiles = 0; - if (sdMounted()) { - char *buf = strcat_modelname(&filename[sizeof(SOUNDS_PATH)], g_eeGeneral.currModel); - *buf++ = '/'; + char * filename = getModelPath(path); + *(filename-1) = '\0'; - for (uint32_t i=0; i-[on|off].wav + for (int i=0; i-[up|mid|down].wav + for (int i=0; i-[on|off].wav + for (int i=0; i> 24); uint8_t index = (i >> 16) & 0xFF; uint8_t event = i & 0xFF; #if 0 - printf("isAudioFileAvailable(%08x)\n", i); fflush(stdout); + printf("isAudioFileReferenced(%08x)\n", i); fflush(stdout); #endif if (category == SYSTEM_AUDIO_CATEGORY) { - if (sdAvailableSystemAudioFiles & ((uint64_t)1 << event)) { - strcpy(filename, SYSTEM_SOUNDS_PATH "/"); - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); - strcpy(filename+sizeof(SYSTEM_SOUNDS_PATH), audioFilenames[i]); - strcat(filename+sizeof(SYSTEM_SOUNDS_PATH), SOUNDS_EXT); + if (sdAvailableSystemAudioFiles & MASK_SYSTEM_AUDIO_FILE(event)) { + getSystemAudioFile(filename, event); return true; } } else if (category == PHASE_AUDIO_CATEGORY) { - if (sdAvailablePhaseAudioFiles[index] & ((uint32_t)1 << event)) { - strcpy(filename, SOUNDS_PATH "/"); - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); - char *str = strcat_modelname(filename+sizeof(SOUNDS_PATH), g_eeGeneral.currModel); - *str++ = '/'; - char * tmp = strcat_phasename(str, index); - if (tmp != str) { - strcpy(tmp, suffixes[event]); - strcat(tmp, SOUNDS_EXT); + if (sdAvailablePhaseAudioFiles & MASK_PHASE_AUDIO_FILE(index, event)) { + getPhaseAudioFile(filename, index, event); return true; } } + else if (category == SWITCH_AUDIO_CATEGORY) { + if (sdAvailableSwitchAudioFiles & MASK_SWITCH_AUDIO_FILE(index)) { + getSwitchAudioFile(filename, index); + return true; } - else if (category == MIXER_AUDIO_CATEGORY) { - if (sdAvailableMixerAudioFiles[index] & ((uint32_t)1 << event)) { - strcpy(filename, SOUNDS_PATH "/"); - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); - char *str = strcat_modelname(filename+sizeof(SOUNDS_PATH), g_eeGeneral.currModel); - *str++ = '/'; - char * tmp = strcat_mixername(str, index); - if (tmp != str) { - strcpy(tmp, suffixes[event]); - strcat(tmp, SOUNDS_EXT); + } + else if (category == LOGICAL_SWITCH_AUDIO_CATEGORY) { + if (sdAvailableLogicalSwitchAudioFiles & MASK_LOGICAL_SWITCH_AUDIO_FILE(index, event)) { + getLogicalSwitchAudioFile(filename, index, event); return true; } } - } return false; } + +tmr10ms_t timeAutomaticPromptsSilence = 0; + +void playModelEvent(uint8_t category, uint8_t index, uint8_t event) +{ + char filename[AUDIO_FILENAME_MAXLEN+1]; + if ((get_tmr10ms()-timeAutomaticPromptsSilence > 50) && isAudioFileReferenced((category << 24) + (index << 16) + event, filename)) { + audioQueue.playFile(filename); + } +} #else -#define isAudioFileAvailable(i, f) false + +#define isAudioFileReferenced(i, f) false + #endif const int16_t alawTable[256] = { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944, -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136, -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472, -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568, -344, -328, -376, -360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392, -440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200, -248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624, -592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, 344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408, 392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232, 152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720, 560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848 }; @@ -808,10 +935,6 @@ void AudioQueue::reset() void audioEvent(uint8_t e, uint16_t f) { -#if defined(SDCARD) - char filename[AUDIO_FILENAME_MAXLEN+1]; -#endif - #if defined(HAPTIC) haptic.event(e); //do this before audio to help sync timings #endif @@ -824,7 +947,8 @@ void audioEvent(uint8_t e, uint16_t f) if (g_eeGeneral.beepMode>0 || (g_eeGeneral.beepMode==0 && e>=AU_TRIM_MOVE) || (g_eeGeneral.beepMode>=-1 && e<=AU_ERROR)) { #if defined(SDCARD) - if (e < AU_FRSKY_FIRST && isAudioFileAvailable(e, filename)) { + char filename[AUDIO_FILENAME_MAXLEN+1]; + if (e < AU_FRSKY_FIRST && isAudioFileReferenced(e, filename)) { audioQueue.playFile(filename); } else @@ -1033,16 +1157,13 @@ void audioEvent(uint8_t e, uint16_t f) void pushPrompt(uint16_t prompt, uint8_t id) { #if defined(SDCARD) - - char filename[] = SYSTEM_SOUNDS_PATH "/0000" SOUNDS_EXT; - strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); - + char filename[AUDIO_FILENAME_MAXLEN+1]; + char * str = getSystemAudioPath(filename); + strcpy(str, "0000" SOUNDS_EXT); for (int8_t i=3; i>=0; i--) { - filename[sizeof(SYSTEM_SOUNDS_PATH)+i] = '0' + (prompt%10); + str[i] = '0' + (prompt%10); prompt /= 10; } - audioQueue.playFile(filename, 0, id); - #endif } diff --git a/radio/src/audio_arm.h b/radio/src/audio_arm.h index 14dbc666a..65a9d6233 100644 --- a/radio/src/audio_arm.h +++ b/radio/src/audio_arm.h @@ -297,16 +297,21 @@ void audioStart(); #define AUDIO_HEARTBEAT() -#define SYSTEM_AUDIO_CATEGORY 0 -#define MODEL_AUDIO_CATEGORY 1 -#define PHASE_AUDIO_CATEGORY 2 -#define MIXER_AUDIO_CATEGORY 3 +enum AutomaticPromptsCategories { + SYSTEM_AUDIO_CATEGORY, + MODEL_AUDIO_CATEGORY, + PHASE_AUDIO_CATEGORY, + SWITCH_AUDIO_CATEGORY, + LOGICAL_SWITCH_AUDIO_CATEGORY, +}; -#define AUDIO_EVENT_OFF 0 -#define AUDIO_EVENT_ON 1 -#define AUDIO_EVENT_BG 2 +enum AutomaticPromptsEvents { + AUDIO_EVENT_OFF, + AUDIO_EVENT_ON, + AUDIO_EVENT_MID, +}; -extern void pushPrompt(uint16_t prompt, uint8_t id=0); +void pushPrompt(uint16_t prompt, uint8_t id=0); #define I18N_PLAY_FUNCTION(lng, x, ...) void lng ## _ ## x(__VA_ARGS__, uint8_t id) #define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id) @@ -320,15 +325,26 @@ extern void pushPrompt(uint16_t prompt, uint8_t id=0); #define AUDIO_RESET() audioQueue.reset() #if defined(SDCARD) - #define PLAY_PHASE_OFF(phase) do { char filename[AUDIO_FILENAME_MAXLEN+1]; if (isAudioFileAvailable((PHASE_AUDIO_CATEGORY << 24) + (phase << 16) + AUDIO_EVENT_OFF, filename)) audioQueue.playFile(filename); } while (0) - #define PLAY_PHASE_ON(phase) do { char filename[AUDIO_FILENAME_MAXLEN+1]; if (isAudioFileAvailable((PHASE_AUDIO_CATEGORY << 24) + (phase << 16) + AUDIO_EVENT_ON, filename)) audioQueue.playFile(filename); } while (0) + extern tmr10ms_t timeAutomaticPromptsSilence; + void playModelEvent(uint8_t category, uint8_t index, uint8_t event=0); + #define PLAY_PHASE_OFF(phase) playModelEvent(PHASE_AUDIO_CATEGORY, phase, AUDIO_EVENT_OFF) + #define PLAY_PHASE_ON(phase) playModelEvent(PHASE_AUDIO_CATEGORY, phase, AUDIO_EVENT_ON) + #define PLAY_SWITCH_MOVED(sw) playModelEvent(SWITCH_AUDIO_CATEGORY, sw) + #define PLAY_LOGICAL_SWITCH_OFF(sw) playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_OFF) + #define PLAY_LOGICAL_SWITCH_ON(sw) playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_ON) + #define SKIP_AUTOMATIC_PROMPTS() timeAutomaticPromptsSilence = get_tmr10ms() #else #define PLAY_PHASE_OFF(phase) #define PLAY_PHASE_ON(phase) + #define PLAY_SWITCH_MOVED(sw) + #define PLAY_LOGICAL_SWITCH_OFF(sw) + #define PLAY_LOGICAL_SWITCH_ON(sw) + #define SKIP_AUTOMATIC_PROMPTS() #endif -extern void refreshSystemAudioFiles(); -extern void refreshModelAudioFiles(); -extern bool isAudioFileAvailable(uint32_t i, char * filename); +void referenceSystemAudioFiles(); +void referenceModelAudioFiles(); + +bool isAudioFileReferenced(uint32_t i, char * filename/*at least AUDIO_FILENAME_MAXLEN+1 long*/); #endif diff --git a/radio/src/audio_avr.h b/radio/src/audio_avr.h index 6302c13f4..691305655 100644 --- a/radio/src/audio_avr.h +++ b/radio/src/audio_avr.h @@ -157,5 +157,9 @@ void audioDefevent(uint8_t e); #define PLAY_PHASE_OFF(phase) #define PLAY_PHASE_ON(phase) +#define PLAY_SWITCH_MOVED(sw) +#define PLAY_LOGICAL_SWITCH_OFF(sw) +#define PLAY_LOGICAL_SWITCH_ON(sw) +#define SKIP_AUTOMATIC_PROMPTS() #endif diff --git a/radio/src/buzzer.h b/radio/src/buzzer.h index cbb4d5717..6d901bbbb 100644 --- a/radio/src/buzzer.h +++ b/radio/src/buzzer.h @@ -102,6 +102,10 @@ void beep(uint8_t val); #define PLAY_PHASE_OFF(phase) #define PLAY_PHASE_ON(phase) + #define PLAY_SWITCH_MOVED(sw) + #define PLAY_LOGICAL_SWITCH_OFF(sw) + #define PLAY_LOGICAL_SWITCH_ON(sw) + #define SKIP_AUTOMATIC_PROMPTS() #endif #if !defined(CPUARM) diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index 8a0e6bac9..e575f4c1c 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -144,7 +144,7 @@ PACK(typedef struct { int8_t swtch; uint8_t func; PACK(union { - char name[LEN_CFN_NAME]; + char name[10]; struct { int16_t val; int16_t ext1; @@ -193,7 +193,7 @@ PACK(typedef struct { int8_t points[NUM_POINTS]; LogicalSwitchData_v215 customSw[NUM_CSW]; - CustomFnData_v215 funcSw[NUM_CFN]; + CustomFnData_v215 funcSw[32]; SwashRingData swashR; PhaseData_v215 phaseData[MAX_PHASES]; @@ -212,9 +212,27 @@ PACK(typedef struct { }) ModelData_v215; +PACK(typedef struct { + uint8_t version; + uint16_t variant; + int16_t calibMid[NUM_STICKS+NUM_POTS]; + int16_t calibSpanNeg[NUM_STICKS+NUM_POTS]; + int16_t calibSpanPos[NUM_STICKS+NUM_POTS]; + uint16_t chkSum; +}) GeneralSettings_v215; + void ConvertGeneralSettings_215_to_216(EEGeneral &settings) { + GeneralSettings_v215 oldSettings; + memcpy(&oldSettings, &settings, sizeof(oldSettings)); + settings.version = 216; + for (int i=0; i 8 bit is enough +#define GV1_SMALL 128 +// highest bit used for large values in mix 4096 --> 12 bits is used (type for weight and offset has even 16 bits) +#define GV1_LARGE 4096 +// the define GV1_LARGE marks the highest bit value used for this variables +// because this would give too big numbers for ARM, we limit it further for offset and weight +// must be smaller than GV1_LARGE - RESERVE_RANGE_FOR_GVARS -1 +#define GV_RANGE_WEIGHT 500 +#define GV_RANGE_OFFSET 500 + #define DELAY_STEP 10 #define SLOW_STEP 10 #define DELAY_MAX (25*DELAY_STEP) /* 25 seconds */ @@ -587,6 +598,12 @@ PACK( union u_int8int16_t { // #define MD_SETOFFSET(md, val) md->offset = val #else + +// highest bit used for small values in mix 128 --> 8 bit is enough +#define GV1_SMALL 128 +// highest bit used for large values in mix 256 --> 9 bits is used (8 bits + 1 extra bit from weightMode/offsetMode) +#define GV1_LARGE 256 + #define DELAY_STEP 2 #define SLOW_STEP 2 #define DELAY_MAX 15 /* 7.5 seconds */ @@ -809,7 +826,7 @@ enum AdjustGvarFunctionParam { #if defined(CPUARM) #if defined(PCBTARANIS) - #define LEN_CFN_NAME 10 + #define LEN_CFN_NAME 8 #else #define LEN_CFN_NAME 6 #endif diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 2be47461e..261c94366 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -51,6 +51,9 @@ int24_t act [MAX_MIXERS] = {0}; SwOn swOn [MAX_MIXERS]; // TODO better name later... uint8_t mixWarning; +#if defined(MODULE_ALWAYS_SEND_PULSES) + uint8_t startupWarningState; +#endif #if defined(CPUARM) #define MENUS_STACK_SIZE 2000 @@ -1247,9 +1250,11 @@ getvalue_t getValue(uint8_t i) else if (i==MIXSRC_SH) return (switchState(SW_SH0) ? -1024 : 1024); else if (i<=MIXSRC_LAST_CSW) return getSwitch(SWSRC_FIRST_CSW+i-MIXSRC_FIRST_CSW) ? 1024 : -1024; #else - else if (i==MIXSRC_3POS) return (switchState(SW_ID0) ? -1024 : (switchState(SW_ID1) ? 0 : 1024)); + else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024)); + // don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning #if defined(EXTRA_3POS) - else if (i==MIXSRC_3POS2) return (switchState(SW_ID3) ? -1024 : (switchState(SW_ID4) ? 0 : 1024)); + else if (i==MIXSRC_3POS2) return (getSwitch(SW_ID3-SW_BASE+1) ? -1024 : (getSwitch(SW_ID4-SW_BASE+1) ? 0 : 1024)); + // don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning #endif else if (i<=MIXSRC_LAST_CSW) return getSwitch(SWSRC_THR+i-MIXSRC_THR) ? 1024 : -1024; #endif @@ -1309,7 +1314,6 @@ getvalue_t getValue(uint8_t i) volatile GETSWITCH_RECURSIVE_TYPE s_last_switch_used = 0; volatile GETSWITCH_RECURSIVE_TYPE s_last_switch_value = 0; -/* recursive function. stack as of today (16/03/2012) grows by 8bytes at each call, which is ok! */ #if defined(CPUARM) uint32_t cswDelays[NUM_CSW]; @@ -1322,27 +1326,66 @@ tmr10ms_t switchesMidposStart[6] = { 0 }; uint32_t switchesPos = 0; tmr10ms_t potsLastposStart[NUM_XPOTS]; uint8_t potsPos[NUM_XPOTS]; + +uint32_t check2PosSwitchPosition(EnumKeys sw) +{ + uint32_t result; + uint32_t index; + + if (switchState(sw)) + index = sw - SW_SA0; + else + index = sw - SW_SA0 + 1; + + result = (1 << index); + + if (!(switchesPos & result)) { + PLAY_SWITCH_MOVED(index); + } + + return result; +} + #define DELAY_SWITCH_3POS 10/*100ms*/ -#define CHECK_2POS(sw) newPos |= (switchState(sw ## 0) ? (1 << (sw ## 0 - SW_SA0)) : (1 << (sw ## 0 - SW_SA0 + 1))) -#define CHECK_3POS(idx, sw) if (switchState(sw ## 0)) { \ - newPos |= (1 << (sw ## 0 - SW_SA0)); \ - switchesMidposStart[idx] = 0; \ - } \ - else if (switchState(sw ## 2)) { \ - newPos |= (1 << (sw ## 0 - SW_SA0 + 2)); \ - switchesMidposStart[idx] = 0; \ - } \ - else if ((switchesPos & (1 << (sw ## 0 - SW_SA0 + 1))) || (switchesMidposStart[idx] && (tmr10ms_t)(get_tmr10ms() - switchesMidposStart[idx]) > DELAY_SWITCH_3POS)) { \ - newPos |= (1 << (sw ## 0 - SW_SA0 + 1)); \ - switchesMidposStart[idx] = 0; \ - } \ - else { \ - if (!switchesMidposStart[idx]) { \ - switchesMidposStart[idx] = get_tmr10ms(); \ - } \ - newPos |= (switchesPos & (0x7 << (sw ## 0 - SW_SA0))); \ - } -void getSwitchesPosition() +uint32_t check3PosSwitchPosition(uint8_t idx, EnumKeys sw, bool startup) +{ + uint32_t result; + uint32_t index; + + if (switchState(sw)) { + index = sw - SW_SA0; + result = (1 << index); + switchesMidposStart[idx] = 0; + } + else if (switchState(EnumKeys(sw+2))) { + index = sw - SW_SA0 + 2; + result = (1 << index); + switchesMidposStart[idx] = 0; + } + else if (startup || (switchesPos & (1 << (sw - SW_SA0 + 1))) || (switchesMidposStart[idx] && (tmr10ms_t)(get_tmr10ms() - switchesMidposStart[idx]) > DELAY_SWITCH_3POS)) { + index = sw - SW_SA0 + 1; + result = (1 << index); + switchesMidposStart[idx] = 0; + } + else { + index = sw - SW_SA0 + 1; + if (!switchesMidposStart[idx]) { + switchesMidposStart[idx] = get_tmr10ms(); + } + result = (switchesPos & (0x7 << (sw - SW_SA0))); + } + + if (!(switchesPos & result)) { + PLAY_SWITCH_MOVED(index); + } + + return result; +} + +#define CHECK_2POS(sw) newPos |= check2PosSwitchPosition(sw ## 0) +#define CHECK_3POS(idx, sw) newPos |= check3PosSwitchPosition(idx, sw ## 0, startup) + +void getSwitchesPosition(bool startup) { uint32_t newPos = 0; CHECK_3POS(0, SW_SA); @@ -1361,13 +1404,17 @@ void getSwitchesPosition() if (calib->count>0 && calib->countcount); uint8_t previousPos = potsPos[i] >> 4; + uint8_t previousStoredPos = potsPos[i] & 0x0F; if (pos != previousPos) { potsLastposStart[i] = get_tmr10ms(); - potsPos[i] = (pos << 4) | (potsPos[i] & 0x0f); + potsPos[i] = (pos << 4) | previousStoredPos; } - else if ((tmr10ms_t)(get_tmr10ms() - potsLastposStart[i]) > DELAY_SWITCH_3POS) { + else if (startup || (tmr10ms_t)(get_tmr10ms() - potsLastposStart[i]) > DELAY_SWITCH_3POS) { potsLastposStart[i] = 0; - potsPos[i] = (pos << 4) | (pos); + potsPos[i] = (pos << 4) | pos; + if (previousStoredPos != pos) { + PLAY_SWITCH_MOVED(SWSRC_LAST_SWITCH+i*POTS_POS_COUNT+pos); + } } } } @@ -1376,12 +1423,14 @@ void getSwitchesPosition() #define SWITCH_POSITION(sw) (switchesPos & (1<<(sw))) #define POT_POSITION(sw) ((potsPos[(sw)/POTS_POS_COUNT] & 0x0f) == ((sw) % POTS_POS_COUNT)) #else -#define getSwitchesPosition() +#define getSwitchesPosition(...) #define SWITCH_POSITION(idx) switchState((EnumKeys)(SW_BASE+(idx))) #endif int16_t csLastValue[NUM_CSW]; #define CS_LAST_VALUE_INIT -32768 + +/* recursive function. stack as of today (16/03/2012) grows by 8bytes at each call, which is ok! */ bool getSwitch(int8_t swtch) { bool result; @@ -1396,6 +1445,20 @@ bool getSwitch(int8_t swtch) } else if (cs_idx <= SWSRC_LAST_SWITCH) { result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH); +#if defined(MODULE_ALWAYS_SEND_PULSES) + if (startupWarningState < STARTUP_WARNING_DONE) { + // if throttle or switch warning is currently active, ignore actual stick position and use wanted values + if (cs_idx <= 3) { + if (!(g_model.nSwToWarn&1)) { // ID1 to ID3 is just one bit in nSwToWarn + result = (cs_idx)==((g_model.switchWarningStates&3)+1); // overwrite result with desired value + } + } + else if (!(g_model.nSwToWarn & (1<<(cs_idx-3)))) { + // current switch should not be ignored for warning + result = g_model.switchWarningStates & (1<<(cs_idx-2)); // overwrite result with desired value + } + } +#endif } #if defined(PCBTARANIS) else if (cs_idx <= SWSRC_P26) { @@ -1587,10 +1650,14 @@ bool getSwitch(int8_t swtch) } #endif - if (result) + if (result) { + if (!(s_last_switch_value&mask)) PLAY_LOGICAL_SWITCH_ON(cs_idx); s_last_switch_value |= mask; - else + } + else { + if (s_last_switch_value&mask) PLAY_LOGICAL_SWITCH_OFF(cs_idx); s_last_switch_value &= ~mask; + } } } @@ -1621,26 +1688,23 @@ int8_t getMovedSwitch() } } #else - for (uint8_t i=NUM_PSWITCH; i>0; i--) { + // return delivers 1 to 3 for ID1 to ID3 + // 4..8 for all other switches if changed to true + // -4..-8 for all other switches if changed to false + // 9 for Trainer switch if changed to true; Change to false is ignored + swstate_t mask = 0x80; + for (uint8_t i=NUM_PSWITCH; i>1; i--) { bool prev; - swstate_t mask = 0; - if (i <= 3) { - prev = ((switches_states & 0x03) == (i-1)); - } - else { - mask = (1<<(i-2)); - prev = (switches_states & mask); - } - bool next = getSwitch(i); + prev = (switches_states & mask); + // don't use getSwitch here to always get the proper value, even getSwitch manipulates + bool next = switchState((EnumKeys)(SW_BASE+i-1)); if (prev != next) { - if (i!=NUM_PSWITCH || next==true) + if (((i3)) || next==true) result = next ? i : -i; - if (mask) - switches_states ^= mask; - else { - switches_states = (switches_states & 0xFC) | (i-1); - } + if (i<=3 && result==0) result = 1; + switches_states ^= mask; } + mask >>= 1; } #endif @@ -2237,8 +2301,12 @@ void checkAll() checkLowEEPROM(); #endif +#if defined(MODULE_ALWAYS_SEND_PULSES) + startupWarningState = STARTUP_WARNING_THROTTLE; +#else checkTHR(); checkSwitches(); +#endif #if defined(PCBTARANIS) if (modelHasNotes() && g_model.displayText) { @@ -2250,8 +2318,22 @@ void checkAll() #endif clearKeyEvents(); + + SKIP_AUTOMATIC_PROMPTS(); } +#if defined(MODULE_ALWAYS_SEND_PULSES) +void checkStartupWarnings() +{ + if (startupWarningState < STARTUP_WARNING_DONE) { + if (startupWarningState == STARTUP_WARNING_THROTTLE) + checkTHR(); + else + checkSwitches(); + } +} +#endif + #if !defined(PCBSKY9X) void checkLowEEPROM() { @@ -2264,105 +2346,136 @@ void checkLowEEPROM() void checkTHR() { - if (g_model.disableThrottleWarning) return; + uint8_t thrchn = ((g_model.thrTraceSrc==0) || (g_model.thrTraceSrc>NUM_POTS)) ? THR_STICK : g_model.thrTraceSrc+NUM_STICKS-1; + // throttle channel is either the stick according stick mode (already handled in evalInputs) + // or P1 to P3; + // in case an output channel is choosen as throttle source (thrTraceSrc>NUM_POTS) we assume the throttle stick is the input + // no other information available at the moment, and good enough to my option (otherwise too much exceptions...) - uint8_t thrchn = (2-(stickMode&1)); //stickMode=0123 -> thr=2121 - -#ifdef SIMU - int16_t lowLim = THRCHK_DEADBAND - 1024 ; -#else - getADC(); // if thr is down - do not display warning at all - CalibData * calib = &g_eeGeneral.calib[thrchn]; - int16_t lowLim = calib->mid; - lowLim = (g_model.throttleReversed ? - lowLim - calib->spanPos : lowLim - calib->spanNeg); - lowLim += THRCHK_DEADBAND; -#endif - int16_t v = thrAnaIn(thrchn); - - if (v<=lowLim) return; - - // first - display warning - MESSAGE(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT); - - while (1) - { - SIMU_SLEEP(1); - - getADC(); - - int16_t v = thrAnaIn(thrchn); - - if (pwrCheck()==e_power_off || keyDown() || v<=lowLim) - break; - - checkBacklight(); - - wdt_reset(); +#if defined(MODULE_ALWAYS_SEND_PULSES) + int16_t v = calibratedStick[thrchn]; + if (v<=THRCHK_DEADBAND-1024 || g_model.disableThrottleWarning || pwrCheck()==e_power_off || keyDown()) { + startupWarningState = STARTUP_WARNING_THROTTLE+1; } + else { + calibratedStick[thrchn] = -1024; +#if !defined(PCBTARANIS) + rawAnas[thrchn] = anas[thrchn] = calibratedStick[thrchn]; +#endif + MESSAGE(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT); + } +#else + if (g_model.disableThrottleWarning) return; + getADC(); + evalInputs(e_perout_mode_notrainer); // let do evalInputs do the job + + int16_t v = calibratedStick[thrchn]; + if (v<=(THRCHK_DEADBAND-1024)) return; // prevent warning if throttle input OK + + // first - display warning; also deletes inputs if any have been before + MESSAGE(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT); + + while (1) { + + SIMU_SLEEP(1); + + getADC(); + + evalInputs(e_perout_mode_notrainer); // let do evalInputs do the job + v = calibratedStick[thrchn]; + + if (pwrCheck()==e_power_off || keyDown() || v<=(THRCHK_DEADBAND-1024)) + break; + + checkBacklight(); + + wdt_reset(); + } +#endif } void checkAlarm() // added by Gohst { - if (g_eeGeneral.disableAlarmWarning) return; - if (IS_SOUND_OFF()) ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR); + if (g_eeGeneral.disableAlarmWarning) + return; + + if (IS_SOUND_OFF()) + ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR); } void checkSwitches() { +#if defined(MODULE_ALWAYS_SEND_PULSES) + static swstate_t last_bad_switches = 0xff; +#else swstate_t last_bad_switches = 0xff; +#endif swstate_t states = g_model.switchWarningStates; + #if defined(PCBTARANIS) uint8_t bad_pots = 0, last_bad_pots = 0xff; #endif +#if !defined(MODULE_ALWAYS_SEND_PULSES) while (1) { #if defined(TELEMETRY_MOD_14051) || defined(PCBTARANIS) getADC(); #endif +#endif // !defined(MODULE_ALWAYS_SEND_PULSES) getMovedSwitch(); - uint8_t warn = false; + bool warn = false; #if defined(PCBTARANIS) for (uint8_t i=0; i> 6; - if(potMode) { + if (potMode) { perOut(e_perout_mode_normal, 0); bad_pots = 0; - for (uint8_t i=0; i> 3)) > 2)) { - warn = true; - bad_pots |= (1<> 3)) > 2)) { + warn = true; + bad_pots |= (1<> (i*2)]; @@ -2370,7 +2483,7 @@ void checkSwitches() lcd_putcAtt(60+i*(2*FW+FW/2)+FW, 4*FH+3, c, attr); } } - if(potMode) { + if (potMode) { for (uint8_t i=0; i (getValue(MIXSRC_FIRST_POT+i) >> 3) ? 126 : 127); break; - case 2: - case 3: + case 2: + case 3: lcd_putc(60+i*(5*FW)+2*FW+2, 6*FH-2, g_model.potPosition[i] > (getValue(MIXSRC_FIRST_POT+i) >> 3) ? '\300' : '\301'); break; } @@ -2399,11 +2512,11 @@ void checkSwitches() for (uint8_t i=0; i0?(i+3):(states&0x3)+1), attr); + attr = (states & (1 << (i+1))) == (switches_states & (1 << (i+1))) ? 0 : INVERS; + if (!(g_model.nSwToWarn & (1<0?(i+3):(states&0x3)+1), attr); x += 3*FW+FW/2; } #endif @@ -2411,7 +2524,13 @@ void checkSwitches() last_bad_switches = switches_states; } - if (pwrCheck()==e_power_off || keyDown()) return; // Usb on or power off +#if defined(MODULE_ALWAYS_SEND_PULSES) + if (pwrCheck()==e_power_off || keyDown()) { + startupWarningState = STARTUP_WARNING_SWITCHES+1; + last_bad_switches = 0xff; + } +#else + if (pwrCheck()==e_power_off || keyDown()) return; checkBacklight(); @@ -2419,6 +2538,7 @@ void checkSwitches() SIMU_SLEEP(1); } +#endif } void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG) @@ -2640,12 +2760,6 @@ uint16_t BandGap = 2040 ; uint16_t BandGap ; #endif -int16_t thrAnaIn(uint8_t chan) -{ - int16_t v = anaIn(chan); - return (g_model.throttleReversed) ? -v : v; -} - #if !defined(SIMU) uint16_t anaIn(uint8_t chan) { @@ -2861,11 +2975,14 @@ void resetAll() #if defined(FRSKY) resetTelemetry(); #endif - for (uint8_t i=0; iHIGH signals start of mixer interrupt #endif - static tmr10ms_t lastTMR; + static tmr10ms_t lastTMR = 0; tmr10ms_t tmr10ms = get_tmr10ms(); - uint8_t tick10ms = (tmr10ms >= lastTMR ? tmr10ms - lastTMR : 1); // handle tick10ms overrun - //@@@ open.20.fsguruh: correct overflow handling costs a lot of code; happens only each 11 min; + uint8_t tick10ms = (tmr10ms >= lastTMR ? tmr10ms - lastTMR : 1); + // handle tick10ms overrun + // correct overflow handling costs a lot of code; happens only each 11 min; // therefore forget the exact calculation and use only 1 instead; good compromise + +#if !defined(CPUARM) lastTMR = tmr10ms; +#endif getADC(); - getSwitchesPosition(); + getSwitchesPosition(lastTMR == 0); + +#if defined(CPUARM) + lastTMR = tmr10ms; +#endif #if defined(PCBSKY9X) && !defined(REVA) && !defined(SIMU) Current_analogue = (Current_analogue*31 + s_anaFilt[8] ) >> 5 ; @@ -4483,6 +4612,13 @@ void perMain() } #endif +#if defined(MODULE_ALWAYS_SEND_PULSES) + if (startupWarningState < STARTUP_WARNING_DONE) { + // don't do menu's until throttle and switch warnings are handled + return; + } +#endif + if (!usbPlugged()) { // TODO merge these 2 branches #if defined(PCBSKY9X) diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 3800abe29..bd3be54c0 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -803,6 +803,18 @@ enum PerOutMode { e_perout_mode_noinput = e_perout_mode_notrainer+e_perout_mode_notrims+e_perout_mode_nosticks }; + +#if defined(MODULE_ALWAYS_SEND_PULSES) +extern uint8_t startupWarningState; + +enum StartupWarningStates { + STARTUP_WARNING_THROTTLE, + STARTUP_WARNING_SWITCHES, + STARTUP_WARNING_DONE, +}; +#endif + + // Fiddle to force compiler to use a pointer #if defined(CPUARM) || defined(SIMU) #define FORCE_INDIRECT(ptr) @@ -894,13 +906,9 @@ void setTrimValue(uint8_t phase, uint8_t idx, int trim); #endif #if defined(CPUARM) - #define GV1_SMALL 128 - #define GV1_LARGE 4096 #define GV_GET_GV1_VALUE(max) ( (max<=GV_RANGESMALL && min>=GV_RANGESMALL_NEG) ? GV1_SMALL : GV1_LARGE ) #define GV_INDEX_CALCULATION(x,max) ( (max<=GV_RANGESMALL && min>=GV_RANGESMALL_NEG) ? (uint8_t) x-GV1_SMALL : ((x&(GV1_LARGE*2-1))-GV1_LARGE) ) #else - #define GV1_SMALL 128 - #define GV1_LARGE 256 #define GV_GET_GV1_VALUE(max) ( (max<=GV_RANGESMALL) ? GV1_SMALL : GV1_LARGE ) #define GV_INDEX_CALCULATION(x,max) ( (max<=GV1_SMALL) ? (uint8_t) x-GV1_SMALL : ((x&(GV1_LARGE*2-1))-GV1_LARGE) ) #endif @@ -915,6 +923,21 @@ void setTrimValue(uint8_t phase, uint8_t idx, int trim); #define GV_RANGESMALL_NEG (-GV1_SMALL + (RESERVE_RANGE_FOR_GVARS+1)) #define GV_RANGELARGE (GV1_LARGE - (RESERVE_RANGE_FOR_GVARS+1)) #define GV_RANGELARGE_NEG (-GV1_LARGE + (RESERVE_RANGE_FOR_GVARS+1)) +#if defined(CPUARM) + // the define GV1_LARGE marks the highest bit value used for this variables + // because this would give too big numbers for ARM, we limit it further for + // offset and weight + #define GV_RANGELARGE_WEIGHT (GV_RANGE_WEIGHT) + #define GV_RANGELARGE_WEIGHT_NEG (-GV_RANGE_WEIGHT) + #define GV_RANGELARGE_OFFSET (GV_RANGE_OFFSET) + #define GV_RANGELARGE_OFFSET_NEG (-GV_RANGE_OFFSET) +#else + // for stock we just use as much as possible + #define GV_RANGELARGE_WEIGHT GV_RANGELARGE + #define GV_RANGELARGE_WEIGHT_NEG GV_RANGELARGE_NEG + #define GV_RANGELARGE_OFFSET GV_RANGELARGE + #define GV_RANGELARGE_OFFSET_NEG GV_RANGELARGE_NEG +#endif extern uint16_t s_timeCumTot; extern uint16_t s_timeCumThr; @@ -1211,8 +1234,8 @@ int applyCurve(int x, int8_t idx); void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS_INC); int16_t applyLimits(uint8_t channel, int32_t value); +void evalInputs(uint8_t mode); uint16_t anaIn(uint8_t chan); -int16_t thrAnaIn(uint8_t chan); extern int16_t calibratedStick[NUM_STICKS+NUM_POTS]; #define FLASH_DURATION 20 /*200ms*/ @@ -1620,8 +1643,7 @@ uint8_t zlen(const char *str, uint8_t size); bool zexist(const char *str, uint8_t size); char * strcat_zchar(char * dest, char * name, uint8_t size, const char *defaultName, uint8_t defaultNameSize, uint8_t defaultIdx); #define strcat_modelname(dest, idx) strcat_zchar(dest, modelHeaders[idx].name, LEN_MODEL_NAME, STR_MODEL, PSIZE(TR_MODEL), idx+1) -#define strcat_phasename(dest, idx) strcat_zchar(dest, g_model.phaseData[idx].name, LEN_FP_NAME, NULL, 0, 0) -#define strcat_mixername(dest, idx) strcat_zchar(dest, g_model.mixData[idx].name, LEN_EXPOMIX_NAME, NULL, 0, 0) +#define strcat_phasename(dest, idx) strcat_zchar(dest, g_model.phaseData[idx].name, LEN_FP_NAME, STR_FP, PSIZE(TR_FP), idx+1) #define ZLEN(s) zlen(s, sizeof(s)) #define ZEXIST(s) zexist(s, sizeof(s)) #endif diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index 4e6c446d7..ccbad5fa6 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -44,7 +44,7 @@ #define LOGS_PATH ROOT_PATH "LOGS" // no trailing slash = important #define SOUNDS_PATH ROOT_PATH "SOUNDS/en" // no trailing slash = important #define SOUNDS_PATH_LNG_OFS (sizeof(SOUNDS_PATH)-3) -#define SYSTEM_SOUNDS_PATH SOUNDS_PATH "/SYSTEM" // no trailing slash = important +#define SYSTEM_SUBDIR "SYSTEM" // no trailing slash = important #define BITMAPS_PATH ROOT_PATH "BMP" #define SCRIPTS_PATH ROOT_PATH "SCRIPTS" @@ -53,7 +53,6 @@ #define SOUNDS_EXT ".wav" #define BITMAPS_EXT ".bmp" #define SCRIPTS_EXT ".lua" -#define MIXES_EXT ".mix" #define TEXT_EXT ".txt" extern FATFS g_FATFS_Obj; diff --git a/radio/src/simpgmspace.cpp b/radio/src/simpgmspace.cpp index b8e57a5ba..b00c96be7 100644 --- a/radio/src/simpgmspace.cpp +++ b/radio/src/simpgmspace.cpp @@ -300,7 +300,7 @@ void *main_thread(void *) eeReadAll(); // load general setup and selected model #if defined(CPUARM) && defined(SDCARD) - refreshSystemAudioFiles(); + referenceSystemAudioFiles(); #endif if (g_eeGeneral.backlightMode != e_backlight_mode_off) backlightOn(); // on Tx start turn the light on @@ -473,9 +473,10 @@ char *convertSimuPath(const char *path) FRESULT f_stat (const TCHAR * name, FILINFO *) { + char *path = convertSimuPath(name); struct stat tmp; - // printf("f_stat(%s)\n", path); fflush(stdout); - return stat(convertSimuPath(name), &tmp) ? FR_INVALID_NAME : FR_OK; + TRACE("f_stat(%s)", path); + return stat(path, &tmp) ? FR_INVALID_NAME : FR_OK; } FRESULT f_mount (BYTE, FATFS*) @@ -550,9 +551,11 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil) fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0); #else if (ent->d_type == simu::DT_UNKNOWN) { + fil->fattrib = 0; struct stat buf; - lstat(ent->d_name, &buf); - fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0); + if (stat(ent->d_name, &buf) == 0) { + fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0); + } } else { fil->fattrib = (ent->d_type == simu::DT_DIR ? AM_DIR : 0); @@ -563,6 +566,7 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil) memset(fil->lfname, 0, SD_SCREEN_FILE_LENGTH); strncpy(fil->fname, ent->d_name, 13-1); strcpy(fil->lfname, ent->d_name); + // TRACE("f_readdir(): %s", fil->fname); return FR_OK; } diff --git a/radio/src/targets/sky9x/diskio.cpp b/radio/src/targets/sky9x/diskio.cpp index d7f60e900..8d9ff5cfc 100644 --- a/radio/src/targets/sky9x/diskio.cpp +++ b/radio/src/targets/sky9x/diskio.cpp @@ -1014,7 +1014,7 @@ void sdMountPoll() case SD_ST_DATA: if (!usbPlugged() && f_mount(0, &g_FATFS_Obj) == FR_OK) { - refreshSystemAudioFiles(); + referenceSystemAudioFiles(); Card_state = SD_ST_MOUNTED; } break; @@ -1082,7 +1082,7 @@ void sdInit() Card_state = SD_ST_DATA; if (f_mount(0, &g_FATFS_Obj) == FR_OK) { - refreshSystemAudioFiles(); + referenceSystemAudioFiles(); Card_state = SD_ST_MOUNTED; } diff --git a/radio/src/targets/taranis/diskio.cpp b/radio/src/targets/taranis/diskio.cpp index b1d2dea7e..d9586804f 100644 --- a/radio/src/targets/taranis/diskio.cpp +++ b/radio/src/targets/taranis/diskio.cpp @@ -969,7 +969,7 @@ FIL g_telemetryFile = {0}; void sdInit() { if (f_mount(0, &g_FATFS_Obj) == FR_OK) { - refreshSystemAudioFiles(); + referenceSystemAudioFiles(); #if defined(DEBUG) f_open(&g_telemetryFile, LOGS_PATH "/sport.log", FA_OPEN_ALWAYS | FA_WRITE); diff --git a/radio/src/targets/taranis/trainer_driver.cpp b/radio/src/targets/taranis/trainer_driver.cpp index 9319cc18b..f4b4e548c 100644 --- a/radio/src/targets/taranis/trainer_driver.cpp +++ b/radio/src/targets/taranis/trainer_driver.cpp @@ -124,7 +124,7 @@ extern "C" void TIM3_IRQHandler() val = (uint16_t)(capture - lastCapt) / 2 ; lastCapt = capture; - // We prcoess g_ppmInsright here to make servo movement as smooth as possible + // We process g_ppmInsright here to make servo movement as smooth as possible // while under trainee control if ((val>4000) && (val < 19000)) { // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) ppmInState = 1; // triggered