git-svn-id: svn://db.shs.com.ru/libs@231 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -181,6 +181,7 @@ void ConnectionEdit::selectionChanged() {
|
||||
ui->lineDevice->setText(di->name());
|
||||
ui->linePath->setEditText(di->path());
|
||||
ui->spinDeviceDT->setValue(di->disconnectTimeout());
|
||||
ui->spinDeviceBS->setValue(di->bufferSize());
|
||||
setOptions(di->options());
|
||||
}
|
||||
if (type == __CV_Filter) {
|
||||
@@ -198,6 +199,7 @@ void ConnectionEdit::selectionChanged() {
|
||||
ui->spinTimeout->setValue(fi->timeout());
|
||||
ui->spinSize->setValue(fi->packetSize());
|
||||
ui->spinFilterDT->setValue(fi->disconnectTimeout());
|
||||
ui->spinFilterBS->setValue(fi->bufferSize());
|
||||
}
|
||||
if (type == __CV_Sender) {
|
||||
ui->tabWidget->setCurrentIndex(2);
|
||||
@@ -219,6 +221,7 @@ void ConnectionEdit::applyFilter(FilterItem * b) {
|
||||
b->setTimeout(ui->spinTimeout->value());
|
||||
b->setPacketSize(ui->spinSize->value());
|
||||
b->setDisconnectTimeout(ui->spinFilterDT->value());
|
||||
b->setBufferSize(ui->spinFilterBS->value());
|
||||
recreateConnection();
|
||||
}
|
||||
|
||||
@@ -233,6 +236,7 @@ void ConnectionEdit::applyDevice(DeviceItem * b) {
|
||||
b->setOptions(PIIODevice::DeviceOptions(getOptions()));
|
||||
b->setPath(ui->linePath->currentText());
|
||||
b->setDisconnectTimeout(ui->spinDeviceDT->value());
|
||||
b->setBufferSize(ui->spinDeviceBS->value());
|
||||
recreateConnection();
|
||||
}
|
||||
|
||||
@@ -283,6 +287,7 @@ void ConnectionEdit::recreateConnection() {
|
||||
PIIODevice * dev = conn->addDevice(Q2PIString(di->path()), di->mode());
|
||||
if (!dev) continue;
|
||||
dev->setOptions(di->options());
|
||||
dev->setThreadedReadBufferSize(di->bufferSize());
|
||||
conn->setDeviceName(dev, Q2PIString(di->name()));
|
||||
PIDiagnostics * diag = conn->diagnostic(dev);
|
||||
if (diag) diag->setDisconnectTimeout(di->disconnectTimeout());
|
||||
@@ -317,6 +322,7 @@ void ConnectionEdit::recreateConnection() {
|
||||
if (name_from.isEmpty()) continue;
|
||||
PIPacketExtractor * pe = conn->addFilter(Q2PIString(fi_t->name()),conn->deviceByName(name_from), fi_t->mode());
|
||||
if (!pe) continue;
|
||||
pe->setBufferSize(fi_t->bufferSize());
|
||||
pe->setHeader(PIByteArray::fromString(Q2PIString(fi_t->header())));
|
||||
pe->setFooter(PIByteArray::fromString(Q2PIString(fi_t->footer())));
|
||||
pe->setTimeout(fi_t->timeout());
|
||||
|
||||
@@ -89,43 +89,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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">
|
||||
<widget class="EComboBox" name="linePath">
|
||||
<property name="editable">
|
||||
@@ -176,6 +139,19 @@ timeout:</string>
|
||||
</item>
|
||||
</widget>
|
||||
</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">
|
||||
<widget class="QLabel" name="labelFilter_14">
|
||||
<property name="text">
|
||||
@@ -193,6 +169,85 @@ timeout:</string>
|
||||
</property>
|
||||
</layout>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
@@ -489,6 +544,45 @@ timeout:</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -18,12 +18,14 @@ public:
|
||||
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 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 path() const {return propertyByName("device").value.toString();}
|
||||
PIIODevice::DeviceMode mode() const {return PIIODevice::DeviceMode(propertyByName("mode").value.toInt());}
|
||||
PIIODevice::DeviceOptions options() const {return PIIODevice::DeviceOptions(propertyByName("options").value.toInt());}
|
||||
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
||||
int bufferSize() const {return propertyByName("bufferSize").value.toInt();}
|
||||
|
||||
void rename();
|
||||
|
||||
@@ -44,7 +46,8 @@ public:
|
||||
void setTimeout(double v) {addProperty(BlockItem::Property("timeout", "", v)); rename();}
|
||||
void setPacketSize(int v) {addProperty(BlockItem::Property("size", "", 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();}
|
||||
PIPacketExtractor::SplitMode mode() const {return PIPacketExtractor::SplitMode(propertyByName("mode").value.toInt());}
|
||||
QString header() const {return propertyByName("header").value.toString();}
|
||||
@@ -52,7 +55,8 @@ public:
|
||||
double timeout() const {return propertyByName("timeout").value.toDouble();}
|
||||
int packetSize() const {return propertyByName("size").value.toInt();}
|
||||
double disconnectTimeout() const {return PIIODevice::DeviceMode(propertyByName("disconnectTimeout").value.toDouble());}
|
||||
|
||||
int bufferSize() const {return propertyByName("bufferSize").value.toInt();}
|
||||
|
||||
void rename();
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user