git-svn-id: svn://db.shs.com.ru/libs@231 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -121,7 +121,7 @@ void CDCore::k_parse(PIIODevice * d) {
|
|||||||
void CDCore::k_update(PIIODevice * d) {
|
void CDCore::k_update(PIIODevice * d) {
|
||||||
CDSection uk = k_;
|
CDSection uk = k_;
|
||||||
k_parse(d);
|
k_parse(d);
|
||||||
bool kn = false;
|
bool kn = true;
|
||||||
if (!uk.isEmpty())
|
if (!uk.isEmpty())
|
||||||
if (!uk.isSameStructure(k_)) {
|
if (!uk.isSameStructure(k_)) {
|
||||||
piCout << "ask for save names";
|
piCout << "ask for save names";
|
||||||
@@ -131,6 +131,7 @@ void CDCore::k_update(PIIODevice * d) {
|
|||||||
//piCout << k_.count() << uk.count();
|
//piCout << k_.count() << uk.count();
|
||||||
k_ = uk;
|
k_ = uk;
|
||||||
k_.makePath();
|
k_.makePath();
|
||||||
|
k_.calculate();
|
||||||
K_ChangedGlobal();
|
K_ChangedGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +189,13 @@ void CDUtils::CDCore::dataReceived(const PIString & from, const PIByteArray & da
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CDCore * CDCore::instance() {
|
||||||
|
/*static CDCore * ret = new CDCore();
|
||||||
|
return ret;*/
|
||||||
|
return __Core_Initializer__::__instance__;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CDCore::K_Send() {
|
void CDCore::K_Send() {
|
||||||
piCoutObj << "K_Send";
|
piCoutObj << "K_Send";
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CDCore: public PIObject
|
|||||||
friend class CDSection;
|
friend class CDSection;
|
||||||
friend class KInterface;
|
friend class KInterface;
|
||||||
public:
|
public:
|
||||||
static CDCore * instance() {return __Core_Initializer__::__instance__;}
|
static CDCore * instance();
|
||||||
|
|
||||||
EVENT(K_Sended)
|
EVENT(K_Sended)
|
||||||
EVENT(K_SendFail)
|
EVENT(K_SendFail)
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
|
|
||||||
using namespace CDUtils;
|
using namespace CDUtils;
|
||||||
|
|
||||||
|
KInterface K;
|
||||||
|
|
||||||
|
|
||||||
KInterface::KInterface() {
|
KInterface::KInterface() {
|
||||||
core = CDCore::instance();
|
core = CDCore::instance();
|
||||||
//piCoutObj << core;
|
//piCoutObj << (void*)this << core;
|
||||||
k_file = PIStringAscii("k.dat");
|
k_file = PIStringAscii("k.dat");
|
||||||
k_file_size = 0;
|
k_file_size = 0;
|
||||||
CONNECTU(core, K_Sended, this, sended);
|
CONNECTU(core, K_Sended, this, sended);
|
||||||
@@ -35,11 +37,13 @@ CDType & KInterface::operator [](const PIString & name_) {
|
|||||||
|
|
||||||
|
|
||||||
CDType & KInterface::operator [](int v) {
|
CDType & KInterface::operator [](int v) {
|
||||||
|
//piCout << (void*)this << "[]" << core;
|
||||||
return core->k_[v];
|
return core->k_[v];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const CDType KInterface::operator [](int v) const {
|
const CDType KInterface::operator [](int v) const {
|
||||||
|
//piCout << (void*)this << "[]" << core;
|
||||||
return core->k_[v];
|
return core->k_[v];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static KInterface K;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern CDUtils::KInterface K;
|
||||||
|
|
||||||
#endif // CDUTILS_K_H
|
#endif // CDUTILS_K_H
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
|
|||||||
comment.cutLeft(en.size_s() + 2).trim();
|
comment.cutLeft(en.size_s() + 2).trim();
|
||||||
ck.setEnumValues(sections.value(en).enumValues());
|
ck.setEnumValues(sections.value(en).enumValues());
|
||||||
ck.setComment(comment);
|
ck.setComment(comment);
|
||||||
piCout << "enum" << en << ck.enumValues();
|
//piCout << "enum" << en << ck.enumValues();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cs[cev] = ck;
|
cs[cev] = ck;
|
||||||
|
|||||||
@@ -301,7 +301,6 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
|
|||||||
if (k.isEmpty() && s.isEmpty()) return;
|
if (k.isEmpty() && s.isEmpty()) return;
|
||||||
// piCout << "[CDSection] write start";
|
// piCout << "[CDSection] write start";
|
||||||
PIString l;
|
PIString l;
|
||||||
if (!k.isEmpty()) {
|
|
||||||
if (prefix.isEmpty()) l = "[k]";
|
if (prefix.isEmpty()) l = "[k]";
|
||||||
else l = "[" + prefix + ".k]";
|
else l = "[" + prefix + ".k]";
|
||||||
l += "\n";
|
l += "\n";
|
||||||
@@ -327,7 +326,6 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
|
|||||||
d->write(l.toUTF8());
|
d->write(l.toUTF8());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
if (prefix.isEmpty()) l = "s";
|
if (prefix.isEmpty()) l = "s";
|
||||||
else l = prefix + ".s";
|
else l = prefix + ".s";
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ message(STATUS "Building ${PROJECT_NAME}")
|
|||||||
if (NOT DEFINED ENV{QNX_HOST})
|
if (NOT DEFINED ENV{QNX_HOST})
|
||||||
if (KX_PULT)
|
if (KX_PULT)
|
||||||
find_package(Qt4 REQUIRED)
|
find_package(Qt4 REQUIRED)
|
||||||
|
find_package(QAD REQUIRED)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
include_directories(${QT_INCLUDES})
|
include_directories(${QT_INCLUDES} ${QAD_INCLUDES})
|
||||||
set(CPPS "kx_pult.cpp" "kx_pult.h" "kx_pult.ui" "main_kx_pult.cpp")
|
set(CPPS "kx_pult.cpp" "kx_pult.h" "kx_pult.ui" "main_kx_pult.cpp")
|
||||||
set(MOCS "kx_pult.h")
|
set(MOCS "kx_pult.h")
|
||||||
file(GLOB UIS "*.ui")
|
file(GLOB UIS "*.ui")
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ void ConnectionEdit::selectionChanged() {
|
|||||||
ui->lineDevice->setText(di->name());
|
ui->lineDevice->setText(di->name());
|
||||||
ui->linePath->setEditText(di->path());
|
ui->linePath->setEditText(di->path());
|
||||||
ui->spinDeviceDT->setValue(di->disconnectTimeout());
|
ui->spinDeviceDT->setValue(di->disconnectTimeout());
|
||||||
|
ui->spinDeviceBS->setValue(di->bufferSize());
|
||||||
setOptions(di->options());
|
setOptions(di->options());
|
||||||
}
|
}
|
||||||
if (type == __CV_Filter) {
|
if (type == __CV_Filter) {
|
||||||
@@ -198,6 +199,7 @@ void ConnectionEdit::selectionChanged() {
|
|||||||
ui->spinTimeout->setValue(fi->timeout());
|
ui->spinTimeout->setValue(fi->timeout());
|
||||||
ui->spinSize->setValue(fi->packetSize());
|
ui->spinSize->setValue(fi->packetSize());
|
||||||
ui->spinFilterDT->setValue(fi->disconnectTimeout());
|
ui->spinFilterDT->setValue(fi->disconnectTimeout());
|
||||||
|
ui->spinFilterBS->setValue(fi->bufferSize());
|
||||||
}
|
}
|
||||||
if (type == __CV_Sender) {
|
if (type == __CV_Sender) {
|
||||||
ui->tabWidget->setCurrentIndex(2);
|
ui->tabWidget->setCurrentIndex(2);
|
||||||
@@ -219,6 +221,7 @@ void ConnectionEdit::applyFilter(FilterItem * b) {
|
|||||||
b->setTimeout(ui->spinTimeout->value());
|
b->setTimeout(ui->spinTimeout->value());
|
||||||
b->setPacketSize(ui->spinSize->value());
|
b->setPacketSize(ui->spinSize->value());
|
||||||
b->setDisconnectTimeout(ui->spinFilterDT->value());
|
b->setDisconnectTimeout(ui->spinFilterDT->value());
|
||||||
|
b->setBufferSize(ui->spinFilterBS->value());
|
||||||
recreateConnection();
|
recreateConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,6 +236,7 @@ void ConnectionEdit::applyDevice(DeviceItem * b) {
|
|||||||
b->setOptions(PIIODevice::DeviceOptions(getOptions()));
|
b->setOptions(PIIODevice::DeviceOptions(getOptions()));
|
||||||
b->setPath(ui->linePath->currentText());
|
b->setPath(ui->linePath->currentText());
|
||||||
b->setDisconnectTimeout(ui->spinDeviceDT->value());
|
b->setDisconnectTimeout(ui->spinDeviceDT->value());
|
||||||
|
b->setBufferSize(ui->spinDeviceBS->value());
|
||||||
recreateConnection();
|
recreateConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,6 +287,7 @@ void ConnectionEdit::recreateConnection() {
|
|||||||
PIIODevice * dev = conn->addDevice(Q2PIString(di->path()), di->mode());
|
PIIODevice * dev = conn->addDevice(Q2PIString(di->path()), di->mode());
|
||||||
if (!dev) continue;
|
if (!dev) continue;
|
||||||
dev->setOptions(di->options());
|
dev->setOptions(di->options());
|
||||||
|
dev->setThreadedReadBufferSize(di->bufferSize());
|
||||||
conn->setDeviceName(dev, Q2PIString(di->name()));
|
conn->setDeviceName(dev, Q2PIString(di->name()));
|
||||||
PIDiagnostics * diag = conn->diagnostic(dev);
|
PIDiagnostics * diag = conn->diagnostic(dev);
|
||||||
if (diag) diag->setDisconnectTimeout(di->disconnectTimeout());
|
if (diag) diag->setDisconnectTimeout(di->disconnectTimeout());
|
||||||
@@ -317,6 +322,7 @@ void ConnectionEdit::recreateConnection() {
|
|||||||
if (name_from.isEmpty()) continue;
|
if (name_from.isEmpty()) continue;
|
||||||
PIPacketExtractor * pe = conn->addFilter(Q2PIString(fi_t->name()),conn->deviceByName(name_from), fi_t->mode());
|
PIPacketExtractor * pe = conn->addFilter(Q2PIString(fi_t->name()),conn->deviceByName(name_from), fi_t->mode());
|
||||||
if (!pe) continue;
|
if (!pe) continue;
|
||||||
|
pe->setBufferSize(fi_t->bufferSize());
|
||||||
pe->setHeader(PIByteArray::fromString(Q2PIString(fi_t->header())));
|
pe->setHeader(PIByteArray::fromString(Q2PIString(fi_t->header())));
|
||||||
pe->setFooter(PIByteArray::fromString(Q2PIString(fi_t->footer())));
|
pe->setFooter(PIByteArray::fromString(Q2PIString(fi_t->footer())));
|
||||||
pe->setTimeout(fi_t->timeout());
|
pe->setTimeout(fi_t->timeout());
|
||||||
|
|||||||
@@ -89,43 +89,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="labelFilter_12">
|
|
||||||
<property name="text">
|
|
||||||
<string>Mode:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QComboBox" name="comboMode"/>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="labelFilter_13">
|
|
||||||
<property name="text">
|
|
||||||
<string>Disconnect
|
|
||||||
timeout:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="spinDeviceDT">
|
|
||||||
<property name="suffix">
|
|
||||||
<string> ms</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>9999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>3.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="EComboBox" name="linePath">
|
<widget class="EComboBox" name="linePath">
|
||||||
<property name="editable">
|
<property name="editable">
|
||||||
@@ -176,6 +139,19 @@ timeout:</string>
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelFilter_12">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mode:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="comboMode"/>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="labelFilter_14">
|
<widget class="QLabel" name="labelFilter_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -193,6 +169,85 @@ timeout:</string>
|
|||||||
</property>
|
</property>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelFilter_13">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disconnect timeout:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="spinDeviceDT">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> ms</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>9999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>3.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelFilter_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>Buffer size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinDeviceBS">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> b</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>4096</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999999999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>1</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -489,6 +544,45 @@ timeout:</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>17</width>
|
||||||
|
<height>17</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelFilter_17">
|
||||||
|
<property name="text">
|
||||||
|
<string>Buffer size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinFilterBS">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> b</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999999999</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>65536</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_7">
|
<spacer name="horizontalSpacer_7">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ public:
|
|||||||
void setMode(PIIODevice::DeviceMode m) {addProperty(BlockItem::Property("mode", "", int(m))); rename();}
|
void setMode(PIIODevice::DeviceMode m) {addProperty(BlockItem::Property("mode", "", int(m))); rename();}
|
||||||
void setOptions(PIIODevice::DeviceOptions o) {addProperty(BlockItem::Property("options", "", int(o))); rename();}
|
void setOptions(PIIODevice::DeviceOptions o) {addProperty(BlockItem::Property("options", "", int(o))); rename();}
|
||||||
void setDisconnectTimeout(double v) {addProperty(BlockItem::Property("disconnectTimeout", "", v)); rename();}
|
void setDisconnectTimeout(double v) {addProperty(BlockItem::Property("disconnectTimeout", "", v)); rename();}
|
||||||
|
void setBufferSize(int v) {addProperty(BlockItem::Property("bufferSize", "", v)); rename();}
|
||||||
|
|
||||||
QString name() const {return propertyByName("name").value.toString();}
|
QString name() const {return propertyByName("name").value.toString();}
|
||||||
QString path() const {return propertyByName("device").value.toString();}
|
QString path() const {return propertyByName("device").value.toString();}
|
||||||
PIIODevice::DeviceMode mode() const {return PIIODevice::DeviceMode(propertyByName("mode").value.toInt());}
|
PIIODevice::DeviceMode mode() const {return PIIODevice::DeviceMode(propertyByName("mode").value.toInt());}
|
||||||
PIIODevice::DeviceOptions options() const {return PIIODevice::DeviceOptions(propertyByName("options").value.toInt());}
|
PIIODevice::DeviceOptions options() const {return PIIODevice::DeviceOptions(propertyByName("options").value.toInt());}
|
||||||
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
||||||
|
int bufferSize() const {return propertyByName("bufferSize").value.toInt();}
|
||||||
|
|
||||||
void rename();
|
void rename();
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ public:
|
|||||||
void setTimeout(double v) {addProperty(BlockItem::Property("timeout", "", v)); rename();}
|
void setTimeout(double v) {addProperty(BlockItem::Property("timeout", "", v)); rename();}
|
||||||
void setPacketSize(int v) {addProperty(BlockItem::Property("size", "", v)); rename();}
|
void setPacketSize(int v) {addProperty(BlockItem::Property("size", "", v)); rename();}
|
||||||
void setDisconnectTimeout(double v) {addProperty(BlockItem::Property("disconnectTimeout", "", v)); rename();}
|
void setDisconnectTimeout(double v) {addProperty(BlockItem::Property("disconnectTimeout", "", v)); rename();}
|
||||||
|
void setBufferSize(int v) {addProperty(BlockItem::Property("bufferSize", "", v)); rename();}
|
||||||
|
|
||||||
QString name() const {return propertyByName("name").value.toString();}
|
QString name() const {return propertyByName("name").value.toString();}
|
||||||
PIPacketExtractor::SplitMode mode() const {return PIPacketExtractor::SplitMode(propertyByName("mode").value.toInt());}
|
PIPacketExtractor::SplitMode mode() const {return PIPacketExtractor::SplitMode(propertyByName("mode").value.toInt());}
|
||||||
@@ -52,6 +55,7 @@ public:
|
|||||||
double timeout() const {return propertyByName("timeout").value.toDouble();}
|
double timeout() const {return propertyByName("timeout").value.toDouble();}
|
||||||
int packetSize() const {return propertyByName("size").value.toInt();}
|
int packetSize() const {return propertyByName("size").value.toInt();}
|
||||||
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
||||||
|
int bufferSize() const {return propertyByName("bufferSize").value.toInt();}
|
||||||
|
|
||||||
void rename();
|
void rename();
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ bool CDKItemModel::setData(const QModelIndex &index, const QVariant &value, int
|
|||||||
CDType t = K.section(item->buildPath())[item->index_];
|
CDType t = K.section(item->buildPath())[item->index_];
|
||||||
if (t.type() == "b") {
|
if (t.type() == "b") {
|
||||||
bool result = item->setData(index.column(), PI2QString(PIString::fromBool(value.toBool())));
|
bool result = item->setData(index.column(), PI2QString(PIString::fromBool(value.toBool())));
|
||||||
|
QModelIndex rin(CDKItemModel::index(index.row(), 3, index.parent()));
|
||||||
|
emit dataChanged(rin, rin);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +105,11 @@ bool CDKItemModel::setData(const QModelIndex &index, const QVariant &value, int
|
|||||||
if (role != Qt::EditRole) return false;
|
if (role != Qt::EditRole) return false;
|
||||||
CDKItem * item = getItem(index);
|
CDKItem * item = getItem(index);
|
||||||
bool result = item->setData(index.column(), value);
|
bool result = item->setData(index.column(), value);
|
||||||
if (result) emit dataChanged(index, index);
|
if (result) {
|
||||||
|
QModelIndex rin(CDKItemModel::index(index.row(), 3, index.parent()));
|
||||||
|
emit dataChanged(rin, rin);
|
||||||
|
emit dataChanged(index, index);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,6 +243,7 @@ QVariant CDKItem::value(CDType t, int role) const {
|
|||||||
bool CDKItem::setData(int column, const QVariant &value) {
|
bool CDKItem::setData(int column, const QVariant &value) {
|
||||||
if ((column == 3 || column == 4) && type_ == ItemCDType) {
|
if ((column == 3 || column == 4) && type_ == ItemCDType) {
|
||||||
K.section(buildPath())[index_].setValue(Q2PIString(value.toString()));
|
K.section(buildPath())[index_].setValue(Q2PIString(value.toString()));
|
||||||
|
K.calculate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ signals:
|
|||||||
void KReceiveFailed();
|
void KReceiveFailed();
|
||||||
void KReceiveSucceed();
|
void KReceiveSucceed();
|
||||||
void messageStatus(QString msg);
|
void messageStatus(QString msg);
|
||||||
void busyStatusChanged(bool bisy);
|
void busyStatusChanged(bool busy);
|
||||||
|
|
||||||
void _qcdk_sendFailed(); // PRIVATE
|
void _qcdk_sendFailed(); // PRIVATE
|
||||||
void _qcdk_sendSucceed(); // PRIVATE
|
void _qcdk_sendSucceed(); // PRIVATE
|
||||||
|
|||||||
Reference in New Issue
Block a user