Selaa lähdekoodia

Merge branch 'development' into programpipe

Neal Wilson 9 vuotta sitten
vanhempi
commit
378a31c202

+ 2
- 1
.gitignore Näytä tiedosto

9
 *.pdf
9
 *.pdf
10
 *.scn
10
 *.scn
11
 *.toc
11
 *.toc
12
-Typica-build*
12
+Typica-build*
13
+*.o

+ 24
- 1
config/Reports/dailyproductiondetail.xml Näytä tiedosto

100
 					output.writeStartElement("tr");
100
 					output.writeStartElement("tr");
101
 					output.writeTextElement("td", String(query.value(0)).split("T")[1]);
101
 					output.writeTextElement("td", String(query.value(0)).split("T")[1]);
102
 					output.writeTextElement("td", query.value(2));
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
 					var unroastedWeightsList = sqlToArray(query.value(5));
109
 					var unroastedWeightsList = sqlToArray(query.value(5));
105
 					output.writeStartElement("td");
110
 					output.writeStartElement("td");
106
 					for(var i = 0; i < unroastedWeightsList.length; i++)
111
 					for(var i = 0; i < unroastedWeightsList.length; i++)
407
 			dateField.dateChanged.connect(function() {
412
 			dateField.dateChanged.connect(function() {
408
 				refresh();
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
 	</program>
434
 	</program>
412
 </window>
435
 </window>

+ 15
- 1
config/Windows/batchdetailsnew.xml Näytä tiedosto

8
         </layout>
8
         </layout>
9
         <webview id="view" />
9
         <webview id="view" />
10
     </layout>
10
     </layout>
11
+	<menu name="File">
12
+		<item id="save" shortcut="Ctrl+S">Save…</item>
13
+	</menu>
11
     <program>
14
     <program>
12
         <![CDATA[
15
         <![CDATA[
13
 			var window = this;
16
 			var window = this;
139
 					viewer.windowTitle = "Typica - " + pname;
142
 					viewer.windowTitle = "Typica - " + pname;
140
 					viewer.raise();
143
 					viewer.raise();
141
 					viewer.activateWindow();
144
 					viewer.activateWindow();
145
+					graph.updatesEnabled = false;
146
+					log.updatesEnabled = false;
142
 					input.input();
147
 					input.input();
148
+					log.updatesEnabled = true;
149
+					graph.updatesEnabled = true;
143
 					log.newAnnotation("End", 1, lc);
150
 					log.newAnnotation("End", 1, lc);
144
 				}
151
 				}
145
 				else {
152
 				else {
209
 					nameQuery.bind(":id", items[i]);
216
 					nameQuery.bind(":id", items[i]);
210
 					nameQuery.exec();
217
 					nameQuery.exec();
211
 					nameQuery.next();
218
 					nameQuery.next();
212
-					output.writeTextElement("td", nameQuery.value(0));
219
+					output.writeTextElement("td", nameQuery.value(0) + " (" + items[i] + ")");
213
 					output.writeStartElement("td");
220
 					output.writeStartElement("td");
214
 					output.writeAttribute("align", "center");
221
 					output.writeAttribute("align", "center");
215
 					output.writeCharacters(quantities[i]);
222
 					output.writeCharacters(quantities[i]);
330
 				query = query.invalidate();
337
 				query = query.invalidate();
331
 				edit.enabled = true;
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
     </program>
348
     </program>
335
 </window>
349
 </window>

+ 1
- 1
config/Windows/invoicelist.xml Näytä tiedosto

6
 		<![CDATA[
6
 		<![CDATA[
7
 			this.windowTitle = "Typica - Invoice List";
7
 			this.windowTitle = "Typica - Invoice List";
8
 			var table = findChildObject(this, 'table');
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
 			table.openEntry.connect(function(arg) {
10
 			table.openEntry.connect(function(arg) {
11
 				var info = createWindow("invoiceinfo");
11
 				var info = createWindow("invoiceinfo");
12
 				info.setInvoiceID(arg);
12
 				info.setInvoiceID(arg);

+ 8
- 2
config/Windows/newbatch.xml Näytä tiedosto

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

+ 4
- 0
config/Windows/newsamplebatch.xml Näytä tiedosto

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

+ 14
- 6
config/Windows/productionroaster.xml Näytä tiedosto

64
 		var translationCurrentColumn = -1;
64
 		var translationCurrentColumn = -1;
65
 		var configModel = new DeviceTreeModel;
65
 		var configModel = new DeviceTreeModel;
66
 		var rootIndex = configModel.index(roasterlist.currentIndex, 0);
66
 		var rootIndex = configModel.index(roasterlist.currentIndex, 0);
67
+		var roasterIndex = roasterlist.currentIndex;
67
 		var channels = new Array();
68
 		var channels = new Array();
68
 		var annotationButtons = new Array();
69
 		var annotationButtons = new Array();
69
 		var nidevices = new Array();
70
 		var nidevices = new Array();
639
 			delete dataqsdkdevices;
640
 			delete dataqsdkdevices;
640
 			delete jsdevices;
641
 			delete jsdevices;
641
             window.saveSizeAndPosition("window");
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
             log.saveState("script/log", 7);
647
             log.saveState("script/log", 7);
646
 			window.navigationWindow.loggingWindow = undefined;
648
 			window.navigationWindow.loggingWindow = undefined;
647
 			Windows.loggingWindow = undefined;
649
 			Windows.loggingWindow = undefined;
648
         });
650
         });
649
 		this.restoreSizeAndPosition('window');
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
 		log.restoreState("script/log", 7);
657
 		log.restoreState("script/log", 7);
654
 		var offsets = new Array();
658
 		var offsets = new Array();
655
 		var zeroemitters = new Array();
659
 		var zeroemitters = new Array();
889
                     QSettings.setValue("liveColumn", c + 1);
893
                     QSettings.setValue("liveColumn", c + 1);
890
 					window.postLoadColumnSetup(c);
894
 					window.postLoadColumnSetup(c);
891
 				});
895
 				});
896
+				graph.updatesEnabled = false;
897
+				log.updatesEnabled = false;
892
                 input.input();
898
                 input.input();
899
+				log.updatesEnabled = true;
900
+				graph.updatesEnabled = true;
893
                 window.windowTitle = 'Typica - [*]' + baseName(filename);
901
                 window.windowTitle = 'Typica - [*]' + baseName(filename);
894
                 QSettings.setValue("script/lastDir", dir(filename));
902
                 QSettings.setValue("script/lastDir", dir(filename));
895
 				log.newAnnotation("End", 1, lc);
903
 				log.newAnnotation("End", 1, lc);

+ 4
- 2
src/Typica.pro Näytä tiedosto

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

+ 61
- 0
src/advancedsettings.w Näytä tiedosto

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 Näytä tiedosto

339
 	sampleRate = di_sample_rate(sampleRate * channels * 40, &oversample,
339
 	sampleRate = di_sample_rate(sampleRate * channels * 40, &oversample,
340
 	                            &burstDivisor);
340
 	                            &burstDivisor);
341
 	buffer = new qint16[(int)sampleRate];
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
 	for(unsigned short i = 0; i < channels; i++)
343
 	for(unsigned short i = 0; i < channels; i++)
344
 	{
344
 	{
345
 		inlist[i].chan = i;
345
 		inlist[i].chan = i;

+ 3
- 2
src/daterangeselector.w Näytä tiedosto

30
 @(daterangeselector.h@>=
30
 @(daterangeselector.h@>=
31
 
31
 
32
 #include <QComboBox>
32
 #include <QComboBox>
33
+#include <QPushButton>
34
+#include <QCalendarWidget>
33
 
35
 
34
 #ifndef TypicaDateRangeSelectorHeader
36
 #ifndef TypicaDateRangeSelectorHeader
35
 #define TypicaDateRangeSelectorHeader
37
 #define TypicaDateRangeSelectorHeader
36
 
38
 
37
-class CustomDateRangePopup;
39
+@<CustomDateRangePopup declaration@>@;
38
 
40
 
39
 class DateRangeSelector : public QWidget
41
 class DateRangeSelector : public QWidget
40
 {
42
 {
74
 
76
 
75
 #include "daterangeselector.h"
77
 #include "daterangeselector.h"
76
 
78
 
77
-@<CustomDateRangePopup declaration@>
78
 @<CustomDateRangePopup implementation@>
79
 @<CustomDateRangePopup implementation@>
79
 @<DateRangeSelector implementation@>
80
 @<DateRangeSelector implementation@>
80
 
81
 

+ 127
- 0
src/feedback.w Näytä tiedosto

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 Näytä tiedosto

26
 		HelpMenu();
26
 		HelpMenu();
27
 	public slots:
27
 	public slots:
28
 		void displayAboutTypica();
28
 		void displayAboutTypica();
29
+		void displayFeedbackWizard();
29
 };
30
 };
30
 
31
 
31
 #endif
32
 #endif
35
 @(helpmenu.cpp@>=
36
 @(helpmenu.cpp@>=
36
 #include "helpmenu.h"
37
 #include "helpmenu.h"
37
 #include "abouttypica.h"
38
 #include "abouttypica.h"
39
+#include "feedback.h"
38
 
40
 
39
 @<Help menu implementation@>@;
41
 @<Help menu implementation@>@;
40
 
42
 
53
 	aboutTypicaAction->setObjectName("aboutTypicaAction");
55
 	aboutTypicaAction->setObjectName("aboutTypicaAction");
54
 	addAction(aboutTypicaAction);
56
 	addAction(aboutTypicaAction);
55
 	connect(aboutTypicaAction, SIGNAL(triggered()), this, SLOT(displayAboutTypica()));
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
 @ When "About Typica" is selected from the menu, we display an about box. This
64
 @ When "About Typica" is selected from the menu, we display an about box. This
65
 	aboutBox->show();
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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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
Näytä tiedosto


+ 96
- 0
src/moc_units.cpp Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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

+ 5
- 1
src/settings.w Näytä tiedosto

31
 	settingsTab->addTab(deviceSettings, tr("Roasters"));
31
 	settingsTab->addTab(deviceSettings, tr("Roasters"));
32
 	GraphSettingsWidget *graphSettings = new GraphSettingsWidget;
32
 	GraphSettingsWidget *graphSettings = new GraphSettingsWidget;
33
 	settingsTab->addTab(graphSettings, tr("Graph"));
33
 	settingsTab->addTab(graphSettings, tr("Graph"));
34
+	AdvancedSettingsWidget *advancedSettings = new AdvancedSettingsWidget;
35
+	settingsTab->addTab(advancedSettings, tr("Advanced"));
34
 	setCentralWidget(settingsTab);
36
 	setCentralWidget(settingsTab);
35
 }
37
 }
36
 
38
 
56
 value = engine->newQMetaObject(&DeviceConfigurationWindow::staticMetaObject, constructor);
58
 value = engine->newQMetaObject(&DeviceConfigurationWindow::staticMetaObject, constructor);
57
 engine->globalObject().setProperty("SettingsWindow", value);
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
Näytä tiedosto


+ 115
- 10
src/typica.w Näytä tiedosto

525
 @<Header files to include@>@/
525
 @<Header files to include@>@/
526
 @<Class declarations@>@/
526
 @<Class declarations@>@/
527
 @<Function prototypes for scripting@>@/
527
 @<Function prototypes for scripting@>@/
528
+@<Logging function prototype@>@/
528
 @<Class implementations@>@/
529
 @<Class implementations@>@/
529
 @<Functions for scripting@>@/
530
 @<Functions for scripting@>@/
531
+@<Logging function implementation@>@/
530
 @<The main program@>
532
 @<The main program@>
531
 #include "moc_typica.cpp"
533
 #include "moc_typica.cpp"
532
 
534
 
1414
 									QScriptEngine *engine);
1416
 									QScriptEngine *engine);
1415
 QScriptValue QSplitter_restoreState(QScriptContext *context,
1417
 QScriptValue QSplitter_restoreState(QScriptContext *context,
1416
 									QScriptEngine *engine);
1418
 									QScriptEngine *engine);
1419
+QScriptValue QSplitter_count(QScriptContext *context,
1420
+                             QScriptEngine *engine);
1417
 void setQSplitterProperties(QScriptValue value, QScriptEngine *engine);
1421
 void setQSplitterProperties(QScriptValue value, QScriptEngine *engine);
1418
 
1422
 
1419
 @ Of these, the scripting engine must be informed of the constructor.
1423
 @ Of these, the scripting engine must be informed of the constructor.
1440
 	value.setProperty("saveState", engine->newFunction(QSplitter_saveState));
1444
 	value.setProperty("saveState", engine->newFunction(QSplitter_saveState));
1441
 	value.setProperty("restoreState",
1445
 	value.setProperty("restoreState",
1442
 	                  engine->newFunction(QSplitter_restoreState));
1446
 	                  engine->newFunction(QSplitter_restoreState));
1447
+	value.setProperty("count", engine->newFunction(QSplitter_count));
1443
 }
1448
 }
1444
 
1449
 
1445
 @ The |"addWidget"| property is a simple wrapper around
1450
 @ The |"addWidget"| property is a simple wrapper around
1472
 	return QScriptValue();
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
 @ When saving and restoring the state of a splitter, we always want to do this
1497
 @ When saving and restoring the state of a splitter, we always want to do this
1476
 through a |QSettings| object. For this, we take an extra argument specifying the
1498
 through a |QSettings| object. For this, we take an extra argument specifying the
1477
 settings key to read from or write to. Unlike the equivalent functions called
1499
 settings key to read from or write to. Unlike the equivalent functions called
2104
 @ The constructor is trivial.
2126
 @ The constructor is trivial.
2105
 
2127
 
2106
 @<Functions for scripting@>=
2128
 @<Functions for scripting@>=
2107
-QScriptValue constructQProcess(QScriptContext *context, QScriptEngine *engine)
2129
+QScriptValue constructQProcess(QScriptContext *, QScriptEngine *engine)
2108
 {
2130
 {
2109
 	QScriptValue object = engine->newQObject(new QProcess);
2131
 	QScriptValue object = engine->newQObject(new QProcess);
2110
 	setQProcessProperties(object, engine);
2132
 	setQProcessProperties(object, engine);
2129
 arguments are specified.
2151
 arguments are specified.
2130
 
2152
 
2131
 @<Functions for scripting@>=
2153
 @<Functions for scripting@>=
2132
-QScriptValue QProcess_execute(QScriptContext *context, QScriptEngine *engine)
2154
+QScriptValue QProcess_execute(QScriptContext *context, QScriptEngine *)
2133
 {
2155
 {
2134
 	QProcess *self = getself<QProcess *>(context);
2156
 	QProcess *self = getself<QProcess *>(context);
2135
 	QString program = argument<QString>(0, context);
2157
 	QString program = argument<QString>(0, context);
2144
 @ Similarly |startDetached()| can be called in a few different ways.
2166
 @ Similarly |startDetached()| can be called in a few different ways.
2145
 
2167
 
2146
 @<Functions for scripting@>=
2168
 @<Functions for scripting@>=
2147
-QScriptValue QProcess_startDetached(QScriptContext *context, QScriptEngine *engine)
2169
+QScriptValue QProcess_startDetached(QScriptContext *context, QScriptEngine *)
2148
 {
2170
 {
2149
 	QProcess *self = getself<QProcess *>(context);
2171
 	QProcess *self = getself<QProcess *>(context);
2150
 	QString program = argument<QString>(0, context);
2172
 	QString program = argument<QString>(0, context);
2177
 @ Sometimes we care about the working directory for our program.
2199
 @ Sometimes we care about the working directory for our program.
2178
 
2200
 
2179
 @<Functions for scripting@>=
2201
 @<Functions for scripting@>=
2180
-QScriptValue QProcess_setWorkingDirectory(QScriptContext *context, QScriptEngine *engine)
2202
+QScriptValue QProcess_setWorkingDirectory(QScriptContext *context, QScriptEngine *)
2181
 {
2203
 {
2182
 	QProcess *self = getself<QProcess *>(context);
2204
 	QProcess *self = getself<QProcess *>(context);
2183
 	QString directory = argument<QString>(0, context);
2205
 	QString directory = argument<QString>(0, context);
2189
 access.
2211
 access.
2190
 
2212
 
2191
 @<Functions for scripting@>=
2213
 @<Functions for scripting@>=
2192
-QScriptValue QProcess_start(QScriptContext *context, QScriptEngine *engine)
2214
+QScriptValue QProcess_start(QScriptContext *context, QScriptEngine *)
2193
 {
2215
 {
2194
 	QProcess *self = getself<QProcess *>(context);
2216
 	QProcess *self = getself<QProcess *>(context);
2195
 	QString program = argument<QString>(0, context);
2217
 	QString program = argument<QString>(0, context);
3913
 QScriptValue annotationFromRecord(QScriptContext *context,
3935
 QScriptValue annotationFromRecord(QScriptContext *context,
3914
                                   QScriptEngine *engine);
3936
                                   QScriptEngine *engine);
3915
 QScriptValue setTabOrder(QScriptContext *context, QScriptEngine *engine);
3937
 QScriptValue setTabOrder(QScriptContext *context, QScriptEngine *engine);
3938
+QScriptValue saveFileFromDatabase(QScriptContext *context, QScriptEngine *engine);
3916
 
3939
 
3917
 @ These functions are passed to the scripting engine.
3940
 @ These functions are passed to the scripting engine.
3918
 
3941
 
3926
                                    engine->newFunction(annotationFromRecord));
3949
                                    engine->newFunction(annotationFromRecord));
3927
 engine->globalObject().setProperty("setTabOrder",
3950
 engine->globalObject().setProperty("setTabOrder",
3928
                                    engine->newFunction(setTabOrder));
3951
                                    engine->newFunction(setTabOrder));
3952
+engine->globalObject().setProperty("saveFileFromDatabase",
3953
+                                   engine->newFunction(saveFileFromDatabase));
3929
 
3954
 
3930
 @ These functions are not part of an object. They expect a string specifying
3955
 @ These functions are not part of an object. They expect a string specifying
3931
 the path to a file and return a string with either the name of the file without
3956
 the path to a file and return a string with either the name of the file without
3947
 	return retval;
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
 @ This function takes a string representing a SQL array and returns an array
3996
 @ This function takes a string representing a SQL array and returns an array
3951
 value.
3997
 value.
3952
 
3998
 
4488
 
4534
 
4489
 @i helpmenu.w
4535
 @i helpmenu.w
4490
 
4536
 
4537
+@i feedback.w
4538
+
4491
 @ A layout can contain a number of different elements including a variety of
4539
 @ A layout can contain a number of different elements including a variety of
4492
 widget types and other layouts. This function is responsible for applying any
4540
 widget types and other layouts. This function is responsible for applying any
4493
 layout class to the widget currently being populated and processing children of
4541
 layout class to the widget currently being populated and processing children of
12943
 {@/
12991
 {@/
12944
 	int *c = &argc;
12992
 	int *c = &argc;
12945
 	Application app(*c, argv);
12993
 	Application app(*c, argv);
12994
+	QSettings settings;
12995
+	@<Set up logging@>@;
12946
 	@<Set up icons@>@;
12996
 	@<Set up icons@>@;
12947
 	@<Set up fonts@>@;
12997
 	@<Set up fonts@>@;
12948
 
12998
 
12949
-	QSettings settings;
12950
-
12951
 	@<Register device configuration widgets@>@;
12999
 	@<Register device configuration widgets@>@;
12952
 	@<Prepare the database connection@>@;
13000
 	@<Prepare the database connection@>@;
12953
 	@<Load the application configuration@>@;
13001
 	@<Load the application configuration@>@;
12960
 	return retval;@/
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
 @ \pn{} 1.4 introduces the ability to use icons in certain interface elements.
13037
 @ \pn{} 1.4 introduces the ability to use icons in certain interface elements.
12964
 Some commonly desired public domain graphics are provided by the Tango Desktop
13038
 Some commonly desired public domain graphics are provided by the Tango Desktop
12965
 Project. We also set an application level default window icon.
13039
 Project. We also set an application level default window icon.
17605
 		void svuResponse(QByteArray response);
17679
 		void svuResponse(QByteArray response);
17606
 		void requestMeasurement();
17680
 		void requestMeasurement();
17607
 		void mResponse(QByteArray response);
17681
 		void mResponse(QByteArray response);
17608
-		void ignore(QByteArray response);@/
17682
+		void ignore(QByteArray response);
17683
+		void timeout();@/
17609
 	private:@/
17684
 	private:@/
17610
 		QextSerialPort *port;
17685
 		QextSerialPort *port;
17611
 		QByteArray responseBuffer;
17686
 		QByteArray responseBuffer;
17614
 		QList<char *> callbackQueue;
17689
 		QList<char *> callbackQueue;
17615
 		quint16 calculateCRC(QByteArray data);
17690
 		quint16 calculateCRC(QByteArray data);
17616
 		QTimer *messageDelayTimer;
17691
 		QTimer *messageDelayTimer;
17692
+		QTimer *commTimeout;
17617
 		int delayTime;
17693
 		int delayTime;
17618
 		char station;
17694
 		char station;
17619
 		int decimalPosition;
17695
 		int decimalPosition;
17645
 
17721
 
17646
 @<ModbusRTUDevice implementation@>=
17722
 @<ModbusRTUDevice implementation@>=
17647
 ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &index)
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
 	waiting(@[false@])@/
17725
 	waiting(@[false@])@/
17650
 {@/
17726
 {@/
17727
+qDebug() << "Initializing Modbus RTU Device";
17651
 	QDomElement portReferenceElement = model->referenceElement(model->data(index,
17728
 	QDomElement portReferenceElement = model->referenceElement(model->data(index,
17652
 		Qt::UserRole).toString());
17729
 		Qt::UserRole).toString());
17653
 	QDomNodeList portConfigData = portReferenceElement.elementsByTagName("attribute");
17730
 	QDomNodeList portConfigData = portReferenceElement.elementsByTagName("attribute");
17665
 	double temp = ((double)(1) / (double)(baudRate)) * 48;
17742
 	double temp = ((double)(1) / (double)(baudRate)) * 48;
17666
 	delayTime = (int)(temp * 3000);
17743
 	delayTime = (int)(temp * 3000);
17667
 	messageDelayTimer->setSingleShot(true);
17744
 	messageDelayTimer->setSingleShot(true);
17745
+	commTimeout->setSingleShot(true);
17668
 	connect(messageDelayTimer, SIGNAL(timeout()), this, SLOT(sendNextMessage()));
17746
 	connect(messageDelayTimer, SIGNAL(timeout()), this, SLOT(sendNextMessage()));
17747
+	connect(commTimeout, SIGNAL(timeout()), this, SLOT(timeout()));
17669
 	port->setDataBits(DATA_8);
17748
 	port->setDataBits(DATA_8);
17670
 	port->setParity((ParityType)attributes.value("parity").toInt());
17749
 	port->setParity((ParityType)attributes.value("parity").toInt());
17671
 	port->setStopBits((StopBitsType)attributes.value("stop").toInt());
17750
 	port->setStopBits((StopBitsType)attributes.value("stop").toInt());
17828
 	{
17907
 	{
17829
 		unitIsF = @[false@];
17908
 		unitIsF = @[false@];
17830
 	}
17909
 	}
17910
+	qDebug() << "Received unit response";
17831
 }
17911
 }
17832
 
17912
 
17833
 void ModbusRTUDevice::svlResponse(QByteArray response)
17913
 void ModbusRTUDevice::svlResponse(QByteArray response)
17842
 		outputSVLower /= 10;
17922
 		outputSVLower /= 10;
17843
 	}
17923
 	}
17844
 	emit SVLowerChanged(outputSVLower);
17924
 	emit SVLowerChanged(outputSVLower);
17925
+	qDebug() << "Received set value lower bound response";
17845
 }
17926
 }
17846
 
17927
 
17847
 void ModbusRTUDevice::svuResponse(QByteArray response)
17928
 void ModbusRTUDevice::svuResponse(QByteArray response)
17856
 		outputSVUpper /= 10;
17937
 		outputSVUpper /= 10;
17857
 	}
17938
 	}
17858
 	emit SVUpperChanged(outputSVUpper);
17939
 	emit SVUpperChanged(outputSVUpper);
17940
+	qDebug() << "Received set value upper bound response";
17859
 }
17941
 }
17860
 
17942
 
17861
 void ModbusRTUDevice::requestMeasurement()
17943
 void ModbusRTUDevice::requestMeasurement()
17963
 @<ModbusRTUDevice implementation@>=
18045
 @<ModbusRTUDevice implementation@>=
17964
 ModbusRTUDevice::~ModbusRTUDevice()
18046
 ModbusRTUDevice::~ModbusRTUDevice()
17965
 {
18047
 {
18048
+	commTimeout->stop();
17966
 	messageDelayTimer->stop();
18049
 	messageDelayTimer->stop();
17967
 	port->close();
18050
 	port->close();
17968
 }
18051
 }
17982
 a timer which will trigger sending the next message after a safe amount of
18065
 a timer which will trigger sending the next message after a safe amount of
17983
 time has passed.
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
 @<ModbusRTUDevice implementation@>=
18072
 @<ModbusRTUDevice implementation@>=
17986
 void ModbusRTUDevice::dataAvailable()
18073
 void ModbusRTUDevice::dataAvailable()
17987
 {
18074
 {
17991
 	}
18078
 	}
17992
 	responseBuffer.append(port->readAll());
18079
 	responseBuffer.append(port->readAll());
17993
 	@<Check Modbus RTU message size@>@;
18080
 	@<Check Modbus RTU message size@>@;
18081
+	commTimeout->stop();
17994
 	if(calculateCRC(responseBuffer) == 0)
18082
 	if(calculateCRC(responseBuffer) == 0)
17995
 	{
18083
 	{
17996
 		QObject *object = retObjQueue.at(0);
18084
 		QObject *object = retObjQueue.at(0);
18003
 		messageQueue.removeAt(0);
18091
 		messageQueue.removeAt(0);
18004
 		retObjQueue.removeAt(0);
18092
 		retObjQueue.removeAt(0);
18005
 		callbackQueue.removeAt(0);
18093
 		callbackQueue.removeAt(0);
18006
-		messageDelayTimer->start(delayTime);
18007
 	}
18094
 	}
18008
 	else
18095
 	else
18009
 	{
18096
 	{
18010
 		qDebug() << "CRC failed";
18097
 		qDebug() << "CRC failed";
18011
 	}
18098
 	}
18099
+	messageDelayTimer->start(delayTime);
18012
 	waiting = @[false@];
18100
 	waiting = @[false@];
18013
 	responseBuffer.clear();
18101
 	responseBuffer.clear();
18014
 }
18102
 }
18123
 		message.append(check[0]);
18211
 		message.append(check[0]);
18124
 		message.append(check[1]);
18212
 		message.append(check[1]);
18125
 		port->write(message);
18213
 		port->write(message);
18214
+		commTimeout->start(2000);
18126
 		messageDelayTimer->start(delayTime);
18215
 		messageDelayTimer->start(delayTime);
18127
 		waiting = @[true@];
18216
 		waiting = @[true@];
18128
 	}
18217
 	}
18154
 	return;
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
 @ This class must be exposed to the host environment.
18262
 @ This class must be exposed to the host environment.
18158
 
18263
 
18159
 @<Function prototypes for scripting@>=
18264
 @<Function prototypes for scripting@>=

Loading…
Peruuta
Tallenna