/* * Copyright (C) OpenTX * * Based on code named * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include "radiodata.h" #include "eeprominterface.h" // TODO here we will move a lot of functions from eeprominterface.cpp when no merge risk void ModelData::convert(Board::Type before, Board::Type after) { // Here we can add explicit conversions when moving from one board to another } void GeneralSettings::convert(Board::Type before, Board::Type after) { // Here we can add explicit conversions when moving from one board to another } void RadioData::setCurrentModel(unsigned int index) { generalSettings.currModelIndex = index; if (index < models.size()) { strcpy(generalSettings.currModelFilename, models[index].filename); } } void RadioData::fixModelFilename(unsigned int index) { ModelData & model = models[index]; QString filename(model.filename); bool ok = filename.endsWith(".bin"); if (ok) { if (filename.startsWith("model") && filename.mid(5, filename.length()-9).toInt() > 0) { ok = false; } } if (ok) { for (unsigned i=0; i