diff --git a/companion/src/radiodata.cpp b/companion/src/radiodata.cpp index a0d68878d..626e6236f 100644 --- a/companion/src/radiodata.cpp +++ b/companion/src/radiodata.cpp @@ -33,6 +33,61 @@ void GeneralSettings::convert(BoardEnum before, BoardEnum after) // Here we can add explicit conversions when moving from one board to another } +void RadioData::setCurrentModel(unsigned int index) +{ + generalSettings.currModelIndex = index; + 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 0) { - ok = false; - } - } - if (ok) { - for (unsigned i=0; i