Browse Source

Configuration widget for free text annotation.

Neal Wilson 11 years ago
parent
commit
e22c03d64f
2 changed files with 109 additions and 41 deletions
  1. 59
    0
      src/freeannotation.w
  2. 50
    41
      src/typica.w

+ 59
- 0
src/freeannotation.w View File

1
+@* Free text annotation control configuration.
2
+
3
+\noindent Some roasting firms like to be able to provide arbitrary text as an
4
+annotation in addition to or instead of fixed form annotations. There is very
5
+little to configure for an annotation control that facilitates that
6
+functionality. The existence and position of the control is implicit in the
7
+existence of a node representing the control in the configuration. An optional
8
+label next to the control is the only configurable option at present. A
9
+configuration widget and associated registrations to integrate with the
10
+configuration system is still required.
11
+
12
+@<Class declarations@>=
13
+class FreeAnnotationConfWidget : public BasicDeviceConfigurationWidget
14
+{
15
+	Q_OBJECT
16
+	public:
17
+		Q_INVOKABLE FreeAnnotationConfWidget(DeviceTreeModel *model, const QModelIndex &index);
18
+	private slots:
19
+		void updateLabel(const QString &text);
20
+};
21
+
22
+@ The constructor should seem familiar by now.
23
+
24
+@<FreeAnnotationConfWidget implementation@>=
25
+FreeAnnotationConfWidget::FreeAnnotationConfWidget(DeviceTreeModel *model,
26
+                                                   const QModelIndex &index)
27
+	: BasicDeviceConfigurationWidget(model, index)
28
+{
29
+	QFormLayout *layout = new QFormLayout;
30
+	QLineEdit *labelEdit = new QLineEdit;
31
+	layout->addRow(tr("Label Text:"), labelEdit);
32
+	@<Get device configuration data for current node@>@;
33
+	for(int i = 0; i < configData.size(); i++)
34
+	{
35
+		node = configData.at(i).toElement();
36
+		if(node.attribute("name") == "labeltext")
37
+		{
38
+			labelEdit->setText(node.attribute("value"));
39
+		}
40
+	}
41
+	updateLabel(labelEdit->text());
42
+	connect(labelEdit, SIGNAL(textEdited(QString)),
43
+	        this, SLOT(updateLabel(QString)));
44
+	setLayout(layout);
45
+}
46
+
47
+@ The update slot is trivial.
48
+
49
+@<FreeAnnotationConfWidget implementation@>=
50
+void FreeAnnotationConfWidget::updateLabel(const QString &text)
51
+{
52
+	updateAttribute("labeltext", text);
53
+}
54
+
55
+@ There is nothing unusual in the control registration.
56
+
57
+@<Register device configuration widgets@>=
58
+app.registerDeviceConfigurationWidget("freeannotation",
59
+                                      FreeAnnotationConfWidget::staticMetaObject);

+ 50
- 41
src/typica.w View File

22
 \mark{\noexpand\nullsec0{A Note on Notation}}
22
 \mark{\noexpand\nullsec0{A Note on Notation}}
23
 \def\pn{Typica}
23
 \def\pn{Typica}
24
 \def\filebase{typica}
24
 \def\filebase{typica}
25
-\def\version{1.4.3 \number\year-\number\month-\number\day}
25
+\def\version{1.5 \number\year-\number\month-\number\day}
26
 \def\years{2007--2013}
26
 \def\years{2007--2013}
27
 \def\title{\pn{} (Version \version)}
27
 \def\title{\pn{} (Version \version)}
28
 \newskip\dangerskipb
28
 \newskip\dangerskipb
60
 	distribute, sublicense, and/or sell copies of the Software, and to permit
60
 	distribute, sublicense, and/or sell copies of the Software, and to permit
61
 	persons to whom the Software is furnished to do so, subject to the following
61
 	persons to whom the Software is furnished to do so, subject to the following
62
 	conditions:\medskip
62
 	conditions:\medskip
63
-	
63
+
64
 	The above copyright notice and this permission notice shall be included in
64
 	The above copyright notice and this permission notice shall be included in
65
 	all copies or substantial portions of the Software.\medskip
65
 	all copies or substantial portions of the Software.\medskip
66
-	
66
+
67
 	THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
 	THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68
 	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
 	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69
 	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
 	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
 	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
71
 	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
72
 	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
72
 	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
73
 	IN THE SOFTWARE.
73
 	IN THE SOFTWARE.
74
-	
74
+
75
 	\bigskip\noindent Parts of \pn{} are from QextSerialPort which is used under the
75
 	\bigskip\noindent Parts of \pn{} are from QextSerialPort which is used under the
76
 	MIT license as follows:
76
 	MIT license as follows:
77
-	
77
+
78
 	\bigskip\noindent Copyright \copyright\ 2000--2003 Wayne Roth
78
 	\bigskip\noindent Copyright \copyright\ 2000--2003 Wayne Roth
79
-	
79
+
80
     \noindent Copyright \copyright\ 2004--2007 Stefan Sander
80
     \noindent Copyright \copyright\ 2004--2007 Stefan Sander
81
-    
81
+
82
 	\noindent Copyright \copyright\ 2007 Michal Policht
82
 	\noindent Copyright \copyright\ 2007 Michal Policht
83
-    
83
+
84
 	\noindent Copyright \copyright\ 2008 Brandon Fosdick
84
 	\noindent Copyright \copyright\ 2008 Brandon Fosdick
85
-    
85
+
86
 	\noindent Copyright \copyright\ 2009--2010 Liam Staskawicz
86
 	\noindent Copyright \copyright\ 2009--2010 Liam Staskawicz
87
-    
87
+
88
 	\noindent Copyright \copyright\ 2011 Debao Zhang
88
 	\noindent Copyright \copyright\ 2011 Debao Zhang
89
-    
89
+
90
     \bigskip\noindent Web: http://code.google.com/p/qextserialport/
90
     \bigskip\noindent Web: http://code.google.com/p/qextserialport/
91
-    
91
+
92
     \bigskip\noindent Permission is hereby granted, free of charge, to any person obtaining
92
     \bigskip\noindent Permission is hereby granted, free of charge, to any person obtaining
93
     a copy of this software and associated documentation files (the
93
     a copy of this software and associated documentation files (the
94
     ``Software''), to deal in the Software without restriction, including
94
     ``Software''), to deal in the Software without restriction, including
96
     distribute, sublicense, and/or sell copies of the Software, and to
96
     distribute, sublicense, and/or sell copies of the Software, and to
97
     permit persons to whom the Software is furnished to do so, subject to
97
     permit persons to whom the Software is furnished to do so, subject to
98
     the following conditions:
98
     the following conditions:
99
-    
99
+
100
     The above copyright notice and this permission notice shall be
100
     The above copyright notice and this permission notice shall be
101
     included in all copies or substantial portions of the Software.
101
     included in all copies or substantial portions of the Software.
102
-    
102
+
103
     THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
103
     THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
104
     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104
     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
105
     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
105
     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
833
 @<LinearSplineInterpolator Implementation@>@/
833
 @<LinearSplineInterpolator Implementation@>@/
834
 @<LinearSplineInterpolationConfWidget implementation@>@/
834
 @<LinearSplineInterpolationConfWidget implementation@>@/
835
 @<TranslationConfWidget implementation@>@/
835
 @<TranslationConfWidget implementation@>@/
836
+@<FreeAnnotationConfWidget implementation@>@/
836
 
837
 
837
 @ A few headers are required for various parts of \pn{}. These allow the use of
838
 @ A few headers are required for various parts of \pn{}. These allow the use of
838
 various Qt modules.
839
 various Qt modules.
1141
 
1142
 
1142
 As of version 1.4 window geometry management is provided for all windows. The
1143
 As of version 1.4 window geometry management is provided for all windows. The
1143
 |restoreSizeAndPosition()| and |saveSizeAndPosition()| methods should be
1144
 |restoreSizeAndPosition()| and |saveSizeAndPosition()| methods should be
1144
-considered depreciated. 
1145
+considered depreciated.
1145
 
1146
 
1146
 @<Class declarations@>=
1147
 @<Class declarations@>=
1147
 class ScriptQMainWindow : public QMainWindow@/
1148
 class ScriptQMainWindow : public QMainWindow@/
1709
 void setQBoxLayoutProperties(QScriptValue value, QScriptEngine *engine);
1710
 void setQBoxLayoutProperties(QScriptValue value, QScriptEngine *engine);
1710
 QScriptValue QBoxLayout_addLayout(QScriptContext *context, QScriptEngine *engine);
1711
 QScriptValue QBoxLayout_addLayout(QScriptContext *context, QScriptEngine *engine);
1711
 QScriptValue QBoxLayout_addWidget(QScriptContext *context, QScriptEngine *engine);
1712
 QScriptValue QBoxLayout_addWidget(QScriptContext *context, QScriptEngine *engine);
1712
-								  
1713
+
1713
 @ The script constructor must be passed to the scripting engine.
1714
 @ The script constructor must be passed to the scripting engine.
1714
 
1715
 
1715
 @<Set up the scripting engine@>=
1716
 @<Set up the scripting engine@>=
1815
 \noindent The |QAction| class is used in \pn{} to create menu items and respond
1816
 \noindent The |QAction| class is used in \pn{} to create menu items and respond
1816
 to the selection of these items. Three functions are required for our scripting
1817
 to the selection of these items. Three functions are required for our scripting
1817
 needs with regard to this class.
1818
 needs with regard to this class.
1818
-								  
1819
+
1819
 @<Function prototypes for scripting@>=
1820
 @<Function prototypes for scripting@>=
1820
 QScriptValue constructQAction(QScriptContext *context, QScriptEngine *engine);
1821
 QScriptValue constructQAction(QScriptContext *context, QScriptEngine *engine);
1821
 QScriptValue QAction_setShortcut(QScriptContext *context,
1822
 QScriptValue QAction_setShortcut(QScriptContext *context,
1945
 			retval = QScriptValue(engine,
1946
 			retval = QScriptValue(engine,
1946
 							      QFileDialog::getSaveFileName(widget, caption,
1947
 							      QFileDialog::getSaveFileName(widget, caption,
1947
 								                               dir, "", 0, 0));
1948
 								                               dir, "", 0, 0));
1948
-		
1949
+
1949
 			setQFileDialogProperties(retval, engine);
1950
 			setQFileDialogProperties(retval, engine);
1950
 		}
1951
 		}
1951
 		else
1952
 		else
3168
 @<Function prototypes for scripting@>=
3169
 @<Function prototypes for scripting@>=
3169
 void setQAbstractScrollAreaProperties(QScriptValue value,
3170
 void setQAbstractScrollAreaProperties(QScriptValue value,
3170
                                       QScriptEngine *engine);
3171
                                       QScriptEngine *engine);
3171
-									  
3172
+
3172
 @ The implementation of this is simple.
3173
 @ The implementation of this is simple.
3173
 
3174
 
3174
 @<Functions for scripting@>=
3175
 @<Functions for scripting@>=
3494
 QScriptValue annotationFromRecord(QScriptContext *context,
3495
 QScriptValue annotationFromRecord(QScriptContext *context,
3495
                                   QScriptEngine *engine);
3496
                                   QScriptEngine *engine);
3496
 QScriptValue setTabOrder(QScriptContext *context, QScriptEngine *engine);
3497
 QScriptValue setTabOrder(QScriptContext *context, QScriptEngine *engine);
3497
-									
3498
+
3498
 @ These functions are passed to the scripting engine.
3499
 @ These functions are passed to the scripting engine.
3499
 
3500
 
3500
 @<Set up the scripting engine@>=
3501
 @<Set up the scripting engine@>=
3771
 
3772
 
3772
 @<Function prototypes for scripting@>=
3773
 @<Function prototypes for scripting@>=
3773
 QScriptValue createWindow(QScriptContext *context, QScriptEngine *engine);
3774
 QScriptValue createWindow(QScriptContext *context, QScriptEngine *engine);
3774
-void addLayoutToWidget(QDomElement element, QStack<QWidget*> *widgetStack, 
3775
+void addLayoutToWidget(QDomElement element, QStack<QWidget*> *widgetStack,
3775
                        QStack<QLayout*> *layoutStack);
3776
                        QStack<QLayout*> *layoutStack);
3776
 void addLayoutToLayout(QDomElement element, QStack<QWidget *> *widgetStack,
3777
 void addLayoutToLayout(QDomElement element, QStack<QWidget *> *widgetStack,
3777
                        QStack<QLayout *> *layoutStack);
3778
                        QStack<QLayout *> *layoutStack);
4046
 resolves to a |QGridLayout|, and {\tt stack} resolves to a |QStackedLayout|.
4047
 resolves to a |QGridLayout|, and {\tt stack} resolves to a |QStackedLayout|.
4047
 
4048
 
4048
 @<Functions for scripting@>=
4049
 @<Functions for scripting@>=
4049
-void addLayoutToWidget(QDomElement element, QStack<QWidget*> *widgetStack, 
4050
+void addLayoutToWidget(QDomElement element, QStack<QWidget*> *widgetStack,
4050
                        QStack<QLayout*> *layoutStack)
4051
                        QStack<QLayout*> *layoutStack)
4051
 {
4052
 {
4052
 	if(element.hasAttribute("type"))
4053
 	if(element.hasAttribute("type"))
7413
                                             QScriptEngine *engine);
7414
                                             QScriptEngine *engine);
7414
 void setMeasurementTimeOffsetProperties(QScriptValue value,
7415
 void setMeasurementTimeOffsetProperties(QScriptValue value,
7415
                                         QScriptEngine *engine);
7416
                                         QScriptEngine *engine);
7416
-										   
7417
+
7417
 @ The scripting engine must be informed of the constructor.
7418
 @ The scripting engine must be informed of the constructor.
7418
 
7419
 
7419
 @<Set up the scripting engine@>=
7420
 @<Set up the scripting engine@>=
8782
 	ZoomLog *self = getself<@[ZoomLog *@]>(context);
8783
 	ZoomLog *self = getself<@[ZoomLog *@]>(context);
8783
 	return QScriptValue(engine, self->lastTime(argument<int>(0, context)));
8784
 	return QScriptValue(engine, self->lastTime(argument<int>(0, context)));
8784
 }
8785
 }
8785
-		
8786
+
8786
 @* A model for roasting data.
8787
 @* A model for roasting data.
8787
 
8788
 
8788
 \noindent Qt provides a tool called the model view architecture. This provides a
8789
 \noindent Qt provides a tool called the model view architecture. This provides a
8914
 	emit rowChanged(insertion);
8915
 	emit rowChanged(insertion);
8915
 	delete temp;
8916
 	delete temp;
8916
 }
8917
 }
8917
-	
8918
+
8918
 @ To find the insertion point for new measurements we use a binary search of the
8919
 @ To find the insertion point for new measurements we use a binary search of the
8919
 existing data. The code below is a direct adaptation of Program B\nfnote{%
8920
 existing data. The code below is a direct adaptation of Program B\nfnote{%
8920
 \underbar{The Art of Computer Programming} Volume 3 Sorting and Searching 2nd
8921
 \underbar{The Art of Computer Programming} Volume 3 Sorting and Searching 2nd
9404
 					default:
9405
 					default:
9405
 						break;
9406
 						break;
9406
 				}
9407
 				}
9407
-			} 
9408
+			}
9408
 			return QVariant(row->at(index.column()).toString());
9409
 			return QVariant(row->at(index.column()).toString());
9409
 		}
9410
 		}
9410
 	}
9411
 	}
9757
 count up timer at a time when my first timer was malfunctioning. After
9758
 count up timer at a time when my first timer was malfunctioning. After
9758
 attempting to purchase a replacement device at several stores that have sold
9759
 attempting to purchase a replacement device at several stores that have sold
9759
 such devices in the past, I decided to spend a couple hours writing my own
9760
 such devices in the past, I decided to spend a couple hours writing my own
9760
-timer. 
9761
+timer.
9761
 
9762
 
9762
 For historical reasons, the |TimerDisplay| class is considerably more functional
9763
 For historical reasons, the |TimerDisplay| class is considerably more functional
9763
 than \pn{} requires. Those needing only a digital timer can extract the code for
9764
 than \pn{} requires. Those needing only a digital timer can extract the code for
10207
 };
10208
 };
10208
 
10209
 
10209
 @ The interesting portion of this class is in |doLayout()|. This function goes
10210
 @ The interesting portion of this class is in |doLayout()|. This function goes
10210
-over the items in the layout and sets the geometry appropriately. 
10211
+over the items in the layout and sets the geometry appropriately.
10211
 
10212
 
10212
 The seemingly odd choice of returning |y| at the end of this function (indeed of
10213
 The seemingly odd choice of returning |y| at the end of this function (indeed of
10213
 having a return value at all) is to allow this function to provide the return
10214
 having a return value at all) is to allow this function to provide the return
10536
 	@<Adjust the decoration width@>@;
10537
 	@<Adjust the decoration width@>@;
10537
 	@<Pack widgets into the layout@>@;
10538
 	@<Pack widgets into the layout@>@;
10538
 }
10539
 }
10539
-	
10540
+
10540
 @ The decoration is a |QGraphicsView|. To get this to look right, we need to
10541
 @ The decoration is a |QGraphicsView|. To get this to look right, we need to
10541
 make sure there aren't any scroll bars and there shouldn't be a frame
10542
 make sure there aren't any scroll bars and there shouldn't be a frame
10542
 surrounding it. While we're at it, we allow it to accept clicks, though this
10543
 surrounding it. While we're at it, we allow it to accept clicks, though this
12368
 	Application app(*c, argv);
12369
 	Application app(*c, argv);
12369
 	@<Set up icons@>@;
12370
 	@<Set up icons@>@;
12370
 	@<Set up fonts@>@;
12371
 	@<Set up fonts@>@;
12371
-	
12372
+
12372
 	QSettings settings;
12373
 	QSettings settings;
12373
-	
12374
+
12374
 	@<Register device configuration widgets@>@;
12375
 	@<Register device configuration widgets@>@;
12375
 	@<Prepare the database connection@>@;
12376
 	@<Prepare the database connection@>@;
12376
 	@<Load the application configuration@>@;
12377
 	@<Load the application configuration@>@;
12377
 	@<Set up the scripting engine@>@;
12378
 	@<Set up the scripting engine@>@;
12378
 	app.engine = engine;
12379
 	app.engine = engine;
12379
 	@<Find and evaluate starting script@>@;
12380
 	@<Find and evaluate starting script@>@;
12380
-	
12381
+
12381
 	int retval = app.exec();
12382
 	int retval = app.exec();
12382
 	delete engine;
12383
 	delete engine;
12383
 	return retval;@/
12384
 	return retval;@/
13216
 	QTextEdit *self = getself<QTextEdit *>(context);
13217
 	QTextEdit *self = getself<QTextEdit *>(context);
13217
 	QTextDocument *document = self->document();
13218
 	QTextDocument *document = self->document();
13218
 	QPrinter printer;
13219
 	QPrinter printer;
13219
-	
13220
+
13220
 	QPrintDialog printwindow(&printer, self);
13221
 	QPrintDialog printwindow(&printer, self);
13221
 	if(printwindow.exec() != QDialog::Accepted)
13222
 	if(printwindow.exec() != QDialog::Accepted)
13222
 	{
13223
 	{
14580
 QScriptValue QAbstractItemModel_index(QScriptContext *context, QScriptEngine *engine);
14581
 QScriptValue QAbstractItemModel_index(QScriptContext *context, QScriptEngine *engine);
14581
 QScriptValue QAbstractItemModel_rowCount(QScriptContext *context, QScriptEngine *engine);
14582
 QScriptValue QAbstractItemModel_rowCount(QScriptContext *context, QScriptEngine *engine);
14582
 QScriptValue QAbstractItemModel_hasChildren(QScriptContext *context, QScriptEngine *engine);
14583
 QScriptValue QAbstractItemModel_hasChildren(QScriptContext *context, QScriptEngine *engine);
14583
-	
14584
+
14584
 @ The constructor is trivial.
14585
 @ The constructor is trivial.
14585
 
14586
 
14586
 @<Functions for scripting@>=
14587
 @<Functions for scripting@>=
15149
 	NodeInserter *basicButtonInserter = new NodeInserter(tr("Annotation Button"), tr("Annotation Button"), "annotationbutton");
15150
 	NodeInserter *basicButtonInserter = new NodeInserter(tr("Annotation Button"), tr("Annotation Button"), "annotationbutton");
15150
 	NodeInserter *countingButtonInserter = new NodeInserter(tr("Counting Button"), tr("Counting Button"), "reconfigurablebutton");
15151
 	NodeInserter *countingButtonInserter = new NodeInserter(tr("Counting Button"), tr("Counting Button"), "reconfigurablebutton");
15151
 	NodeInserter *spinBoxInserter = new NodeInserter(tr("Numeric Entry"), tr("Numeric Entry"), "annotationspinbox");
15152
 	NodeInserter *spinBoxInserter = new NodeInserter(tr("Numeric Entry"), tr("Numeric Entry"), "annotationspinbox");
15153
+	NodeInserter *freeAnnotationInserter = new NodeInserter(tr("Free Text"),
15154
+	                                                        tr("Free Text"),
15155
+	                                                        "freeannotation");
15152
 	annotationMenu->addAction(basicButtonInserter);
15156
 	annotationMenu->addAction(basicButtonInserter);
15153
 	annotationMenu->addAction(countingButtonInserter);
15157
 	annotationMenu->addAction(countingButtonInserter);
15154
 	annotationMenu->addAction(spinBoxInserter);
15158
 	annotationMenu->addAction(spinBoxInserter);
15159
+	annotationMenu->addAction(freeAnnotationInserter);
15155
 	connect(basicButtonInserter, SIGNAL(triggered(QString, QString)),
15160
 	connect(basicButtonInserter, SIGNAL(triggered(QString, QString)),
15156
 	        this, SLOT(insertChildNode(QString, QString)));
15161
 	        this, SLOT(insertChildNode(QString, QString)));
15157
 	connect(countingButtonInserter, SIGNAL(triggered(QString, QString)),
15162
 	connect(countingButtonInserter, SIGNAL(triggered(QString, QString)),
15158
 	        this, SLOT(insertChildNode(QString, QString)));
15163
 	        this, SLOT(insertChildNode(QString, QString)));
15159
 	connect(spinBoxInserter, SIGNAL(triggered(QString, QString)),
15164
 	connect(spinBoxInserter, SIGNAL(triggered(QString, QString)),
15160
 	        this, SLOT(insertChildNode(QString, QString)));
15165
 	        this, SLOT(insertChildNode(QString, QString)));
15166
+	connect(freeAnnotationInserter, SIGNAL(triggered(QString, QString)),
15167
+	        this, SLOT(insertChildNode(QString, QString)));
15161
 	addAnnotationControlButton->setMenu(annotationMenu);
15168
 	addAnnotationControlButton->setMenu(annotationMenu);
15162
 	layout->addWidget(addAnnotationControlButton);
15169
 	layout->addWidget(addAnnotationControlButton);
15163
 	QPushButton *advancedButton = new QPushButton(tr("Advanced Features"));
15170
 	QPushButton *advancedButton = new QPushButton(tr("Advanced Features"));
15190
 	connect(id, SIGNAL(valueChanged(int)), this, SLOT(updateRoasterId(int)));
15197
 	connect(id, SIGNAL(valueChanged(int)), this, SLOT(updateRoasterId(int)));
15191
 	setLayout(layout);
15198
 	setLayout(layout);
15192
 }
15199
 }
15193
-	
15200
+
15194
 @ Iterating over the configuration data associated with the current node is
15201
 @ Iterating over the configuration data associated with the current node is
15195
 required in nearly every configuration widget. The specifics of the loop
15202
 required in nearly every configuration widget. The specifics of the loop
15196
 vary, but there is likely a better way to generalize that. Until then,
15203
 vary, but there is likely a better way to generalize that. Until then,
15452
 	NiDaqMxBase9211ConfWidget::staticMetaObject);
15459
 	NiDaqMxBase9211ConfWidget::staticMetaObject);
15453
 app.registerDeviceConfigurationWidget("ni9211seriestc",
15460
 app.registerDeviceConfigurationWidget("ni9211seriestc",
15454
 	Ni9211TcConfWidget::staticMetaObject);
15461
 	Ni9211TcConfWidget::staticMetaObject);
15455
-	
15462
+
15456
 @ Furthermore, we should create the NodeInserter objects for adding top level
15463
 @ Furthermore, we should create the NodeInserter objects for adding top level
15457
 nodes to the configuration. Preferably we would only allow top level nodes to
15464
 nodes to the configuration. Preferably we would only allow top level nodes to
15458
 be inserted when all prerequisite software is available.
15465
 be inserted when all prerequisite software is available.
16639
 topLevelNodeInserters.append(inserter);
16646
 topLevelNodeInserters.append(inserter);
16640
 #endif
16647
 #endif
16641
 
16648
 
16642
-@* Configuration of Annotation Controls.
16649
+@** Configuration of Annotation Controls.
16643
 
16650
 
16644
 \noindent Aside from the details of hardware devices, the logging view must
16651
 \noindent Aside from the details of hardware devices, the logging view must
16645
 also be able to set up log annotation controls. A few different control types
16652
 also be able to set up log annotation controls. A few different control types
16908
 @<Register device configuration widgets@>=
16915
 @<Register device configuration widgets@>=
16909
 app.registerDeviceConfigurationWidget("annotationspinbox", NoteSpinConfWidget::staticMetaObject);
16916
 app.registerDeviceConfigurationWidget("annotationspinbox", NoteSpinConfWidget::staticMetaObject);
16910
 
16917
 
16918
+@i freeannotation.w
16919
+
16911
 @** Communicating with a Device through Modbus RTU.
16920
 @** Communicating with a Device through Modbus RTU.
16912
 
16921
 
16913
 \noindent The classes described here need to be further generalized to support
16922
 \noindent The classes described here need to be further generalized to support
17362
 length with the total length determined by the sum of 5 and the value in the
17371
 length with the total length determined by the sum of 5 and the value in the
17363
 fifth byte. Messages with a function number of 0x05, 0x06, or 0x10 will be 8
17372
 fifth byte. Messages with a function number of 0x05, 0x06, or 0x10 will be 8
17364
 bytes in length. Messages with a function number greater than 0x80 will be five
17373
 bytes in length. Messages with a function number greater than 0x80 will be five
17365
-bytes in length. 
17374
+bytes in length.
17366
 
17375
 
17367
 @<Check Modbus RTU message size@>=
17376
 @<Check Modbus RTU message size@>=
17368
 if(responseBuffer.size() < 5)
17377
 if(responseBuffer.size() < 5)
17480
 	char *valBytes = (char*)&outval;
17489
 	char *valBytes = (char*)&outval;
17481
 	message.append(valBytes[1]);
17490
 	message.append(valBytes[1]);
17482
 	message.append(valBytes[0]);
17491
 	message.append(valBytes[0]);
17483
-	queueMessage(message, this, "ignore(QByteArray)");	
17492
+	queueMessage(message, this, "ignore(QByteArray)");
17484
 }
17493
 }
17485
 
17494
 
17486
 @ We don't care about the response when sending a new SV.
17495
 @ We don't care about the response when sending a new SV.
18144
 			@<Convert numeric array literal to list@>@;
18153
 			@<Convert numeric array literal to list@>@;
18145
 			int column = 0;
18154
 			int column = 0;
18146
 			@<Populate model column from list@>@;
18155
 			@<Populate model column from list@>@;
18147
-			
18156
+
18148
 		}
18157
 		}
18149
 		else if(node.attribute("name") == "destinationvalues")
18158
 		else if(node.attribute("name") == "destinationvalues")
18150
 		{
18159
 		{
18183
 {
18192
 {
18184
 	knotmodel->setData(knotmodel->index(i, column),
18193
 	knotmodel->setData(knotmodel->index(i, column),
18185
 	                   QVariant(itemList.at(i).toDouble()),
18194
 	                   QVariant(itemList.at(i).toDouble()),
18186
-                       Qt::DisplayRole);   
18195
+                       Qt::DisplayRole);
18187
 }
18196
 }
18188
 
18197
 
18189
 @ When data in the table is changed we simply overwrite any previously saved
18198
 @ When data in the table is changed we simply overwrite any previously saved

Loading…
Cancel
Save