Implementation of some SCPI commands via TCP

This commit is contained in:
Jan Käberich 2021-04-11 00:10:22 +02:00
parent f1d52f159b
commit a15d02f217
15 changed files with 627 additions and 19 deletions

View file

@ -22,6 +22,7 @@ JSONPickerDialog::~JSONPickerDialog()
JSONModel::JSONModel(const nlohmann::json &json, QObject *parent) :
json(json)
{
Q_UNUSED(parent)
setupJsonInfo(json);
}
@ -97,6 +98,7 @@ int JSONModel::rowCount(const QModelIndex &parent) const
int JSONModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
return 2;
}
@ -133,11 +135,15 @@ QVariant JSONModel::data(const QModelIndex &index, int role) const
QVariant JSONModel::headerData(int section, Qt::Orientation orientation, int role) const
{
Q_UNUSED(section)
Q_UNUSED(orientation)
Q_UNUSED(role)
return QVariant();
}
bool JSONModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
Q_UNUSED(value)
nlohmann::json *item = static_cast<nlohmann::json*>(index.internalPointer());
auto info = jsonInfo.at(item);
if(role == Qt::CheckStateRole)