|
@@ -10673,6 +10673,8 @@ if(s > QTime(0, 0, 0))@/
|
10673
|
10673
|
s = nt;
|
10674
|
10674
|
emit valueChanged(s);
|
10675
|
10675
|
}
|
|
10676
|
+} else {
|
|
10677
|
+ stopTimer();
|
10676
|
10678
|
}
|
10677
|
10679
|
|
10678
|
10680
|
@ The clock mode is the simplest case as it just needs to find out if the time
|
|
@@ -10867,6 +10869,7 @@ void TimerDisplay::updateDisplay()
|
10867
|
10869
|
QScriptValue constructTimerDisplay(QScriptContext *context,
|
10868
|
10870
|
QScriptEngine *engine);
|
10869
|
10871
|
void setTimerDisplayProperties(QScriptValue value, QScriptEngine *engine);
|
|
10872
|
+QScriptValue TimerDisplay_setTimerMode(QScriptContext *context, QScriptEngine *engine);
|
10870
|
10873
|
|
10871
|
10874
|
@ The engine must be informed of the script constructor.
|
10872
|
10875
|
|
|
@@ -10888,6 +10891,36 @@ QScriptValue constructTimerDisplay(QScriptContext *, QScriptEngine *engine)
|
10888
|
10891
|
void setTimerDisplayProperties(QScriptValue value, QScriptEngine *engine)
|
10889
|
10892
|
{
|
10890
|
10893
|
setQLCDNumberProperties(value, engine);
|
|
10894
|
+ value.setProperty("setTimerMode", engine->newFunction(TimerDisplay_setTimerMode));
|
|
10895
|
+}
|
|
10896
|
+
|
|
10897
|
+@ A new feature in \pn{} 1.6.4 benefits from having the ability to set the
|
|
10898
|
+timer mode from a script. Rather than exposing the |enum| responsible for this
|
|
10899
|
+to the host environment, a new function is provided to allow integer based
|
|
10900
|
+setting.
|
|
10901
|
+
|
|
10902
|
+@<Functions for scripting@>=
|
|
10903
|
+QScriptValue TimerDisplay_setTimerMode(QScriptContext *context, QScriptEngine *)
|
|
10904
|
+{
|
|
10905
|
+ TimerDisplay *self = getself<TimerDisplay *>(context);
|
|
10906
|
+ if(self)
|
|
10907
|
+ {
|
|
10908
|
+ switch(argument<int>(0, context))
|
|
10909
|
+ {
|
|
10910
|
+ case 0:
|
|
10911
|
+ self->setMode(TimerDisplay::CountUp);
|
|
10912
|
+ break;
|
|
10913
|
+ case 1:
|
|
10914
|
+ self->setMode(TimerDisplay::CountDown);
|
|
10915
|
+ break;
|
|
10916
|
+ case 2:
|
|
10917
|
+ self->setMode(TimerDisplay::Clock);
|
|
10918
|
+ break;
|
|
10919
|
+ default:
|
|
10920
|
+ break;
|
|
10921
|
+ }
|
|
10922
|
+ }
|
|
10923
|
+ return QScriptValue();
|
10891
|
10924
|
}
|
10892
|
10925
|
|
10893
|
10926
|
|
|
@@ -16004,6 +16037,24 @@ RoasterConfWidget::RoasterConfWidget(DeviceTreeModel *model, const QModelIndex &
|
16004
|
16037
|
@<Add annotation control node inserters@>@;
|
16005
|
16038
|
addAnnotationControlButton->setMenu(annotationMenu);
|
16006
|
16039
|
layout->addWidget(addAnnotationControlButton);
|
|
16040
|
+
|
|
16041
|
+ QPushButton *timersButton = new QPushButton(tr("Extra Timers"));
|
|
16042
|
+ QMenu *timersMenu = new QMenu;
|
|
16043
|
+ NodeInserter *coolingTimerInserter = new NodeInserter(tr("Cooling Timer"), tr("Cooling Timer"), "coolingtimer");
|
|
16044
|
+ NodeInserter *rangeTimerInserter = new NodeInserter(tr("Range Timer"), tr("Range Timer"), "rangetimer");
|
|
16045
|
+ NodeInserter *multirangeTimerInserter = new NodeInserter(tr("Multi-Range Timer"), tr("Multi-Range Timer"), "multirangetimer");
|
|
16046
|
+ timersMenu->addAction(coolingTimerInserter);
|
|
16047
|
+ timersMenu->addAction(rangeTimerInserter);
|
|
16048
|
+ timersMenu->addAction(multirangeTimerInserter);
|
|
16049
|
+ connect(coolingTimerInserter, SIGNAL(triggered(QString, QString)),
|
|
16050
|
+ this, SLOT(insertChildNode(QString, QString)));
|
|
16051
|
+ connect(rangeTimerInserter, SIGNAL(triggered(QString, QString)),
|
|
16052
|
+ this, SLOT(insertChildNode(QString, QString)));
|
|
16053
|
+ connect(multirangeTimerInserter, SIGNAL(triggered(QString, QString)),
|
|
16054
|
+ this, SLOT(insertChildNode(QString, QString)));
|
|
16055
|
+ timersButton->setMenu(timersMenu);
|
|
16056
|
+ layout->addWidget(timersButton);
|
|
16057
|
+
|
16007
|
16058
|
QPushButton *advancedButton = new QPushButton(tr("Advanced Features"));
|
16008
|
16059
|
QMenu *advancedMenu = new QMenu;
|
16009
|
16060
|
NodeInserter *linearsplineinserter = new NodeInserter(tr("Linear Spline Interpolated Series"), tr("Linear Spline Interpolated Series"), "linearspline");
|
|
@@ -16015,6 +16066,7 @@ RoasterConfWidget::RoasterConfWidget(DeviceTreeModel *model, const QModelIndex &
|
16015
|
16066
|
@<Add node inserters to advanced features menu@>@;
|
16016
|
16067
|
advancedButton->setMenu(advancedMenu);
|
16017
|
16068
|
layout->addWidget(advancedButton);
|
|
16069
|
+
|
16018
|
16070
|
QHBoxLayout *idLayout = new QHBoxLayout;
|
16019
|
16071
|
QLabel *idLabel = new QLabel(tr("Machine ID for database:"));
|
16020
|
16072
|
idLayout->addWidget(idLabel);
|
|
@@ -19155,6 +19207,72 @@ void LinearSplineInterpolationConfWidget::updateDestinationColumn(const QString
|
19155
|
19207
|
@<Register device configuration widgets@>=
|
19156
|
19208
|
app.registerDeviceConfigurationWidget("linearspline", LinearSplineInterpolationConfWidget::staticMetaObject);
|
19157
|
19209
|
|
|
19210
|
+@* Additional Timers.
|
|
19211
|
+
|
|
19212
|
+\noindent \pn{} 1.6.4 adds support for more timer indicators than just the
|
|
19213
|
+default batch timer. Three new timer types are supported. The first is a
|
|
19214
|
+cooling timer. This is a timer that is initially set to 0, but at the end of a
|
|
19215
|
+batch this is set to a configured time and starts counting down. There are no
|
|
19216
|
+data logging requirements and this is purely a convenience feature, but one
|
|
19217
|
+that supports product and personnel safety best practices as it helps to
|
|
19218
|
+eliminate the practice of a person reaching into the cooling tray as it
|
|
19219
|
+agitates to test if the coffee has cooled.
|
|
19220
|
+
|
|
19221
|
+@<Class declarations@>=
|
|
19222
|
+class CoolingTimerConfWidget : public BasicDeviceConfigurationWidget
|
|
19223
|
+{
|
|
19224
|
+ @[Q_OBJECT@]@/
|
|
19225
|
+ public:@/
|
|
19226
|
+ @[Q_INVOKABLE@]@, CoolingTimerConfWidget(DeviceTreeModel *model,
|
|
19227
|
+ const QModelIndex &index);
|
|
19228
|
+ @[private slots@]:@/
|
|
19229
|
+ void updateResetTime(QTime time);
|
|
19230
|
+};
|
|
19231
|
+
|
|
19232
|
+@ The only configurable detail is the vaue the timer should reset to. For this
|
|
19233
|
+a |QTimeEdit| is fine.
|
|
19234
|
+
|
|
19235
|
+@<CoolingTimerConfWidget implementation@>=
|
|
19236
|
+CoolingTimerConfWidget::CoolingTimerConfWidget(DeviceTreeModel *model,
|
|
19237
|
+ const QModelIndex &index)
|
|
19238
|
+: BasicDeviceConfigurationWidget(model, index)
|
|
19239
|
+{
|
|
19240
|
+ QHBoxLayout *layout = new QHBoxLayout;
|
|
19241
|
+ QLabel *label = new QLabel(tr("Cooling Time: "));
|
|
19242
|
+ QTimeEdit *editor = new QTimeEdit;
|
|
19243
|
+ editor->setDisplayFormat("mm:ss");
|
|
19244
|
+ @<Get device configuration data for current node@>@;
|
|
19245
|
+ for(int i = 0; i < configData.size(); i++)
|
|
19246
|
+ {
|
|
19247
|
+ node = configData.at(i).toElement();
|
|
19248
|
+ if(node.attribute("name") == "reset")
|
|
19249
|
+ {
|
|
19250
|
+ editor->setTime(QTime::fromString(node.attribute("value"), "mm:ss"));
|
|
19251
|
+ }
|
|
19252
|
+ }
|
|
19253
|
+ updateResetTime(editor->time());
|
|
19254
|
+ connect(editor, SIGNAL(timeChanged(QTime)),
|
|
19255
|
+ this, SLOT(updateResetTime(QTime)));
|
|
19256
|
+ layout->addWidget(label);
|
|
19257
|
+ layout->addWidget(editor);
|
|
19258
|
+ setLayout(layout);
|
|
19259
|
+}
|
|
19260
|
+
|
|
19261
|
+void CoolingTimerConfWidget::updateResetTime(QTime time)
|
|
19262
|
+{
|
|
19263
|
+ updateAttribute("reset", time.toString("mm:ss"));
|
|
19264
|
+}
|
|
19265
|
+
|
|
19266
|
+@ The widget is registered with the configuration system.
|
|
19267
|
+@<Register device configuration widgets@>=
|
|
19268
|
+app.registerDeviceConfigurationWidget("coolingtimer",
|
|
19269
|
+CoolingTimerConfWidget::staticMetaObject);
|
|
19270
|
+
|
|
19271
|
+@ The implementation chunk for now is in the main source file.
|
|
19272
|
+
|
|
19273
|
+@<Class implementations@>=
|
|
19274
|
+@<CoolingTimerConfWidget implementation@>
|
|
19275
|
+
|
19158
|
19276
|
@* Profile Translation Configuration Widget.
|
19159
|
19277
|
|
19160
|
19278
|
\noindent Configuring profile translation requires knowing which column to use
|