Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -200,7 +200,6 @@ vCanId = Can::Can_Id::eChlid_UI_TD ; vPayload.clear(); int length = vData.length(); - // DEBUG: LOG_EVENT(QString("0x%0").arg(vActionId, 4, 16,QChar('0'))); switch (vActionId) { // notice we are in transmit mode case Gui::GuiActionType::ID_Acknow: // len: 0, can have zero len @@ -227,11 +226,14 @@ case Gui::GuiActionType::ID_AdjustServiceModeReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustServiceModeRequestData ); break; case Gui::GuiActionType::ID_AdjustVersionsUIRsp : INTERPRET_TRANSMIT_MESSAGE(AdjustVersionsResponseData ); break; case Gui::GuiActionType::ID_AdjustVersionsUIReq : INTERPRET_TRANSMIT_MESSAGE(AdjustVersionsRequestData ); break; - case Gui::GuiActionType::ID_AdjustHDDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHDDateTimeRequestData ); break; - case Gui::GuiActionType::ID_AdjustDGDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDGDateTimeRequestData ); break; + case Gui::GuiActionType::ID_AdjustTDDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustTDDateTimeRequestData ); break; + case Gui::GuiActionType::ID_AdjustDDDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDDDateTimeRequestData ); break; case Gui::GuiActionType::ID_AdjustServiceDatesReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustServiceDatesRequestData ); break; case Gui::GuiActionType::ID_HDUsageInfoReq : INTERPRET_TRSMT_MT_MESSAGE(HDUsageInfoRequestData ); break; - case Gui::GuiActionType::ID_AdjustInstitutionalRecordReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustInstitutionalRequestData ); break; + case Gui::GuiActionType::ID_AdjustInstitutionalRecordReq : INTERPRET_TRANSMIT_MESSAGE(AdjustInstitutionalRequestData ); break; + case Gui::GuiActionType::ID_InstitutionalRecordReq : INTERPRET_TRSMT_MT_MESSAGE(InstitutionalRequestData ); break; + case Gui::GuiActionType::ID_AdjustAdvancedInstitutionalRecordReq : INTERPRET_TRANSMIT_MESSAGE(AdjustAdvancedInstitutionalRequestData ); break; + case Gui::GuiActionType::ID_AdvancedInstitutionalRecordReq : INTERPRET_TRSMT_MT_MESSAGE(AdvancedInstitutionalRequestData ); break; // Pre-Treatment case Gui::GuiActionType::ID_AdjustInitTreatmentReq : INTERPRET_TRANSMIT_MESSAGE(AdjustInitTreatmentRequestData ); break; case Gui::GuiActionType::ID_AdjustParametersValidationReq : INTERPRET_TRANSMIT_MESSAGE(AdjustParametersValidationRequestData ); break; @@ -246,19 +248,31 @@ case Gui::GuiActionType::ID_AdjustPatientConnectionConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientConnectionConfirmRequestData ); break; case Gui::GuiActionType::ID_AdjustStartTreatmentReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustStartTreatmentRequestData ); break; // in-treatment - case Gui::GuiActionType::ID_AdjustDurationReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationRequestData ); break; + case Gui::GuiActionType::ID_AdjustBloodPrimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodPrimeRequestData ); break; + case Gui::GuiActionType::ID_AdjustBolusVolumeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBolusVolumeRequestData ); break; + case Gui::GuiActionType::ID_AdjustDurationEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationEditRequestData ); break; + case Gui::GuiActionType::ID_AdjustDurationConfirmReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationConfirmRequestData ); break; + case Gui::GuiActionType::ID_AdjustSetPointsReq : INTERPRET_TRANSMIT_MESSAGE(AdjustSetPointsRequestData ); break; + case Gui::GuiActionType::ID_AdjustBloodFlowRateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodFlowRateRequestData ); break; + case Gui::GuiActionType::ID_AdjustDialysateFlowRateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDialysateFlowRateRequestData ); break; + case Gui::GuiActionType::ID_AdjustDialysateTemperatureReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDialysateTemperatureRequestData ); break; + case Gui::GuiActionType::ID_AdjustBloodDialysateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodDialysateRequestData ); break; case Gui::GuiActionType::ID_AdjustPressuresLimitsReq : INTERPRET_TRANSMIT_MESSAGE(AdjustPressuresLimitsRequestData ); break; case Gui::GuiActionType::ID_AdjustSalineReq : INTERPRET_TRANSMIT_MESSAGE(AdjustSalineRequestData ); break; + case Gui::GuiActionType::ID_AdjustVitalsReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustVitalsRequestData ); break; case Gui::GuiActionType::ID_AdjustHeparinReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHeparinRequestData ); break; // in-treatment - ultrafiltration case Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustUltrafiltrationStateRequestData ); break; case Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustUltrafiltrationEditRequestData ); break; case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmReq : INTERPRET_TRANSMIT_MESSAGE(AdjustUltrafiltrationConfirmRequestData ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFDurationEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustIsolatedUFDurationEditRequestData ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFVolumeEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustIsolatedUFVolumeEditRequestData ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustIsolatedUFConfirmRequestData ); break; // End-Treatment case Gui::GuiActionType::ID_AdjustRinsebackReq : INTERPRET_TRANSMIT_MESSAGE(AdjustRinsebackRequestData ); break; case Gui::GuiActionType::ID_AdjustRecirculateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustRecirculateRequestData ); break; - case Gui::GuiActionType::ID_AdjustTreatmentEndReq : INTERPRET_TRANSMIT_MESSAGE(AdjustTreatmentEndRequestData ); break; + case Gui::GuiActionType::ID_AdjustTreatmentEndReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustTreatmentEndRequestData ); break; // Post-Treatment case Gui::GuiActionType::ID_AdjustPatientDisconnectNotifyReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionNotifyRequestData ); break; case Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionConfirmRequestData ); break; @@ -307,14 +321,14 @@ return Can_Source::eCan_TD; case eChlid_DD_TD : + case eChlid_DD_FP : //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync case eChlid_DD_Alarm: case eChlid_DD_Sync : if (vText) *vText = "DD"; return Can_Source::eCan_DD; - case eChlid_DD_FP : - //case eChlid_FP_UI : + //case eChlid_FP_UI : // has duplicate value as eChlid_FP_Sync case eChlid_FP_Alarm: case eChlid_FP_Sync : if (vText) *vText = "FP"; @@ -357,18 +371,18 @@ return Can_Id::eChlid_UI_TD; //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync + case eChlid_DD_FP : case eChlid_DD_Alarm: case eChlid_DD_Sync : if (vText) *vText = "DD"; return Can_Id::eChlid_UI_DD; // FP is not designed to directly communicate with UI - //case eChlid_DD_FP : - //case eChlid_FP_UI : - //case eChlid_FP_Alarm: - //case eChlid_FP_Sync : - // if (vText) *vText = "FP"; - // return Can_Id::eChlid_UI_Sync; + //case eChlid_FP_UI : // has duplicate value as eChlid_FP_Sync + case eChlid_FP_Alarm: + case eChlid_FP_Sync : + if (vText) *vText = "FP"; + return Can_Id::eChlid_UI_Sync; case eDialin_TD : case eTD_Dialin : @@ -411,8 +425,9 @@ if ( ! gLogUnhandledOnly ) { switch (identifySource(vMessage.can_id)) { - case Can_Source::eCan_TD: ok = interpretMessage_HD(vMessage, vData); break; - case Can_Source::eCan_DD: ok = interpretMessage_DG(vMessage, vData); break; + case Can_Source::eCan_TD: ok = interpretMessage_TD(vMessage, vData); break; + case Can_Source::eCan_DD: ok = interpretMessage_DD(vMessage, vData); break; + case Can_Source::eCan_FP: ok = interpretMessage_FP(vMessage, vData); break; default : printUnhandled (vMessage ); break; // ok is false, the individual interpreters for ?HD/DG should not be called, and it should be done here. } } @@ -424,9 +439,9 @@ } /*! - * \brief MessageInterpreter::interpretMessage_HD + * \brief MessageInterpreter::interpretMessage_TD * \details This method will be called - * for received messages from HD to interpret the vMessage of type Message + * for received messages from TD to interpret the vMessage of type Message * to vData of type QVariantList which UI understands regarding the Can_Id. * \param vMessage - The complete message of type Message which needs to be interpreted. * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. @@ -436,7 +451,7 @@ * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_HD(const Message &vMessage, QVariantList &vData) +bool MessageInterpreter::interpretMessage_TD(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); @@ -465,10 +480,15 @@ case Gui::GuiActionType::ID_AdjustVersionsTDRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVersionsTDRsp ); break; case Gui::GuiActionType::ID_AdjustSerialTDRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSerialTDRsp ); break; case Gui::GuiActionType::ID_AdjustServiceDatesHDRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustServiceDatesHDRsp ); break; - case Gui::GuiActionType::ID_AdjustHDDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustHDDateTimeRsp ); break; + case Gui::GuiActionType::ID_AdjustTDDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustTDDateTimeRsp ); break; case Gui::GuiActionType::ID_HDUsageInfoRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDUsageInfoRsp ); break; case Gui::GuiActionType::ID_AdjustInstitutionalRecordRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustInstitutionalRecordRsp ); break; - // ----- States + case Gui::GuiActionType::ID_InstitutionalRecordRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_InstitutionalRecordRsp ); break; + case Gui::GuiActionType::ID_AdjustAdvancedInstitutionalRecordRsp: ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustAdvancedInstitutionalRecordRsp); break; + case Gui::GuiActionType::ID_AdvancedInstitutionalRecordRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdvancedInstitutionalRecordRsp ); break; + + + // ----- States case Gui::GuiActionType::ID_TDOpModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TDOpModeData ); break; case Gui::GuiActionType::ID_PreTreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PreTreatmentStates ); break; case Gui::GuiActionType::ID_TreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStates ); break; @@ -513,23 +533,36 @@ case Gui::GuiActionType::ID_DialysateOutletFlow : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DialysateOutletFlow ); break; case Gui::GuiActionType::ID_PressureOcclusion : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PressureOcclusion ); break; case Gui::GuiActionType::ID_Saline : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Saline ); break; + case Gui::GuiActionType::ID_Vitals : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Vitals ); break; case Gui::GuiActionType::ID_Heparin : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Heparin ); break; case Gui::GuiActionType::ID_Rinseback : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Rinseback ); break; case Gui::GuiActionType::ID_Recirculate : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Recirculate ); break; case Gui::GuiActionType::ID_BloodPrime : ok = notify(vMessage, vData, Gui::GuiActionType::ID_BloodPrime ); break; case Gui::GuiActionType::ID_TreatmentStop : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStop ); break; case Gui::GuiActionType::ID_Ultrafiltration : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Ultrafiltration ); break; + case Gui::GuiActionType::ID_IsolatedUF : ok = notify(vMessage, vData, Gui::GuiActionType::ID_IsolatedUF ); break; case Gui::GuiActionType::ID_TreatmentParametersSetPointData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentParametersSetPointData ); break; // ----- In-Treatment Adjust - case Gui::GuiActionType::ID_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); break; + case Gui::GuiActionType::ID_AdjustBloodPrimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodPrimeRsp ); break; + case Gui::GuiActionType::ID_AdjustDurationEditRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationEditRsp ); break; + case Gui::GuiActionType::ID_AdjustDurationConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationConfirmRsp ); break; + case Gui::GuiActionType::ID_AdjustSetPointsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSetPointsRsp ); break; + case Gui::GuiActionType::ID_AdjustBloodFlowRateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodFlowRateRsp ); break; + case Gui::GuiActionType::ID_AdjustDialysateFlowRateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDialysateFlowRateRsp ); break; + case Gui::GuiActionType::ID_AdjustDialysateTemperatureRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDialysateTemperatureRsp ); break; + case Gui::GuiActionType::ID_AdjustBolusVolumeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBolusVolumeRsp ); break; case Gui::GuiActionType::ID_AdjustBloodDialysateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodDialysateRsp ); break; case Gui::GuiActionType::ID_AdjustPressuresLimitsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPressuresLimitsRsp ); break; case Gui::GuiActionType::ID_AdjustSalineRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSalineRsp ); break; + case Gui::GuiActionType::ID_AdjustVitalsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVitalsRsp ); break; case Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp ); break; case Gui::GuiActionType::ID_AdjustHeparinRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustHeparinRsp ); break; case Gui::GuiActionType::ID_AdjustRinsebackRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustRinsebackRsp ); break; case Gui::GuiActionType::ID_AdjustRecirculateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustRecirculateRsp ); break; case Gui::GuiActionType::ID_AdjustTreatmentEndRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustTreatmentEndRsp ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFDurationEditRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustIsolatedUFDurationEditRsp ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFVolumeEditRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustIsolatedUFVolumeEditRsp ); break; + case Gui::GuiActionType::ID_AdjustIsolatedUFConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustIsolatedUFConfirmRsp ); break; // ----- Post-Treatment Adjust case Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmRsp ); break; @@ -543,8 +576,8 @@ case Gui::GuiActionType::ID_AdjustDisinfectModeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisinfectModeRsp ); break; case Gui::GuiActionType::ID_AdjustDisinfectStartRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisinfectStartRsp ); break; // these need to be standard and use notify as well - case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); /* TODO : implement notify<>() */ break; - case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); /* TODO : implement notify<>() */ break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp ); break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp ); break; // ----- Alarms case Gui::GuiActionType::ID_AlarmStatus : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmStatus ); break; @@ -563,9 +596,9 @@ } /*! - * \brief MessageInterpreter::interpretMessage_DG + * \brief MessageInterpreter::interpretMessage_DD * \details This method will be called - * for received messages from DG to interpret the vMessage of type Message + * for received messages from DD to interpret the vMessage of type Message * to vData of type QVariantList which UI understands regarding the Can_Id. * \param vMessage - The complete message of type Message which needs to be interpreted. * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. @@ -575,7 +608,7 @@ * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_DG(const Message &vMessage, QVariantList &vData) +bool MessageInterpreter::interpretMessage_DD(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); @@ -611,7 +644,7 @@ case Gui::GuiActionType::ID_AdjustVersionsDDRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVersionsDDRsp ); break; case Gui::GuiActionType::ID_AdjustSerialDDRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSerialDDRsp ); break; case Gui::GuiActionType::ID_AdjustServiceDatesDGRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustServiceDatesDGRsp ); break; - case Gui::GuiActionType::ID_AdjustDGDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGDateTimeRsp ); break; + case Gui::GuiActionType::ID_AdjustDDDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDDDateTimeRsp ); break; case Gui::GuiActionType::ID_AdjustDGCleaningUsageRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGCleaningUsageRsp ); break; // RO Water case Gui::GuiActionType::ID_DuetRoWaterStatDGq : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DuetRoWaterStatDGq ); break; @@ -624,6 +657,47 @@ return ok; } +/*! + * \brief MessageInterpreter::interpretMessage_FP + * \details This method will be called + * for received messages from FP to interpret the vMessage of type Message + * to vData of type QVariantList which UI understands regarding the Can_Id. + * \param vMessage - The complete message of type Message which needs to be interpreted. + * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. + * \param vData - The values of QVariantList which is understandable for UI + * and has been extracted from hex values of the CANBus Message Payload + * in vMessage of type Message regarding each Message Id definition. + * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. + * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not + */ +bool MessageInterpreter::interpretMessage_FP(const Message &vMessage, QVariantList &vData) +{ + bool ok = false; + vData.clear(); + switch (vMessage.actionId) { // notice we are in receive mode + case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; + LOG_APPED(QString("FP,CheckIn," + QVariant(vData).toStringList().join(','))); break; + + // FP data messages + case Gui::GuiActionType::ID_FPROPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPROPumpData ); break; + case Gui::GuiActionType::ID_FPPressuresData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPPressuresData ); break; + case Gui::GuiActionType::ID_FPLevelData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPLevelData ); break; + case Gui::GuiActionType::ID_FPFlowSensorData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPFlowSensorData ); break; + case Gui::GuiActionType::ID_FPConductivityData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPConductivityData ); break; + case Gui::GuiActionType::ID_FPTemperaturesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPTemperaturesData ); break; + case Gui::GuiActionType::ID_FPROBoosterPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPROBoosterPumpData ); break; + + // FP Response Messages + case Gui::GuiActionType::ID_AdjustVersionsFPRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVersionsFPRsp ); break; + + // unhandled messages: these will only be logged as received message + // there has nothing been defined for these messages. + default : printUnhandled (vMessage ); break; + } + + return ok; +} + // ---------- ---------- Message handlers ---------- ---------- // // ---------- ---------- ---------- ---------- ---------- Debug ---------- ---------- ---------- ---------- ---------- // @@ -655,54 +729,6 @@ // ---------- ---------- ---------- ---------- ---------- Adjustments ---------- ---------- ---------- ---------- ---------- // /*! - * \brief MessageInterpreter::adjustUltrafiltrationEditData - * \details This method interprets Treatment Ultrafiltration Volume Adjustment Response message data - * in vMessage of type Message. - * \param vMessage - The vMessage of type Message which contains all the data, - * require to be interpreted. - * \param vData - Treatment Ultrafiltration Volume Adjustment Response data - * \return true if the data can be extracted as defined for Treatment Ultrafiltration Volume Adjustment Response Message ID - */ -bool MessageInterpreter::adjustUltrafiltrationEdit(const Message &vMessage, QVariantList &vData) -{ - bool ok = false; - if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp) ) return ok; - - Model::MAdjustUltrafiltrationEditResponse mData; - ok = mData.fromByteArray(vMessage.data); - LOG_APPED("HD," + mData.toString()); // TODO : Not Standard - - mData.toVariantList(vData); - emit didActionReceive(mData.data()); - - return ok; -} - -/*! - * \brief MessageInterpreter::adjustUltrafiltrationConfirmData - * \details This method interprets Treatment Ultrafiltration Volume Adjustment Confirm Response message data - * in vMessage of type Message. - * \param vMessage - The vMessage of type Message which contains all the data, - * require to be interpreted. - * \param vData - Treatment Ultrafiltration Volume Adjustment Confirm Response data - * \return true if the data can be extracted as defined for Treatment Ultrafiltration Volume Adjustment Confirm Response Message ID - */ -bool MessageInterpreter::adjustUltrafiltrationConfirm(const Message &vMessage, QVariantList &vData) -{ - bool ok = false; - if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp) ) return ok; - - Model::MAdjustUltrafiltrationConfirmResponse mData; - ok = mData.fromByteArray(vMessage.data); - LOG_APPED("HD," + mData.toString()); // TODO : Not Standard - - mData.toVariantList(vData); - emit didActionReceive(mData.data()); - - return ok; -} - -/*! * \brief MessageInterpreter::updateUnhandledMessages * \return this method is converting the general settings messages/unhandled (Storage::Settings_Category_MessagesUnhandled) group of settings to the message interpreter specific map structure. * it is done for performance to keep the lookup table shorter and faster. Index: sources/device/DeviceModels.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/device/DeviceModels.cpp (.../DeviceModels.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/device/DeviceModels.cpp (.../DeviceModels.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -193,7 +193,7 @@ _data.mAccepted = false; // check if the vExitCode passed and it has a value other than zero - if ( vExitCode && *vExitCode ){ _data.mReason = Device::DeviceError::eDevice_FactoryReset_Error; error = *vExitCode; } + if ( vExitCode && *vExitCode ){ _data.mReason = Device::DeviceError::eDevice_Decommission_Error; error = *vExitCode; } else _data.mReason = Device::DeviceError::eDevice_OK; // if vExitCode is not zero go to error since the data is no longer valid @@ -211,6 +211,49 @@ } /*! + * \brief MDeviceRootSSHAccessResponse::fromByteArray + * \details Checks the response and sets up the model data. + * \param vExitCode - Passed script exit code + * \return true if passed. + */ +bool MDeviceRootSSHAccessResponse::fromByteArray(const QByteArray &vByteArray, int *vExitCode) +{ + // initialize data + bool ok = false; + int error = 0; + _data.mCompleted = true; + _data.mAccepted = false; + _data.mReason = Device::DeviceError::eDevice_OK; + + // set as default if the val is invalid. + _data.mRootSSHAccess = Qt::Unchecked; + + // get the value + QString val = vByteArray; + ok = ! val.isNull() && val.isSimpleText(); + + // check if the vExitCode passed and it has a value other than zero + if ( ! ok ){ _data.mReason = Device::DeviceError::eDevice_Scripts_Error_Incorrect_Rsp_Type ; goto lError; } // there is not a valid value + if ( vExitCode && *vExitCode ){ _data.mReason = Device::DeviceError::eDevice_RootSSHAccess_Error ; goto lApply; } + + // Now everything is good to extract the data + _data.mAccepted = true; + _data.mMessage = QObject::tr("The RootSSHAccess Command Complete."); goto lApply; // normal return + +lApply: + _data.mRootSSHAccess = static_cast(val.toInt()); + goto lOut; + + // immediate exit on fail exitcode and invalid returned value. +lError: + if ( vExitCode ) error = *vExitCode; + _data.mMessage = Device::DeviceError::deviceErrorText(static_cast(_data.mReason), error) + "\n" + vByteArray; + +lOut: + return _data.mAccepted; +} + +/*! * \brief MDeviceWifiListResponse::fromByteArray * \details Checks the response and sets up the model data. * \param vExitCode - Passed script exit code @@ -452,3 +495,42 @@ if ( vError && error ) *vError = error; return ""; } + +/*! + * \brief MDeviceDateTimeResponse::fromByteArray + * \details Checks the response and sets up the model data. + * \param vExitCode - Passed script exit code + * \return true if passed. + */ +bool MDeviceDateTimeResponse::fromByteArray(const QByteArray &vByteArray, int *vExitCode) +{ + // initialize data + bool ok = false; + int error = 0; + _data.mCompleted = true; + _data.mAccepted = false; + _data.mReason = Device::DeviceError::eDevice_OK; + + ok = true; + + // check if the vExitCode passed and it has a value other than zero + if ( ! ok ){ _data.mReason = Device::DeviceError::eDevice_Scripts_Error_Incorrect_Rsp_Type ; goto lError; } // there is not a valid value + if ( vExitCode && *vExitCode ){ _data.mReason = Device::DeviceError::eDevice_DateTime_Error ; goto lApply; } // there still a valid value + + // Now everything is good to extract the data + _data.mAccepted = true; + _data.mMessage = QObject::tr("The Date Time is complete.") ; goto lOut ; // normal return + +// apply returned value in case the passed value is valid (type, range) +// regardless of the exit code (success, fail) +lApply: + goto lOut; + +// immediate exit on fail exitcode and invalid returned value. +lError: + if ( vExitCode ) error = *vExitCode; + _data.mMessage = Device::DeviceError::deviceErrorText(static_cast(_data.mReason), error) + "\n" + vByteArray; + +lOut: + return _data.mAccepted; +} Index: sources/device/DeviceView.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -16,6 +16,7 @@ // Qt #include +#include // Project #include "ApplicationController.h" @@ -32,8 +33,8 @@ DEVICE_VIEW_INIT_CONNECTIONS_LIST connect(&_DeviceController , SIGNAL(didPOSTOSVersionData(QString)), this , SLOT( onPOSTOSVersionData(QString))); - connect(&_DeviceController , SIGNAL(didWiFiIP(QString)), - this , SLOT( onWiFiIP(QString))); + connect(&_DeviceController , SIGNAL(didWiFiIP(QString, bool)), + this , SLOT( onWiFiIP(QString, bool))); } // ================================================================================================== @@ -167,30 +168,29 @@ // ================================================= RootSSHAccess void VDevice::doInitRootSSHAccess() { - // DEBUG : qDebug() << "HERE Request" << vValue; DeviceRootSSHAccessRequestData data; data.mIsGet = true; emit didAttributeRequest(data); } void VDevice::rootSSHAccessRequest(const Qt::CheckState &vValue) { - // DEBUG : qDebug() << "HERE Request" << vValue; DeviceRootSSHAccessRequestData data; data.mIsGet = false; data.mRootSSHAccess = vValue; emit didAttributeRequest(data); } void VDevice::onAttributeResponse(const DeviceRootSSHAccessResponseData &vData) { - if ( vData.mAccepted ) { - rootSSHAccess(vData.mRootSSHAccess); - status(""); + + if ( vData.mCompleted ) { + if ( vData.mAccepted ) { + emit rootSSHAccessChanged(vData.mRootSSHAccess); + status(""); + } + else { + status(vData.mMessage); + } } - else { - // this has to be called to let Gui to set to old value that device controller provided. - emit rootSSHAccessChanged(vData.mRootSSHAccess); - status(vData.mMessage); - } accepted(vData.mAccepted); reason (vData.mReason ); @@ -204,18 +204,14 @@ // Nothing for now. } -void VDevice::factoryResetRequest(const QString &vCommand) { - Q_UNUSED(vCommand) - // DEBUG : qDebug() << "HERE Request" << vCommand; - +void VDevice::factoryResetRequest(const QString &) { factoryResetEnabled(false); DeviceFactoryResetRequestData data; emit didAttributeRequest(data); } void VDevice::onAttributeResponse(const DeviceFactoryResetResponseData &vData) { - // QDEBUG : qDebug() << "HERE Response " << Q_FUNC_INFO << " accepted: " << vData.mAccepted; // this has to be called to let Gui to set to old value that device controller provided. status(vData.mMessage); @@ -233,10 +229,7 @@ // Nothing for now. } -void VDevice::decommissionRequest(const QString &vCommand) { - Q_UNUSED(vCommand) - // DEBUG : qDebug() << "HERE Request" << vCommand; - +void VDevice::decommissionRequest(const QString &) { decommissionEnabled(true); DeviceDecommissionRequestData data; @@ -252,7 +245,6 @@ } void VDevice::onAttributeResponse(const DeviceDecommissionResponseData &vData) { - //QDEBUG : qDebug() << "HERE Response " << Q_FUNC_INFO << " accepted: "<< vData.mAccepted << vData.mReason; // this has to be called to let Gui to set to old value that device controller provided. status(vData.mMessage); @@ -628,8 +620,58 @@ } // ================================================= WiFi Indicator -void VDevice::onWiFiIP (const QString &vData) +void VDevice::onWiFiIP (const QString &vData, bool vWifiError) { + if ( vWifiError ) { + ssid(""); + } ipAddress(vData); } +// ================================================= Date/Time +void VDevice::doInitDateTime() { + // Nothing for now. +} + +void VDevice::dateTimeRequest( const QString &) { + // Nothing for now. +} + +void VDevice::doDateTime(const QString &vYear, const QString &vMonth, const QString &vDay, + const QString &vHour, const QString &vMinute, bool vNTP) { + + const QDateTime currentDateTimeLocal ( QDate( vYear .toInt() , + vMonth .toInt() , + vDay .toInt()) , + QTime( vHour .toInt() , + vMinute .toInt())); + const QString dateTimeLocalStr = currentDateTimeLocal.toString(_Settings.getUpdateFormat()); // sudo date -s requires this format + + DeviceDateTimeRequestData data; + data.mDateTime = dateTimeLocalStr; + data.mNTP = vNTP; + + LOG_DEBUG(tr("SetDateTime %1").arg(dateTimeLocalStr)); + + emit didAttributeRequest(data); +} + +void VDevice::onAttributeResponse(const DeviceDateTimeResponseData &vData) { + + if ( vData.mCompleted ) { + if ( vData.mAccepted ) { + emit dateTimeChanged(""); + status(""); + } + else { + status(vData.mMessage); + } + } + + accepted(vData.mAccepted); + reason (vData.mReason ); + + // has to be the last one + response(true); +} + Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -51,6 +51,9 @@ #include "VCloudSync.h" #include "VHDUsageInfo.h" #include "VAdjustmentInstitutionalRecord.h" +#include "VInstitutionalRecord.h" +#include "VAdjustmentAdvancedInstitutionalRecord.h" +#include "VAdvancedInstitutionalRecord.h" // states data #include "VTDOpModeData.h" #include "VPreTreatmentStatesData.h" @@ -115,19 +118,41 @@ #include "VDDGenDialysateData.h" #include "VDDLevelData.h" #include "VDDBloodLeakData.h" +// FP data +#include "VFPROPumpData.h" +#include "VFPPressuresData.h" +#include "VFPLevelData.h" +#include "VFPFlowData.h" +#include "VFPConductivityData.h" +#include "VFPTemperatureData.h" +#include "VFPBoostPumpData.h" // ----- #include "VTreatmentCreate.h" +#include "VTreatmentIsolatedUFData.h" // ----- In-Treatment Adjustments -#include "VTreatmentAdjustmentDuration.h" +#include "VTreatmentAdjustmentBloodPrime.h" +#include "VTreatmentAdjustmentDurationEdit.h" +#include "VTreatmentAdjustmentDurationConfirm.h" #include "VTreatmentAdjustmentFlows.h" #include "VTreatmentAdjustmentUltrafiltrationState.h" #include "VTreatmentAdjustmentUltrafiltrationEdit.h" #include "VTreatmentAdjustmentUltrafiltrationConfirm.h" #include "VTreatmentAdjustmentSaline.h" +#include "VTreatmentAdjustmentVitals.h" #include "VTreatmentAdjustmentHeparin.h" #include "VTreatmentAdjustmentRinseback.h" #include "VTreatmentAdjustmentRecirculate.h" #include "VTreatmentAdjustmentPressuresLimits.h" +#include "VTreatmentAdjustmentBloodFlowRate.h" +#include "VTreatmentAdjustmentBolusVolume.h" +#include "VTreatmentAdjustmentDialysateFlowRate.h" +#include "VTreatmentAdjustmentDialysateTemperature.h" +#include "VTreatmentAdjustmentDurationConfirm.h" +#include "VTreatmentAdjustmentDurationEdit.h" +#include "VTreatmentAdjustmentIsolatedUFConfirm.h" +#include "VTreatmentAdjustmentIsolatedUFDurationEdit.h" +#include "VTreatmentAdjustmentIsolatedUFVolumeEdit.h" +#include "VTreatmentAdjustmentSetPoints.h" // ----- Post-Treatment Adjustments #include "VPostTreatmentAdjustPatientDisconnectionConfirm.h" #include "VPostTreatmentAdjustDisposablesRemovalConfirm.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -81,11 +81,11 @@ ID_DuetConfirmUIr = 0xBB00, // 187 // POST - ID_HDPostSingleResultData = 0x8E00, // 142 - ID_HDPostFinalResultData = 0x8F00, // 143 - ID_DGPostSingleResultData = 0x9000, // 144 - ID_DGPostFinalResultData = 0x9100, // 145 - ID_UIPostFinalResultData = 0x9200, // 146 // ID_UIFinalResultTxr - UI Final Result response/Data transmit + ID_HDPostSingleResultData = 0x8E0F, // 142 //// ----- @CRAPIZED: had to change to avoid duplication + ID_HDPostFinalResultData = 0x8F0F, // 143 //// ----- @CRAPIZED: had to change to avoid duplication + ID_DGPostSingleResultData = 0x900F, // 144 //// ----- @CRAPIZED: had to change to avoid duplication + ID_DGPostFinalResultData = 0x910F, // 145 //// ----- @CRAPIZED: had to change to avoid duplication + ID_UIPostFinalResultData = 0x920F, // 146 //// ----- @CRAPIZED: had to change to avoid duplication ID_UIPostFinalResultHDReq = 0xB200, // 178 // ID_HDFinalResultRxq - HD Final Result request received // ----- Settings @@ -99,30 +99,31 @@ ID_AdjustVersionsTDReq = 0x1500, // 21 // ID_TDVersionsRxq - TD Version request received //// ----- @LEAHIZED ID_AdjustVersionsTDRsp = 0x0E00, // 14 //// ----- @LEAHIZED ID_AdjustVersionsDDRsp = 0x0F00, // 15 //// ----- @LEAHIZED + ID_AdjustVersionsFPRsp = 0x5A00, // 90 //// ----- @LEAHIZED ID_AdjustSerialTDRsp = 0x5100, // 81 //// ----- @LEAHIZED ID_AdjustSerialDDRsp = 0x5200, // 82 //// ----- @LEAHIZED // Service Information - ID_AdjustServiceDatesReq = 0x8900, // 137 - ID_AdjustServiceDatesHDRsp = 0x8A00, // 138 - ID_AdjustServiceDatesDGRsp = 0x8C00, // 140 + ID_AdjustServiceDatesReq = 0x890F, // 137 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustServiceDatesHDRsp = 0x8A0F, // 138 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustServiceDatesDGRsp = 0x8C0F, // 140 //// ----- @CRAPIZED: had to change to avoid duplication // HD/DG Usage Counter - ID_HDUsageInfoReq = 0xA000, // 160 - ID_HDUsageInfoRsp = 0x8B00, // 139 + ID_HDUsageInfoReq = 0xA00F, // 160 //// ----- @CRAPIZED: had to change to avoid duplication + ID_HDUsageInfoRsp = 0x8B0F, // 139 //// ----- @CRAPIZED: had to change to avoid duplication // RTC - ID_AdjustHDDateTimeReq = 0x6D00, // 109 - ID_AdjustHDDateTimeRsp = 0x6E00, // 110 - ID_AdjustDGDateTimeReq = 0x6F00, // 111 - ID_AdjustDGDateTimeRsp = 0x7000, // 112 + ID_AdjustTDDateTimeReq = 0x6C00, // 108 + ID_AdjustTDDateTimeRsp = 0x6D00, // 109 + ID_AdjustDDDateTimeReq = 0x6E00, // 110 + ID_AdjustDDDateTimeRsp = 0x6F00, // 111 ID_HDRTCEpochData = 0x0A0F, // 10 //// ----- @CRAPIZED // State Messages ID_TDOpModeData = 0x1200, // 18 //// ----- @LEAHIZED ID_PreTreatmentStates = 0x5C00, // 92 ID_TreatmentStates = 0x3C00, // 60 //// ----- @LEAHIZED - ID_PostTreatmentStates = 0x7700, // 119 + ID_PostTreatmentStates = 0x770F, // 119 //// ----- @CRAPIZED: had to change to avoid duplication // ----- ID_PowerOff = 0x010F, // 010F //// ----- @CRAPIZED @@ -134,11 +135,13 @@ ID_PressureOcclusion = 0x2400, // 36 //// ----- @LEAHIZED ID_Saline = 0x3D00, // 61 //// ----- @LEAHIZED ID_Ultrafiltration = 0x3E00, // 62 //// ----- @LEAHIZED - ID_Heparin = 0x4D00, // 77 - ID_Rinseback = 0x5600, // 86 + ID_Heparin = 0x8C00, // 140 + ID_IsolatedUF = 0x9A00, // 154 + ID_Rinseback = 0x8F00, // 143 //// ----- @LEAHIZED ID_Recirculate = 0x5A00, // 90 - ID_BloodPrime = 0x5900, // 89 + ID_BloodPrime = 0x9700, // 151 ID_TreatmentStop = 0x4900, // 73 + ID_Vitals = 0x6500, // 101 // Alarm Messages ID_AlarmStatus = 0x0100, // 01 //// ----- @LEAHIZED @@ -169,26 +172,26 @@ // Pre-Treatment SelfTest NoCartridge Progress Data ID_SelfTestNoCartridgeData = 0x6100, // 97 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment Disposables Installation Confirm - ID_AdjustDisposablesConfirmReq = 0x6200, // 98 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response - ID_AdjustDisposablesConfirmRsp = 0xAD00, // 173 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + ID_AdjustDisposablesConfirmReq = 0x9200, // 146 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + ID_AdjustDisposablesConfirmRsp = 0x9300, // 147 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment SelfTest Dry Progress Data - ID_SelfTestDryData = 0x6300, // 99 + ID_SelfTestDryData = 0x630F, // 99 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Disposable Priming ID_AdjustDisposablesPrimeReq = 0x3C0F, // 60 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustDisposablesPrimeRsp = 0x3D0F, // 61 //// ----- @CRAPIZED: had to change to avoid duplication ID_DisposablesPrimeData = 0x43FF, // ?? //// ----- @CRAPIZED - FFed // Pre-Treatment Patient Connection Begin - ID_AdjustPatientConnectionBeginReq = 0x6400, // 100 - ID_AdjustPatientConnectionBeginRsp = 0x6500, // 101 + ID_AdjustPatientConnectionBeginReq = 0x640F, // 100 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustPatientConnectionBeginRsp = 0x650F, // 101 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Ultrafiltration initial volume ID_AdjustUltrafiltrationInitReq = 0x4F0F, // 79 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustUltrafiltrationInitRsp = 0x5000, // 80 // Pre-Treatment Patient Connection Confirm - ID_AdjustPatientConnectionConfirmReq = 0x6600, // 102 - ID_AdjustPatientConnectionConfirmRsp = 0x6700, // 103 + ID_AdjustPatientConnectionConfirmReq = 0x660F, // 102 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustPatientConnectionConfirmRsp = 0x670F, // 103 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Start Treatment - ID_AdjustStartTreatmentReq = 0x7100, // 113 - ID_AdjustStartTreatmentRsp = 0x7200, // 114 + ID_AdjustStartTreatmentReq = 0xA100, // 161 + ID_AdjustStartTreatmentRsp = 0xA200, // 162 // DG Data Messages ID_DGROPumpData = 0x1F0F, // 31 //// ----- @CRAPIZED: had to change to avoid duplication @@ -208,10 +211,20 @@ ID_DDGenDialysateData = 0x2F00, // 47 //// ----- @LEAHIZED ID_DDBloodLeakData = 0x6000, // 96 //// ----- TODO: Payload subject to change given FW implementation + // FP Data Messages + ID_FPValvesStatesData = 0x310F, // 49 //// ----- @OBSOLETE. REMOVE? + ID_FPROPumpData = 0x3200, // 50 //// ----- @LEAHIZED + ID_FPPressuresData = 0x3400, // 52 //// ----- @LEAHIZED + ID_FPLevelData = 0x3500, // 53 //// ----- @LEAHIZED + ID_FPFlowSensorData = 0x3600, // 54 //// ----- @LEAHIZED + ID_FPConductivityData = 0x3700, // 55 //// ----- @LEAHIZED + ID_FPTemperaturesData = 0x3900, // 57 //// ----- @LEAHIZED + ID_FPROBoosterPumpData = 0x5000, // 80 //// ----- @LEAHIZED + // HD Data Messages ID_HDAccelerometerData = 0x3300, // 51 ID_HDSyringePumpData = 0x6900, // 105 - ID_HDBloodLeakData = 0x6C00, // 108 + ID_HDBloodLeakData = 0x6C0F, // 108 //// ----- @CRAPIZED: had to change to avoid duplication ID_TDAirBubbleData = 0x1E00, // 30 //// ----- @LEAHIZED ID_TDAirPumpData = 0x2000, // 32 //// ----- @LEAHIZED ID_TDAirTrapData = 0x2A00, // 42 //// ----- @LEAHIZED @@ -223,81 +236,122 @@ ID_TDTemperatureData = 0x5300, // 83 //// ----- TODO: Payload subject to change given FW implementation ID_TreatmentParametersSetPointData = 0x4F00, // 79 //// ----- @LEAHIZED + // Blood Prime + ID_AdjustBloodPrimeReq = 0x9800, // 152 + ID_AdjustBloodPrimeRsp = 0x9900, // 153 + // In-Treatment Adjustables - ID_AdjustDurationReq = 0x160F, // 22 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustDurationRsp = 0x1B00, // 27 + ID_AdjustPressuresLimitsReq = 0x7200, // 114 //// ----- @LEAHIZED + ID_AdjustPressuresLimitsRsp = 0x7300, // 115 //// ----- @LEAHIZED + ID_AdjustBolusVolumeReq = 0x7400, // 116 //// ----- @LEAHIZED + ID_AdjustBolusVolumeRsp = 0x7500, // 117 //// ----- @LEAHIZED + + ID_AdjustDurationEditReq = 0x7600, // 118 //// ----- @LEAHIZED + ID_AdjustDurationEditRsp = 0x7700, // 119 //// ----- @LEAHIZED + ID_AdjustDurationConfirmReq = 0x7800, // 120 //// ----- @LEAHIZED + ID_AdjustDurationConfirmRsp = 0x7900, // 121 //// ----- @LEAHIZED + + ID_AdjustSetPointsReq = 0x7A00, // 122 //// ----- @LEAHIZED + ID_AdjustSetPointsRsp = 0x7B00, // 123 //// ----- @LEAHIZED + + ID_AdjustBloodFlowRateReq = 0x7C00, // 124 //// ----- @LEAHIZED + ID_AdjustBloodFlowRateRsp = 0x7D00, // 125 //// ----- @LEAHIZED + + ID_AdjustDialysateFlowRateReq = 0x7E00, // 126 //// ----- @LEAHIZED + ID_AdjustDialysateFlowRateRsp = 0x7F00, // 127 //// ----- @LEAHIZED + + ID_AdjustDialysateTemperatureReq = 0x8000, // 128 //// ----- @LEAHIZED + ID_AdjustDialysateTemperatureRsp = 0x8100, // 129 //// ----- @LEAHIZED + ID_AdjustBloodDialysateReq = 0x1700, // 23 ID_AdjustBloodDialysateRsp = 0x1800, // 24 - ID_AdjustPressuresLimitsReq = 0x4600, // 70 - ID_AdjustPressuresLimitsRsp = 0x4700, // 71 - ID_AdjustSalineReq = 0x5F00, // 95 ID_AdjustSalineRsp = 0x6000, // 96 - ID_AdjustHeparinReq = 0x4B00, // 75 - ID_AdjustHeparinRsp = 0x4C00, // 76 + ID_AdjustVitalsReq = 0x6300, // 99 + ID_AdjustVitalsRsp = 0x6400, // 100 + ID_AdjustHeparinReq = 0x8A00, // 138 + ID_AdjustHeparinRsp = 0x8B00, // 139 + // Ultrafiltration - ID_AdjustUltrafiltrationStateReq = 0x100F, // 16 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustUltrafiltrationStateRsp = 0x4100, // 65 + ID_AdjustUltrafiltrationStateReq = 0x4700, // 71 //// ----- @LEAHIZED + ID_AdjustUltrafiltrationStateRsp = 0x4800, // 72 //// ----- @LEAHIZED - ID_AdjustUltrafiltrationEditReq = 0x110F, // 17 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustUltrafiltrationEditRsp = 0x1300, // 19 + ID_AdjustUltrafiltrationEditReq = 0x4100, // 65 //// ----- @LEAHIZED + ID_AdjustUltrafiltrationEditRsp = 0x4200, // 66 //// ----- @LEAHIZED - ID_AdjustUltrafiltrationConfirmReq = 0x150F, // 21 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustUltrafiltrationConfirmRsp = 0x2E00, // 46 + ID_AdjustUltrafiltrationConfirmReq = 0x6600, // 102 //// ----- @LEAHIZED + ID_AdjustUltrafiltrationConfirmRsp = 0x6700, // 103 //// ----- @LEAHIZED + ID_AdjustIsolatedUFDurationEditReq = 0x9B00, // 155 //// ----- @LEAHIZED + ID_AdjustIsolatedUFDurationEditRsp = 0x9C00, // 156 //// ----- @LEAHIZED + + ID_AdjustIsolatedUFVolumeEditReq = 0x9D00, // 157 //// ----- @LEAHIZED + ID_AdjustIsolatedUFVolumeEditRsp = 0x9E00, // 158 //// ----- @LEAHIZED + + ID_AdjustIsolatedUFConfirmReq = 0x9F00, // 159 //// ----- @LEAHIZED + ID_AdjustIsolatedUFConfirmRsp = 0xA000, // 160 //// ----- @LEAHIZED + // End-Treatment // Rinseback - ID_AdjustRinsebackReq = 0x520F, // 82 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustRinsebackRsp = 0x530F, // 83 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustRinsebackReq = 0x9000, // 144 //// ----- @LEAHIZED + ID_AdjustRinsebackRsp = 0x9100, // 145 //// ----- @LEAHIZED // Recirculate ID_AdjustRecirculateReq = 0x540F, // 84 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustRecirculateRsp = 0x5500, // 85 // Treatment End - ID_AdjustTreatmentEndReq = 0x5700, // 87 - ID_AdjustTreatmentEndRsp = 0x5800, // 88 + ID_AdjustTreatmentEndReq = 0x8D00, // 141 + ID_AdjustTreatmentEndRsp = 0x8E00, // 142 // Post-Treatment // Patient Disconnect ID_AdjustPatientDisconnectNotifyReq = 0x4A00, // 74 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response ID_AdjustPatientDisconnectConfirmReq = 0x060F, // 060f //// ----- @CRAPIZED - ID_AdjustPatientDisconnectConfirmRsp = 0x7E00, // 126 + ID_AdjustPatientDisconnectConfirmRsp = 0x7E0F, // 126 //// ----- @CRAPIZED: had to change to avoid duplication // Disposables Removal - ID_AdjustDisposablesRemovalConfirmReq = 0x7300, // 115 - ID_AdjustDisposablesRemovalConfirmRsp = 0x7400, // 116 + ID_AdjustDisposablesRemovalConfirmReq = 0x9400, // 148 + ID_AdjustDisposablesRemovalConfirmRsp = 0x9500, // 149 // Treatment Log Adjs - ID_AdjustTreatmentLogReq = 0x7500, // 117 - ID_AdjustTreatmentLogRsp = 0x7600, // 118 + ID_AdjustTreatmentLogReq = 0x750F, // 117 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustTreatmentLogRsp = 0x760F, // 118 //// ----- @CRAPIZED: had to change to avoid duplication // Treatment Log Data ID_TreatmentLogAvrgeData = 0x940F, // 148 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentLogAlarmData = 0x950F, // 149 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentLogEventData = 0x960F, // 150 //// ----- @CRAPIZED: had to change to avoid duplication // Disinfect - ID_AdjustDisinfectModeReq = 0x9A00, // 154 - ID_AdjustDisinfectModeRsp = 0x9B00, // 155 - ID_AdjustDisinfectStartReq = 0x7F00, // 127 - ID_AdjustDisinfectStartRsp = 0x8000, // 128 + ID_AdjustDisinfectModeReq = 0x9A0F, // 154 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustDisinfectModeRsp = 0x9B0F, // 155 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustDisinfectStartReq = 0x7F0F, // 127 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustDisinfectStartRsp = 0x800F, // 128 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustDGCleaningUsageReq = 0xB800, // 184 - ID_AdjustDGCleaningUsageRsp = 0x8D00, // 141 + ID_AdjustDGCleaningUsageRsp = 0x8D0F, // 141 //// ----- @CRAPIZED: had to change to avoid duplication // RO Water Input Mode ID_DuetRoWaterStatDGq = 0xC300, // 195 DG -> UI // DG initiates Status query ID_DuetRoWaterModeUIi = 0xBC00, // 188 UI -> DG // UI initiates Mode Set || responses to status query ID_DuetRoWaterModeDGr = 0xC400, // 196 UI <- DG // DG responses Mode Set // Institutional record request and response - ID_AdjustInstitutionalRecordReq = 0xCF00, // 207 UI -> HD request institutional record - ID_AdjustInstitutionalRecordRsp = 0xD000, // 208 HD -> UI response institutional record + ID_InstitutionalRecordReq = 0x8200, // 130 UI -> TD request institutional record + ID_InstitutionalRecordRsp = 0x8300, // 131 TD -> UI response institutional record + ID_AdjustInstitutionalRecordReq = 0x8400, // 132 UI -> TD request institutional record + ID_AdjustInstitutionalRecordRsp = 0x8500, // 133 TD -> UI response institutional record + // Advanced Institutional record request and response + ID_AdvancedInstitutionalRecordReq = 0x8600, // 134 UI -> TD request institutional record + ID_AdvancedInstitutionalRecordRsp = 0x8700, // 135 TD -> UI response institutional record + ID_AdjustAdvancedInstitutionalRecordReq = 0x8800, // 136 UI -> TD request institutional record + ID_AdjustAdvancedInstitutionalRecordRsp = 0x8900, // 137 TD -> UI response institutional record + // HD reset request in service mode ID_ResetHDInServiceModeReq = 0xB900, // 185 UI -> HD reset in service mode }; @@ -388,6 +442,8 @@ Q_ENUM(DD_Disinfect_States) Q_ENUM(DD_Heat_UI_States) Q_ENUM(DD_Valves) + + #include "FPDefs.h" }; // to be able to use the enum as signal/slot parameter @@ -432,6 +488,7 @@ typedef GuiActions::Requested_Treatment_Recirc_User_Actions GuiRecirculateCommands; // Blood Prime typedef GuiActions::Blood_Prime_States GuiBloodPrimeStates; + typedef GuiActions::Requested_Blood_Prime_User_Actions GuiBloodPrimeCommands; // Treatment End typedef GuiActions::Treatment_End_States GuiTreatmentEndStates; typedef GuiActions::Requested_Treatment_End_User_Actions GuiTreatmentEndCommands; @@ -503,4 +560,4 @@ void registerQmlTypes(); bool startGui(); -} + } Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -37,6 +37,8 @@ property alias notificationText : _notification.text property alias notification : _notification property bool showDropShadow : false + property alias backgroundItem : _backgroundItem.children + property alias backgroundItemZ : _backgroundItem.z width : Variables.dialogWidth height : Variables.dialogHeight @@ -60,20 +62,23 @@ } background: Rectangle { id: _backgroundRect - color : Colors.backgroundDialog - radius: Variables.dialogRadius + color : Colors.backgroundDialog + radius : Variables.dialogRadius - layer.enabled: showDropShadow + layer.enabled : showDropShadow layer.effect: DropShadow { id: _dropShadow horizontalOffset: 4 verticalOffset : 4 radius : 12 samples : 32 - color : "#4DFFF8E1" + color : Colors.dropShadowDialogColor source : _backgroundRect anchors.fill : _backgroundRect } + + // 👇 Placeholder for an injected component. Ex. numpad + Item { id: _backgroundItem } } onVisibleChanged: { @@ -93,5 +98,5 @@ } } - NotificationBarSmall { id: _notification } + NotificationBarSmall { id: _notification ; height: 60} } Index: sources/gui/qml/components/NotificationBarSmall.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -26,6 +26,8 @@ objectName: "NotificationBar" // SquishQt property alias imageSource : _image.source + property alias imageFillMode : _image.fillMode + property bool imageVerticalCenter: false property bool imageAutoSize : false property bool imageAnimated : false property int imageDiameter : Variables.notificationIconDiameter @@ -57,7 +59,7 @@ Image { id: _image width : source == "" ? 0 : imageAutoSize ? Math.min(_root.height, _root.width) : _root.imageDiameter height: source == "" ? 0 : imageAutoSize ? Math.min(_root.height, _root.width) : _root.imageDiameter - anchors.verticalCenter : imageAutoSize ? parent.verticalCenter : undefined + anchors.verticalCenter : imageAutoSize || imageVerticalCenter ? parent.verticalCenter : undefined anchors.top : imageAutoSize ? undefined : parent.top anchors.topMargin : height > _root.height ? -((height - _root.height) / 2) : imageTopMargin } Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -25,6 +25,7 @@ */ RangeRect { id: _root property real value : _progressRect.value + property real minStop : _root.minimum property real defaultValue : _root.minimum property real step : 1 @@ -54,7 +55,13 @@ property bool isRoundedEnds : true property bool hasBorder : true property bool showMinMaxText : true - property color borderColor : Colors.borderDisableButton + property color borderColor : Colors.borderDisableButton + property color highlightActiveColor : Colors.sliderHighlightColor + property color highlightInactiveColor : Colors.createTreatmentInactive + property color progressBorderActiveColor : Colors.sliderProgressBorderActive + property color progressBorderInactiveColor : Colors.borderDisableButton + property color handlerActiveColor : Colors.createTreatmentActive + property color handlerInactiveColor : Colors.createTreatmentInactive signal activeChanged() signal handleSelected() @@ -86,14 +93,16 @@ let newValue = Number.NaN if(vIsIncrement) { - newValue = _progressRect.value + amountChanged + newValue = calculateRoundedValue(_progressRect.value + amountChanged) } else { - newValue = _progressRect.value - amountChanged + newValue = calculateRoundedValue(_progressRect.value - amountChanged) } // Capping values based on min/max threshold - if ( newValue < minimum ) newValue = minimum - if ( newValue > maximum ) newValue = maximum + let min = calculateMinimum() + let max = calculateMaximum() + if ( newValue < min ) newValue = min + if ( newValue > max ) newValue = max // Update the slider's visual value _progressRect.previousSliderValue = newValue // for comparison purposes @@ -105,11 +114,11 @@ function setActiveVisuals(active) { if (active) { - color = Colors.sliderHighlightColor - handlerColor = Colors.createTreatmentActive + color = _root.highlightActiveColor + handlerColor = _root.handlerActiveColor } else { - color = Colors.createTreatmentInactive - handlerColor = Colors.createTreatmentInactive + color = _root.highlightInactiveColor + handlerColor = _root.handlerInactiveColor } } @@ -179,6 +188,12 @@ return (Math.round(vValue / step) * step).toFixed(decimal) } + // round the value based on the given precision (not step) + function calculatePrecisionRoundedValue(value) { + let multiplier = Math.pow(10, decimal) + return Math.round(value * multiplier) / multiplier + } + function getValueOfX(x) { return ( x * ( maximum - minimum ) ) / width + minimum } @@ -188,8 +203,8 @@ } function calculateValue(x, isSnappingToTicks) { - let mMinimum = Number(_root.minimum.toFixed(decimal)) - let mMaximum = Number(_root.maximum.toFixed(decimal)) + let mMinimum = calculateMinimum() + let mMaximum = calculateMaximum() // the center of the handler is aligned on the snap point and half width shall be used to set as min not the entire width. // also half of the hadler is out of slider min position when set on min, which proves the same as above. @@ -216,8 +231,10 @@ let stepWidth = width / ((mMaximum - mMinimum) / step) if ( stepWidth < _handler.width ) { let valueStepCount = parseInt(mValue / step) - mValue = valueStepCount * step - return mValue.toFixed(decimal) + mValue = calculateRoundedValue((valueStepCount * step)) + if ( mValue < mMinimum ) { return mMinimum } + if ( mValue > mMaximum ) { return mMaximum } + return mValue } // For sliders with decimal min, max, values, we need to add refinement to @@ -237,6 +254,44 @@ return mValue; } + /*! + * \brief Calculate the minimum value for the slider based on the current minimum, + * minStop, and stepSnap values. + * \return If minimum is greater than or equal to minStop, then just return minimum. + * If minStop is greater than minimum and stepSnap is false, then return minStop. + * If minStop is greater than minimum and stepSnap is true, then return minStep if + * it falls on a step, otherwise return the step above minStop. + */ + function calculateMinimum() { + let result = calculateRoundedValue(_root.minimum) + let rdMinStop = calculatePrecisionRoundedValue(_root.minStop) + if (rdMinStop > result) { + if (stepSnap) { + // if slider is set to snap and minimum stop is not on a step, then + // adjust it to one step above + let rdStep = calculatePrecisionRoundedValue(step) + result = Math.ceil(rdMinStop/rdStep) * rdStep + } + else { + result = rdMinStop + } + } + return result + } + + /*! + * \brief Calculate the maximum value for the slider based on the current maximum + * and stepSnap values. + * \return If stepSnap is false, then maximum. + * If stepSnap is true and maximum does not fall on a step, then one step below maximum, + * otherwise maximum. + */ + function calculateMaximum() { + let result = calculatePrecisionRoundedValue(_root.maximum) + return stepSnap ? Math.min(result, parseInt(result/step) * step) + : result + } + // used loader for performance since it may not always be required. // and can be a heavy Component Loader { id: _ticksLoader @@ -260,7 +315,7 @@ ProgressRect { id: _progressRect property real previousSliderValue: Number.NaN value : minimum - color : Colors.sliderHighlightColor + color : _root.highlightActiveColor decimal : _root.decimal minimum : _root.minimum @@ -270,7 +325,7 @@ radius : _root.isRoundedEnds ? (height/2) : Variables.rangeRectRadius border.width: _root.hasBorder ? Variables.rangeRectBorderWidth : 0 - border.color: _root.isActive ? Colors.sliderProgressBorderActive : Colors.borderDisableButton + border.color: _root.isActive ? _root.progressBorderActiveColor : _root.progressBorderInactiveColor // propagation is not working on drag ! onDragged : (mouse) => _root.dragged(mouse) @@ -335,7 +390,7 @@ width : diameter height : diameter radius : diameter - color : Colors.highlightProgressBar + color : _root.handlerActiveColor border { width: Variables.progressbarHandlerBorderWidth color: _root.handleBorderColor Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -73,7 +73,7 @@ // TODO: disable doubleClicked later. this is only for diagnostic purpose when alarm dialog covers the entire screen. MouseArea { id: _minimizeArea anchors.fill : parent - onDoubleClicked : { if ( ! _root.minVisible ) _sdcProgressItem.doubleClicked() } // call the sdcard.double click to pop the DiagnosticsDialog + onDoubleClicked : { if ( ! _root.minVisible ) _diagnosticsDialog.open() } } Text { id: _title @@ -110,7 +110,7 @@ } Rectangle { id: _descriptionRect - color : Colors.alarmDialog + color : Colors.offWhite clip : true anchors { @@ -165,7 +165,7 @@ delegate: Item { id: _delegateControl width : _listView.width - height : 73 + height : Variables.instructionHeight clip : true Rectangle { id: _stepRect Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsDD.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/dialogs/diagnostics/DiagnosticsDD.qml (.../DiagnosticsDD.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsDD.qml (.../DiagnosticsDD.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -21,21 +21,22 @@ // Qml imports import "qrc:/globals" import "qrc:/components" -import "qrc:/compounds" /*! * \brief the post treatment prime stack screen */ DiagnosticsBase { id: _root - objectName: "_DiagnosticsDD" + objectName : "_DiagnosticsDD" - title: "Dialysate Delivery" + contentItem : Item { id: _content - DebugDataColumn { id: _DDConcentratePumpColumn + DebugDataColumn { id: _DDConcentratePumpColumn textObjectName :"_DDConcentratePumpData" title : qsTr(" Conc Pump ") - x: col(0) - y: row(0) + anchors { + top : parent.top + left : parent.left + } model: [ vDDConcentratePump.D10PumpCurrentSetSpeed .toFixed(2) , vDDConcentratePump.D10PumpMeasuredSpeed .toFixed(2) , @@ -92,11 +93,14 @@ ] } - DebugDataColumn { id: _DDDialysatePumpColumn + DebugDataColumn { id: _DDDialysatePumpColumn textObjectName :"_DDDialysatePumpData" title : qsTr(" Dial Pump ") - x: col(1.5) - y: row(0) + anchors { + top : parent.top + left : _DDConcentratePumpColumn.right + leftMargin : spacing + } model: [ vDDDialysatePump.D12PumpTargetRPM .toFixed(2) , vDDDialysatePump.D12PumpMeasuredSpeed .toFixed(2) , @@ -143,11 +147,14 @@ ] } - DebugDataColumn { id: _DDHeatersColumn + DebugDataColumn { id: _DDHeatersColumn textObjectName :"_DDHeatersData" title : qsTr(" Heaters ") - x: col(3) - y: row(0) + anchors { + top : parent.top + left : _DDDialysatePumpColumn.right + leftMargin : spacing + } model: [ vDDHeaters.mainPrimayHeaterDC .toFixed(2) , vDDHeaters.primaryTargetTemp .toFixed(2) , @@ -188,11 +195,14 @@ ] } - DebugDataColumn { id: _DDTemperatureColumn + DebugDataColumn { id: _DDTemperatureColumn textObjectName :"_DDTemperatureData" title : qsTr(" Temp ") - x: col(4.5) - y: row(0) + anchors { + top : parent.top + left : _DDHeatersColumn.right + leftMargin : spacing + } model: [ vDDTemperatures.inletHeatExchanger .toFixed(2) , vDDTemperatures.outletHeatExchanger .toFixed(2) , @@ -229,214 +239,308 @@ ] } - DebugDataColumn { id: _DDPressureColumn - textObjectName :"_DDPressureData" - title : qsTr(" Pressure ") - x: col(6) - y: row(0) - model: [ - vDDPressures.waterInletPSI .toFixed(2), - vDDPressures.waterOutletPSI .toFixed(2), - vDDPressures.hydrolicOutletPSI .toFixed(2), - vDDPressures.bicarbBagPSI .toFixed(2), - vDDPressures.spentDialysatePSI .toFixed(2), - vDDPressures.freshDialysatePSI .toFixed(2), - vDDPressures.transmembranePSI .toFixed(2), - vDDPressures.waterInletTemp .toFixed(2), - vDDPressures.waterOutletTemp .toFixed(2), - vDDPressures.hydrolicOutletTemp .toFixed(2), - vDDPressures.bicarbBagTemp .toFixed(2), - vDDPressures.spentDialysateTemp .toFixed(2), - vDDPressures.freshDialysateTemp .toFixed(2), - vDDPressures.transmembraneTemp .toFixed(2), - ] - label: [ - "WInPSI (M1) ", - "WOutPSI (M3) ", - "HOutPSI (D9) ", - "BBagPSI (D66) ", - "SDialPSI (D51) ", - "FDialPSI (D18) ", - "TransPSI (D41) ", - "WInTmp (M1) ", - "WOutTmp (M3) ", - "HOutTmp (D9) ", - "BBagTmp (D66) ", - "SDialTmp (D51) ", - "FDialTmp (D18) ", - "TransTmp (D41) ", - ] - } + DebugDataColumn { id: _DDPressureColumn + textObjectName :"_DDPressureData" + title : qsTr(" Pressure ") + anchors { + top : parent.top + left : _DDTemperatureColumn.right + leftMargin : spacing + } + model: [ + vDDPressures.waterInletPSI .toFixed(2), + vDDPressures.waterOutletPSI .toFixed(2), + vDDPressures.hydrolicOutletPSI .toFixed(2), + vDDPressures.bicarbBagPSI .toFixed(2), + vDDPressures.spentDialysatePSI .toFixed(2), + vDDPressures.freshDialysatePSI .toFixed(2), + vDDPressures.transmembranePSI .toFixed(2), + vDDPressures.waterInletTemp .toFixed(2), + vDDPressures.waterOutletTemp .toFixed(2), + vDDPressures.hydrolicOutletTemp .toFixed(2), + vDDPressures.bicarbBagTemp .toFixed(2), + vDDPressures.spentDialysateTemp .toFixed(2), + vDDPressures.freshDialysateTemp .toFixed(2), + vDDPressures.transmembraneTemp .toFixed(2), + ] + label: [ + "WInPSI (M1) ", + "WOutPSI (M3) ", + "HOutPSI (D9) ", + "BBagPSI (D66) ", + "SDialPSI (D51) ", + "FDialPSI (D18) ", + "TransPSI (D41) ", + "WInTmp (M1) ", + "WOutTmp (M3) ", + "HOutTmp (D9) ", + "BBagTmp (D66) ", + "SDialTmp (D51) ", + "FDialTmp (D18) ", + "TransTmp (D41) ", + ] + } - DebugDataColumn { id: _DDGenDialColumn - textObjectName :"_DDGenDialData" - title : qsTr(" GenDial ") - x: col(7.5) - y: row(0) + DebugDataColumn { id: _DDGenDialColumn + textObjectName :"_DDGenDialData" + title : qsTr(" GenDial ") + anchors { + top : parent.top + left : _DDPressureColumn.right + leftMargin : spacing + } - model: [ - vDDGenDialysate.genDialysateExec , - vDDGenDialysate.ddInProgress , - vDDGenDialysate.isDialGood , - vDDGenDialysate.fltLevel1 , - vDDGenDialysate.bicarbLevel , - vDDGenDialysate.spentLevel , - vDDGenDialysate.hydNegativePressure .toFixed(2), - vDDGenDialysate.hydPositivePressure .toFixed(2), - vDDGenDialysate.spentPressure .toFixed(2), - ] - label: [ - "Exec ", - "inProg ", - "isGood ", - "fltLvL (D6) ", - "bicarbLvL (D63)", - "sptLvL (D46) ", - "hydNeg (D19) ", - "hydPos (D18) ", - "sptPres (D51) ", - ] - } + model: [ + vDDGenDialysate.genDialysateExec , + vDDGenDialysate.ddInProgress , + vDDGenDialysate.isDialGood , + vDDGenDialysate.fltLevel1 , + vDDGenDialysate.bicarbLevel , + vDDGenDialysate.spentLevel , + vDDGenDialysate.hydNegativePressure .toFixed(2), + vDDGenDialysate.hydPositivePressure .toFixed(2), + vDDGenDialysate.spentPressure .toFixed(2), + ] + label: [ + "Exec ", + "inProg ", + "isGood ", + "fltLvL (D6) ", + "bicarbLvL (D63)", + "sptLvL (D46) ", + "hydNeg (D19) ", + "hydPos (D18) ", + "sptPres (D51) ", + ] + } - DebugDataColumn { id: _DDHydraulicsValveColumn - textObjectName :"_DDHydraulicValveData" - title : qsTr(" Hyd Valve ") - x: col(7.8) - y: row(3.1) + DebugDataColumn { id: _DDHydraulicsValveColumn + textObjectName :"_DDHydraulicValveData" + title : qsTr(" Hyd Valve ") + anchors { + top : _DDGenDialColumn.bottom + topMargin : spacing + left : _DDGenDialColumn.left + } - model: [ - Number(vDDValvesStates.hydraulicsOutletValve ) , - Number(vDDValvesStates.thermalDisinfectValve ) , - Number(vDDValvesStates.HydraulicsBypassValve ) , - Number(vDDValvesStates.rinsePortValve ) , - Number(vDDValvesStates.drainValve ) , - Number(vDDValvesStates.dialyzerBypassValve ) , - Number(vDDValvesStates.purgeValve1 ) , - Number(vDDValvesStates.pressureTestValve ) , - Number(vDDValvesStates.dryBicarbInletValve ) , - Number(vDDValvesStates.dialyzerInletValve ) , - Number(vDDValvesStates.dialyzerOutletValve ) , - Number(vDDValvesStates.purgeValve2 ) , - Number(vDDValvesStates.hydraulicsInletValve ) , - Number(vDDValvesStates.waterInletValve ) , - ] - label: [ - "HydOut (D14) ", - "ThemD (D52) ", - "HydByP (D8) ", - "RinseP (D54) ", - "Drain (D53) ", - "DialByP (D34) ", - "PurgV1 (D64) ", - "PresT (D31) ", - "DryBic (D65) ", - "DialIn (D35) ", - "DialOut (D40) ", - "PurgV2 (D47) ", - "HydIn (D3) ", - "WaterIn (M4) ", - ] - } + model: [ + Number(vDDValvesStates.hydraulicsOutletValve ) , + Number(vDDValvesStates.thermalDisinfectValve ) , + Number(vDDValvesStates.HydraulicsBypassValve ) , + Number(vDDValvesStates.rinsePortValve ) , + Number(vDDValvesStates.drainValve ) , + Number(vDDValvesStates.dialyzerBypassValve ) , + Number(vDDValvesStates.purgeValve1 ) , + Number(vDDValvesStates.pressureTestValve ) , + Number(vDDValvesStates.dryBicarbInletValve ) , + Number(vDDValvesStates.dialyzerInletValve ) , + Number(vDDValvesStates.dialyzerOutletValve ) , + Number(vDDValvesStates.purgeValve2 ) , + Number(vDDValvesStates.hydraulicsInletValve ) , + Number(vDDValvesStates.dryBicarbValve ) , + Number(vDDValvesStates.deScalerValve ) , + ] + label: [ + "HydOut (D14) ", + "ThemD (D52) ", + "HydByP (D8) ", + "RinseP (D54) ", + "Drain (D53) ", + "DialByP (D34) ", + "PurgV1 (D64) ", + "PresT (D31) ", + "DryBic (D65) ", + "DialIn (D35) ", + "DialOut (D40) ", + "PurgV2 (D47) ", + "HydIn (D3) ", + "Dry Bicarb (D80) ", + "De-scaler (D81) ", + ] + } - DebugDataColumn { id: _DDCondColumn - textObjectName :"_DDCondlData" - title : qsTr(" Cond ") - x: col(9) - y: row(0) - model: [ - vDDConductivity.bicarbCondutivity1 .toFixed(2), - vDDConductivity.acidBicarbCondutivity1 .toFixed(2), - vDDConductivity.acidBicarbCondutivity2 .toFixed(2), - vDDConductivity.spentCondutivity1 .toFixed(2), - vDDConductivity.bicarbCondutivity2 .toFixed(2), - ] - label: [ - "bicarb1 (D17) ", - "acidb1 (D27) ", - "acidb1 (D29) ", - "spent (D43) ", - "bicarb2 (D74) ", - ] - } + DebugDataColumn { id: _DDCondColumn + textObjectName :"_DDCondlData" + title : qsTr(" Cond ") + anchors { + top : _DDDialysatePumpColumn.bottom + topMargin : spacing + left : _DDDialysatePumpColumn.left + } + model: [ + vDDConductivity.bicarbCondutivity1 .toFixed(2), + vDDConductivity.acidBicarbCondutivity1 .toFixed(2), + vDDConductivity.acidBicarbCondutivity2 .toFixed(2), + vDDConductivity.spentCondutivity1 .toFixed(2), + vDDConductivity.bicarbCondutivity2 .toFixed(2), + ] + label: [ + "bicarb1 (D17) ", + "acidb1 (D27) ", + "acidb1 (D29) ", + "spent (D43) ", + "bicarb2 (D74) ", + ] + } - DebugDataColumn { id: _DDLevelColumn - textObjectName :"_DDLevelData" - title : qsTr(" Levels ") - x: col(9) - y: row(2) - model: [ - vDDLevel.floaterLevel , - vDDLevel.bicarbLevel , - vDDLevel.spentDialysateLevel , - ] - label: [ - "floater (D6) ", - "bicarb (D63) ", - "sptDial (D46) ", - ] - } + DebugDataColumn { id: _DDLevelColumn + textObjectName :"_DDLevelData" + title : qsTr(" Levels ") + anchors { + top : _DDPressureColumn.bottom + topMargin : spacing + left : _DDPressureColumn.left + } + model: [ + vDDLevel.floaterLevel , + vDDLevel.bicarbLevel , + vDDLevel.spentDialysateLevel , + ] + label: [ + "floater (D6) ", + "bicarb (D63) ", + "sptDial (D46) ", + ] + } - DebugDataColumn { id: _DDBCValvesColumn - textObjectName :"_DDBCValvesData" - title : qsTr(" BC Valves ") - x: col(9.5) - y: row(3.3) - model: [ - Number(vDDValvesStates.balancingChamberValve1 ) , - Number(vDDValvesStates.balancingChamberValve2 ) , - Number(vDDValvesStates.balancingChamberValve3 ) , - Number(vDDValvesStates.balancingChamberValve7 ) , - Number(vDDValvesStates.balancingChamberValve5 ) , - Number(vDDValvesStates.balancingChamberValve6 ) , - Number(vDDValvesStates.balancingChamberValve4 ) , - Number(vDDValvesStates.balancingChamberValve8 ) , - ] - label: [ - "BC1 (D23) ", - "BC2 (D19) ", - "BC3 (D25) ", - "BC7 (D26) ", - "BC5 (D24) ", - "BC6 (D20) ", - "BC4 (D21) ", - "BC8 (D22) ", - ] - } + DebugDataColumn { id: _DDBCValvesColumn + textObjectName :"_DDBCValvesData" + title : qsTr(" BC Valves ") + anchors { + top : _DDTemperatureColumn.bottom + topMargin : spacing + left : _DDHeatersColumn.right + leftMargin : spacing + } + model: [ + Number(vDDValvesStates.balancingChamberValve1 ) , + Number(vDDValvesStates.balancingChamberValve2 ) , + Number(vDDValvesStates.balancingChamberValve3 ) , + Number(vDDValvesStates.balancingChamberValve4 ) , + Number(vDDValvesStates.balancingChamberValve5 ) , + Number(vDDValvesStates.balancingChamberValve6 ) , + Number(vDDValvesStates.balancingChamberValve7 ) , + Number(vDDValvesStates.balancingChamberValve8 ) , + ] + label: [ + "BC1 (D23) ", + "BC2 (D19) ", + "BC3 (D25) ", + "BC4 (D21) ", + "BC5 (D24) ", + "BC6 (D20) ", + "BC7 (D26) ", + "BC8 (D22) ", + ] + } - DebugDataColumn { id: _DDBloodLeakColumn - textObjectName :"_DDBloodLeakData" - title : qsTr(" Blood Leak ") - x: col(10.5) - y: row(0) - model: [ - vDDBloodLeak.bloodLeak , - ] - label: [ - "BL ", - ] - } + DebugDataColumn { id: _DDIOValvesColumn + textObjectName :"_DDIOValvesColumn" + title : qsTr(" IO Valves ") + anchors { + top : _DDBCValvesColumn.bottom + topMargin : spacing + left : _DDBCValvesColumn.left + } + model: [ + Number(vDDValvesStates.ioValve0 ) , + Number(vDDValvesStates.ioValve1 ) , + ] + label: [ + "IO0 (M4) ", + "IO1 (M12) ", + ] + } - // TODO: The TouchRect should be unnecessary since the first communication message with UI/TD is the version. - TouchRect { - x : col(9.0) - y : row(8.0) - width : 425 - height : 80 - onClicked : vAdjustmentVersions.doAdjustment() - radius : 10 - Column { - anchors.top : parent.top - anchors.topMargin: -20 - anchors.left: parent.left - anchors.leftMargin: 5 + DebugDataColumn { id: _DDSpareValvesColumn + textObjectName :"_DDSpareValvesColumn" + title : qsTr(" Spare Valves ") + anchors { + top : _DDHeatersColumn.bottom + topMargin : spacing + left : _DDHeatersColumn.left + } + model: [ + Number(vDDValvesStates.spareValve0 ) , + Number(vDDValvesStates.spareValve1 ) , + Number(vDDValvesStates.spareValve2 ) , + Number(vDDValvesStates.spareValve3 ) , + Number(vDDValvesStates.spareValve4 ) , + Number(vDDValvesStates.spareValve5 ) , + Number(vDDValvesStates.spareValve6 ) , + Number(vDDValvesStates.spareValve7 ) , + ] + label: [ + "D79 ", + "D82 ", + "D91 ", + "Spare Valve 3 ", + "Spare Valve 4 ", + "Spare Valve 5 ", + "D100 ", + "Spare Valve 7 ", + ] + } - spacing: -30 + DebugDataColumn { id: _DDFPValvesColumn + textObjectName :"_DDFPValvesColumn" + title : qsTr(" FP Valves ") + anchors { + top : _DDLevelColumn.bottom + topMargin : spacing + left : _DDPressureColumn.left + } + model: [ + Number(vDDValvesStates.fpValve0) , + Number(vDDValvesStates.fpValve1) , + Number(vDDValvesStates.fpValve2) , + Number(vDDValvesStates.fpValve3) , + Number(vDDValvesStates.fpValve4) , + Number(vDDValvesStates.fpValve5) , + ] + label: [ + "P11 ", + "P33 ", + "P34 ", + "P37 ", + "P39 ", + "P6 ", + ] + } + DebugDataColumn { id: _DDBloodLeakColumn + textObjectName :"_DDBloodLeakData" + title : qsTr(" Blood Leak ") + anchors { + top : _DDConcentratePumpColumn.bottom + topMargin : spacing + left : parent.left + } + model: [ + vDDBloodLeak.bloodLeak , + ] + label: [ + "BL ", + ] + } + + // TODO: The TouchRect should be unnecessary since the first communication message with UI/TD is the version. + TouchRect { + width : _DDVersionsColumn.width + height : _DDVersionsColumn.height + onClicked : vAdjustmentVersions.doAdjustment() + radius : 5 + anchors { + bottom : parent.bottom + right : parent.right + } + DebugDataColumn { id: _DDVersionsColumn textObjectName :"_DDVersionsData" title : "" horizontalAlignmentText: Text.AlignLeft fontPixelSizeText: Fonts.fontPixelDebugTitle + isTouchRect : true model: [ "DD: v%1.%2.%3-%4 v%5.%6.%7-%8 c%9\nDD Serial#: %10" .arg(vAdjustmentVersions.ddVerMajor ) .arg(vAdjustmentVersions.ddVerMinor ) @@ -453,7 +557,6 @@ } } - Connections { target: _GuiView function onDidActionReceive( vAction, vData ) { // DEBUG: console.debug("onDidActionReceive", vAction, vData) Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsTD.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/dialogs/diagnostics/DiagnosticsTD.qml (.../DiagnosticsTD.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsTD.qml (.../DiagnosticsTD.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -21,318 +21,355 @@ // Qml imports import "qrc:/globals" import "qrc:/components" -import "qrc:/compounds" /*! * \brief the post treatment prime stack screen */ DiagnosticsBase { id: _root objectName: "_DiagnosticsTD" - title: "Treatment Delivery & Blood Handling" + contentItem : Item { id: _content - DebugDataColumn { id: _TDBloodFlowColumn - textObjectName :"_TDBloodFlowData" - title : qsTr(" BP(H4)") - x: col(0) - y: row(0) - model: [ - vTreatmentBloodFlow.setFlowRate , - vTreatmentBloodFlow.measFlow .toFixed(2) , - vTreatmentBloodFlow.measRotorSpd .toFixed(2) , - vTreatmentBloodFlow.measPumpSpd .toFixed(2) , - vTreatmentBloodFlow.measCurr .toFixed(2) , - vTreatmentBloodFlow.setRPM .toFixed(2) , - vTreatmentBloodFlow.rotorCount , - vTreatmentBloodFlow.presFlow , - vTreatmentBloodFlow.rotorHallState , + DebugDataColumn { id: _TDBloodFlowColumn + textObjectName :"_TDBloodFlowData" + title : qsTr(" BP(H4)") + anchors { + top : parent.top + left : parent.left + } - ] - label: [ - "sFLow (H4) ", - "mFlow (H4) ", - "rSpd (H4) ", - "mSpd (H4) ", - "mCurr (H4) ", - "RPM (H4) ", - "rCnt (H4) ", - "pFlow (H4) ", - "rHall (H6) ", - ] - } + model: [ + vTreatmentBloodFlow.setFlowRate , + vTreatmentBloodFlow.measFlow .toFixed(2) , + vTreatmentBloodFlow.measRotorSpd .toFixed(2) , + vTreatmentBloodFlow.measPumpSpd .toFixed(2) , + vTreatmentBloodFlow.measCurr .toFixed(2) , + vTreatmentBloodFlow.setRPM .toFixed(2) , + vTreatmentBloodFlow.rotorCount , + vTreatmentBloodFlow.presFlow , + vTreatmentBloodFlow.rotorHallState , - DebugDataColumn { id: _TDAirTrapCoulumn - textObjectName :"_TDAirTrapData" - title : qsTr(" Air Trap ") - x: col(1.5) - y: row(0) - model: [ - vTDAirTrap.lowLevel , - vTDAirTrap.upLevel , - vTDAirTrap.lowLevelRaw , - vTDAirTrap.upLevelRaw , - vTDAirTrap.valveIntakeState , - vTDAirTrap.valveOutletState , - vTDAirTrap.controlling , - ] - label: [ - "ATL (H17)", - "ATH (H16)", - "rARL (H17)", - "rATH (H16)", - "IState (H13)", - "OState (H20)", - "ctrl ", - ] - } + ] + label: [ + "sFLow (H4) ", + "mFlow (H4) ", + "rSpd (H4) ", + "mSpd (H4) ", + "mCurr (H4) ", + "RPM (H4) ", + "rCnt (H4) ", + "pFlow (H4) ", + "rHall (H6) ", + ] + } - DebugDataColumn { id: _TDAirPumpColumn - textObjectName :"_TDAirPumpData" - title : qsTr(" Air Pumps ") - x: col(3) - y: row(0) - model: [ - vTDAirPump.airPumpState , - vTDAirPump.airPumpPower , + DebugDataColumn { id: _TDAirTrapCoulumn + textObjectName :"_TDAirTrapData" + title : qsTr(" Air Trap ") + anchors { + top : parent.top + left : _TDPressureOcclusionColumn.right + leftMargin : spacing + } - ] - label: [ - "state (H12) ", - "power (H12) ", - ] - } + model: [ + vTDAirTrap.lowLevel , + vTDAirTrap.upLevel , + vTDAirTrap.lowLevelRaw , + vTDAirTrap.upLevelRaw , + vTDAirTrap.valveIntakeState , + vTDAirTrap.valveOutletState , + vTDAirTrap.controlling , + ] + label: [ + "ATL (H17)", + "ATH (H16)", + "rARL (H17)", + "rATH (H16)", + "IState (H13)", + "OState (H20)", + "ctrl ", + ] + } - DebugDataColumn { id: _TDAirBubblesColumn - textObjectName :"_TDAirBubblesData" - title : qsTr(" Bubbles ") - x: col(3) - y: row(1.5) - model: [ - vTDAirBubble.venousAirBubbleStatus , - vTDAirBubble.venousAirBubbleState , + DebugDataColumn { id: _TDAirPumpColumn + textObjectName :"_TDAirPumpData" + title : qsTr(" Air Pumps ") + anchors { + top : _TDAirTrapCoulumn.bottom + topMargin : spacing + left : _TDAirTrapCoulumn.left + } - ] - label: [ - "status (H18) ", - "state (H18) ", - ] - } + model: [ + vTDAirPump.airPumpState , + vTDAirPump.airPumpPower , - DebugDataColumn { id: _TDValvesColumn - textObjectName :"_TDValvesData" - title : qsTr(" Valves ") - x: col(4.5) - y: row(0) - model: [ - vTDValves.valveId , - vTDValves.state , - vTDValves.posName , - vTDValves.posCount , - vTDValves.nextPos , + ] + label: [ + "state (H12) ", + "power (H12) ", + ] + } - ] - label: [ - "ID ", - "state ", - "Name ", - "Cnt ", - "nPos ", - ] - } + DebugDataColumn { id: _TDAirBubblesColumn + textObjectName :"_TDAirBubblesData" + title : qsTr(" Bubbles ") + anchors { + top : _TDPressureOcclusionColumn.bottom + topMargin : spacing + left : _TDPressureOcclusionColumn.left + } - DebugDataColumn { id: _TDEjectorColumn - textObjectName :"_TDEjectorData" - title : qsTr(" Ejector ") - x: col(6) - y: row(0) - model: [ - vTDEjector.state , - vTDEjector.setSpeed .toFixed(2) , + model: [ + vTDAirBubble.venousAirBubbleStatus , + vTDAirBubble.venousAirBubbleState , - ] - label: [ - "State (H5) ", - "Spd (H5) " , - ] - } + ] + label: [ + "status (H18) ", + "state (H18) ", + ] + } - DebugDataColumn { id: _TDSwitchesColumn - textObjectName :"_TDSwitchesData" - title : qsTr(" Switches ") - x: col(7.5) - y: row(0) - model: [ - vTDSwitches.door , + DebugDataColumn { id: _TDValvesColumn + textObjectName :"_TDValvesData" + title : qsTr(" Valves ") + anchors { + top : parent.top + left : _TDAirTrapCoulumn.right + leftMargin : spacing + } + model: [ + vTDValves.valveId , + vTDValves.state , + vTDValves.posName , + vTDValves.posCount , + vTDValves.nextPos , - ] - label: [ - "door (H9) ", - ] - } + ] + label: [ + "ID ", + "state ", + "Name ", + "Cnt ", + "nPos ", + ] + } - DebugDataColumn { id: _TDTXStatesColumn - textObjectName :"_TDTxStatesData" - title : qsTr(" TXStates ") - x: col(0) - y: row(3.5) - model: [ - Number(vTDTreatmentStates.subMode ), - Number(vTDTreatmentStates.txBloodPrime ), - Number(vTDTreatmentStates.txDialysis ), - Number(vTDTreatmentStates.ufState ), - Number(vTDTreatmentStates.txStop ), - Number(vTDTreatmentStates.txRinseback ), - Number(vTDTreatmentStates.txRecirculate ), - Number(vTDTreatmentStates.txEnd ), - Number(vTDTreatmentStates.salineState ), - Number(vTDTreatmentStates.heparin ), - ] - label: [ - "subMode " , - "BPrime " , - "Dial " , - "UF " , - "Stop " , - "RB " , - "Recirc " , - "End " , - "Saline " , - "Hep " , - ] - } + DebugDataColumn { id: _TDEjectorColumn + textObjectName :"_TDEjectorData" + title : qsTr(" Ejector ") + anchors { + top : parent.top + left : _TDValvesColumn.right + leftMargin : spacing + } + model: [ + vTDEjector.state , + vTDEjector.setSpeed .toFixed(2) , - DebugDataColumn { id: _TDOpModeColumn - textObjectName :"_TDOpmodeData" - title : qsTr(" Opmode ") - x: col(0) - y: row(7) - model: [ - vTDOpMode.opMode , - vTDOpMode.subMode - ] - label: [ - "opMode " , - "subMode " - ] - } + ] + label: [ + "State (H5) ", + "Spd (H5) " , + ] + } - DebugDataColumn { id: _TDVoltageCoulumn - textObjectName :"_TDVoltageData" - title : qsTr(" Volume ") - x: col(1.5) - y: row(3.5) - model: [ - vTDVoltage.line_1_2V .toFixed(2) , - vTDVoltage.line_3_3V .toFixed(2) , - vTDVoltage.logic5V .toFixed(2) , - vTDVoltage.sensors5V .toFixed(2) , - vTDVoltage.line_24V .toFixed(2) , - vTDVoltage.regen24V .toFixed(2) , - vTDVoltage.fpgaAdcRef .toFixed(2) , - vTDVoltage.presRef .toFixed(2) , - vTDVoltage.fpgaVcc .toFixed(2) , - vTDVoltage.fpgaVaux .toFixed(2) , - vTDVoltage.fpgaVpvn .toFixed(2) - ] - label: [ - "1.2V" , - "3.3V" , - "L5V" , - "S5V" , - "24V" , - "R24V" , - "ADC" , - "Ref" , - "VCC" , - "Vaux" , - "VPN" , - ] - } + DebugDataColumn { id: _TDSwitchesColumn + textObjectName :"_TDSwitchesData" + title : qsTr(" Switches ") + anchors { + top : _TDVoltageCoulumn.bottom + topMargin : spacing + left : parent.left + } + model: [ + vTDSwitches.door , + ] + label: [ + "door (H9) ", + ] + } - DebugDataColumn { id: _TDPressureOcclusionCoulumn - textObjectName :"_TDPressureData" - title : qsTr(" Pressure ") - x: col(3) - y: row(3.5) - model: [ - vTreatmentPressureOcclusion.arterialPressure .toFixed(2), - vTreatmentPressureOcclusion.venousPressure , - vTreatmentPressureOcclusion.limitState , - vTreatmentPressureOcclusion.arterialMin , - vTreatmentPressureOcclusion.arterialMax , - vTreatmentPressureOcclusion.venousMin , - vTreatmentPressureOcclusion.venousMax , - vTreatmentPressureOcclusion.arterialLongFilter .toFixed(2), - vTreatmentPressureOcclusion.venousLongFilter .toFixed(2), - vTreatmentPressureOcclusion.tmpPressure .toFixed(2), - vTreatmentPressureOcclusion.tmpMin .toFixed(2), - vTreatmentPressureOcclusion.tmpMax .toFixed(2) - ] - label: [ - "Arterial (H12) " , - "Venous (H14) " , - "limit " , - "artMin (H12) " , - "artMax (H12) " , - "venMin (H14) " , - "venMax (H14) " , - "aLong (H12) " , - "vLong (H14) " , - "TMP " , - "tmpMin " , - "tmpMax " , - ] - } + DebugDataColumn { id: _TDOpModeColumn + textObjectName :"_TDOpmodeData" + title : qsTr(" Opmode ") + anchors { + top : parent.top + left : _TDEjectorColumn.right + leftMargin : spacing + } + model: [ + vTDOpMode.opMode , + vTDOpMode.subMode + ] + label: [ + "opMode " , + "subMode " + ] + } - DebugDataColumn { id: _TDTemperatureCoulumn - textObjectName :"_TDTemperatureData" - title : qsTr(" Temp ") - x: col(4.5) - y: row(3.5) - model: [ - vTDTemperature.boardTemp .toFixed(2) - ] - label: [ - "board", - ] - } + DebugDataColumn { id: _TDTXStatesColumn + textObjectName :"_TDTxStatesData" + title : qsTr(" TXStates ") - DebugDataColumn { id: _TDBatteryCoulumn - textObjectName :"_TDBatteryData" - title : qsTr(" Battery ") - x: col(6) - y: row(3.5) - model: [ - vTDBattery.acPower , - vTDBattery.capacity , - ] - label: [ - "AC ", - "cap ", - ] - } + anchors { + top : _TDOpModeColumn.bottom + topMargin : spacing + left : _TDOpModeColumn.left + } + model: [ + Number(vTDTreatmentStates.subMode ), + Number(vTDTreatmentStates.txBloodPrime ), + Number(vTDTreatmentStates.txDialysis ), + Number(vTDTreatmentStates.ufState ), + Number(vTDTreatmentStates.txStop ), + Number(vTDTreatmentStates.txRinseback ), + Number(vTDTreatmentStates.txRecirculate ), + Number(vTDTreatmentStates.txEnd ), + Number(vTDTreatmentStates.salineState ), + Number(vTDTreatmentStates.heparin ), + ] + label: [ + "subMode " , + "BPrime " , + "Dial " , + "UF " , + "Stop " , + "RB " , + "Recirc " , + "End " , + "Saline " , + "Hep " , + ] + } - // TODO: The TouchRect should be unnecessary since the first communication message with UI/TD is the version. - TouchRect { - x : col(9.0) - y : row(8.0) - width : 425 - height : 80 - onClicked : vAdjustmentVersions.doAdjustment() - radius : 10 - Column { - anchors.top : parent.top - anchors.topMargin: -20 - anchors.left: parent.left - anchors.leftMargin: 5 + DebugDataColumn { id: _TDVoltageCoulumn + textObjectName :"_TDVoltageData" + title : qsTr(" Volume ") + anchors { + top : _TDBloodFlowColumn.bottom + topMargin : spacing + } - spacing: -30 + model: [ + vTDVoltage.line_1_2V .toFixed(2) , + vTDVoltage.line_3_3V .toFixed(2) , + vTDVoltage.logic5V .toFixed(2) , + vTDVoltage.sensors5V .toFixed(2) , + vTDVoltage.line_24V .toFixed(2) , + vTDVoltage.regen24V .toFixed(2) , + vTDVoltage.fpgaAdcRef .toFixed(2) , + vTDVoltage.presRef .toFixed(2) , + vTDVoltage.fpgaVcc .toFixed(2) , + vTDVoltage.fpgaVaux .toFixed(2) , + vTDVoltage.fpgaVpvn .toFixed(2) + ] + label: [ + "1.2V" , + "3.3V" , + "L5V" , + "S5V" , + "24V" , + "R24V" , + "ADC" , + "Ref" , + "VCC" , + "Vaux" , + "VPN" , + ] + } + + DebugDataColumn { id: _TDPressureOcclusionColumn + textObjectName :"_TDPressureData" + title : qsTr(" Pressure ") + + anchors { + top : parent.top + left : _TDBloodFlowColumn.right + leftMargin : spacing + } + model: [ + vTreatmentPressureOcclusion.arterialPressure .toFixed(2), + vTreatmentPressureOcclusion.venousPressure , + vTreatmentPressureOcclusion.limitState , + vTreatmentPressureOcclusion.arterialMin , + vTreatmentPressureOcclusion.arterialMax , + vTreatmentPressureOcclusion.venousMin , + vTreatmentPressureOcclusion.venousMax , + vTreatmentPressureOcclusion.arterialLongFilter .toFixed(2), + vTreatmentPressureOcclusion.venousLongFilter .toFixed(2), + vTreatmentPressureOcclusion.tmpPressure .toFixed(2), + vTreatmentPressureOcclusion.tmpMin .toFixed(2), + vTreatmentPressureOcclusion.tmpMax .toFixed(2) + ] + label: [ + "Arterial (H12) " , + "Venous (H14) " , + "limit " , + "artMin (H12) " , + "artMax (H12) " , + "venMin (H14) " , + "venMax (H14) " , + "aLong (H12) " , + "vLong (H14) " , + "TMP " , + "tmpMin " , + "tmpMax " , + ] + } + + DebugDataColumn { id: _TDTemperatureCoulumn + textObjectName :"_TDTemperatureData" + title : qsTr(" Temp ") + anchors { + top : _TDValvesColumn.bottom + topMargin : spacing + left : _TDValvesColumn.left + } + model: [ + vTDTemperature.boardTemp .toFixed(2) + ] + label: [ + "board", + ] + } + + DebugDataColumn { id: _TDBatteryCoulumn + textObjectName :"_TDBatteryData" + title : qsTr(" Battery ") + anchors { + top : _TDEjectorColumn.bottom + topMargin : spacing + left : _TDEjectorColumn.left + } + model: [ + vTDBattery.acPower , + vTDBattery.capacity , + ] + label: [ + "AC ", + "cap ", + ] + } + + // // TODO: The TouchRect should be unnecessary since the first communication message with UI/TD is the version. + TouchRect { + width : _TDVersionsColumn.width + height : _TDVersionsColumn.height + onClicked : vAdjustmentVersions.doAdjustment() + radius : 5 + anchors { + bottom : parent.bottom + right : parent.right + } DebugDataColumn { id: _TDVersionsColumn - textObjectName :"_TDVersionsData" - title : "" - horizontalAlignmentText: Text.AlignLeft - fontPixelSizeText: Fonts.fontPixelDebugTitle + textObjectName :"_TDVersionsData" + horizontalAlignmentText : Text.AlignLeft + fontPixelSizeText : Fonts.fontPixelDebugTitle + isTouchRect : true model: [ "TD: v%1.%2.%3-%4 v%5.%6.%7-%8 c%9\nTD Serial#: %10" .arg(vAdjustmentVersions.tdVerMajor ) .arg(vAdjustmentVersions.tdVerMinor ) @@ -349,7 +386,6 @@ } } - Connections { target: _GuiView function onDidActionReceive( vAction, vData ) { // DEBUG: console.debug("onDidActionReceive", vAction, vData) Index: sources/gui/qml/dialogs/headerbar/HeaderbarInformation.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/dialogs/headerbar/HeaderbarInformation.qml (.../HeaderbarInformation.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/dialogs/headerbar/HeaderbarInformation.qml (.../HeaderbarInformation.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -1,5 +1,6 @@ import QtQuick 2.12 +import "qrc:/" import "qrc:/components" import "qrc:/globals" @@ -48,7 +49,7 @@ anchors.verticalCenter: parent.verticalCenter Text { id: _name - color : "#2E5E92" + color : Colors.dialogText text : modelData.name width : leftColumnWidth font.pixelSize : Fonts.fontPixelDialogText @@ -77,6 +78,11 @@ } } + SDCInfo { id: _sdCardInfo + width : parent.width + height : 75 + } + Row { id: _qrRow spacing : Variables.defaultMargin anchors.left : parent.left @@ -87,7 +93,7 @@ Text { id: _qrCodeInstructions anchors.bottom : _qrCode.bottom - text : qsTr("Scan for electronic instructions for use (eIFU)" ) + text : qsTr("Customer Service Number: %1\nScan for electronic instructions for use (eIFU)").arg("(123) 456-7890") color : Colors.dialogText font.pixelSize : Fonts.fontPixelDialogText } Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -30,21 +30,21 @@ readonly property color red : "#c53b33" // red readonly property color white : "white" // white readonly property color transparent : "Transparent" // No Color + readonly property color offWhite : "#FEFEFE" readonly property color separatorLine : "#5f809d" readonly property color backgroundMain : "#1A344D" //// ----- @LEAHIZED readonly property color backgroundButtonNormal : transparent readonly property color backgroundButtonSelect : "#438FEB" readonly property color backgroundButtonSelectDark : "#135088" // "#214773" - readonly property color backgroundDialog : "#254670" + readonly property color backgroundDialog : "#1B3F66" readonly property color backgroundMenu : "#14314C" readonly property color backgroundMainMenu : "#0F2841" //// ----- @LEAHIZED readonly property color backgroundDottedMenu : "#64809D" readonly property color backgroundSlider : "#195187" readonly property color treatmentSectionHeader : "#1A2E42" readonly property color treatmentSectionMain : "#1A3046" readonly property color mainTreatmentLighterBlue : "#1F3D5A" - readonly property color mainTreatmentDarkerBlue : "#142C49" readonly property color mainTreatmentOrange : "#FFB836" readonly property color mainTreatmentIsoBlue : "#C3F9FF" readonly property color mainTreatmentGreen : "#BBFFA3" @@ -54,19 +54,20 @@ readonly property color backgroundUltrafiltrationButton : "#31568F" readonly property color textValueUltrafiltrationButtonFg: "#98aec2" - readonly property color dialogText : "#343434" + readonly property color dialogText : "#2E5E92" readonly property color alarmDialogText : "#343434" readonly property color alarmDialogGreyText : "#838080" - readonly property color alarmDialog : "#FEFEFE" - readonly property color dialogShadowColor : "#334E759C" - readonly property color dialogValueColor : "#3D8EEF" + readonly property color dialogShadowColor : "#EAE9E9" + readonly property color dialogValueColor : "#385E92" + readonly property color darkDialogColor : "#091E31" - readonly property color backgroundRangeRect : "#3e546e" + readonly property color backgroundRangeRect : "#2E4F76" readonly property color highlightProgressBar : "#3d8eef" readonly property color highlightMedProgressBar : "#1b2b3e" readonly property color textProgressBar : "#88a3c5" readonly property color progressBarSaline : "#73D8DF" readonly property color progressBarUltrafiltration : "#67ACFF" + readonly property color comboBoxDisplay : "#B31B2B3E" readonly property color textRangeMarker : white readonly property color rangeMarker : white @@ -88,13 +89,23 @@ readonly property color buttonDisableColor : "#515050" readonly property color pauseColor : "#9B864E" + readonly property color panelBackgroundColor : "#12FFFFFF" + readonly property color panelBorderColor : "#4DB5B5B5" + readonly property color panelInvalidBorderColor : "#FFA500" + readonly property color heparinPanelBorderColor         : "#CC42556B" + readonly property color heparinSectionHeader            : "#384B60" + readonly property color heparinActive                   : "#429C4A" + readonly property color heparinPaused                   : "#D9A23D" + readonly property color heparinComplete                 : "#276FCD" + readonly property color touchTextAreaTitle : "#a0b6d0" readonly property color textTextRectTitle : white readonly property color textTextRectLabel : "#e8e8e8" readonly property color textTextRectExtra : "#708795" readonly property color line : "#094266" + readonly property color checkListLine : "#345477" readonly property color pressuresText : white readonly property color pressuresArterialBar : "#FF8282" @@ -132,6 +143,7 @@ readonly property color alarmTopBarNoneFg : white readonly property color createTrProfileID : "#ffbb44" + readonly property color dropShadowDialogColor : "#4DFFF8E1" readonly property color createTreatmentActive : "#3d8eef" readonly property color createTreatmentInactive : backgroundRangeRect @@ -142,7 +154,19 @@ readonly property color createTreatmentInvalidParam : red readonly property color scrollBarBgColor : white //"#80696969" // half transparent dimgray + readonly property color scrollBarColor : "#6992BC" + readonly property color ufVolumeGoalText : "#f5be59" + readonly property color ufNotificationBarBg : "#0f2841" + readonly property color ufProgressBarFill : "#2083FA" + readonly property color ufAdjustmentDeltaFill : "#747974" + readonly property color ufAdjustmentProgressBarBg : "#2C517D" + readonly property color progressBarMinMax : "#c7c7c7" + + readonly property color roFeatured : "#E79DF6" + readonly property color roDefeatured : "#F9CD74" + readonly property color waterSampleContainer : "#2A425A" + // ---------- < PRS > Related Section ---------- // Alarm priority colors function alarmPriorityColors(vPriority) { Index: sources/gui/qml/pages/settings/SettingsDeviceRegistration.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/settings/SettingsDeviceRegistration.qml (.../SettingsDeviceRegistration.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/settings/SettingsDeviceRegistration.qml (.../SettingsDeviceRegistration.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -39,7 +39,7 @@ readonly property int spacing : 20 readonly property int leftMargin : 100 readonly property int rightMargin : 150 - readonly property int topMargin : topMarginContent + readonly property int topMargin : 200 readonly property int separatorGap : 40 readonly property string separatorText : ":" @@ -52,11 +52,9 @@ if ( visible ) vAdjustmentVersions .doAdjustment() } - Column { id : _column + contentItem: Column { id : _column spacing : _root.spacing - y : _root.topMargin - anchors.left : parent.left - anchors.leftMargin : _root.leftMargin + anchors.fill: parent TextEntry { id : _version_UI textInput.clip : true @@ -68,6 +66,7 @@ separator.width : _root.separatorGap textInput.width : _root.entryWidth label.width : _root.labelWidth + anchors.horizontalCenter: parent.horizontalCenter } TextEntry { id : _serial_TD @@ -80,6 +79,7 @@ separator.width : _root.separatorGap textInput.width : _root.entryWidth label.width : _root.labelWidth + anchors.horizontalCenter: parent.horizontalCenter } TextEntry { id : _serial_DD @@ -92,6 +92,7 @@ separator.width : _root.separatorGap textInput.width : _root.entryWidth label.width : _root.labelWidth + anchors.horizontalCenter: parent.horizontalCenter } TextEntry { id : _ipAddress_wlan0 @@ -105,6 +106,7 @@ textInput.width : _root.entryWidth label.width : _root.labelWidth validator : _root.ipValidator + anchors.horizontalCenter: parent.horizontalCenter } TextEntry { id : _ipAddress_eth0 @@ -118,6 +120,7 @@ textInput.width : _root.entryWidth label.width : _root.labelWidth validator : _root.ipValidator + anchors.horizontalCenter: parent.horizontalCenter } } Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -38,6 +38,7 @@ stackView.initialItem : _settingsHome property bool serviceMode : false + property int currentItem : -1 readonly property bool normalMode : ! ( _GuiView.manufactSetup || _GuiView.updateSetup ) readonly property bool setupMode : _GuiView.manufactSetup || _GuiView.updateSetup @@ -53,7 +54,6 @@ readonly property bool visibleInformation : true readonly property bool visibleVolumeBrightness : ! onlyUpdating // same as service password, on application execution in updating, on mount files will be moved. readonly property bool visibleWiFi : true - readonly property bool visibleBluetooth : true readonly property bool visibleExportLogs : true // during the update we cannot enable the servce menu since the current set password is in ~denali folder @@ -63,84 +63,72 @@ readonly property bool visibleServicePassword : ( normalMode && ! loggedIn ) // || ( onlyUpdating && ! loggedIn ) readonly property bool visibleDGCleaning : normalMode readonly property bool visibleRoInput : normalMode - readonly property bool visibleRootSSHAccess : loggedIn - readonly property bool visibleFactoryReset : loggedIn - readonly property bool visibleDecommission : loggedIn - readonly property bool visibleSetDateTime : loggedIn || onlyUpdating - readonly property bool visibleDeviceConfiguration : onlyManufacturing && loggedIn - readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn + readonly property bool visibleRootSSHAccess : loggedIn + readonly property bool visibleFactoryReset : loggedIn + readonly property bool visibleDecommission : false // TODO: Not Yet Defined + readonly property bool visibleSetDateTime : loggedIn || onlyUpdating + readonly property bool visibleDeviceConfiguration : onlyManufacturing && loggedIn + readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn readonly property bool visibleInstitutionalRecord : true - readonly property bool visibleLocalization : true // loggedIn TODO: + readonly property bool visibleFeatureConfigurations : loggedIn + readonly property bool visibleAdvancedInstitutional : loggedIn + readonly property bool visibleLocalization : loggedIn + readonly property bool visibleAdvancedModes : loggedIn + readonly property string settingsTitle : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : _GuiView.updateSetup + ? qsTr("Software Update") : qsTr("Device Settings") enum ItemsIndex { - Information , - VolumeBrightness , - WiFi , - Bluetooth , - DGCleaning , - DGScheduling , - ServicePassword , - SetDateTime , - ExportLogs , - Localization , - RoInput , - Calibration , - DeviceConfiguration , - DeviceRegistration , - SWUpdate , - RootSSHAccess , - FactoryReset , - Decommission , - InstitutionalRecord + Information , + VolumeBrightness , + WiFi , + DGCleaning , + DGScheduling , + ServicePassword , + SetDateTime , + ExportLogs , + Localization , + RoInput , + Calibration , + DeviceConfiguration , + DeviceRegistration , + SWUpdate , + RootSSHAccess , + FactoryReset , + Decommission , + InstitutionalRecord , + AdvancedInstitutional , + FeatureConfigurations , + AdvancedMode } property var itemsText : [ - qsTr("Information" ), // Information - qsTr("Volume And Brightness" ), // VolumeBrightness - qsTr("Wi-Fi" ), // WiFi - qsTr("Bluetooth Cuff" ), // Bluetooth - qsTr("DG Cleaning" ), // DGCleaning - qsTr("DG Scheduling" ), // DGScheduling - qsTr("Service" ), // servicePassword - qsTr("Date and Time" ), // SetDateTime - qsTr("Export Logs" ), // ExportLogs - qsTr("Language" ), // Localization - qsTr("Water Input Mode" ), // RoInput - qsTr("Calibration" ), // Calibration - qsTr("Device Configuration" ), // Device Configuration - qsTr("Device Registration" ), // DeviceRegistration - qsTr("Software Update" ), // SWUpdate - qsTr("Enable Root SSH" ), // RootSSHAccess - qsTr("Factory Reset" ), // FactoryReset - qsTr("Decommissioning" ), // Decommission - qsTr("Institutional Configurations" ), // Institutional Configurations + qsTr("Device Information" ), // Device Information + qsTr("Volume And Brightness" ), // VolumeBrightness + qsTr("Wi-Fi" ), // WiFi + qsTr("Device Cleaning" ), // DGCleaning + qsTr("DG Scheduling" ), // DGScheduling + qsTr("Service" ), // servicePassword + qsTr("Date and Time" ), // SetDateTime + qsTr("Export Logs" ), // ExportLogs + qsTr("Language" ), // Localization + qsTr("Water Input Mode" ), // RoInput + qsTr("Calibration" ), // Calibration + qsTr("Device Configuration" ), // Device Configuration + qsTr("Device Registration" ), // DeviceRegistration + qsTr("Software Update" ), // SWUpdate + qsTr("Enable Root SSH" ), // RootSSHAccess + qsTr("Factory Reset" ), // FactoryReset + qsTr("Decommissioning" ), // Decommission + qsTr("Institutional Configurations" ), // Institutional Configurations + qsTr("Advanced Institutional Settings" ), // AdvancedInstitutional + qsTr("Feature Configurations" ), // FeatureConfigurations + qsTr("Advanced Mode" ), // Advanced Modes ] - property var itemsEnabled : [ - true , // Information - true , // VolumeBrightness - true , // WiFi - true , // Bluetooth - true , // DGCleaning - true , // DGScheduling - true , // ServicePassword - true , // SetDateTime - true , // ExportLogs - true , // Localization - true , // RoInput - true , // Calibration - true , // Device Configuration - true , // DeviceRegistration - true , // SWUpdate - true , // RootSSHAccess - true , // FactoryReset - true , // Decommission - true , // Institutional Record - ] + property var itemsVisible : [ visibleInformation , // Information visibleVolumeBrightness , // VolumeBrightness visibleWiFi , // WiFi - visibleBluetooth , // Bluetooth visibleDGCleaning , // DGCleaning visibleDGScheduling , // DGScheduling visibleServicePassword , // ServicePassword @@ -156,10 +144,15 @@ visibleFactoryReset , // FactoryReset visibleDecommission , // Decommission visibleInstitutionalRecord , // Institutional Record + visibleAdvancedInstitutional , // AdvancedInstitutional + visibleFeatureConfigurations , // FeatureConfigurations + visibleAdvancedModes , // Advanced Modes ] + // TODO: SRS 405/406 Test Mode instead add Q_PROPERTY to monitor state??? + onServiceModeChanged: _headerBar.loggedUser = serviceMode ? "[Service]" : "" + SettingsHome { id : _settingsHome - title : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : serviceMode ? qsTr("Service") : _GuiView.updateSetup ? qsTr("Software Update") : qsTr("Device Settings") backVisible : false //TODO on graceful shutdown, the applicaiton quit shall be used for any applicaiton termination // and needs to be distinguished between the QUIT or SHUTDOWN touch, @@ -175,10 +168,11 @@ } } itemsText : _root.itemsText - itemsEnabled : _root.itemsEnabled itemsVisible : _root.itemsVisible onItemClicked : { + _root.currentItem = vIndex vDevice.status = "" + _headerBar.titleText = itemsText[vIndex] switch (vIndex) { case SettingsStack.Information: vAdjustmentVersions .doAdjustment() @@ -197,10 +191,6 @@ push( _settingsWiFi ) break - case SettingsStack.Bluetooth: - push( _settingsBluetooth ) - break - case SettingsStack.DGCleaning: push( _settingsDGCleaning ) break @@ -250,48 +240,60 @@ break case SettingsStack.InstitutionalRecord: - vAdjustmentInstitutionalRecord.doAdjustment() + vInstitutionalRecord.doAdjustment() push( _settingsInstitutionalRecord ) break + case SettingsStack.AdvancedInstitutional: + vAdvancedInstitutionalRecord.doAdjustment() + push( _settingsAdvancedInstitutional ) + break + + case SettingsStack.FeatureConfigurations: + push( _settingsFeatureConfigurations ) + break + case SettingsStack.Localization: push( _settingLocalization ) break + case SettingsStack.AdvancedMode: + push( _settingAdvancedMode ) + break + default: console.debug("Unknown Index", vIndex) break } } } - SettingsInformation { id: _settingsInformation } - SettingsVolumeBrightness { id: _settingsVolumeBrightness } - SettingsWiFi { id: _settingsWiFi } - SettingsBluetoothCuff { id: _settingsBluetooth } - SettingsDGCleaning { id: _settingsDGCleaning } - SettingsDGScheduling { id: _settingsDGScheduling } - SettingsServicePassword { id: _servicePassword } - SettingsDateTime { id: _settingsDateTime } - SettingsExportLogs { id: _settingsExportLogs } - SettingsROInput { id: _settingsRoInput } - SettingsManufacturingSetup { id: _settingsDeviceConfiguration } - SettingsDeviceRegistration { id: _settingsDeviceRegistration } - SettingsRootSSHAccess { id: _SettingsRootSSHAccess } - SettingsFactoryReset { id: _serviceFactoryReset } - SettingsDecommission { id: _serviceDecommission } - SettingsInstitutionalRecord { id: _settingsInstitutionalRecord } - SettingsLocalization { id: _settingLocalization } + SettingsInformation { id: _settingsInformation } + SettingsVolumeBrightness { id: _settingsVolumeBrightness } + SettingsWiFi { id: _settingsWiFi } + SettingsDGCleaning { id: _settingsDGCleaning } + SettingsDGScheduling { id: _settingsDGScheduling } + SettingsServicePassword { id: _servicePassword } + SettingsDateTime { id: _settingsDateTime } + SettingsExportLogs { id: _settingsExportLogs } + SettingsROInput { id: _settingsRoInput } + SettingsManufacturingSetup { id: _settingsDeviceConfiguration } + SettingsDeviceRegistration { id: _settingsDeviceRegistration } + SettingsRootSSHAccess { id: _SettingsRootSSHAccess } + SettingsFactoryReset { id: _serviceFactoryReset } + SettingsDecommission { id: _serviceDecommission } + SettingsInstitutionalRecord { id: _settingsInstitutionalRecord } + SettingsAdvancedInstitutional { id: _settingsAdvancedInstitutional} + SettingsLocalization { id: _settingLocalization } + SettingsFeatureConfigurations { id: _settingsFeatureConfigurations} + SettingsAdvancedMode { id: _settingAdvancedMode } function gotoServiceMode( vservice ) { //DEBUG console.log (" 0 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vservice, stackView.initialItem, stackView.currentItem, stackView.depth) if ( ! _servicePassword.isPassword_Accepted ) return serviceMode = vservice - if ( vservice ) - _mainMenu.hidden = true - else - if ( _settingsHome.visible ) - _mainMenu.hidden = false + if ( _settingsHome.visible ) + _mainMenu.hidden = false } Connections { target: vAdjustmentServiceMode @@ -305,17 +307,6 @@ } } - Connections { target: vAdjustmentInstitutionalRecord - function onAdjustmentTriggered ( vValue ) { - if ( vAdjustmentInstitutionalRecord.adjustment_Accepted ) { - _settingsHome.notificationText = "" - } - else { - _settingsHome.notificationText = vAdjustmentInstitutionalRecord.text() - } - } - } - Connections { target: vTDOpMode function onServiceChanged ( vValue ) { gotoServiceMode( vValue )} function onStandbyWaitDisinfectChanged ( vValue ) { page( _settingsHome , vValue )} @@ -325,12 +316,8 @@ function onManufactModeChanged( vPass ) { if ( _GuiView.manufactMode ) { vSettings.checkServicePasswordSet() - stackView.initialItem = _servicePassword + push(_servicePassword) } - else { - stackView.initialItem = _settingsHome - } - push(stackView.initialItem) //DEBUG console.log (" 1 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vPass, stackView.initialItem, stackView.currentItem, stackView.depth) if ( _GuiView.manufactSetup ) { @@ -341,7 +328,6 @@ if ( _GuiView.UpdateMode ) { stackView.initialItem = _settingsHome } - push(stackView.initialItem) //DEBUG console.log (" 1 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vPass, stackView.initialItem, stackView.currentItem, stackView.depth) if ( _GuiView.updateSetup ) { @@ -352,10 +338,12 @@ onVisibleChanged: { if (visible) { - _mainMenu.hidden = serviceMode || _GuiView.manufactSetup + _mainMenu.hidden = _GuiView.manufactSetup + _headerBar.titleText = _root.settingsTitle } else { stackView.initialItem = null + _headerBar.titleText = "" } } } Index: sources/gui/qml/pages/settings/SettingsWiFi.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -41,7 +41,8 @@ readonly property int spacing : 20 readonly property int leftMargin : 50 readonly property int rightMargin : 50 - readonly property int topMargin : topMarginContent - 40 // moved up to top of the keyboard + readonly property int topMargin : 160 + readonly property bool isConnected : vDevice.ssid !== "" readonly property bool isValid : @@ -68,46 +69,51 @@ textInput.width : entryWidth label.width : labelWidth hasCursor : false // set false for now to disable the static IP entry for phase 1 + textInput.color : Colors.textMain } TextEntry { id : _ipAddress nextInput : _gateway // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. - textInput.text : vDevice.ssid !== "" ? vDevice.ipAddress : "" + textInput.text : vDevice.ipAddress + textInput.visible: _root.isConnected label.text : qsTr("IP Address") textInput.width : entryWidth label.width : labelWidth hasCursor : false // set false for now to disable the static IP entry for phase 1 - validator : ipValidator + textInput.color : Colors.textMain } TextEntry { id : _gateway nextInput : _subnetmask // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. textInput.text : vDevice.gateway + textInput.visible: _root.isConnected textInput.width : entryWidth label.width : labelWidth label.text : qsTr("Gateway") hasCursor : false // set false for now to disable the static IP entry for phase 1 - validator : ipValidator + textInput.color : Colors.textMain } TextEntry { id : _subnetmask nextInput : _dns // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. textInput.text : vDevice.subnetMask + textInput.visible: _root.isConnected textInput.width : entryWidth label.width : labelWidth label.text : qsTr("Subnet Mask") hasCursor : false // set false for now to disable the static IP entry for phase 1 - validator : ipValidator + textInput.color : Colors.textMain } TextEntry { id : _dns textInput.text : vDevice.dns + textInput.visible: _root.isConnected textInput.width : entryWidth textInput.wrapMode : Text.WordWrap label.width : labelWidth label.text : qsTr("DNS") hasCursor : false // set false for now to disable the static IP entry for phase 1 -// validator : ipValidator // Will fail the validor if there are more than 1 ip + textInput.color : Colors.textMain } } @@ -198,7 +204,7 @@ UserConfirmation { id : _userConfirmation property string ssid : "" property string macAddress : "" - property string separator : "\n\n" + property string separator : "\n" readonly property string spaceSeparator : " " notificationText : vDevice.status message : qsTr("Do you want to disconnect from `%1`?").arg(ssid) Index: sources/gui/qml/pages/treatment/TreatmentSection.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/treatment/TreatmentSection.qml (.../TreatmentSection.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/treatment/TreatmentSection.qml (.../TreatmentSection.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -24,6 +24,7 @@ property Item contentItem : null property alias header : _header property alias contentArea : _contentArea + property bool enableDropShadow: true signal editClicked signal lockClicked @@ -50,7 +51,7 @@ contentItem: _root.contentItem } - layer.enabled: true + layer.enabled: _root.enableDropShadow layer.effect: DropShadow { id: _dropShadow horizontalOffset: 3 Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -33,11 +33,12 @@ objectName: "TreatmentStack" onVisibleChanged : { // this should never happen by design, but in tests it can easily happen and will block the screen touch. - _treatmentAdjustmentFlow .close() - _vitalEntry .close( true ) // vQuit == true + _treatmentAdjustmentSetPoints .close() + _treatmentAdjustmentVitals .close() _treatmentAdjustmentPressuresLimits .close() + _treatmentAdjustmentBolusVolume .close() _treatmentAdjustmentDuration .close() - _treatmentUltrafiltrationItem .close() + _treatmentAdjustmentUltrafiltration .close() if (! visible) { _headerBar.menuHidden = true @@ -46,148 +47,117 @@ stackView.initialItem : null - // ultrafiltration state information bar properties - readonly property bool isUFPaused : vTDTreatmentStates.ufPaused - readonly property bool isUFRunning : vTDTreatmentStates.ufRunning readonly property bool isTreatmentPaused : vTDTreatmentStates.txStop - - readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" : "" - readonly property string ufInfoText : isUFPaused ? qsTr("Ultrafiltration Paused" ) : "" - readonly property string ufInfoTextColor : isUFPaused ? "gray" : "" - readonly property bool isSBInProgress : ( vTDTreatmentStates.sbRunning || vTDTreatmentStates.sbWaitPump ) + readonly property bool isTreatmentEnd : vTDTreatmentStates.txEnd + property int headerMenuIndex : _headerBar.headerMenuIndex - readonly property bool isDialogOpened : _treatmentAdjustmentFlow .visible - || _treatmentAdjustmentPressuresLimits .visible - || _treatmentAdjustmentDuration .visible - || _treatmentUltrafiltrationItem .visible - - property int headerMenuIndex: _headerBar.headerMenuIndex - onHeaderMenuIndexChanged: { - if ( _root.headerMenuIndex === 2) page(_treatmentHeparin) - if ( _root.headerMenuIndex === 1) page(_treatmentTrends) - if ( _root.headerMenuIndex === 0) pop(null) // unwind stack + switch( _headerBar.currentScreen ) { + case MainMenu.Treatment: + pop(null) // unwind stack back to main treatment + break + case MainMenu.Trends: + page( _treatmentTrends ) + break; + case MainMenu.Heparin: + page( _treatmentHeparin ) + break + case MainMenu.HDF: // TODO + page( _treatmentHDF ) + break + default: + pop(null) // unwind stack back to main treatment + break + } } // Components TreatmentBloodPrime { id: _treatmentBloodPrime } - TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } TreatmentHome { id: _treatmentHome } Connections { target: _treatmentHome function onSectionFlowClicked ( vValue ) { - _treatmentAdjustmentFlow.open() + _treatmentAdjustmentSetPoints.open() } function onSectionVitalsClicked ( vValue ) { - _vitalEntry.open() + _treatmentAdjustmentVitalsInterval.open() } function onSectionPressuresClicked ( vValue ) { _treatmentAdjustmentPressuresLimits.open() } + function onSectionSalineClicked ( vValue ) { + _treatmentAdjustmentBolusVolume.open() + } function onSectionTimeClicked ( vValue ) { - //DEBUG: console.log("time total minutes: " + vTreatmentTime.time_Total / 60 ) - _treatmentAdjustmentDuration.setDurationValue(vTreatmentTime.time_Total / 60) // minutes => hours _treatmentAdjustmentDuration.open() } function onSectionUltrafiltrationClicked ( vValue ) { - _treatmentUltrafiltrationItem.open() + _treatmentAdjustmentUltrafiltration.open() } } ScreenItem { id: _treatmentTrends } // TODO: make me! - ScreenItem { id: _treatmentHeparin } // TODO: make me! + TreatmentHeparin { id: _treatmentHeparin } + Connections { target: _treatmentHeparin + function onIdleTimeout ( ) { + _headerBar.headerMenuIndex = MainMenu.Treatment // on heparin idle timeout go to main treatment + } + } + ScreenItem { id: _treatmentHDF } // TODO: make me! + //// Treatment Adjustment Dialogs - TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow } - TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } + TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } + TreatmentAdjustmentUltrafiltration { id: _treatmentAdjustmentUltrafiltration } - Connections { target: _treatmentAdjustmentFlow - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentFlows.doAdjustment( - _treatmentAdjustmentFlow.bloodFlowRateValue , - _treatmentAdjustmentFlow.dialysateFlowRateValue ) + Connections { target: _treatmentAdjustmentSetPoints + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentSetPoints.doAdjustment( + _treatmentAdjustmentSetPoints.bloodFlowRate , + _treatmentAdjustmentSetPoints.dialysateFlowRate , + _treatmentAdjustmentSetPoints.dialysateTemperature , + _treatmentAdjustmentSetPoints.acidConcentrate , + _treatmentAdjustmentSetPoints.bicarbConcentrate + ) } } Connections { target: _treatmentAdjustmentPressuresLimits - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentPressuresLimits.doAdjustment( - _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow , - _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow , - _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc ) + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentPressuresLimits.doAdjustment( + _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc , + _treatmentAdjustmentPressuresLimits.tmpLimitWindow + ) } } - - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } - Connections { target: _treatmentAdjustmentDuration - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentDuration.doAdjustment( - _treatmentAdjustmentDuration.durationValue ) + Connections { target: _treatmentAdjustmentBolusVolume + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentBolusVolume.doAdjustment(_treatmentAdjustmentBolusVolume.fluidBolusVolume) } } - EntryDialog { id: _vitalEntry - function update(vSystolic, vDiastolic ,vHeartRate) { - _bphrEntry.systolic = vSystolic ? vSystolic : "" - _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" - _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" - } + TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } - titleText : qsTr("VITALS") - confirmEnabled : _bphrEntry.isValid - onConfirmClicked : { - _vitalEntry.close() - vTreatmentVitals.doConfirm( - _bphrEntry.systolic , - _bphrEntry.diastolic , - _bphrEntry.heartRate - ) - _treatmentHome.logVitalTime() - } + TreatmentAdjustmentVitalsInterval { id: _treatmentAdjustmentVitalsInterval } - onCloseClicked : { - vTreatmentVitals.doSkip() // only for logging - } - - onOpened : vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user - - onClosed : (vQuit) => { - if ( ! vQuit ) - vTreatmentVitals.doTimerStart() - } - - BPHREntry { id : _bphrEntry - contentRectHeight : _vitalEntry.contentRect.height - } - - Connections { target: vTreatmentVitals - function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { - if ( vTreatmentVitals.enableDialog ) { - _vitalEntry.update ( vSystolic, vDiastolic, vHeartRate ) - _vitalEntry.open () - } - } - } - } - // ---------- Manages Responses ---------- - Connections { target: vTreatmentAdjustmentDuration + Connections { target: vTreatmentAdjustmentBolusVolume function onAdjustmentTriggered ( vValue ) { - if ( vTreatmentAdjustmentDuration.adjustment_Accepted ) { - vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentDuration.ultrafiltration - _treatmentAdjustmentDuration.accept() - } else { - _treatmentAdjustmentDuration.setDurationValue(vTreatmentAdjustmentDuration.duration); - _treatmentAdjustmentDuration.notification.text = vTreatmentAdjustmentDuration.text(); + if ( vTreatmentAdjustmentBolusVolume.adjustment_Accepted ) { + _treatmentAdjustmentBolusVolume.close() } + else { + _treatmentAdjustmentBolusVolume.notification.text = vTreatmentAdjustmentBolusVolume.text() + } } } Connections { target: vTreatmentAdjustmentPressuresLimits function onAdjustmentTriggered ( vValue ) { - // values have to be update even when rejected HD is reverting back the values. - // if accepted will be updated for later [may need refresh later] - _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.arterialPressureLimitWindow - _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.venousPressureLimitWindow - _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc = vTreatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc - if (vTreatmentAdjustmentPressuresLimits.adjustment_Accepted) { _treatmentAdjustmentPressuresLimits.close() } @@ -197,6 +167,17 @@ } } + Connections { target: vTreatmentAdjustmentSetPoints + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentSetPoints.adjustment_Accepted) { + _treatmentAdjustmentSetPoints.close() + } + else { + _treatmentAdjustmentSetPoints.notification.text = vTreatmentAdjustmentSetPoints.text() + } + } + } + Connections { target: vTDOpMode // The initail screen should be the Blood Prime, since that one is the earlier state in the list. // also since it is being used in two stacks In-Treatment and also in End-Treatmet is has been defined in the MainStack. @@ -213,11 +194,12 @@ Connections { target: vTDTreatmentStates // in-Treatmet - function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} - function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} + function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} + function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} + function onTxEndChanged ( vValue ) { if ( vValue ) { _endTreatmentDialog.open() }} } Connections { target: _mainHome - function onStartTreatment ( vValue ) { page( _treatmentHome )} + function onStartTreatment ( vValue ) { page( _treatmentHome )} } } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2025 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 TreatmentAdjustmentUltrafiltrationConfirm.qml - * \author (last) Behrouz NematiPour - * \date (last) 19-Jul-2023 + * \author (last) Stephen Quong + * \date (last) 08-Oct-2025 * \author (original) Behrouz NematiPour * \date (original) 18-May-2020 * @@ -21,134 +21,87 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! - * \brief TreatmentAdjustmentUltrafiltrationEdit.qml is the screen - * To adjust the treatment ultrafiltration + * \brief TreatmentAdjustmentUltrafiltrationConfirm.qml is the screen + * to confirm requested changes to the treatment ultrafiltration setting. */ -TreatmentAdjustmentBase { id: _root - contentItem.objectName: "TreatmentAdjustmentUltrafiltrationConfirm" //SquishQt testability +Item { id: _root + objectName: "_TreatmentAdjustmentUltrafiltrationConfirm" // SquishQt testability - QtObject { id: _private - property int decimalVolume: Variables.ultrafiltrationPrecision - property int decimalRate : 0 - } - property real ultrafiltrationVolume : 0.000 - property int treatmentDuration : 0 - property int treatmentDurationDiff : 0 - property real ultrafiltrationRate : 0.000 - property real ultrafiltrationRateDiff : 0.000 - property real ultrafiltrationRateOld : 0.000 + property real ultrafiltrationVolume : 0.000 + property real ultrafiltrationRate : 0.000 - signal confirmRateClicked (real vVolume) - signal confirmDurationClicked(real vVolume) + signal confirmVolumeClicked(real vVolume) - closeVisible : false - confirmVisible : false - backVisible : true + component ValueContainer: LabelUnitContainer { id: _valueContainer + objectName : "_valueContainer" + property alias value : _value.text + property color valueColor : _value.color - information { - visible : true && information.text && ! notification.visible - imageSource : ufInfoImageSource - text : ufInfoText - } + implicitWidth : Variables.ultrafiltrationConfirmValueWidth + implicitHeight : Variables.adjustmentLabelUnitContainerHeight - titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume - - function revert() { - _rateAdjustmentButton.selected = false - _durationAdjustmentButton.selected = false - } - - TitleText { id : _titleText - text: qsTr("To confirm new UF Volume (%1),\nselect a treatment adjustment:") - .arg(ultrafiltrationVolume.toFixed(_private.decimalVolume)) - font.pixelSize: Fonts.fontPixelTitle - color: Colors.textMain - height: Variables.mainMenuHeight - anchors { - top: parent.top - topMargin: 100 - horizontalCenter: parent.horizontalCenter + contentItem: Text { id: _value + objectName: "_value" + font { + pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentMetrics + weight : Font.DemiBold + } + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + color : Colors.ufVolumeGoalText } } - TouchRect { id: _confirmButton - width : 530 - height : 70 + Item { id: _newValuesItem + objectName: "_newValuesItem" anchors { - bottom: parent.bottom - bottomMargin: 85 - horizontalCenter: parent.horizontalCenter + top : parent.top + bottom : _confirmButton.top + left : parent.left + right : parent.right } - isDefault : true - enabled : _rateAdjustmentButton.selected || _durationAdjustmentButton.selected - text { - text: qsTr("CONFIRM") - font.weight: Font.DemiBold - font.pixelSize: Fonts.fontPixelUltrafiltrationAdjustmentConfirmButton - } - onClicked: { - if (_rateAdjustmentButton.selected) { - confirmRateClicked(ultrafiltrationVolume) - return + + Row { id: _newValuesRow + objectName : "_newValuesRow" + anchors.centerIn: parent + spacing : Variables.columnSpacing + + ValueContainer { id: _newVolumeContainer + objectName : "_newVolumeContainer" + text : qsTr("New UF Volume") + unitText : Variables.unitVolume + valueColor : Colors.ufVolumeGoalText + value : _root.ultrafiltrationVolume.toFixed(Variables.ultrafiltrationPrecision) } - if (_durationAdjustmentButton.selected) { - confirmDurationClicked(ultrafiltrationVolume) - return + + ValueContainer { id: _newRateContainer + objectName : "_newRateContainer" + text : qsTr("New UF Rate") + unitText : Variables.unitTextRate + valueColor : Colors.ufVolumeGoalText + value : _root.ultrafiltrationRate.toFixed(Variables.ultrafiltrationPrecision) } - confirmClicked() } } - Row { - spacing: 20 + TouchRect { id: _confirmButton + objectName : "_confirmButton" anchors { - top: parent.top - topMargin: 205 + bottom : parent.bottom + bottomMargin : Variables.defaultMargin horizontalCenter: parent.horizontalCenter } - UltrafiltrationButton { id: _rateAdjustmentButton - titleString : qsTr("%1 UF Rate") - descriptionString : qsTr("The rate %3 by %1 %2,\nthe treatment duration remains the same.") - .arg(Math.abs(ultrafiltrationRateDiff .toFixed(_private.decimalRate))) - .arg(Variables.unitTextUltrafiltrationRate) - buttonType : UltrafiltrationButton.ButtonType.UltrafiltrationRate - isIncrease : ultrafiltrationRateDiff > 0 - valueText : qsTr( "UF Rate : %1 %2") - .arg(ultrafiltrationRate .toFixed(_private.decimalRate)) - .arg(Variables.unitTextUltrafiltrationRate) - onClicked : { - _durationAdjustmentButton.selected = false - selected = true - } - disabled: ultrafiltrationRate == 0 && ultrafiltrationRateDiff == 0 + width : Variables.ultrafiltrationButtonWidth + height : Variables.ultrafiltrationButtonHeight + isDefault : true + text { + text : qsTr("Confirm") + font.weight : Font.Medium } - UltrafiltrationButton { id: _durationAdjustmentButton - titleString : qsTr("%1 Treatment Duration") - descriptionString : qsTr("The rate remains, the treatment\nduration %2 by %1 minutes.") - .arg(Math.abs(treatmentDurationDiff)) - buttonType: UltrafiltrationButton.ButtonType.TreatmentDuration - isIncrease: treatmentDurationDiff > 0 - valueText : qsTr( "UF Rate : %1 %2") - .arg(ultrafiltrationRateOld .toFixed(_private.decimalRate)) - .arg(Variables.unitTextUltrafiltrationRate) - onClicked : { - _rateAdjustmentButton.selected = false - selected = true - } - visible : false - disabled: treatmentDuration == 0 && treatmentDurationDiff == 0 - } + onClicked: confirmVolumeClicked(_root.ultrafiltrationVolume.toFixed(Variables.ultrafiltrationPrecision)) } - - onConfirmClicked: { - _durationAdjustmentButton.selected = false - _rateAdjustmentButton.selected = false - } - onBackClicked: { - _durationAdjustmentButton.selected = false - _rateAdjustmentButton.selected = false - } } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2025 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 TreatmentAdjustmentUltrafiltrationEdit.qml - * \author (last) Vy - * \date (last) 20-Mar-2023 + * \author (last) Stephen Quong + * \date (last) 08-Oct-2025 * \author (original) Behrouz NematiPour * \date (original) 15-May-2020 * @@ -21,123 +21,179 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! * \brief TreatmentAdjustmentUltrafiltrationEdit.qml is the screen * To adjust the treatment ultrafiltration */ -TreatmentAdjustmentBase { id: _root - contentItem.objectName: "TreatmentAdjustmentUltrafiltrationEdit" //SquishQt testability +Item { id: _root + objectName: "_TreatmentAdjustmentUltrafiltrationEdit" // SquishQt testability + QtObject { id: _private - property int decimal : Variables.ultrafiltrationPrecision - property real minAdjust : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Min - property real valAdjust : _volumeSlider.value - property real maxAdjust : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max + objectName: "_private" + readonly property real minimum : calculatePrecisionValue( vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Min ) + readonly property real maximum : calculatePrecisionValue( vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max ) + readonly property real volumeRes : calculatePrecisionValue( vTreatmentRanges.ultrafiltrationVolumeRes ) + readonly property real setVolume : calculatePrecisionValue( vTreatmentUltrafiltration.setVolume ) + readonly property real volumeRemoved : calculatePrecisionValue( vTreatmentUltrafiltration.volumeRemoved ) - property real min : vTreatmentUltrafiltration.minimum - property real val : vTreatmentUltrafiltration.volumeRemoved - property real max : vTreatmentUltrafiltration.maximum + readonly property int multiplier : Math.pow(10, Variables.ultrafiltrationPrecision) + function calculatePrecisionValue(value) { + return Math.round(value * multiplier) / multiplier + } } - signal nextClicked(real vVolume) + signal continueClicked(real vVolume) - function revert() { - _volumeSlider.value = _private.max + function reset() { + _volumeGoalAdjuster.value = _private.setVolume } - closeVisible : false - confirmVisible : false - backVisible : true - - information { - visible : true && information.text && ! notification.visible - imageSource : ufInfoImageSource - text : ufInfoText - } - - titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume - - ProgressBarEx { id: _rangeProgressBar - width : Variables.ultrafiltrationProgressbarWidth - height : Variables.ultraFiltrationProgressBarHeight + TreatmentAdjustmentUltrafiltrationMetrics { id: _ufMetrics + objectName : "_ufMetrics" anchors { - top : parent.top - topMargin : 250 - right : parent.right - rightMargin : _volumeSliderArrows.width + Variables.sliderAdjustButtonSpacing*2 + top : parent.top + topMargin : Variables.defaultMargin + horizontalCenter: parent.horizontalCenter } - decimal : _private.decimal - minimum : _private.min // suppose to be always 0 // DEN-6022 // _private.maxAdjust => _private.min - maximum : _private.maxAdjust - value : _private.val - valueEx : _private.valAdjust - progressEx.maxText.visible: false + setVolume : _volumeGoalAdjuster.value + volumeRemoved : _private.volumeRemoved + volumeRemovedColor : Colors.ufVolumeGoalText } - Slider { id: _volumeSlider - // TODO : These two values shall get from a model - property int minGapValue: 0 // No gap for now. - property int maxGapValue: 0 // No gap for now. - - readonly property int minPrgWidth: _rangeProgressBar.maximum - _rangeProgressBar.minimum - readonly property int maxPrgWidth: _rangeProgressBar.maximum - _rangeProgressBar.minimum - readonly property int minGapWidth: minPrgWidth > 0 ? (minGapValue * _rangeProgressBar.width) / minPrgWidth : 0 - readonly property int maxGapWidth: maxPrgWidth > 0 ? (maxGapValue * _rangeProgressBar.width) / maxPrgWidth : 0 - + Item { id: _contentArea + objectName: "_contentArea" anchors { - top: _rangeProgressBar.bottom - topMargin: 50 + top : _ufMetrics.bottom + bottom : _continueButton.top + left : parent.left + right : parent.right } - x : _rangeProgressBar.x + minGapWidth + _rangeProgressBar.progressWidth - width : _rangeProgressBar.width - maxGapWidth - minGapWidth - _rangeProgressBar.progressWidth - height : Variables.ultraFiltrationEditSliderHeight - step : 0.100 - stepSnap: true - ticks : true - decimal : _private.decimal - minimum : _private.minAdjust + minGapValue - maximum : _private.maxAdjust - maxGapValue - } + Column { id: _contentColumn + objectName : "_contentColumn" + anchors.centerIn : parent + width : Variables.ultrafiltrationProgressBarWidth + spacing : 80 - SliderArrows{ id: _volumeSliderArrows - visible : true - anchors.verticalCenter : _volumeSlider.verticalCenter - anchors.right : parent.right - anchors.rightMargin : Variables.sliderAdjustButtonSpacing + ProgressBar { id: _maxVolumeBar + objectName : "_maxVolumeBar" + width : parent.width + height : Variables.ultraFiltrationProgressBarHeight + marker.visible : false + bgColor : Colors.ufAdjustmentProgressBarBg + color : Colors.ufAdjustmentDeltaFill + radius : Variables.ultrafiltrationProgressBarRadius + minText { + font { + pixelSize : Fonts.fontPixelUltrafiltrationMinMaxLabel + weight : Font.Normal + } + color : Colors.progressBarMinMax + text : minimum.toFixed(Variables.ultrafiltrationPrecision) + " " + Variables.unitVolume + } + maxText { + font { + pixelSize : minText.font.pixelSize + weight : minText.font.weight + } + color : Colors.progressBarMinMax + text : _private.maximum.toFixed(Variables.ultrafiltrationPrecision) + " " + Variables.unitVolume + } + minimum : _private.minimum + maximum : _private.maximum + decimal : Variables.ultrafiltrationPrecision + value : _volumeGoalAdjuster.value - onIncrementValue : _volumeSlider.incrementValue(true) - onDecrementValue : _volumeSlider.decrementValue(true) - } + Rectangle { id: _removedFill + objectName: "_removedFill" + anchors { + top : parent.top + bottom : parent.bottom + left : parent.left + right : _lowMarker.right + // adjust margin so fill completely covers the underlying slider + leftMargin : -1 + } + z : parent.z + 1 + color : Colors.ufProgressBarFill + radius : parent.radius + } - Text { id: _textVolume - visible : true - color : Colors.textMain - text : _private.valAdjust.toFixed(_private.decimal) - font { - pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentEditValue + RangeMarker { id: _lowMarker + objectName : "_lowMarker" + anchors.bottom : parent.bottom + x : (_maxVolumeBar.width * ((value - _maxVolumeBar.minimum) / (_maxVolumeBar.maximum - _maxVolumeBar.minimum))) - ((width+1)/2) + z : _removedFill.z + 1 + width : Variables.ultrafiltrationRangeMarkerWidth + height : Variables.rangeMarkerHeight + hasHandle : false + valueOnTop : true + decimal : Variables.ultrafiltrationPrecision + value : Math.max(_private.volumeRemoved, _private.minimum) + text { + anchors.bottomMargin: Variables.ultrafiltrationRangeMarkerTextMargin + font { + pixelSize: Fonts.fontPixelUltrafiltrationRangeMarker + weight: Font.DemiBold + } + } + } + } + + LabelUnitContainer { id: _volumeGoalContainer + objectName : "_volumeGoalContainer" + width : parent.width + height : _ufMetrics.height + text : qsTr("UF Volume Goal") + unitText : Variables.unitVolume + contentItem : ValueAdjuster { id: _volumeGoalAdjuster + objectName : "_volumeGoalAdjuster" + textColor : Colors.ufVolumeGoalText + isActive : true + decimal : Variables.ultrafiltrationPrecision + minimum : Math.ceil(_private.volumeRemoved / step) * step + maximum : Math.floor(_private.maximum / step) * step + step : _private.volumeRes + value : { value = _private.setVolume } // set without binding + + onDidChange : { + value = _private.calculatePrecisionValue(vValue) + } + onMinimumChanged: { + if (value < minimum) { + value = minimum + } + } + onMaximumChanged: { + if (value > maximum) { + value = maximum + } + } + } + } } - anchors { - horizontalCenter: parent.horizontalCenter - top : parent.top - topMargin : 150 - } } - TouchRect { id: _nextButton - width : 530 - height : 95 + TouchRect { id: _continueButton + objectName : "_continueButton" anchors { - top: parent.top - topMargin: 460 + bottom : parent.bottom + bottomMargin : Variables.defaultMargin horizontalCenter: parent.horizontalCenter } - isDefault: true + width : Variables.ultrafiltrationButtonWidth + height : Variables.ultrafiltrationButtonHeight text { - text: qsTr("NEXT") - font.weight : Font .DemiBold - font.pixelSize: Fonts.fontPixelUltrafiltrationAdjustmentNextButton + text : qsTr("Continue") + font.weight : Font.Medium } - onClicked: nextClicked( _private.valAdjust.toFixed(_private.decimal) ) + isDefault : true + enabled : _volumeGoalAdjuster.value !== _private.setVolume + + onClicked : { + continueClicked(_volumeGoalAdjuster.value) + } } } Index: sources/storage/Logger.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -557,7 +557,6 @@ _logFileNameTime = QDateTime::currentDateTime().time().toString(_fileTimeFormat); } break; - case GuiTDOpModes::MODE_TPAR: case GuiTDOpModes::MODE_PRET: case GuiTDOpModes::MODE_TREA: case GuiTDOpModes::MODE_POST: Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -37,10 +37,13 @@ { static bool init = false; if ( init ) return; - PROPERTY_POST_CONNECTION(VSettings, servicePass ); - PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); - PROPERTY_POST_CONNECTION(VSettings, roWaterMode ); - + PROPERTY_POST_CONNECTION(VSettings, servicePass ); + PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); + PROPERTY_POST_CONNECTION(VSettings, roWaterMode ); + PROPERTY_POST_CONNECTION(VSettings, integratedBPCuff ); + PROPERTY_POST_CONNECTION(VSettings, heparinSyringePump ); + PROPERTY_POST_CONNECTION(VSettings, chemicalDisinfection); + PROPERTY_POST_CONNECTION(VSettings, advancedMode); init = true; } @@ -60,6 +63,36 @@ } } +void VSettings::advancedMode_post(const bool &vadvancedMode_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(advancedModeGroup(), advancedModeKey(), QString::number(vadvancedMode_post)) != 0 ) { + advancedMode(false); + } +} +void VSettings::integratedBPCuff_post(const bool &vintegratedBPCuff_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(integratedBPCuffGroup(), integratedBPCuffKey(), QString::number(vintegratedBPCuff_post)) != 0 ) { + integratedBPCuff(false); + // FIXME: Notify UI with a message + } +} + +void VSettings::heparinSyringePump_post(const bool &vheparinSyringePump_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(heparinSyringePumpGroup(), heparinSyringePumpKey(), QString::number(vheparinSyringePump_post)) != 0 ) { + heparinSyringePump(false); + // FIXME: Notify UI with a message + } +} + +void VSettings::chemicalDisinfection_post(const bool &vchemicalDisinfection_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(chemicalDisinfectionGroup(), chemicalDisinfectionKey(), QString::number(vchemicalDisinfection_post)) != 0 ) { + chemicalDisinfection(false); + // FIXME: Notify UI with a message + } +} + void VSettings::alarmVolume_post(const quint8 &valarmVolume) { //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. Storage::Settings::save(alarmVolumeGroup(), alarmVolumeKey(), QString::number(valarmVolume)); @@ -73,15 +106,28 @@ 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); + QStringList keys ; + QVariantList values ; + QString title = ""; + for (const QString &key : _Settings.keys(category, group)) { + if (Storage::Settings::isKeyTitle ( key ) ) { + title = _Settings.value(category, group, key).toString(); + } else { + const QString imagePath = QStringLiteral("%1%2").arg(_location) + .arg(_Settings.value(category, group, key).toString()); + QFileInfo fileInfo(imagePath); + values.append(fileInfo.exists() && fileInfo.isFile() ? "file:" + imagePath : ""); + keys.append(key); + } + } + if ( Storage::Settings::isCategoryInstructions( category ) ) { - TKeysList keysList = updateReplacements(group, keys ); - updateInstructions(group, keysList, values ); - updateInstructions(group ); + TKeysList keysList = updateReplacements(group, keys ); + updateInstructions(group, keysList, values, title ); + updateInstructions(group ); } 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 : std::as_const(keys)) { + for (const auto &key : qAsConst(keys)) { // DEBUG: qDebug() << " ~~~~~~~~~~ " << category << group << key << _Settings.value(category, group, key).toString (); QVariantMap keyValue; if ( isservicePass (category, group, key) ) { @@ -96,6 +142,30 @@ keyValue[key] = mRoWaterMode ; roWaterMode ( mRoWaterMode); } + else if ( isadvancedMode(category, group, key) ) { + bool mAdvancedMode; + mAdvancedMode = _Settings.value(category, group, key).toBool (); + keyValue[key] = mAdvancedMode ; + advancedMode ( mAdvancedMode ); + } + else if ( isintegratedBPCuff (category, group, key) ) { + bool mIntegratedBPCuff; + mIntegratedBPCuff = _Settings.value(category, group, key).toBool (); + keyValue[key] = mIntegratedBPCuff ; + integratedBPCuff ( mIntegratedBPCuff ); + } + else if ( isheparinSyringePump (category, group, key) ) { + bool mHeparinSyringePump; + mHeparinSyringePump = _Settings.value(category, group, key).toBool (); + keyValue[key] = mHeparinSyringePump ; + heparinSyringePump ( mHeparinSyringePump ); + } + else if ( ischemicalDisinfection (category, group, key) ) { + bool mChemicalDisinfection; + mChemicalDisinfection = _Settings.value(category, group, key).toBool (); + keyValue[key] = mChemicalDisinfection ; + chemicalDisinfection ( mChemicalDisinfection ); + } else if ( isalarmVolume (category, group, key) ) { quint8 mAlarmVolume; mAlarmVolume = _Settings.value(category, group, key).toInt (); // returns 0 if fails, so no error checking needed. @@ -118,6 +188,7 @@ servicePass ( _servicePass ); alarmVolume ( _alarmVolume ); roWaterMode ( _roWaterMode ); + advancedMode( _advancedMode ); //DEBUG qDebug() << servicePass() << roWaterMode() << alarmVolume(); adjustment(true); @@ -129,18 +200,17 @@ { TKeysList keysList; for ( quint16 keyIndex = 0; keyIndex < vKeys.count(); keyIndex++ ) { - QRegularExpression regx("\\{\\s*\\d+\\s*:\\s*\\d+\\s*:\\s*\\w*\\s*:\\s*\\d*\\s*\\}"); + QRegExp regx("\\{\\s*\\d+\\s*:\\s*\\d+\\s*:\\s*\\w*\\s*:\\s*\\d*\\s*\\}"); QString key = vKeys[keyIndex]; - QRegularExpressionMatch regxMatch = regx.match(key); int replacementCount = key.count(regx); QStringList keyList; for ( int j = 0; j < replacementCount; j++ ) { int pos = key.indexOf(regx); - int len = regxMatch.captured(j).length(); + int len = regx.matchedLength(); QString blk = key.mid(pos+1, len-2); keyList += key.mid(0, pos); keyList += ""; // value placeholder - key.remove(0, pos + len); + key.remove(0, pos + regx.matchedLength()); QStringList lst = blk.split(":"); quint16 id = lst[0].toUInt(); quint16 ix = lst[1].toUInt(); @@ -162,10 +232,10 @@ return keysList; } -void VSettings::updateInstructions(const QString &vGroup, const TKeysList &vKeysList, const QVariantList &vValues) +void VSettings::updateInstructions(const QString &vGroup, const TKeysList &vKeysList, const QVariantList &vValues, const QString &vTitle) { TInstruction mInstruction; - mInstruction.location = _location; + mInstruction.title = vTitle; mInstruction.keys = vKeysList; mInstruction.values = vValues ; _instructionMap[vGroup] = mInstruction; @@ -176,12 +246,13 @@ //TODO: this function or even the structure may need to update to send less data to qml and only the updated part. TKeysList keysList = _instructionMap[vGroup].keys ; QVariantList values = _instructionMap[vGroup].values; + QString title = _instructionMap[vGroup].title; QStringList keyList; for ( const auto &keys : keysList) { keyList += keys.join(""); } QVariantMap details; - details["location"] = _location ; + details["title"] = title ; details["keys" ] = keyList ; details["values" ] = values ; _instructions[vGroup] = details ; @@ -226,47 +297,69 @@ } /*! - * \brief VSettings::isPasswordValid - * \details Validates the passed string for conforming to the - * - at least one capital letter, - * - at least one digit, - * - at least one symbol - * rule - * \param vPassword - the string to check - * \returns true if string pass conforms, false otherwise + * \brief Return whether the password has the minimum character limit + * \param[in] password password to check + * \return true if the password contains requirement */ -bool View::VSettings::isPasswordValid(const QString &vPassword) { - int minLen = 10 ; // in the SRS the max is required to be 12 which seems incorrect and I didn't set it here. - QString pla = "(?=.*[%1])" ; // positive look ahead - QString regSntnc = "^%1$" ; // regular expression sentence with has a start/end - QString regUpper = "A-Z" ; - QString regLower = "a-z" ; - QString regDigit = "0-9" ; - QString regSymbl = "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{\\|}~"; - QString rln = "[%1]{%2,}" ; +bool View::VSettings::passwordContainsCharacterLimit(const QString &vPassword) const +{ + return vPassword.size() >= 10; +} - // "^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{\|}~])[A-Za-z0-9!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{\|}~]{10,}$" - // !"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{\\|}~ - QString regStr = regSntnc.arg( - pla.arg(regUpper) + - pla.arg(regLower) + - pla.arg(regDigit) + - pla.arg(regSymbl) + - rln.arg(regUpper + - regLower + - regDigit + - regSymbl) - .arg(minLen ) - ); - QRegularExpression passwordRegex(regStr); - bool ok; +/*! + * \brief Return whether the password has a upper case letter + * \param[in] password password to check + * \return true if the password contains requirement + */ +bool View::VSettings::passwordContainsUpperCase(const QString &vPassword) const +{ + static const QRegularExpression upperCaseLetter("[A-Z]"); + return vPassword.contains(upperCaseLetter); +} - //DEBUG: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ - //DEBUG: vPassword = "Ab0!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" - ok = passwordRegex.match(vPassword).hasMatch(); - return ok; +/*! + * \brief Return whether the password has a lower case letter + * \param[in] password password to check + * \return true if the password contains requirement + */ +bool View::VSettings::passwordContainsLowerCase(const QString &vPassword) const +{ + static const QRegularExpression lowerCaseLetter("[a-z]"); + return vPassword.contains(lowerCaseLetter); } +/*! + * \brief Return whether the password has a digit + * \param[in] password password to check + * \return true if the password contains requirement + */ +bool View::VSettings::passwordContainsDigit(const QString &vPassword) const +{ + static const QRegularExpression number("[0-9]"); + return vPassword.contains(number); +} + +bool View::VSettings::passwordContainsSymbol(const QString &vPassword) const +{ + static const QRegularExpression symbol( + QStringLiteral("[%1]").arg(QRegularExpression::escape("{}[],.<>;:'\"?/|\\`~!@#$%^&*()_-+="))); + return vPassword.contains(symbol); +} + +/*! + * \brief Return whether the password is high strength. + * \param[in] password password to check + * \return true if the password is high strength and false otherwise. + */ +bool View::VSettings::isPasswordHighStrength(const QString &vPassword) const +{ + return passwordContainsUpperCase(vPassword) && + passwordContainsLowerCase(vPassword) && + passwordContainsDigit(vPassword) && + passwordContainsSymbol(vPassword) && + passwordContainsCharacterLimit(vPassword); +} + QString View::VSettings::hashedPassword(const QString &vPassword, bool vIsService) { bool ok;