fix(cpn): Simulate from model only yml file (#3537) (#3566)

This commit is contained in:
Neil Horne
2023-05-15 11:22:49 +10:00
committed by GitHub
parent e603581105
commit 54483e6c4e
+3 -4
View File
@@ -55,7 +55,7 @@ bool YamlFormat::writeFile(const QByteArray & filedata)
}
bool YamlFormat::load(RadioData & radioData)
{
{
//bool hasLabels = getCurrentFirmware()->getCapability(HasModelLabels);
int modelIdx = 0;
@@ -97,13 +97,12 @@ bool YamlFormat::load(RadioData & radioData)
return false;
}
/*model.category = 0;*/
model.modelIndex = modelIdx;
strncpy(model.filename, qPrintable(filename), sizeof(model.filename) - 1);
model.used = true;
strncpy(radioData.generalSettings.currModelFilename, qPrintable(filename), sizeof(radioData.generalSettings.currModelFilename) - 1);
radioData.generalSettings.currModelIndex = modelIdx;
radioData.fixModelFilenames();
// without knowing the radio this model came from the old to new radio conversion can cause more issues than it tries to solve
// so leave fixing incompatibilities to the user
radioData.generalSettings.variant = getCurrentBoard();