Skip to content

Commit

Permalink
emu: added emu type option to json
Browse files Browse the repository at this point in the history
Signed-off-by: IonutMuthi <[email protected]>
  • Loading branch information
IonutMuthi authored and adisuciu committed Aug 21, 2024
1 parent b8d10de commit 21d7e86
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions core/include/core/emuwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private Q_SLOTS:
QStringList m_availableOptions;

QString m_jsonConfigVal;
QString m_emuType = "generic";
};
} // namespace scopy

Expand Down
15 changes: 9 additions & 6 deletions core/src/emuwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ void EmuWidget::enGenericOptWidget(QWidget *xmlPathWidget, QWidget *rxTxDevWidge
rxTxDevWidget->setEnabled(isNotAdalm2000);
m_enDemoBtn->setFocus();

if(isNotAdalm2000) {
configureOption(crtOpt);
}
configureOption(crtOpt);
}

void EmuWidget::setStatusMessage(QString msg)
Expand Down Expand Up @@ -157,14 +155,13 @@ QStringList EmuWidget::createArgList()
{
QString option = m_demoOptCb->currentText();
QStringList arguments;
arguments.append(m_emuType);

if(option.compare("adalm2000") != 0) {
arguments.append("generic");
arguments.append(m_xmlPathEdit->edit()->text());
arguments.append(m_rxTxDevEdit->edit()->text());
} else {
arguments.append("adalm2000");
}

return arguments;
}

Expand Down Expand Up @@ -254,6 +251,12 @@ void EmuWidget::configureOption(QString option)
m_uriEdit->edit()->setText(uri);
}

if(jsonObject.contains("emu-type")) {
m_emuType = jsonObject.value(QString("emu-type")).toString();
} else {
m_emuType = "generic";
}

break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion resources/scopy_emu_options_config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[
{
"device": "adalm2000",
"uri": "ip:127.0.0.1"
"uri": "ip:127.0.0.1",
"emu-type": "adalm2000"
},
{
"device": "pluto",
Expand Down

0 comments on commit 21d7e86

Please sign in to comment.