new PIP
This commit is contained in:
@@ -52,6 +52,9 @@ QAD_PIQT_EXPORT const PIVariant Q2PIVariant(const QVariant & v);
|
|||||||
|
|
||||||
//inline const QString PI2QString(const PIString & v) {return QString::fromLocal8Bit(v.data());}
|
//inline const QString PI2QString(const PIString & v) {return QString::fromLocal8Bit(v.data());}
|
||||||
inline const QString PI2QString(const PIString & v) {return QString::fromUtf8(v.dataUTF8());}
|
inline const QString PI2QString(const PIString & v) {return QString::fromUtf8(v.dataUTF8());}
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,38,0)
|
||||||
|
inline const QString PI2QString(const PIConstChars & v) {return QString::fromLatin1(v.data(), v.length());}
|
||||||
|
#endif
|
||||||
|
|
||||||
//inline const PIString Q2PIString(const QString & v) {return PIString(v.toLocal8Bit().data());}
|
//inline const PIString Q2PIString(const QString & v) {return PIString(v.toLocal8Bit().data());}
|
||||||
inline const PIString Q2PIString(const QString & v) {return PIString::fromUTF8(v.toUtf8().data());}
|
inline const PIString Q2PIString(const QString & v) {return PIString::fromUTF8(v.toUtf8().data());}
|
||||||
|
|||||||
@@ -19,14 +19,22 @@ ConnectionEdit::ConnectionEdit(QWidget * parent): QDialog(parent) {
|
|||||||
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceMode");
|
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceMode");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
ui->comboMode->addItem(PI2QString(e.name.toString() + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#else
|
||||||
ui->comboMode->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
ui->comboMode->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
ui->comboMode->setCurrentIndex(ui->comboMode->count() - 1);
|
ui->comboMode->setCurrentIndex(ui->comboMode->count() - 1);
|
||||||
ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceOption");
|
ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceOption");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||||
QCheckBox * cb = new QCheckBox();
|
QCheckBox * cb = new QCheckBox();
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
cb->setText(PI2QString(e.name.toString() + " (" + PIString::fromNumber(e.value) + ")"));
|
||||||
|
#else
|
||||||
cb->setText(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"));
|
cb->setText(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"));
|
||||||
|
#endif
|
||||||
cb->setProperty("__value", e.value);
|
cb->setProperty("__value", e.value);
|
||||||
ui->layoutOptions->addWidget(cb);
|
ui->layoutOptions->addWidget(cb);
|
||||||
}
|
}
|
||||||
@@ -34,7 +42,11 @@ ConnectionEdit::ConnectionEdit(QWidget * parent): QDialog(parent) {
|
|||||||
ei = PICodeInfo::enumsInfo->value("PIPacketExtractor::SplitMode");
|
ei = PICodeInfo::enumsInfo->value("PIPacketExtractor::SplitMode");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
ui->comboSplit->addItem(PI2QString(e.name.toString() + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#else
|
||||||
ui->comboSplit->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
ui->comboSplit->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
udevicenum = 0;
|
udevicenum = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,11 @@ void FilterItem::rename() {
|
|||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & i, ei->members)
|
piForeachC (PICodeInfo::EnumeratorInfo & i, ei->members)
|
||||||
if (i.value == mode()) {
|
if (i.value == mode()) {
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
ms = PI2QString(i.name.toString());
|
||||||
|
#else
|
||||||
ms = PI2QString(i.name);
|
ms = PI2QString(i.name);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,14 +12,22 @@ IODeviceEditDialog::IODeviceEditDialog(QWidget * parent): QDialog(parent) {
|
|||||||
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceMode");
|
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceMode");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members)
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
ui->comboMode->addItem(PI2QString(e.name.toString() + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#else
|
||||||
ui->comboMode->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
ui->comboMode->addItem(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"), QVariant::fromValue<int>(e.value));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
ui->comboMode->setCurrentIndex(ui->comboMode->count() - 1);
|
ui->comboMode->setCurrentIndex(ui->comboMode->count() - 1);
|
||||||
ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceOption");
|
ei = PICodeInfo::enumsInfo->value("PIIODevice::DeviceOption");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||||
QCheckBox * cb = new QCheckBox();
|
QCheckBox * cb = new QCheckBox();
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
cb->setText(PI2QString(e.name.toString() + " (" + PIString::fromNumber(e.value) + ")"));
|
||||||
|
#else
|
||||||
cb->setText(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"));
|
cb->setText(PI2QString(e.name + " (" + PIString::fromNumber(e.value) + ")"));
|
||||||
|
#endif
|
||||||
cb->setProperty("__value", e.value);
|
cb->setProperty("__value", e.value);
|
||||||
ui->layoutOptions->addWidget(cb);
|
ui->layoutOptions->addWidget(cb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ int main(int argc, char * argv[]) {
|
|||||||
QPIConfig cfg(a.arguments()[1]);
|
QPIConfig cfg(a.arguments()[1]);
|
||||||
QByteArray model = cfg.getValue("connectionmodel").toByteArray();
|
QByteArray model = cfg.getValue("connectionmodel").toByteArray();
|
||||||
if (!model.isEmpty()) w.setModel(model);
|
if (!model.isEmpty()) w.setModel(model);
|
||||||
}
|
} else
|
||||||
|
w.recreateConnection();
|
||||||
if (w.exec() == QDialog::Accepted) {
|
if (w.exec() == QDialog::Accepted) {
|
||||||
QString c = QFileDialog::getSaveFileName(&w, "Save config to file", a.applicationDirPath(), "*.conf");
|
QString c = QFileDialog::getSaveFileName(&w, "Save config to file", a.applicationDirPath(), "*.conf");
|
||||||
if (!c.isEmpty()) {
|
if (!c.isEmpty()) {
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ QPIIntrospector::QPIIntrospector(QWidget * parent): EMainWindow(parent), peer("_
|
|||||||
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIntrospection::InfoTypes");
|
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIntrospection::InfoTypes");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
QCheckBox * cb = new QCheckBox(PI2QString(e.name.mid(2).toString()));
|
||||||
|
#else
|
||||||
QCheckBox * cb = new QCheckBox(PI2QString(e.name.mid(2)));
|
QCheckBox * cb = new QCheckBox(PI2QString(e.name.mid(2)));
|
||||||
|
#endif
|
||||||
cb->setObjectName(QString("checkRequest%1").arg(e.value));
|
cb->setObjectName(QString("checkRequest%1").arg(e.value));
|
||||||
cb->setProperty("__value__", e.value);
|
cb->setProperty("__value__", e.value);
|
||||||
layoutRequestFlags->addWidget(cb);
|
layoutRequestFlags->addWidget(cb);
|
||||||
|
|||||||
@@ -25,7 +25,11 @@ ThreadsModel::ThreadsModel() {
|
|||||||
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIntrospectionThreads::ThreadState");
|
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIntrospectionThreads::ThreadState");
|
||||||
if (ei) {
|
if (ei) {
|
||||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,39,0)
|
||||||
|
state_names[e.value] = PI2QString(e.name.mid(1).toString());
|
||||||
|
#else
|
||||||
state_names[e.value] = PI2QString(e.name.mid(1));
|
state_names[e.value] = PI2QString(e.name.mid(1));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state_colors[PIIntrospectionThreads::sStopped] = QColor(Qt::red).lighter(150);
|
state_colors[PIIntrospectionThreads::sStopped] = QColor(Qt::red).lighter(150);
|
||||||
|
|||||||
Reference in New Issue
Block a user