Index: AlarmMapping.csv =================================================================== diff -u -r86acb3c49bfc7c4ed8fc860d895c0603b4816b3a -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- AlarmMapping.csv (.../AlarmMapping.csv) (revision 86acb3c49bfc7c4ed8fc860d895c0603b4816b3a) +++ AlarmMapping.csv (.../AlarmMapping.csv) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -41,7 +41,7 @@ 40,"Dialysis outlet pump failed motor off check.\nMeasured speed while commanded off." 41,"Dialysis outlet pump failed motor direction check.\nMeasured vs commanded." 42,"Dialysis outlet pump failed rotor speed check.\nMismatch with rotor and motor speeds." - 43,"HD blood leak self test fault." + 43,"DG main primary heater FPGA fault." 44,"User interface communication timeout." 45,"HD too many bad communications CRC." 46,"System message that required acknowledgment was not acknowledged." @@ -61,8 +61,8 @@ 60,"HD valve not functional." 61,"HD valve current out of range." 62,"HD valve position out of target." - 63,"FPGA reports failure reading arterial pressure sensor." - 64,"FPGA reports failure reading venous pressure sensor." + 63,"HD blood leak FPGA fault." + 64,"DG barometric pressure sensor out of range." 65,"HD requests DG command with invalid parameter fault." 66,"HD blood leak sensor set point set failure." 67,"HD blood pump occlusion self-test failure alarm." @@ -72,7 +72,7 @@ 71,"HD venous pressure self-test failure alarm." 72,"HD No load cell data message receive at least once every 2 seconds." 73,"HD No dialysate temperature data message receive at least once every 2 seconds." - 74,"HD blood leak detector self-test transmit timeout." + 74,"DG inlet UV reactor is on with no flow." 75,"HD syringe pump self-test failure alarm." 76,"HD monitored voltage is out of range." 77,"DG monitored voltage is out of range." @@ -82,13 +82,13 @@ 81,"HD syringe pump over travel error." 82,"HD syringe pump DAC write failure." 83,"HD syringe pump is running while the BP is off." - 84,"HD venous pressure sensor not being read." + 84,"DG set RTC year is invalid." 85,"HD pump track latch opened alarm." - 86,"HD BP occlusion sensor not being read." + 86,"HD set RTC year is invalid." 87,"DG heating invalid calibration record." 88,"DG concentrate pumps hall sensor out of range." - 89,"HD BP occlusion sensor error." - 90,"DG load cells FPGA read error." + 89,"DG outlet UV reactor on with no flow." + 90,"DG load cells A1/B1 FPGA fault." 91,"HD No dialysate flow data receive in the last 3 seconds." 92,"DG conductivity sensor bad status." 93,"DG outlet primary conductivity out of range." @@ -106,12 +106,12 @@ 105,"DG invalid calibration CRC." 106,"DG dialysate flow sensor invalid calibration record." 107,"HD reports DG restarted fault." - 108,"HD syringe pump ADC error." + 108,"HD syringe pump ADC FPGA fault." 109,"HD syringe pump volume check error." 110,"HD syringe pump speed check error." 111,"HD syringe pump not stopped in off state error." - 112,"HD blood leak zero command transmit timeout." - 113,"HD blood leak zero command fault." + 112,"DG load cells A1/B1 FPGA fault." + 113,"DG Drain pump current out of range." 114,"HD venous air bubble detector self-test failure." 115,"DG temperature sensor out of range." 116,"DG temperature sensor ADC fault." @@ -167,7 +167,7 @@ 166,"HD in treatment re-circ sub-mode for too long." 167,"HD cartridge door opened alarm." 168,"HD active reservoir depletion timeout." - 169,"Dialysate flow rate out of range." + 169,"DG Dialysate flow rate out of maximum range." 170,"HD syringe empty alarm." 171,"HD syringe pump occlusion alarm." 172,"HD syringe pump not enough Heparin alarm." @@ -178,7 +178,7 @@ 177,"DG software fault.\nSoftware found itself in an unexpected state." 178,"HD communication timeout." 179,"DG FPGA communication down for too long." - 180,"DG load cell ADC error." + 180,"DG RO flow out of maximum range." 181,"DG load cells weight out of range for tare." 182,"DG load cells invalid calibration." 183,"DG invalid load cell value." @@ -194,8 +194,8 @@ 193,"HD dialysate temperature out of low safety range." 194,"DG RO pump duty cycle out of range." 195,"DG RO pump pressure out of range." - 196,"DG temperature sensor error bit fault." - 197,"DG temperature sensors FPGA fault." + 196,"DG CPi/CPo sensors FPGA fault." + 197,"DG CD1/CD2 sensors FPGA fault." 198,"RO flow too low while primary heater is on." 199,"Dialysate flow too low while trimmer heater is on." 200,"DG thermistors/sensors temperature out of range." @@ -220,8 +220,8 @@ 219,"HD syringe pump syringe removed alarm." 220,"DG THd sensors FPGA fault." 221,"HD Saline bag is empty." - 222,"HD dialysate temperature too high alarm." - 223,"HD dialysate temperature too low alarm." + 222,"HD occlusion sensor FPGA fault." + 223,"HD arterial sensor FPGA fault." 224,"Treatment stopped by user action." 225,"HD end of treatment warning." 226,"HD prime completed low priority alarm." @@ -278,7 +278,7 @@ 277,"HD BP occlusion sensor is reading out of range." 278,"HD active reservoir weight out of range." 279,"DG dialysate drain time out." - 280,"HD arterial pressure sensor read timeout error." + 280,"DG drain pump direction invalid." 281,"Acid concentration bottle low volume alarm." 282,"Bicarbonate concentration bottle low volume alarm." 283,"DG load cells weight out of range." @@ -288,7 +288,7 @@ 287,"HD processor clock speed checks against FPGA clock failure." 288,"HD load cells primary/back up drift out of range." 289,"DG dialysate or concentrate caps not closed." - 290,"DG flow too low while heater is on." + 290,"HD venous pressure sensor FPGA fault." 291,"HD processor is in Disinfect Flush mode." 292,"HD processor is in Disinfect Heat mode." 293,"HD processor is in Disinfect Chemical mode." @@ -297,11 +297,13 @@ 296,"DG TDi sensors FPGA fault." 297,"DG TRo sensors FPGA fault." 298,"DG baro sensor FPGA fault." - 299,"DG disinfect has been expired." - 300,"DG service time interval has elapsed." + 299,"DG invalid serial number." + 300,"HD invalid serial number." 301,"DG primary heater power voltage out of range." 302,"DG processor RAM error." - 303,"HD service time interval has elapsed." + 303,"Alarm ID available for use." 304,"HD invalid usage record." 305,"HD processor RAM error." - 306,"Total number of alarms." + 306,"HD air trap over-fill alarm." + 307,"HD AC power lost second alarm." + 308,"Total number of alarms." Index: denali.pro.user =================================================================== diff -u -r7823da721f8041d6d39c37cd040e162ea9d35e7f -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- denali.pro.user (.../denali.pro.user) (revision 7823da721f8041d6d39c37cd040e162ea9d35e7f) +++ denali.pro.user (.../denali.pro.user) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- en_US.udic (.../en_US.udic) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ en_US.udic (.../en_US.udic) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -210,3 +210,4 @@ MVC Jahnavi txr +nd Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rf502bc55feb08cd037d9caa12086d30034fe715b -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision f502bc55feb08cd037d9caa12086d30034fe715b) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -76,7 +76,7 @@ {Gui::GuiActionType::ID_DialysateOutletFlow , 7 * 4 }, // 7 parameters each 4bytes {Gui::GuiActionType::ID_PressureOcclusion , 5 * 4 }, // 5 parameters each 4bytes {Gui::GuiActionType::ID_Saline , 3 * 4 }, // 3 parameters each 4bytes - {Gui::GuiActionType::ID_Heparin , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_Heparin , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_Rinseback , 6 * 4 }, // 6 parameters each 4bytes {Gui::GuiActionType::ID_Recirculate , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_BloodPrime , 2 * 4 }, // 2 parameters each 4bytes Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r7992f1a517435b1801dbee84e5ffc38b8452d2dd -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 7992f1a517435b1801dbee84e5ffc38b8452d2dd) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 24-Oct-2022 + * \date (last) 27-Oct-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/model/hd/data/treatment/MTreatmentHeparinData.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/model/hd/data/treatment/MTreatmentHeparinData.cpp (.../MTreatmentHeparinData.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/model/hd/data/treatment/MTreatmentHeparinData.cpp (.../MTreatmentHeparinData.cpp) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -18,15 +18,18 @@ QVariantList MTreatmentHeparin::parameters() const { return { - _data.mCumulative .value + _data.mCumulative .value, + _data.mTarget .value }; } bool MTreatmentHeparin::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mCumulative )) + if (GetValue(vByteArray, index, _data.mTarget )) return true ; else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } /*! @@ -37,5 +40,6 @@ MTreatmentHeparin::Data MTreatmentHeparin::data() const { Data data; data.mCumulative = _data.mCumulative .value; + data.mTarget = _data.mTarget .value; return data; } Index: sources/model/hd/data/treatment/MTreatmentHeparinData.h =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/model/hd/data/treatment/MTreatmentHeparinData.h (.../MTreatmentHeparinData.h) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/model/hd/data/treatment/MTreatmentHeparinData.h (.../MTreatmentHeparinData.h) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -37,6 +37,7 @@ * | Payload || * | || * | #1:(F32) | \ref Data::mCumulative | + * | #2:(F32) | \ref Data::mTarget | * * \sa Data * \sa MAdjustHeparinReq : Heparin Request @@ -59,6 +60,7 @@ struct { Types::F32 mCumulative ; + Types::F32 mTarget ; } _data; public: @@ -69,6 +71,7 @@ struct Data { float mCumulative = 0; ///< Cumulative volume of all Heparin deliveries during current treatment + float mTarget = 0; ///< Target volume of all Heparin deliveries during current treatment }; public: Index: sources/view/hd/data/treatment/VTreatmentHeparinData.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -22,4 +22,5 @@ void VTreatmentHeparin::onActionReceive(const TreatmentHeparinData &vData) { cumulative (vData.mCumulative); + target (vData.mTarget ); } Index: sources/view/hd/data/treatment/VTreatmentHeparinData.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/view/hd/data/treatment/VTreatmentHeparinData.h (.../VTreatmentHeparinData.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/view/hd/data/treatment/VTreatmentHeparinData.h (.../VTreatmentHeparinData.h) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -37,6 +37,7 @@ Q_OBJECT PROPERTY( float , cumulative , 0) + PROPERTY( float , target , 0) VIEW_DEC(VTreatmentHeparin, TreatmentHeparinData) }; Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -re961fc7bcdeba8ffab9c96da20244b07405f8f99 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision e961fc7bcdeba8ffab9c96da20244b07405f8f99) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -15,6 +15,7 @@ #include "VSettings.h" // Qt +#include // Project #include "GuiController.h" @@ -28,6 +29,10 @@ PROPERTY_POST_CONNECTION(VSettings, servicePass ); PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); PROPERTY_POST_CONNECTION(VSettings, noCANBus ); + + connect(&_GuiController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), + this , SLOT( onActionReceive (GuiActionType, const QVariantList &))); + } void VSettings::servicePass_post(const QString &vservicePass) { @@ -49,27 +54,14 @@ { // TODO: this function needs to be moved to the controller, to execute in settings thread not the main thread. // it should then send the output here to update the specific properties defined. - QVariantMap mInstructions; QStringList mCategorys = _Settings.categorys(); for (const auto &category : mCategorys) { QStringList groups = _Settings.groups(category); for (const auto &group : groups) { QStringList keys = _Settings.keys (category, group); QVariantList values = _Settings.values (category, group); if ( Storage::Settings::isCategoryInstructions( category ) ) { - // DEBUG : - // qDebug() << " ##### " - // << group - // << keys - // << values - // << location ; - QVariantMap details; - QString location = QString(Storage::Settings_Category_InstructionsImagesLoc).arg(Storage::Settings_Path_Name); - details["location"] = location; - details["keys" ] = keys ; - details["values" ] = values ; - - mInstructions[group] = details; + updateInstructions(group, keys, values); } else { //TODO: Since it is global system settings, move this to the settings controller so the C++ backend can also use it. like Date/Time formats. for (const auto &key : keys) { @@ -106,7 +98,7 @@ } categorys (mCategorys); - instructions(mInstructions); + emit instructionsChanged(_instructions); // If the configuration exits, then it has been set, and this call internally will be neutral, // otherwise will use the default value and will notify the update. @@ -116,3 +108,80 @@ adjustment(true); } + +void VSettings::updateReplacements(const QString &vGroup, QStringList &vKeys) +{ + for ( quint16 keyIndex = 0; keyIndex < vKeys.count(); keyIndex++ ) { + QRegExp regx("\\{\\w+:\\d+\\}"); + QString key = vKeys[keyIndex]; + int replacementCount = key.count(regx); + int oLen = 0; + for ( int j = 0; j < replacementCount; j++ ) { + int cLen = 0; + int pos = key.indexOf(regx); + cLen = regx.matchedLength(); + QString blk = key.mid(pos+1, cLen-2); + key.remove(pos, regx.matchedLength()); + QStringList lst = blk.split(":"); + quint16 id = lst[0].toUInt(); + quint8 ix = lst[1].toUInt(); + TLocation loc; + loc.group = vGroup ; + loc.keyIndex = keyIndex ; + loc.locIndex = pos - oLen ; + loc.prmIndex = ix ; + + _replacements[id] += loc; + qDebug() << "#" << replacementCount << id << ix << loc.group << loc.keyIndex << loc.locIndex << loc.prmIndex << oLen << cLen ; + oLen = cLen; + } + vKeys[keyIndex] = key; + } +} + +void VSettings::updateInstructions(const QString &vGroup, QStringList &vKeys, const QVariantList &vValues) +{ + // DEBUG : + // qDebug() << " ##### " + // << group + // << keys + // << values + // << location ; + QVariantMap details; + QString location = QString(Storage::Settings_Category_InstructionsImagesLoc).arg(Storage::Settings_Path_Name); + + updateReplacements(vGroup, vKeys); + + details["location"] = location ; + details["keys" ] = vKeys ; + details["values" ] = vValues ; + + _instructions[vGroup] = details; +} + +/*! + * \brief VSettings::onActionReceive + * \details emits didActionReceive signal to notify other classes (Gui) + * , an action has been received. + * \param vAction - the action + * \param vData - the action data + */ +void VSettings::onActionReceive (GuiActionType vAction, const QVariantList &) +{ + bool isChanged = false; + QVariantMap mInstructions = _instructions; // the original should be kept unchanged since all the posIndexes will change if values added. + quint16 id = qFromBigEndian((quint16)vAction); + if (_replacements.contains(id)) { + isChanged = true; + qDebug() << _replacements[id].count(); + for ( auto item : _replacements[id]) { + qDebug() << id << item.group << item.keyIndex << item.locIndex << item.prmIndex; + QVariantMap details = mInstructions[item.group].toMap(); + // QStringList keys = details["keys" ].toStringList(); + // qDebug() << keys.at(item.keyIndex).insert(); + + } + qDebug() << "\n"; + } + if ( isChanged ) emit instructionsChanged(mInstructions); +} Index: sources/view/settings/VSettings.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r30d7e9993624feb138e7532ad2feaefc592f6a63 --- sources/view/settings/VSettings.h (.../VSettings.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision 30d7e9993624feb138e7532ad2feaefc592f6a63) @@ -23,6 +23,7 @@ #include "MSettings.h" #include "VView.h" #include "StorageGlobals.h" +#include "GuiController.h" namespace View { @@ -44,7 +45,26 @@ SETTINGS(bool , noCANBus , false , Storage::Settings_Category_NoCANBus , "Navigation" , "Create Treatment To Patient ID" ) VIEW_DEC(VSettings, SettingsData) +private: + typedef qint16 TID ; + typedef qint16 TParamIndex ; + typedef struct { + QString group ; + quint16 keyIndex; + quint16 locIndex; + quint16 prmIndex; + } TLocation; + typedef QList TLocationList; + typedef QMap TReplacements; + TReplacements _replacements; +private: + void updateInstructions (const QString &vGroup, QStringList &vKeys, const QVariantList &vValues); + void updateReplacements (const QString &vGroup, QStringList &vKeys); + +private slots: + void onActionReceive (GuiActionType vAction, const QVariantList &vData); + }; }