Index: denali.pro.user =================================================================== diff -u -rfe1cc7af9637a8485b6948b50eb5fb06e4c83740 -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- denali.pro.user (.../denali.pro.user) (revision fe1cc7af9637a8485b6948b50eb5fb06e4c83740) +++ denali.pro.user (.../denali.pro.user) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -60,26 +60,47 @@ ProjectExplorer.Project.PluginSettings - + + + false + false + true + true + + 0 + true + + true + Builtin.Questionable + + true + Builtin.DefaultTidyAndClazy + 2 + + + + true + + ProjectExplorer.Project.Target.0 Desktop Qt 5.12.5 GCC 64bit Desktop Qt 5.12.5 GCC 64bit qt.qt5.5125.gcc_64_kit - 0 + 9 0 0 - /home/denali/projects/tmp/build/build-denali-Desktop_Qt_5_12_5_GCC_64bit-Debug + /home/denali/projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug true qmake QtProjectManager.QMakeBuildStep - true + false false false @@ -98,7 +119,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -115,7 +136,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -128,7 +149,7 @@ true - /home/denali/projects/build-denali-Desktop_Qt_5_12_5_GCC_64bit-Release + /home/denali/projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release true @@ -139,7 +160,7 @@ false false - true + false true @@ -154,7 +175,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -171,7 +192,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -183,19 +204,207 @@ 0 true + + /home/denali/projects/tmp/build/unittest/tst_threads + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_threads CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_threads + tst_threads + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_messaging + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_messaging CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_messaging + tst_messaging + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + - /home/denali/projects/build-denali-Desktop_Qt_5_12_5_GCC_64bit-Profile + /home/denali/projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Profile true qmake QtProjectManager.QMakeBuildStep - true + false - false - true - true + true + false + false true @@ -210,7 +419,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -227,7 +436,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -239,12 +448,670 @@ 0 true - 3 + + /home/denali/projects/tmp/build/unittest/tst_canbus + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_canbus CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_canbus + tst_canbus + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_logging + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_logging CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_logging + tst_logging + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_utilities + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_utilities CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_utilities + tst_utilities + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_acknow + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_acknow CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_acknow + tst_acknow + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_models + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_models CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_models + tst_models + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_initializations + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_initializations CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_initializations + tst_initializations + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/denali/projects/tmp/build/unittest/tst_views + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + CONFIG+=tst_views CONFIG+=CodeCoverage + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 + + false + + + true + + %{buildDir}/denali + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + -m denali.csmes -t UnitTests denali.csexe + cmcsexeimport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --html=Coverage/index + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + + true + --csmes=denali.csmes --csv-excel=Coverage/coverage.csv + cmreport + %{buildDir} + Custom Process Step + + ProjectExplorer.ProcessStep + + 6 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + + tst_views + tst_views + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + 12 0 Deploy - + Deploy ProjectExplorer.BuildSteps.Deploy 1 @@ -307,7 +1174,7 @@ 2 denali - + denali2 Qt4ProjectManager.Qt4RunConfiguration:/home/denali/projects/application/denali.pro 3768 @@ -317,9 +1184,8 @@ false false true - false - /home/denali/projects/tmp/build-denali-Desktop_Qt_5_12_5_GCC_64bit-Debug + /home/denali/projects/tmp/build/unittest/tst_views 1 @@ -334,14 +1200,14 @@ 0 0 - /home/denali/projects/tmp/build/build-denali-Qt_5_12_5_iMX8-Debug + /home/denali/projects/tmp/build/denali-Qt_5_12_5_iMX8-Debug true qmake QtProjectManager.QMakeBuildStep - true + false false false @@ -360,7 +1226,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -377,7 +1243,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -390,7 +1256,7 @@ true - /home/denali/projects/build-denali-Qt_5_12_5_iMX8-Release + /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Release true @@ -401,7 +1267,7 @@ false false - true + false true @@ -416,7 +1282,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -433,7 +1299,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -446,18 +1312,18 @@ true - /home/denali/projects/build-denali-Qt_5_12_5_iMX8-Profile + /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Profile true qmake QtProjectManager.QMakeBuildStep - true + false false - true - true + false + false true @@ -472,7 +1338,7 @@ 2 Build - + Build ProjectExplorer.BuildSteps.Build @@ -489,7 +1355,7 @@ 1 Clean - + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -546,7 +1412,7 @@ 3 Deploy - + Deploy ProjectExplorer.BuildSteps.Deploy 1 Index: sources/gui/qml/pages/treatment/TreatmentConfirm.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -29,9 +29,10 @@ * which is the default screen in the "Manager" stack */ ScreenItem { id: _root + objectName: "TreatmentConfirm" + backgroundRect.color: Colors.backgroundMainMenu signal clickedBack() signal clickedConfirm() - backgroundRect.color: Colors.backgroundMainMenu TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top @@ -68,6 +69,7 @@ } TouchRect { id : _continueRect + objectName: "_continueRect" anchors.horizontalCenter: parent.horizontalCenter text.text: qsTr("CONFIRM TREATMENT") button.onClicked: { Index: sources/view/VCreateTreatment.cpp =================================================================== diff -u -rfe1cc7af9637a8485b6948b50eb5fb06e4c83740 -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision fe1cc7af9637a8485b6948b50eb5fb06e4c83740) +++ sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -22,20 +22,20 @@ connect(&_GuiController, SIGNAL(didActionReceive(GuiActionType,QVariantList)), this, SLOT(onFWValidationResponse(GuiActionType,QVariantList))); - loadTreatmentParameterRanges(); } /** - * @brief VCreateTreatment::loadTreatmentParameterRanges + * \brief VCreateTreatment::loadTreatmentParameterRanges * Loads treatment parameters from a json file - * @return QJsonObject holding the treatment parameters + * \return QJsonObject holding the treatment parameters */ QJsonObject VCreateTreatment::loadTreatmentParameterRanges() { + // coco begin validated: The treatment parameters file needs to be present QJsonObject obj; if (!FileHandler::readJSON(Treatment_Parameter_Ranges_Path, obj)) { - // TODO: handle error + // TODO: notify user } foreach (const QString& key, obj.keys()) @@ -117,13 +117,13 @@ } } - return obj; + // coco end } /** - * @brief VCreateTreatment::onResetCreateTreatment + * \brief VCreateTreatment::onResetCreateTreatment * Resets the create treatment page to the default values. * Disables the continue button. */ @@ -153,10 +153,10 @@ /** - * @brief VCreateTreatment::jsonArrayToStringList + * \brief VCreateTreatment::jsonArrayToStringList * Converts a jsonarray of strings to a QStringList - * @param arr (QJsonArray) to convert - * @return (QStringList) The list of strings in the array + * \param arr (QJsonArray) to convert + * \return (QStringList) The list of strings in the array */ QStringList VCreateTreatment::jsonArrayToStringList(const QJsonArray &arr) { @@ -168,7 +168,7 @@ } /** - * @brief VCreateTreatment::setTreatmentData + * \brief VCreateTreatment::setTreatmentData * Assigns treatment parameters to the treatment data structure. */ void VCreateTreatment::setTreatmentData() { @@ -194,7 +194,7 @@ } /** - * @brief VCreateTreatment::onFinishedCreate + * \brief VCreateTreatment::onFinishedCreate * Validates the treatment profile locally, then requests validation of it with FW */ void VCreateTreatment::onFinishedCreate() { @@ -243,10 +243,10 @@ } /** - * @brief VCreateTreatment::enumToString + * \brief VCreateTreatment::enumToString * Convenience functiont to convert an enum to a string - * @param vEnum - the enum value - * @return QString - the enum name + * \param vEnum - the enum value + * \return QString - the enum name */ QString VCreateTreatment::enumToString(GuiRequestReasons vEnum) { @@ -260,10 +260,10 @@ } /** - * @brief VCreateTreatment::onFWValidationResponse + * \brief VCreateTreatment::onFWValidationResponse * Slot to handle a validation response from FW - * @param actionType The action type must be a create treatment response - * @param messageData The message data must contain the reject reason codes for all parameters + * \param actionType The action type must be a create treatment response + * \param messageData The message data must contain the reject reason codes for all parameters */ void VCreateTreatment::onFWValidationResponse(GuiActionType actionType, QVariantList messageData) { @@ -355,7 +355,7 @@ } /** - * @brief VCreateTreatment::onFinishedConfirm + * \brief VCreateTreatment::onFinishedConfirm * Emits treatment data to gui controller, * who emits to application controller and the * application controller will save the data to disk. @@ -392,11 +392,13 @@ } /** - * @brief ApplicationController::saveNewTreatment + * \brief ApplicationController::saveNewTreatment * Saves a new treatment to the filesystem. - * @param doc - QJsonDocument containing the new treatment parameters. + * \param doc - QJsonDocument containing the new treatment parameters. + * \returns QString - the file to be written to + * */ -void VCreateTreatment::saveNewTreatment(QJsonObject obj) +QString VCreateTreatment::saveNewTreatment(QJsonObject obj) { QJsonDocument document(obj); int i = 0; @@ -406,6 +408,7 @@ } QString filename = QString("%0treatment%1.json").arg(Treatment_Profiles_Dir).arg(i); _FileSaver.concurrentSave(filename, document.toJson(), false); + return filename; } @@ -419,7 +422,7 @@ } /** - * @brief VCreateTreatment::onFnishedPrime + * \brief VCreateTreatment::onFnishedPrime * Called when priming qml selections are complete. * TODO: Placed here for now. Likely will be moved eventually. */ @@ -430,7 +433,7 @@ } /** - * @brief VCreateTreatment::start + * \brief VCreateTreatment::start * Called when user is ready to begin a new treatment. * TODO: Placed here for now. Likely will be moved eventually. */ @@ -440,10 +443,10 @@ } /** - * @brief VCreateTreatment::validate + * \brief VCreateTreatment::validate * Validates the create new treatment input. - * @param vData - the selected TreatmentData - * @return true on success, false otherwise. + * \param vData - the selected TreatmentData + * \return true on success, false otherwise. */ bool VCreateTreatment::validate(const TreatmentData &vData) { @@ -464,6 +467,9 @@ if (!isheparinBolusVolumeSet) success = false; + if (!isheparinStopTimeSet) + success = false; + if (!issalineBolusVolumeSet) success = false; @@ -500,7 +506,6 @@ if (!success) { return false; } - if (vData.bloodFlowRate < _bloodFlowRateMin || vData.bloodFlowRate > _bloodFlowRateMax) { @@ -610,11 +615,11 @@ } /** - * @brief VCreateTreatment::indexInItems + * \brief VCreateTreatment::indexInItems * Checks if the index is in the QStringList - * @param idx (int) the index - * @param items (QStringList) The list of strings to check - * @return True if it is in the list, false otherwise + * \param idx (int) the index + * \param items (QStringList) The list of strings to check + * \return True if it is in the list, false otherwise */ bool VCreateTreatment::indexInItems(quint32 idx, const QStringList &items) { @@ -626,7 +631,7 @@ } /** - * @brief VCreateTreatment::onUserModifiedParameters + * \brief VCreateTreatment::onUserModifiedParameters * Manages enabling / disabling the continue button */ void VCreateTreatment::onUserModifiedParameters() Index: sources/view/VCreateTreatment.h =================================================================== diff -u -rd1907168ef46faa6de1ada400cad789f8379041f -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision d1907168ef46faa6de1ada400cad789f8379041f) +++ sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -16,6 +16,9 @@ #include "storageglobals.h" #include "filesaver.h" +// forward diclations +class tst_views; + using namespace Storage; using namespace Gui; @@ -25,6 +28,9 @@ { Q_OBJECT + // friends + friend class::tst_views; + public: explicit VCreateTreatment(QObject *parent = nullptr); @@ -89,7 +95,7 @@ TreatmentData treatmentData; bool validate(const TreatmentData &vData); - void saveNewTreatment(QJsonObject obj); + QString saveNewTreatment(QJsonObject obj); QJsonObject loadTreatmentParameterRanges(); QStringList jsonArrayToStringList(const QJsonArray &arr); bool indexInItems(quint32 idx, const QStringList &items); Index: unittests/tst_views.cpp =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -15,10 +15,13 @@ #include "tst_views.h" // Qt +#include // Project #include "vtreatmentadjustmentresponsebase.h" #include "vtreatmentadjustmentultrafiltrationstate.h" +#include "mtreatmentparameters.h" +#include "filehandler.h" tst_views::tst_views(QObject *parent) : QObject(parent) { } @@ -65,3 +68,250 @@ v.isPaused(false); } +/*! + * \brief tst_views::VCreateTreatment_validation + * Tests treatment parameter validation + */ +void tst_views::VCreateTreatment_validation() +{ + + for (int i = 0; i < 18; ++i) { + View::VCreateTreatment view; + if (i != 0) view.set_bloodFlowRate(view.bloodFlowRateMax()); + if (i != 1) view.set_dialysateFlowRate(view.dialysateFlowRateMax()); + if (i != 2) view.set_duration(view.durationMax()); + if (i != 3) view.set_heparinDispensingRate(view.heparinDispensingRateMax()); + + if (i != 4) view.set_heparinBolusVolume(view.heparinBolusVolumeMax()); + if (i != 5) view.set_heparinStopTime(view.heparinStopTimeMax()); + if (i != 6) view.set_salineBolusVolume(0); + if (i != 7) view.set_acidConcentrate(0); + if (i != 8) view.set_bicarbonateConcentrate(0); + + if (i != 9) view.set_dialyzerType(0); + if (i != 10) view.set_dialysateTemp(view.dialysateTempMax()); + if (i != 11) view.set_arterialPressureLimitLow(view.arterialPressureLimitLowMin()); + if (i != 12) view.set_arterialPressureLimitHigh(view.arterialPressureLimitHighMax()); + if (i != 13) view.set_venousPressureLimitLow(view.venousPressureLimitLowMin()); + if (i != 14) view.set_venousPressureLimitHigh(view.venousPressureLimitHighMax()); + + if (i != 15) view.set_bloodPressureMeasureInterval(view.bloodPressureMeasureIntervalMax()); + if (i != 16) view.set_rinsebackFlowRate(view.rinsebackFlowRateMax()); + + if (i == 17) { + QCOMPARE(view.isbloodFlowRateSet, true); + QCOMPARE(view.isdialysateFlowRateSet, true); + QCOMPARE(view.isdurationSet, true); + QCOMPARE(view.isheparinDispensingRateSet, true); + QCOMPARE(view.isheparinBolusVolumeSet, true); + QCOMPARE(view.isheparinStopTimeSet, true); + QCOMPARE(view.issalineBolusVolumeSet, true); + QCOMPARE(view.isacidConcentrateSet, true); + QCOMPARE(view.isbicarbonateConcentrateSet, true); + QCOMPARE(view.isdialyzerTypeSet, true); + QCOMPARE(view.isdialysateTempSet, true); + QCOMPARE(view.isarterialPressureLimitLowSet, true); + QCOMPARE(view.isarterialPressureLimitHighSet, true); + QCOMPARE(view.isvenousPressureLimitLowSet, true); + QCOMPARE(view.isvenousPressureLimitHighSet, true); + QCOMPARE(view.isbloodPressureMeasureIntervalSet, true); + QCOMPARE(view.isrinsebackFlowRateSet, true); + QCOMPARE(view.validate(view.treatmentData), true); + } + else { + QCOMPARE(view.validate(view.treatmentData), false); + } + } +} + +/*! + * \brief tst_views::VCreateTreatment_simulate_valid_parameters + * Simulates a user selection of valid parameters + * \param view VCreateTreatment object to be set with valid parameters + */ +void tst_views::VCreateTreatment_simulate_valid_parameters(View::VCreateTreatment &view) +{ + view.set_bloodFlowRate(view.bloodFlowRateMax()); + view.set_dialysateFlowRate(view.dialysateFlowRateMax()); + view.set_duration(view.durationMax()); + view.set_heparinDispensingRate(view.heparinDispensingRateMax()); + + view.set_heparinBolusVolume(view.heparinBolusVolumeMax()); + view.set_heparinStopTime(view.heparinStopTimeMax()); + view.set_salineBolusVolume(0); + view.set_acidConcentrate(0); + view.set_bicarbonateConcentrate(0); + + view.set_dialyzerType(0); + view.set_dialysateTemp(view.dialysateTempMax()); + view.set_arterialPressureLimitLow(view.arterialPressureLimitLowMin()); + view.set_arterialPressureLimitHigh(view.arterialPressureLimitHighMax()); + view.set_venousPressureLimitLow(view.venousPressureLimitLowMin()); + view.set_venousPressureLimitHigh(view.venousPressureLimitHighMax()); + + view.set_bloodPressureMeasureInterval(view.bloodPressureMeasureIntervalMax()); + view.set_rinsebackFlowRate(view.rinsebackFlowRateMax()); + +} + +/*! + * \brief tst_views::VCreateTreatment_validation_ranges + * Tests the treatment parameter validation ranges are checked + */ +void tst_views::VCreateTreatment_validation_ranges() +{ + View::VCreateTreatment view; + view.set_bloodFlowRate(-1); + view.set_dialysateFlowRate(-1); + view.set_duration(-1); + view.set_heparinDispensingRate(-1); + + view.set_heparinBolusVolume(-1); + view.set_heparinStopTime(-1); + view.set_salineBolusVolume(-1); + view.set_acidConcentrate(-1); + view.set_bicarbonateConcentrate(-1); + + view.set_dialyzerType(-1); + view.set_dialysateTemp(-1); + view.set_arterialPressureLimitLow(-1); + view.set_arterialPressureLimitHigh(-1); + view.set_venousPressureLimitLow(-1); + view.set_venousPressureLimitHigh(-1); + + view.set_bloodPressureMeasureInterval(-1); + view.set_rinsebackFlowRate(-1); + + QCOMPARE(view.isbloodFlowRateSet, true); + QCOMPARE(view.isdialysateFlowRateSet, true); + QCOMPARE(view.isdurationSet, true); + QCOMPARE(view.isheparinDispensingRateSet, true); + QCOMPARE(view.isheparinBolusVolumeSet, true); + QCOMPARE(view.isheparinStopTimeSet, true); + QCOMPARE(view.issalineBolusVolumeSet, true); + QCOMPARE(view.isacidConcentrateSet, true); + QCOMPARE(view.isbicarbonateConcentrateSet, true); + QCOMPARE(view.isdialyzerTypeSet, true); + QCOMPARE(view.isdialysateTempSet, true); + QCOMPARE(view.isarterialPressureLimitLowSet, true); + QCOMPARE(view.isarterialPressureLimitHighSet, true); + QCOMPARE(view.isvenousPressureLimitLowSet, true); + QCOMPARE(view.isvenousPressureLimitHighSet, true); + QCOMPARE(view.isbloodPressureMeasureIntervalSet, true); + QCOMPARE(view.isrinsebackFlowRateSet, true); + + QCOMPARE(view.validate(view.treatmentData), false); + + + for (int i = 0; i < 17; ++i) { + VCreateTreatment_simulate_valid_parameters(view); + + if (i == 0) view.set_bloodFlowRate(view.bloodFlowRateMax()+1); + if (i == 1) view.set_dialysateFlowRate(view.dialysateFlowRateMax()+1); + if (i == 2) view.set_duration(view.durationMax()+1); + if (i == 3) view.set_heparinDispensingRate(view.heparinDispensingRateMax()+1); + + if (i == 4) view.set_heparinBolusVolume(view.heparinBolusVolumeMax()+1); + if (i == 5) view.set_heparinStopTime(view.heparinStopTimeMax()+1); + if (i == 6) view.set_salineBolusVolume(view.salineBolusOptions().length()); + if (i == 7) view.set_acidConcentrate(view.acidConcentrateOptions().length()); + if (i == 8) view.set_bicarbonateConcentrate(view.bicarbonateConcentrateOptions().length()); + + if (i == 9) view.set_dialyzerType(view.dialyzerTypeOptions().length()); + if (i == 10) view.set_dialysateTemp(view.dialysateTempMax()+1); + if (i == 11) view.set_arterialPressureLimitLow(view.arterialPressureLimitLowMax()+1); + if (i == 12) view.set_arterialPressureLimitHigh(view.arterialPressureLimitHighMax()+1); + if (i == 13) view.set_venousPressureLimitLow(view.venousPressureLimitLowMax()+1); + if (i == 14) view.set_venousPressureLimitHigh(view.venousPressureLimitHighMax()+1); + + if (i == 15) view.set_bloodPressureMeasureInterval(view.bloodPressureMeasureIntervalMax()+1); + if (i == 16) view.set_rinsebackFlowRate(view.rinsebackFlowRateMax()+1); + + QCOMPARE(view.validate(view.treatmentData), false); + } + +} + +/*! + * \brief tst_views::VCreateTreatment_save + * Tests that VCreateTreatment saves treatment profiles properly. + */ +void tst_views::VCreateTreatment_save() +{ + View::VCreateTreatment view; + + QJsonObject objectWritten { + {"bloodFlowRate", QString::number(view.treatmentData.bloodFlowRate)}, + {"dialysateFlowRate", QString::number(view.treatmentData.dialysateFlowRate)}, + {"duration", QString::number(view.treatmentData.duration)}, + {"heparinDispensingRate", QString::number(view.treatmentData.heparinDispensingRate)}, + {"heparinBolusVolume", QString::number(view.treatmentData.heparinBolusVolume)}, + {"heparinStopTime", QString::number(view.treatmentData.heparinStopTime)}, + {"acidConcentrate", QString::number(view.treatmentData.acidConcentrate)}, + {"bicarbonateConcentrate", QString::number(view.treatmentData.bicarbonateConcentrate)}, + {"dialyzerType", QString::number(view.treatmentData.dialyzerType)}, + {"dialysateTemp", QString::number(view.treatmentData.dialysateTemp)}, + {"arterialPressureLimitLow", QString::number(view.treatmentData.arterialPressureLimitLow)}, + {"arterialPressureLimitHigh", QString::number(view.treatmentData.arterialPressureLimitHigh)}, + {"venousPressureLimitLow", QString::number(view.treatmentData.venousPressureLimitLow)}, + {"venousPressureLimitHigh", QString::number(view.treatmentData.venousPressureLimitHigh)}, + {"bloodPressureMeasureInterval",QString::number(view.treatmentData.bloodPressureMeasureInterval)}, + {"rinsebackFlowRate", QString::number(view.treatmentData.rinsebackFlowRate)} + }; + + QString filename = view.saveNewTreatment(objectWritten); + + + QThread::msleep(500); + + QJsonObject objectRead; + QVERIFY(FileHandler::readJSON(filename, objectRead)); + QCOMPARE(objectWritten, objectRead); +} + +/*! + * \brief tst_views::VCreateTreatment_enums + * Tests that enums are handled properly + */ +void tst_views::VCreateTreatment_enums() +{ + View::VCreateTreatment view; + + GuiRequestReasons reason = GuiRequestReasons::REQUEST_REJECT_REASON_NONE; + QCOMPARE(view.enumToString(reason), "REQUEST_REJECT_REASON_NONE"); + + QCOMPARE(view.enumToString(static_cast(-1)), "[-1] Unknown Rejection Reason"); + QCOMPARE(view.enumToString(static_cast(GuiRequestReasons::NUM_OF_REQUEST_REJECT_REASONS + 1)), + QString("[%0] Unknown Rejection Reason").arg(GuiRequestReasons::NUM_OF_REQUEST_REJECT_REASONS + 1)); +} + +/*! + * \brief tst_views::VCreateTreatment_json + * Tests a helper function's conversion from QJsonArray to QStringList + */ +void tst_views::VCreateTreatment_json() +{ + View::VCreateTreatment view; + + QJsonArray arr; + QStringList list; + + QCOMPARE(view.jsonArrayToStringList(arr), list); + + arr << "1"; + list << "1"; + + QCOMPARE(view.jsonArrayToStringList(arr), list); + + arr << QJsonValue("1") << QJsonValue("2"); + list << "1" << "2"; + + QCOMPARE(view.jsonArrayToStringList(arr), list); + + arr << 3 << 4; + list << "3" << "4"; + + QVERIFY(view.jsonArrayToStringList(arr) != list); + +} + Index: unittests/tst_views.h =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r542278273f3d13ad5fb5ba8916178d747c78fe77 --- unittests/tst_views.h (.../tst_views.h) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ unittests/tst_views.h (.../tst_views.h) (revision 542278273f3d13ad5fb5ba8916178d747c78fe77) @@ -19,6 +19,7 @@ #include // Project +#include "VCreateTreatment.h" class tst_views : public QObject { @@ -31,5 +32,13 @@ void VTreatmentAdjustmentsResponse_text_WAReason(); void VTreatmentAdjustmentUltrafiltrationState_text(); + + void VCreateTreatment_simulate_valid_parameters(View::VCreateTreatment &view); + void VCreateTreatment_validation(); + void VCreateTreatment_validation_ranges(); + void VCreateTreatment_save(); + void VCreateTreatment_json(); + void VCreateTreatment_enums(); + };