|
@@ -17005,17 +17005,17 @@ class ModbusRTUDevice : public QObject
|
17005
|
17005
|
ModbusRTUDevice(DeviceTreeModel *model, const QModelIndex &index);
|
17006
|
17006
|
~ModbusRTUDevice();
|
17007
|
17007
|
void queueMessage(QByteArray request, QObject *object, const char *callback);
|
17008
|
|
- @[Q_INVOKABLE@]@, double SVLower();
|
17009
|
|
- @[Q_INVOKABLE@]@, double SVUpper();
|
17010
|
|
- @[Q_INVOKABLE@]@, int decimals();
|
17011
|
|
- QList<Channel*> channels;
|
|
17008
|
+ @[Q_INVOKABLE@,@, double@]@, SVLower();@t\2\2@>@/
|
|
17009
|
+ @[Q_INVOKABLE@,@, double@]@, SVUpper();@t\2\2@>@/
|
|
17010
|
+ @[Q_INVOKABLE@,@, int@]@, decimals();@t\2\2@>@/
|
|
17011
|
+ QList<Channel*> channels;@/
|
17012
|
17012
|
@[public slots@]:@/
|
17013
|
|
- void outputSV(double sv);
|
17014
|
|
- @[signals@]:@/
|
|
17013
|
+ void outputSV(double sv);@/
|
|
17014
|
+ signals:@/
|
17015
|
17015
|
void SVLowerChanged(double);
|
17016
|
17016
|
void SVUpperChanged(double);
|
17017
|
17017
|
void SVDecimalChanged(int);
|
17018
|
|
- void queueEmpty();
|
|
17018
|
+ void queueEmpty();@/
|
17019
|
17019
|
@[private slots@]:@/
|
17020
|
17020
|
void dataAvailable();
|
17021
|
17021
|
void sendNextMessage();
|
|
@@ -17025,7 +17025,7 @@ class ModbusRTUDevice : public QObject
|
17025
|
17025
|
void svuResponse(QByteArray response);
|
17026
|
17026
|
void requestMeasurement();
|
17027
|
17027
|
void mResponse(QByteArray response);
|
17028
|
|
- void ignore(QByteArray response);
|
|
17028
|
+ void ignore(QByteArray response);@/
|
17029
|
17029
|
private:@/
|
17030
|
17030
|
QextSerialPort *port;
|
17031
|
17031
|
QByteArray responseBuffer;
|
|
@@ -17064,10 +17064,10 @@ arbitrarily many monitored addresses per device. Communications are initiated
|
17064
|
17064
|
immediately upon construction.
|
17065
|
17065
|
|
17066
|
17066
|
@<ModbusRTUDevice implementation@>=
|
17067
|
|
-ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model, const QModelIndex &index)
|
17068
|
|
-: QObject(NULL), messageDelayTimer(new QTimer), unitIsF(true), readingsv(false),
|
17069
|
|
- waiting(false)
|
17070
|
|
-{
|
|
17067
|
+ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &index)
|
|
17068
|
+: QObject(NULL), messageDelayTimer(new QTimer), unitIsF(@[true@]), readingsv(@[false@]),
|
|
17069
|
+ waiting(@[false@])@/
|
|
17070
|
+{@/
|
17071
|
17071
|
QDomElement portReferenceElement = model->referenceElement(model->data(index,
|
17072
|
17072
|
Qt::UserRole).toString());
|
17073
|
17073
|
QDomNodeList portConfigData = portReferenceElement.elementsByTagName("attribute");
|
|
@@ -17130,7 +17130,7 @@ ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model, const QModelIndex &inde
|
17130
|
17130
|
{
|
17131
|
17131
|
if(attributes.value("fixedUnit") == "Celsius")
|
17132
|
17132
|
{
|
17133
|
|
- unitIsF = false;
|
|
17133
|
+ unitIsF = @[false@];
|
17134
|
17134
|
}
|
17135
|
17135
|
}
|
17136
|
17136
|
if(attributes.value("sVWritable") == "true")
|
|
@@ -17242,11 +17242,11 @@ void ModbusRTUDevice::unitResponse(QByteArray response)
|
17242
|
17242
|
int value = temp;
|
17243
|
17243
|
if(value == valueF)
|
17244
|
17244
|
{
|
17245
|
|
- unitIsF = true;
|
|
17245
|
+ unitIsF = @[true@];
|
17246
|
17246
|
}
|
17247
|
17247
|
else
|
17248
|
17248
|
{
|
17249
|
|
- unitIsF = false;
|
|
17249
|
+ unitIsF = @[false@];
|
17250
|
17250
|
}
|
17251
|
17251
|
}
|
17252
|
17252
|
|
|
@@ -17415,9 +17415,9 @@ void ModbusRTUDevice::dataAvailable()
|
17415
|
17415
|
{
|
17416
|
17416
|
QObject *object = retObjQueue.at(0);
|
17417
|
17417
|
char *method = callbackQueue.at(0);
|
17418
|
|
- QMetaMethod metamethod = object->metaObject()->
|
|
17418
|
+ QMetaMethod metamethod = @| object->metaObject()->
|
17419
|
17419
|
method(object->metaObject()->
|
17420
|
|
- indexOfMethod(QMetaObject::normalizedSignature(method)));
|
|
17420
|
+ indexOfMethod(@|QMetaObject::normalizedSignature(method)));
|
17421
|
17421
|
metamethod.invoke(object, Qt::QueuedConnection,
|
17422
|
17422
|
Q_ARG(QByteArray, responseBuffer));
|
17423
|
17423
|
messageQueue.removeAt(0);
|
|
@@ -17429,7 +17429,7 @@ void ModbusRTUDevice::dataAvailable()
|
17429
|
17429
|
{
|
17430
|
17430
|
qDebug() << "CRC failed";
|
17431
|
17431
|
}
|
17432
|
|
- waiting = false;
|
|
17432
|
+ waiting = @[false@];
|
17433
|
17433
|
responseBuffer.clear();
|
17434
|
17434
|
}
|
17435
|
17435
|
|
|
@@ -17544,7 +17544,7 @@ void ModbusRTUDevice::sendNextMessage()
|
17544
|
17544
|
message.append(check[1]);
|
17545
|
17545
|
port->write(message);
|
17546
|
17546
|
messageDelayTimer->start(delayTime);
|
17547
|
|
- waiting = true;
|
|
17547
|
+ waiting = @[true@];
|
17548
|
17548
|
}
|
17549
|
17549
|
else
|
17550
|
17550
|
{
|
|
@@ -17672,9 +17672,9 @@ after such a change.
|
17672
|
17672
|
@<Class declarations@>=
|
17673
|
17673
|
class ModbusConfigurator : public BasicDeviceConfigurationWidget
|
17674
|
17674
|
{
|
17675
|
|
- @[Q_OBJECT@]
|
|
17675
|
+ @[Q_OBJECT@]@;
|
17676
|
17676
|
public:@/
|
17677
|
|
- Q_INVOKABLE ModbusConfigurator(DeviceTreeModel *model, const QModelIndex &index);
|
|
17677
|
+ Q_INVOKABLE@,@, ModbusConfigurator(DeviceTreeModel *model, const QModelIndex &index);@/
|
17678
|
17678
|
@[private slots@]:@/
|
17679
|
17679
|
void updatePort(const QString &newPort);
|
17680
|
17680
|
void updateBaudRate(const QString &newRate);
|
|
@@ -17703,7 +17703,7 @@ class ModbusConfigurator : public BasicDeviceConfigurationWidget
|
17703
|
17703
|
void updatePVColumnName(const QString &name);
|
17704
|
17704
|
void updateSVColumnName(const QString &name);
|
17705
|
17705
|
void updatePVHidden(bool hidden);
|
17706
|
|
- void updateSVHidden(bool hidden);
|
|
17706
|
+ void updateSVHidden(bool hidden);@/
|
17707
|
17707
|
private:@/
|
17708
|
17708
|
PortSelector *port;
|
17709
|
17709
|
BaudSelector *baud;
|