git-svn-id: svn://db.shs.com.ru/libs@94 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -16,7 +16,7 @@ if (DEBUG)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
endif ()
|
||||
set(CPPS_UTILS "kx_coeffs.cpp")
|
||||
set(HDRS_UTILS "kx_coeffs.h" "kx_protocol_x.h")
|
||||
set(HDRS_UTILS "kx_coeffs.h" "kx_protocol_x.h" "kx_protocol_c.h")
|
||||
if (DEFINED ENV{QNX_HOST})
|
||||
add_library(${PROJECT_NAME} STATIC ${CPPS_UTILS})
|
||||
else ()
|
||||
|
||||
@@ -90,6 +90,7 @@ void KX_Coefficients::sendCoeffs() {
|
||||
memcpy(k_protocol->to_k.coeffs, k_content.data(k_protocol->to_k.first_index), curcnt);
|
||||
//for (int j = 0; j < curcnt; j++) k_protocol->to_k.coeffs[j] = K.at(k_protocol->to_k.first_index + j);
|
||||
k_protocol->send();
|
||||
piMSleep(5);
|
||||
}
|
||||
//cout << "waiting for commit ...\n";
|
||||
waitingCommit = true;
|
||||
|
||||
126
kx_utils/kx_protocol_c.h
Normal file
126
kx_utils/kx_protocol_c.h
Normal file
@@ -0,0 +1,126 @@
|
||||
#ifndef KX_PROTOCOL_C_H
|
||||
#define KX_PROTOCOL_C_H
|
||||
|
||||
#include "piprotocol.h"
|
||||
|
||||
|
||||
#pragma pack (push, 1)
|
||||
|
||||
|
||||
struct KX_C_Header {
|
||||
uchar type;
|
||||
uchar addr_to;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct KX_C_Command: KX_C_Header {
|
||||
KX_C_Command() {command = -1;}
|
||||
int command;
|
||||
uint checksum;
|
||||
};
|
||||
|
||||
|
||||
struct KX_C_Event: KX_C_Header {
|
||||
KX_C_Event() {event = -1;}
|
||||
PISystemTime time;
|
||||
int event;
|
||||
uint checksum;
|
||||
};
|
||||
|
||||
|
||||
#pragma pack (pop)
|
||||
|
||||
|
||||
// Client side
|
||||
|
||||
class KX_Protocol_C: public PIProtocol
|
||||
{
|
||||
PIOBJECT_SUBCLASS(KX_Protocol_C, PIProtocol)
|
||||
public:
|
||||
KX_Protocol_C(const PIString & config, const PIString & name = "c"): PIProtocol(config, name, &from_buff, 2, &(from_buff.command), sizeof(from_buff) - 2, &to_pult, sizeof(to_pult)) {
|
||||
PIConfig conf(config, PIIODevice::ReadOnly);
|
||||
PIConfig::Entry ce = conf.getValue(name);
|
||||
to_pult.type = from_buff.type = ce.getValue("type", 0xC);
|
||||
to_pult.addr_to = ce.getValue("addr_pult", 0x15);
|
||||
from_buff.addr_to = ce.getValue("addr_c", 0x75);
|
||||
from_pult = from_buff;
|
||||
packetExtractor()->setSplitMode(PIPacketExtractor::Header);
|
||||
packetExtractor()->setHeader(PIByteArray(&from_buff, 2));
|
||||
startReceive();
|
||||
}
|
||||
|
||||
void sendEvent(int ev) {
|
||||
to_pult.time = PISystemTime::current();
|
||||
to_pult.event = ev;
|
||||
send();
|
||||
}
|
||||
EVENT1(commandReceived, int, command)
|
||||
|
||||
KX_C_Command from_pult;
|
||||
KX_C_Event to_pult;
|
||||
|
||||
private:
|
||||
bool validate() {
|
||||
if (checksum_i(&from_buff, sizeof(from_buff) - 4) != from_buff.checksum) return false;
|
||||
from_pult = from_buff;
|
||||
commandReceived(from_pult.command);
|
||||
return true;
|
||||
}
|
||||
bool aboutSend() {
|
||||
to_pult.checksum = checksum_i(&to_pult, sizeof(to_pult) - 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
KX_C_Command from_buff;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Pult side
|
||||
|
||||
class __KX_Protocol_C: public PIProtocol
|
||||
{
|
||||
PIOBJECT_SUBCLASS(__KX_Protocol_C, PIProtocol)
|
||||
public:
|
||||
__KX_Protocol_C(const PIString & config, const PIString & name): PIProtocol(config, name, &from_buff, 2, &(from_buff.time), sizeof(from_buff) - 2, &to_c, sizeof(to_c)) {
|
||||
PIConfig conf(config, PIIODevice::ReadOnly);
|
||||
PIConfig::Entry ce = conf.getValue(name);
|
||||
to_c.type = from_buff.type = ce.getValue("type", 0xC);
|
||||
to_c.addr_to = ce.getValue("addr_c", 0x75);
|
||||
from_buff.addr_to = ce.getValue("addr_pult", 0x15);
|
||||
from_c = from_buff;
|
||||
packetExtractor()->setSplitMode(PIPacketExtractor::Header);
|
||||
packetExtractor()->setHeader(PIByteArray(&from_buff, 2));
|
||||
startReceive();
|
||||
}
|
||||
|
||||
void sendCommand(int cmd) {
|
||||
to_c.command = cmd;
|
||||
send();
|
||||
}
|
||||
EVENT2(eventReceived, int, event, PISystemTime, time)
|
||||
|
||||
KX_C_Event from_c;
|
||||
KX_C_Command to_c;
|
||||
|
||||
private:
|
||||
bool validate() {
|
||||
if (checksum_i(&from_buff, sizeof(from_buff) - 4) != from_buff.checksum) return false;
|
||||
from_c = from_buff;
|
||||
eventReceived(from_c.event, from_c.time);
|
||||
return true;
|
||||
}
|
||||
bool aboutSend() {
|
||||
//piCout << "send command" << to_c.command;
|
||||
to_c.checksum = checksum_i(&to_c, sizeof(to_c) - 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
KX_C_Event from_buff;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // KX_PROTOCOL_C_H
|
||||
@@ -45,7 +45,8 @@ bool XCheck::eventFilter(QObject * o, QEvent * e) {
|
||||
|
||||
|
||||
|
||||
KX_Pult::KX_Pult(): QMainWindow(), config_("kx_pult.conf"), name_("x"), config(piqt(config_), QIODevice::ReadWrite), coeffs(config_, "k", true) {
|
||||
KX_Pult::KX_Pult(): QMainWindow(), config_("kx_pult.conf"), name_x("x"), name_c("c"),
|
||||
config(piqt(config_), QIODevice::ReadWrite), coeffs(config_, "k", true) {
|
||||
//cout << sizeof(coeffsK.k_protocol->to_k) << endl;
|
||||
ui = new Ui::KX_Pult();
|
||||
ui->setupUi(this);
|
||||
@@ -53,8 +54,12 @@ KX_Pult::KX_Pult(): QMainWindow(), config_("kx_pult.conf"), name_("x"), config(p
|
||||
ui->configWidget->expandAll();
|
||||
ui->list->viewport()->installEventFilter(this);
|
||||
ui->treeK->viewport()->installEventFilter(this);
|
||||
ui->scrollArea->setAutoFillBackground(false);
|
||||
ui->scrollAreaWidgetContents->setAutoFillBackground(false);
|
||||
ui->widget->setAutoFillBackground(false);
|
||||
log_menu.addAction(ui->actionClear);
|
||||
prot_x = 0;
|
||||
prot_c = 0;
|
||||
show_x = config.getValue("show_x", true);
|
||||
if (!show_x)
|
||||
ui->tabWidget->removeTab(1);
|
||||
@@ -121,6 +126,7 @@ KX_Pult::KX_Pult(): QMainWindow(), config_("kx_pult.conf"), name_("x"), config(p
|
||||
connect(ui->lineKSearch, SIGNAL(textChanged(QString)), this, SLOT(filterTree()));
|
||||
session.load();
|
||||
updateKDesc();
|
||||
updateCDesc();
|
||||
timer_diag.start(40);
|
||||
timer_update = startTimer(25);
|
||||
}
|
||||
@@ -133,11 +139,13 @@ KX_Pult::~KX_Pult() {
|
||||
|
||||
void KX_Pult::loading(QPIConfig & conf) {
|
||||
kdesc_file = conf.getValue("kdesc_file").stringValue();
|
||||
cdesc_file = conf.getValue("cdesc_file").stringValue();
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::saving(QPIConfig & conf) {
|
||||
conf.setValue("kdesc_file", kdesc_file);
|
||||
conf.setValue("cdesc_file", cdesc_file);
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +411,7 @@ void KX_Pult::on_buttonResize_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::on_buttonSetDesc_clicked() {
|
||||
void KX_Pult::on_buttonSetKDesc_clicked() {
|
||||
QString ret = QFileDialog::getOpenFileName(this, trUtf8("Select *.h file with K description"), kdesc_file, "C/C++ header files(*.h *.hpp);;All files(*)");
|
||||
if (ret.isEmpty()) return;
|
||||
kdesc_file = QDir::current().relativeFilePath(ret);
|
||||
@@ -411,6 +419,14 @@ void KX_Pult::on_buttonSetDesc_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::on_buttonSetCDesc_clicked() {
|
||||
QString ret = QFileDialog::getOpenFileName(this, trUtf8("Select *.h file with C description"), cdesc_file, "C/C++ header files(*.h *.hpp);;All files(*)");
|
||||
if (ret.isEmpty()) return;
|
||||
cdesc_file = QDir::current().relativeFilePath(ret);
|
||||
updateCDesc();
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::on_spinSize_valueChanged(int) {
|
||||
ui->spinSize->setStyleSheet("");
|
||||
}
|
||||
@@ -462,7 +478,6 @@ void KX_Pult::updateGraph() {
|
||||
|
||||
|
||||
void KX_Pult::updateDiag() {
|
||||
|
||||
ui->labelKReceiver->setText(piqt(coeffs.k_protocol->receiverDeviceName() + " - " + coeffs.k_protocol->receiverDeviceState()));
|
||||
ui->labelKSender->setText(piqt(coeffs.k_protocol->senderDeviceName()));
|
||||
ui->spinKSended->setValue(coeffs.k_protocol->sendCount());
|
||||
@@ -483,22 +498,31 @@ void KX_Pult::updateDiag() {
|
||||
ui->labelXAddrPult->setText("0x" + QString::number(prot_x->from_x.addr_to, 16).toUpper().rightJustified(2, '0'));
|
||||
ui->labelXAddr->setText("0x" + QString::number(prot_x->to_x.addr_to, 16).toUpper().rightJustified(2, '0'));
|
||||
|
||||
ui->labelCReceiver->setText(piqt(prot_c->receiverDeviceName() + " - " + prot_c->receiverDeviceState()));
|
||||
ui->labelCSender->setText(piqt(prot_c->senderDeviceName()));
|
||||
ui->spinCSended->setValue(prot_c->sendCount());
|
||||
ui->spinCReceived->setValue(prot_c->receiveCount());
|
||||
ui->spinCWrong->setValue(prot_c->wrongCount());
|
||||
ui->spinCMissed->setValue(prot_c->missedCount());
|
||||
ui->labelCType->setText("0x" + QString::number(prot_c->from_c.type, 16).toUpper().rightJustified(2, '0'));
|
||||
ui->labelCAddrPult->setText("0x" + QString::number(prot_c->from_c.addr_to, 16).toUpper().rightJustified(2, '0'));
|
||||
ui->labelCAddr->setText("0x" + QString::number(prot_c->to_c.addr_to, 16).toUpper().rightJustified(2, '0'));
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateKDesc(bool ask_move) {
|
||||
kdesc.clear();
|
||||
QFile f(kdesc_file);
|
||||
int KX_Pult::parseHeader(const QString & file, QMap<int, KX_Pult::KDesc> & map) {
|
||||
map.clear();
|
||||
QFile f(file);
|
||||
if (!f.open(QIODevice::ReadOnly)) {
|
||||
updateTree();
|
||||
addToList(trUtf8("Update descriptions from \"%1\": error").arg(kdesc_file), Qt::darkRed);
|
||||
return;
|
||||
addToList(trUtf8("Update descriptions from \"%1\": error").arg(file), Qt::darkRed);
|
||||
return 0;
|
||||
}
|
||||
addToList(trUtf8("Update descriptions from \"%1\"").arg(kdesc_file), Qt::darkMagenta);
|
||||
addToList(trUtf8("Update descriptions from \"%1\"").arg(file), Qt::darkMagenta);
|
||||
QTextStream s(&f);
|
||||
int cind = -1;
|
||||
bool found = false;
|
||||
//qDebug() << "\nparse" << kdesc_file;
|
||||
//qDebug() << "\nparse" << file;
|
||||
while (!s.atEnd()) {
|
||||
QString line = s.readLine().trimmed(), num, name, type, comment;
|
||||
int i = line.indexOf("//");
|
||||
@@ -532,10 +556,16 @@ void KX_Pult::updateKDesc(bool ask_move) {
|
||||
kd.name = name;
|
||||
kd.type = type;
|
||||
kd.comment = comment;
|
||||
kdesc[kd.index] = kd;
|
||||
map[kd.index] = kd;
|
||||
//qDebug() << name << cind << type << comment;
|
||||
}
|
||||
cind++;
|
||||
return cind;
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateKDesc(bool ask_move) {
|
||||
int cind = parseHeader(kdesc_file, kdesc);
|
||||
if (K.size_s() < cind) {
|
||||
ui->spinSize->setValue(cind);
|
||||
ui->spinSize->setStyleSheet("background-color: rgb(220, 220, 255);");
|
||||
@@ -547,6 +577,12 @@ void KX_Pult::updateKDesc(bool ask_move) {
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateCDesc() {
|
||||
parseHeader(cdesc_file, cdesc);
|
||||
updateCommands();
|
||||
}
|
||||
|
||||
|
||||
bool stringComp(const QString & s1, const QString & s2) {
|
||||
if (s1.size() != s2.size())
|
||||
return s1.size() > s2.size();
|
||||
@@ -608,6 +644,25 @@ void KX_Pult::updateTree(bool move) {
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::updateCommands() {
|
||||
while (ui->layoutCommands->count() > 0)
|
||||
delete ui->layoutCommands->itemAt(0)->widget();
|
||||
QMapIterator<int, KDesc> it(cdesc);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
KDesc kd = it.value();
|
||||
QPushButton * b = new QPushButton();
|
||||
QString text = kd.name;
|
||||
if (!kd.comment.isEmpty())
|
||||
text += QString("\n(%1)").arg(kd.comment);
|
||||
b->setText(text);
|
||||
b->setProperty("_command", kd.index);
|
||||
connect(b, SIGNAL(clicked()), this, SLOT(commandClicked()));
|
||||
ui->layoutCommands->addWidget(b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::filterTree() {
|
||||
bool he = ui->checkKHideEmpty->isChecked();
|
||||
bool hn = ui->checkKHideNormal->isChecked();
|
||||
@@ -763,7 +818,12 @@ void KX_Pult::renew(bool write) {
|
||||
prot_x->stop();
|
||||
delete prot_x;
|
||||
}
|
||||
prot_x = new __KX_Protocol_X(config_, name_);
|
||||
if (prot_c != 0) {
|
||||
prot_c->stop();
|
||||
delete prot_c;
|
||||
}
|
||||
prot_x = new __KX_Protocol_X(config_, name_x);
|
||||
prot_c = new __KX_Protocol_C(config_, name_c);
|
||||
ui->graphic->setAutoXIncrement(prot_x->expectedFrequency() > 0. ? 1. / prot_x->expectedFrequency() : 1.);
|
||||
coeffs.renew();
|
||||
CONNECT1(void, bool, prot_x, received, this, received);
|
||||
@@ -778,3 +838,10 @@ void KX_Pult::toggledX(int index, bool on) {
|
||||
void KX_Pult::changedX(int index, int num) {
|
||||
prot_x->to_x.x_num[index] = num;
|
||||
}
|
||||
|
||||
|
||||
void KX_Pult::commandClicked() {
|
||||
QPushButton * b = qobject_cast<QPushButton*>(sender());
|
||||
if (!b) return;
|
||||
prot_c->sendCommand(b->property("_command").toInt());
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <QLabel>
|
||||
#include "kx_coeffs.h"
|
||||
#include "kx_protocol_x.h"
|
||||
#include "kx_protocol_c.h"
|
||||
#include "piqt.h"
|
||||
#include "session_manager.h"
|
||||
#include "qpievaluator.h"
|
||||
@@ -80,6 +81,7 @@ private:
|
||||
void progress(int val, int max);
|
||||
void clearSelected();
|
||||
QString typeName(const QString & n) const;
|
||||
int parseHeader(const QString & file, QMap<int, KDesc> & map);
|
||||
|
||||
EVENT_HANDLER1(void, received, bool, ok);
|
||||
EVENT_HANDLER(void, pip_sendFailed) {emit q_k_sendFailed();}
|
||||
@@ -91,15 +93,15 @@ private:
|
||||
QVector<QLabel * > values;
|
||||
|
||||
Ui::KX_Pult * ui;
|
||||
PIString config_, name_;
|
||||
PIString config_, name_x, name_c;
|
||||
QDir dir;
|
||||
QString outdir, kdesc_file;
|
||||
QString outdir, kdesc_file, cdesc_file;
|
||||
QFile file;
|
||||
QTime tm, ctm;
|
||||
QIcon icon_record, icon_stop;
|
||||
QTextStream stream;
|
||||
QTimer timer_diag;
|
||||
QMap<int, KDesc> kdesc;
|
||||
QMap<int, KDesc> kdesc, cdesc;
|
||||
QMap<QString, int> knames;
|
||||
QSet<int> calculated;
|
||||
QStringList knames_sort;
|
||||
@@ -110,6 +112,7 @@ private:
|
||||
//QVector<float> k, x;
|
||||
KX_Coefficients coeffs;
|
||||
__KX_Protocol_X * prot_x;
|
||||
__KX_Protocol_C * prot_c;
|
||||
int csize, wcnt, timer, timer_update, clear_target;
|
||||
bool needWrite, isPause, need_update, show_x;
|
||||
|
||||
@@ -119,12 +122,15 @@ private slots:
|
||||
void updateGraph();
|
||||
void updateDiag();
|
||||
void updateKDesc(bool ask_move = false);
|
||||
void updateCDesc();
|
||||
void updateTree(bool move = false);
|
||||
void updateCommands();
|
||||
void filterTree();
|
||||
void calculate();
|
||||
void renew(bool write = true);
|
||||
void toggledX(int index, bool on);
|
||||
void changedX(int index, int num);
|
||||
void commandClicked();
|
||||
void k_sendFailed();
|
||||
void k_sendSucceed();
|
||||
void k_receiveFailed();
|
||||
@@ -137,8 +143,10 @@ private slots:
|
||||
void on_buttonRead_clicked();
|
||||
void on_buttonWrite_clicked();
|
||||
void on_buttonResize_clicked();
|
||||
void on_buttonSetDesc_clicked();
|
||||
void on_buttonReparseDesc_clicked() {updateKDesc(true);}
|
||||
void on_buttonSetKDesc_clicked();
|
||||
void on_buttonReparseKDesc_clicked() {updateKDesc(true);}
|
||||
void on_buttonSetCDesc_clicked();
|
||||
void on_buttonReparseCDesc_clicked() {updateCDesc();}
|
||||
void on_buttonCalculate_clicked() {calculate();}
|
||||
void on_buttonApply_clicked() {renew();}
|
||||
void on_spinSize_valueChanged(int);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1142</width>
|
||||
<height>598</height>
|
||||
<width>1034</width>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -28,7 +28,7 @@
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="buttonReparseDesc">
|
||||
<widget class="QPushButton" name="buttonReparseKDesc">
|
||||
<property name="text">
|
||||
<string>Reparse K desc</string>
|
||||
</property>
|
||||
@@ -119,7 +119,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="buttonSetDesc">
|
||||
<widget class="QPushButton" name="buttonSetKDesc">
|
||||
<property name="text">
|
||||
<string>Set K desc file ...</string>
|
||||
</property>
|
||||
@@ -392,6 +392,114 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Commands (C)</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSetCDesc">
|
||||
<property name="text">
|
||||
<string>Set C desc file ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="kx_pult.qrc">
|
||||
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonReparseCDesc">
|
||||
<property name="text">
|
||||
<string>Reparse C desc</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="kx_pult.qrc">
|
||||
<normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupCommands">
|
||||
<property name="title">
|
||||
<string>Commands</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="layout_">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>851</width>
|
||||
<height>462</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QVBoxLayout" name="layoutCommands"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>66</width>
|
||||
<height>441</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Graphics (X)</string>
|
||||
@@ -941,6 +1049,174 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>C</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>receiver:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="labelCReceiver">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>sender:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="labelCSender">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelKType_7">
|
||||
<property name="text">
|
||||
<string>type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="labelCType">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelKType_8">
|
||||
<property name="text">
|
||||
<string>address C:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="labelKType_9">
|
||||
<property name="text">
|
||||
<string>address pult:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="labelCAddrPult">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>sended count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="spinCSended">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>received count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="spinCReceived">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>wrong received count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="spinCWrong">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="labelCAddr">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>missed received count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="spinCMissed">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
|
||||
@@ -13,6 +13,9 @@ class QRectEdit: public QWidget
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QRectF value READ value WRITE setValue)
|
||||
Q_PROPERTY(int decimals READ decimals WRITE setDecimals)
|
||||
Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
|
||||
Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
|
||||
Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
|
||||
|
||||
public:
|
||||
explicit QRectEdit(QWidget * parent = 0);
|
||||
@@ -20,10 +23,16 @@ public:
|
||||
|
||||
QRectF value() const {return QRectF(s_x->value(), s_y->value(), s_w->value(), s_h->value());}
|
||||
int decimals() const {return s_x->decimals();}
|
||||
double maximum() const {return s_x->maximum();}
|
||||
double minimum() const {return s_x->minimum();}
|
||||
double singleStep() const {return s_x->singleStep();}
|
||||
|
||||
public slots:
|
||||
void setValue(QRectF v) {s_x->setValue(v.x()); s_y->setValue(v.y()); s_w->setValue(v.width()); s_h->setValue(v.height());}
|
||||
void setDecimals(int d) {s_x->setDecimals(d); s_y->setDecimals(d); s_w->setDecimals(d); s_h->setDecimals(d);}
|
||||
void setMaximum(double m) {s_x->setMaximum(m); s_y->setMaximum(m); s_w->setMaximum(m); s_h->setMaximum(m);}
|
||||
void setMinimum(double m) {s_x->setMinimum(m); s_y->setMinimum(m); s_w->setMinimum(m); s_h->setMinimum(m);}
|
||||
void setSingleStep(double m) {s_x->setSingleStep(m); s_y->setSingleStep(m); s_w->setSingleStep(m); s_h->setSingleStep(m);}
|
||||
|
||||
private:
|
||||
virtual void changeEvent(QEvent * e);
|
||||
|
||||
Reference in New Issue
Block a user