Browse Source

Merge branch 'development' into programpipe

Neal Wilson 10 years ago
parent
commit
378a31c202

+ 2
- 1
.gitignore View File

@@ -9,4 +9,5 @@ typica.c
9 9
 *.pdf
10 10
 *.scn
11 11
 *.toc
12
-Typica-build*
12
+Typica-build*
13
+*.o

+ 24
- 1
config/Reports/dailyproductiondetail.xml View File

@@ -100,7 +100,12 @@
100 100
 					output.writeStartElement("tr");
101 101
 					output.writeTextElement("td", String(query.value(0)).split("T")[1]);
102 102
 					output.writeTextElement("td", query.value(2));
103
-					output.writeTextElement("td", query.value(11));
103
+					output.writeStartElement("td");
104
+					output.writeStartElement("a");
105
+					output.writeAttribute("href", "typica://script/p" + query.value(11).slice(1,-1));
106
+					output.writeCDATA(query.value(11));
107
+					output.writeEndElement();
108
+					output.writeEndElement();
104 109
 					var unroastedWeightsList = sqlToArray(query.value(5));
105 110
 					output.writeStartElement("td");
106 111
 					for(var i = 0; i < unroastedWeightsList.length; i++)
@@ -407,6 +412,24 @@
407 412
 			dateField.dateChanged.connect(function() {
408 413
 				refresh();
409 414
 			});
415
+			
416
+			view.scriptLinkClicked.connect(function(url) {
417
+				var arg = url.slice(1, url.length);
418
+				var details = createWindow("batchDetails");
419
+				var fakeTable = new Object;
420
+				fakeTable.holding = new Array(7);
421
+				fakeTable.data = function(r, c) {
422
+					return this.holding[c];
423
+				};
424
+				var query = new QSqlQuery();
425
+				query.exec("SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) AS weight_loss, duration, annotation FROM roasting_log WHERE files = '{" + arg + "}'");
426
+				query.next();
427
+				for(var i = 0; i < 8; i++) {
428
+					fakeTable.holding[i] = query.value(i);
429
+				}
430
+				query = query.invalidate();
431
+				details.loadData(fakeTable, 0);
432
+			});
410 433
 		]]>
411 434
 	</program>
412 435
 </window>

+ 15
- 1
config/Windows/batchdetailsnew.xml View File

@@ -8,6 +8,9 @@
8 8
         </layout>
9 9
         <webview id="view" />
10 10
     </layout>
11
+	<menu name="File">
12
+		<item id="save" shortcut="Ctrl+S">Save…</item>
13
+	</menu>
11 14
     <program>
12 15
         <![CDATA[
13 16
 			var window = this;
@@ -139,7 +142,11 @@
139 142
 					viewer.windowTitle = "Typica - " + pname;
140 143
 					viewer.raise();
141 144
 					viewer.activateWindow();
145
+					graph.updatesEnabled = false;
146
+					log.updatesEnabled = false;
142 147
 					input.input();
148
+					log.updatesEnabled = true;
149
+					graph.updatesEnabled = true;
143 150
 					log.newAnnotation("End", 1, lc);
144 151
 				}
145 152
 				else {
@@ -209,7 +216,7 @@
209 216
 					nameQuery.bind(":id", items[i]);
210 217
 					nameQuery.exec();
211 218
 					nameQuery.next();
212
-					output.writeTextElement("td", nameQuery.value(0));
219
+					output.writeTextElement("td", nameQuery.value(0) + " (" + items[i] + ")");
213 220
 					output.writeStartElement("td");
214 221
 					output.writeAttribute("align", "center");
215 222
 					output.writeCharacters(quantities[i]);
@@ -330,6 +337,13 @@
330 337
 				query = query.invalidate();
331 338
 				edit.enabled = true;
332 339
 			};
340
+			var saveMenu = findChildObject(this, 'save');
341
+			saveMenu.triggered.connect(function() {
342
+				var filename = QFileDialog.getSaveFileName(window, "Save Log As…", QSettings.value("script/lastDir", "") + "/");
343
+				if(filename != "") {
344
+					saveFileFromDatabase(fileID, filename);
345
+				}
346
+			});
333 347
         ]]>
334 348
     </program>
335 349
 </window>

+ 1
- 1
config/Windows/invoicelist.xml View File

@@ -6,7 +6,7 @@
6 6
 		<![CDATA[
7 7
 			this.windowTitle = "Typica - Invoice List";
8 8
 			var table = findChildObject(this, 'table');
9
-			table.setQuery("SELECT id, time, invoice, vendor FROM invoices ORDER BY time DESC");
9
+			table.setQuery("SELECT id, time, invoice, vendor, (SELECT sum(cost) FROM invoice_items WHERE invoice_id = id) AS cost FROM invoices ORDER BY time DESC");
10 10
 			table.openEntry.connect(function(arg) {
11 11
 				var info = createWindow("invoiceinfo");
12 12
 				info.setInvoiceID(arg);

+ 8
- 2
config/Windows/newbatch.xml View File

@@ -244,6 +244,8 @@
244 244
                 query.bind(":item", Number(roasted.currentData()));
245 245
                 query.bind(":again", Number(roasted.currentData()));
246 246
 				query.exec();
247
+				var graph;
248
+				var log;
247 249
 				if(query.next())
248 250
 				{
249 251
 					var files = query.value(0);
@@ -259,8 +261,8 @@
259 261
 						var buffer = new QBuffer(query.value(0));
260 262
 						var pname = query.value(1);
261 263
 						var input = new XMLInput(buffer, 1);
262
-						var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
263
-						var log = findChildObject(navigationwindow.loggingWindow, 'log');
264
+						graph = findChildObject(navigationwindow.loggingWindow, 'graph');
265
+						log = findChildObject(navigationwindow.loggingWindow, 'log');
264 266
 						log.clear();
265 267
 						graph.clear();
266 268
 						input.newTemperatureColumn.connect(log.setHeaderData);
@@ -296,7 +298,11 @@
296 298
 				navigationwindow.loggingWindow.windowTitle = "Typica - [*]" + pname;
297 299
 				navigationwindow.loggingWindow.raise();
298 300
 				navigationwindow.loggingWindow.activateWindow();
301
+				graph.updatesEnabled = false;
302
+				log.updatesEnabled = false;
299 303
 				input.input();
304
+				log.updatesEnabled = true;
305
+				graph.updatesEnabled = true;
300 306
 				log.newAnnotation("End", 1, lc);
301 307
 			});
302 308
 			var noprofilebutton = findChildObject(this, 'noprofile');

+ 4
- 0
config/Windows/newsamplebatch.xml View File

@@ -227,7 +227,11 @@
227 227
 						});
228 228
 						navigationwindow.loggingWindow.raise();
229 229
 						navigationwindow.loggingWindow.activateWindow();
230
+						log.updatesEnabled = false;
231
+						graph.updatesEnabled = false;
230 232
 						input.input();
233
+						graph.updatesEnabled = true;
234
+						log.updatesEnabled = true;
231 235
 						log.newAnnotation("End", 1, lc);
232 236
 					}
233 237
 				}

+ 14
- 6
config/Windows/productionroaster.xml View File

@@ -64,6 +64,7 @@
64 64
 		var translationCurrentColumn = -1;
65 65
 		var configModel = new DeviceTreeModel;
66 66
 		var rootIndex = configModel.index(roasterlist.currentIndex, 0);
67
+		var roasterIndex = roasterlist.currentIndex;
67 68
 		var channels = new Array();
68 69
 		var annotationButtons = new Array();
69 70
 		var nidevices = new Array();
@@ -639,17 +640,20 @@
639 640
 			delete dataqsdkdevices;
640 641
 			delete jsdevices;
641 642
             window.saveSizeAndPosition("window");
642
-            vsplit.saveState("script/mainSplitter");
643
-            isplit.saveState("script/instrumentSplitter");
644
-            lsplit.saveState("script/logSplitter");
643
+            vsplit.saveState("script/loggingView/" + roasterIndex + "/mainSplitter");
644
+			QSettings.setValue("script/loggingView/" + roasterIndex + "/instrumentCount", isplit.count());
645
+            isplit.saveState("script/loggingView/" + roasterIndex + "/instrumentSplitter");
646
+            lsplit.saveState("script/loggingView/" + roasterIndex + "/logSplitter");
645 647
             log.saveState("script/log", 7);
646 648
 			window.navigationWindow.loggingWindow = undefined;
647 649
 			Windows.loggingWindow = undefined;
648 650
         });
649 651
 		this.restoreSizeAndPosition('window');
650
-        vsplit.restoreState("script/mainSplitter");
651
-        isplit.restoreState("script/instrumentSplitter");
652
-        lsplit.restoreState("script/logSplitter");
652
+        vsplit.restoreState("script/loggingView/" + roasterIndex + "/mainSplitter");
653
+		if(QSettings.value("script/loggingView/" + roasterIndex + "/instrumentCount") == isplit.count()) {
654
+			isplit.restoreState("script/loggingView/" + roasterIndex + "/instrumentSplitter");
655
+		}
656
+        lsplit.restoreState("script/loggingView/" + roasterIndex + "/logSplitter");
653 657
 		log.restoreState("script/log", 7);
654 658
 		var offsets = new Array();
655 659
 		var zeroemitters = new Array();
@@ -889,7 +893,11 @@
889 893
                     QSettings.setValue("liveColumn", c + 1);
890 894
 					window.postLoadColumnSetup(c);
891 895
 				});
896
+				graph.updatesEnabled = false;
897
+				log.updatesEnabled = false;
892 898
                 input.input();
899
+				log.updatesEnabled = true;
900
+				graph.updatesEnabled = true;
893 901
                 window.windowTitle = 'Typica - [*]' + baseName(filename);
894 902
                 QSettings.setValue("script/lastDir", dir(filename));
895 903
 				log.newAnnotation("End", 1, lc);

+ 4
- 2
src/Typica.pro View File

@@ -24,7 +24,8 @@ HEADERS += moc_typica.cpp \
24 24
     webelement.h \
25 25
     scale.h \
26 26
     draglabel.h \
27
-    daterangeselector.h
27
+    daterangeselector.h \
28
+    feedback.h
28 29
 SOURCES += typica.cpp \
29 30
     helpmenu.cpp \
30 31
     abouttypica.cpp \
@@ -33,7 +34,8 @@ SOURCES += typica.cpp \
33 34
     webelement.cpp \
34 35
     scale.cpp \
35 36
     draglabel.cpp \
36
-    daterangeselector.cpp
37
+    daterangeselector.cpp \
38
+    feedback.cpp
37 39
 
38 40
 RESOURCES += \
39 41
     resources.qrc

+ 61
- 0
src/advancedsettings.w View File

@@ -0,0 +1,61 @@
1
+@* Advanced settings configuration.
2
+
3
+\noindent Sometimes a feature has a sensible default that should be used the
4
+vast majority of the time but sometimes requires some other setting to be
5
+available in a reasonably accessible way.
6
+
7
+@<Class declarations@>=
8
+class AdvancedSettingsWidget : public QWidget@/
9
+{@/
10
+	@[Q_OBJECT@]@;
11
+	public:@/
12
+		AdvancedSettingsWidget();
13
+	@[public slots:@]@/
14
+		void enableDiagnosticLogging(bool enabled);
15
+};
16
+
17
+@ At present the advanced settings consist only of an option to redirect
18
+diagnostic output to a file. This should normally be disabled as it supresses
19
+console output and there is no mechanism within \pn{} for periodically removing
20
+the files generated. It is, however, useful for producing a diagnostic file
21
+that can be attached to an email if someone is encountering an issue that they
22
+are not able to resolve on their own. It is especially useful on Microsoft
23
+Windows where this output is not otherwise available unless Typica is run from
24
+software development tools most people do not have installed.
25
+
26
+@<AdvancedSettingsWidget implementation@>=
27
+AdvancedSettingsWidget::AdvancedSettingsWidget() : QWidget(NULL)
28
+{
29
+	QSettings settings;
30
+	QFormLayout *layout = new QFormLayout;
31
+	QCheckBox *logDiagnostics = new QCheckBox;
32
+	logDiagnostics->setCheckState(
33
+		settings.value("settings/advanced/logging", false).toBool() ?
34
+		Qt::Checked : Qt::Unchecked);
35
+	connect(logDiagnostics, SIGNAL(toggled(bool)), this, SLOT(enableDiagnosticLogging(bool)));
36
+	layout->addRow(tr("Enable diagnostic logging"), logDiagnostics);
37
+	setLayout(layout);
38
+}
39
+
40
+@ Changes to this setting should take effect immediately. It should also be
41
+written to |QSettings| so the feature can be correctly enabled or not. 
42
+
43
+@<AdvancedSettingsWidget implementation@>=
44
+void AdvancedSettingsWidget::enableDiagnosticLogging(bool enabled)
45
+{
46
+	QSettings settings;
47
+	settings.setValue("settings/advanced/logging", enabled);
48
+	if(enabled)
49
+	{
50
+		qInstallMsgHandler(messageFileOutput);
51
+	}
52
+	else
53
+	{
54
+		qInstallMsgHandler(0);
55
+	}
56
+}
57
+
58
+@ Currently the implementation is brought into typica.cpp.
59
+
60
+@<Class implementations@>=
61
+@<AdvancedSettingsWidget implementation@>

+ 1
- 1
src/dataqsdk.w View File

@@ -339,7 +339,7 @@ void DataqSdkDeviceImplementation::run()
339 339
 	sampleRate = di_sample_rate(sampleRate * channels * 40, &oversample,
340 340
 	                            &burstDivisor);
341 341
 	buffer = new qint16[(int)sampleRate];
342
-	di_inlist_struct inlist[16] = {{0}};
342
+	di_inlist_struct inlist[16] = {{0, 0, 0, 0, 0, 0, 0, 0}};
343 343
 	for(unsigned short i = 0; i < channels; i++)
344 344
 	{
345 345
 		inlist[i].chan = i;

+ 3
- 2
src/daterangeselector.w View File

@@ -30,11 +30,13 @@ access to the ISO 8601 string representation of these dates is provided.
30 30
 @(daterangeselector.h@>=
31 31
 
32 32
 #include <QComboBox>
33
+#include <QPushButton>
34
+#include <QCalendarWidget>
33 35
 
34 36
 #ifndef TypicaDateRangeSelectorHeader
35 37
 #define TypicaDateRangeSelectorHeader
36 38
 
37
-class CustomDateRangePopup;
39
+@<CustomDateRangePopup declaration@>@;
38 40
 
39 41
 class DateRangeSelector : public QWidget
40 42
 {
@@ -74,7 +76,6 @@ class DateRangeSelector : public QWidget
74 76
 
75 77
 #include "daterangeselector.h"
76 78
 
77
-@<CustomDateRangePopup declaration@>
78 79
 @<CustomDateRangePopup implementation@>
79 80
 @<DateRangeSelector implementation@>
80 81
 

+ 127
- 0
src/feedback.w View File

@@ -0,0 +1,127 @@
1
+@* The Feedback Wizard.
2
+
3
+\noindent While the About Typica window includes a link for sending email, this
4
+is not as obvious as a Send Feedback option from the Help menu. It also does
5
+not provide an adequate amount of prompting for feedback to be useful.
6
+
7
+This functionality is provided in the form of a |QWizard| and five
8
+|QWizardPage|s to guide people through the feedback process.
9
+
10
+@(feedback.h@>=
11
+#include <QWizard>
12
+#include <QComboBox>
13
+#include <QTextEdit>
14
+#include <QLabel>
15
+
16
+#ifndef FeedbackHeader
17
+#define FeedbackHeader
18
+
19
+class FeedbackWizard : public QWizard
20
+{
21
+	Q_OBJECT
22
+	public:
23
+		FeedbackWizard();
24
+	private slots:
25
+		void setCommentInstructions(int index);
26
+	private:
27
+		QComboBox *feedbackType;
28
+		QLabel *commentInstructions;
29
+		QTextEdit *comment;
30
+};
31
+
32
+#endif
33
+
34
+@ Implementation is in a separate file.
35
+
36
+@(feedback.cpp@>=
37
+#include "feedback.h"
38
+#include <QLabel>
39
+#include <QVBoxLayout>
40
+#include <QWizardPage>
41
+
42
+@<Feedback wizard implementation@>@;
43
+
44
+@ The feedback wizard constructor is responsible for setting up its appearance,
45
+adding pages, and ensuring connections for properly responding to input are set
46
+up.
47
+
48
+@<Feedback wizard implementation@>=
49
+FeedbackWizard::FeedbackWizard() : QWizard()
50
+{
51
+	@<Set wizard graphics@>@;
52
+	@<Set feedback wizard pages@>@;
53
+}
54
+
55
+@ At present we do not have any custom graphics for wizards. If we did, they
56
+would go here.
57
+
58
+@<Set wizard graphics@>=
59
+/* Nothing needs to be done here. */
60
+
61
+@ The first page presented is an introduction page where we would like to know
62
+what sort of feedback is going to be provided. This is selected in a
63
+|QComboBox| which wil be used to update information on later pages.
64
+
65
+@<Set feedback wizard pages@>=
66
+QWizardPage *introPage = new QWizardPage;
67
+introPage->setTitle(tr("Send Feedback"));
68
+introPage->setSubTitle("Select the type of feedback you wish to provide");
69
+setPixmap(QWizard::LogoPixmap, QPixmap(":/resources/icons/appicons/logo48.png"));
70
+QLabel *page1prompt = new QLabel(tr("What sort of feedback would you like to provide?"));
71
+feedbackType = new QComboBox;
72
+feedbackType->addItem(tr("Bug Report"));
73
+feedbackType->addItem(tr("Comment"));
74
+feedbackType->addItem(tr("Feature Request"));
75
+feedbackType->addItem(tr("Question"));
76
+QVBoxLayout *page1layout = new QVBoxLayout;
77
+page1layout->addStretch();
78
+page1layout->addWidget(page1prompt);
79
+page1layout->addWidget(feedbackType);
80
+page1layout->addStretch();
81
+introPage->setLayout(page1layout);
82
+addPage(introPage);
83
+connect(feedbackType, SIGNAL(currentIndexChanged(int)), this, SLOT(setCommentInstructions(int)));
84
+commentInstructions = new QLabel;
85
+commentInstructions->setWordWrap(true);
86
+setCommentInstructions(0);
87
+
88
+@ The selection on the first page influences the instructions provided on the
89
+second page.
90
+
91
+@<Feedback wizard implementation@>=
92
+void FeedbackWizard::setCommentInstructions(int index)
93
+{
94
+	switch(index)
95
+	{
96
+		case 0:
97
+			commentInstructions->setText(tr("Please provide as complete a description of the issue as possible. Useful information includes step by step instructions for replicating the issue, the resulting behavior, and what you expected."));
98
+			break;
99
+		case 1:
100
+			commentInstructions->setText(tr("If you would like action to occur based on your comment, please be specific."));
101
+			break;
102
+		case 2:
103
+			commentInstructions->setText(tr("Please try to be as clear as possible about what you want, where you believe this would fit in with what is already provided, and provide a description of why this would be useful."));
104
+			break;
105
+		case 3:
106
+			commentInstructions->setText(tr("Please be specific and provide any information that you think might be useful in answering your question."));
107
+			break;
108
+		default:
109
+			commentInstructions->setText("");
110
+			break;
111
+	}
112
+}
113
+
114
+@ The second page provides both guidance on writing feedback and an area for typing this.
115
+
116
+@<Set feedback wizard pages@>=
117
+QWizardPage *commentPage = new QWizardPage;
118
+commentPage->setTitle(tr("Send Feedback"));
119
+commentPage->setSubTitle(tr("Your feedback is appreciated"));
120
+comment = new QTextEdit;
121
+QVBoxLayout *page2layout = new QVBoxLayout;
122
+page2layout->addStretch();
123
+page2layout->addWidget(commentInstructions);
124
+page2layout->addWidget(comment);
125
+page2layout->addStretch();
126
+commentPage->setLayout(page2layout);
127
+addPage(commentPage);

+ 15
- 0
src/helpmenu.w View File

@@ -26,6 +26,7 @@ class HelpMenu : public QMenu
26 26
 		HelpMenu();
27 27
 	public slots:
28 28
 		void displayAboutTypica();
29
+		void displayFeedbackWizard();
29 30
 };
30 31
 
31 32
 #endif
@@ -35,6 +36,7 @@ class HelpMenu : public QMenu
35 36
 @(helpmenu.cpp@>=
36 37
 #include "helpmenu.h"
37 38
 #include "abouttypica.h"
39
+#include "feedback.h"
38 40
 
39 41
 @<Help menu implementation@>@;
40 42
 
@@ -53,6 +55,10 @@ HelpMenu::HelpMenu() : QMenu()
53 55
 	aboutTypicaAction->setObjectName("aboutTypicaAction");
54 56
 	addAction(aboutTypicaAction);
55 57
 	connect(aboutTypicaAction, SIGNAL(triggered()), this, SLOT(displayAboutTypica()));
58
+	QAction *sendFeedbackAction = new QAction(tr("Send Feedback"), this);
59
+	sendFeedbackAction->setObjectName("sendFeedback");
60
+	addAction(sendFeedbackAction);
61
+	connect(sendFeedbackAction, SIGNAL(triggered()), this, SLOT(displayFeedbackWizard()));
56 62
 }
57 63
 
58 64
 @ When "About Typica" is selected from the menu, we display an about box. This
@@ -65,3 +71,12 @@ void HelpMenu::displayAboutTypica()
65 71
 	aboutBox->show();
66 72
 }
67 73
 
74
+@ A feedback wizard is also available from the Help menu.
75
+
76
+@<Help menu implementation@>=
77
+void HelpMenu::displayFeedbackWizard()
78
+{
79
+	FeedbackWizard *window = new FeedbackWizard;
80
+	window->show();
81
+}
82
+

+ 80
- 0
src/moc_abouttypica.cpp View File

@@ -0,0 +1,80 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'abouttypica.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "abouttypica.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'abouttypica.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_AboutTypica[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       0,    0, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+       0        // eod
33
+};
34
+
35
+static const char qt_meta_stringdata_AboutTypica[] = {
36
+    "AboutTypica\0"
37
+};
38
+
39
+void AboutTypica::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
40
+{
41
+    Q_UNUSED(_o);
42
+    Q_UNUSED(_id);
43
+    Q_UNUSED(_c);
44
+    Q_UNUSED(_a);
45
+}
46
+
47
+const QMetaObjectExtraData AboutTypica::staticMetaObjectExtraData = {
48
+    0,  qt_static_metacall 
49
+};
50
+
51
+const QMetaObject AboutTypica::staticMetaObject = {
52
+    { &QMainWindow::staticMetaObject, qt_meta_stringdata_AboutTypica,
53
+      qt_meta_data_AboutTypica, &staticMetaObjectExtraData }
54
+};
55
+
56
+#ifdef Q_NO_DATA_RELOCATION
57
+const QMetaObject &AboutTypica::getStaticMetaObject() { return staticMetaObject; }
58
+#endif //Q_NO_DATA_RELOCATION
59
+
60
+const QMetaObject *AboutTypica::metaObject() const
61
+{
62
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
63
+}
64
+
65
+void *AboutTypica::qt_metacast(const char *_clname)
66
+{
67
+    if (!_clname) return 0;
68
+    if (!strcmp(_clname, qt_meta_stringdata_AboutTypica))
69
+        return static_cast<void*>(const_cast< AboutTypica*>(this));
70
+    return QMainWindow::qt_metacast(_clname);
71
+}
72
+
73
+int AboutTypica::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
74
+{
75
+    _id = QMainWindow::qt_metacall(_c, _id, _a);
76
+    if (_id < 0)
77
+        return _id;
78
+    return _id;
79
+}
80
+QT_END_MOC_NAMESPACE

+ 210
- 0
src/moc_daterangeselector.cpp View File

@@ -0,0 +1,210 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'daterangeselector.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "daterangeselector.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'daterangeselector.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_CustomDateRangePopup[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       3,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       1,       // signalCount
31
+
32
+ // signals: signature, parameters, type, tag, flags
33
+      22,   21,   21,   21, 0x05,
34
+
35
+ // slots: signature, parameters, type, tag, flags
36
+      36,   21,   21,   21, 0x0a,
37
+      49,   21,   21,   21, 0x08,
38
+
39
+       0        // eod
40
+};
41
+
42
+static const char qt_meta_stringdata_CustomDateRangePopup[] = {
43
+    "CustomDateRangePopup\0\0hidingPopup()\0"
44
+    "applyRange()\0validateRange()\0"
45
+};
46
+
47
+void CustomDateRangePopup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
48
+{
49
+    if (_c == QMetaObject::InvokeMetaMethod) {
50
+        Q_ASSERT(staticMetaObject.cast(_o));
51
+        CustomDateRangePopup *_t = static_cast<CustomDateRangePopup *>(_o);
52
+        switch (_id) {
53
+        case 0: _t->hidingPopup(); break;
54
+        case 1: _t->applyRange(); break;
55
+        case 2: _t->validateRange(); break;
56
+        default: ;
57
+        }
58
+    }
59
+    Q_UNUSED(_a);
60
+}
61
+
62
+const QMetaObjectExtraData CustomDateRangePopup::staticMetaObjectExtraData = {
63
+    0,  qt_static_metacall 
64
+};
65
+
66
+const QMetaObject CustomDateRangePopup::staticMetaObject = {
67
+    { &QWidget::staticMetaObject, qt_meta_stringdata_CustomDateRangePopup,
68
+      qt_meta_data_CustomDateRangePopup, &staticMetaObjectExtraData }
69
+};
70
+
71
+#ifdef Q_NO_DATA_RELOCATION
72
+const QMetaObject &CustomDateRangePopup::getStaticMetaObject() { return staticMetaObject; }
73
+#endif //Q_NO_DATA_RELOCATION
74
+
75
+const QMetaObject *CustomDateRangePopup::metaObject() const
76
+{
77
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
78
+}
79
+
80
+void *CustomDateRangePopup::qt_metacast(const char *_clname)
81
+{
82
+    if (!_clname) return 0;
83
+    if (!strcmp(_clname, qt_meta_stringdata_CustomDateRangePopup))
84
+        return static_cast<void*>(const_cast< CustomDateRangePopup*>(this));
85
+    return QWidget::qt_metacast(_clname);
86
+}
87
+
88
+int CustomDateRangePopup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
89
+{
90
+    _id = QWidget::qt_metacall(_c, _id, _a);
91
+    if (_id < 0)
92
+        return _id;
93
+    if (_c == QMetaObject::InvokeMetaMethod) {
94
+        if (_id < 3)
95
+            qt_static_metacall(this, _c, _id, _a);
96
+        _id -= 3;
97
+    }
98
+    return _id;
99
+}
100
+
101
+// SIGNAL 0
102
+void CustomDateRangePopup::hidingPopup()
103
+{
104
+    QMetaObject::activate(this, &staticMetaObject, 0, 0);
105
+}
106
+static const uint qt_meta_data_DateRangeSelector[] = {
107
+
108
+ // content:
109
+       6,       // revision
110
+       0,       // classname
111
+       0,    0, // classinfo
112
+       8,   14, // methods
113
+       0,    0, // properties
114
+       0,    0, // enums/sets
115
+       0,    0, // constructors
116
+       0,       // flags
117
+       1,       // signalCount
118
+
119
+ // signals: signature, parameters, type, tag, flags
120
+      19,   18,   18,   18, 0x05,
121
+
122
+ // slots: signature, parameters, type, tag, flags
123
+      48,   42,   18,   18, 0x0a,
124
+      87,   69,   18,   18, 0x0a,
125
+     121,   42,   18,   18, 0x0a,
126
+     138,   18,   18,   18, 0x08,
127
+     153,   18,   18,   18, 0x08,
128
+     167,   42,   18,   18, 0x08,
129
+
130
+ // methods: signature, parameters, type, tag, flags
131
+     193,   18,  184,   18, 0x02,
132
+
133
+       0        // eod
134
+};
135
+
136
+static const char qt_meta_stringdata_DateRangeSelector[] = {
137
+    "DateRangeSelector\0\0rangeUpdated(QVariant)\0"
138
+    "index\0setCurrentIndex(int)\0startDate,endDate\0"
139
+    "setLifetimeRange(QString,QString)\0"
140
+    "removeIndex(int)\0toggleCustom()\0"
141
+    "popupHidden()\0updateRange(int)\0QVariant\0"
142
+    "currentRange()\0"
143
+};
144
+
145
+void DateRangeSelector::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
146
+{
147
+    if (_c == QMetaObject::InvokeMetaMethod) {
148
+        Q_ASSERT(staticMetaObject.cast(_o));
149
+        DateRangeSelector *_t = static_cast<DateRangeSelector *>(_o);
150
+        switch (_id) {
151
+        case 0: _t->rangeUpdated((*reinterpret_cast< QVariant(*)>(_a[1]))); break;
152
+        case 1: _t->setCurrentIndex((*reinterpret_cast< int(*)>(_a[1]))); break;
153
+        case 2: _t->setLifetimeRange((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
154
+        case 3: _t->removeIndex((*reinterpret_cast< int(*)>(_a[1]))); break;
155
+        case 4: _t->toggleCustom(); break;
156
+        case 5: _t->popupHidden(); break;
157
+        case 6: _t->updateRange((*reinterpret_cast< int(*)>(_a[1]))); break;
158
+        case 7: { QVariant _r = _t->currentRange();
159
+            if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; }  break;
160
+        default: ;
161
+        }
162
+    }
163
+}
164
+
165
+const QMetaObjectExtraData DateRangeSelector::staticMetaObjectExtraData = {
166
+    0,  qt_static_metacall 
167
+};
168
+
169
+const QMetaObject DateRangeSelector::staticMetaObject = {
170
+    { &QWidget::staticMetaObject, qt_meta_stringdata_DateRangeSelector,
171
+      qt_meta_data_DateRangeSelector, &staticMetaObjectExtraData }
172
+};
173
+
174
+#ifdef Q_NO_DATA_RELOCATION
175
+const QMetaObject &DateRangeSelector::getStaticMetaObject() { return staticMetaObject; }
176
+#endif //Q_NO_DATA_RELOCATION
177
+
178
+const QMetaObject *DateRangeSelector::metaObject() const
179
+{
180
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
181
+}
182
+
183
+void *DateRangeSelector::qt_metacast(const char *_clname)
184
+{
185
+    if (!_clname) return 0;
186
+    if (!strcmp(_clname, qt_meta_stringdata_DateRangeSelector))
187
+        return static_cast<void*>(const_cast< DateRangeSelector*>(this));
188
+    return QWidget::qt_metacast(_clname);
189
+}
190
+
191
+int DateRangeSelector::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
192
+{
193
+    _id = QWidget::qt_metacall(_c, _id, _a);
194
+    if (_id < 0)
195
+        return _id;
196
+    if (_c == QMetaObject::InvokeMetaMethod) {
197
+        if (_id < 8)
198
+            qt_static_metacall(this, _c, _id, _a);
199
+        _id -= 8;
200
+    }
201
+    return _id;
202
+}
203
+
204
+// SIGNAL 0
205
+void DateRangeSelector::rangeUpdated(QVariant _t1)
206
+{
207
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
208
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
209
+}
210
+QT_END_MOC_NAMESPACE

+ 80
- 0
src/moc_draglabel.cpp View File

@@ -0,0 +1,80 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'draglabel.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "draglabel.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'draglabel.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_DragLabel[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       0,    0, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+       0        // eod
33
+};
34
+
35
+static const char qt_meta_stringdata_DragLabel[] = {
36
+    "DragLabel\0"
37
+};
38
+
39
+void DragLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
40
+{
41
+    Q_UNUSED(_o);
42
+    Q_UNUSED(_id);
43
+    Q_UNUSED(_c);
44
+    Q_UNUSED(_a);
45
+}
46
+
47
+const QMetaObjectExtraData DragLabel::staticMetaObjectExtraData = {
48
+    0,  qt_static_metacall 
49
+};
50
+
51
+const QMetaObject DragLabel::staticMetaObject = {
52
+    { &QLabel::staticMetaObject, qt_meta_stringdata_DragLabel,
53
+      qt_meta_data_DragLabel, &staticMetaObjectExtraData }
54
+};
55
+
56
+#ifdef Q_NO_DATA_RELOCATION
57
+const QMetaObject &DragLabel::getStaticMetaObject() { return staticMetaObject; }
58
+#endif //Q_NO_DATA_RELOCATION
59
+
60
+const QMetaObject *DragLabel::metaObject() const
61
+{
62
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
63
+}
64
+
65
+void *DragLabel::qt_metacast(const char *_clname)
66
+{
67
+    if (!_clname) return 0;
68
+    if (!strcmp(_clname, qt_meta_stringdata_DragLabel))
69
+        return static_cast<void*>(const_cast< DragLabel*>(this));
70
+    return QLabel::qt_metacast(_clname);
71
+}
72
+
73
+int DragLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
74
+{
75
+    _id = QLabel::qt_metacall(_c, _id, _a);
76
+    if (_id < 0)
77
+        return _id;
78
+    return _id;
79
+}
80
+QT_END_MOC_NAMESPACE

+ 102
- 0
src/moc_feedback.cpp View File

@@ -0,0 +1,102 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'feedback.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "feedback.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'feedback.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_FeedbackWizard[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       5,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+ // slots: signature, parameters, type, tag, flags
33
+      22,   16,   15,   15, 0x08,
34
+      50,   15,   15,   15, 0x08,
35
+      70,   15,   15,   15, 0x08,
36
+      91,   15,   15,   15, 0x08,
37
+     107,   15,   15,   15, 0x08,
38
+
39
+       0        // eod
40
+};
41
+
42
+static const char qt_meta_stringdata_FeedbackWizard[] = {
43
+    "FeedbackWizard\0\0index\0setCommentInstructions(int)\0"
44
+    "updateMessageText()\0printButtonPressed()\0"
45
+    "printAccepted()\0copyButtonPressed()\0"
46
+};
47
+
48
+void FeedbackWizard::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
49
+{
50
+    if (_c == QMetaObject::InvokeMetaMethod) {
51
+        Q_ASSERT(staticMetaObject.cast(_o));
52
+        FeedbackWizard *_t = static_cast<FeedbackWizard *>(_o);
53
+        switch (_id) {
54
+        case 0: _t->setCommentInstructions((*reinterpret_cast< int(*)>(_a[1]))); break;
55
+        case 1: _t->updateMessageText(); break;
56
+        case 2: _t->printButtonPressed(); break;
57
+        case 3: _t->printAccepted(); break;
58
+        case 4: _t->copyButtonPressed(); break;
59
+        default: ;
60
+        }
61
+    }
62
+}
63
+
64
+const QMetaObjectExtraData FeedbackWizard::staticMetaObjectExtraData = {
65
+    0,  qt_static_metacall 
66
+};
67
+
68
+const QMetaObject FeedbackWizard::staticMetaObject = {
69
+    { &QWizard::staticMetaObject, qt_meta_stringdata_FeedbackWizard,
70
+      qt_meta_data_FeedbackWizard, &staticMetaObjectExtraData }
71
+};
72
+
73
+#ifdef Q_NO_DATA_RELOCATION
74
+const QMetaObject &FeedbackWizard::getStaticMetaObject() { return staticMetaObject; }
75
+#endif //Q_NO_DATA_RELOCATION
76
+
77
+const QMetaObject *FeedbackWizard::metaObject() const
78
+{
79
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
80
+}
81
+
82
+void *FeedbackWizard::qt_metacast(const char *_clname)
83
+{
84
+    if (!_clname) return 0;
85
+    if (!strcmp(_clname, qt_meta_stringdata_FeedbackWizard))
86
+        return static_cast<void*>(const_cast< FeedbackWizard*>(this));
87
+    return QWizard::qt_metacast(_clname);
88
+}
89
+
90
+int FeedbackWizard::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
91
+{
92
+    _id = QWizard::qt_metacall(_c, _id, _a);
93
+    if (_id < 0)
94
+        return _id;
95
+    if (_c == QMetaObject::InvokeMetaMethod) {
96
+        if (_id < 5)
97
+            qt_static_metacall(this, _c, _id, _a);
98
+        _id -= 5;
99
+    }
100
+    return _id;
101
+}
102
+QT_END_MOC_NAMESPACE

+ 96
- 0
src/moc_helpmenu.cpp View File

@@ -0,0 +1,96 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'helpmenu.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "helpmenu.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'helpmenu.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_HelpMenu[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       2,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+ // slots: signature, parameters, type, tag, flags
33
+      10,    9,    9,    9, 0x0a,
34
+      31,    9,    9,    9, 0x0a,
35
+
36
+       0        // eod
37
+};
38
+
39
+static const char qt_meta_stringdata_HelpMenu[] = {
40
+    "HelpMenu\0\0displayAboutTypica()\0"
41
+    "displayFeedbackWizard()\0"
42
+};
43
+
44
+void HelpMenu::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
45
+{
46
+    if (_c == QMetaObject::InvokeMetaMethod) {
47
+        Q_ASSERT(staticMetaObject.cast(_o));
48
+        HelpMenu *_t = static_cast<HelpMenu *>(_o);
49
+        switch (_id) {
50
+        case 0: _t->displayAboutTypica(); break;
51
+        case 1: _t->displayFeedbackWizard(); break;
52
+        default: ;
53
+        }
54
+    }
55
+    Q_UNUSED(_a);
56
+}
57
+
58
+const QMetaObjectExtraData HelpMenu::staticMetaObjectExtraData = {
59
+    0,  qt_static_metacall 
60
+};
61
+
62
+const QMetaObject HelpMenu::staticMetaObject = {
63
+    { &QMenu::staticMetaObject, qt_meta_stringdata_HelpMenu,
64
+      qt_meta_data_HelpMenu, &staticMetaObjectExtraData }
65
+};
66
+
67
+#ifdef Q_NO_DATA_RELOCATION
68
+const QMetaObject &HelpMenu::getStaticMetaObject() { return staticMetaObject; }
69
+#endif //Q_NO_DATA_RELOCATION
70
+
71
+const QMetaObject *HelpMenu::metaObject() const
72
+{
73
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
74
+}
75
+
76
+void *HelpMenu::qt_metacast(const char *_clname)
77
+{
78
+    if (!_clname) return 0;
79
+    if (!strcmp(_clname, qt_meta_stringdata_HelpMenu))
80
+        return static_cast<void*>(const_cast< HelpMenu*>(this));
81
+    return QMenu::qt_metacast(_clname);
82
+}
83
+
84
+int HelpMenu::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
85
+{
86
+    _id = QMenu::qt_metacall(_c, _id, _a);
87
+    if (_id < 0)
88
+        return _id;
89
+    if (_c == QMetaObject::InvokeMetaMethod) {
90
+        if (_id < 2)
91
+            qt_static_metacall(this, _c, _id, _a);
92
+        _id -= 2;
93
+    }
94
+    return _id;
95
+}
96
+QT_END_MOC_NAMESPACE

+ 111
- 0
src/moc_qextserialenumerator.cpp View File

@@ -0,0 +1,111 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'qextserialenumerator.h'
3
+**
4
+** Created: Thu Jul 3 12:13:29 2014
5
+**      by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
6
+**
7
+** WARNING! All changes made in this file will be lost!
8
+*****************************************************************************/
9
+
10
+#include "3rdparty/qextserialport/src/qextserialenumerator.h"
11
+#if !defined(Q_MOC_OUTPUT_REVISION)
12
+#error "The header file 'qextserialenumerator.h' doesn't include <QObject>."
13
+#elif Q_MOC_OUTPUT_REVISION != 63
14
+#error "This file was generated using the moc from 4.8.4. It"
15
+#error "cannot be used with the include files from this version of Qt."
16
+#error "(The moc has changed too much.)"
17
+#endif
18
+
19
+QT_BEGIN_MOC_NAMESPACE
20
+static const uint qt_meta_data_QextSerialEnumerator[] = {
21
+
22
+ // content:
23
+       6,       // revision
24
+       0,       // classname
25
+       0,    0, // classinfo
26
+       2,   14, // methods
27
+       0,    0, // properties
28
+       0,    0, // enums/sets
29
+       0,    0, // constructors
30
+       0,       // flags
31
+       2,       // signalCount
32
+
33
+ // signals: signature, parameters, type, tag, flags
34
+      27,   22,   21,   21, 0x05,
35
+      58,   22,   21,   21, 0x05,
36
+
37
+       0        // eod
38
+};
39
+
40
+static const char qt_meta_stringdata_QextSerialEnumerator[] = {
41
+    "QextSerialEnumerator\0\0info\0"
42
+    "deviceDiscovered(QextPortInfo)\0"
43
+    "deviceRemoved(QextPortInfo)\0"
44
+};
45
+
46
+void QextSerialEnumerator::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
47
+{
48
+    if (_c == QMetaObject::InvokeMetaMethod) {
49
+        Q_ASSERT(staticMetaObject.cast(_o));
50
+        QextSerialEnumerator *_t = static_cast<QextSerialEnumerator *>(_o);
51
+        switch (_id) {
52
+        case 0: _t->deviceDiscovered((*reinterpret_cast< const QextPortInfo(*)>(_a[1]))); break;
53
+        case 1: _t->deviceRemoved((*reinterpret_cast< const QextPortInfo(*)>(_a[1]))); break;
54
+        default: ;
55
+        }
56
+    }
57
+}
58
+
59
+const QMetaObjectExtraData QextSerialEnumerator::staticMetaObjectExtraData = {
60
+    0,  qt_static_metacall 
61
+};
62
+
63
+const QMetaObject QextSerialEnumerator::staticMetaObject = {
64
+    { &QObject::staticMetaObject, qt_meta_stringdata_QextSerialEnumerator,
65
+      qt_meta_data_QextSerialEnumerator, &staticMetaObjectExtraData }
66
+};
67
+
68
+#ifdef Q_NO_DATA_RELOCATION
69
+const QMetaObject &QextSerialEnumerator::getStaticMetaObject() { return staticMetaObject; }
70
+#endif //Q_NO_DATA_RELOCATION
71
+
72
+const QMetaObject *QextSerialEnumerator::metaObject() const
73
+{
74
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
75
+}
76
+
77
+void *QextSerialEnumerator::qt_metacast(const char *_clname)
78
+{
79
+    if (!_clname) return 0;
80
+    if (!strcmp(_clname, qt_meta_stringdata_QextSerialEnumerator))
81
+        return static_cast<void*>(const_cast< QextSerialEnumerator*>(this));
82
+    return QObject::qt_metacast(_clname);
83
+}
84
+
85
+int QextSerialEnumerator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
86
+{
87
+    _id = QObject::qt_metacall(_c, _id, _a);
88
+    if (_id < 0)
89
+        return _id;
90
+    if (_c == QMetaObject::InvokeMetaMethod) {
91
+        if (_id < 2)
92
+            qt_static_metacall(this, _c, _id, _a);
93
+        _id -= 2;
94
+    }
95
+    return _id;
96
+}
97
+
98
+// SIGNAL 0
99
+void QextSerialEnumerator::deviceDiscovered(const QextPortInfo & _t1)
100
+{
101
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
102
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
103
+}
104
+
105
+// SIGNAL 1
106
+void QextSerialEnumerator::deviceRemoved(const QextPortInfo & _t1)
107
+{
108
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
109
+    QMetaObject::activate(this, &staticMetaObject, 1, _a);
110
+}
111
+QT_END_MOC_NAMESPACE

+ 176
- 0
src/moc_qextserialport.cpp View File

@@ -0,0 +1,176 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'qextserialport.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "3rdparty/qextserialport/src/qextserialport.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'qextserialport.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_QextSerialPort[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+      14,   14, // methods
26
+       2,   84, // properties
27
+       1,   90, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       1,       // signalCount
31
+
32
+ // signals: signature, parameters, type, tag, flags
33
+      23,   16,   15,   15, 0x05,
34
+
35
+ // slots: signature, parameters, type, tag, flags
36
+      45,   40,   15,   15, 0x0a,
37
+      71,   66,   15,   15, 0x0a,
38
+      95,   15,   15,   15, 0x0a,
39
+     121,   15,   15,   15, 0x0a,
40
+     147,   15,   15,   15, 0x0a,
41
+     169,   15,   15,   15, 0x0a,
42
+     195,   15,   15,   15, 0x0a,
43
+     220,   15,   15,   15, 0x0a,
44
+     241,  237,   15,   15, 0x0a,
45
+     254,   15,   15,   15, 0x2a,
46
+     263,  237,   15,   15, 0x0a,
47
+     276,   15,   15,   15, 0x2a,
48
+     285,   15,   15,   15, 0x08,
49
+
50
+ // properties: name, type, flags
51
+     306,  298, 0x0a095103,
52
+     325,  315, 0x0009510b,
53
+
54
+ // enums: name, flags, count, data
55
+     315, 0x0,    2,   94,
56
+
57
+ // enum data: key, value
58
+     335, uint(QextSerialPort::Polling),
59
+     343, uint(QextSerialPort::EventDriven),
60
+
61
+       0        // eod
62
+};
63
+
64
+static const char qt_meta_stringdata_QextSerialPort[] = {
65
+    "QextSerialPort\0\0status\0dsrChanged(bool)\0"
66
+    "name\0setPortName(QString)\0mode\0"
67
+    "setQueryMode(QueryMode)\0"
68
+    "setBaudRate(BaudRateType)\0"
69
+    "setDataBits(DataBitsType)\0"
70
+    "setParity(ParityType)\0setStopBits(StopBitsType)\0"
71
+    "setFlowControl(FlowType)\0setTimeout(long)\0"
72
+    "set\0setDtr(bool)\0setDtr()\0setRts(bool)\0"
73
+    "setRts()\0_q_canRead()\0QString\0portName\0"
74
+    "QueryMode\0queryMode\0Polling\0EventDriven\0"
75
+};
76
+
77
+void QextSerialPort::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
78
+{
79
+    if (_c == QMetaObject::InvokeMetaMethod) {
80
+        Q_ASSERT(staticMetaObject.cast(_o));
81
+        QextSerialPort *_t = static_cast<QextSerialPort *>(_o);
82
+        switch (_id) {
83
+        case 0: _t->dsrChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
84
+        case 1: _t->setPortName((*reinterpret_cast< const QString(*)>(_a[1]))); break;
85
+        case 2: _t->setQueryMode((*reinterpret_cast< QueryMode(*)>(_a[1]))); break;
86
+        case 3: _t->setBaudRate((*reinterpret_cast< BaudRateType(*)>(_a[1]))); break;
87
+        case 4: _t->setDataBits((*reinterpret_cast< DataBitsType(*)>(_a[1]))); break;
88
+        case 5: _t->setParity((*reinterpret_cast< ParityType(*)>(_a[1]))); break;
89
+        case 6: _t->setStopBits((*reinterpret_cast< StopBitsType(*)>(_a[1]))); break;
90
+        case 7: _t->setFlowControl((*reinterpret_cast< FlowType(*)>(_a[1]))); break;
91
+        case 8: _t->setTimeout((*reinterpret_cast< long(*)>(_a[1]))); break;
92
+        case 9: _t->setDtr((*reinterpret_cast< bool(*)>(_a[1]))); break;
93
+        case 10: _t->setDtr(); break;
94
+        case 11: _t->setRts((*reinterpret_cast< bool(*)>(_a[1]))); break;
95
+        case 12: _t->setRts(); break;
96
+        case 13: _t->d_func()->_q_canRead(); break;
97
+        default: ;
98
+        }
99
+    }
100
+}
101
+
102
+const QMetaObjectExtraData QextSerialPort::staticMetaObjectExtraData = {
103
+    0,  qt_static_metacall 
104
+};
105
+
106
+const QMetaObject QextSerialPort::staticMetaObject = {
107
+    { &QIODevice::staticMetaObject, qt_meta_stringdata_QextSerialPort,
108
+      qt_meta_data_QextSerialPort, &staticMetaObjectExtraData }
109
+};
110
+
111
+#ifdef Q_NO_DATA_RELOCATION
112
+const QMetaObject &QextSerialPort::getStaticMetaObject() { return staticMetaObject; }
113
+#endif //Q_NO_DATA_RELOCATION
114
+
115
+const QMetaObject *QextSerialPort::metaObject() const
116
+{
117
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
118
+}
119
+
120
+void *QextSerialPort::qt_metacast(const char *_clname)
121
+{
122
+    if (!_clname) return 0;
123
+    if (!strcmp(_clname, qt_meta_stringdata_QextSerialPort))
124
+        return static_cast<void*>(const_cast< QextSerialPort*>(this));
125
+    return QIODevice::qt_metacast(_clname);
126
+}
127
+
128
+int QextSerialPort::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
129
+{
130
+    _id = QIODevice::qt_metacall(_c, _id, _a);
131
+    if (_id < 0)
132
+        return _id;
133
+    if (_c == QMetaObject::InvokeMetaMethod) {
134
+        if (_id < 14)
135
+            qt_static_metacall(this, _c, _id, _a);
136
+        _id -= 14;
137
+    }
138
+#ifndef QT_NO_PROPERTIES
139
+      else if (_c == QMetaObject::ReadProperty) {
140
+        void *_v = _a[0];
141
+        switch (_id) {
142
+        case 0: *reinterpret_cast< QString*>(_v) = portName(); break;
143
+        case 1: *reinterpret_cast< QueryMode*>(_v) = queryMode(); break;
144
+        }
145
+        _id -= 2;
146
+    } else if (_c == QMetaObject::WriteProperty) {
147
+        void *_v = _a[0];
148
+        switch (_id) {
149
+        case 0: setPortName(*reinterpret_cast< QString*>(_v)); break;
150
+        case 1: setQueryMode(*reinterpret_cast< QueryMode*>(_v)); break;
151
+        }
152
+        _id -= 2;
153
+    } else if (_c == QMetaObject::ResetProperty) {
154
+        _id -= 2;
155
+    } else if (_c == QMetaObject::QueryPropertyDesignable) {
156
+        _id -= 2;
157
+    } else if (_c == QMetaObject::QueryPropertyScriptable) {
158
+        _id -= 2;
159
+    } else if (_c == QMetaObject::QueryPropertyStored) {
160
+        _id -= 2;
161
+    } else if (_c == QMetaObject::QueryPropertyEditable) {
162
+        _id -= 2;
163
+    } else if (_c == QMetaObject::QueryPropertyUser) {
164
+        _id -= 2;
165
+    }
166
+#endif // QT_NO_PROPERTIES
167
+    return _id;
168
+}
169
+
170
+// SIGNAL 0
171
+void QextSerialPort::dsrChanged(bool _t1)
172
+{
173
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
174
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
175
+}
176
+QT_END_MOC_NAMESPACE

+ 109
- 0
src/moc_scale.cpp View File

@@ -0,0 +1,109 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'scale.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "scale.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'scale.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_SerialScale[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       4,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       1,       // signalCount
31
+
32
+ // signals: signature, parameters, type, tag, flags
33
+      25,   13,   12,   12, 0x05,
34
+
35
+ // slots: signature, parameters, type, tag, flags
36
+      60,   12,   12,   12, 0x0a,
37
+      67,   12,   12,   12, 0x0a,
38
+      75,   12,   12,   12, 0x08,
39
+
40
+       0        // eod
41
+};
42
+
43
+static const char qt_meta_stringdata_SerialScale[] = {
44
+    "SerialScale\0\0weight,unit\0"
45
+    "newMeasurement(double,Units::Unit)\0"
46
+    "tare()\0weigh()\0dataAvailable()\0"
47
+};
48
+
49
+void SerialScale::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
50
+{
51
+    if (_c == QMetaObject::InvokeMetaMethod) {
52
+        Q_ASSERT(staticMetaObject.cast(_o));
53
+        SerialScale *_t = static_cast<SerialScale *>(_o);
54
+        switch (_id) {
55
+        case 0: _t->newMeasurement((*reinterpret_cast< double(*)>(_a[1])),(*reinterpret_cast< Units::Unit(*)>(_a[2]))); break;
56
+        case 1: _t->tare(); break;
57
+        case 2: _t->weigh(); break;
58
+        case 3: _t->dataAvailable(); break;
59
+        default: ;
60
+        }
61
+    }
62
+}
63
+
64
+const QMetaObjectExtraData SerialScale::staticMetaObjectExtraData = {
65
+    0,  qt_static_metacall 
66
+};
67
+
68
+const QMetaObject SerialScale::staticMetaObject = {
69
+    { &QextSerialPort::staticMetaObject, qt_meta_stringdata_SerialScale,
70
+      qt_meta_data_SerialScale, &staticMetaObjectExtraData }
71
+};
72
+
73
+#ifdef Q_NO_DATA_RELOCATION
74
+const QMetaObject &SerialScale::getStaticMetaObject() { return staticMetaObject; }
75
+#endif //Q_NO_DATA_RELOCATION
76
+
77
+const QMetaObject *SerialScale::metaObject() const
78
+{
79
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
80
+}
81
+
82
+void *SerialScale::qt_metacast(const char *_clname)
83
+{
84
+    if (!_clname) return 0;
85
+    if (!strcmp(_clname, qt_meta_stringdata_SerialScale))
86
+        return static_cast<void*>(const_cast< SerialScale*>(this));
87
+    return QextSerialPort::qt_metacast(_clname);
88
+}
89
+
90
+int SerialScale::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
91
+{
92
+    _id = QextSerialPort::qt_metacall(_c, _id, _a);
93
+    if (_id < 0)
94
+        return _id;
95
+    if (_c == QMetaObject::InvokeMetaMethod) {
96
+        if (_id < 4)
97
+            qt_static_metacall(this, _c, _id, _a);
98
+        _id -= 4;
99
+    }
100
+    return _id;
101
+}
102
+
103
+// SIGNAL 0
104
+void SerialScale::newMeasurement(double _t1, Units::Unit _t2)
105
+{
106
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
107
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
108
+}
109
+QT_END_MOC_NAMESPACE

+ 7273
- 0
src/moc_typica.cpp
File diff suppressed because it is too large
View File


+ 96
- 0
src/moc_units.cpp View File

@@ -0,0 +1,96 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'units.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "units.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'units.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_Units[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       0,    0, // methods
26
+       0,    0, // properties
27
+       1,   14, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+ // enums: name, flags, count, data
33
+       6, 0x0,    9,   18,
34
+
35
+ // enum data: key, value
36
+      11, uint(Units::Unitless),
37
+      20, uint(Units::Fahrenheit),
38
+      31, uint(Units::Celsius),
39
+      39, uint(Units::Kelvin),
40
+      46, uint(Units::Rankine),
41
+      54, uint(Units::Pound),
42
+      60, uint(Units::Kilogram),
43
+      69, uint(Units::Ounce),
44
+      75, uint(Units::Gram),
45
+
46
+       0        // eod
47
+};
48
+
49
+static const char qt_meta_stringdata_Units[] = {
50
+    "Units\0Unit\0Unitless\0Fahrenheit\0Celsius\0"
51
+    "Kelvin\0Rankine\0Pound\0Kilogram\0Ounce\0"
52
+    "Gram\0"
53
+};
54
+
55
+void Units::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
56
+{
57
+    Q_UNUSED(_o);
58
+    Q_UNUSED(_id);
59
+    Q_UNUSED(_c);
60
+    Q_UNUSED(_a);
61
+}
62
+
63
+const QMetaObjectExtraData Units::staticMetaObjectExtraData = {
64
+    0,  qt_static_metacall 
65
+};
66
+
67
+const QMetaObject Units::staticMetaObject = {
68
+    { &QObject::staticMetaObject, qt_meta_stringdata_Units,
69
+      qt_meta_data_Units, &staticMetaObjectExtraData }
70
+};
71
+
72
+#ifdef Q_NO_DATA_RELOCATION
73
+const QMetaObject &Units::getStaticMetaObject() { return staticMetaObject; }
74
+#endif //Q_NO_DATA_RELOCATION
75
+
76
+const QMetaObject *Units::metaObject() const
77
+{
78
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
79
+}
80
+
81
+void *Units::qt_metacast(const char *_clname)
82
+{
83
+    if (!_clname) return 0;
84
+    if (!strcmp(_clname, qt_meta_stringdata_Units))
85
+        return static_cast<void*>(const_cast< Units*>(this));
86
+    return QObject::qt_metacast(_clname);
87
+}
88
+
89
+int Units::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
90
+{
91
+    _id = QObject::qt_metacall(_c, _id, _a);
92
+    if (_id < 0)
93
+        return _id;
94
+    return _id;
95
+}
96
+QT_END_MOC_NAMESPACE

+ 113
- 0
src/moc_webelement.cpp View File

@@ -0,0 +1,113 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'webelement.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "webelement.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'webelement.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_TypicaWebElement[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+       9,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       0,       // signalCount
31
+
32
+ // methods: signature, parameters, type, tag, flags
33
+      25,   18,   17,   17, 0x02,
34
+      47,   18,   17,   17, 0x02,
35
+      70,   18,   17,   17, 0x02,
36
+      93,   18,   17,   17, 0x02,
37
+     117,   17,   17,   17, 0x02,
38
+     138,   18,   17,   17, 0x02,
39
+     155,   18,   17,   17, 0x02,
40
+     176,   18,   17,   17, 0x02,
41
+     202,  197,   17,   17, 0x02,
42
+
43
+       0        // eod
44
+};
45
+
46
+static const char qt_meta_stringdata_TypicaWebElement[] = {
47
+    "TypicaWebElement\0\0markup\0appendInside(QString)\0"
48
+    "appendOutside(QString)\0prependInside(QString)\0"
49
+    "prependOutside(QString)\0removeFromDocument()\0"
50
+    "replace(QString)\0setInnerXml(QString)\0"
51
+    "setOuterXml(QString)\0text\0"
52
+    "setPlainText(QString)\0"
53
+};
54
+
55
+void TypicaWebElement::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
56
+{
57
+    if (_c == QMetaObject::InvokeMetaMethod) {
58
+        Q_ASSERT(staticMetaObject.cast(_o));
59
+        TypicaWebElement *_t = static_cast<TypicaWebElement *>(_o);
60
+        switch (_id) {
61
+        case 0: _t->appendInside((*reinterpret_cast< const QString(*)>(_a[1]))); break;
62
+        case 1: _t->appendOutside((*reinterpret_cast< const QString(*)>(_a[1]))); break;
63
+        case 2: _t->prependInside((*reinterpret_cast< const QString(*)>(_a[1]))); break;
64
+        case 3: _t->prependOutside((*reinterpret_cast< const QString(*)>(_a[1]))); break;
65
+        case 4: _t->removeFromDocument(); break;
66
+        case 5: _t->replace((*reinterpret_cast< const QString(*)>(_a[1]))); break;
67
+        case 6: _t->setInnerXml((*reinterpret_cast< const QString(*)>(_a[1]))); break;
68
+        case 7: _t->setOuterXml((*reinterpret_cast< const QString(*)>(_a[1]))); break;
69
+        case 8: _t->setPlainText((*reinterpret_cast< const QString(*)>(_a[1]))); break;
70
+        default: ;
71
+        }
72
+    }
73
+}
74
+
75
+const QMetaObjectExtraData TypicaWebElement::staticMetaObjectExtraData = {
76
+    0,  qt_static_metacall 
77
+};
78
+
79
+const QMetaObject TypicaWebElement::staticMetaObject = {
80
+    { &QObject::staticMetaObject, qt_meta_stringdata_TypicaWebElement,
81
+      qt_meta_data_TypicaWebElement, &staticMetaObjectExtraData }
82
+};
83
+
84
+#ifdef Q_NO_DATA_RELOCATION
85
+const QMetaObject &TypicaWebElement::getStaticMetaObject() { return staticMetaObject; }
86
+#endif //Q_NO_DATA_RELOCATION
87
+
88
+const QMetaObject *TypicaWebElement::metaObject() const
89
+{
90
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
91
+}
92
+
93
+void *TypicaWebElement::qt_metacast(const char *_clname)
94
+{
95
+    if (!_clname) return 0;
96
+    if (!strcmp(_clname, qt_meta_stringdata_TypicaWebElement))
97
+        return static_cast<void*>(const_cast< TypicaWebElement*>(this));
98
+    return QObject::qt_metacast(_clname);
99
+}
100
+
101
+int TypicaWebElement::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
102
+{
103
+    _id = QObject::qt_metacall(_c, _id, _a);
104
+    if (_id < 0)
105
+        return _id;
106
+    if (_c == QMetaObject::InvokeMetaMethod) {
107
+        if (_id < 9)
108
+            qt_static_metacall(this, _c, _id, _a);
109
+        _id -= 9;
110
+    }
111
+    return _id;
112
+}
113
+QT_END_MOC_NAMESPACE

+ 130
- 0
src/moc_webview.cpp View File

@@ -0,0 +1,130 @@
1
+/****************************************************************************
2
+** Meta object code from reading C++ file 'webview.h'
3
+**
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5
+**
6
+** WARNING! All changes made in this file will be lost!
7
+*****************************************************************************/
8
+
9
+#include "webview.h"
10
+#if !defined(Q_MOC_OUTPUT_REVISION)
11
+#error "The header file 'webview.h' doesn't include <QObject>."
12
+#elif Q_MOC_OUTPUT_REVISION != 63
13
+#error "This file was generated using the moc from 4.8.6. It"
14
+#error "cannot be used with the include files from this version of Qt."
15
+#error "(The moc has changed too much.)"
16
+#endif
17
+
18
+QT_BEGIN_MOC_NAMESPACE
19
+static const uint qt_meta_data_TypicaWebView[] = {
20
+
21
+ // content:
22
+       6,       // revision
23
+       0,       // classname
24
+       0,    0, // classinfo
25
+      10,   14, // methods
26
+       0,    0, // properties
27
+       0,    0, // enums/sets
28
+       0,    0, // constructors
29
+       0,       // flags
30
+       1,       // signalCount
31
+
32
+ // signals: signature, parameters, type, tag, flags
33
+      20,   15,   14,   14, 0x05,
34
+
35
+ // slots: signature, parameters, type, tag, flags
36
+      51,   47,   14,   14, 0x08,
37
+
38
+ // methods: signature, parameters, type, tag, flags
39
+      70,   47,   14,   14, 0x02,
40
+      84,   14,   14,   14, 0x02,
41
+     105,   92,   14,   14, 0x02,
42
+     132,  127,   14,   14, 0x22,
43
+     156,  149,   14,   14, 0x02,
44
+     187,   14,  179,   14, 0x02,
45
+     209,   14,  197,   14, 0x02,
46
+     236,  227,  197,   14, 0x02,
47
+
48
+       0        // eod
49
+};
50
+
51
+static const char qt_meta_stringdata_TypicaWebView[] = {
52
+    "TypicaWebView\0\0link\0scriptLinkClicked(QString)\0"
53
+    "url\0linkDelegate(QUrl)\0load(QString)\0"
54
+    "print()\0html,baseUrl\0setHtml(QString,QUrl)\0"
55
+    "html\0setHtml(QString)\0device\0"
56
+    "setContent(QIODevice*)\0QString\0saveXml()\0"
57
+    "QWebElement\0documentElement()\0selector\0"
58
+    "findFirstElement(QString)\0"
59
+};
60
+
61
+void TypicaWebView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
62
+{
63
+    if (_c == QMetaObject::InvokeMetaMethod) {
64
+        Q_ASSERT(staticMetaObject.cast(_o));
65
+        TypicaWebView *_t = static_cast<TypicaWebView *>(_o);
66
+        switch (_id) {
67
+        case 0: _t->scriptLinkClicked((*reinterpret_cast< const QString(*)>(_a[1]))); break;
68
+        case 1: _t->linkDelegate((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
69
+        case 2: _t->load((*reinterpret_cast< const QString(*)>(_a[1]))); break;
70
+        case 3: _t->print(); break;
71
+        case 4: _t->setHtml((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QUrl(*)>(_a[2]))); break;
72
+        case 5: _t->setHtml((*reinterpret_cast< const QString(*)>(_a[1]))); break;
73
+        case 6: _t->setContent((*reinterpret_cast< QIODevice*(*)>(_a[1]))); break;
74
+        case 7: { QString _r = _t->saveXml();
75
+            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
76
+        case 8: { QWebElement _r = _t->documentElement();
77
+            if (_a[0]) *reinterpret_cast< QWebElement*>(_a[0]) = _r; }  break;
78
+        case 9: { QWebElement _r = _t->findFirstElement((*reinterpret_cast< const QString(*)>(_a[1])));
79
+            if (_a[0]) *reinterpret_cast< QWebElement*>(_a[0]) = _r; }  break;
80
+        default: ;
81
+        }
82
+    }
83
+}
84
+
85
+const QMetaObjectExtraData TypicaWebView::staticMetaObjectExtraData = {
86
+    0,  qt_static_metacall 
87
+};
88
+
89
+const QMetaObject TypicaWebView::staticMetaObject = {
90
+    { &QWebView::staticMetaObject, qt_meta_stringdata_TypicaWebView,
91
+      qt_meta_data_TypicaWebView, &staticMetaObjectExtraData }
92
+};
93
+
94
+#ifdef Q_NO_DATA_RELOCATION
95
+const QMetaObject &TypicaWebView::getStaticMetaObject() { return staticMetaObject; }
96
+#endif //Q_NO_DATA_RELOCATION
97
+
98
+const QMetaObject *TypicaWebView::metaObject() const
99
+{
100
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
101
+}
102
+
103
+void *TypicaWebView::qt_metacast(const char *_clname)
104
+{
105
+    if (!_clname) return 0;
106
+    if (!strcmp(_clname, qt_meta_stringdata_TypicaWebView))
107
+        return static_cast<void*>(const_cast< TypicaWebView*>(this));
108
+    return QWebView::qt_metacast(_clname);
109
+}
110
+
111
+int TypicaWebView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
112
+{
113
+    _id = QWebView::qt_metacall(_c, _id, _a);
114
+    if (_id < 0)
115
+        return _id;
116
+    if (_c == QMetaObject::InvokeMetaMethod) {
117
+        if (_id < 10)
118
+            qt_static_metacall(this, _c, _id, _a);
119
+        _id -= 10;
120
+    }
121
+    return _id;
122
+}
123
+
124
+// SIGNAL 0
125
+void TypicaWebView::scriptLinkClicked(const QString & _t1)
126
+{
127
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
128
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
129
+}
130
+QT_END_MOC_NAMESPACE

+ 1
- 0
src/resources.qrc View File

@@ -11,6 +11,7 @@
11 11
         <file>resources/icons/tango/scalable/actions/list-remove.svg</file>
12 12
         <file>resources/icons/tango/index.theme</file>
13 13
         <file>resources/icons/appicons/logo.svg</file>
14
+        <file>resources/icons/appicons/logo48.png</file>
14 15
         <file>resources/icons/appicons/logo96.png</file>
15 16
         <file>resources/html/about.html</file>
16 17
         <file>resources/html/style.css</file>

+ 5
- 1
src/settings.w View File

@@ -31,6 +31,8 @@ SettingsWindow::SettingsWindow() : QMainWindow(NULL)
31 31
 	settingsTab->addTab(deviceSettings, tr("Roasters"));
32 32
 	GraphSettingsWidget *graphSettings = new GraphSettingsWidget;
33 33
 	settingsTab->addTab(graphSettings, tr("Graph"));
34
+	AdvancedSettingsWidget *advancedSettings = new AdvancedSettingsWidget;
35
+	settingsTab->addTab(advancedSettings, tr("Advanced"));
34 36
 	setCentralWidget(settingsTab);
35 37
 }
36 38
 
@@ -56,4 +58,6 @@ constructor = engine->newFunction(constructSettingsWindow);
56 58
 value = engine->newQMetaObject(&DeviceConfigurationWindow::staticMetaObject, constructor);
57 59
 engine->globalObject().setProperty("SettingsWindow", value);
58 60
 
59
-@i graphsettings.w
61
+@i graphsettings.w
62
+
63
+@i advancedsettings.w

+ 2489
- 2442
src/typica.cpp
File diff suppressed because it is too large
View File


+ 115
- 10
src/typica.w View File

@@ -525,8 +525,10 @@ generated file empty.
525 525
 @<Header files to include@>@/
526 526
 @<Class declarations@>@/
527 527
 @<Function prototypes for scripting@>@/
528
+@<Logging function prototype@>@/
528 529
 @<Class implementations@>@/
529 530
 @<Functions for scripting@>@/
531
+@<Logging function implementation@>@/
530 532
 @<The main program@>
531 533
 #include "moc_typica.cpp"
532 534
 
@@ -1414,6 +1416,8 @@ QScriptValue QSplitter_saveState(QScriptContext *context,
1414 1416
 									QScriptEngine *engine);
1415 1417
 QScriptValue QSplitter_restoreState(QScriptContext *context,
1416 1418
 									QScriptEngine *engine);
1419
+QScriptValue QSplitter_count(QScriptContext *context,
1420
+                             QScriptEngine *engine);
1417 1421
 void setQSplitterProperties(QScriptValue value, QScriptEngine *engine);
1418 1422
 
1419 1423
 @ Of these, the scripting engine must be informed of the constructor.
@@ -1440,6 +1444,7 @@ void setQSplitterProperties(QScriptValue value, QScriptEngine *engine)
1440 1444
 	value.setProperty("saveState", engine->newFunction(QSplitter_saveState));
1441 1445
 	value.setProperty("restoreState",
1442 1446
 	                  engine->newFunction(QSplitter_restoreState));
1447
+	value.setProperty("count", engine->newFunction(QSplitter_count));
1443 1448
 }
1444 1449
 
1445 1450
 @ The |"addWidget"| property is a simple wrapper around
@@ -1472,6 +1477,23 @@ QScriptValue QSplitter_addWidget(QScriptContext *context, QScriptEngine *)
1472 1477
 	return QScriptValue();
1473 1478
 }
1474 1479
 
1480
+@ The methods for saving and restoring the state of a splitter do not behave
1481
+well when the number of widgets contained in the splitter increase. This is a
1482
+problem in the logging view where we may want to allow zero width indicators
1483
+but reconfiguration can cause the number of indicators to increase. This would
1484
+result in the right most indicators such as the batch timer disappearing. Most
1485
+people do not notice the splitter handle or think to drag that to the left to
1486
+correct this issue so it would be better to save the number of indicators when
1487
+saving the state and if the number of indicators does not match, we should not
1488
+restore the obsolete saved state.
1489
+
1490
+@<Functions for scripting@>=
1491
+QScriptValue QSplitter_count(QScriptContext *context, QScriptEngine *)
1492
+{
1493
+	QSplitter *self = getself<QSplitter *>(context);
1494
+	return QScriptValue(self->count());
1495
+}
1496
+
1475 1497
 @ When saving and restoring the state of a splitter, we always want to do this
1476 1498
 through a |QSettings| object. For this, we take an extra argument specifying the
1477 1499
 settings key to read from or write to. Unlike the equivalent functions called
@@ -2104,7 +2126,7 @@ engine->globalObject().setProperty("QProcess", value);
2104 2126
 @ The constructor is trivial.
2105 2127
 
2106 2128
 @<Functions for scripting@>=
2107
-QScriptValue constructQProcess(QScriptContext *context, QScriptEngine *engine)
2129
+QScriptValue constructQProcess(QScriptContext *, QScriptEngine *engine)
2108 2130
 {
2109 2131
 	QScriptValue object = engine->newQObject(new QProcess);
2110 2132
 	setQProcessProperties(object, engine);
@@ -2129,7 +2151,7 @@ We always call the one with arguments and simply pass in an empty list if no
2129 2151
 arguments are specified.
2130 2152
 
2131 2153
 @<Functions for scripting@>=
2132
-QScriptValue QProcess_execute(QScriptContext *context, QScriptEngine *engine)
2154
+QScriptValue QProcess_execute(QScriptContext *context, QScriptEngine *)
2133 2155
 {
2134 2156
 	QProcess *self = getself<QProcess *>(context);
2135 2157
 	QString program = argument<QString>(0, context);
@@ -2144,7 +2166,7 @@ QScriptValue QProcess_execute(QScriptContext *context, QScriptEngine *engine)
2144 2166
 @ Similarly |startDetached()| can be called in a few different ways.
2145 2167
 
2146 2168
 @<Functions for scripting@>=
2147
-QScriptValue QProcess_startDetached(QScriptContext *context, QScriptEngine *engine)
2169
+QScriptValue QProcess_startDetached(QScriptContext *context, QScriptEngine *)
2148 2170
 {
2149 2171
 	QProcess *self = getself<QProcess *>(context);
2150 2172
 	QString program = argument<QString>(0, context);
@@ -2177,7 +2199,7 @@ QScriptValue QProcess_startDetached(QScriptContext *context, QScriptEngine *engi
2177 2199
 @ Sometimes we care about the working directory for our program.
2178 2200
 
2179 2201
 @<Functions for scripting@>=
2180
-QScriptValue QProcess_setWorkingDirectory(QScriptContext *context, QScriptEngine *engine)
2202
+QScriptValue QProcess_setWorkingDirectory(QScriptContext *context, QScriptEngine *)
2181 2203
 {
2182 2204
 	QProcess *self = getself<QProcess *>(context);
2183 2205
 	QString directory = argument<QString>(0, context);
@@ -2189,7 +2211,7 @@ QScriptValue QProcess_setWorkingDirectory(QScriptContext *context, QScriptEngine
2189 2211
 access.
2190 2212
 
2191 2213
 @<Functions for scripting@>=
2192
-QScriptValue QProcess_start(QScriptContext *context, QScriptEngine *engine)
2214
+QScriptValue QProcess_start(QScriptContext *context, QScriptEngine *)
2193 2215
 {
2194 2216
 	QProcess *self = getself<QProcess *>(context);
2195 2217
 	QString program = argument<QString>(0, context);
@@ -3913,6 +3935,7 @@ QScriptValue setFont(QScriptContext *context, QScriptEngine *engine);
3913 3935
 QScriptValue annotationFromRecord(QScriptContext *context,
3914 3936
                                   QScriptEngine *engine);
3915 3937
 QScriptValue setTabOrder(QScriptContext *context, QScriptEngine *engine);
3938
+QScriptValue saveFileFromDatabase(QScriptContext *context, QScriptEngine *engine);
3916 3939
 
3917 3940
 @ These functions are passed to the scripting engine.
3918 3941
 
@@ -3926,6 +3949,8 @@ engine->globalObject().setProperty("annotationFromRecord",
3926 3949
                                    engine->newFunction(annotationFromRecord));
3927 3950
 engine->globalObject().setProperty("setTabOrder",
3928 3951
                                    engine->newFunction(setTabOrder));
3952
+engine->globalObject().setProperty("saveFileFromDatabase",
3953
+                                   engine->newFunction(saveFileFromDatabase));
3929 3954
 
3930 3955
 @ These functions are not part of an object. They expect a string specifying
3931 3956
 the path to a file and return a string with either the name of the file without
@@ -3947,6 +3972,27 @@ QScriptValue dir(QScriptContext *context, QScriptEngine *engine)
3947 3972
 	return retval;
3948 3973
 }
3949 3974
 
3975
+@ This function takes a file ID and a file name and copies file data stored in
3976
+the database out to the file system.
3977
+
3978
+@<Functions for scripting@>=
3979
+QScriptValue saveFileFromDatabase(QScriptContext *context, QScriptEngine *)
3980
+{
3981
+	SqlQueryConnection h;
3982
+	QSqlQuery *query = h.operator->();
3983
+	QString q = "SELECT file FROM files WHERE id = :file";
3984
+	query->prepare(q);
3985
+	query->bindValue(":file", argument<int>(0, context));
3986
+	query->exec();
3987
+	query->next();
3988
+	QByteArray array = query->value(0).toByteArray();
3989
+	QFile file(argument<QString>(1, context));
3990
+	file.open(QIODevice::WriteOnly);
3991
+	file.write(array);
3992
+	file.close();
3993
+	return QScriptValue();
3994
+}
3995
+
3950 3996
 @ This function takes a string representing a SQL array and returns an array
3951 3997
 value.
3952 3998
 
@@ -4488,6 +4534,8 @@ while(j < menuItems.count())
4488 4534
 
4489 4535
 @i helpmenu.w
4490 4536
 
4537
+@i feedback.w
4538
+
4491 4539
 @ A layout can contain a number of different elements including a variety of
4492 4540
 widget types and other layouts. This function is responsible for applying any
4493 4541
 layout class to the widget currently being populated and processing children of
@@ -12943,11 +12991,11 @@ int main(int argc, char **argv)@/
12943 12991
 {@/
12944 12992
 	int *c = &argc;
12945 12993
 	Application app(*c, argv);
12994
+	QSettings settings;
12995
+	@<Set up logging@>@;
12946 12996
 	@<Set up icons@>@;
12947 12997
 	@<Set up fonts@>@;
12948 12998
 
12949
-	QSettings settings;
12950
-
12951 12999
 	@<Register device configuration widgets@>@;
12952 13000
 	@<Prepare the database connection@>@;
12953 13001
 	@<Load the application configuration@>@;
@@ -12960,6 +13008,32 @@ int main(int argc, char **argv)@/
12960 13008
 	return retval;@/
12961 13009
 }
12962 13010
 
13011
+@ \pn{} 1.6.3 introduces optional logging of diagnostic messages to a file. By
13012
+default this feature is not enabled. A sensible future refinement to this would
13013
+allow specification of where this file should be created.
13014
+
13015
+@<Set up logging@>=
13016
+if(settings.value("settings/advanced/logging", false).toBool())
13017
+{
13018
+	qInstallMsgHandler(messageFileOutput);
13019
+}
13020
+
13021
+@ This requires that we have our messageFileOutput function.
13022
+
13023
+@<Logging function prototype@>=
13024
+void messageFileOutput(QtMsgType type, const char *msg);
13025
+
13026
+@ The current implementation is straightforward.
13027
+
13028
+@<Logging function implementation@>=
13029
+void messageFileOutput(QtMsgType type, const char *msg)
13030
+{
13031
+	QFile output("Typica-"+QDate::currentDate().toString("yyyy-MM-dd")+".log");
13032
+	output.open(QIODevice::WriteOnly | QIODevice::Append);
13033
+	QTextStream outstream(&output);
13034
+	outstream << msg << "\r\n";
13035
+}
13036
+
12963 13037
 @ \pn{} 1.4 introduces the ability to use icons in certain interface elements.
12964 13038
 Some commonly desired public domain graphics are provided by the Tango Desktop
12965 13039
 Project. We also set an application level default window icon.
@@ -17605,7 +17679,8 @@ class ModbusRTUDevice : public QObject
17605 17679
 		void svuResponse(QByteArray response);
17606 17680
 		void requestMeasurement();
17607 17681
 		void mResponse(QByteArray response);
17608
-		void ignore(QByteArray response);@/
17682
+		void ignore(QByteArray response);
17683
+		void timeout();@/
17609 17684
 	private:@/
17610 17685
 		QextSerialPort *port;
17611 17686
 		QByteArray responseBuffer;
@@ -17614,6 +17689,7 @@ class ModbusRTUDevice : public QObject
17614 17689
 		QList<char *> callbackQueue;
17615 17690
 		quint16 calculateCRC(QByteArray data);
17616 17691
 		QTimer *messageDelayTimer;
17692
+		QTimer *commTimeout;
17617 17693
 		int delayTime;
17618 17694
 		char station;
17619 17695
 		int decimalPosition;
@@ -17645,9 +17721,10 @@ immediately upon construction.
17645 17721
 
17646 17722
 @<ModbusRTUDevice implementation@>=
17647 17723
 ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &index)
17648
-: QObject(NULL), messageDelayTimer(new QTimer), unitIsF(@[true@]), readingsv(@[false@]),
17724
+: QObject(NULL), messageDelayTimer(new QTimer), commTimeout(new QTimer), unitIsF(@[true@]), readingsv(@[false@]),
17649 17725
 	waiting(@[false@])@/
17650 17726
 {@/
17727
+qDebug() << "Initializing Modbus RTU Device";
17651 17728
 	QDomElement portReferenceElement = model->referenceElement(model->data(index,
17652 17729
 		Qt::UserRole).toString());
17653 17730
 	QDomNodeList portConfigData = portReferenceElement.elementsByTagName("attribute");
@@ -17665,7 +17742,9 @@ ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &in
17665 17742
 	double temp = ((double)(1) / (double)(baudRate)) * 48;
17666 17743
 	delayTime = (int)(temp * 3000);
17667 17744
 	messageDelayTimer->setSingleShot(true);
17745
+	commTimeout->setSingleShot(true);
17668 17746
 	connect(messageDelayTimer, SIGNAL(timeout()), this, SLOT(sendNextMessage()));
17747
+	connect(commTimeout, SIGNAL(timeout()), this, SLOT(timeout()));
17669 17748
 	port->setDataBits(DATA_8);
17670 17749
 	port->setParity((ParityType)attributes.value("parity").toInt());
17671 17750
 	port->setStopBits((StopBitsType)attributes.value("stop").toInt());
@@ -17828,6 +17907,7 @@ void ModbusRTUDevice::unitResponse(QByteArray response)
17828 17907
 	{
17829 17908
 		unitIsF = @[false@];
17830 17909
 	}
17910
+	qDebug() << "Received unit response";
17831 17911
 }
17832 17912
 
17833 17913
 void ModbusRTUDevice::svlResponse(QByteArray response)
@@ -17842,6 +17922,7 @@ void ModbusRTUDevice::svlResponse(QByteArray response)
17842 17922
 		outputSVLower /= 10;
17843 17923
 	}
17844 17924
 	emit SVLowerChanged(outputSVLower);
17925
+	qDebug() << "Received set value lower bound response";
17845 17926
 }
17846 17927
 
17847 17928
 void ModbusRTUDevice::svuResponse(QByteArray response)
@@ -17856,6 +17937,7 @@ void ModbusRTUDevice::svuResponse(QByteArray response)
17856 17937
 		outputSVUpper /= 10;
17857 17938
 	}
17858 17939
 	emit SVUpperChanged(outputSVUpper);
17940
+	qDebug() << "Received set value upper bound response";
17859 17941
 }
17860 17942
 
17861 17943
 void ModbusRTUDevice::requestMeasurement()
@@ -17963,6 +18045,7 @@ else
17963 18045
 @<ModbusRTUDevice implementation@>=
17964 18046
 ModbusRTUDevice::~ModbusRTUDevice()
17965 18047
 {
18048
+	commTimeout->stop();
17966 18049
 	messageDelayTimer->stop();
17967 18050
 	port->close();
17968 18051
 }
@@ -17982,6 +18065,10 @@ remove the message and callback information from the message queue, and start
17982 18065
 a timer which will trigger sending the next message after a safe amount of
17983 18066
 time has passed.
17984 18067
 
18068
+If a response is received with an invalid CRC, we do not pass that message
18069
+out. Instead, the message handling queues are kept as they are and the previous
18070
+command will be sent again once the message delay timer is finished.
18071
+
17985 18072
 @<ModbusRTUDevice implementation@>=
17986 18073
 void ModbusRTUDevice::dataAvailable()
17987 18074
 {
@@ -17991,6 +18078,7 @@ void ModbusRTUDevice::dataAvailable()
17991 18078
 	}
17992 18079
 	responseBuffer.append(port->readAll());
17993 18080
 	@<Check Modbus RTU message size@>@;
18081
+	commTimeout->stop();
17994 18082
 	if(calculateCRC(responseBuffer) == 0)
17995 18083
 	{
17996 18084
 		QObject *object = retObjQueue.at(0);
@@ -18003,12 +18091,12 @@ void ModbusRTUDevice::dataAvailable()
18003 18091
 		messageQueue.removeAt(0);
18004 18092
 		retObjQueue.removeAt(0);
18005 18093
 		callbackQueue.removeAt(0);
18006
-		messageDelayTimer->start(delayTime);
18007 18094
 	}
18008 18095
 	else
18009 18096
 	{
18010 18097
 		qDebug() << "CRC failed";
18011 18098
 	}
18099
+	messageDelayTimer->start(delayTime);
18012 18100
 	waiting = @[false@];
18013 18101
 	responseBuffer.clear();
18014 18102
 }
@@ -18123,6 +18211,7 @@ void ModbusRTUDevice::sendNextMessage()
18123 18211
 		message.append(check[0]);
18124 18212
 		message.append(check[1]);
18125 18213
 		port->write(message);
18214
+		commTimeout->start(2000);
18126 18215
 		messageDelayTimer->start(delayTime);
18127 18216
 		waiting = @[true@];
18128 18217
 	}
@@ -18154,6 +18243,22 @@ void ModbusRTUDevice::ignore(QByteArray)
18154 18243
 	return;
18155 18244
 }
18156 18245
 
18246
+@ Sometimes a communications failure will occur in which a response to a
18247
+command is never received. To reset communications we set a timer whenever a
18248
+command is sent and stop that once a full response is received. If the timer
18249
+times out, we should clear the response buffer and attempt to re-establish
18250
+communications. Currently this timeout is hard coded at 2 seconds, however
18251
+this should be configurable and smaller values may well be acceptable.
18252
+
18253
+@<ModbusRTUDevice implementation@>=
18254
+void ModbusRTUDevice::timeout()
18255
+{
18256
+	qDebug() << "Communications timeout.";
18257
+	responseBuffer.clear();
18258
+	waiting = false;
18259
+	messageDelayTimer->start();
18260
+}
18261
+
18157 18262
 @ This class must be exposed to the host environment.
18158 18263
 
18159 18264
 @<Function prototypes for scripting@>=

Loading…
Cancel
Save