|
@@ -840,6 +840,8 @@ generated file empty.
|
840
|
840
|
@<GraphSettingsWidget implementation@>@/
|
841
|
841
|
@<DataqSdkDeviceConfWidget implementation@>@/
|
842
|
842
|
@<SerialScaleConfWidget implementation@>@/
|
|
843
|
+@<ValueAnnotation implementation@>@/
|
|
844
|
+@<ValueAnnotationConfWidget implementation@>@/
|
843
|
845
|
|
844
|
846
|
@ A few headers are required for various parts of \pn{}. These allow the use of
|
845
|
847
|
various Qt modules.
|
|
@@ -10017,7 +10019,7 @@ oseconds = TIMETOINT(relative);
|
10017
|
10019
|
r = cseconds - oseconds;
|
10018
|
10020
|
|
10019
|
10021
|
@ The logic for a count down timer is very similar to the logic for a count up
|
10020
|
|
-timer. A key difference is that we don't want to continue counting down if the
|
|
10022
|
+timer. A key difference is that we don'@q'@>t want to continue counting down if the
|
10021
|
10023
|
timer has already reached 0.
|
10022
|
10024
|
|
10023
|
10025
|
@<Check for Timer Decrement@>=
|
|
@@ -10077,7 +10079,7 @@ void TimerDisplay::startTimer()@t\2\2@>@/
|
10077
|
10079
|
}
|
10078
|
10080
|
|
10079
|
10081
|
@ Stopping the timer is a little simpler. Remember to stop the clock so we
|
10080
|
|
-aren't updating senselessly.
|
|
10082
|
+aren'@q'@>t updating senselessly.
|
10081
|
10083
|
|
10082
|
10084
|
@<TimerDisplay Implementation@>=
|
10083
|
10085
|
void TimerDisplay::stopTimer()@t\2\2@>@/
|
|
@@ -11982,7 +11984,7 @@ the last row to increase the size of the table.
|
11982
|
11984
|
|
11983
|
11985
|
The end of this function may seem a little strange. Why not simply look up the
|
11984
|
11986
|
map and insert information directly into the model data? Well, as of this
|
11985
|
|
-writing, that doesn't work. There are two ways around that problem. One is to
|
|
11987
|
+writing, that doesn'@q'@>t work. There are two ways around that problem. One is to
|
11986
|
11988
|
have the lists store references and dereference the real data. The other option
|
11987
|
11989
|
is to obtain a copy of the row, then a copy of the cell, update the cell, then
|
11988
|
11990
|
replace the old value of the cell in the copy of the row, then replace the old
|
|
@@ -12057,7 +12059,7 @@ SaltModel::SaltModel(int columns) : QAbstractItemModel(), colcount(columns)
|
12057
|
12059
|
@<Expand the SaltModel@>@;
|
12058
|
12060
|
}
|
12059
|
12061
|
|
12060
|
|
-@ The destructor doesn't need to do anything.
|
|
12062
|
+@ The destructor doesn'@q'@>t need to do anything.
|
12061
|
12063
|
|
12062
|
12064
|
@<SaltModel Implementation@>=
|
12063
|
12065
|
SaltModel::~SaltModel()
|
|
@@ -12476,7 +12478,7 @@ if(settings.value("database/exists", "false").toString() == "false")
|
12476
|
12478
|
@ In order to connect to the database, we need five pieces of information: the
|
12477
|
12479
|
name of a database driver (PostgreSQL is recommended for now), the host name of
|
12478
|
12480
|
the computer running the database, the name of the database, the name of the
|
12479
|
|
-user connecting to the database, and that user's password. This information will
|
|
12481
|
+user connecting to the database, and that user'@q'@>s password. This information will
|
12480
|
12482
|
be stored in the user settings for the application so that the database
|
12481
|
12483
|
connection can be established without prompting the user next time. A class is
|
12482
|
12484
|
provided to gather this information.
|
|
@@ -12669,7 +12671,7 @@ settings.setValue(QString("columnWidths/%1/%2/%3").
|
12669
|
12671
|
QVariant(newsize));
|
12670
|
12672
|
|
12671
|
12673
|
@ To determine which window a given table is in, we just follow
|
12672
|
|
-|parentWidget()| until there isn't one. It is possible that the table view
|
|
12674
|
+|parentWidget()| until there isn'@q'@>t one. It is possible that the table view
|
12673
|
12675
|
will also be the window, however this is not advised as it is easier for the
|
12674
|
12676
|
settings key to be non-unique in such a case.
|
12675
|
12677
|
|
|
@@ -12971,7 +12973,7 @@ for(int j = 0; j < hierarchy.size() - 1; j++)
|
12971
|
12973
|
in Qt. This brings several benefits, including making it easy to print reports
|
12972
|
12974
|
or save reports as plain text or HTML.
|
12973
|
12975
|
|
12974
|
|
-Reports are specified in the \pn{}'s configuration document and can include both
|
|
12976
|
+Reports are specified in the \pn{}'@q'@>s configuration document and can include both
|
12975
|
12977
|
static elements and elements that are populated by external data such as the
|
12976
|
12978
|
result of a SQL query.
|
12977
|
12979
|
|
|
@@ -13223,7 +13225,7 @@ do
|
13223
|
13225
|
@ It is sometimes desirable to add fixed data such as column headers to a table.
|
13224
|
13226
|
This is done with the {\tt <row>} element.
|
13225
|
13227
|
|
13226
|
|
-Technically, this isn't needed. The same results can be produced by using a
|
|
13228
|
+Technically, this isn'@q'@>t needed. The same results can be produced by using a
|
13227
|
13229
|
{\tt <query>} element to select constant data, but this approach saves a trip to
|
13228
|
13230
|
the database.
|
13229
|
13231
|
|
|
@@ -14210,7 +14212,7 @@ else
|
14210
|
14212
|
saveDeviceConfiguration();
|
14211
|
14213
|
}
|
14212
|
14214
|
|
14213
|
|
-@ There isn't really anything that can be done if the device configuration data
|
|
14215
|
+@ There isn'@q'@>t really anything that can be done if the device configuration data
|
14214
|
14216
|
is corrupt, but an error message can be produced if the program happens to have
|
14215
|
14217
|
access to a debugging console.
|
14216
|
14218
|
|
|
@@ -14600,7 +14602,7 @@ QDomElement DeviceTreeModel::referenceElement(const QString &id)
|
14600
|
14602
|
return QDomElement();
|
14601
|
14603
|
}
|
14602
|
14604
|
|
14603
|
|
-@ We don't want any headers, so |headerData()| is very simple.
|
|
14605
|
+@ We don'@q'@>t want any headers, so |headerData()| is very simple.
|
14604
|
14606
|
|
14605
|
14607
|
@<DeviceTreeModel implementation@>=
|
14606
|
14608
|
QVariant DeviceTreeModel::headerData(int, Qt::Orientation, int) const
|
|
@@ -15228,6 +15230,7 @@ RoasterConfWidget::RoasterConfWidget(DeviceTreeModel *model, const QModelIndex &
|
15228
|
15230
|
this, SLOT(insertChildNode(QString, QString)));
|
15229
|
15231
|
connect(freeAnnotationInserter, SIGNAL(triggered(QString, QString)),
|
15230
|
15232
|
this, SLOT(insertChildNode(QString, QString)));
|
|
15233
|
+ @<Add annotation control node inserters@>@;
|
15231
|
15234
|
addAnnotationControlButton->setMenu(annotationMenu);
|
15232
|
15235
|
layout->addWidget(addAnnotationControlButton);
|
15233
|
15236
|
QPushButton *advancedButton = new QPushButton(tr("Advanced Features"));
|
|
@@ -15816,7 +15819,7 @@ by the current operating system are available to select.
|
15816
|
15819
|
A later version of QextSerialPort than is used by \pn{} provides a helper
|
15817
|
15820
|
class which can be used more conveniently to create this sort of control. As
|
15818
|
15821
|
this is not yet available to \pn{}, we instead copy the |enum| specifying
|
15819
|
|
-the appropriate values into the class and use Qt's meta-object system to
|
|
15822
|
+the appropriate values into the class and use Qt'@q'@>s meta-object system to
|
15820
|
15823
|
populate the combo box based on the values in that |enum|.
|
15821
|
15824
|
|
15822
|
15825
|
@<Class declarations@>=
|
|
@@ -17304,7 +17307,7 @@ void ModbusRTUDevice::mResponse(QByteArray response)
|
17304
|
17307
|
}
|
17305
|
17308
|
|
17306
|
17309
|
@ There are two ways that we might request measurement data. All of the
|
17307
|
|
-devices I've seen documented provide function 0x4 addresses for PV and SV
|
|
17310
|
+devices I'@q'@>ve seen documented provide function 0x4 addresses for PV and SV
|
17308
|
17311
|
such that SV can be obtained from the address immediately after the address
|
17309
|
17312
|
from which we obtain PV. In this case we request both values at the same time.
|
17310
|
17313
|
|
|
@@ -17389,7 +17392,7 @@ more than one response in the buffer at a time. It is, however, likely that
|
17389
|
17392
|
this buffer will have incomplete data. This means that we must determine when
|
17390
|
17393
|
the full response is available before passing the complete response along to
|
17391
|
17394
|
the appropriate method. If the response has not been received in full, nothing
|
17392
|
|
-is done. We'll be notified of more data shortly.
|
|
17395
|
+is done. We'@q'@>ll be notified of more data shortly.
|
17393
|
17396
|
|
17394
|
17397
|
When the message we see the response for was queued, a callback was also
|
17395
|
17398
|
registered to handle the response. Once we have the complete message, we pass
|
|
@@ -17562,7 +17565,7 @@ void ModbusRTUDevice::outputSV(double value)
|
17562
|
17565
|
queueMessage(message, this, "ignore(QByteArray)");
|
17563
|
17566
|
}
|
17564
|
17567
|
|
17565
|
|
-@ We don't care about the response when sending a new SV.
|
|
17568
|
+@ We don'@q'@>t care about the response when sending a new SV.
|
17566
|
17569
|
|
17567
|
17570
|
@<ModbusRTUDevice implementation@>=
|
17568
|
17571
|
void ModbusRTUDevice::ignore(QByteArray)
|
|
@@ -18183,7 +18186,7 @@ class LinearSplineInterpolationConfWidget : public BasicDeviceConfigurationWidge
|
18183
|
18186
|
void updateDestinationColumn(const QString &dest);
|
18184
|
18187
|
void updateKnots();
|
18185
|
18188
|
private:@/
|
18186
|
|
- SaltModel *model;
|
|
18189
|
+ SaltModel *tablemodel;
|
18187
|
18190
|
};
|
18188
|
18191
|
|
18189
|
18192
|
@ This is configured by specifying a source column name, a destination column
|
|
@@ -18192,17 +18195,17 @@ the mapping data, we store each column of the table in its own attribute.
|
18192
|
18195
|
|
18193
|
18196
|
@<LinearSplineInterpolationConfWidget implementation@>=
|
18194
|
18197
|
LinearSplineInterpolationConfWidget::LinearSplineInterpolationConfWidget(DeviceTreeModel *model, const QModelIndex &index)
|
18195
|
|
-: BasicDeviceConfigurationWidget(model, index), model(new SaltModel(2))
|
|
18198
|
+: BasicDeviceConfigurationWidget(model, index), tablemodel(new SaltModel(2))
|
18196
|
18199
|
{
|
18197
|
18200
|
QFormLayout *layout = new QFormLayout;
|
18198
|
18201
|
QLineEdit *source = new QLineEdit;
|
18199
|
18202
|
layout->addRow(tr("Source column name:"), source);
|
18200
|
18203
|
QLineEdit *destination = new QLineEdit;
|
18201
|
18204
|
layout->addRow(tr("Destination column name:"), destination);
|
18202
|
|
- model->setHeaderData(0, Qt::Horizontal, "Input");
|
18203
|
|
- model->setHeaderData(1, Qt::Horizontal, "Output");
|
|
18205
|
+ tablemodel->setHeaderData(0, Qt::Horizontal, "Input");
|
|
18206
|
+ tablemodel->setHeaderData(1, Qt::Horizontal, "Output");
|
18204
|
18207
|
QTableView *mappingTable = new QTableView;
|
18205
|
|
- mappingTable->setModel(model);
|
|
18208
|
+ mappingTable->setModel(tablemodel);
|
18206
|
18209
|
NumericDelegate *delegate = new NumericDelegate;
|
18207
|
18210
|
mappingTable->setItemDelegate(delegate);
|
18208
|
18211
|
layout->addRow(tr("Mapping data:"), mappingTable);
|
|
@@ -18237,7 +18240,7 @@ LinearSplineInterpolationConfWidget::LinearSplineInterpolationConfWidget(DeviceT
|
18237
|
18240
|
updateKnots();
|
18238
|
18241
|
connect(source, SIGNAL(textEdited(QString)), this, SLOT(updateSourceColumn(QString)));
|
18239
|
18242
|
connect(destination, SIGNAL(textEdited(QString)), this, SLOT(updateDestinationColumn(QString)));
|
18240
|
|
- connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(updateKnots()));
|
|
18243
|
+ connect(tablemodel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(updateKnots()));
|
18241
|
18244
|
setLayout(layout);
|
18242
|
18245
|
}
|
18243
|
18246
|
|
|
@@ -18260,7 +18263,7 @@ model.
|
18260
|
18263
|
@<Populate model column from list@>=
|
18261
|
18264
|
for(int i = 0; i < itemList.size(); i++)
|
18262
|
18265
|
{
|
18263
|
|
- model->setData(model->index(i, column),
|
|
18266
|
+ tablemodel->setData(tablemodel->index(i, column),
|
18264
|
18267
|
QVariant(itemList.at(i).toDouble()),
|
18265
|
18268
|
Qt::DisplayRole);
|
18266
|
18269
|
}
|
|
@@ -18271,8 +18274,8 @@ data with the current data.
|
18271
|
18274
|
@<LinearSplineInterpolationConfWidget implementation@>=
|
18272
|
18275
|
void LinearSplineInterpolationConfWidget::updateKnots()
|
18273
|
18276
|
{
|
18274
|
|
- updateAttribute("sourcevalues", model->arrayLiteral(0, Qt::DisplayRole));
|
18275
|
|
- updateAttribute("destinationvalues", model->arrayLiteral(1, Qt::DisplayRole));
|
|
18277
|
+ updateAttribute("sourcevalues", tablemodel->arrayLiteral(0, Qt::DisplayRole));
|
|
18278
|
+ updateAttribute("destinationvalues", tablemodel->arrayLiteral(1, Qt::DisplayRole));
|
18276
|
18279
|
}
|
18277
|
18280
|
|
18278
|
18281
|
void LinearSplineInterpolationConfWidget::updateSourceColumn(const QString &source)
|