Browse Source

Enable batch counting

Neal Wilson 5 years ago
parent
commit
3805a2c39b
4 changed files with 18 additions and 8 deletions
  1. 2
    0
      config/Windows/productionroaster.xml
  2. 2
    1
      config/Windows/setsampleparameters.xml
  3. 10
    6
      src/moc_typica.cpp
  4. 4
    1
      src/typica.w

+ 2
- 0
config/Windows/productionroaster.xml View File

@@ -552,6 +552,8 @@
552 552
 						setParam.windowTitle = TTR("basicWindow", "Typica - Set Sample Parameters");
553 553
 						setParam.button = button;
554 554
 					});
555
+					stop.clicked.connect(button.incrementBatch);
556
+					stop.clicked.connect(button.resetCount);
555 557
 				}
556 558
 				else if(driverReference.driver == "annotationspinbox")
557 559
 				{

+ 2
- 1
config/Windows/setsampleparameters.xml View File

@@ -2,7 +2,7 @@
2 2
     <layout type="vertical">
3 3
         <layout type="horizontal">
4 4
             <label>Annotation:</label>
5
-            <line id="template">Sample %1</line>
5
+            <line id="template">%A-%1</line>
6 6
         </layout>
7 7
         <textarea id="instructions" />
8 8
         <button name="Reset Sample Number" type="push" id="reset" />
@@ -18,6 +18,7 @@
18 18
         var reset = findChildObject(this, 'reset');
19 19
         reset.clicked.connect(function() {
20 20
             window.button.resetCount();
21
+			window.button.resetBatch();
21 22
         });
22 23
         var okay = findChildObject(this, 'ok');
23 24
         var template = findChildObject(this, 'template');

+ 10
- 6
src/moc_typica.cpp View File

@@ -1,7 +1,7 @@
1 1
 /****************************************************************************
2 2
 ** Meta object code from reading C++ file 'typica.cpp'
3 3
 **
4
-** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
4
+** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6)
5 5
 **
6 6
 ** WARNING! All changes made in this file will be lost!
7 7
 *****************************************************************************/
@@ -9,7 +9,7 @@
9 9
 #if !defined(Q_MOC_OUTPUT_REVISION)
10 10
 #error "The header file 'typica.cpp' doesn't include <QObject>."
11 11
 #elif Q_MOC_OUTPUT_REVISION != 63
12
-#error "This file was generated using the moc from 4.8.7. It"
12
+#error "This file was generated using the moc from 4.8.6. It"
13 13
 #error "cannot be used with the include files from this version of Qt."
14 14
 #error "(The moc has changed too much.)"
15 15
 #endif
@@ -1716,7 +1716,7 @@ static const uint qt_meta_data_AnnotationButton[] = {
1716 1716
        6,       // revision
1717 1717
        0,       // classname
1718 1718
        0,    0, // classinfo
1719
-       6,   14, // methods
1719
+       8,   14, // methods
1720 1720
        0,    0, // properties
1721 1721
        0,    0, // enums/sets
1722 1722
        0,    0, // constructors
@@ -1732,6 +1732,8 @@ static const uint qt_meta_data_AnnotationButton[] = {
1732 1732
      167,  150,   17,   17, 0x0a,
1733 1733
      192,   17,   17,   17, 0x0a,
1734 1734
      203,   17,   17,   17, 0x0a,
1735
+     216,   17,   17,   17, 0x0a,
1736
+     229,   17,   17,   17, 0x0a,
1735 1737
 
1736 1738
        0        // eod
1737 1739
 };
@@ -1742,7 +1744,7 @@ static const char qt_meta_stringdata_AnnotationButton[] = {
1742 1744
     "setAnnotation(QString)\0tempcolumn\0"
1743 1745
     "setTemperatureColumn(int)\0annotationcolumn\0"
1744 1746
     "setAnnotationColumn(int)\0annotate()\0"
1745
-    "resetCount()\0"
1747
+    "resetCount()\0resetBatch()\0incrementBatch()\0"
1746 1748
 };
1747 1749
 
1748 1750
 void AnnotationButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
@@ -1757,6 +1759,8 @@ void AnnotationButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int
1757 1759
         case 3: _t->setAnnotationColumn((*reinterpret_cast< int(*)>(_a[1]))); break;
1758 1760
         case 4: _t->annotate(); break;
1759 1761
         case 5: _t->resetCount(); break;
1762
+        case 6: _t->resetBatch(); break;
1763
+        case 7: _t->incrementBatch(); break;
1760 1764
         default: ;
1761 1765
         }
1762 1766
     }
@@ -1794,9 +1798,9 @@ int AnnotationButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
1794 1798
     if (_id < 0)
1795 1799
         return _id;
1796 1800
     if (_c == QMetaObject::InvokeMetaMethod) {
1797
-        if (_id < 6)
1801
+        if (_id < 8)
1798 1802
             qt_static_metacall(this, _c, _id, _a);
1799
-        _id -= 6;
1803
+        _id -= 8;
1800 1804
     }
1801 1805
     return _id;
1802 1806
 }

+ 4
- 1
src/typica.w View File

@@ -10795,7 +10795,8 @@ string that can be incremented between batches.
10795 10795
 int batchReplace = noteTemplate.indexOf("%A");
10796 10796
 if(batchReplace >= 0)
10797 10797
 {
10798
-	note = noteTemplate.replace(batchReplace, 2, batch);
10798
+	QString temp = noteTemplate;
10799
+	note = temp.replace(batchReplace, 2, batch);
10799 10800
 }
10800 10801
 else
10801 10802
 {
@@ -10814,6 +10815,7 @@ void AnnotationButton::resetCount()
10814 10815
 void AnnotationButton::resetBatch()
10815 10816
 {
10816 10817
 	batch = "A";
10818
+	@<Replace batch holder in template@>@;
10817 10819
 }
10818 10820
 
10819 10821
 @ The batch sequence starts at A through Z, then proceeds to AA through AZ
@@ -18443,6 +18445,7 @@ ReconfigurableAnnotationButtonConfWidget::ReconfigurableAnnotationButtonConfWidg
18443 18445
     QFormLayout *layout = new QFormLayout;
18444 18446
     QLineEdit *buttonTextEdit = new QLineEdit;
18445 18447
     QLineEdit *annotationTextEdit = new QLineEdit;
18448
+	annotationTextEdit->setText("%A-%1");
18446 18449
     layout->addRow(tr("Button Text:"), buttonTextEdit);
18447 18450
     layout->addRow(tr("Annotation Text:"), annotationTextEdit);
18448 18451
     @<Get device configuration data for current node@>@;

Loading…
Cancel
Save