Make parameter changes trigger updating peripheral exports info
MODIFY
src/io/iobase.cpp
src/io/iobase.cpp
@@ -28,12 +28,11 @@ bool IOBase::setParameter(unsigned ID, const QVariant& value) {
m_parameters.at(ID).value = value;
parameterChanged(ID);
const auto postSize = size();
- emit paramsChanged();
-
if (preSize != postSize) {
emit sizeChanged();
}
+ emit paramsChanged();
return true;
}

MODIFY
src/io/iobase.h
src/io/iobase.h
@@ -137,12 +137,7 @@ public:
auto paramCopy = m_parameters;
archive(cereal::make_nvp("parameters", paramCopy));
for (const auto& p : paramCopy) {
- m_parameters[p.first].value = p.second.value;
- }
-
- // Invalidate all parameters
- for (int i = 0; i < parameters; i++) {
- parameterChanged(i);
+ setParameter(p.first, p.second.value);
}
}

MODIFY
src/ioperipheraltab.cpp
src/ioperipheraltab.cpp
@@ -28,9 +28,12 @@ IOPeripheralTab::IOPeripheralTab(QWidget* parent, IOBase* peripheral)
}
updateExportsInfo();
+
+ connect(peripheral, &IOBase::paramsChanged, this, &IOPeripheralTab::updateExportsInfo);
}
void IOPeripheralTab::updateExportsInfo() {
+ m_ui->exports->clear();
auto symbols = IOManager::get().assemblerSymbolsForPeriph(m_peripheral);
for (const auto& symbol : symbols) {
m_ui->exports->appendPlainText("#define " + symbol.first + " " + "(0x" + QString::number(symbol.second, 16) +

Make parameter changes trigger updating peripheral exports info