Browse Source

Clarify notification channel behavior

Neal Wilson 7 years ago
parent
commit
0f82e76e71
3 changed files with 446 additions and 455 deletions
  1. 1
    1
      config/Reports/historyreport.xml
  2. 440
    447
      src/typica.cpp
  3. 5
    7
      src/typica.w

+ 1
- 1
config/Reports/historyreport.xml View File

296
                 buffer.close();
296
                 buffer.close();
297
             };
297
             };
298
             refresh();
298
             refresh();
299
-            var notifier = Application.subscribe("RoastingLogChange");
299
+            var notifier = Application.subscribe("roastinglogchange");
300
             notifier.notify.connect(function() {
300
             notifier.notify.connect(function() {
301
                 refresh();
301
                 refresh();
302
             });
302
             });

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


+ 5
- 7
src/typica.w View File

13014
 bother notification aware controls that are uninterested in unrelated
13014
 bother notification aware controls that are uninterested in unrelated
13015
 notifications, a notification object is created for each notification.
13015
 notifications, a notification object is created for each notification.
13016
 
13016
 
13017
+Note that the notification channel is an identifier and unquoted identifiers
13018
+will be converted to lowercase while \pn{} will attempt to match subscribed to
13019
+notifications exactly. This means that it is generally a good idea to subscribe
13020
+with the channel specified in lowercase.
13021
+
13017
 @<Application Implementation@>=
13022
 @<Application Implementation@>=
13018
 DatabaseNotification* Application::subscribe(const QString &notification)
13023
 DatabaseNotification* Application::subscribe(const QString &notification)
13019
 {
13024
 {
13986
         settings.setValue("database/dbname", dbname->text());
13991
         settings.setValue("database/dbname", dbname->text());
13987
         settings.setValue("database/user", user->text());
13992
         settings.setValue("database/user", user->text());
13988
         settings.setValue("database/password", password->text());
13993
         settings.setValue("database/password", password->text());
13989
-        database.close();
13990
         AppInstance->setDatabaseConnected(true);
13994
         AppInstance->setDatabaseConnected(true);
13991
         accept();
13995
         accept();
13992
     }
13996
     }
14026
 }
14030
 }
14027
 else
14031
 else
14028
 {
14032
 {
14029
-    database.close();
14030
     AppInstance->setDatabaseConnected(true);
14033
     AppInstance->setDatabaseConnected(true);
14031
 }
14034
 }
14032
 
14035
 
18782
     tchar[0] = response.at(4);
18785
     tchar[0] = response.at(4);
18783
     decimalPosition = temp;
18786
     decimalPosition = temp;
18784
     emit SVDecimalChanged(decimalPosition);
18787
     emit SVDecimalChanged(decimalPosition);
18785
-    qDebug() << "Received decimal response";
18786
 }
18788
 }
18787
 
18789
 
18788
 void ModbusRTUDevice::unitResponse(QByteArray response)
18790
 void ModbusRTUDevice::unitResponse(QByteArray response)
18800
     {
18802
     {
18801
         unitIsF = @[false@];
18803
         unitIsF = @[false@];
18802
     }
18804
     }
18803
-    qDebug() << "Received unit response";
18804
 }
18805
 }
18805
 
18806
 
18806
 void ModbusRTUDevice::svlResponse(QByteArray response)
18807
 void ModbusRTUDevice::svlResponse(QByteArray response)
18815
         outputSVLower /= 10;
18816
         outputSVLower /= 10;
18816
     }
18817
     }
18817
     emit SVLowerChanged(outputSVLower);
18818
     emit SVLowerChanged(outputSVLower);
18818
-    qDebug() << "Received set value lower bound response";
18819
 }
18819
 }
18820
 
18820
 
18821
 void ModbusRTUDevice::svuResponse(QByteArray response)
18821
 void ModbusRTUDevice::svuResponse(QByteArray response)
18830
         outputSVUpper /= 10;
18830
         outputSVUpper /= 10;
18831
     }
18831
     }
18832
     emit SVUpperChanged(outputSVUpper);
18832
     emit SVUpperChanged(outputSVUpper);
18833
-    qDebug() << "Received set value upper bound response";
18834
 }
18833
 }
18835
 
18834
 
18836
 void ModbusRTUDevice::requestMeasurement()
18835
 void ModbusRTUDevice::requestMeasurement()
19103
         char *check = (char*)&crc;
19102
         char *check = (char*)&crc;
19104
         message.append(check[0]);
19103
         message.append(check[0]);
19105
         message.append(check[1]);
19104
         message.append(check[1]);
19106
-        qDebug() << "Writing" << message.toHex();
19107
         port->write(message);
19105
         port->write(message);
19108
         commTimeout->start(2000);
19106
         commTimeout->start(2000);
19109
         messageDelayTimer->start(delayTime);
19107
         messageDelayTimer->start(delayTime);

Loading…
Cancel
Save