Refactor to Model level ui datamodels for sources, switches and curves

This commit is contained in:
elecpower
2020-09-17 14:30:20 +10:00
parent 6ad75996e6
commit 1e0e22955d
34 changed files with 994 additions and 623 deletions
+7 -3
View File
@@ -22,10 +22,13 @@
#include "expodialog.h"
#include "helpers.h"
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware,
RawSourceItemModel * rawSourceItemModel, RawSwitchItemModel * rawSwitchItemModel):
ModelPanel(parent, model, generalSettings, firmware),
expoInserted(false),
modelPrinter(firmware, generalSettings, model)
modelPrinter(firmware, generalSettings, model),
rawSourceItemModel(rawSourceItemModel),
rawSwitchItemModel(rawSwitchItemModel)
{
inputsCount = firmware->getCapability(VirtualInputs);
if (inputsCount == 0)
@@ -180,11 +183,12 @@ void InputsPanel::gm_openExpo(int index)
if (firmware->getCapability(VirtualInputs))
inputName = model->inputNames[ed.chn];
ExpoDialog *g = new ExpoDialog(this, *model, &ed, generalSettings, firmware, inputName);
ExpoDialog *g = new ExpoDialog(this, *model, &ed, generalSettings, firmware, inputName, rawSourceItemModel, rawSwitchItemModel);
if (g->exec()) {
model->expoData[index] = ed;
if (firmware->getCapability(VirtualInputs))
strncpy(model->inputNames[ed.chn], inputName.toLatin1().data(), INPUT_NAME_LEN);
emit updateDataModels();
emit modified();
update();
}