Index: denali.pro =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- denali.pro (.../denali.pro) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ denali.pro (.../denali.pro) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -40,6 +40,7 @@ sources/model/dg/data \ sources/view \ sources/view/hd/adjustment \ + sources/view/hd/alarm \ sources/view/hd/data \ sources/view/dg/data @@ -60,11 +61,11 @@ sources/model/MDGDebugText.h \ sources/model/MHDDebugText.h \ sources/storage/DriveWatcher.h \ - sources/threads.h \ - sources/maintimer.h \ - sources/applicationpost.h \ + sources/Threads.h \ + sources/MainTimer.h \ + sources/ApplicationPost.h \ \ # Controllers - sources/applicationcontroller.h \ + sources/ApplicationController.h \ \ # ---------- Models ---------- sources/model/MModel.h \ sources/model/MAbstract.h \ @@ -101,44 +102,44 @@ sources/model/dg/data/MDGTemperaturesData.h \ sources/model/dg/data/MDGValvesStatesData.h \ \ # CANBus - sources/canbus/caninterface.h \ - sources/canbus/frameinterface.h \ + sources/canbus/CanInterface.h \ + sources/canbus/FrameInterface.h \ \ # Denali Message - sources/canbus/messageglobals.h \ - sources/canbus/messageacknowmodel.h \ - sources/canbus/messagebuilder.h \ - sources/canbus/messageinterpreter.h \ - sources/canbus/messagedispatcher.h \ + sources/canbus/MessageGlobals.h \ + sources/canbus/MessageAcknowModel.h \ + sources/canbus/MessageBuilder.h \ + sources/canbus/MessageInterpreter.h \ + sources/canbus/MessageDispatcher.h \ \ # Gui - sources/gui/guiglobals.h \ - sources/gui/guiview.h \ - sources/gui/guicontroller.h \ + sources/gui/GuiGlobals.h \ + sources/gui/GuiView.h \ + sources/gui/GuiController.h \ \ # ---------- Views ---------- sources/view/VTreatmentCreate.h \ sources/view/VEventSpy.h \ - sources/view/hd/data/VHDTreatmentStatesData.h \ - sources/view/vview.h \ - sources/view/vpoweroff.h \ - \ # ---------- Views - Alarm - sources/view/valarmstatus.h \ + sources/view/VView.h \ + sources/view/VPowerOff.h \ sources/view/VPriming.h \ + \ # ---------- Views - Alarm + sources/view/hd/alarm/VAlarmStatus.h \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/vtreatmentadjustmentresponsebase.h \ - sources/view/vtreatmentadjustmentduration.h \ - sources/view/vtreatmentadjustmentflows.h \ - sources/view/vtreatmentadjustmentultrafiltrationstate.h \ - sources/view/vtreatmentadjustmentultrafiltrationedit.h \ - sources/view/vtreatmentadjustmentultrafiltrationconfirm.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentDuration.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentFlows.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationEdit.h \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationConfirm.h \ sources/view/hd/adjustment/VTreatmentAdjustmentSaline.h \ \ # ---------- Views - HD - Data - sources/view/vtreatmenttime.h \ - sources/view/vtreatmentbloodflow.h \ - sources/view/vtreatmentdialysateflow.h \ - sources/view/vtreatmentultrafiltration.h \ - sources/view/vtreatmentranges.h \ - sources/view/vtreatmentpressureocclusion.h \ + sources/view/hd/data/VTreatmentTime.h \ + sources/view/hd/data/VTreatmentBloodFlow.h \ + sources/view/hd/data/VTreatmentDialysateFlow.h \ + sources/view/hd/data/VTreatmentUltrafiltration.h \ + sources/view/hd/data/VTreatmentRanges.h \ + sources/view/hd/data/VTreatmentPressureOcclusion.h \ sources/view/hd/data/VHDOperationModeData.h \ sources/view/hd/data/VTreatmentSalineData.h \ + sources/view/hd/data/VHDTreatmentStatesData.h \ \ # ---------- Views - DG - Data sources/view/dg/data/VDGDrainPumpData.h \ sources/view/dg/data/VDGHeatersData.h \ @@ -150,9 +151,9 @@ sources/view/dg/data/VDGTemperaturesData.h \ sources/view/dg/data/VDGValvesStatesData.h \ \ # Storage - sources/storage/storageglobals.h \ - sources/storage/filehandler.h \ - sources/storage/logger.h \ + sources/storage/StorageGlobals.h \ + sources/storage/Logger.h \ + sources/storage/FileHandler.h \ \ # Utility sources/utility/crc.h \ sources/utility/format.h \ @@ -170,18 +171,15 @@ sources/model/MStartTreatmentResponse.cpp \ sources/model/hd/data/MPrimingData.cpp \ sources/model/MTreatmentParametersResp.cpp \ - sources/storage/filesaver.cpp \ - sources/model/MDGDebugText.cpp \ - sources/model/MHDDebugText.cpp \ - sources/storage/DriveWatcher.cpp \ - sources/threads.cpp \ - sources/maintimer.cpp \ - sources/applicationpost.cpp \ + sources/Threads.cpp \ + sources/MainTimer.cpp \ + sources/ApplicationPost.cpp \ \ # Controllers - sources/applicationcontroller.cpp \ + sources/ApplicationController.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ sources/model/MPowerOff.cpp \ + sources/model/MHDDebugText.cpp \ \ # ---------- Models - Alarm sources/model/hd/alarm/MAlarmCleared.cpp \ sources/model/hd/alarm/MAlarmTriggered.cpp \ @@ -203,6 +201,7 @@ sources/model/hd/data/MHDOperationModeData.cpp \ sources/model/hd/data/MTreatmentSalineData.cpp \ \ # ---------- Models - DG - Data + sources/model/MDGDebugText.cpp \ sources/model/dg/data/MDGDrainPumpData.cpp \ sources/model/dg/data/MDGHeatersData.cpp \ sources/model/dg/data/MDGLoadCellReadingsData.cpp \ @@ -213,42 +212,42 @@ sources/model/dg/data/MDGTemperaturesData.cpp \ sources/model/dg/data/MDGValvesStatesData.cpp \ \ # CANBus - sources/canbus/caninterface.cpp \ - sources/canbus/frameinterface.cpp \ + sources/canbus/CanInterface.cpp \ + sources/canbus/FrameInterface.cpp \ \ # Denali Message - sources/canbus/messageacknowmodel.cpp \ - sources/canbus/messagebuilder.cpp \ - sources/canbus/messagedispatcher.cpp \ - sources/canbus/messageinterpreter.cpp \ + sources/canbus/MessageAcknowModel.cpp \ + sources/canbus/MessageBuilder.cpp \ + sources/canbus/MessageDispatcher.cpp \ + sources/canbus/MessageInterpreter.cpp \ \ # Gui - sources/gui/guiglobals.cpp \ - sources/gui/guiview.cpp \ - sources/gui/guicontroller.cpp \ + sources/gui/GuiGlobals.cpp \ + sources/gui/GuiView.cpp \ + sources/gui/GuiController.cpp \ \ # ---------- Views ---------- sources/view/VTreatmentCreate.cpp \ sources/view/VEventSpy.cpp \ - sources/view/hd/data/VHDTreatmentStatesData.cpp \ - sources/view/vpoweroff.cpp \ sources/view/VPriming.cpp \ + sources/view/VPowerOff.cpp \ \ # ---------- Views - Alarm - sources/view/valarmstatus.cpp \ + sources/view/hd/alarm/VAlarmStatus.cpp \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/vtreatmentadjustmentresponsebase.cpp \ - sources/view/vtreatmentadjustmentduration.cpp \ - sources/view/vtreatmentadjustmentflows.cpp \ - sources/view/vtreatmentadjustmentultrafiltrationstate.cpp \ - sources/view/vtreatmentadjustmentultrafiltrationedit.cpp \ - sources/view/vtreatmentadjustmentultrafiltrationconfirm.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentDuration.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentFlows.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationEdit.cpp \ + sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp \ sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp \ \ # ---------- Views - HD - Data - sources/view/vtreatmenttime.cpp \ - sources/view/vtreatmentbloodflow.cpp \ - sources/view/vtreatmentdialysateflow.cpp \ - sources/view/vtreatmentultrafiltration.cpp \ - sources/view/vtreatmentranges.cpp \ - sources/view/vtreatmentpressureocclusion.cpp \ + sources/view/hd/data/VTreatmentTime.cpp \ + sources/view/hd/data/VTreatmentBloodFlow.cpp \ + sources/view/hd/data/VTreatmentDialysateFlow.cpp \ + sources/view/hd/data/VTreatmentUltrafiltration.cpp \ + sources/view/hd/data/VTreatmentRanges.cpp \ + sources/view/hd/data/VTreatmentPressureOcclusion.cpp \ sources/view/hd/data/VHDOperationModeData.cpp \ sources/view/hd/data/VTreatmentSalineData.cpp \ + sources/view/hd/data/VHDTreatmentStatesData.cpp \ \ # ---------- Views - DG - Data sources/view/dg/data/VDGDrainPumpData.cpp \ sources/view/dg/data/VDGHeatersData.cpp \ @@ -260,9 +259,11 @@ sources/view/dg/data/VDGTemperaturesData.cpp \ sources/view/dg/data/VDGValvesStatesData.cpp \ \ # Storage - sources/storage/storageglobals.cpp \ - sources/storage/filehandler.cpp \ - sources/storage/logger.cpp \ + sources/storage/StorageGlobals.cpp \ + sources/storage/FileHandler.cpp \ + sources/storage/Logger.cpp \ + sources/storage/DriveWatcher.cpp \ + sources/storage/filesaver.cpp \ \ # Utility sources/utility/crc.cpp \ sources/utility/format.cpp \ @@ -281,7 +282,8 @@ VER_MINOR_DEV=\\\"0\\\" \ VER_MICRO_DEV=\\\"0\\\" \ VER_REVIS_DEV=\\\"$$system( date "+%m%d%H%M" )\\\" \ - VER_APPLY=\\\"$$system( touch -m main.cpp)\\\" + VER_APPLY=\\\"$$system( touch -m main.cpp )\\\" \ + VER_BRANCH=\\\"$$system( git rev-parse --abbrev-ref HEAD )\\\" CodeCoverage { message(Building with Squish Coco) @@ -412,4 +414,5 @@ else: unix:!android: target.path = /home/root !isEmpty(target.path): INSTALLS += target -DISTFILES += +DISTFILES += \ + README.md Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -288,6 +288,71 @@ /*! * \brief MessageDispatcher::onAdjustment + * \details This method transmits the StartTreatment request message. + * \param vData - Data model contains the start treatment request information. + * \return void + */ +void MessageDispatcher::onAdjustment(const StartTreatmentRequestData &vData) +{ + QVariantList mData; + mData += vData.request; + onActionTransmit(GuiActionType::ID_StartTreatmentReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the Alarm Request Silence message. + * \param vData - Data model contains the silence request information. + * \return void + */ +void MessageDispatcher::onAdjustment(const AlarmSilenceRequestData &vData) +{ + QVariantList mData; + mData += vData.state; + onActionTransmit(GuiActionType::ID_AlarmSilenceReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the Alarm Acknowledge Request message. + * \param vData - Data model contains the user acknowledge request information. + * \return void + */ +void MessageDispatcher::onAdjustment(const AlarmAcknowledgeRequestData &vData) +{ + QVariantList mData; + mData += vData.alarmID; + onActionTransmit(GuiActionType::ID_AlarmUserAckReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the Confirm Treatment request message. + * \param vData - Data model contains the confirm treatment request + * \return void + */ +void MessageDispatcher::onAdjustment(const ConfirmTreatmentRequestData &vData) +{ + Q_UNUSED(vData) + QVariantList mData; + onActionTransmit(GuiActionType::ID_ConfirmTreatmentReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the End Treatment request message. + * \param vData - Data model contains the end treatment request + * \return void + */ +void MessageDispatcher::onAdjustment(const EndTreatmentRequestData &vData) +{ + Q_UNUSED(vData) + QVariantList mData; + onActionTransmit(GuiActionType::ID_EndTreatmentReq, mData); +} + + +/** * \details This method transmits the Saline Bolus Adjustment Denali message. * \param vData - Data model contains treatment Saline Bolus adjustment state. * \return void @@ -299,7 +364,36 @@ onActionTransmit(GuiActionType::ID_AdjustSalineReq, mData); } +/** + * \details This method transmits the Treatment Parameter request message. + * \param vData - Data model contains treatment parameter adjustment data structure + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustTreatmentParametersRequestData &vData) +{ + QVariantList mData; + mData += vData.bloodFlowRate ; + mData += vData.dialysateFlowRate ; + mData += vData.duration ; + mData += vData.heparinStopTime ; + mData += vData.salineBolus ; + mData += vData.acidConcentrate ; + mData += vData.bicarbonateConcentrate ; + mData += vData.dialyzerType ; + mData += vData.bloodPressureMeasureInterval ; + mData += vData.rinsebackFlowRate ; + mData += vData.arterialPressureLimitLow ; + mData += vData.arterialPressureLimitHigh ; + mData += vData.venousPressureLimitLow ; + mData += vData.venousPressureLimitHigh ; + mData += vData.heparinDispensingRate ; + mData += vData.heparinBolusVolume ; + mData += vData.dialysateTemp ; + onActionTransmit(GuiActionType::ID_CreateTreatmentReq, mData); +} + + /*! * \brief MessageDispatcher::actionTransmit * \details This method is called by slot MessageDispatcher::onActionTransmit Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,5 +1,5 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN @@ -74,10 +74,16 @@ {Gui::GuiActionType::ID_AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes {Gui::GuiActionType::ID_AlarmTriggered , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AlarmCleared , 1 * 4 }, // 1 parameter each 4bytes - {Gui::GuiActionType::ID_AlarmSilenceReq , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::ID_AlarmSilenceRsp , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::ID_AlarmSilenceReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmUserAckReq , 1 * 4 }, // 1 parameter each 4bytes // ---- + {Gui::GuiActionType::ID_StartTreatmentReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_StartTreatmentRsp , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_ConfirmTreatmentReq , 0 }, + {Gui::GuiActionType::ID_EndTreatmentReq , 0 }, + + // ---- {Gui::GuiActionType::ID_TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes {Gui::GuiActionType::ID_TreatmentStates , 3 * 4 }, // 3 parameters each 4bytes @@ -105,6 +111,8 @@ {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp , 5 * 4 }, // ---- + {Gui::GuiActionType::ID_PrimingData , 3 * 4 }, // 3 parameters each 4bytes + // ---- {Gui::GuiActionType::ID_AdjustSalineReq , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AdjustSalineRsp , 3 * 4 }, // 3 parameters each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -144,9 +144,9 @@ QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + QString("%1 # %2 %3") - .arg(int(vMessage.can_id), 3, 16, QChar('0')) - .arg(mActionIdHexString) - .arg(QString(vMessage.data.toHex('.'))); + .arg(int(vMessage.can_id), 3, 16, QChar('0')) + .arg(mActionIdHexString) + .arg(QString(vMessage.data.toHex('.'))); LOG_DEBUG(logMessage); } @@ -187,6 +187,7 @@ vPayload.clear(); int length = vData.length(); + LOG_EVENT(QString("%0").arg(vActionId)); switch (vActionId) { // notice we are in transmit mode case Gui::GuiActionType::ID_Acknow: // len: 0, can have zero len break; // No data, Just registered @@ -254,20 +255,41 @@ LOG_EVENT(AlarmSilenceRequestData::toString(vData)); break; - case Gui::GuiActionType::ID_CreateTreatmentReq: { + case Gui::GuiActionType::ID_AlarmUserAckReq: if ( ! length ) { logInvalidLength(vActionId); return false; } vPayload = Format::fromVariant(vData); - MAdjustTreatmentParametersRequest params; - params.fromVariantList(vData); - LOG_EVENT(params.toString()); - } break; + LOG_EVENT(AlarmAcknowledgeRequestData::toString(vData)); + break; - default: { + case Gui::GuiActionType::ID_StartTreatmentReq: + if ( ! length ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(StartTreatmentRequestData::toString(vData)); + break; + + case Gui::GuiActionType::ID_ConfirmTreatmentReq: + if ( length != 0 ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(ConfirmTreatmentRequestData::toString(vData)); + break; + + case Gui::GuiActionType::ID_EndTreatmentReq: + if ( length != 0 ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(EndTreatmentRequestData::toString(vData)); + break; + + case Gui::GuiActionType::ID_CreateTreatmentReq: + if ( ! length ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustTreatmentParametersRequestData::toString(vData)); + break; + + default: QString mActionIdHexString = Format::toHexString(vActionId); LOG_DEBUG(mSenderID + tr("Unknown transmit Message with ID '%1'").arg(mActionIdHexString)); ok = false; - } break; - + break; } return ok; } @@ -334,6 +356,7 @@ case Gui::GuiActionType::ID_TreatmentRanges : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentRanges ); break; case Gui::GuiActionType::ID_PressureOcclusion : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PressureOcclusion ); break; case Gui::GuiActionType::ID_TreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStates ); break; + case Gui::GuiActionType::ID_PrimingData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PrimingData ); break; case Gui::GuiActionType::ID_Saline : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Saline ); break; // ----- Events @@ -346,6 +369,7 @@ case Gui::GuiActionType::ID_AlarmStatus : ok = alarmStatus (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_AlarmTriggered : ok = alarmTriggered (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_AlarmCleared : ok = alarmCleared (vMessage, vData); break; // TODO : implement notify<>() + case Gui::GuiActionType::ID_CreateTreatmentRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_CreateTreatmentRsp ); break; // Adjustment Response Messages case Gui::GuiActionType::ID_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); break; @@ -359,11 +383,12 @@ case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); break; // TODO : implement notify<>() - case Gui::GuiActionType::ID_CreateTreatmentRsp : ok = createTreatmentRespData (vMessage, vData); break; - // unhandles messages: these will only be logged as received message + case Gui::GuiActionType::ID_StartTreatmentRsp : ok = notify (vMessage, vData, Gui::GuiActionType::ID_StartTreatmentRsp ); break; + case Gui::GuiActionType::ID_EndTreatmentRsp : ok = notify (vMessage, vData, Gui::GuiActionType::ID_EndTreatmentRsp ); break; + // unhandles messages: these will only be logged as received message // there has nothing been defined for these messages. - default : printUnhandled (vMessage ); break; + default : printUnhandled (vMessage ); break; } return ok; @@ -596,26 +621,3 @@ return ok; } - -/*! - * \brief MessageInterpreter::createTreatmentRespData - * Checks the validity of the create treatment response data. - * \param vMessage - The message - * \param vData - the output data - * \return true if ok, false otherwise - */ -bool MessageInterpreter::createTreatmentRespData(const Message &vMessage, QVariantList &vData) { - bool ok = false; - if ( ! isType (vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; - if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; - - Model::MTreatmentParametersResponse mData; - ok = mData.fromByteArray(vMessage.data); - LOG_DATUM(mData.toString()); - - mData.toVariantList(vData); - emit didActionReceive(mData.data()); - - return ok; - -} Index: sources/gui/GuiController.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/GuiController.cpp (.../GuiController.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,16 +1,26 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +<<<<<<< HEAD:sources/gui/guicontroller.cpp + * + * \file guicontroller.cpp + * \author (last) Behrouz NematiPour + * \date (last) 25-Aug-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Sep-2019 + * +======= * * \file GuiController.cpp * \author (last) Peter Lucia * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * +>>>>>>> master:sources/gui/GuiController.cpp */ #include "GuiController.h" Index: sources/gui/GuiController.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/GuiController.h (.../GuiController.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/GuiController.h (.../GuiController.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -101,5 +101,5 @@ // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_PUBLIC ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS -}; + }; } Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -49,8 +49,9 @@ #include "VDGReservoirData.h" #include "VDGTemperaturesData.h" #include "VDGValvesStatesData.h" - -#include "VCreateTreatment.h" +#include "VTreatmentCreate.h" +#include "VPriming.h" +#include "VTreatmentBegin.h" #include "VTreatmentAdjustmentDuration.h" #include "VTreatmentAdjustmentFlows.h" #include "VTreatmentAdjustmentUltrafiltrationEdit.h" @@ -88,7 +89,7 @@ void registerQmlTypes() { //using namespace View; - qmlRegisterType ("Gui.View" , 0, 1, "GuiView"); + qmlRegisterType ("Gui.View" , 0, 1, "GuiView"); qmlRegisterUncreatableType ("Gui.Actions" , 0, 1, "GuiActions" , QStringLiteral("Used only for enumerations no need to have an object")); qmlRegisterSingletonType ("Gui.VEventSpy", 0, 1, "GuiEventSpy", [](QQmlEngine *, QJSEngine *) -> QObject * { return &_VEventSpy; Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,5 +1,5 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN @@ -89,12 +89,19 @@ ID_AlarmStatus = 0x0200, ID_AlarmTriggered = 0x0300, ID_AlarmCleared = 0x0400, - ID_CreateTreatmentReq = 0x3500, // 53 - Not implemented yet on FW side - ID_CreateTreatmentRsp = 0x3600, // 54 - Not implemented yet on FW side + ID_AlarmUserAckReq = 0x3F00, // 63 + ID_AlarmSilenceReq = 0x3200, // 50 - ID_AlarmSilenceReq = 0x3200, // 50 - Not implemented yet on FW side - ID_AlarmSilenceRsp = 0x0000, // Needs to be removed. + ID_CreateTreatmentReq = 0x3500, // 53 + ID_CreateTreatmentRsp = 0x3600, // 54 + ID_StartTreatmentReq = 0x3800, // 56 + ID_StartTreatmentRsp = 0x3900, // 57 + ID_ConfirmTreatmentReq = 0x3A00, // 58 + ID_EndTreatmentReq = 0x3B00, // 59 + ID_EndTreatmentRsp = 0x3C00, // 60 + ID_PrimingData = 0x3700, // 55 + ID_HDOperationModeData = 0x2500, // 37 ID_DGROPumpData = 0x1F00, // 31 Index: sources/gui/qml/components/GridSelection.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,14 +1,15 @@ /*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * \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 SliderCreateTreatment.qml - * \date 2020/07/07 - * \author Peter Lucia + * \file RectSelectCreateTreatment.qml + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/components/NotificationBar.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file NotificationBar.qml - * \author (last) Behrouz NemaiPour - * \date (last) 06-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 30-Mar-2020 * Index: sources/gui/qml/components/RangeRect.qml =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file RangeRect.qml - * \author (last) Behrouz NemaiPour - * \date (last) 04-Jun-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Jan-2020 * Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file Slider.qml - * \author (last) Behrouz NemaiPour - * \date (last) 04-Jun-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 18-Mar-2020 * @@ -107,7 +107,7 @@ value = getValueOfX(x) - if ( step === 1 ) { /* keep the value and return */ return; } + if ( step === 1 ) { value = parseInt(value); return; } var start = 0 if ( ! stepSnap ) start = minimum Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,14 +1,15 @@ /*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * \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 SliderCreateTreatment.qml - * \date 2020/07/07 - * \author Peter Lucia + * \file SliderCreateTreatment.qml + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 07-Jul-2020 * */ Index: sources/gui/qml/components/SliderDoubleCreateTreatment.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/SliderDoubleCreateTreatment.qml (.../SliderDoubleCreateTreatment.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/components/SliderDoubleCreateTreatment.qml (.../SliderDoubleCreateTreatment.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,14 +1,15 @@ /*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * \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 SliderCreateTreatment.qml - * \date 2020/07/07 - * \author Peter Lucia + * \file SliderDoubleCreateTreatment.qml + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/components/TopMenuBarCreateTreatment.qml =================================================================== diff -u -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/TopMenuBarCreateTreatment.qml (.../TopMenuBarCreateTreatment.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) +++ sources/gui/qml/components/TopMenuBarCreateTreatment.qml (.../TopMenuBarCreateTreatment.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,14 +1,15 @@ /*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * \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 SliderCreateTreatment.qml - * \date 2020/07/07 - * \author Peter Lucia + * \file TopMenuBarCreateTreatment.qml + * \author (last) Peter Lucia + * \date (last) 28-Aug-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file TouchRect.qml - * \author (last) Behrouz NemaiPour - * \date (last) 15-Jun-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 18-Oct-2019 * Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file NotificationDialog.qml - * \author (last) Behrouz NematiPour - * \date (last) 20-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Peter Lucia * \date (original) 02-Jun-2020 * Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -7,7 +7,7 @@ * * \file Colors.qml * \author (last) Peter Lucia - * \date (last) 01-Jul-2020 + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 17-Oct-2019 * @@ -55,7 +55,7 @@ readonly property color borderButton : "#4290EC" //K:D //"#438FEB" readonly property color borderDisableButton : "#607A91" readonly property color boderSeparatorLine : "#476982" - readonly property color borderDialog : "transparent" // "#D01A344D" // "#D00F0F0F" //"#F51A344D" + readonly property color borderDialog : "transparent" // different colors for different displays // "#D01A344D" // "#D00F0F0F" //"#F51A344D" readonly property color touchTextAreaTitle : "#a0b6d0" Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -r32bc2f04da62ae95a041945b449d2c40465f9308 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 32bc2f04da62ae95a041945b449d2c40465f9308) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -7,7 +7,7 @@ * * \file Fonts.qml * \author (last) Peter Lucia - * \date (last) 06-Jul-2020 + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 17-Oct-2019 * @@ -56,8 +56,6 @@ readonly property int fontPixelDurationCurTime : 89 readonly property int fontPixelDurationAdjTime : 28 - - readonly property int fontPixelUltrafiltrationAdjustmentPauseButton : 26 readonly property int fontPixelUltrafiltrationAdjustmentResumeButton : 30 readonly property int fontPixelUltrafiltrationAdjustmentEditButton : 30 @@ -69,6 +67,4 @@ readonly property int primingFontSize : 20 readonly property int crTreatmentFontSize : 30 readonly property int crTreatmentTableFontSize : 24 - - } Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file Variables.qml - * \author (last) Behrouz NematiPour - * \date (last) 10-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 09-Oct-2019 * Index: sources/gui/qml/main.qml =================================================================== diff -u -radf89000bad1a50ec33114ea76d65621a1d351d5 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/main.qml (.../main.qml) (revision adf89000bad1a50ec33114ea76d65621a1d351d5) +++ sources/gui/qml/main.qml (.../main.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file main.qml - * \author (last) Behrouz NematiPour - * \date (last) 25-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * @@ -194,7 +194,7 @@ color: Colors.textMain anchors { right: parent.right - margins: 10 + margins: 5 bottom: parent.bottom } horizontalAlignment: Text.AlignRight Index: sources/gui/qml/pages/treatment/TreatmentBegin.qml =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/pages/treatment/TreatmentBegin.qml (.../TreatmentBegin.qml) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/gui/qml/pages/treatment/TreatmentBegin.qml (.../TreatmentBegin.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,16 +1,15 @@ /*! * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentCreate.qml + * \file TreatmentBegin.qml * \author (last) Peter Lucia - * \date (last) 17-07-2020 - * \author (original) Behrouz NematiPour - * \date (original) 27-Jan-2020 + * \date (last) 05-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/pages/treatment/TreatmentConfirm.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,16 +1,15 @@ /*! * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentConfirm.qml + * \file TreatmentConfirm.qml * \author (last) Peter Lucia - * \date (last) 17-07-2020 + * \date (last) 05-Oct-2020 * \author (original) Peter Lucia - * \date (original) 17-07-2020 + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -ra67227573c4c8e7df862325c67eb51e9b96e6898 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision a67227573c4c8e7df862325c67eb51e9b96e6898) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,14 +1,13 @@ /*! * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentCreate.qml + * \file TreatmentCreate.qml * \author (last) Peter Lucia - * \date (last) 17-07-2020 + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * Index: sources/gui/qml/pages/treatment/TreatmentPrime.qml =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/pages/treatment/TreatmentPrime.qml (.../TreatmentPrime.qml) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/gui/qml/pages/treatment/TreatmentPrime.qml (.../TreatmentPrime.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,16 +1,15 @@ /*! * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentCreate.qml + * \file TreatmentPrime.qml * \author (last) Peter Lucia - * \date (last) 17-07-2020 - * \author (original) Behrouz NematiPour - * \date (original) 27-Jan-2020 + * \date (last) 05-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 * */ Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r1d2ab4adce5e88a7e316cad3c75e519704511813 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 1d2ab4adce5e88a7e316cad3c75e519704511813) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file TreatmentStack.qml - * \author (last) Behrouz NematiPour - * \date (last) 18-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 02-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * Index: sources/main.h =================================================================== diff -u -r846a9ebc350e33be4affab3cc4c136248900015d -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/main.h (.../main.h) (revision 846a9ebc350e33be4affab3cc4c136248900015d) +++ sources/main.h (.../main.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file main.h - * \author (last) Behrouz NematiPour - * \date (last) 30-Jul-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 28-Oct-2019 * @@ -33,6 +33,10 @@ vCLASS(vCLASS const &) = delete; \ vCLASS & operator = (vCLASS const &) = delete; \ public: \ + /*! \brief instance accessor + \details A singleton class single instance creator/accessor + \return reference to the class static instance + */\ static vCLASS &I() { \ static vCLASS _instance; \ return _instance; \ @@ -50,46 +54,77 @@ //--------------------------------------------------------------------------------// #define DEBUG_PROPERTY_CHANGED(vVARIABLE, PREFIX) // qDebug() << "#" << #vVARIABLE << PREFIX##vVARIABLE; //--------------------------------------------------------------------------------// -#define PROPERTY_SLOT( vTYPE , vVARIABLE ) \ - protected : \ - void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ - static bool init = false; \ - if ( !init || _##vVARIABLE != v##vVARIABLE ) { \ - DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ - init = true; \ - _##vVARIABLE = v##vVARIABLE; \ - emit vVARIABLE##Changed( _##vVARIABLE ); \ - } \ +#define PROPERTY_SLOT( vTYPE , vVARIABLE ) \ + protected : \ + /*! \brief Property setter + \details The property setter which update the private variable \n + - if only the value has been changed \n + - or it's the first time property is set. \n + emits the Property notify (...Changed) signal on update. \n + the notify signal (...Changed) passes the new value as its parameter. \n + \param new value + */\ + void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ + static bool init = false; \ + if ( !init || _##vVARIABLE != v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + init = true; \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Changed( _##vVARIABLE ); \ + } \ } //--------------------------------------------------------------------------------// -#define TRIGGER_SLOT( vTYPE , vVARIABLE ) \ - protected: \ - void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ - DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ - _##vVARIABLE = v##vVARIABLE; \ - emit vVARIABLE##Triggered( _##vVARIABLE ); \ +#define TRIGGER_SLOT( vTYPE , vVARIABLE ) \ + protected: \ + /*! \brief Trigger setter + \details The Trigger setter which update the private variable \n + with no condition each time the value the passed. \n + emits the Trigger notify (...Triggered) signal after update. \n + the notify signal (...Triggered) passes the new value as its parameter.\n + \param new value + */\ + void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Triggered( _##vVARIABLE ); \ } //--------------------------------------------------------------------------------// -#define PROPERTY_BASE(vTYPE , vVARIABLE , vDEFVALUE, vSIGNAL) \ - Q_PROPERTY( vTYPE vVARIABLE \ - READ vVARIABLE \ - WRITE vVARIABLE \ - NOTIFY vVARIABLE##vSIGNAL) \ - Q_SIGNALS: \ - void vVARIABLE##vSIGNAL( const vTYPE & v##vVARIABLE ); \ - private: \ - vTYPE _##vVARIABLE = vDEFVALUE; \ - protected: \ - vTYPE vVARIABLE () const { \ - return _##vVARIABLE ; \ - } +#define PROPERTY_BASE(vTYPE , vVARIABLE , vDEFVALUE, vSIGNAL) \ + /*! \brief Qt Property declaration + \details The Qt Property definition by Q_PROPERTY documentation. + */\ + Q_PROPERTY( vTYPE vVARIABLE \ + READ vVARIABLE \ + WRITE vVARIABLE \ + NOTIFY vVARIABLE##vSIGNAL) \ + Q_SIGNALS: \ + /*! \brief Property notify signal + \details The property notify signal (...Changed) + which will be emitted by property setter + - if only the value has been changed \n + - or it's the first time property is set. \n + \return current value + */\ + void vVARIABLE##vSIGNAL( const vTYPE & v##vVARIABLE ); \ + private: \ + vTYPE _##vVARIABLE = vDEFVALUE; \ + protected: \ + /*! \brief Property getter + \details The property getter which reads the private variable + \return current value + */\ + vTYPE vVARIABLE () const { \ + return _##vVARIABLE ; \ + } //--------------------------------------------------------------------------------// -#define PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ - PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ +#define PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ + \ + PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ PROPERTY_SLOT( vTYPE , vVARIABLE) //--------------------------------------------------------------------------------// -#define TRIGGER( vTYPE , vVARIABLE , vDEFVALUE ) \ - PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Triggered) \ +#define TRIGGER( vTYPE , vVARIABLE , vDEFVALUE ) \ + \ + PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Triggered) \ TRIGGER_SLOT( vTYPE , vVARIABLE) //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// @@ -114,53 +149,91 @@ //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_PRIVATE_SLOT(vTYPE) \ private Q_SLOTS: \ + /*! \brief Bridge slot + \details The bridge slot is for thread safety between classes for received message + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is private and the interface is signals only. (starts with 'on') + */\ void onActionReceive (const vTYPE &vData) { \ emit didActionReceive(vData); \ } //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PRIVATE_SLOT_DEFINITION(vTYPE) \ private Q_SLOTS: \ + /*! \brief Adjustment slot + \details The bridge slot is for thread safety between classes for adjustment messages + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data to be used for adjustment + \note This method is private and the interface is signals only. (starts with 'on') + This slot has to have its specific implementation and is not a bridge (not a signal emitter). + */\ void onAdjustment (const vTYPE &vData); //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PRIVATE_SLOT(vTYPE) \ private Q_SLOTS: \ + /*! \brief Adjustment bridge slot + \details The bridge slot is for thread safety between classes for adjustment messages + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data to be used for adjustment + \note This method is private and the interface is signals only. (starts with 'on') + */\ void onAdjustment (const vTYPE &vData) { \ emit didAdjustment( vData); \ } //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PUBLIC_SLOT(vTYPE) \ public Q_SLOTS: \ + /*! \brief Adjustment invocable/exposed slot + \details This slot is able to be called within QML context + when an object of the class is instantiated in QML. + For thread safety it's calling its designated signal to notify observers. + \note This method is public and is the interface. (starts with 'do') + */\ void doAdjustment (const vTYPE &vData) { \ emit didAdjustment( vData); \ } //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_SIGNAL(vTYPE) \ Q_SIGNALS: \ + /*! \brief Receive bridge signal + \details The bridge signal is for thread safety between classes for received message + and is used to be emitted in its slot to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is public to be exposed to the observers to be able to connect to it as the interface. (starts with 'did') + */\ void didActionReceive (const vTYPE &vData); //--------------------------------------------------------------------------------// -#define ACTION_TRANSMT_SIGNAL(vTYPE) \ -Q_SIGNALS: \ - void didActionTransmit(const vTYPE &vData); -//--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_SIGNAL(vTYPE) \ Q_SIGNALS: \ + /*! \brief Adjustment bridge signal + \details The bridge signal is for thread safety between classes for received message + and is used to be emitted in its slot to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is public to be exposed to the observers to be able to connect to it as the interface. (starts with 'did') + */\ void didAdjustment (const vTYPE &vData); //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_BRIDGE_DEFINITION(vTYPE) \ + \ ACTION_RECEIVE_PRIVATE_SLOT (vTYPE) \ - ACTION_RECEIVE_SIGNAL (vTYPE) + ACTION_RECEIVE_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT(vTYPE) \ + \ ADJUST_TRANSMT_PRIVATE_SLOT_DEFINITION (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION(vTYPE) \ + \ ADJUST_TRANSMT_PRIVATE_SLOT (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC(vTYPE) \ + \ ADJUST_TRANSMT_PUBLIC_SLOT (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ + //--------------------------------------------------------------------------------// #define REGISTER_METATYPE(vTYPE) \ qRegisterMetaType < vTYPE > (#vTYPE); Index: sources/model/MModel.h =================================================================== diff -u -rbfde9964a92b954e7da925e0d04e797a225a5352 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/model/MModel.h (.../MModel.h) (revision bfde9964a92b954e7da925e0d04e797a225a5352) +++ sources/model/MModel.h (.../MModel.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file MModel.h - * \author (last) Behrouz NematiPour - * \date (last) 20-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * @@ -58,71 +58,126 @@ #include "MTreatmentAdjustSalineResponse.h" /*! - * \brief Message interpretation instruction - * \details This comment explains how to add a Denali Message in Denali UI Application + * \page MessageFlow Message interpretation Flow + * \dot + * digraph callgraph { + * node [shape=ellipse, fontname=Arial, fontsize=11]; + * user [shape=box ]; + * QML [URL="\ref application/sources/gui" ]; + * GuiView [URL="\ref Gui::GuiView" ]; + * View [URL="\ref application/sources/view" ]; + * GuiController [URL="\ref Gui::GuiController" ]; + * ApplicationController [URL="\ref ApplicationController" ]; + * FrameInterface [URL="\ref Can::FrameInterface" ]; + * CanInterface [URL="\ref Can::CanInterface" ]; + * CANBus [shape=box ]; + * subgraph MessageDispatcher { + * node [shape=ellipse, fontname=Arial, fontsize=11, URL="\ref Can::MessageDispatcher"]; + * label = "Message_Dispatcher"; + * MessageAcknow [URL="\ref Can::MessageAcknowModel" ]; + * MessageInterpreter [URL="\ref Can::MessageInterpreter" ]; + * MessageBuilder [URL="\ref Can::MessageBuilder" ]; + * MessageDispatcher -> MessageInterpreter [dir="both" ]; + * MessageDispatcher -> MessageAcknow [dir="both" ]; + * MessageInterpreter -> MessageBuilder [dir="both" ]; + * } + * user -> QML [dir="both" ]; + * QML -> { GuiView } [dir="both" ]; + * { GuiView, } -> GuiController [dir="both" ]; + * GuiController -> ApplicationController [dir="both" ]; + * ApplicationController -> MessageDispatcher [dir="both" ]; + * MessageDispatcher -> FrameInterface [dir="both" ]; + * FrameInterface -> CanInterface [dir="both" ]; + * CanInterface -> CANBus [dir="both" ]; + * } + * \enddot * - * 1 - Look at the message structure in the "message list.xlsx" + * \note + * 00 - sort .pro file after all new files added. * - * 2 - MSG ID : - * Add an enum for the message in the guiglobals.h : GuiActionsType_Enum - * and assign a correct message value to it. - * example : MSG ID = 9 => - * \code{.cpp} - * PressureOcclusion = 0x0900, //(little endian) - * \endcode + * \details + * This comment explains how to add a Denali Message in Denali UI Application * - * 3 - MSG Payload Len : - * Add a line in the "messageglobals.h" in payloadLen hash table - * to define the required payload length of the message + * Model : * - * 4 - Model Implementation : - * Implement a model like MPressureOcclusion by copy/paste the closest model .h/.cpp file - * and adding it to project and modify to fit the new model. + * 01 - Look at the message structure in the "message list.xlsx" and in GuiGlobals.h define enum ID_ + * Add an enum for the message in the guiglobals.h : GuiActionsType_Enum + * and assign a correct message value to it. + * Note that it needs to be in little endian so if you have a message Id of 37 your enum should have a value of 0x2500 in hex. + * \code{.cpp} + * ID_HDOperationModeData = 0x2500, // 37 // little endian + * \endcode * - * 5 - Register Model : - * Add the required lines like the other models in the mmodel.h file. + * 02 - MessageGlobals.h : add len + * \code{.cpp} + * {Gui::GuiActionType::ID_HDOperationModeData , 1 * 4 }, // 1 parameter each 4bytes + * \endcode * - * 6 - Populate/Interpret Model Data : - * Copy/Paste one of the other implementations of the Messages setter/getter. - * example : be careful about the type. - * in the header should be like: - * \code{.cpp} - * bool pressureOcclusionData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - * \endcode - * in the implementation should be like: - * \code{.cpp} - * bool MessageInterpreter::pressureOcclusionData(const Message &vMessage, QVariantList &vData) - * { - * // TODO : review other methods - * bool ok = false; - * if ( ! isType (vMessage, Gui::GuiActionType::PressureOcclusion) ) return ok; - * if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::PressureOcclusion) ) return ok; + * 03 - Implement the model by copy/paste of the closest model, fit to your need. + * \sa MHDOperationMode + * \sa MHDOperationModeData.h + * \sa MHDOperationModeData.cpp * - * Model::MPressureOcclusion mData; - * ok = mData.fromByteArray(vMessage.data); - * LOG_DATUM("HD," + mData.toString()); + * 04 - Added #include in MModel.h for the implemented model + * \code{.cpp} + * #include "MHDOperationModeData.h" + * \endcode * - * mData.toVariantList(vData); - * emit didActionReceive(mData.data()); + * 05 - Register the model in MModel.h by adding it to the macro lists : + * - \ref REGISTER_MODEL_METATYPES + * - \ref ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + * - \ref ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + * - \ref ACTION_RECEIVE_SIGNALS * - * return ok; - * } - * \endcode + * 06 - In the MessageInterpreter add a line of handler in interpretMessage_ method + * and put the enum and model. + * \sa MessageInterpreter::interpretMessage_HD + * \sa MessageInterpreter::interpretMessage_DG + * \sa MessageInterpreter.cpp * - * Add a case in MessageInterpreter::interpretMessage_HD for that message id Enum - * with lines like : - * \code{.cpp} - * case Gui::GuiActionType::PressureOcclusion: - * ok = pressureOcclusionData (vMessage, vData); - * break; - * \endcode + * View : + * 07 - Implement the view by copy/paste of the closest view, fit to your need. + * \sa VHDOperationMode + * \sa VHDOperationModeData.h + * \sa VHDOperationModeData.cpp * + * 08 - Register the view in VView.h in macro list + * \sa REGISTER_VIEW_TYPES + * \sa VView.h + * + * 09 - Include the view header in the GuiGlobals.cpp + * \code{.cpp} + * #include "VHDOperationModeData.h" + * \endcode + * \sa GuiGlobals.cpp + * + * QML : + * 10 - Import the registered view + * \code{.js} + * import VHDOperationMode 0.1; + * \endcode + * \sa main.qml + * + * 11 - Create an object + * \code{.js} + * VHDOperationMode { id: vHDOperationMode } + * \endcode + * \sa main.qml + * + * 12 - Use it. */ + //--------------------------------------------------------------------------------// //-------- Please add the model type to the lists below to register them ---------// //--------------------------------------------------------------------------------// + +/*! + \def REGISTER_MODEL_METATYPES + \details Registers the models in the Qt MetaType so it can be used in signal/slots between threads. + */ #define REGISTER_MODEL_METATYPES \ + \ REGISTER_METATYPE( BloodFlowData ) \ REGISTER_METATYPE( DialysateFlowData ) \ REGISTER_METATYPE( OutletFlowData ) \ @@ -179,7 +234,21 @@ REGISTER_METATYPE( AdjustTreatmentParametersResponseData ) //===============================================================================// +/*! + \def ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + \details This macro connects the source object vSource to the models defined in the list for received messages. + It connects source didActionReceive() signal to the this pointer of the class object + onActionReceive(). + The code below is implemented for each model : + \code {.cpp} + connect(&vSOURCE, SIGNAL(didActionReceive(const vTYPE &)), + this , SLOT( onActionReceive(const vTYPE &))); + \endcode + This macro should be used in the cpp file of the class. + This macro should be used with its counterpart macro \ref ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + */ #define ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ + \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \ @@ -217,8 +286,10 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, EndTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSalineResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustTreatmentParametersResponseData ) -//===============================================================================// + +// /* Request */ ---------------------------------------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ + \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateRequestData ) \ @@ -231,8 +302,26 @@ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustTreatmentParametersRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AlarmAcknowledgeRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AlarmSilenceRequestData ) + //===============================================================================// +/*! + \def ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + \details This macro defines the signal/slot of the source object vSource to the models + listed in its definition for received messages. + The code below will be implemented for each model : + \code {.cpp} + private slots: + void onActionReceive (const vTYPE &vData) { + emit didActionReceive(vData); + } + signals: + void didActionReceive (const vTYPE &vData); + \endcode + This macro should be used in the header file of the class. + This macro should be used with its counterpart macro \ref ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + */ #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ + \ ACTION_RECEIVE_BRIDGE_DEFINITION( BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \ @@ -270,8 +359,9 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( EndTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSalineResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustTreatmentParametersResponseData ) -// /* Request */ ---------------------------------------------------------// + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS \ + /* Request --------------------------------------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationStateRequestData ) \ @@ -284,8 +374,9 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustTreatmentParametersRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmAcknowledgeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmSilenceRequestData ) -// /* Request */ ----------------------- NoEmit --------------------------// + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_NOEMIT \ + /* Request ----------------------- NoEmit -------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationStateRequestData ) \ @@ -298,8 +389,9 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustTreatmentParametersRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmAcknowledgeRequestData ) -// /* Request */ ----------------------- public --------------------------// + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_PUBLIC \ + /* Request ----------------------- public -------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationStateRequestData ) \ @@ -314,6 +406,7 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AlarmSilenceRequestData ) //===============================================================================// #define ACTION_RECEIVE_SIGNALS \ + /* Received signals */ \ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \ ACTION_RECEIVE_SIGNAL( DialysateFlowData ) \ ACTION_RECEIVE_SIGNAL( OutletFlowData ) \ Index: sources/model/MTreatmentParametersResp.cpp =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/model/MTreatmentParametersResp.cpp (.../MTreatmentParametersResp.cpp) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/model/MTreatmentParametersResp.cpp (.../MTreatmentParametersResp.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,3 +1,17 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentParametersResp.cpp + * \author (last) Peter Lucia + * \date (last) 14-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 08-Sep-2020 + * + */ #include "MTreatmentParametersResp.h" using namespace Model; Index: sources/model/MTreatmentParametersResp.h =================================================================== diff -u -rd47617a89c852ffc38d6a0c62eb18ea41ae27d29 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/model/MTreatmentParametersResp.h (.../MTreatmentParametersResp.h) (revision d47617a89c852ffc38d6a0c62eb18ea41ae27d29) +++ sources/model/MTreatmentParametersResp.h (.../MTreatmentParametersResp.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,3 +1,17 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentParametersResp.h + * \author (last) Peter Lucia + * \date (last) 14-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 08-Sep-2020 + * + */ #ifndef MTREATMENTPARAMETERSRESP_H #define MTREATMENTPARAMETERSRESP_H Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -r24dfaab03aaabc7b7714c5a4264dfbfca65aa41a -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 24dfaab03aaabc7b7714c5a4264dfbfca65aa41a) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -7,7 +7,7 @@ * * \file MTreatmentAdjustRequests.h * \author (last) Behrouz NematiPour - * \date (last) 10-Aug-2020 + * \date (last) 25-Sep-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * @@ -16,10 +16,10 @@ #pragma once // Qt -#include +#include //project -#include "guiglobals.h" +#include "GuiGlobals.h" namespace Model { @@ -31,16 +31,37 @@ * Otherwise the parameters are so tiny models. */ -#include - class MModel { protected: + /*! + * \brief toString + * \details the global toString function for all the request message models + * which is mainly used for logging and debugging. + * \param vStringPrefix - a prefix string to be inserted after senderID (UI) and parameter values list. + * This is comma separated. + * \param vParameters - list of parameter values of the model as a comma separated string. + * \return QString + */ static QString toString (const QString &vStringPrefix, const QVariant &vParameters) { QString senderID = "UI,"; return QString(senderID + vStringPrefix + "," + vParameters.toStringList().join(',')); } }; +/*! + * \brief The MAdjustPowerOffReq class + * \details The power off request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x0100| 0x020 | 6 | Cmd | N | HD | UI | Power Off | + * + * | Payload || + * | || + * | #1:(U08) | \ref state | + * + * + */ class MAdjustPowerOffReq : public MModel { public: quint8 state; @@ -57,6 +78,21 @@ } }; +/*! + * \brief The MAdjustBloodDialysateReq class + * \details The blood/dialysate rate change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1700| 0x100 | 9 | Req | Y | UI | HD | Blood/dialysate rate Change | + * + * | Payload || + * | || + * | #1:(U32) | \ref bloodFlow | + * | #2:(U32) | \ref dialysateFlow | + * + * + */ class MAdjustBloodDialysateReq : public MModel { public: quint32 bloodFlow = 0; @@ -72,6 +108,19 @@ } }; +/*! + * \brief The MAdjustDurationReq class + * \details The treatment duration change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1600| 0x100 | 9 | Req | Y | UI | HD | Treatment Duration Change Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref duration | + * + */ class MAdjustDurationReq : public MModel { public: quint32 duration = 0; @@ -86,12 +135,26 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationStateReq class + * \details The ultrafiltration pause/resume request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1000| 0x100 | 9 | Req | Y | UI | HD | UF Pause/Resume | + * + * | Payload || + * | || + * | #1:(U32) | \ref requestedState | + * + */ class MAdjustUltrafiltrationStateReq : public MModel { public: enum State{ ePaused = 0, eRunning = 1, - }; + }; + State requestedState = ePaused; // the requested state. Initially it's running => paused. // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. @@ -104,6 +167,19 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationEditReq class + * \details The ultrafiltration volume change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1100| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change Request | + * + * | Payload || + * | || + * | #1:(F32) | \ref volume | + * + */ class MAdjustUltrafiltrationEditReq : public MModel { public: float volume = 0; @@ -118,12 +194,29 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationConfirmReq class + * \details The ultrafiltration volume change user confirm request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1500| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change User Confirm | + * + * | Payload || + * | || + * | #1:(F32) | \ref volume | + * | #2:(U32) | \ref option | + * + * \sa Options + * + */ class MAdjustUltrafiltrationConfirmReq : public MModel { public: enum Options : quint32 { eDuration = Gui::GuiActions::UF_ADJ_TREATMENT_TIME, eRate = Gui::GuiActions::UF_ADJ_UF_RATE, - }; + }; + float volume = 0; Options option = eDuration; // coco begin validated : Has been validated manually. @@ -137,12 +230,30 @@ } }; +/*! + * \brief The MAdjustSalineReq class + * \details The model to request the Saline Bolus state + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| + * | 18 | 0x100 | 9 | Req | Y | UI | HD | Saline Bolus Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref requestedState | + * + * \sa State + * \sa MTreatmentSaline : Saline Bolus Data + * \sa MAdjustSalineResponse : Saline Bolus Response + * + */ class MAdjustSalineReq : public MModel { public: enum State { eStop = 0, eStart = 1, - }; + }; + State requestedState = eStop; // the requested state. Initially it's Stop => start. // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. @@ -155,6 +266,19 @@ } }; +/*! + * \brief The MAlarmSilenceReq class + * \details The model to request alarm silent + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| + * | | | | Req | Y | UI | HD | Alarm Silent Request | + * + * | Payload || + * | || + * | #1:(U32) | TBD | + * + */ class MAlarmSilenceReq : public MModel { public: quint8 state; Index: sources/model/hd/alarm/MAlarmStatusData.h =================================================================== diff -u -radf89000bad1a50ec33114ea76d65621a1d351d5 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/model/hd/alarm/MAlarmStatusData.h (.../MAlarmStatusData.h) (revision adf89000bad1a50ec33114ea76d65621a1d351d5) +++ sources/model/hd/alarm/MAlarmStatusData.h (.../MAlarmStatusData.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file MAlarmStatusData.h - * \author (last) Behrouz NemaiPour - * \date (last) 06-Aug-2020 + * \author (last) Behrouz NematiPour + * \date (last) 25-Sep-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * @@ -19,13 +19,39 @@ // Project #include "types.h" -#include "guiglobals.h" +#include "GuiGlobals.h" // forward declarations class tst_models; namespace Model { +/*! + * \brief The MAlarmStatus class + * \details The alarm status model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x0200| 0x001 | 1 | 1 Hz | N | HD | All | Alarm Status | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mState | + * | #2:(U32) | \ref Data::mTop | + * | #3:(U32) | \ref Data::mEscalatesIn | + * | #4:(U32) | \ref Data::mMuteTimeout | + * | #5:(U16) | \ref Data::mFlags | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | HD | + * | infoText | Alarm Status | + * + */ class MAlarmStatus { // friends @@ -46,13 +72,14 @@ eFlag_userAcknowledged , eFlag_Bits_Length = 16, }; + QString stringPrefix = "Alarm Status"; struct Data { - quint32 mState = 0; /*!< State - Alarm Priority value of type unsigned int as 4 bytes extracted out */ - quint32 mTop = 0; /*!< Top - Top value of type unsigned int as 4 bytes extracted out */ - quint32 mEscalatesIn = 0; /*!< EscalatesIn - EscalatesIn value of type unsigned int as 4 bytes extracted out */ - quint32 mMuteTimeout = 0; /*!< MuteTimeout - MuteTimeout value of type unsigned int as 4 bytes extracted out */ - QBitArray mFlags ; /*!< Flags - Flags value of type unsigned int as 1 byte extracted out */ + quint32 mState = 0; ///< State - Alarm Priority + quint32 mTop = 0; ///< Top - Top current alarm ID + quint32 mEscalatesIn = 0; ///< EscalatesIn - EscalatesIn + quint32 mMuteTimeout = 0; ///< MuteTimeout - MuteTimeout + QBitArray mFlags ; ///< Flags - Flags }; private: @@ -67,14 +94,13 @@ public: MAlarmStatus(); - QString toString ( ) const ; + QString toString ( ) const ; void toVariantList ( QVariantList &vData ) const ; bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); static QString toText ( Gui::GuiAlarmID vAlarmID); Data data() const ; }; - } typedef Model::MAlarmStatus::Data AlarmStatusData; Index: sources/storage/FileHandler.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -46,7 +46,7 @@ // coco end count = 0; mCritical = vMessage; - QTextStream err(stderr); + QTextStream err(stderr); err << "FS" << " " << QDate::currentDate().toString("yyyy_MM_dd") << " " << QTime::currentTime().toString("HH:mm:ss" ) << " " Index: sources/storage/FileHandler.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/storage/FileHandler.h (.../FileHandler.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/storage/FileHandler.h (.../FileHandler.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,5 +1,5 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,5 +1,5 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,5 +1,5 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN Fisheye: Tag b61d8a3e01fef66eee8095c9cddf835d9bb32b66 refers to a dead (removed) revision in file `sources/view/VCreateTreatment.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/VPriming.cpp =================================================================== diff -u -r074b32b5cc08f41f2d9ce0d021f2151b76bba5ad -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/VPriming.cpp (.../VPriming.cpp) (revision 074b32b5cc08f41f2d9ce0d021f2151b76bba5ad) +++ sources/view/VPriming.cpp (.../VPriming.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -15,7 +15,7 @@ #include "VPriming.h" // Project -#include "guicontroller.h" +#include "GuiController.h" using namespace Gui; using namespace View; Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,9 +1,23 @@ -#include "VTreatmentCreate.h" +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentCreate.cpp + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 + * \author (original) Peter Lucia + * \date (original) 03-Aug-2020 + * + */ // Qt // Project -#include "filehandler.h" +#include "VTreatmentCreate.h" +#include "FileHandler.h" #include "MsgDefs.h" using namespace Gui; Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -11,8 +11,8 @@ // Project #include "MTreatmentParametersResp.h" -#include "guicontroller.h" -#include "storageglobals.h" +#include "GuiController.h" +#include "StorageGlobals.h" #include "filesaver.h" // forward diclations Index: sources/view/VView.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/VView.h (.../VView.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/view/VView.h (.../VView.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * \file VView.h - * \author (last) Peter Lucia - * \date (last) 15-Oct-2020 + * + * \file vview.h + * \author (last) Behrouz NematiPour + * \date (last) 13-Aug-2020 * \author (original) Behrouz NematiPour - * \date (original) 26-Aug-2020 - * + * \date (original) 10-Mar-2020 + * */ #pragma once @@ -130,7 +130,9 @@ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationConfirm ) \ - REGISTER_TYPE( VCreateTreatment ) \ - REGISTER_TYPE( VTreatmentAdjustmentSaline ) \ + REGISTER_TYPE( VTreatmentCreate ) \ + REGISTER_TYPE( VPriming ) \ + REGISTER_TYPE( VTreatmentBegin ) \ + REGISTER_TYPE( VTreatmentAdjustmentSaline ) //--------------------------------------------------------------------------------// Index: sources/view/hd/alarm/VAlarmStatus.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -26,6 +26,12 @@ connect(this, SIGNAL(requestActionTransmit(GuiActionType,QVariantList)), &_GuiController, SLOT(doActionTransmit(GuiActionType,QVariantList))); + + connect(this, SIGNAL(requestAlarmAcknowledge(AlarmAcknowledgeRequestData)), + &_GuiController, SLOT(doAdjustment(AlarmAcknowledgeRequestData))); + + connect(this, SIGNAL(requestAlarmSilence(AlarmSilenceRequestData)), + &_GuiController, SLOT(doAdjustment(AlarmSilenceRequestData))); } void VAlarmStatus::onActionReceive(const AlarmStatusData &vData) @@ -37,34 +43,28 @@ return; } - if (acknowledgedAlarms.contains(alarmID)) { - LOG_EVENT(tr("Alarm ID %0 has been acknowledged and is visible. ").arg(alarmID)); + if (vData.mTop == GuiAlarmID::ALARM_ID_NO_ALARM) { + emit noAlarm(); return; } - if (vData.mTop <= GuiAlarmID::ALARM_ID_NO_ALARM) { - emit hideAlarm(); - return; - } - alarm_Priority (vData.mState ); alarm_AlarmID (vData.mTop ); - alarm_EscalateIn (vData.mMuteTimeout ); - alarm_MuteTimeout (vData.mEscalatesIn ); - alarm_Flag_systemFault (vData.mFlags.at(AlarmStatusFlag::eFlag_systemFault )); - alarm_Flag_stop (vData.mFlags.at(AlarmStatusFlag::eFlag_stop )); - alarm_Flag_noClear (vData.mFlags.at(AlarmStatusFlag::eFlag_noClear )); - alarm_Flag_noResume (vData.mFlags.at(AlarmStatusFlag::eFlag_noResume )); - alarm_Flag_noRinseback (vData.mFlags.at(AlarmStatusFlag::eFlag_noRinseback )); - alarm_Flag_noEndTreatment (vData.mFlags.at(AlarmStatusFlag::eFlag_noEndTreatment )); - alarm_Flag_noNewTreatment (vData.mFlags.at(AlarmStatusFlag::eFlag_noNewTreatment )); - alarm_Flag_bypassDialyzer (vData.mFlags.at(AlarmStatusFlag::eFlag_bypassDialyzer )); - alarm_Flag_alarmsToEscalate (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsToEscalate)); - alarm_Flag_alarmsSilenced (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsSilenced )); + alarm_EscalateIn (vData.mEscalatesIn ); + alarm_MuteTimeout (vData.mMuteTimeout ); + alarm_Flag_systemFault (vData.mFlags.at(AlarmStatusFlag::eFlag_systemFault )); + alarm_Flag_stop (vData.mFlags.at(AlarmStatusFlag::eFlag_stop )); + alarm_Flag_noClear (vData.mFlags.at(AlarmStatusFlag::eFlag_noClear )); + alarm_Flag_noResume (vData.mFlags.at(AlarmStatusFlag::eFlag_noResume )); + alarm_Flag_noRinseback (vData.mFlags.at(AlarmStatusFlag::eFlag_noRinseback )); + alarm_Flag_noEndTreatment (vData.mFlags.at(AlarmStatusFlag::eFlag_noEndTreatment )); + alarm_Flag_noNewTreatment (vData.mFlags.at(AlarmStatusFlag::eFlag_noNewTreatment )); + alarm_Flag_bypassDialyzer (vData.mFlags.at(AlarmStatusFlag::eFlag_bypassDialyzer )); + alarm_Flag_alarmsToEscalate (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsToEscalate )); + alarm_Flag_alarmsSilenced (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsSilenced )); + alarm_Flag_UserAcknowledged (vData.mFlags.at(AlarmStatusFlag::eFlag_userAcknowledged )); emit raiseAlarm(); - - } /*! @@ -123,21 +123,33 @@ /*! * \brief VAlarmStatus::requestOkay - * Send out a request to acknowledge alarms. + * Send out a request to acknowledge this alarmID */ -void VAlarmStatus::requestOkay(GuiAlarmID alarmID) +void VAlarmStatus::onRequestOkay(GuiAlarmID alarmID) { - acknowledgedAlarms.append(alarmID); + AlarmAcknowledgeRequestData data; + data.alarmID = (quint32)alarmID; + emit requestAlarmAcknowledge(data); + onSetMinimize(true); // TODO: Remove once FW implements user acknowledge } /*! - * \brief VAlarmStatus::requestSilence - * Send out a request to silence alarms. + * \brief VAlarmStatus::onToggleMinimize + * Toggles the whether the alarm should be minimized */ -void VAlarmStatus::requestSilence() +void VAlarmStatus::onSetMinimize(bool minimize) { - // TODO: Update with needed data. Placeholder for now. - QVariantList messageData = {1,2,3,4,5}; - GuiActionType messageAction = GuiActions::ID_AlarmSilenceReq; - emit requestActionTransmit(messageAction, messageData); + minimizeAlarm(minimize); } + +/*! + * \brief VAlarmStatus::requestSilence + * Send out a request to silence alarms + */ +void VAlarmStatus::onRequestSilence() +{ + AlarmSilenceRequestData data; + data.state = 1; + emit requestAlarmSilence(data); + onSetMinimize(true); +} Index: sources/view/hd/alarm/VAlarmStatus.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -60,28 +60,35 @@ PROPERTY( bool , alarm_Flag_bypassDialyzer , false) PROPERTY( bool , alarm_Flag_alarmsToEscalate , false) PROPERTY( bool , alarm_Flag_alarmsSilenced , false) + PROPERTY( bool , alarm_Flag_UserAcknowledged , false) + PROPERTY( bool , minimizeAlarm , false) // coco end + Q_PROPERTY(QString text READ text NOTIFY alarm_AlarmIDChanged) Q_PROPERTY(QString id READ id NOTIFY alarm_AlarmIDChanged) + + signals: void raiseAlarm(); - void hideAlarm(); + void noAlarm(); void requestActionTransmit(GuiActionType vAction, const QVariantList &vData); + void requestAlarmAcknowledge(AlarmAcknowledgeRequestData); + void requestAlarmSilence(AlarmSilenceRequestData); private: QString alarmPriorityText (GuiAlarmPriority vEnum); QString alarmIDText (GuiAlarmID vEnum); - QList acknowledgedAlarms; private slots: void onActionReceive(const AlarmStatusData &vData); public slots: QString text(); QString id(); - void requestOkay(GuiAlarmID alarmID); - void requestSilence(); + void onRequestOkay(GuiAlarmID alarmID); + void onRequestSilence(); + void onSetMinimize(bool minimize); }; } Index: unittests/tst_models.cpp =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- unittests/tst_models.cpp (.../tst_models.cpp) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_models.cpp - * \author (last) Behrouz NematiPour - * \date (last) 13-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * @@ -79,10 +79,10 @@ QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } void tst_models::tst_MAdjustBloodDialysateResponse () @@ -105,7 +105,7 @@ case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mBloodRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mDialydateReate; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDialysateRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; Index: unittests/tst_views.cpp =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- unittests/tst_views.cpp (.../tst_views.cpp) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_views.cpp - * \author (last) Behrouz NemaiPour - * \date (last) 23-Jun-2020 + * \author (last) Peter Lucia + * \date (last) 15-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * @@ -17,9 +17,9 @@ // Qt // Project -#include "vtreatmentadjustmentresponsebase.h" -#include "vtreatmentadjustmentultrafiltrationstate.h" -#include "filehandler.h" +#include "VTreatmentAdjustmentResponseBase.h" +#include "VTreatmentAdjustmentUltrafiltrationState.h" +#include "FileHandler.h" tst_views::tst_views(QObject *parent) : QObject(parent) { } Index: unittests/tst_views.h =================================================================== diff -u -rf8321d4b6a5489f797122321a4821b4eeaaa50cb -rb61d8a3e01fef66eee8095c9cddf835d9bb32b66 --- unittests/tst_views.h (.../tst_views.h) (revision f8321d4b6a5489f797122321a4821b4eeaaa50cb) +++ unittests/tst_views.h (.../tst_views.h) (revision b61d8a3e01fef66eee8095c9cddf835d9bb32b66) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_views.h - * \author (last) Behrouz NematiPour - * \date (last) 20-Aug-2020 + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 *