Index: AlarmMapping.csv =================================================================== diff -u -r67d05211b87d310ce213695c52b110fb28cfbd4b -r9ae3b0d6624904693329309aaf8ff02784c17184 --- AlarmMapping.csv (.../AlarmMapping.csv) (revision 67d05211b87d310ce213695c52b110fb28cfbd4b) +++ AlarmMapping.csv (.../AlarmMapping.csv) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -64,10 +64,10 @@ 63,"FPGA reports failure reading arterial pressure sensor." 64,"FPGA reports failure reading venous pressure sensor." 65,"HD requests DG command with invalid parameter fault." - 66,"DG non-volatile calibration group invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." + 66,"DG non-volatile calibration group invalid record CRC." 67,"HD blood pump occlusion self-test failure alarm." - 68,"HD dialysate inlet pump occlusion self-test failure alarm." - 69,"HD dialysate outlet pump occlusion self-test failure alarm." + 68,"This alarm ID is available for use." + 69,"This alarm ID is available for use." 70,"HD arterial pressure self-test failure alarm." 71,"HD venous pressure self-test failure alarm." 72,"HD blood flow meter status check self-test failure alarm." @@ -104,7 +104,7 @@ 103,"HD non-volatile calibration group invalid record CRC." 104,"Air trap level sensors reporting illegal combination of air/fluid." 105,"DG non-volatile system group invalid record CRC." - 106,"DG non-volatile service group invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." + 106,"DG non-volatile service group invalid record CRC." 107,"HD reports DG restarted fault." 108,"HD syringe pump ADC error." 109,"HD syringe pump volume check error." @@ -141,8 +141,8 @@ 140,"Dialysate generator communication timeout." 141,"Air trap fill timeout during treatment." 142,"Blood pump occlusion detected." - 143,"Dialysate inlet pump occlusion detected." - 144,"Dialysate outlet pump occlusion detected." + 143,"This alarm ID is available for use." + 144,"This alarm ID is available for use." 145,"Concentrate conductivity after adding acid out of range alarm." 146,"Dialysate conductivity out of range." 147,"DG dialysate generation conductivity fault alarm." @@ -153,11 +153,11 @@ 152,"Inlet water pressure too low." 153,"HD prime completed high priority alarm." 154,"EEPROM operations (read, write, erase) failure." - 155,"DG non-volatile service invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." + 155,"DG non-volatile service invalid record CRC." 156,"HW usage data (treatment time in HD and total consumed water in DG) failure." - 157,"Calibration record CRC failure TODO remove this alarm after DEN-9480 fwcommon was merged into staging." - 158,"Blood pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." - 159,"Dialysate inlet pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." + 157,"Calibration record CRC failure." + 158,"Blood pump failed flow vs motor speed check." + 159,"Dialysate inlet pump failed flow vs motor speed check." 160,"Blood pump rotor speed too high." 161,"Blood flow sensor signal strength too low." 162,"Dialysate flow sensor signal strength too low." @@ -192,7 +192,7 @@ 191,"DG flow rate out of upper range." 192,"DG flow rate out of lower range." 193,"RO pump flow rate out of range." - 194,"DG RO pump off fault." + 194,"DG RO pump duty cycle out of range." 195,"DG RO pump pressure out of range." 196,"DG temperature sensor error flag fault." 197,"DG temperature sensors ADC fault." @@ -235,8 +235,8 @@ 234,"RTC (i.e read time) or RAM operations failure (read or write)." 235,"HD in treatment stopped sub-mode after rinseback completed (no escalation)." 236,"HD needs new cartridge to be installed." - 237,"HD cartridge installed improperly alarm." - 238,"HD no cartridge loaded alarm." + 237,"This alarm ID is available for use." + 238,"HD no cartridge loaded or installed improperly alarm." 239,"HD fail to remove cartridge alarm." 240,"Bicarb conductivity out of range during bicarb pump check alarm." 241,"DG reservoir drain time out." @@ -276,8 +276,8 @@ 275,"HD arterial pressure sensor is reading out of range." 276,"HD venous pressure sensor is reading out of range." 277,"HD BP occlusion sensor is reading out of range." - 278,"HD DPi occlusion sensor is reading out of range." - 279,"HD DPo occlusion sensor is reading out of range." + 278,"This alarm ID is available for use." + 279,"This alarm ID is available for use." 280,"HD arterial pressure sensor read timeout error." 281,"Acid concentration bottle low volume alarm." 282,"Bicarbonate concentration bottle low volume alarm." Index: alarmMapping.sh =================================================================== diff -u -r3f555c49ddd2c983f469709e3c001d0e76159248 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- alarmMapping.sh (.../alarmMapping.sh) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) +++ alarmMapping.sh (.../alarmMapping.sh) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -15,15 +15,18 @@ # ############################################################################ # update common repo +echo "update the common repo" cd common git pull cd .. # update the alarm messaging +echo "update the alarm message mapping" ../scripts/build/alarmMapping \ common/AlarmDefs.h \ sources/model/hd/alarm/MAlarmMapping.cpp \ 1> alarmMapping.log \ 2> alarmMapping.err -cp ../scripts/build/AlarmMapping.csv . +echo "move the Alarm code mapping to current location(./)" +mv ../scripts/build/AlarmMapping.csv . Index: denali.pro =================================================================== diff -u -r161d1431cc3507cd430f54af6aa47dab5145d472 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- denali.pro (.../denali.pro) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) +++ denali.pro (.../denali.pro) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -51,6 +51,7 @@ sources/utility \ sources/wifi \ sources/bluetooth \ + sources/cloudsync \ sources/abstract \ sources/model \ sources/model/settings \ @@ -119,6 +120,7 @@ sources/view/hd/data/post/VHDPOSTData.h \ sources/wifi/WifiInterface.h \ sources/bluetooth/BluetoothInterface.h \ + sources/cloudsync/CloudSyncController.h \ \ # ---------- Models ---------- sources/model/MModel.h \ sources/model/MAbstract.h \ @@ -372,6 +374,7 @@ sources/view/hd/data/post/VHDPOSTData.cpp \ sources/wifi/WifiInterface.cpp \ sources/bluetooth/BluetoothInterface.cpp \ + sources/cloudsync/CloudSyncController.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ sources/model/MAbstractDynamic.cpp \ Index: denali.pro.user =================================================================== diff -u -r161d1431cc3507cd430f54af6aa47dab5145d472 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- denali.pro.user (.../denali.pro.user) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) +++ denali.pro.user (.../denali.pro.user) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- en_US.udic (.../en_US.udic) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ en_US.udic (.../en_US.udic) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -183,3 +183,16 @@ HDEvent MHDDebug MDGGeneral +Inp +cloudsync +inp +wifi +ssid +subnetmask +ip +wpa +dns +useDHCP +ini +vfat +Unmounts Index: main.cpp =================================================================== diff -u -re4a0e2fc4c7ae0cbce0d670772276bf7f5ff3845 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- main.cpp (.../main.cpp) (revision e4a0e2fc4c7ae0cbce0d670772276bf7f5ff3845) +++ main.cpp (.../main.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -52,6 +52,7 @@ #include "DeviceController.h" #include "WifiInterface.h" #include "BluetoothInterface.h" +#include "CloudSyncController.h" #include "Threads.h" // #include "FileHandler.h" @@ -362,6 +363,9 @@ //! - Initializing Bluetooth Interface _BluetoothInterface.init(Threads::_Bluetooth_Thread); + //! - Initializing the CloudSync controller + _CloudSyncController.init(Threads::_CloudSync_Thread); + //! - Initialize the QML Viewer and starts GUI int app_exec = -1; LOG_DEBUG("UI Initializing"); Index: resources/settings/messages/unhandled.conf =================================================================== diff -u -rcbb246d6efa242f927f88ac5da518dedb2d63320 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- resources/settings/messages/unhandled.conf (.../unhandled.conf) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) +++ resources/settings/messages/unhandled.conf (.../unhandled.conf) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -8,20 +8,268 @@ # 1 - the message short name to be used in log. # 2 - varable number of parameters type # 3 - any value for a key will be ignored for now. -# message [0x4900] as an example has value for the two keys (parameter type) it has which will be ignore. +# message [0x4900] as an example has value for the two keys (parameter type) it has which will be ignore. +# 4 - Every unhandled message listed in the unhandled.conf file will be logged as Data, +# since from UI perspective event is a bidirectional, +# in opposed to data message which is sent on a predefined frequency. +# 5 - All the channels even DG->HD or HD->DG are logged as well. +# 6 - If a message is handled by the UI, it will never look into this file. +# 7 - The logged messages will only contain the source not the destination. +# so in case the message is comming from DG->HD, only the DG as the source will be logged. +# 8 - The title of the message is yours to put the destination as well if is not UI, +# but please don't make it too long. +# 9 - Please only use [A-Z, a-z] characters in the title and avoid using special characters (specially comma). +# since th log output is in csv format and the separator is comma and each column has meaing. +#10 - In case the received message is shorter than defined (in this file), +# for the missing parameters, a question mark (?) will be used. +# -[0x6A00] -FluidLeak -U32 +[0x0A00] +HD_RTC_Epoch_Data +U32=Epoch -[0x6C00] -BloodLeak -U32 -U32 +[0x1900] +DG_Dialysate_Tgt_Temps +F32=Primary Heater +F32=Trimmer Heater +[0x2100] +DG_Switch_Res_Cmd +U32=Reservoir + +[0x2200] +DG_Fill_Cmd +U32=Fill volume +U32=Start/Stop + +[0x2300] +DG_Drain_Cmd +U32=Drain volume +U32=Tare/No Tare +U32=Rinse concentrate lines or not + +[0x2600] +DG_Cmd +U32=Start/Stop + +[0x2900] +DG_Sample_Water_Cmd +U32=Cmd + +[0x2B00] +DG_Trimmer_Htr_Cmd +U32=Start/Stop +F32=Target temperature + +[0x3000] +DG_Heat_Disinfect_Cmd +U32=Start/Stop + +[0x3100] +DG_Conductivity_Sensors_Data +F32=Reject Ratio +F32=CPi +F32=CPo +F32=CD1 +F32=CD2 + +[0x3700] +DG_Heat_Disinfect_Data +U32=Heat Disinfect State +U32=Heat Disinfect Total Time +U32=Heat Disinfect State Time +U32=Heat Disinfect Disinfect Time +U32=Cancel Mode +F32=R1 Fill Level +F32=R2 Fill Level +U32=UI Data + +[0x3A00] +HD_Valves_Data +U32=ValveID +U32=Valve State +U32=PosID +S16=Position +S16=Next Position +F32=Current +S16=PositionC +S16=PositionA +S16=PositionB +U32=PWM DC +U32=Air Trap Valve State + +[0x3E00] +Air_Trap_Data +U32=Lower Level +U32=Upper Level + +[0x4200] +DG_Concentrate_Pump_Data +F32=CP1 Set Speed +F32=CP1 Measured Speed +F32=CP2 Set Speed +F32=CP2 Measured Speed + +[0x4400] +DG_UV_Reactors_Data +U32=Inlet UV Health Status +U32=Outlet UV Health Status +U32=Inlet UV State +U32=Outlet UV State + +[0x4500] +DG_Thermistors_Data +F32=Board Temp +F32=PS1 Temp +F32=PS2 Temp + +[0x4800] +DG_Fans_Data +F32=Calc PWM DC +F32=Target RPM +F32=Inlet Fan 1 RPM +F32=Inlet Fan 2 RPM +F32=Inlet Fan 3 RPM +F32=Outlet Fan 1 RPM +F32=Outlet Fan 2 RPM +F32=Outlet Fan 3 RPM + [0x4900] TxStopPrg U32=Timeout (secs) U32=Timeout countdown (secs) +[0x5100] +DG_Cmd_Rsp +U32=CmdID +U32=Rejected/Accepted +U32=Reject Reason +[0x5B00] +DG_Chg_Valves_Cmd +U32=Res transfer direction + +[0x6A00] +HD_Fluid_Leak_Data +U32=Leak State + +[0x6B00] +DG_Fluid_Leak_Data +U32=Leak State + +[0x6C00] +HD_Blood_Leak_Data +U32=Leak Status +U32=Leak State + +[0x7800] +DG_Chem_Disinfect_Cmd +U32=Start/Stop + +[0x7900] +DG_Flush_Cmd +U32=Start/Stop + +[0x7A00] +DG_Flush_Data +U32=State +U32=Time +U32=State Time + +[0x7B00] +HD_Voltages_Data +F32=1.2V +F32=3.3V +F32=5V Logic +F32=5V Sensors +F32=24V +F32=24V Regen +F32=1.25V FPGA ADC Ref +F32=3V PBA Ref +F32=1V FPGA Vcc +F32=1.8V FPGA Vaux +F32=0V FPGA Vpvn + +[0x8600] +DG_Voltages_Data +F32=1V FPGA +F32=1.2V Processor +F32=1.8V Processor +F32=1.8V FPGA +F32=3V Vref +F32=3V Ext ADC1 +F32=3V Ext ADC2 +F32=3.3V +F32=3.3V Sensors +F32=5V Logic +F32=5V Sensors +F32=5V PS Gate Driver +F32=24V main +F32=24V small primary heating element +F32=24V trimmer heating element + +[0x8700] +DG_Chemical_Disinfect_Data +U32=State +U32=Time +U32=State Time +U32=Cancel Mode +F32=R1 Fill Level +F32=R2 Fill Level +U32=Target rinse count +U32=Rinse count +U32 UI State + +[0x8B00] +HD_Usage_Data +U32=Treatment count + +[0x8D00] +DG_Usage_Data +F32=Liters + +[0x9300] +Bubble_Data +U32=Arterial bubble detector status +U32=Arterial bubble detector state +U32=Venous bubble detector status +U32=Venous bubble detector state + +[0x9A00] +HD_Standby_Disinfect_Req + +[0x9B00] +HD_Set_Standby_Disinfect_State_Response +U32=Accepted or Rejected +U32=Reject Reason + +[0x9D00] +DG_POST_Result_Req + +[0x9D00] +HD_Temperature_Data +F32=Board temperature +F32=PS 1 temperature +F32=FPGA temperature +F32=PBo temperature +F32=PBA ADC temperature + +[0xA000] +HD_Usage_Info_Req + +[0xA100] +DG_Switches_Data +U32=Concentrate cap status +U32=Dialysate cap status +U32=Door status + +[0xA200] +HD_Switches_Data +U32=Door switch + +[0xA300] +HD_Fans_Data +F32=PWM Duty Cycle +F32=Target RPM +F32=Inlet fan 1 RPM + Index: sources/Threads.cpp =================================================================== diff -u -r2dd767833cf0cf706c457951c2d78e7e20aff768 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/Threads.cpp (.../Threads.cpp) (revision 2dd767833cf0cf706c457951c2d78e7e20aff768) +++ sources/Threads.cpp (.../Threads.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -36,6 +36,7 @@ QThread _Application_Thread ; QThread _Wifi_Thread ; QThread _Bluetooth_Thread ; + QThread _CloudSync_Thread ; /*! * \brief registerTypes * \details this method has to be called before any class which uses these types Index: sources/Threads.h =================================================================== diff -u -r2dd767833cf0cf706c457951c2d78e7e20aff768 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/Threads.h (.../Threads.h) (revision 2dd767833cf0cf706c457951c2d78e7e20aff768) +++ sources/Threads.h (.../Threads.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -27,6 +27,7 @@ extern QThread _Application_Thread ; extern QThread _Wifi_Thread ; extern QThread _Bluetooth_Thread ; + extern QThread _CloudSync_Thread ; void registerTypes(); void quitThread (QThread &vThread); Index: sources/bluetooth/BluetoothInterface.h =================================================================== diff -u -raeb915075b9e13e5c1aaf2800ba6db03b6c24a0b -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision aeb915075b9e13e5c1aaf2800ba6db03b6c24a0b) +++ sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -167,7 +167,7 @@ void didDeviceChange (const BluetoothDeviceData &vDevice); void didDeviceSelect (const BluetoothDeviceData &vDevice); - SAFE_CALL(doStart ) - SAFE_CALL(doScan ) + SAFE_CALL(doStart) + SAFE_CALL(doScan ) }; } Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r161d1431cc3507cd430f54af6aa47dab5145d472 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -226,7 +226,8 @@ if ( length ) { // this message has a variable length vPayload = Format::fromVariant(vData[0]); } - // DEBUG: LOG_EVENT_UI(QString("CheckIn")); + // DEBUG: + LOG_EVENT_UI(QString("CheckIn")); break; case Gui::GuiActionType::ID_RawData: // len: 255, can have any len @@ -654,9 +655,9 @@ */ void MessageInterpreter::updateUnhandledMessages() { - qDebug() << _Settings.groups("messages/unhandled"); + // DEBUG: qDebug() << _Settings.groups("messages/unhandled"); for(const auto group: _Settings.groups("messages/unhandled")) { - qDebug() << _Settings.keys(group); + // DEBUG: qDebug() << _Settings.keys(group); bool ok; quint16 id = QString(group).toUInt(&ok,16); if (!ok) continue; Index: sources/cloudsync/CloudSyncController.cpp =================================================================== diff -u --- sources/cloudsync/CloudSyncController.cpp (revision 0) +++ sources/cloudsync/CloudSyncController.cpp (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -0,0 +1,192 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file CloudSyncController.cpp + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 13-Oct-2021 + * \date (original) 13-Oct-2021 + * + */ +#include "CloudSyncController.h" + +// Qt +#include + +// Project +#include "MainTimer.h" +#include "MessageDispatcher.h" +#include "Logger.h" +#include "GuiController.h" +#include "DeviceController.h" +#include "FileHandler.h" +//#include "GuiGlobals.h" + +/*! + * \brief CloudSyncController::CloudSyncController + * \details Constructor + * \param parent - QObject parent owner object. + * Qt handles the children destruction by their parent objects life-cycle. + */ +CloudSyncController::CloudSyncController(QObject *parent) : QObject(parent) { + addWatch(); +} + +/*! + * \brief CloudSyncController initializer + */ +bool CloudSyncController::init() +{ + if ( _init ) return false; + _init = true; + + initConnections(); + LOG_DEBUG(tr("%1 Initialized").arg(metaObject()->className())); + + return true; +} + +/*! + * \brief CloudSyncController::init + * \details Initialized the Class by calling the init() method first + * And initializes the thread vThread by calling initThread + * on success init(). + * \param vThread - the thread + * \return returns the return value of the init() method + */ +bool CloudSyncController::init(QThread &vThread) +{ + if ( ! init() ) return false; + initThread(vThread); + return true; +} + +/*! + * \brief CloudSyncController::quit + * \details quits the class + * Calls quitThread + */ +void CloudSyncController::quit() +{ + // coco begin validated: CloudSync termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + quitThread(); // validated +} + +/*! + * \brief CloudSyncController::onWatchFileChange + * \details This slot will be called when the Device Controller identifies any changes in the watched files. + * \param vFile - watched file + * \note The DeviceController will emit the signal on any watched file update, it's up to the CloudSyncController to filter the result. + */ +void CloudSyncController::onWatchFileChange(const QString &vFile) +{ + if ( QFileInfo(vFile).fileName() != Storage::CloudSync_Out_File ) return; // ignore unwanted file updates. + + QString content; + Storage::FileHandler::read(vFile, content); + interpreter(content); +} +// coco end + +/*! + * \brief CloudSyncController::initConnections + * \details Initializes the required signal/slot connection between this class and other objects + * to be able to communicate. + */ +void CloudSyncController::initConnections() +{ + connect(&_DeviceController , SIGNAL(didWatchFileChange (const QString &)), + this , SLOT( onWatchFileChange (const QString &))); + connect(&_MessageDispatcher , SIGNAL(didActionReceive (GuiActionType,const QVariantList &)), + this , SLOT( onActionReceive (GuiActionType,const QVariantList &))); +} + +/*! + * \brief CloudSyncController::initThread + * \details Moves this object into the thread vThread. + * And checks that this method is called from main thread. + * Also connects quitThread to CloudSync aboutToQuit. + * \param vThread - the thread + */ +void CloudSyncController::initThread(QThread &vThread) +{ + // runs in main thread + Q_ASSERT_X(QThread::currentThread() == qApp->thread(), __func__, "The Class initialization must be done in Main Thread" ); + _thread = &vThread; + _thread->setObjectName(QString("%1_Thread").arg(metaObject()->className())); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit())); + _thread->start(); + moveToThread(_thread); +} + +/*! + * \brief CloudSyncController::quitThread + * \details Moves this object to main thread to be handled by QCloudSync + * And to be destroyed there. + */ +void CloudSyncController::quitThread() +{ + // coco begin validated: CloudSync termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + + if ( ! _thread ) return; + + // runs in thread + moveToThread(qApp->thread()); // validated +} +// coco end + +void CloudSyncController::addWatch() +{ + bool ok = Storage::FileHandler::makeFolder(Storage::SDCard_Base_Path_Name + _location); + if ( ok ) { + // watching for the cloud sync output file buffer. + _DeviceController.doAddWatch(Storage::SDCard_Base_Path_Name + _location + Storage::CloudSync_Out_File); + } + else { + LOG_DEBUG(tr("the CloudSync log folder cannot be created.")); + } +} + +/*! + * \brief CloudSyncController::interpreter + * \details the function to be called after reading the CloudSync out file to interpret the content of the file. + * \param vContent - the content to be interpreted. + * \return true if the content has a meaning for the interpreter, false otherwise. + */ +bool CloudSyncController::interpreter(const QString &vContent) +{ + qDebug() << QString("~~~CloudSync Message received [%1]").arg(vContent); + // TODO: messages have to have a sequence. + // if the seq is duplicate it will be ignored. + // seq, id, payload + return true; +} + +/*! + * \brief CloudSyncController::onActionReceive + * \details The slot which will be called when a CANBus message is received, and will be sent to CloudSync if related. + * \param vAction - The message action + * \param vData - The message data + */ +void CloudSyncController::onActionReceive(GuiActionType vAction, const QVariantList &vData) +{ + switch (vAction) { + case GuiActionType::ID_HDOperationModeData: + case GuiActionType::ID_PreTreatmentStates : + case GuiActionType::ID_TreatmentStates : + case GuiActionType::ID_PostTreatmentStates: + case GuiActionType::ID_DisinfectStates : + qDebug() << "~ update for CloudSync" << vAction << vData; + if ( ! Storage::FileHandler::write(Storage::SDCard_Base_Path_Name + _location + Storage::CloudSync_Inp_File, enumString(vAction)) ) + LOG_DEBUG(tr("Error writing to the CloudSync Input file.")); + break; + default: + break; + } +} Index: sources/cloudsync/CloudSyncController.h =================================================================== diff -u --- sources/cloudsync/CloudSyncController.h (revision 0) +++ sources/cloudsync/CloudSyncController.h (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -0,0 +1,69 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file CloudSyncController.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 13-Oct-2021 + * \date (original) 13-Oct-2021 + * + */ +#pragma once + +// Qt +#include +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "GuiController.h" + +// define +#define _CloudSyncController CloudSyncController::I() + +// forward declarations +class tst_initializations; + +// namespace + +/*! + * \brief The CloudSyncController class + * \details Singleton class which is the main gateway of CloudSync signal/slots. + */ +class CloudSyncController : public QObject { + Q_OBJECT + + // Singleton + SINGLETON(CloudSyncController) + + // friends + friend class ::tst_initializations; + + QThread *_thread = nullptr; + bool _init = false; + + const QString _location = "cloudsync/"; + +public slots: + bool init(); + bool init(QThread &vThread); + +private slots: + void quit(); + + void onWatchFileChange (const QString &vFile); + void onActionReceive (GuiActionType vAction, const QVariantList &vData); + +private: + void initConnections(); + + void initThread(QThread &vThread); + void quitThread(); + + void addWatch(); + bool interpreter(const QString &vContent); // this function may later need to be a class. +}; Index: sources/device/DeviceController.cpp =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -43,6 +43,7 @@ * Qt handles the children destruction by their parent objects life-cycle. */ DeviceController::DeviceController(QObject *parent) : QObject(parent) { + _fileSystemWatcher.setParent(this); DEVICE_DEV_PARENT_LIST } @@ -114,6 +115,9 @@ connect(this , SIGNAL(didScreenshot(const QImage &, const QString &)), this , SLOT( onScreenshot(const QImage &, const QString &))); + connect(&_fileSystemWatcher , SIGNAL( fileChanged(QString)), + this , SLOT( onWatchFileChanged(QString))); + DEVICE_DEV_INIT_CONNECTIONS_LIST } @@ -423,10 +427,10 @@ bool DeviceController::checkError(DeviceError::Scripts_Error_Enum vError, TModel &vModel, QString vExtraLogInfo) { if ( vError ) { - QString src = (vError > DeviceError::eScripts_Error_Start ? MAbstract::unitText(MAbstract::Unit_Enum::eUI) : MAbstract::unitText(MAbstract::Unit_Enum::eDV)) + ","; + QString src = (vError > DeviceError::eDevice_Scripts_Error_Start ? MAbstract::unitText(MAbstract::Unit_Enum::eUI) : MAbstract::unitText(MAbstract::Unit_Enum::eDV)) + ","; vModel._data.mAccepted = false ; vModel._data.mReason = vError ; - vModel._data.mMessage = DeviceError::scriptErrorText(vError) + QString(" [%1]").arg(vError); + vModel._data.mMessage = DeviceError::deviceErrorText(vError) + QString(" [%1]").arg(vError); LOG_EVENT(src + vModel._data.mMessage + " " + vExtraLogInfo); emit didAttributeResponse(vModel._data); return true; @@ -456,14 +460,14 @@ // ----- check if the process is not running if ( _processBrightness.state() != QProcess::NotRunning ) { - checkError(DeviceError::eScripts_Error_IsRunning, _deviceBrightnessResponse); + checkError(DeviceError::eDevice_Scripts_Error_IsRunning, _deviceBrightnessResponse); return; } // ----- check the data is valid // TODO : this should be in the model if ( _deviceBrightnessRequest.mBrightness_min > _deviceBrightnessRequest._data.mBrightness_val || _deviceBrightnessRequest._data.mBrightness_val > _deviceBrightnessRequest.mBrightness_max ) { - checkError(DeviceError::eScripts_Error_OutOfRange, _deviceBrightnessResponse); + checkError(DeviceError::eDevice_Scripts_Error_OutOfRange, _deviceBrightnessResponse); return; } @@ -474,7 +478,7 @@ for ( quint8 i = _deviceBrightnessRequest.mBrightness_min; i <= _deviceBrightnessRequest.mBrightness_max; i += _deviceBrightnessRequest.mBrightness_res ) _allowableValues += i; // check the value is in the list if ( ! _allowableValues.contains(_deviceBrightnessRequest._data.mBrightness_val) ) { - checkError(DeviceError::eScripts_Error_Incorrect_Req, _deviceBrightnessResponse); + checkError(DeviceError::eDevice_Scripts_Error_Incorrect_Req, _deviceBrightnessResponse); return; } @@ -504,7 +508,7 @@ _deviceBrightnessResponse._data.mBrightnessPercent = brightness * 10; } else { - checkError(DeviceError::eScripts_Error_Incorrect_Rsp,_deviceBrightnessResponse, _deviceBrightnessResponse.toString()); + checkError(DeviceError::eDevice_Scripts_Error_Incorrect_Rsp,_deviceBrightnessResponse, _deviceBrightnessResponse.toString()); return; } } @@ -536,3 +540,31 @@ vImage.save(vFileName); LOG_DEBUG("Screenshot saved in " + vFileName); } + +/*! + * \brief DeviceController::ondoAddWatch + * \details The thread safe add file watch method + * \param vFile - The file to add to watch. + */ +void DeviceController::ondoAddWatch(const QString &vFile) +{ + if ( ! QFileInfo::exists(vFile)) { + if ( ! FileHandler::write(vFile, "", false) ) { + LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotFound)); + return; + } + } + if ( ! _fileSystemWatcher.addPath(vFile) ) { + LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotAdded)); + } +} + +/*! + * \brief DeviceController::onWatchFileChanged + * \details This slot is called once the files being watched is updated. + * \param vFile - the file name. + */ +void DeviceController::onWatchFileChanged(const QString &vFile) +{ + emit didWatchFileChange(vFile); +} Index: sources/device/DeviceController.h =================================================================== diff -u -rfc329c788fe9453983072bee937ccbc95b4ed6e4 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/device/DeviceController.h (.../DeviceController.h) (revision fc329c788fe9453983072bee937ccbc95b4ed6e4) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -17,14 +17,14 @@ // Qt #include #include +#include "QFileSystemWatcher" // Project #include "main.h" // Doxygen : do not remove #include "Threads.h" #include "DeviceGlobals.h" #include "DeviceModels.h" #include "DeviceError.h" - // Define #define _DeviceController Device::DeviceController::I() @@ -71,6 +71,8 @@ bool _pauseSpaceCheck = false; + QFileSystemWatcher _fileSystemWatcher; + DEVICE_DEV_DEFINITION_LIST public slots: @@ -101,6 +103,8 @@ bool checkError(DeviceError::Scripts_Error_Enum vError, TModel &vModel,QString vExtraLogInfo = ""); DeviceError::Scripts_Error_Enum checkScript(QString &vScript, const QString &vShellScript); + bool addWatch(const QString &vFilePath); + signals: /*! * \brief didScreenshot @@ -159,6 +163,8 @@ void didActionReceive( const DeviceBrightnessResponseData &vBrightness ); + void didWatchFileChange(const QString &vFile); + private slots: // ----- USB void usbCheck(); @@ -170,7 +176,11 @@ void onUSBDriveUmount(); + void onWatchFileChanged(const QString &vFile); + // ----- SDCard void sdcardSpaceCheck(); + + SAFE_CALL_EX(doAddWatch, const QString &) }; } Index: sources/device/DeviceError.cpp =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -17,6 +17,7 @@ // Linux // Qt +#include #include // Project @@ -32,6 +33,7 @@ QT_TR_NOOP("The requested value is out of range."), QT_TR_NOOP("The requested value is incorrect."), QT_TR_NOOP("The response value is incorrect."), + QT_TR_NOOP("The watch file is not found."), }; /*! @@ -41,13 +43,27 @@ * \param vShellScript : The shell script name * \return true if succeeds and false otherwise */ + DeviceError::Scripts_Error_Enum DeviceError::checkScript(QString &vScript, const QString &vShellScript) { - DeviceError::Scripts_Error_Enum err = DeviceError::eScripts_OK; + DeviceError::Scripts_Error_Enum err = DeviceError::eDevice_OK; vScript = _scriptsFolder + vShellScript; QFileInfo info(vScript); - if ( ! info.exists () ) { err = DeviceError::eScripts_Error_NotFound ; goto lOut; } - if ( ! info.isExecutable() ) { err = DeviceError::eScripts_Error_NotExecutable ; goto lOut; } + if ( ! info.exists () ) { err = DeviceError::eDevice_Scripts_Error_NotFound ; goto lOut; } + if ( ! info.isExecutable() ) { err = DeviceError::eDevice_Scripts_Error_NotExecutable ; goto lOut; } lOut: return err; } + +QString DeviceError::deviceErrorText(DeviceError::Scripts_Error_Enum vError) { + QString message; + int idx = vError - eDevice_Scripts_Error_Start - 1; + int len = sizeof Scripts_Error_Text / sizeof Scripts_Error_Text[0]; + if (idx > len) { message = QObject::tr("Device error no text defined [%1]").arg(vError); goto lOut; } + if (eDevice_Scripts_Error_Start < vError && vError < eDevice_Error_End) { + message = QObject::tr(Scripts_Error_Text[idx]); goto lOut; } + + message = QObject::tr("Device error"); +lOut: + return message; +} Index: sources/device/DeviceError.h =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/device/DeviceError.h (.../DeviceError.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceError.h (.../DeviceError.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -38,33 +38,26 @@ public: enum Scripts_Error_Enum { - eScripts_OK = 0 , + eDevice_OK = 0 , - eScripts_Error_Start = 1000 , // the script itself in system starts from 0 so give it enough gap + eDevice_Scripts_Error_Start = 1000 , // the script itself in system starts from 0 so give it enough gap - eScripts_Error_NotFound , - eScripts_Error_NotExecutable, - eScripts_Error_IsRunning , - eScripts_Error_OutOfRange , - eScripts_Error_Incorrect_Req, - eScripts_Error_Incorrect_Rsp, + eDevice_Scripts_Error_NotFound , + eDevice_Scripts_Error_NotExecutable , + eDevice_Scripts_Error_IsRunning , + eDevice_Scripts_Error_OutOfRange , + eDevice_Scripts_Error_Incorrect_Req , + eDevice_Scripts_Error_Incorrect_Rsp , - eScripts_Error_End + eDevice_Watch_Error_NotFound , + eDevice_Watch_Error_NotAdded , + eDevice_Error_End + }; Q_ENUM(Scripts_Error_Enum) - static QString scriptErrorText( DeviceError::Scripts_Error_Enum vError ) { - QString message; - if (eScripts_Error_Start < vError && vError < eScripts_Error_End) { - message += QObject::tr(Scripts_Error_Text[vError - eScripts_Error_Start - 1]); - } - else { - message += QObject::tr("Device error"); - } - return message; - } - + static QString deviceErrorText( DeviceError::Scripts_Error_Enum vError ); static Scripts_Error_Enum checkScript(QString &vScript, const QString &vShellScript); }; Index: sources/main.h =================================================================== diff -u -r76d4131d70c18cbfaf47c242c17258e80161e8dc -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/main.h (.../main.h) (revision 76d4131d70c18cbfaf47c242c17258e80161e8dc) +++ sources/main.h (.../main.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -357,18 +357,32 @@ ADJUST_TRANSMT_PUBLIC_SLOT (vTYPE) \ ADJUST_TRANSMT_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// -#define SAFE_CALL( vMETHOD) \ -public Q_SLOTS : void vMETHOD() { \ - static bool init = false; \ - if ( ! init ) { \ - connect(this, SIGNAL(did##vMETHOD()), \ - this, SLOT( on##vMETHOD())); \ - init = true; \ +#define SAFE_CALL( vMETHOD) \ +public Q_SLOTS : void vMETHOD() { \ + static bool init = false; \ + if ( ! init ) { \ + connect(this, SIGNAL( did##vMETHOD()), \ + this, SLOT( on##vMETHOD())); \ + init = true; \ + } \ + emit did##vMETHOD(); \ } \ - emit did##vMETHOD();} \ -Q_SIGNALS : void did##vMETHOD(); \ -private Q_SLOTS : void on##vMETHOD(); +Q_SIGNALS : void did##vMETHOD(); \ +private Q_SLOTS : void on##vMETHOD(); //--------------------------------------------------------------------------------// +#define SAFE_CALL_EX( vMETHOD,vTYPE) \ +public Q_SLOTS : void vMETHOD(vTYPE vData) { \ + static bool init = false; \ + if ( ! init ) { \ + connect(this, SIGNAL( did##vMETHOD(vTYPE)), \ + this, SLOT( on##vMETHOD(vTYPE))); \ + init = true; \ + } \ + emit did##vMETHOD( vData); \ + } \ +Q_SIGNALS : void did##vMETHOD(vTYPE); \ +private Q_SLOTS : void on##vMETHOD(vTYPE); +//--------------------------------------------------------------------------------// #define REGISTER_METATYPE(vTYPE) \ qRegisterMetaType < vTYPE > (#vTYPE); //--------------------------------------------------------------------------------// Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r67d05211b87d310ce213695c52b110fb28cfbd4b -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 67d05211b87d310ce213695c52b110fb28cfbd4b) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -7,10 +7,16 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 04-Oct-2021 + * \date (last) 13-Oct-2021 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * + ********************************************************************************* + * ANY MODIFICATION IN THIS FILE WILL BE LOST. * + * THE CONTENT OF THIS FILE IS AUTOMATICALLY GENERATED ON EACH BUILD ON SERVER. * + * ANY REQUIRED UPDATE NEEDS TO BE DONE IN THE AlarmDefs.h IN common REPOSITORY. * + ******************************************************************************* * + * */ #include "MAlarmStatusData.h" @@ -93,10 +99,10 @@ /*0063*/case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading arterial pressure sensor." ); break; } /* 63*/ /*0064*/case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading venous pressure sensor." ); break; } /* 64*/ /*0065*/case GuiAlarmID::ALARM_ID_DG_COMMAND_INVALID_PARAMETER_FAULT : { result = QObject::tr("HD requests DG command with invalid parameter fault." ); break; } /* 65*/ -/*0066*/case GuiAlarmID::ALARM_ID_NVDATAMGMT_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG non-volatile calibration group invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." ); break; } /* 66*/ +/*0066*/case GuiAlarmID::ALARM_ID_NVDATAMGMT_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG non-volatile calibration group invalid record CRC." ); break; } /* 66*/ /*0067*/case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD blood pump occlusion self-test failure alarm." ); break; } /* 67*/ -/*0068*/case GuiAlarmID::ALARM_ID_HD_DIP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD dialysate inlet pump occlusion self-test failure alarm." ); break; } /* 68*/ -/*0069*/case GuiAlarmID::ALARM_ID_HD_DOP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD dialysate outlet pump occlusion self-test failure alarm." ); break; } /* 69*/ +/*0068*/case GuiAlarmID::ALARM_ID____AVAILABLE_5 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 68*/ +/*0069*/case GuiAlarmID::ALARM_ID____AVAILABLE_6 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 69*/ /*0070*/case GuiAlarmID::ALARM_ID_HD_ARTERIAL_PRESSURE_SELF_TEST_FAILURE : { result = QObject::tr("HD arterial pressure self-test failure alarm." ); break; } /* 70*/ /*0071*/case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_SELF_TEST_FAILURE : { result = QObject::tr("HD venous pressure self-test failure alarm." ); break; } /* 71*/ /*0072*/case GuiAlarmID::ALARM_ID_HD_BLOOD_FLOW_STATUS_SELF_TEST_FAILURE : { result = QObject::tr("HD blood flow meter status check self-test failure alarm." ); break; } /* 72*/ @@ -114,11 +120,11 @@ /*0084*/case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_READ_TIMEOUT_ERROR : { result = QObject::tr("HD venous pressure sensor not being read." ); break; } /* 84*/ /*0085*/case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_SENSOR_TEMP_OUT_OF_RANGE : { result = QObject::tr("HD venous pressure sensor temperature out of range error." ); break; } /* 85*/ /*0086*/case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_READ_TIMEOUT_ERROR : { result = QObject::tr("HD BP occlusion sensor not being read." ); break; } /* 86*/ -/*0087*/case GuiAlarmID::ALARM_ID_HD_DPI_OCCLUSON_READ_TIMEOUT_ERROR : { result = QObject::tr("HD DPi occlusion sensor not being read." ); break; } /* 87*/ -/*0088*/case GuiAlarmID::ALARM_ID_HD_DPO_OCCLUSION_READ_TIMEOUT_ERROR : { result = QObject::tr("HD DPo occlusion sensor not being read." ); break; } /* 88*/ +/*0087*/case GuiAlarmID::ALARM_ID____AVAILABLE_10 : { result = QObject::tr("HD DPi occlusion sensor not being read." ); break; } /* 87*/ +/*0088*/case GuiAlarmID::ALARM_ID____AVAILABLE_11 : { result = QObject::tr("HD DPo occlusion sensor not being read." ); break; } /* 88*/ /*0089*/case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD BP occlusion sensor error." ); break; } /* 89*/ -/*0090*/case GuiAlarmID::ALARM_ID_HD_DPI_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD DPi occlusion sensor error." ); break; } /* 90*/ -/*0091*/case GuiAlarmID::ALARM_ID_HD_DPO_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD DPo occlusion sensor error." ); break; } /* 91*/ +/*0090*/case GuiAlarmID::ALARM_ID____AVAILABLE_12 : { result = QObject::tr("HD DPi occlusion sensor error." ); break; } /* 90*/ +/*0091*/case GuiAlarmID::ALARM_ID____AVAILABLE_13 : { result = QObject::tr("HD DPo occlusion sensor error." ); break; } /* 91*/ /*0092*/case GuiAlarmID::ALARM_ID_HD_BP_FLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD blood flow sensor not being read." ); break; } /* 92*/ /*0093*/case GuiAlarmID::ALARM_ID_HD_BP_FLOW_SENSOR_ERROR : { result = QObject::tr("HD blood flow sensor error." ); break; } /* 93*/ /*0094*/case GuiAlarmID::ALARM_ID_HD_DP_FLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD dialysate flow sensor not being read." ); break; } /* 94*/ @@ -133,7 +139,7 @@ /*0103*/case GuiAlarmID::ALARM_ID_HD_NVDATAMGMT_CAL_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("HD non-volatile calibration group invalid record CRC." ); break; } /* 103*/ /*0104*/case GuiAlarmID::ALARM_ID_AIR_TRAP_ILLEGAL_LEVELS : { result = QObject::tr("Air trap level sensors reporting illegal combination of air/fluid." ); break; } /* 104*/ /*0105*/case GuiAlarmID::ALARM_ID_DG_NVDATAMGMT_CAL_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG non-volatile system group invalid record CRC." ); break; } /* 105*/ -/*0106*/case GuiAlarmID::ALARM_ID_DG_NVDATAMGMT_SERVICE_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG non-volatile service group invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." ); break; } /* 106*/ +/*0106*/case GuiAlarmID::ALARM_ID_DG_NVDATAMGMT_SERVICE_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG non-volatile service group invalid record CRC." ); break; } /* 106*/ /*0107*/case GuiAlarmID::ALARM_ID_DG_RESTARTED_FAULT : { result = QObject::tr("HD reports DG restarted fault." ); break; } /* 107*/ /*0108*/case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_ADC_ERROR : { result = QObject::tr("HD syringe pump ADC error." ); break; } /* 108*/ /*0109*/case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_VOLUME_ERROR : { result = QObject::tr("HD syringe pump volume check error." ); break; } /* 109*/ @@ -170,8 +176,8 @@ /*0140*/case GuiAlarmID::ALARM_ID_DG_COMM_TIMEOUT : { result = QObject::tr("Dialysate generator communication timeout." ); break; } /* 140*/ /*0141*/case GuiAlarmID::ALARM_ID_AIR_TRAP_FILL_DURING_TREATMENT : { result = QObject::tr("Air trap fill timeout during treatment." ); break; } /* 141*/ /*0142*/case GuiAlarmID::ALARM_ID_OCCLUSION_BLOOD_PUMP : { result = QObject::tr("Blood pump occlusion detected." ); break; } /* 142*/ -/*0143*/case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_IN_PUMP : { result = QObject::tr("Dialysate inlet pump occlusion detected." ); break; } /* 143*/ -/*0144*/case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_OUT_PUMP : { result = QObject::tr("Dialysate outlet pump occlusion detected." ); break; } /* 144*/ +/*0143*/case GuiAlarmID::ALARM_ID____AVAILABLE_8 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 143*/ +/*0144*/case GuiAlarmID::ALARM_ID____AVAILABLE_9 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 144*/ /*0145*/case GuiAlarmID::ALARM_ID_ACID_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Concentrate conductivity after adding acid out of range alarm." ); break; } /* 145*/ /*0146*/case GuiAlarmID::ALARM_ID_DIALYSATE_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Dialysate conductivity out of range." ); break; } /* 146*/ /*0147*/case GuiAlarmID::ALARM_ID_DIALYSATE_CONDUCTIVITY_FAULT : { result = QObject::tr("DG dialysate generation conductivity fault alarm." ); break; } /* 147*/ @@ -182,11 +188,11 @@ /*0152*/case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_PRESSURE : { result = QObject::tr("Inlet water pressure too low." ); break; } /* 152*/ /*0153*/case GuiAlarmID::ALARM_ID_PRIME_COMPLETED_HIGH : { result = QObject::tr("HD prime completed high priority alarm." ); break; } /* 153*/ /*0154*/case GuiAlarmID::ALARM_ID_NVDATA_EEPROM_OPS_FAILURE : { result = QObject::tr("EEPROM operations (read, write, erase) failure." ); break; } /* 154*/ -/*0155*/case GuiAlarmID::ALARM_ID_DG_NVDATAMGMT_SERVICE_RECORD_CRC_ERROR : { result = QObject::tr("DG non-volatile service invalid record CRC TODO remove this alarm after DEN-9480 fwcommon was merged into staging." ); break; } /* 155*/ +/*0155*/case GuiAlarmID::ALARM_ID_DG_NVDATAMGMT_SERVICE_RECORD_CRC_ERROR : { result = QObject::tr("DG non-volatile service invalid record CRC." ); break; } /* 155*/ /*0156*/case GuiAlarmID::ALARM_ID_NVDATA_HW_USAGE_DATA_CRC_ERROR : { result = QObject::tr("HW usage data (treatment time in HD and total consumed water in DG) failure." ); break; } /* 156*/ -/*0157*/case GuiAlarmID::ALARM_ID_NVDATA_CAL_RECORD_CRC_ERROR : { result = QObject::tr("Calibration record CRC failure TODO remove this alarm after DEN-9480 fwcommon was merged into staging." ); break; } /* 157*/ -/*0158*/case GuiAlarmID::ALARM_ID_BLOOD_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." ); break; } /* 158*/ -/*0159*/case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." ); break; } /* 159*/ +/*0157*/case GuiAlarmID::ALARM_ID_NVDATA_CAL_RECORD_CRC_ERROR : { result = QObject::tr("Calibration record CRC failure." ); break; } /* 157*/ +/*0158*/case GuiAlarmID::ALARM_ID_BLOOD_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed flow vs motor speed check." ); break; } /* 158*/ +/*0159*/case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed flow vs motor speed check." ); break; } /* 159*/ /*0160*/case GuiAlarmID::ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH : { result = QObject::tr("Blood pump rotor speed too high." ); break; } /* 160*/ /*0161*/case GuiAlarmID::ALARM_ID_BLOOD_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Blood flow sensor signal strength too low." ); break; } /* 161*/ /*0162*/case GuiAlarmID::ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Dialysate flow sensor signal strength too low." ); break; } /* 162*/ @@ -221,7 +227,7 @@ /*0191*/case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_UPPER_RANGE : { result = QObject::tr("DG flow rate out of upper range." ); break; } /* 191*/ /*0192*/case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_LOWER_RANGE : { result = QObject::tr("DG flow rate out of lower range." ); break; } /* 192*/ /*0193*/case GuiAlarmID::ALARM_ID_RO_PUMP_FLOW_RATE_OUT_OF_RANGE : { result = QObject::tr("RO pump flow rate out of range." ); break; } /* 193*/ -/*0194*/case GuiAlarmID::ALARM_ID_RO_PUMP_OFF_FAULT : { result = QObject::tr("DG RO pump off fault." ); break; } /* 194*/ +/*0194*/case GuiAlarmID::ALARM_ID_RO_PUMP_DUTY_CYCLE_OUT_OF_RANGE : { result = QObject::tr("DG RO pump duty cycle out of range." ); break; } /* 194*/ /*0195*/case GuiAlarmID::ALARM_ID_RO_PUMP_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("DG RO pump pressure out of range." ); break; } /* 195*/ /*0196*/case GuiAlarmID::ALARM_ID_DG_TEMPERATURE_SENSOR_FAULT : { result = QObject::tr("DG temperature sensor error flag fault." ); break; } /* 196*/ /*0197*/case GuiAlarmID::ALARM_ID_DG_TEMPERATURE_SENSORS_ADC_FAULT : { result = QObject::tr("DG temperature sensors ADC fault." ); break; } /* 197*/ @@ -264,8 +270,8 @@ /*0234*/case GuiAlarmID::ALARM_ID_RTC_RAM_OPS_ERROR : { result = QObject::tr("RTC (i.e read time) or RAM operations failure (read or write)." ); break; } /* 234*/ /*0235*/case GuiAlarmID::ALARM_ID_TREATMENT_STOPPED_AFTER_RINSEBACK : { result = QObject::tr("HD in treatment stopped sub-mode after rinseback completed (no escalation)." ); break; } /* 235*/ /*0236*/case GuiAlarmID::ALARM_ID_INSTALL_NEW_CARTRIDGE : { result = QObject::tr("HD needs new cartridge to be installed." ); break; } /* 236*/ -/*0237*/case GuiAlarmID::ALARM_ID_CARTRIDGE_INSTALLED_IMPROPERLY : { result = QObject::tr("HD cartridge installed improperly alarm." ); break; } /* 237*/ -/*0238*/case GuiAlarmID::ALARM_ID_NO_CARTRIDGE_LOADED : { result = QObject::tr("HD no cartridge loaded alarm." ); break; } /* 238*/ +/*0237*/case GuiAlarmID::ALARM_ID____AVAILABLE_7 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 237*/ +/*0238*/case GuiAlarmID::ALARM_ID_NO_CARTRIDGE_LOADED : { result = QObject::tr("HD no cartridge loaded or installed improperly alarm." ); break; } /* 238*/ /*0239*/case GuiAlarmID::ALARM_ID_CARTRIDGE_REMOVAL_FAILURE : { result = QObject::tr("HD fail to remove cartridge alarm." ); break; } /* 239*/ /*0240*/case GuiAlarmID::ALARM_ID_BICARB_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Bicarb conductivity out of range during bicarb pump check alarm." ); break; } /* 240*/ /*0241*/case GuiAlarmID::ALARM_ID_DG_RESERVOIR_DRAIN_TIMEOUT : { result = QObject::tr("DG reservoir drain time out." ); break; } /* 241*/ @@ -305,8 +311,8 @@ /*0275*/case GuiAlarmID::ALARM_ID_HD_ARTERIAL_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("HD arterial pressure sensor is reading out of range." ); break; } /* 275*/ /*0276*/case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("HD venous pressure sensor is reading out of range." ); break; } /* 276*/ /*0277*/case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_OUT_OF_RANGE : { result = QObject::tr("HD BP occlusion sensor is reading out of range." ); break; } /* 277*/ -/*0278*/case GuiAlarmID::ALARM_ID_HD_DPI_OCCLUSION_OUT_OF_RANGE : { result = QObject::tr("HD DPi occlusion sensor is reading out of range." ); break; } /* 278*/ -/*0279*/case GuiAlarmID::ALARM_ID_HD_DPO_OCCLUSION_OUT_OF_RANGE : { result = QObject::tr("HD DPo occlusion sensor is reading out of range." ); break; } /* 279*/ +/*0278*/case GuiAlarmID::ALARM_ID____AVAILABLE_3 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 278*/ +/*0279*/case GuiAlarmID::ALARM_ID____AVAILABLE_4 : { result = QObject::tr("This alarm ID is available for use." ); break; } /* 279*/ /*0280*/case GuiAlarmID::ALARM_ID_HD_ARTERIAL_PRESSURE_READ_TIMEOUT_ERROR : { result = QObject::tr("HD arterial pressure sensor read timeout error." ); break; } /* 280*/ /*0281*/case GuiAlarmID::ALARM_ID_DG_ACID_BOTTLE_LOW_VOLUME : { result = QObject::tr("Acid concentration bottle low volume alarm." ); break; } /* 281*/ /*0282*/case GuiAlarmID::ALARM_ID_DG_BICARB_BOTTLE_LOW_VOLUME : { result = QObject::tr("Bicarbonate concentration bottle low volume alarm." ); break; } /* 282*/ Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -rcbb246d6efa242f927f88ac5da518dedb2d63320 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -85,33 +85,36 @@ const char *Date_Time_Set_Sh = "date_time_set.sh"; // WiFi Settings - const char *Wifi_Disconnect_Network = "wifi_disconnect_network.sh"; - const char *Wifi_Generate_WPA_Supplicant = "wifi_generate_wpa_supplicant.sh"; - const char *Wifi_Read_DNS = "wifi_read_dns.sh"; - const char *Wifi_Read_Gateway = "wifi_read_gateway.sh"; - const char *Wifi_Read_IP_Settings = "wifi_read_ip_settings.sh"; - const char *Wifi_Get_Auto_Assigned_IP = "wifi_request_auto_assigned_ip.sh"; - const char *Wifi_Reset_Adapter = "wifi_reset_adapter.sh"; - const char *Wifi_Reset_Interface = "wifi_reset_interface.sh"; - const char *Wifi_Scan_For_Networks = "wifi_scan_for_networks.sh"; - const char *Wifi_Set_Auto_Assigned_IP = "wifi_set_auto_assigned_ip.sh"; - const char *Wifi_Set_DNS = "wifi_set_dns.sh"; - const char *Wifi_Set_Static_IP = "wifi_set_static_ip.sh"; - const char *Wifi_Set_Gateway = "wifi_set_gateway.sh"; - const char *Wifi_Set_SubnetMask = "wifi_set_subnetmask.sh"; - const char *Wifi_Start_WPA_Supplicant = "wifi_start_wpa_supplicant.sh"; - const char *WifiSettings_SSID = "wifi/ssid"; - const char *WifiSettings_MacAddress = "wifi/macAddress"; - const char *WifiSettings_ConfPath = "wifi/confPath"; - const char *WifiSettings_Security_Types = "wifi/security"; - const char *WifiSettings_IPAddress = "wifi/ipAddress"; - const char *WifiSettings_Gateway = "wifi/gateway"; - const char *WifiSettings_SubnetMask = "wifi/subnetmask"; - const char *WifiSettings_DNS = "wifi/dns"; - const char *WifiSettings_UseDHCP = "wifi/useDHCP"; + const char *Wifi_Disconnect_Network = "wifi_disconnect_network.sh"; + const char *Wifi_Generate_WPA_Supplicant = "wifi_generate_wpa_supplicant.sh"; + const char *Wifi_Read_DNS = "wifi_read_dns.sh"; + const char *Wifi_Read_Gateway = "wifi_read_gateway.sh"; + const char *Wifi_Read_IP_Settings = "wifi_read_ip_settings.sh"; + const char *Wifi_Get_Auto_Assigned_IP = "wifi_request_auto_assigned_ip.sh"; + const char *Wifi_Reset_Adapter = "wifi_reset_adapter.sh"; + const char *Wifi_Reset_Interface = "wifi_reset_interface.sh"; + const char *Wifi_Scan_For_Networks = "wifi_scan_for_networks.sh"; + const char *Wifi_Set_Auto_Assigned_IP = "wifi_set_auto_assigned_ip.sh"; + const char *Wifi_Set_DNS = "wifi_set_dns.sh"; + const char *Wifi_Set_Static_IP = "wifi_set_static_ip.sh"; + const char *Wifi_Set_Gateway = "wifi_set_gateway.sh"; + const char *Wifi_Set_SubnetMask = "wifi_set_subnetmask.sh"; + const char *Wifi_Start_WPA_Supplicant = "wifi_start_wpa_supplicant.sh"; + const char *WifiSettings_SSID = "wifi/ssid"; + const char *WifiSettings_MacAddress = "wifi/macAddress"; + const char *WifiSettings_ConfPath = "wifi/confPath"; + const char *WifiSettings_Security_Types = "wifi/security"; + const char *WifiSettings_IPAddress = "wifi/ipAddress"; + const char *WifiSettings_Gateway = "wifi/gateway"; + const char *WifiSettings_SubnetMask = "wifi/subnetmask"; + const char *WifiSettings_DNS = "wifi/dns"; + const char *WifiSettings_UseDHCP = "wifi/useDHCP"; // Brightness - const char *Brightness_Set = "brightness_set.sh"; - const char *Brightness_Get = "brightness_get.sh"; + const char *Brightness_Set = "brightness_set.sh"; + const char *Brightness_Get = "brightness_get.sh"; + // Cloud Sync + const char *CloudSync_Out_File = "cloudsync_out.log"; + const char *CloudSync_Inp_File = "cloudsync_inp.log"; } Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r3f555c49ddd2c983f469709e3c001d0e76159248 -r9ae3b0d6624904693329309aaf8ff02784c17184 --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 9ae3b0d6624904693329309aaf8ff02784c17184) @@ -82,4 +82,7 @@ extern const char *Brightness_Set; extern const char *Brightness_Get; + // Cloud Sync + extern const char *CloudSync_Out_File; + extern const char *CloudSync_Inp_File; }