Przeglądaj źródła

Merge branch 'logging' into development

Neal Wilson 10 lat temu
rodzic
commit
7c6d5b688b

+ 61
- 0
src/advancedsettings.w Wyświetl plik

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

+ 2
- 0
src/daterangeselector.w Wyświetl plik

@@ -30,6 +30,8 @@ access to the ISO 8601 string representation of these dates is provided.
30 30
 @(daterangeselector.h@>=
31 31
 
32 32
 #include <QComboBox>
33
+#include <QPushButton>
34
+#include <QCalendarWidget>
33 35
 
34 36
 #ifndef TypicaDateRangeSelectorHeader
35 37
 #define TypicaDateRangeSelectorHeader

+ 80
- 0
src/moc_abouttypica.cpp Wyświetl plik

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

+ 210
- 0
src/moc_daterangeselector.cpp Wyświetl plik

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

+ 80
- 0
src/moc_draglabel.cpp Wyświetl plik

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

+ 102
- 0
src/moc_feedback.cpp Wyświetl plik

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

+ 96
- 0
src/moc_helpmenu.cpp Wyświetl plik

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

+ 111
- 0
src/moc_qextserialenumerator.cpp Wyświetl plik

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

+ 176
- 0
src/moc_qextserialport.cpp Wyświetl plik

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

+ 109
- 0
src/moc_scale.cpp Wyświetl plik

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

+ 7273
- 0
src/moc_typica.cpp
Plik diff jest za duży
Wyświetl plik


+ 96
- 0
src/moc_units.cpp Wyświetl plik

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

+ 113
- 0
src/moc_webelement.cpp Wyświetl plik

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

+ 130
- 0
src/moc_webview.cpp Wyświetl plik

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

+ 5
- 1
src/settings.w Wyświetl plik

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

+ 2489
- 2442
src/typica.cpp
Plik diff jest za duży
Wyświetl plik


+ 64
- 5
src/typica.w Wyświetl plik

@@ -525,8 +525,10 @@ generated file empty.
525 525
 @<Header files to include@>@/
526 526
 @<Class declarations@>@/
527 527
 @<Function prototypes for scripting@>@/
528
+@<Logging function prototype@>@/
528 529
 @<Class implementations@>@/
529 530
 @<Functions for scripting@>@/
531
+@<Logging function implementation@>@/
530 532
 @<The main program@>
531 533
 #include "moc_typica.cpp"
532 534
 
@@ -12719,11 +12721,11 @@ int main(int argc, char **argv)@/
12719 12721
 {@/
12720 12722
 	int *c = &argc;
12721 12723
 	Application app(*c, argv);
12724
+	QSettings settings;
12725
+	@<Set up logging@>@;
12722 12726
 	@<Set up icons@>@;
12723 12727
 	@<Set up fonts@>@;
12724 12728
 
12725
-	QSettings settings;
12726
-
12727 12729
 	@<Register device configuration widgets@>@;
12728 12730
 	@<Prepare the database connection@>@;
12729 12731
 	@<Load the application configuration@>@;
@@ -12736,6 +12738,32 @@ int main(int argc, char **argv)@/
12736 12738
 	return retval;@/
12737 12739
 }
12738 12740
 
12741
+@ \pn{} 1.6.3 introduces optional logging of diagnostic messages to a file. By
12742
+default this feature is not enabled. A sensible future refinement to this would
12743
+allow specification of where this file should be created.
12744
+
12745
+@<Set up logging@>=
12746
+if(settings.value("settings/advanced/logging", false).toBool())
12747
+{
12748
+	qInstallMsgHandler(messageFileOutput);
12749
+}
12750
+
12751
+@ This requires that we have our messageFileOutput function.
12752
+
12753
+@<Logging function prototype@>=
12754
+void messageFileOutput(QtMsgType type, const char *msg);
12755
+
12756
+@ The current implementation is straightforward.
12757
+
12758
+@<Logging function implementation@>=
12759
+void messageFileOutput(QtMsgType type, const char *msg)
12760
+{
12761
+	QFile output("Typica-"+QDate::currentDate().toString("yyyy-MM-dd")+".log");
12762
+	output.open(QIODevice::WriteOnly | QIODevice::Append);
12763
+	QTextStream outstream(&output);
12764
+	outstream << msg << "\r\n";
12765
+}
12766
+
12739 12767
 @ \pn{} 1.4 introduces the ability to use icons in certain interface elements.
12740 12768
 Some commonly desired public domain graphics are provided by the Tango Desktop
12741 12769
 Project. We also set an application level default window icon.
@@ -17381,7 +17409,8 @@ class ModbusRTUDevice : public QObject
17381 17409
 		void svuResponse(QByteArray response);
17382 17410
 		void requestMeasurement();
17383 17411
 		void mResponse(QByteArray response);
17384
-		void ignore(QByteArray response);@/
17412
+		void ignore(QByteArray response);
17413
+		void timeout();@/
17385 17414
 	private:@/
17386 17415
 		QextSerialPort *port;
17387 17416
 		QByteArray responseBuffer;
@@ -17390,6 +17419,7 @@ class ModbusRTUDevice : public QObject
17390 17419
 		QList<char *> callbackQueue;
17391 17420
 		quint16 calculateCRC(QByteArray data);
17392 17421
 		QTimer *messageDelayTimer;
17422
+		QTimer *commTimeout;
17393 17423
 		int delayTime;
17394 17424
 		char station;
17395 17425
 		int decimalPosition;
@@ -17421,9 +17451,10 @@ immediately upon construction.
17421 17451
 
17422 17452
 @<ModbusRTUDevice implementation@>=
17423 17453
 ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &index)
17424
-: QObject(NULL), messageDelayTimer(new QTimer), unitIsF(@[true@]), readingsv(@[false@]),
17454
+: QObject(NULL), messageDelayTimer(new QTimer), commTimeout(new QTimer), unitIsF(@[true@]), readingsv(@[false@]),
17425 17455
 	waiting(@[false@])@/
17426 17456
 {@/
17457
+qDebug() << "Initializing Modbus RTU Device";
17427 17458
 	QDomElement portReferenceElement = model->referenceElement(model->data(index,
17428 17459
 		Qt::UserRole).toString());
17429 17460
 	QDomNodeList portConfigData = portReferenceElement.elementsByTagName("attribute");
@@ -17441,7 +17472,9 @@ ModbusRTUDevice::ModbusRTUDevice(DeviceTreeModel *model,@| const QModelIndex &in
17441 17472
 	double temp = ((double)(1) / (double)(baudRate)) * 48;
17442 17473
 	delayTime = (int)(temp * 3000);
17443 17474
 	messageDelayTimer->setSingleShot(true);
17475
+	commTimeout->setSingleShot(true);
17444 17476
 	connect(messageDelayTimer, SIGNAL(timeout()), this, SLOT(sendNextMessage()));
17477
+	connect(commTimeout, SIGNAL(timeout()), this, SLOT(timeout()));
17445 17478
 	port->setDataBits(DATA_8);
17446 17479
 	port->setParity((ParityType)attributes.value("parity").toInt());
17447 17480
 	port->setStopBits((StopBitsType)attributes.value("stop").toInt());
@@ -17604,6 +17637,7 @@ void ModbusRTUDevice::unitResponse(QByteArray response)
17604 17637
 	{
17605 17638
 		unitIsF = @[false@];
17606 17639
 	}
17640
+	qDebug() << "Received unit response";
17607 17641
 }
17608 17642
 
17609 17643
 void ModbusRTUDevice::svlResponse(QByteArray response)
@@ -17618,6 +17652,7 @@ void ModbusRTUDevice::svlResponse(QByteArray response)
17618 17652
 		outputSVLower /= 10;
17619 17653
 	}
17620 17654
 	emit SVLowerChanged(outputSVLower);
17655
+	qDebug() << "Received set value lower bound response";
17621 17656
 }
17622 17657
 
17623 17658
 void ModbusRTUDevice::svuResponse(QByteArray response)
@@ -17632,6 +17667,7 @@ void ModbusRTUDevice::svuResponse(QByteArray response)
17632 17667
 		outputSVUpper /= 10;
17633 17668
 	}
17634 17669
 	emit SVUpperChanged(outputSVUpper);
17670
+	qDebug() << "Received set value upper bound response";
17635 17671
 }
17636 17672
 
17637 17673
 void ModbusRTUDevice::requestMeasurement()
@@ -17739,6 +17775,7 @@ else
17739 17775
 @<ModbusRTUDevice implementation@>=
17740 17776
 ModbusRTUDevice::~ModbusRTUDevice()
17741 17777
 {
17778
+	commTimeout->stop();
17742 17779
 	messageDelayTimer->stop();
17743 17780
 	port->close();
17744 17781
 }
@@ -17758,6 +17795,10 @@ remove the message and callback information from the message queue, and start
17758 17795
 a timer which will trigger sending the next message after a safe amount of
17759 17796
 time has passed.
17760 17797
 
17798
+If a response is received with an invalid CRC, we do not pass that message
17799
+out. Instead, the message handling queues are kept as they are and the previous
17800
+command will be sent again once the message delay timer is finished.
17801
+
17761 17802
 @<ModbusRTUDevice implementation@>=
17762 17803
 void ModbusRTUDevice::dataAvailable()
17763 17804
 {
@@ -17767,6 +17808,7 @@ void ModbusRTUDevice::dataAvailable()
17767 17808
 	}
17768 17809
 	responseBuffer.append(port->readAll());
17769 17810
 	@<Check Modbus RTU message size@>@;
17811
+	commTimeout->stop();
17770 17812
 	if(calculateCRC(responseBuffer) == 0)
17771 17813
 	{
17772 17814
 		QObject *object = retObjQueue.at(0);
@@ -17779,12 +17821,12 @@ void ModbusRTUDevice::dataAvailable()
17779 17821
 		messageQueue.removeAt(0);
17780 17822
 		retObjQueue.removeAt(0);
17781 17823
 		callbackQueue.removeAt(0);
17782
-		messageDelayTimer->start(delayTime);
17783 17824
 	}
17784 17825
 	else
17785 17826
 	{
17786 17827
 		qDebug() << "CRC failed";
17787 17828
 	}
17829
+	messageDelayTimer->start(delayTime);
17788 17830
 	waiting = @[false@];
17789 17831
 	responseBuffer.clear();
17790 17832
 }
@@ -17899,6 +17941,7 @@ void ModbusRTUDevice::sendNextMessage()
17899 17941
 		message.append(check[0]);
17900 17942
 		message.append(check[1]);
17901 17943
 		port->write(message);
17944
+		commTimeout->start(2000);
17902 17945
 		messageDelayTimer->start(delayTime);
17903 17946
 		waiting = @[true@];
17904 17947
 	}
@@ -17930,6 +17973,22 @@ void ModbusRTUDevice::ignore(QByteArray)
17930 17973
 	return;
17931 17974
 }
17932 17975
 
17976
+@ Sometimes a communications failure will occur in which a response to a
17977
+command is never received. To reset communications we set a timer whenever a
17978
+command is sent and stop that once a full response is received. If the timer
17979
+times out, we should clear the response buffer and attempt to re-establish
17980
+communications. Currently this timeout is hard coded at 2 seconds, however
17981
+this should be configurable and smaller values may well be acceptable.
17982
+
17983
+@<ModbusRTUDevice implementation@>=
17984
+void ModbusRTUDevice::timeout()
17985
+{
17986
+	qDebug() << "Communications timeout.";
17987
+	responseBuffer.clear();
17988
+	waiting = false;
17989
+	messageDelayTimer->start();
17990
+}
17991
+
17933 17992
 @ This class must be exposed to the host environment.
17934 17993
 
17935 17994
 @<Function prototypes for scripting@>=

Ładowanie…
Anuluj
Zapisz