Index: alarmMapping =================================================================== diff -u Binary files differ Index: alarmMapping.err =================================================================== diff -u --- alarmMapping.err (revision 0) +++ alarmMapping.err (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1 @@ \ No newline at end of file Index: alarmMapping.log =================================================================== diff -u --- alarmMapping.log (revision 0) +++ alarmMapping.log (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1 @@ \ No newline at end of file Index: alarmMapping.sh =================================================================== diff -u --- alarmMapping.sh (revision 0) +++ alarmMapping.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,28 @@ +#!/bin/sh +########################################################################### +# +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# +# 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 cppcheck.sh +# +# @author (last) Behrouz NematiPour +# @date (last) 11-May-2021 +# @author (original) Behrouz NematiPour +# @date (original) 11-May-2021 +# +############################################################################ +# update common repo +cd common +git pull +cd .. + +# update the alarm messaging +./alarmMapping \ + common/AlarmDefs.h \ + sources/model/hd/alarm/MAlarmMapping.cpp \ + 1> alarmMapping.log \ + 2> alarmMapping.err + Index: cppcheck.err =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- cppcheck.err (.../cppcheck.err) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ cppcheck.err (.../cppcheck.err) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -42,6 +42,7 @@ [sources/storage/Settings.h:39]: (style) Unused private function: 'Settings::makeSetting' [sources/AlarmGenerator.cpp:68]: (style) The function 'ALARM_ID_BLE_CUFF' is never used. [sources/view/VTreatmentCreate.cpp:124]: (style) The function 'doCancel' is never used. +[sources/view/settings/VNetworkModel.cpp:223]: (style) The function 'doCheckIfConnected' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:93]: (style) The function 'doClearCondition' is never used. [sources/view/VTreatmentCreate.cpp:114]: (style) The function 'doConfirm' is never used. [sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:73]: (style) The function 'doDisinfectChemical' is never used. @@ -57,6 +58,10 @@ [sources/view/VTreatmentCreate (legacy).cpp:111]: (style) The function 'doResetCreateTreatment' is never used. [sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp:64]: (style) The function 'doResult' is never used. [sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp:51]: (style) The function 'doResume' is never used. +[sources/view/settings/VNetworkModel.cpp:347]: (style) The function 'doSetDNS' is never used. +[sources/view/settings/VNetworkModel.cpp:329]: (style) The function 'doSetGateway' is never used. +[sources/view/settings/VNetworkModel.cpp:320]: (style) The function 'doSetIPAddress' is never used. +[sources/view/settings/VNetworkModel.cpp:338]: (style) The function 'doSetSubnetMask' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:76]: (style) The function 'doSilence' is never used. [sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.cpp:58]: (style) The function 'doStop' is never used. [sources/view/VEventSpy.cpp:182]: (style) The function 'doTouchReset' is never used. @@ -69,6 +74,7 @@ [sources/utility/types.cpp:28]: (style) The function 'floatCompare' is never used. [sources/utility/types.cpp:44]: (style) The function 'getBits' is never used. [sources/storage/FileHandler.cpp:166]: (style) The function 'removeFiles' is never used. +[sources/view/settings/VNetworkModel.cpp:166]: (style) The function 'roleNames' is never used. [sources/view/VAdjustmentResponseBase.cpp:28]: (style) The function 'text' is never used. [sources/MainTimer.cpp:116]: (style) The function 'timerEvent' is never used. (information) Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config. Index: cppcheck.log =================================================================== diff -u -r19ff3b7500f4839728ca3422bbf3c5a45c189388 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- cppcheck.log (.../cppcheck.log) (revision 19ff3b7500f4839728ca3422bbf3c5a45c189388) +++ cppcheck.log (.../cppcheck.log) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -4,810 +4,821 @@ Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native Checking main.cpp: UNIT_TEST... -1/161 files checked 4% done +1/163 files checked 4% done Checking sources/AlarmGenerator.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -2/161 files checked 4% done +2/163 files checked 4% done Checking sources/ApplicationController.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -3/161 files checked 5% done +3/163 files checked 5% done Checking sources/ApplicationPost.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -4/161 files checked 5% done +4/163 files checked 5% done Checking sources/MainTimer.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -5/161 files checked 6% done +5/163 files checked 6% done Checking sources/Threads.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -6/161 files checked 7% done +6/163 files checked 7% done Checking sources/canbus/CanInterface.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -7/161 files checked 7% done +7/163 files checked 7% done Checking sources/canbus/FrameInterface.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -8/161 files checked 8% done +8/163 files checked 8% done Checking sources/canbus/MessageAcknowModel.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -9/161 files checked 8% done +9/163 files checked 8% done Checking sources/canbus/MessageBuilder.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native Checking sources/canbus/MessageBuilder.cpp: DISABLE_CRC... -10/161 files checked 9% done +10/163 files checked 9% done Checking sources/canbus/MessageDispatcher.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native Checking sources/canbus/MessageDispatcher.cpp: DEBUG_ACKBACK_HD_TO_UI... Checking sources/canbus/MessageDispatcher.cpp: DEBUG_OUT_OF_SYNC... -11/161 files checked 10% done +11/163 files checked 10% done Checking sources/canbus/MessageInterpreter.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -12/161 files checked 10% done +12/163 files checked 10% done Checking sources/gui/GuiController.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -13/161 files checked 11% done +13/163 files checked 11% done Checking sources/gui/GuiGlobals.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -14/161 files checked 11% done +14/163 files checked 11% done Checking sources/gui/GuiView.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -15/161 files checked 12% done +15/163 files checked 12% done Checking sources/model/MAbstract.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native Checking sources/model/MAbstract.cpp: ROUND_FLOATS... -16/161 files checked 13% done +16/163 files checked 13% done Checking sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -17/161 files checked 13% done +17/163 files checked 13% done Checking sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -18/161 files checked 14% done +18/163 files checked 14% done Checking sources/model/dg/data/MDGAccelerometerData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -19/161 files checked 14% done +19/163 files checked 14% done Checking sources/model/dg/data/MDGDebugText.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -20/161 files checked 15% done +20/163 files checked 15% done Checking sources/model/dg/data/MDGDrainPumpData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -21/161 files checked 16% done +21/163 files checked 15% done Checking sources/model/dg/data/MDGHeatersData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -22/161 files checked 16% done +22/163 files checked 16% done Checking sources/model/dg/data/MDGLoadCellReadingsData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -23/161 files checked 17% done +23/163 files checked 17% done Checking sources/model/dg/data/MDGOperationModeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -24/161 files checked 17% done +24/163 files checked 17% done Checking sources/model/dg/data/MDGPressuresData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -25/161 files checked 18% done +25/163 files checked 18% done Checking sources/model/dg/data/MDGROPumpData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -26/161 files checked 19% done +26/163 files checked 18% done Checking sources/model/dg/data/MDGReservoirData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -27/161 files checked 19% done +27/163 files checked 19% done Checking sources/model/dg/data/MDGTemperaturesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -28/161 files checked 20% done +28/163 files checked 20% done Checking sources/model/dg/data/MDGValvesStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -29/161 files checked 20% done +29/163 files checked 20% done Checking sources/model/dg/data/disinfect/MDisinfectDGChemicalTimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -30/161 files checked 21% done +30/163 files checked 21% done Checking sources/model/dg/data/disinfect/MDisinfectDGFlushTimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -31/161 files checked 22% done +31/163 files checked 21% done Checking sources/model/dg/data/disinfect/MDisinfectDGHeatTimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -32/161 files checked 22% done +32/163 files checked 22% done Checking sources/model/dg/data/disinfect/MDisinfectStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -33/161 files checked 23% done +33/163 files checked 23% done Checking sources/model/dg/data/pretreatment/MDGFilterFlushData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -34/161 files checked 23% done +34/163 files checked 23% done Checking sources/model/hd/adjustment/MAdjustPowerOff.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -35/161 files checked 24% done +35/163 files checked 24% done Checking sources/model/hd/adjustment/disinfect/MDisinfectAdjustChemicalConfirmResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -36/161 files checked 25% done +36/163 files checked 24% done Checking sources/model/hd/adjustment/disinfect/MDisinfectAdjustResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -37/161 files checked 25% done +37/163 files checked 25% done Checking sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustDisposablesRemovalConfirmResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -38/161 files checked 26% done +38/163 files checked 26% done Checking sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -39/161 files checked 26% done +39/163 files checked 26% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustDisposablesPrimeResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -40/161 files checked 27% done +40/163 files checked 27% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -41/161 files checked 28% done +41/163 files checked 27% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -42/161 files checked 28% done +42/163 files checked 28% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustPatientConnectionBeginResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -43/161 files checked 29% done +43/163 files checked 28% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustPatientConnectionConfirmResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -44/161 files checked 29% done +44/163 files checked 29% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustStartTreatmentResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -45/161 files checked 30% done +45/163 files checked 30% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustUltrafiltrationInitResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -46/161 files checked 31% done +46/163 files checked 30% done Checking sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -47/161 files checked 31% done +47/163 files checked 31% done Checking sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -48/161 files checked 32% done +48/163 files checked 31% done Checking sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -49/161 files checked 32% done +49/163 files checked 32% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustBloodDialysateResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -50/161 files checked 33% done +50/163 files checked 33% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -51/161 files checked 34% done +51/163 files checked 33% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustEndResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -52/161 files checked 34% done +52/163 files checked 34% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustHeparinResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -53/161 files checked 35% done +53/163 files checked 34% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustPressuresLimitsResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -54/161 files checked 35% done +54/163 files checked 35% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustRecirculateResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -55/161 files checked 36% done +55/163 files checked 36% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustRinsebackResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -56/161 files checked 37% done +56/163 files checked 36% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -57/161 files checked 37% done +57/163 files checked 37% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -58/161 files checked 38% done +58/163 files checked 37% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -59/161 files checked 38% done +59/163 files checked 38% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -60/161 files checked 39% done +60/163 files checked 39% done Checking sources/model/hd/alarm/MAlarmCleared.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -61/161 files checked 40% done +61/163 files checked 39% done Checking sources/model/hd/alarm/MAlarmClearedCondition.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -62/161 files checked 40% done +62/163 files checked 40% done Checking sources/model/hd/alarm/MAlarmMapping.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -63/161 files checked 41% done +63/163 files checked 40% done Checking sources/model/hd/alarm/MAlarmStatusData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -64/161 files checked 41% done +64/163 files checked 41% done Checking sources/model/hd/alarm/MAlarmTriggered.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -65/161 files checked 42% done +65/163 files checked 42% done Checking sources/model/hd/data/MHDAccelerometerData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -66/161 files checked 43% done +66/163 files checked 42% done Checking sources/model/hd/data/MHDDebugText.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -67/161 files checked 43% done +67/163 files checked 43% done Checking sources/model/hd/data/MHDOperationModeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -68/161 files checked 44% done +68/163 files checked 43% done Checking sources/model/hd/data/MTreatmentRangesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -69/161 files checked 44% done +69/163 files checked 44% done Checking sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -70/161 files checked 45% done +70/163 files checked 44% done Checking sources/model/hd/data/pretreatment/MPreTreatmentDisposablesPrimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -71/161 files checked 46% done +71/163 files checked 45% done Checking sources/model/hd/data/pretreatment/MPreTreatmentSelfTestDryData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -72/161 files checked 46% done +72/163 files checked 46% done Checking sources/model/hd/data/pretreatment/MPreTreatmentSelfTestNoCartridgeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -73/161 files checked 47% done +73/163 files checked 46% done Checking sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -74/161 files checked 47% done +74/163 files checked 47% done Checking sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -75/161 files checked 48% done +75/163 files checked 47% done Checking sources/model/hd/data/treatment/MTreatmentFlowsData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -76/161 files checked 49% done +76/163 files checked 48% done Checking sources/model/hd/data/treatment/MTreatmentHeparinData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -77/161 files checked 49% done +77/163 files checked 49% done Checking sources/model/hd/data/treatment/MTreatmentOutletFlowData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -78/161 files checked 50% done +78/163 files checked 49% done Checking sources/model/hd/data/treatment/MTreatmentPressureOcclusionData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -79/161 files checked 50% done +79/163 files checked 50% done Checking sources/model/hd/data/treatment/MTreatmentRecirculateData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -80/161 files checked 51% done +80/163 files checked 50% done Checking sources/model/hd/data/treatment/MTreatmentRinsebackData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -81/161 files checked 52% done +81/163 files checked 51% done Checking sources/model/hd/data/treatment/MTreatmentSalineData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -82/161 files checked 52% done +82/163 files checked 52% done Checking sources/model/hd/data/treatment/MTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -83/161 files checked 53% done +83/163 files checked 52% done Checking sources/model/hd/data/treatment/MTreatmentTimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -84/161 files checked 53% done +84/163 files checked 53% done Checking sources/model/settings/MSettings.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -85/161 files checked 54% done +85/163 files checked 53% done Checking sources/storage/DriveWatcher.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -86/161 files checked 55% done +86/163 files checked 54% done Checking sources/storage/FileHandler.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -87/161 files checked 55% done +87/163 files checked 55% done Checking sources/storage/FileSaver.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -88/161 files checked 56% done +88/163 files checked 55% done Checking sources/storage/Logger.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -89/161 files checked 56% done +89/163 files checked 56% done Checking sources/storage/Settings.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -90/161 files checked 57% done +90/163 files checked 56% done Checking sources/storage/StorageGlobals.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native +Checking sources/storage/StorageGlobals.cpp: BUILD_FOR_DESKTOP... Checking sources/storage/StorageGlobals.cpp: BUILD_FOR_TARGET... -91/161 files checked 58% done +91/163 files checked 57% done Checking sources/storage/TreatmentLog.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -92/161 files checked 58% done +92/163 files checked 57% done Checking sources/utility/crc.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -93/161 files checked 59% done +93/163 files checked 58% done Checking sources/utility/format.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -94/161 files checked 59% done +94/163 files checked 59% done Checking sources/utility/types.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -95/161 files checked 60% done +95/163 files checked 59% done Checking sources/view/VAdjustmentResponseBase.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -96/161 files checked 61% done +96/163 files checked 60% done Checking sources/view/VEventSpy.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native Checking sources/view/VEventSpy.cpp: SPY_MOUSE_EVENT... -97/161 files checked 61% done +97/163 files checked 60% done Checking sources/view/VPowerOff.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -98/161 files checked 62% done +98/163 files checked 61% done Checking sources/view/VTreatmentCreate (legacy).cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -99/161 files checked 62% done +99/163 files checked 62% done Checking sources/view/VTreatmentCreate.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -100/161 files checked 63% done +100/163 files checked 62% done Checking sources/view/dg/data/VDGAccelerometerData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -101/161 files checked 64% done +101/163 files checked 63% done Checking sources/view/dg/data/VDGDrainPumpData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -102/161 files checked 64% done +102/163 files checked 63% done Checking sources/view/dg/data/VDGHeatersData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -103/161 files checked 65% done +103/163 files checked 64% done Checking sources/view/dg/data/VDGLoadCellReadingsData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -104/161 files checked 65% done +104/163 files checked 65% done Checking sources/view/dg/data/VDGOperationModeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -105/161 files checked 66% done +105/163 files checked 65% done Checking sources/view/dg/data/VDGPressuresData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -106/161 files checked 67% done +106/163 files checked 66% done Checking sources/view/dg/data/VDGROPumpData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -107/161 files checked 67% done +107/163 files checked 66% done Checking sources/view/dg/data/VDGReservoirData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -108/161 files checked 68% done +108/163 files checked 67% done Checking sources/view/dg/data/VDGTemperaturesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -109/161 files checked 68% done +109/163 files checked 68% done Checking sources/view/dg/data/VDGValvesStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -110/161 files checked 69% done +110/163 files checked 68% done Checking sources/view/dg/data/disinfect/VDisinfectDGData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -111/161 files checked 70% done +111/163 files checked 69% done Checking sources/view/dg/data/disinfect/VDisinfectStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -112/161 files checked 70% done +112/163 files checked 69% done Checking sources/view/dg/data/pretreatment/VDGFilterFlushData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -113/161 files checked 71% done +113/163 files checked 70% done Checking sources/view/hd/adjustment/disinfect/VDisinfectAdjustChemicalConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -114/161 files checked 71% done +114/163 files checked 71% done Checking sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -115/161 files checked 72% done +115/163 files checked 71% done Checking sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustDisposablesRemovalConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -116/161 files checked 73% done +116/163 files checked 72% done Checking sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -117/161 files checked 73% done +117/163 files checked 72% done Checking sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -118/161 files checked 74% done +118/163 files checked 73% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -119/161 files checked 74% done +119/163 files checked 73% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -120/161 files checked 75% done +120/163 files checked 74% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -121/161 files checked 76% done +121/163 files checked 75% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -122/161 files checked 76% done +122/163 files checked 75% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -123/161 files checked 77% done +123/163 files checked 76% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -124/161 files checked 77% done +124/163 files checked 76% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -125/161 files checked 78% done +125/163 files checked 77% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentUltrafiltrationInit.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -126/161 files checked 79% done +126/163 files checked 78% done Checking sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -127/161 files checked 79% done +127/163 files checked 78% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -128/161 files checked 80% done +128/163 files checked 79% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentEnd.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -129/161 files checked 80% done +129/163 files checked 79% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -130/161 files checked 81% done +130/163 files checked 80% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -131/161 files checked 82% done +131/163 files checked 81% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -132/161 files checked 82% done +132/163 files checked 81% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -133/161 files checked 83% done +133/163 files checked 82% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRinseback.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -134/161 files checked 83% done +134/163 files checked 82% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -135/161 files checked 84% done +135/163 files checked 83% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -136/161 files checked 85% done +136/163 files checked 84% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -137/161 files checked 85% done +137/163 files checked 84% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -138/161 files checked 86% done +138/163 files checked 85% done Checking sources/view/hd/alarm/VAlarmStatus.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -139/161 files checked 86% done +139/163 files checked 85% done Checking sources/view/hd/data/VHDAccelerometerData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -140/161 files checked 87% done +140/163 files checked 86% done Checking sources/view/hd/data/VHDOperationModeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -141/161 files checked 88% done +141/163 files checked 86% done Checking sources/view/hd/data/VTreatmentRanges.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -142/161 files checked 88% done +142/163 files checked 87% done Checking sources/view/hd/data/posttreatment/VPostTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -143/161 files checked 89% done +143/163 files checked 88% done Checking sources/view/hd/data/pretreatment/VPreTreatmentDisposablesPrimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -144/161 files checked 89% done +144/163 files checked 88% done Checking sources/view/hd/data/pretreatment/VPreTreatmentSelfTestDryData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -145/161 files checked 90% done +145/163 files checked 89% done Checking sources/view/hd/data/pretreatment/VPreTreatmentSelfTestNoCartridgeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -146/161 files checked 91% done +146/163 files checked 89% done Checking sources/view/hd/data/pretreatment/VPreTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -147/161 files checked 91% done +147/163 files checked 90% done Checking sources/view/hd/data/treatment/VHDTreatmentStatesData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -148/161 files checked 92% done +148/163 files checked 91% done Checking sources/view/hd/data/treatment/VTreatmentBloodFlow.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -149/161 files checked 92% done +149/163 files checked 91% done Checking sources/view/hd/data/treatment/VTreatmentBloodPrimeData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -150/161 files checked 93% done +150/163 files checked 92% done Checking sources/view/hd/data/treatment/VTreatmentDialysateFlow.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -151/161 files checked 94% done +151/163 files checked 92% done Checking sources/view/hd/data/treatment/VTreatmentHeparinData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -152/161 files checked 94% done +152/163 files checked 93% done Checking sources/view/hd/data/treatment/VTreatmentPressureOcclusion.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -153/161 files checked 95% done +153/163 files checked 94% done Checking sources/view/hd/data/treatment/VTreatmentRecirculateData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -154/161 files checked 95% done +154/163 files checked 94% done Checking sources/view/hd/data/treatment/VTreatmentRinsebackData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -155/161 files checked 96% done +155/163 files checked 95% done Checking sources/view/hd/data/treatment/VTreatmentSalineData.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -156/161 files checked 97% done +156/163 files checked 95% done Checking sources/view/hd/data/treatment/VTreatmentTime.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -157/161 files checked 97% done +157/163 files checked 96% done Checking sources/view/hd/data/treatment/VTreatmentUltrafiltration.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -158/161 files checked 98% done +158/163 files checked 97% done Checking sources/view/settings/VAdjustmentVersions.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -159/161 files checked 98% done +159/163 files checked 97% done Checking sources/view/settings/VDateTime.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -160/161 files checked 99% done +160/163 files checked 98% done +Checking sources/view/settings/VNetworkModel.cpp ... +Defines: +Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ +Platform:Native +161/163 files checked 98% done Checking sources/view/settings/VSettings.cpp ... Defines: Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ Platform:Native -161/161 files checked 100% done +162/163 files checked 99% done +Checking sources/wifi/WifiInterface.cpp ... +Defines: +Includes: -I.//sources/ -I.//sources/gui/ -I.//sources/storage/ -I.//sources/canbus/ +Platform:Native +163/163 files checked 100% done Index: denali.pro =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- denali.pro (.../denali.pro) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ denali.pro (.../denali.pro) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -48,6 +48,7 @@ sources/gui \ sources/canbus \ sources/utility \ + sources/wifi \ sources/abstract \ sources/model \ sources/model/settings \ @@ -100,11 +101,13 @@ sources/ApplicationController.h \ sources/storage/Settings.h \ sources/storage/TreatmentLog.h \ + sources/wifi/WifiInterface.h \ \ # ---------- Models ---------- sources/model/MModel.h \ sources/model/MAbstract.h \ \ # ---------- Models - settings sources/model/settings/MSettings.h \ + sources/model/settings/MWifiNetwork.h \ \ # ---------- Models - Alarm sources/model/hd/alarm/MAlarmStatusData.h \ sources/model/hd/alarm/MAlarmTriggered.h \ @@ -217,6 +220,7 @@ sources/view/settings/VDateTime.h \ sources/view/settings/VSettings.h \ sources/view/settings/VAdjustmentVersions.h \ + sources/view/settings/VNetworkModel.h \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.h \ \ # ---------- Views - HD - Adjustment @@ -313,6 +317,7 @@ sources/ApplicationController.cpp \ sources/storage/Settings.cpp \ sources/storage/TreatmentLog.cpp \ + sources/wifi/WifiInterface.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ \ # ---------- Models - settings @@ -424,6 +429,7 @@ sources/view/settings/VSettings.cpp \ sources/view/settings/VDateTime.cpp \ sources/view/settings/VAdjustmentVersions.cpp \ + sources/view/settings/VNetworkModel.cpp \ \ # ---------- Views - HD - Adjustment sources/view/VAdjustmentResponseBase.cpp \ \ # ---------- Views - HD - Adjustment - Pre-Treatment @@ -512,12 +518,12 @@ denali.qrc DEFINES += \ - VER_MAJOR="\\\"${majorVersion}\\\"" \ - VER_MINOR="\\\"${minorVersion}\\\"" \ - VER_MICRO="\\\"${microVersion}\\\"" \ - VER_REVIS="\\\"${buildNumber}\\\"" \ - VER_REVIS_DEV=\\\"$$system( date "+%m%d%H%M" )\\\" \ - VER_APPLY=\\\"$$system( touch -m main.cpp )\\\" \ + VER_MAJOR="\\\"${majorVersion}\\\"" \ + VER_MINOR="\\\"${minorVersion}\\\"" \ + VER_MICRO="\\\"${microVersion}\\\"" \ + VER_REVIS="\\\"${buildNumber}\\\"" \ + VER_REVIS_DEV=\\\"$$system( date "+%m%d%H%M" )\\\" \ + VER_APPLY=\\\"$$system( touch -m main.cpp )\\\" \ VER_BRANCH=\\\"$$system( git rev-parse --abbrev-ref HEAD )\\\" CodeCoverage { Index: denali.pro.user =================================================================== diff -u -r577ab4647b2584d4e32b26797281ec1543d2e1aa -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- denali.pro.user (.../denali.pro.user) (revision 577ab4647b2584d4e32b26797281ec1543d2e1aa) +++ denali.pro.user (.../denali.pro.user) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -89,7 +89,7 @@ Qt 5.12.5 (iMX8) Qt 5.12.5 (iMX8) {5d6458ef-f917-4aef-a092-c77bbe106149} - 0 + 1 0 0 Index: denali.qrc =================================================================== diff -u -r1a8e9578b27bb3877116675d0b2361ce4f5b5539 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- denali.qrc (.../denali.qrc) (revision 1a8e9578b27bb3877116675d0b2361ce4f5b5539) +++ denali.qrc (.../denali.qrc) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -3,7 +3,7 @@ sources/gui/qml/pages/MainStack.qml sources/gui/qml/pages/MainHome.qml sources/gui/qml/pages/ManagerStack.qml - sources/gui/qml/pages/ManagerHome.qml + sources/gui/qml/pages/UserConfirmation.qml sources/gui/qml/pages/settings/SettingsBase.qml @@ -17,6 +17,7 @@ sources/gui/qml/dialogs/AutoHideInfo.qml sources/gui/qml/dialogs/NotificationDialog.qml sources/gui/qml/dialogs/AlarmListDialog.qml + sources/gui/qml/dialogs/DiagnosticsDialog.qml resources/images/Settings_gear_setting_tools-128.png @@ -55,6 +56,7 @@ resources/images/Busy.png resources/images/BusyDone.png resources/images/eject.png + resources/images/eye.png sources/gui/qml/components/MainMenu.qml Index: en_US.udic =================================================================== diff -u -ra64c31ec79b3af203691f70397cc31f5727f47f4 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- en_US.udic (.../en_US.udic) (revision a64c31ec79b3af203691f70397cc31f5727f47f4) +++ en_US.udic (.../en_US.udic) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -100,3 +100,11 @@ sdcard usb VM +MDGHeaters +Fi +Wi +prepend +Prepends +WPA +DNS +subnet Index: main.cpp =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- main.cpp (.../main.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ main.cpp (.../main.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -47,7 +47,10 @@ #include "GuiController.h" #include "Logger.h" #include "DriveWatcher.h" +#include "WifiInterface.h" + #include "Threads.h" +// #include "FileHandler.h" // kernel #include @@ -287,6 +290,9 @@ //! - Parse the command line arguments commandlineParse(); + // SYSTEM TEST FOR INSTRUCTIONS WHEN THERE IS NO PORT AVAILABLE + // Storage::FileHandler::copyFolder(QString(Storage::USB_Mount_Point) + "Instructions", QString(Storage::Settings_Path_Name)); + //! - Translation initialization QTranslator translator; bool trLoaded = translator.load(QLocale(), app.applicationName(), QLatin1String("_"), QLatin1String(":/translations")); @@ -344,6 +350,10 @@ //! - Initializing Main Timer _MainTimer.init(); + //! - Initializing WiFi Interface + _WifiInterface.init(Threads::_Wifi_Thread); + _WifiInterface.start(); + //! - Initialize the QML Viewer and starts GUI int app_exec = -1; LOG_DEBUG("UI Initializing"); Index: resources/images/eye.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/1.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/2.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/3.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/Acid line connect v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/Bicarb line connect v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/Dialysate lines to DG v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/HD door open_v1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/Instructions.conf =================================================================== diff -u -ra64c31ec79b3af203691f70397cc31f5727f47f4 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- resources/settings/Instructions/Instructions.conf (.../Instructions.conf) (revision a64c31ec79b3af203691f70397cc31f5727f47f4) +++ resources/settings/Instructions/Instructions.conf (.../Instructions.conf) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -1,10 +1,61 @@ +[Sample^Water Sample] +Place cup in the water sampling pocket. Press and hold the "Water Sample" button. = water sampling_v2.png + +[Sample^Water Sample Result] +Test the water sample per your clinic's instructions and enter the result. = temp_water_test.png + +[Sample^Water Sample Result Failed] +Water sample result failed. = logo.png + +[Consumables^Consumables Installation] +Open the DG concentrate door. = concentrate door open-v1.png +Remove the bottom acid/bicarbonate cap. = remove Acid_Bicab cap-v2.png +Connect the acid concentrate to the acid port. = Acid line connect v2.png +Connect the bicarbonate concentrate to the bicarbonate port. = Bicarb line connect v2.png + [Disposables^Cartridge Installation] -Unlock pump track, Lock pump track =1.png -Insert cartridge using alignment pins =2.png -HD machine door open / HD machine door closed =3.png +Open the front panel door. = door up v2.png +Unlock the pump track by moving the lever to its upward position. = pump track lock_v1.png +Install the cartirdge using the aligment pins. = cassette load_v1.png +Lock the pump track by moving the lever to its downward position. = cassette clamp lock v2-01.png [Disposables^Cartridge Connection] -Connect dialyzer v1 = slide2_filter-connect_v1.png +Insert dialyzer into the clamps. = filter load_72.png +Connect the cartridge dialysis fluid and blood lines to the the dialyzer. = filter connect_72.png +Connect the cartridge tubing line to air vent port. Unclamp the pinch clamp. = PBo connect_72.png +Remove the top dialysis fluid cap. = remove top cap v1.png +Connect the cartridge dialysis fluid lines to the DG fluid ports. = Dialysate lines to DG v2.png -[Sample^Water Sample] -Please follow the instruction to sample the water = water sampling_v1.png +[Disposables^Heparin Syringe] +Fill a syringe with heparin (1000 units/mL) and connect the cartridge heparin tubing line. = syringe connect_72.png +Insert syringe into infusion pump housing. = syringe load_72.png + +[Disposables^Saline Bag] +Spike a saline bag and connect it to the cartridge tubing. Hang the saline bag on the hook. = saline connect_72.png + +[Connection^Patient Connection] +Establish vascular access per your clinic's instructions. +Clamp lines and remove arterial and venous shunt. = untwist stunt_72.png +Connect arterial and venous cartridge lines to your patient access lines. = alt connect fistula_72.png + +[Connection^Start Treatment] +Unclamp patient lines and cartridge lines.= + +[Disconnection^Patient Disconnection] +Patient Disconnection=logo.png + +[Disposables^Disposables Removal] +Disposables Removal1=logo.png +Disposables Removal2=logo.png + +[Disinfection^Disinfection] +Disinfection1=logo.png +Disinfection2=logo.png +Disinfection3=logo.png + +[Chemical Disinfect^Chemical Disinfect] +Disinfection1=logo.png + + + + Index: resources/settings/Instructions/PBo connect_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/alt connect fistula_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/arterial to saline_v1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/cassette clamp lock v2-01.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/cassette load_v1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/connect Bicarbonate Line-v1-01.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/door down v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/door up v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/filter connect_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/filter load_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/logo.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/pinch paient lines v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/pump track lock_v1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/remove Acid_Bicab cap-v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/remove top cap v1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/saline connect_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/slide1_filter_v2.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/slide1_filter_v2b.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/slide2_filter-connect_v1.png =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/syringe connect_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/syringe load_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/temp_water_test.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/untwist stunt_72.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/water sampling_v1.png =================================================================== diff -u -ra64c31ec79b3af203691f70397cc31f5727f47f4 -r7077e38c74db9cccb5496ffefcf8936c0916de76 Binary files differ Index: resources/settings/Instructions/water sampling_v2.png =================================================================== diff -u Binary files differ Index: scripts/copy.sh =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- scripts/copy.sh (.../copy.sh) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ scripts/copy.sh (.../copy.sh) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -23,6 +23,7 @@ fi SSHUSER=root HOMEPATH="/home/$SSHUSER/" +SCRIPTSPATH="/home/$SSHUSER/scripts/" FONTPATH="/usr/share/fonts/truetype/" FONTSPATH="/home/denali/Projects/application/resources/fonts/" DENALIPATH="/home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Release/" @@ -154,13 +155,37 @@ fi } +# copy the date/time settings scripts +function copyDateTimeScripts() { + copyFileTo "date_time_set.sh" $SCRIPTSPATH +} + +# copy the wifi settings scripts +function copyWifiScripts() { + wifiScripts=$(ls wifi_*.sh) + for script in $wifiScripts + do + copyFileTo $script $SCRIPTSPATH + done +} + +# copy the wifi settings scripts +function setupSettingsScripts() { + ssh $SSHUSER@$IPADDR "mkdir $SCRIPTSPATH;" + copyDateTimeScripts + copyWifiScripts + ssh $SSHUSER@$IPADDR "cd $1; chmod a+x *.sh;" +} + function main() { getIpAddress copyFileTo "autostart" $HOMEPATH copyFileTo "run.sh" $HOMEPATH copyFileTo "setup.sh" $HOMEPATH + setupSettingsScripts + getDenaliPath copyFileTo $DENALIPATH/$DENALINAME $HOMEPATH Index: scripts/run.sh =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- scripts/run.sh (.../run.sh) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ scripts/run.sh (.../run.sh) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -70,5 +70,14 @@ # echo ":: candump launched" #fi +# stop the connection manager daemon +killall connmand + +# setup wifi +killall wpa_supplicant >> $HOME/filesystem.out 2>> $HOME/filesystem.err + #launching denali application, disable keep-alive -$HOME/denali -u 2>> $HOME/filesystem.err & +$HOME/denali -u & # 2>> $HOME/filesystem.err & + +udhcpc -i eth0 -n & + Index: scripts/wifi_disconnect_network.sh =================================================================== diff -u --- scripts/wifi_disconnect_network.sh (revision 0) +++ scripts/wifi_disconnect_network.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +killall wpa_supplicant +rm -f /etc/wpa_supplicant +./wifi_reset_interface.sh $iface Index: scripts/wifi_generate_wpa_supplicant.sh =================================================================== diff -u --- scripts/wifi_generate_wpa_supplicant.sh (revision 0) +++ scripts/wifi_generate_wpa_supplicant.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,53 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +ssid=$1 +password=$2 +dest=$3 +securityType=$4 +psk=$(wpa_passphrase "$ssid" "$password" | grep "psk=" | grep -v "#psk" | sed -nr 's/.*psk=(.*)/\1/p') +case $securityType in + wpa2) + echo "Security: wpa2"; + echo "ctrl_interface=/var/run/wpa_supplicant +ctrl_interface_group=0 +update_config=1 + +network={ + ssid=\"$ssid\" + key_mgmt=WPA-PSK + pairwise=CCMP TKIP + group=CCMP TKIP + scan_ssid=1 + #psk=\"\" + psk=$psk +}" > $dest;; + wpa) + echo "Security: wpa"; + echo "ctrl_interface=/var/run/wpa_supplicant +ctrl_interface_group=0 +update_config=1 + +network={ + ssid=\"$ssid\" + #psk=\"\" + psk=$psk +}" > $dest;; + wep) + echo "Security: wep"; + echo "ctrl_interface=/var/run/wpa_supplicant +ctrl_interface_group=0 +update_config=1 + +network={ + ssid=\"$ssid\" + key_mgmt=NONE + wep_key0=$password + wep_tx_keyidx=0 +}" > $dest;; +esac Index: scripts/wifi_read_dns.sh =================================================================== diff -u --- scripts/wifi_read_dns.sh (revision 0) +++ scripts/wifi_read_dns.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,7 @@ +#!/bin/sh +if [ "$1" == "-h" ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile" + exit 0 +fi +cat /etc/resolv.conf | grep "nameserver" Index: scripts/wifi_read_gateway.sh =================================================================== diff -u --- scripts/wifi_read_gateway.sh (revision 0) +++ scripts/wifi_read_gateway.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$1" == "-h" ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile" + exit 0 +fi + +ip route show | grep "default via" Index: scripts/wifi_read_ip_settings.sh =================================================================== diff -u --- scripts/wifi_read_ip_settings.sh (revision 0) +++ scripts/wifi_read_ip_settings.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +ifconfig $iface | grep "inet " Index: scripts/wifi_request_auto_assigned_ip.sh =================================================================== diff -u --- scripts/wifi_request_auto_assigned_ip.sh (revision 0) +++ scripts/wifi_request_auto_assigned_ip.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +killall udhcpc +udhcpc --timeout=5 --retries=8 -n -i $iface Index: scripts/wifi_reset_adapter.sh =================================================================== diff -u --- scripts/wifi_reset_adapter.sh (revision 0) +++ scripts/wifi_reset_adapter.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ "$1" == "-h" ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile" + exit 0 +fi + +rfkill block wifi +rfkill unblock wifi Index: scripts/wifi_reset_interface.sh =================================================================== diff -u --- scripts/wifi_reset_interface.sh (revision 0) +++ scripts/wifi_reset_interface.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +ip link set $1 down +ip link set $1 up Index: scripts/wifi_save_dhcp_interface.sh =================================================================== diff -u --- scripts/wifi_save_dhcp_interface.sh (revision 0) +++ scripts/wifi_save_dhcp_interface.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,12 @@ + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +echo "auto $iface +iface $iface inet dhcp + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf" > /etc/network/interfaces \ No newline at end of file Index: scripts/wifi_save_static_interface_assignments.sh =================================================================== diff -u --- scripts/wifi_save_static_interface_assignments.sh (revision 0) +++ scripts/wifi_save_static_interface_assignments.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +ip=$2 +gateway=$3 +subnet_mask=$4 + +echo "auto $iface +iface $iface inet static + address $ip + netmask $subnet_mask + gateway $3" > /etc/network/interfaces + +./wifi_set_gateway.sh $gateway Index: scripts/wifi_scan_for_networks.sh =================================================================== diff -u --- scripts/wifi_scan_for_networks.sh (revision 0) +++ scripts/wifi_scan_for_networks.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iwlist $1 scan Index: scripts/wifi_set_auto_assigned_ip.sh =================================================================== diff -u --- scripts/wifi_set_auto_assigned_ip.sh (revision 0) +++ scripts/wifi_set_auto_assigned_ip.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 + +echo "auto $iface +iface $iface inet dhcp" >> /etc/network/interfaces Index: scripts/wifi_set_dns.sh =================================================================== diff -u --- scripts/wifi_set_dns.sh (revision 0) +++ scripts/wifi_set_dns.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +echo "nameserver $1" >> /etc/resolv.conf Index: scripts/wifi_set_gateway.sh =================================================================== diff -u --- scripts/wifi_set_gateway.sh (revision 0) +++ scripts/wifi_set_gateway.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +ip route del default +ip route add default via $1 Index: scripts/wifi_set_static_ip.sh =================================================================== diff -u --- scripts/wifi_set_static_ip.sh (revision 0) +++ scripts/wifi_set_static_ip.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +ifconfig $1 $2 \ No newline at end of file Index: scripts/wifi_set_subnetmask.sh =================================================================== diff -u --- scripts/wifi_set_subnetmask.sh (revision 0) +++ scripts/wifi_set_subnetmask.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +ifconfig $1 netmask $2 \ No newline at end of file Index: scripts/wifi_start_wpa_supplicant.sh =================================================================== diff -u --- scripts/wifi_start_wpa_supplicant.sh (revision 0) +++ scripts/wifi_start_wpa_supplicant.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +wpa_supplicant_path=$2 +wpa_cli terminate +killall udhcpc +killall wpa_supplicant +sleep 1 +wpa_supplicant -B -i $iface -c $wpa_supplicant_path wext Index: scripts/wifi_test_internet.sh =================================================================== diff -u --- scripts/wifi_test_internet.sh (revision 0) +++ scripts/wifi_test_internet.sh (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ "$1" == "-h" ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile " + exit 0 +fi + +iface=$1 +ping -I $iface -c 4 www.linuxfoundation.org Index: sources/Threads.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/Threads.cpp (.../Threads.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/Threads.cpp (.../Threads.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -35,6 +35,7 @@ QThread _DriveWatcher_Thread ; QThread _Logger_Thread ; QThread _Application_Thread ; + QThread _Wifi_Thread ; /*! * \brief registerTypes @@ -86,12 +87,13 @@ { // coco begin validated: Application termination is not correctly done in coco!!! // it has been tested and works perfectly fine in normal run. - quitThread(_CanFrame_Thread ); // validated - quitThread(_CanAcknow_Thread ); // validated - quitThread(_CanMessage_Thread ); // validated - quitThread(_DriveWatcher_Thread ); // validated - quitThread(_Logger_Thread ); // validated - quitThread(_Application_Thread ); // validated + quitThread(_CanFrame_Thread ); + quitThread(_CanAcknow_Thread ); + quitThread(_CanMessage_Thread ); + quitThread(_DriveWatcher_Thread ); + quitThread(_Logger_Thread ); + quitThread(_Wifi_Thread ); + quitThread(_Application_Thread ); } // coco end } Index: sources/Threads.h =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/Threads.h (.../Threads.h) (revision 821bf955d0ba7e028bccfee7c04ca77cf80a0bd4) +++ sources/Threads.h (.../Threads.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -25,6 +25,7 @@ extern QThread _DriveWatcher_Thread ; extern QThread _Logger_Thread ; extern QThread _Application_Thread ; + extern QThread _Wifi_Thread ; void registerTypes(); void quitThread (QThread &vThread); Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -41,6 +41,7 @@ * \brief Payload Length * \details List of each ActionID required data (in byte) length in the message. * So the data collector has to collect this amount of bytes as payload of a message. + * */ const QHash payloadLen { // ---- @@ -81,13 +82,13 @@ {Gui::GuiActionType::ID_DGTemperaturesData , 12 * 4 }, // 12 parameters each 4bytes {Gui::GuiActionType::ID_DGAccelerometerData , 9 * 4 }, // 9 parameters each 4bytes - // ---- + // ---- TODO : AFTER GIVING IT SOME THOUGHT, IT SEEMS WE CAN GET THESE LEN FROM THE MODEL AND DON'T NEED TO HAVE THIS BUT NEED TO INVESTIGATE MORE. {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_AlarmClearedConditionReq , 1 * 4 }, // 1 parameter each 4bytes // the same message 63:0x3F00 {Gui::GuiActionType::ID_AlarmClearedConditionRsp , 1 * 4 }, // 1 parameter each 4bytes // the same message 63:0x3F00 - {Gui::GuiActionType::ID_AlarmSilenceReq , 1 * 1 }, // 1 parameter each 1bytes + {Gui::GuiActionType::ID_AlarmSilenceReq , 1 * 4 }, // 1 parameter each 1bytes {Gui::GuiActionType::ID_AlarmUserActionReq , 1 * 4 }, // 1 parameter each 4bytes // ---- Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -530,7 +530,7 @@ Model::MAdjustUltrafiltrationEditResponse mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard + LOG_EVENT("HD," + mData.toString()); // TODO : Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); @@ -554,7 +554,7 @@ Model::MAdjustUltrafiltrationConfirmResponse mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard + LOG_EVENT("HD," + mData.toString()); // TODO : Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -30,6 +30,7 @@ #include "VPowerOff.h" #include "VAdjustmentVersions.h" #include "VDateTime.h" +#include "VNetworkModel.h" // states data #include "VHDOperationModeData.h" #include "VPreTreatmentStatesData.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -303,7 +303,7 @@ Q_ENUM(DG_Op_Modes) Q_ENUM(DG_Heat_States) - // TODO: temporary enum until DG defines one + // TODO : temporary enum until DG defines one enum DG_Disinfect_States { DG_DISINFECT_STATE_UNKNOWN = -1, DG_DISINFECT_STATE_FLUSH = 0, Index: sources/gui/qml/AlarmItem.qml =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -73,11 +73,11 @@ onClicked : alarmMaximize() } - // TODO : Later need to create a base Notification dialog class - // and inherit NotificationDialog and AlarmListDialog from that - // Beter be the NotificationDialog defined as parent - // and two separate dialogs by the names of AlarmDialog , AlarmListDlialog creatd. - // Same for the Notification Bar + // TODO : Later need to create a base Notification dialog class + // and inherit NotificationDialog and AlarmListDialog from that + // Beter be the NotificationDialog defined as parent + // and two separate dialogs by the names of AlarmDialog , AlarmListDlialog creatd. + // Same for the Notification Bar NotificationDialog { id : _alarmDialog // this will change later to the actual message text // and the instruction would be in the dialog content Index: sources/gui/qml/SDItem.qml =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/SDItem.qml (.../SDItem.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/gui/qml/SDItem.qml (.../SDItem.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -29,14 +29,17 @@ * The percent value in the circle will show "SD" if the device is not present/ready. */ Rectangle { id: _root // TEST : SD-Card not present may need to be handled with better indication(s). + + signal doubleClicked + color : Colors.transparent anchors { top : parent.top right : parent.right topMargin : 5 rightMargin : 5 } - width : 28 + width : 30 height: width radius: width Text { id: _SDText @@ -56,4 +59,8 @@ color : ! _GuiView.sdIsReady ? "red" : _GuiView.sdIsReadOnly ? "gray" : _GuiView.sdIsLow ? Colors.red : "green" } + MouseArea { + anchors.fill: parent + onDoubleClicked: _root.doubleClicked() + } } Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -r2230a5b1b891f47b64165164710aa680ddfc7040 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 2230a5b1b891f47b64165164710aa680ddfc7040) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -23,7 +23,7 @@ Item { id: _root enum Constants { EntryWidth = 350 , - EntryHeight = 50 , + EntryHeight = 40 , InputWidth = 100 } @@ -35,7 +35,7 @@ signal enterPressed() - width : TextEntry.EntryWidth + width : _label.width + _input.width height : TextEntry.EntryHeight onEnterPressed : { @@ -47,6 +47,7 @@ } Text { id : _label + height : parent.height anchors.left : parent.left anchors.top : parent.top color : Colors.textMain @@ -80,5 +81,6 @@ width : _input.width anchors.top : _input.bottom anchors.left: _input.left + anchors.topMargin : -thickness // move it up to be in the container rect in case the TextEntry clip set true. } } Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -81,7 +81,6 @@ color : _private.color() border.color: _private.borderColor() - Rectangle { id: _rectAnim visible : _root.fading radius : width Index: sources/gui/qml/dialogs/DiagnosticsDialog.qml =================================================================== diff -u --- sources/gui/qml/dialogs/DiagnosticsDialog.qml (revision 0) +++ sources/gui/qml/dialogs/DiagnosticsDialog.qml (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,376 @@ +/*! + * + * 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 ManagerHome.qml + * \author (last) Behrouz NematiPour + * \date (last) 16-Oct-2020 + * \author (original) Behrouz NematiPour + * \date (original) 21-Oct-2019 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +import Gui.Actions 0.1 +import Gui.VEventSpy 0.1 + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief Diagnostics is the screen + */ +ModalDialog { id: _root + + width : Variables.applicationWidth - 40 + height : Variables.applicationHeight - 60 + + function col(idx, gap = 0) { + return idx * 155 + gap + } + + function row(idx, gap = 10) { + return idx * 100 + gap + } + + Rectangle { + anchors.centerIn: _closeButton + border.color : Colors.white + color : Colors.transparent + border.width : Variables.borderWidth + width : _closeButton.width + 10 + height : width + radius : width + } + CloseButton { id : _closeButton + anchors.top : undefined + anchors.bottom : parent.bottom + anchors.margins : 10 + onClicked : close() + } + + DebugDataColumn { id: _DGROPumpColumn + x: col(0) + y: row(0) + title: qsTr(" ROPmp ") + model: [ + vDGROPump.pressure .toFixed(2) , + vDGROPump.flowRate .toFixed(2) , + vDGROPump.pwm .toFixed(2) , + vDGROPump.state + ] + textObjectName: "_DGROPumpData" + } + + DebugDataColumn { id: _DGDrainPumpColumn + x: col(1) + y: row(0) + title: qsTr(" DRPmp ") + model: [ + vDGDrainPump.rpmi , + vDGDrainPump.dac , + vDGDrainPump.state , + vDGDrainPump.rpmo + ] + textObjectName: "_DGDrainPumpData" + } + + DebugDataColumn { id: _DGPressuresColumn + x: col(2) + y: row(0) + title: qsTr(" Prssr ") + model: [ + vDGPressures.roInletPSI .toFixed(2) , + vDGPressures.roOutletPSI .toFixed(2) , + vDGPressures.drainInletPSI .toFixed(2) , + vDGPressures.drainOutletPSI .toFixed(2) + ] + textObjectName: "_DGPressuresData" + } + + DebugDataColumn { id: _DGReservoirColumn + x: col(3) + y: row(0) + title: qsTr(" Rsrvr ") + model: [ + vDGReservoir.activeReservoir , + vDGReservoir.fillToVol , + vDGReservoir.drainToVol , + ] + textObjectName: "_DGReservoirData" + } + + DebugDataColumn { id: _DGHeatersColumn + x: col(4) + y: row(0) + title: qsTr(" Heatrs ") + model: [ + vDGHeaters.mainPrimaryDC .toFixed(2), + vDGHeaters.smallPrimaryDC .toFixed(2), + vDGHeaters.trimmerDC .toFixed(2), + ] + textObjectName: "_DGHeatersData" + } + + DebugDataColumn { id: _LoadCellReadingsColumn + x: col(5) + y: row(0) + title: qsTr(" LoadCl ") + model: [ + vDGLoadCellReadings.reservoir1Prim .toFixed(2) , + vDGLoadCellReadings.reservoir1Bkup .toFixed(2) , + vDGLoadCellReadings.reservoir2Prim .toFixed(2) , + vDGLoadCellReadings.reservoir2Bkup .toFixed(2) + ] + textObjectName: "_DGLoadCellReadingsData" + } + + DebugDataColumn { id: _DGTemperaturesColumn + x: col(6) + y: row(0) + title: qsTr(" Tmprtr ") + model: [ + vDGTemperatures.inletPrimaryHeater .toFixed(2) , + vDGTemperatures.outletPrimaryHeater .toFixed(2) , + vDGTemperatures.conductivitySensor1 .toFixed(2) , + vDGTemperatures.conductivitySensor2 .toFixed(2) , + vDGTemperatures.outletRedundancy .toFixed(2) , + vDGTemperatures.inletDialysate .toFixed(2) , + vDGTemperatures.primaryHeaterThermoCouple .toFixed(2) , + vDGTemperatures.trimmerHeaterThermoCouple .toFixed(2) , + vDGTemperatures.primaryHeaterColdJunction .toFixed(2) , + vDGTemperatures.trimmerHeaterColdJunction .toFixed(2) , + vDGTemperatures.primaryHeaterInternal .toFixed(2) , + vDGTemperatures.trimmerHeaterInternal .toFixed(2) + ] + textObjectName: "_DGTemperaturesData" + } + + // Next row + DebugDataColumn { id: _DGValvesStatesColumn + x: col(1) + y: row(2) + title: qsTr(" Valves ") + model: [ vDGValvesStates.text ] + textObjectName: "_DGValvesStatesData" + } + + DebugDataColumn { id: _DGOperationModeColumn + x: col(5) + y: row(2) + title: qsTr(" DG Mode ") + model: [ vDGOperationMode.text ] + textObjectName: "_DGOperationModeData" + } + + // --- HD --- + DebugDataColumn { id: _HDBloodFlowColumn + x: col(0) + y: row(2.8) + title: qsTr(" Blood ") + model: [ + vTreatmentBloodFlow.bloodFlow_FlowSetPoint , + vTreatmentBloodFlow.bloodFlow_MeasuredFlow .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_RotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlCurrent .toFixed(2) , + "%" + vTreatmentBloodFlow.bloodFlow_PWMDutyCycle .toFixed(2) , + "%" + vTreatmentBloodFlow.bloodFlow_SigStrength .toFixed(2) + ] + textObjectName: "_HDBloodFlowData" + } + + DebugDataColumn { id: _HDDialysateInletFlowColumn + x: col(1.2) + y: row(2.8) + title: qsTr(" Dlyst I ") + model: [ + vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MeasuredFlow .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_RotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentDialysateFlow.dialysateFlow_PWMDutyCycle .toFixed(2) , + "%" + vTreatmentDialysateFlow.dialysateFlow_SigStrength .toFixed(2) + ] + textObjectName: "_HDInletFlowData" + } + + DebugDataColumn { id: _HDDialysateOutletFlowColumn + x: col(2.4) + y: row(2.8) + title: qsTr(" Dlyst O ") + model: [ + vTreatmentUltrafiltration.ultrafiltration_RefUFVol .toFixed(3) , + vTreatmentUltrafiltration.ultrafiltration_MeasUFVol .toFixed(3) , + vTreatmentUltrafiltration.ultrafiltration_RotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentUltrafiltration.ultrafiltration_PWMDtCycle .toFixed(2) + ] + textObjectName: "_HDOutletFlowData" + } + + DebugDataColumn { id: _HDPressureOcclusionColumn + x: col(3.6) + y: row(2.8) + title: qsTr(" Prsr Oc ") + model: [ + vTreatmentPressureOcclusion.arterialPressure .toFixed(2) , + vTreatmentPressureOcclusion.venousPressure .toFixed(2) , + vTreatmentPressureOcclusion.bloodPumpOcclusion , + vTreatmentPressureOcclusion.dialysateInletPumpOcclusion , + vTreatmentPressureOcclusion.dialysateOutletPumpOcclusion + ] + textObjectName: "_PressureOcclusionData" + } + + DebugDataColumn { id: _HDOperationModeColumn + x: col(2.8) + y: row(2) + title: qsTr(" HD Mode ") + model: [ vHDOperationMode.text ] + textObjectName: "_HDOperationModeData" + } + + Text { id : _canbusFaultCountText + x: col(0) + y: row(6) + property int count: 0 + visible: true + text: qsTr("CAN Faults: %1").arg(count) + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: 38 + } + + DebugDataColumn { id: _HDAccelerometerColumn + x: col(7) + y: row(3.2) + title: qsTr(" HD Acc ") + model: [ + vHDAccelerometer.x .toFixed(3) , + vHDAccelerometer.y .toFixed(3) , + vHDAccelerometer.z .toFixed(3) , + vHDAccelerometer.xMax .toFixed(3) , + vHDAccelerometer.yMax .toFixed(3) , + vHDAccelerometer.zMax .toFixed(3) , + vHDAccelerometer.xTilt .toFixed(3) , + vHDAccelerometer.yTilt .toFixed(3) , + vHDAccelerometer.zTilt .toFixed(3) + ] + textObjectName: "_HDAccelerometerData" + } + + DebugDataColumn { id: _DGAccelerometerColumn + x: col(7) + y: row(0) + title: qsTr(" DG Acc ") + model: [ + vDGAccelerometer.x .toFixed(3) , + vDGAccelerometer.y .toFixed(3) , + vDGAccelerometer.z .toFixed(3) , + vDGAccelerometer.xMax .toFixed(3) , + vDGAccelerometer.yMax .toFixed(3) , + vDGAccelerometer.zMax .toFixed(3) , + vDGAccelerometer.xTilt .toFixed(3) , + vDGAccelerometer.yTilt .toFixed(3) , + vDGAccelerometer.zTilt .toFixed(3) + ] + textObjectName: "_DGAccelerometerData" + } + + DebugDataColumn { id: _HDVersionsColumn + x: col(6) + y: row(4.5) + title: qsTr(" HD Ver ") + model: [ "v%1.%2.%3-%4 %5 v%6.%7 %8" + .arg(vAdjustmentVersions.hdVerMajor) + .arg(vAdjustmentVersions.hdVerMinor) + .arg(vAdjustmentVersions.hdVerMicro) + .arg(vAdjustmentVersions.hdVerBuild) + .arg(vAdjustmentVersions.hdVerFPGAId) + .arg(vAdjustmentVersions.hdVerFPGAMajor) + .arg(vAdjustmentVersions.hdVerFPGAMinor) + .arg(vAdjustmentVersions.hdVerFPGALab) + ] + textObjectName: "_HDVersions" + } + TouchRect { + x : col(5.2) + y : row(4.5) + width : 150 + height : 35 + text.text : "Get Version" + onClicked : vAdjustmentVersions.doAdjustment() + } + + DebugDataColumn { id: _DGVersionsColumn + x: col(6) + y: row(5.4) + title: qsTr(" DG Ver ") + model: [ "v%1.%2.%3-%4 %5 v%6.%7 %8" + .arg(vAdjustmentVersions.dgVerMajor) + .arg(vAdjustmentVersions.dgVerMinor) + .arg(vAdjustmentVersions.dgVerMicro) + .arg(vAdjustmentVersions.dgVerBuild) + .arg(vAdjustmentVersions.dgVerFPGAId) + .arg(vAdjustmentVersions.dgVerFPGAMajor) + .arg(vAdjustmentVersions.dgVerFPGAMinor) + .arg(vAdjustmentVersions.dgVerFPGALab) + ] + textObjectName: "_DGVersions" + } + + + Text { id : _mouseEventCountText + x: col(2) + y: row(6) + visible: true + text: String("Touch Count: %1,%2") + .arg(GuiEventSpy.touchCount /*.toString().padStart(4,'0')*/ ) + .arg(GuiEventSpy.touchPoints /*.toString().padStart(4,'0')*/ ) + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: 38 + MouseArea { + anchors.fill: _mouseEventCountText + onClicked: GuiEventSpy.doTouchReset() + } + } + + DebugDataColumn { id: _PreTreatmentStates + x: col(1) + y: row(6.5) + title: qsTr(" PreTx States ") + model: [ "%1, %2, %3, %4, %5, %6, %7, %8" + .arg(vPreTreatmentStates.subMode ) + .arg(vPreTreatmentStates.waterSampleState ) + .arg(vPreTreatmentStates.selfTestNoCartridgeState) + .arg(vPreTreatmentStates.installationState ) + .arg(vPreTreatmentStates.selfTestDryState ) + .arg(vPreTreatmentStates.primeState ) + .arg(vPreTreatmentStates.recirculateState ) + .arg(vPreTreatmentStates.patientConnectionState ) + ] + textObjectName: "_PreTreatmentStates" + } + + Connections { target: _GuiView + onDidActionReceive: { + if (vAction === GuiActions.ID_CANBusFaultCount ) { + _canbusFaultCountText.count = vData[0] + } + } + } +} Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r1a8e9578b27bb3877116675d0b2361ce4f5b5539 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 1a8e9578b27bb3877116675d0b2361ce4f5b5539) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -130,7 +130,7 @@ bottomMargin : spacing } - // IMPORTANT NOTE: + // IMPORTANT NOTE : Alarm Dialog buttons // It has been granteed by FW that there should never be more than 3 buttons on the ScreenItem // Regarding the discussion there should be only 3 situations: // 1 - Different combination of the Resume,Rinseback,End Index: sources/gui/qml/main.qml =================================================================== diff -u -r577ab4647b2584d4e32b26797281ec1543d2e1aa -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/main.qml (.../main.qml) (revision 577ab4647b2584d4e32b26797281ec1543d2e1aa) +++ sources/gui/qml/main.qml (.../main.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -28,6 +28,7 @@ import VSettings 0.1 import VAdjustmentVersions 0.1 import VDateTime 0.1 +import VNetworkModel 0.1 // States views import VHDOperationMode 0.1 @@ -111,12 +112,7 @@ VSettings { id: vSettings } VAdjustmentVersions { id: vAdjustmentVersions } VDateTime { id: vDateTime } - QtObject { id: vNetwork - property string status: "No Status" - property string ipAddress: "192.168.10.1" - property string gateway : "192.168.10.2" - - } + VNetworkModel { id: vNetwork } // ---- States VHDOperationMode { id: vHDOperationMode } VPreTreatmentStates { id: vPreTreatmentStates } @@ -232,19 +228,24 @@ font.pixelSize: 14 } - SDItem { } - PowerItem { id: _powerItem } - AlarmItem { id: _alarmItem } - Keyboard { id: _keyboard } + DiagnosticsDialog { id: _diagnosticsDialog } + SDItem { + onDoubleClicked:{ + _diagnosticsDialog.open() + } + } + PowerItem { id: _powerItem } + AlarmItem { id: _alarmItem } + Keyboard { id: _keyboard } // NotificationBar has to be anchored to the main menu and if it is moved into the AlarmItem // then cannot be anchored. - NotificationBar { id: _alarmBar - anchors.bottom : _mainMenu.top - backgroundColor : _alarmItem.backgroundColor - textColor : _alarmItem.textColor - text : _alarmItem.text - isSilenced : _alarmItem.isSilenced - timeout : _alarmItem.timeout + NotificationBar { id: _alarmBar + anchors.bottom : _mainMenu.top + backgroundColor : _alarmItem.backgroundColor + textColor : _alarmItem.textColor + text : _alarmItem.text + isSilenced : _alarmItem.isSilenced + timeout : _alarmItem.timeout } } Fisheye: Tag 7077e38c74db9cccb5496ffefcf8936c0916de76 refers to a dead (removed) revision in file `sources/gui/qml/pages/ManagerHome.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/pages/ManagerStack.qml =================================================================== diff -u -rbd01334f257c35b96b7b232beacbcd7fae60c852 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision bd01334f257c35b96b7b232beacbcd7fae60c852) +++ sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -28,9 +28,13 @@ * is selected from the main menu. */ StackItem { id : _root - ManagerHome { id : _managerHome } stackView.initialItem : _managerHome + ScreenItem { id: _managerHome + PlaceHolderText { screenName: qsTr("Treatment Management") } + onVisibleChanged: if (visible) _mainMenu.hidden = true + } + onVisibleChanged: { if (visible) { _mainMenu.hidden = false Index: sources/gui/qml/pages/UserConfirmation.qml =================================================================== diff -u --- sources/gui/qml/pages/UserConfirmation.qml (revision 0) +++ sources/gui/qml/pages/UserConfirmation.qml (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,78 @@ +/*! + * + * 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 Alert.qml + * \author (last) Peter Lucia + * \date (last) 30-Nov-2020 + * \author (original) Peter Lucia + * \date (original) 30-Nov-2019 + * + */ + +// Qt +import QtQuick 2.12 + +// Project + +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/settings" + +/*! + * \brief Contains the message for user information or password entry for user to confirm. + */ +SettingsBase { id: _root + objectName : "UserConfirmation" // SquishQt testability + + property bool isPassword: false + property string password: _password.textInput.text + property alias message : _message.text + + firstFocusInput : isPassword ? _password : undefined + TextEntry { id : _password + clip : true + visible : _root.isPassword + label.text : qsTr("Password") + label .width : 150 + textInput .width : 450 + anchors { + top : parent.top + topMargin : topMarginContent + 120 // moved a little down to be more on center and close to keyboard top edge. + horizontalCenter: parent.horizontalCenter + } + textInput.inputMethodHints : Qt.ImhNone + textInput.echoMode : TextInput.Password + } + + Image { id : _showPassword + visible : _password.visible + anchors.left : _password.right + anchors.leftMargin : Variables.minVGap + anchors.verticalCenter : _password.verticalCenter + width : Variables.iconsDiameter + height : Variables.iconsDiameter + source : "qrc:/images/iEye" + } + MouseArea { + anchors.fill: _showPassword + onPressed : _password.textInput.echoMode = TextInput.Normal + onReleased : _password.textInput.echoMode = TextInput.Password + } + + Text { id : _message + visible : ! _root.isPassword + text : "Do you ... ?" + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTitle + anchors.topMargin : topMarginContent + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter : parent.verticalCenter + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + } +} Index: sources/gui/qml/pages/endtreatment/EndTreatmentRinsebackStack.qml =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/endtreatment/EndTreatmentRinsebackStack.qml (.../EndTreatmentRinsebackStack.qml) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/qml/pages/endtreatment/EndTreatmentRinsebackStack.qml (.../EndTreatmentRinsebackStack.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -71,7 +71,7 @@ } } -/* TODO: +/* TODO : stackView manual performance enhanced. // an idea that is being worked on for later performance imporovement // if the stackview becomes slow this idea is a manual transition with animation to be replacecd with stackView PropertyAnimation { id: _rbInitAnimation Index: sources/gui/qml/pages/pretreatment/PreTreatmentDisposablesStack.qml =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/pretreatment/PreTreatmentDisposablesStack.qml (.../PreTreatmentDisposablesStack.qml) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/gui/qml/pages/pretreatment/PreTreatmentDisposablesStack.qml (.../PreTreatmentDisposablesStack.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -35,7 +35,7 @@ readonly property bool hasHeparin : vTreatmentCreate.heparinBolusVolume || vTreatmentCreate.heparinDispensingRate PreTreatmentBase { id: _preTreatmentDisposablesSelfTest - title.text : qsTr("Disposables Self Test") + title.text : qsTr("System Self Test") hasTimeCircle : true timeCircleMinimum : 0 timeCircleMaximum : vPreTreatmentSelfTestNoCartridge.total Index: sources/gui/qml/pages/settings/SettingsBase.qml =================================================================== diff -u -r65558208e4968de9a5470ff5fda1ee2a9d00c793 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/settings/SettingsBase.qml (.../SettingsBase.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) +++ sources/gui/qml/pages/settings/SettingsBase.qml (.../SettingsBase.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -27,6 +27,7 @@ ScreenItem { id: _root objectName: "_SettingsBase" + property var firstFocusInput : undefined readonly property int topMarginTitle : 100 property int topMarginContent : 200 @@ -45,6 +46,13 @@ signal backClicked() signal confirmClicked() + function setFocus() { + if (firstFocusInput) { + firstFocusInput.textInput.forceActiveFocus() + _keyboard.setVisible(true) + } + } + BackButton { id : _backButton objectName: "_backButton" visible: true @@ -80,6 +88,7 @@ topMargin : topMarginTitle horizontalCenter: parent.horizontalCenter } + horizontalAlignment : Text.AlignHCenter text : itemsText[itemIndex] color : Colors.textMain font.pixelSize : Fonts.fontPixelTitle Index: sources/gui/qml/pages/settings/SettingsDateTime.qml =================================================================== diff -u -r840b91f4f72d599bb523050dda2183a6611017b5 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 840b91f4f72d599bb523050dda2183a6611017b5) +++ sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -29,11 +29,6 @@ */ SettingsBase { id: _root - function setFocus() { - _hours.textInput.forceActiveFocus() - _keyboard.setVisible(true) - } - property int labelWidth : 275 property int entryWidth : 100 @@ -44,10 +39,10 @@ _hours .textInput.acceptableInput && _minutes.textInput.acceptableInput - confirmEnabled: isValid - + confirmEnabled : isValid + firstFocusInput : _hours notificationText: vDateTime.status - onConfirmClicked: { + onConfirmClicked: { vDateTime.doConfirm( _year .textInput.text , _month .textInput.text , Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r577ab4647b2584d4e32b26797281ec1543d2e1aa -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 577ab4647b2584d4e32b26797281ec1543d2e1aa) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -20,6 +20,7 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages" /*! * \brief SettingsStack is the screen @@ -36,6 +37,7 @@ SetDateTime , WiFi , Bluetooth , + EmptySep , Services } @@ -55,11 +57,17 @@ itemIndex : SettingsStack.WiFi } + UserConfirmation { id: _servicePassword + itemIndex : SettingsStack.Services + title : qsTr("Please Enter The Service Password") + isPassword: true + } + SettingsHome { id : _settingsHome backVisible : false confirmVisible : false itemsText : _root.itemsText - itemsEnabled : [ 1,1,1,0,0,0,0,0,0 ] + itemsEnabled : [ 1,1,0,0,1,0,0,0,0 ] onItemClicked : { switch (vIndex) { case SettingsStack.SetDateTime: @@ -68,8 +76,14 @@ _settingsDateTime.setFocus() break case SettingsStack.WiFi: - push( _settingsWiFi ) - break + vNetwork.doInit() + push( _settingsWiFi ) + // _settingsWiFi.setFocus() + break + case SettingsStack.Services: + push(_servicePassword) + _servicePassword.setFocus() + break default: console.debug(vIndex) break Index: sources/gui/qml/pages/settings/SettingsWiFi.qml =================================================================== diff -u -r577ab4647b2584d4e32b26797281ec1543d2e1aa -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision 577ab4647b2584d4e32b26797281ec1543d2e1aa) +++ sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -17,67 +17,215 @@ import QtQuick 2.12 // Project -import Gui.Actions 0.1; +import Gui.Actions 0.1 // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages" /*! * \brief SettingsWiFi * The settings screen to setup the WiFi connection */ SettingsBase { id: _root - function setFocus() { - _hours.textInput.forceActiveFocus() - _keyboard.setVisible(true) - } - property var ipValidator: RegExpValidator { regExp:/^(([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))\.){3}([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))$/ } - property int labelWidth : 275 - property int inputWidth : 275 - property int spacing : 20 + readonly property int labelWidth : 200 + readonly property int inputWidth : 175 + readonly property int spacing : 20 + readonly property int leftMargin : 50 + readonly property int rightMargin : 50 + readonly property int topMargin : topMarginContent - 40 // moved up to top of the keyboard - readonly property bool isValid : false - // _year .textInput.acceptableInput && - // _month .textInput.acceptableInput && - // _day .textInput.acceptableInput && - // _hours .textInput.acceptableInput && - // _minutes.textInput.acceptableInput + readonly property bool isValid : + _ipAddress .textInput.acceptableInput && + _gateway .textInput.acceptableInput && + _subnetmask .textInput.acceptableInput && + _dns .textInput.acceptableInput - confirmEnabled: isValid - + confirmEnabled : isValid + confirmVisible : false // since the static setting is done one by one seems confirm is not needed for now. + firstFocusInput : _ipAddress notificationText: vNetwork.status onConfirmClicked: { - // vDateTime.doConfirm( - // _year .textInput.text , - // _month .textInput.text , - // _day .textInput.text , - // _hours .textInput.text , - // _minutes.textInput.text ) + vDateTime.doConfirm( + _ipAddress .textInput.text , + _gateway .textInput.text , + _subnetmask .textInput.text , + _dns .textInput.text ) } - Column { id: _container - spacing: _root.spacing - anchors.horizontalCenter: parent.horizontalCenter + Column { id : _ipColumn + spacing : _root.spacing + y : _root.topMargin + anchors.left : parent.left + anchors.leftMargin : _root.leftMargin - TextEntry { id: _ipAddress + TextEntry { id : _ipAddress + // nextInput : _gateway // it's not needed to be entered in order all the time and also the keyboard needs to be hidden for the set result to be shown. textInput.text : vNetwork.ipAddress label.text : qsTr("IP Address") - width : inputWidth + textInput.width : inputWidth + label.width : labelWidth validator : ipValidator - nextInput : _gateway + onEnterPressed : { + _keyboard.setVisible(false) + vNetwork.doSetIPAddress(textInput.text) + } } - TextEntry { id: _gateway + TextEntry { id : _gateway + // nextInput : _subnetmask // it's not needed to be entered in order all the time and also the keyboard needs to be hidden for the set result to be shown. textInput.text : vNetwork.gateway - width : inputWidth + textInput.width : inputWidth + label.width : labelWidth label.text : qsTr("Gateway") validator : ipValidator + onEnterPressed : { + _keyboard.setVisible(false) + vNetwork.doSetGateway(textInput.text) + } } + + TextEntry { id : _subnetmask + // nextInput : _dns // it's not needed to be entered in order all the time and also the keyboard needs to be hidden for the set result to be shown. + textInput.text : vNetwork.subnetMask + textInput.width : inputWidth + label.width : labelWidth + label.text : qsTr("Subnet Mask") + validator : ipValidator + onEnterPressed : { + _keyboard.setVisible(false) + vNetwork.doSetSubnetMask(textInput.text) + } + } + + TextEntry { id : _dns + textInput.text : vNetwork.dns + textInput.width : inputWidth + label.width : labelWidth + label.text : qsTr("DNS") + validator : ipValidator + onEnterPressed : { + _keyboard.setVisible(false) + vNetwork.doSetDNS(textInput.text) + } + } } + + Row { id : _ssidRow + anchors.top : _ipColumn.bottom + anchors.topMargin : 50 + anchors.left : parent.left + anchors.leftMargin : _root.leftMargin + Text { id : _ssidLabel + font.pixelSize : Fonts.fontPixelTextRectExtra + color : Colors.textMain + horizontalAlignment : TextInput.Alignleft + width : labelWidth + text : qsTr("SSID") + } + + Text { id : _ssidText + font.pixelSize : Fonts.fontPixelTextRectExtra + color : Colors.textMain + horizontalAlignment : TextInput.Alignleft + text : vNetwork.ssid + width : inputWidth + } + } + + TouchRect { id : _scanButton + anchors.bottom : parent.bottom + anchors.bottomMargin: Variables.mainMenuHeight * 2 + Variables.minVGap + anchors.left : parent.left + anchors.leftMargin : _root.leftMargin + text.text : qsTr("SCAN") + width : 350 + isDefault : true + enabled :!vNetwork.scanInProgress + onClicked : vNetwork.doScan() + } + + ScrollBar { flickable : _networkList + anchors.fill: _networkList + } + ListView { id : _networkList + model : vNetwork + clip : true + spacing : 7 + y : _root.topMargin + width : 450 + anchors.top : _ipColumn.top + anchors.bottom : _scanButton.bottom + anchors.right : _root.right + anchors.rightMargin : _root.rightMargin + delegate : TouchRect { id : _delegate + + property bool isCurrrentNetwork: vNetwork.macAddress === macAddress + + clip : true + text.text : ssid + text.elide : Text.ElideLeft + width : _networkList.width - Variables.minVGap + height : 75 + radius : Variables.dialogRadius + + text.anchors.horizontalCenter : undefined + text.horizontalAlignment : Text.AlignLeft + text.leftPadding : 5 + border.width : 1 + + Text { id : _securityLevel + anchors { + left : parent.left + leftMargin : 10 + bottom : parent.bottom + } + font.pixelSize : Fonts.fontPixelDialogText + text : securityTypes + color : Colors.textMain + } + + Text { id : _isConnected + anchors { + right : parent.right + rightMargin : 10 + bottom : parent.bottom + } + font.pixelSize : Fonts.fontPixelDialogText + text : _delegate.isCurrrentNetwork ? qsTr("Connected") : "" + color : Colors.textMain + } + + onClicked : { + _userConfirmation.isPassword = ! _delegate.isCurrrentNetwork + _userConfirmation.ssid = ssid + _userConfirmation.macAddress = macAddress + push( _userConfirmation ) + _userConfirmation.setFocus() + } + } + } + + UserConfirmation { id : _userConfirmation + property string ssid : "" + property string macAddress : "" + property string separator : "\n" + // notificationText : vNetwork.status + message : qsTr("Do you want to disconnect from `%1`?").arg(ssid) + title : isPassword ? qsTr("Join") + separator + ssid : qsTr("Disconnect") + separator + ssid + onConfirmClicked : { + if ( isPassword ) { + vNetwork.doJoinNetwork ( macAddress, password ) + } else { + vNetwork.doDisconnectNetwork( macAddress ) + } + pop() + } + } } Index: sources/main.h =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/main.h (.../main.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/main.h (.../main.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -30,7 +30,7 @@ // TODO : A singleton parent class needs to be created // to taking care of the Threading, init, quit, and so -// TODO : +// TODO : Threading // - We still need to work on threading on other classes // - We need to have a singleton parent class // - Some code has been added to debug can interface (We still have swap frames) Index: sources/model/MAbstract.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/MAbstract.cpp (.../MAbstract.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/MAbstract.cpp (.../MAbstract.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -59,8 +59,7 @@ * \return String */ QString MAbstract::description() const { - // TODO: - // not all the received messages are inherited form MAbstract + // TODO : not all the received messages are inherited form MAbstract // also LOG_EVENT is adding E // so for now let LOG_EVENT add E until all the received messages inherit from MAbstract return /*_typeText[typeText()] + _delimiter +*/ _unitText[unitText()] + _delimiter + infoText(); Index: sources/model/MAbstract.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/MAbstract.h (.../MAbstract.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/MAbstract.h (.../MAbstract.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -99,24 +99,31 @@ * \details type of the model which can be Data or Event which is mostly used in logging. * \return Enum of Types */ - virtual Type_Enum typeText ( ) const = 0; + virtual Type_Enum typeText () const = 0; /*! * \brief unitText * \details the unit which UI communicates with by using this model and is used in Logging mostly * \return Enum of Units */ - virtual Unit_Enum unitText ( ) const = 0; + virtual Unit_Enum unitText () const = 0; /*! * \brief infoText * \details the text description of the model which will be used in the logging. * \return QString */ - virtual QString infoText ( ) const = 0; + virtual QString infoText () const = 0; /*! * \brief parameters * \return current data values of the models. */ - virtual QVariantList parameters ( ) const = 0; + virtual QVariantList parameters () const = 0; + /*! + * \brief size + * \return This has to be implemented in each child to return the message payload length. + */ + // TODO : The message length can be get from the model itself but currently we have an enum for that. + // It needs work and will be done later. + // virtual quint32 size () const = 0; // Non-virtual methods which working with parameters virtual method. void toVariantList(QVariantList &vData) const; Index: sources/model/MModel.h =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/MModel.h (.../MModel.h) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/model/MModel.h (.../MModel.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -231,6 +231,8 @@ #define REGISTER_MODEL_METATYPES \ \ REGISTER_METATYPE( SettingsData ) \ + REGISTER_METATYPE( WifiNetworkData ) \ + \ REGISTER_METATYPE( HDOperationModeData ) \ REGISTER_METATYPE( PreTreatmentStatesData ) \ REGISTER_METATYPE( TreatmentStatesData ) \ Index: sources/model/dg/data/MDGHeatersData.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/dg/data/MDGHeatersData.h (.../MDGHeatersData.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/dg/data/MDGHeatersData.h (.../MDGHeatersData.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -36,9 +36,9 @@ * * | Payload || * | || - * | #1:(U32) | \ref Data::mMainPrimaryDC | - * | #2:(U32) | \ref Data::mSmallPrimaryDC | - * | #3:(U32) | \ref Data::mTrimmerDC | + * | #1:(F32) | \ref Data::mMainPrimaryDC | + * | #2:(F32) | \ref Data::mSmallPrimaryDC | + * | #3:(F32) | \ref Data::mTrimmerDC | * * \sa Data * @@ -59,9 +59,9 @@ QVariantList parameters() const override; struct { - Types::U32 mMainPrimaryDC ; - Types::U32 mSmallPrimaryDC ; - Types::U32 mTrimmerDC ; + Types::F32 mMainPrimaryDC ; + Types::F32 mSmallPrimaryDC ; + Types::F32 mTrimmerDC ; } _data; public: @@ -71,9 +71,9 @@ QString infoText () const override { return QString("Heaters"); } struct Data { - quint32 mMainPrimaryDC = 0; ///< main Primary DC - quint32 mSmallPrimaryDC = 0; ///< small Primary DC - quint32 mTrimmerDC = 0; ///< trimmer DC + float mMainPrimaryDC = 0; ///< main Primary DC + float mSmallPrimaryDC = 0; ///< small Primary DC + float mTrimmerDC = 0; ///< trimmer DC }; MDGHeaters () {} Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -456,12 +456,12 @@ * * | Payload || * | || - * | #1:(U08) | silence | + * | #1:(U32) | silence | * */ class MAlarmSilenceReq : public MModel { public: - quint8 silence = 1; + quint32 silence = 1; // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r64acc3de5b17878fa78a7d4310a6d655bf29dcb8 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 64acc3de5b17878fa78a7d4310a6d655bf29dcb8) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 04-May-2021 + * \date (last) 11-May-2021 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * @@ -30,7 +30,7 @@ case GuiAlarmID::ALARM_ID_NO_ALARM : { result = QObject::tr("Indication for when no alarms is a possible situation." ); break; } case GuiAlarmID::ALARM_ID_HD_SOFTWARE_FAULT : { result = QObject::tr("HD Software fault.\nSoftware found itself in an unexpected state." ); break; } case GuiAlarmID::ALARM_ID_STUCK_BUTTON_TEST_FAILED : { result = QObject::tr("Stuck button POST failure.\nStop or Off button detected to be pressed for at least 1 second during test shortly after power up." ); break; } - case GuiAlarmID::ALARM_ID_FPGA_POST_TEST_FAILED : { result = QObject::tr("FPGA POST failure." ); break; } + case GuiAlarmID::ALARM_ID_HD_FPGA_POST_TEST_FAILED : { result = QObject::tr("HD FPGA POST failure." ); break; } case GuiAlarmID::ALARM_ID_WATCHDOG_POST_TEST_FAILED : { result = QObject::tr("Watchdog POST failure." ); break; } case GuiAlarmID::ALARM_ID_UI_COMM_POST_FAILED : { result = QObject::tr("UI communication POST failure.\nUI failed to communicate within a reasonable time after power up." ); break; } case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Blood pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running." ); break; } @@ -73,10 +73,10 @@ case GuiAlarmID::ALARM_ID_NVDATA_SRVC_RECORD_CRC_ERROR : { result = QObject::tr("Service record CRC failure." ); break; } case GuiAlarmID::ALARM_ID_NVDATA_CAL_RECORD_CRC_ERROR : { result = QObject::tr("Calibration record CRC failure." ); break; } case GuiAlarmID::ALARM_ID_NVDATA_HW_USAGE_DATA_CRC_ERROR : { result = QObject::tr("HW usage data (treatment time in HD and total consumed water in DG) failure." ); break; } - case GuiAlarmID::AlARM_ID_NVDATA_DISINFECTION_DATE_CRC_ERROR : { result = QObject::tr("Last disinfection date CRC error." ); break; } - case GuiAlarmID::ALARM_ID_RO_PUMP_OUT_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("Pressure at outlet of RO pump is out of range." ); break; } + case GuiAlarmID::ALARM_ID_AVAILABLE_1 : { result = QObject::tr("Last disinfection date CRC error." ); break; } + case GuiAlarmID::ALARM_ID_AVAILABLE_2 : { result = QObject::tr("Pressure at outlet of RO pump is out of range." ); break; } case GuiAlarmID::ALARM_ID_TEMPERATURE_SENSORS_FAULT : { result = QObject::tr("DG temperature sensors fault." ); break; } - case GuiAlarmID::ALARM_ID_FPGA_COMM_TIMEOUT : { result = QObject::tr("FPGA communication down for too long." ); break; } + case GuiAlarmID::ALARM_ID_HD_FPGA_COMM_TIMEOUT : { result = QObject::tr("HD FPGA communication down for too long." ); break; } case GuiAlarmID::ALARM_ID_HD_COMM_TIMEOUT : { result = QObject::tr("HD communication timeout." ); break; } case GuiAlarmID::ALARM_ID_VALVE_CONTROL_FAILURE : { result = QObject::tr("FPGA not accepting commanded valve states." ); break; } case GuiAlarmID::ALARM_ID_BLOOD_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." ); break; } @@ -137,7 +137,7 @@ case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_WARNING : { result = QObject::tr("HD end of treatment warning." ); break; } case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_ALARM : { result = QObject::tr("HD end of treatment alarm (user not acting to end treatment)." ); break; } case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_HIGH : { result = QObject::tr("HD end of treatment alarm (high priority - user still not acting to end treatment)." ); break; } - case GuiAlarmID::ALARM_ID_DG_HEAT_DISINFECT_CYCLE_FAILED : { result = QObject::tr("DG heat disinfect cycle failed." ); break; } + case GuiAlarmID::ALARM_ID_AVAILABLE_3 : { result = QObject::tr("DG heat disinfect cycle failed." ); break; } case GuiAlarmID::ALARM_ID_RO_PUMP_RAMP_UP_TO_FLOW_TIMEOUT : { result = QObject::tr("DG RO pump ramp up to target flow time out." ); break; } case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_LOWER_RANGE : { result = QObject::tr("DG flow rate out of lower range." ); break; } case GuiAlarmID::ALARM_ID_DRAIN_PUMP_OFF_FAULT : { result = QObject::tr("DG drain pump off fault." ); break; } @@ -155,7 +155,7 @@ case GuiAlarmID::ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM : { result = QObject::tr("HD in treatment rinseback operation timeout." ); break; } case GuiAlarmID::ALARM_ID_TREATMENT_RECIRC_TIMEOUT_ALARM : { result = QObject::tr("HD in treatment re-circ sub-mode for too long." ); break; } case GuiAlarmID::ALARM_ID_CARTRIDGE_DOOR_OPENED : { result = QObject::tr("HD cartridge door opened alarm." ); break; } - case GuiAlarmID::ALARM_ID_PRE_TREATMENT_NO_CART_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode no cartridge self-tests failure." ); break; } + case GuiAlarmID::ALARM_ID_AVAILABLE_4 : { result = QObject::tr("HD pre-treatment mode no cartridge self-tests failure." ); break; } case GuiAlarmID::ALARM_ID_INSTALL_NEW_CARTRIDGE : { result = QObject::tr("HD needs new cartridge to be installed." ); break; } case GuiAlarmID::ALARM_ID_CARTRIDGE_INSTALLED_IMPROPERLY : { result = QObject::tr("HD cartridge installed improperly alarm." ); break; } case GuiAlarmID::ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE : { result = QObject::tr("HD rinseback volume check failure." ); break; } @@ -167,7 +167,7 @@ case GuiAlarmID::ALARM_ID_PRE_TREATMENT_DRY_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode dry self-tests failure." ); break; } case GuiAlarmID::ALARM_ID_PRE_TREATMENT_WET_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode wet self-tests failure." ); break; } case GuiAlarmID::ALARM_ID_DG_FLOW_METER_CHECK_FAILURE : { result = QObject::tr("DG flow meter check failure alarm." ); break; } - case GuiAlarmID::ALARM_ID_DG_RO_PUMP_TOO_MANY_RAMP_UP_RETRY : { result = QObject::tr("DG RO pump ramp up exceed maximum allowed number of retries." ); break; } + case GuiAlarmID::ALARM_ID_AVAILABLE_5 : { result = QObject::tr("DG RO pump ramp up exceed maximum allowed number of retries." ); break; } case GuiAlarmID::ALARM_ID_NVDATAMGMT_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG/HD NV data management overall group record CRC invalid." ); break; } case GuiAlarmID::ALARM_ID_NVDATAMGMT_INDIVIDUAL_RECORD_CRC_INVALID : { result = QObject::tr("DG/HD NV data management individual record CRC invalid." ); break; } case GuiAlarmID::ALARM_ID_NVDATAMGMT_INDIVIDUAL_RECORD_TIME_INVALID : { result = QObject::tr("DG/HD NV data management individual record time invalid." ); break; } @@ -223,6 +223,32 @@ case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_RUNNING_WHILE_BP_OFF_ERROR : { result = QObject::tr("HD syringe pump is running while the BP is off." ); break; } case GuiAlarmID::ALARM_ID_DG_CHEM_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT: { result = QObject::tr("DG chemical disinfect inlet pressure and temperature sensors out of range." ); break; } case GuiAlarmID::ALARM_ID_DG_CHEM_DISINFECT_INLET_COND_AND_TEMP_OUT : { result = QObject::tr("DG chemical disinfect inlet conductivity and temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_FPGA_COMM_TIMEOUT : { result = QObject::tr("DG FPGA communication down for too long." ); break; } + case GuiAlarmID::ALARM_ID_DG_LOAD_CELL_ADC_ERROR : { result = QObject::tr("DG load cell ADC error." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_READ_TIMEOUT_ERROR : { result = QObject::tr("HD venous pressure sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_SENSOR_TEMP_OUT_OF_RANGE : { result = QObject::tr("HD venous pressure sensor temperature out of range error." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_READ_TIMEOUT_ERROR : { result = QObject::tr("HD BP occlusion sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_DPI_OCCLUSON_READ_TIMEOUT_ERROR : { result = QObject::tr("HD DPi occlusion sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_DPO_OCCLUSION_READ_TIMEOUT_ERROR : { result = QObject::tr("HD DPo occlusion sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD BP occlusion sensor error." ); break; } + case GuiAlarmID::ALARM_ID_HD_DPI_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD DPi occlusion sensor error." ); break; } + case GuiAlarmID::ALARM_ID_HD_DPO_OCCLUSION_SENSOR_ERROR : { result = QObject::tr("HD DPo occlusion sensor error." ); break; } + case GuiAlarmID::ALARM_ID_DG_CONCENTRATE_PUMP_FAULT : { result = QObject::tr("DG concentrate pump fault." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_FLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD blood flow sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_FLOW_SENSOR_ERROR : { result = QObject::tr("HD blood flow sensor error." ); break; } + case GuiAlarmID::ALARM_ID_HD_DP_FLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD dialysate flow sensor not being read." ); break; } + case GuiAlarmID::ALARM_ID_HD_DP_FLOW_SENSOR_ERROR : { result = QObject::tr("HD dialysate flow sensor error." ); break; } + case GuiAlarmID::ALARM_ID_DG_CHEM_DISINFECT_TARGET_TEMP_TIMEOUT : { result = QObject::tr("DG chemical disinfect could not reach to target temperature." ); break; } + case GuiAlarmID::ALARM_ID_DG_FPGA_POST_TEST_FAILED : { result = QObject::tr("DG FPGA POST failure." ); break; } + case GuiAlarmID::ALARM_ID_HD_ARTERIAL_BUBBLE_SELF_TEST_FAILURE : { result = QObject::tr("HD arterial air bubble detector self-test failure." ); break; } + case GuiAlarmID::ALARM_ID_HD_ARTERIAL_BUBBLE_DETECTOR_FAULT : { result = QObject::tr("HD arterial air bubble detector fault." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEATERS_SELF_TEST_FAILURE : { result = QObject::tr("DG heaters failed POST." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_BUBBLE_SELF_TEST_FAILURE : { result = QObject::tr("HD venous air bubble detector self-test failure." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_BUBBLE_DETECTOR_TREATMENT_FAULT : { result = QObject::tr("HD venous air bubble detector treatment fault." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_BUBBLE_DETECTOR_RINSEBACK_FAULT : { result = QObject::tr("HD venous air bubble detector rinseback fault." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_FLOW_SLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD blood flow sensor not being read - slow packet." ); break; } + case GuiAlarmID::ALARM_ID_HD_DP_FLOW_SLOW_READ_TIMEOUT_ERROR : { result = QObject::tr("HD dialysate flow sensor not being read - slow packet." ); break; } + case GuiAlarmID::ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR : { result = QObject::tr("HD pump direction status error." ); break; } case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } default: Index: sources/model/settings/MWifiNetwork.h =================================================================== diff -u --- sources/model/settings/MWifiNetwork.h (revision 0) +++ sources/model/settings/MWifiNetwork.h (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,207 @@ +#pragma once + +// Qt +#include + +// Project + +// forward declarations +class tst_models; + +namespace Model { + + +/*! + * \brief The Network class + * Provides abstraction for a WiFi network + * \details Holds information about the WiFi network such as ssid, security, and connection status + * + */ +class MWifiNetwork { + +public: + enum SECURITY_TYPE { + UNSUPPORTED, + WEP, + WPA_TKIP, + WPA_TKIP_AES, + WPA_AES, + WPA2_AES + }; + + enum SIGNAL_LEVEL + { + NO_SIGNAL, + LVL_1, + LVL_2, + LVL_3, + LVL_4, + LVL_5 + }; + + enum STATUS { + NOT_CONNECTED, + CONNECTING, + CONNECTED, + DISCONNECTING + }; + + struct IPSettings { + QString mIPAddress; + QString mGateway; + QString mSubnetMask; + QString mBroadcast; + QString mDNS; + }; + + static SIGNAL_LEVEL convertSignalLevel(int vLevel) { + if (vLevel == 0) + return NO_SIGNAL; + else if (vLevel >= -50) + return LVL_5; + else if (vLevel >= -60) + return LVL_4; + else if (vLevel >= -70) + return LVL_3; + else if (vLevel >= -80) + return LVL_2; + else if (vLevel >= -90) + return LVL_1; + + return NO_SIGNAL; + } + + static QStringList securityTypesToStringList(QList vSecurityTypes) + { + QStringList result; + for (const SECURITY_TYPE &type : vSecurityTypes) + { + switch (type) { + case WEP: + { + result.append("WEP"); + break; + } + case WPA_TKIP: + { + result.append("WPA_TKIP"); + break; + } + case WPA_TKIP_AES: + { + result.append("WPA_TKIP_AES"); + break; + } + case WPA_AES: + { + result.append("WPA_AES"); + break; + } + case WPA2_AES: + { + result.append("WPA2_AES"); + break; + } + case UNSUPPORTED: + { + result.append("UNSUPPORTED"); + break; + } + default: + { + result.append("UNKNOWN"); + break; + } + } + } + return result; + } + + struct Data + { + + public: + + IPSettings mIPSettings; + + bool operator==(const Data &d1) { + if (ssid() == d1.ssid()) + return true; + return false; + } + + QString ssid() const { + return _ssid; + } + + void ssid(const QString &vSSID) { + _ssid = vSSID; + } + + QList securityTypes() const { + return _securityTypes; + } + + void securityTypes(const QList &vSecurityTypes) { + _securityTypes = vSecurityTypes; + } + + SIGNAL_LEVEL signalLevel() const { + return _signalLevel; + } + + void signalLevel(const SIGNAL_LEVEL &vLevel) { + _signalLevel = vLevel; + } + + STATUS status() const { + return _status; + } + + void status(const STATUS &vStatus) { + _status = vStatus; + } + + QString macAddress() const { + return _macAddress; + } + + void macAddress(const QString &vMacAddress) { + _macAddress = vMacAddress; + } + + explicit Data() {} + explicit Data(const QString &vMacAddress) { _macAddress = vMacAddress; } + explicit Data(const QString &vMacAddress, const QString &vSSID, const QList &vSecurityTypes, const STATUS &vStatus, const int &vSignalLevel) { + _macAddress = vMacAddress; + _ssid = vSSID; + _securityTypes = vSecurityTypes; + _status = vStatus; + _signalLevel = convertSignalLevel(vSignalLevel); + } + + void clearSettings() { + mIPSettings.mIPAddress = ""; + mIPSettings.mDNS = ""; + mIPSettings.mGateway = ""; + mIPSettings.mSubnetMask = ""; + + _macAddress = ""; + _ssid = ""; + _securityTypes.clear(); + _status = NOT_CONNECTED; + _signalLevel = NO_SIGNAL; + } + + private: + QString _macAddress; + QString _ssid; + QList _securityTypes; + SIGNAL_LEVEL _signalLevel = NO_SIGNAL; + STATUS _status = NOT_CONNECTED; + }; + +}; + +} +typedef Model::MWifiNetwork::Data WifiNetworkData; Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -ra64c31ec79b3af203691f70397cc31f5727f47f4 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision a64c31ec79b3af203691f70397cc31f5727f47f4) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -57,17 +57,52 @@ // Scripts #ifdef BUILD_FOR_TARGET - const char *Scripts_Path_Name = "/home/root/scripts/"; + const char *Scripts_Path_Name = "/home/root/scripts/"; #else // should be in the project application folder. [is tracking by git] - const char *Scripts_Path_Name = "/home/denali/Projects/application/scripts/"; + const char *Scripts_Path_Name = "/home/denali/Projects/application/scripts/"; #endif - // Date and Time - const char *Date_Time_Set_Sh = "date_time_set.sh"; - // Treatment // Please notice that is the folder not the path // and it needs to be concatenated after SDCard_Base_Path_Name for each build configuration - const char *Treatment_Log_Folder = "treatment/"; + const char *Treatment_Log_Folder = "treatment/"; + + + // FIXME : Not sure having global settings object is a good idea. +#ifdef BUILD_FOR_DESKTOP + QSettings WifiSettings("/home/denali/wifi.ini"); +#elif BUILD_FOR_TARGET + QSettings WifiSettings("/home/root/wifi.ini", QSettings::IniFormat); +#endif + + // TODO : These need to be removed from here because they are only used in their specific classes. + // Date and Time + const char *Date_Time_Set_Sh = "date_time_set.sh"; + + // WiFi Settings + const char *Wifi_Disconnect_Network = "wifi_disconnect_network.sh"; + const char *Wifi_Generate_WPA_Supplicant = "wifi_generate_wpa_supplicant.sh"; + const char *Wifi_Read_DNS = "wifi_read_dns.sh"; + const char *Wifi_Read_Gateway = "wifi_read_gateway.sh"; + const char *Wifi_Read_IP_Settings = "wifi_read_ip_settings.sh"; + const char *Wifi_Get_Auto_Assigned_IP = "wifi_request_auto_assigned_ip.sh"; + const char *Wifi_Reset_Adapter = "wifi_reset_adapter.sh"; + const char *Wifi_Reset_Interface = "wifi_reset_interface.sh"; + const char *Wifi_Scan_For_Networks = "wifi_scan_for_networks.sh"; + const char *Wifi_Set_Auto_Assigned_IP = "wifi_set_auto_assigned_ip.sh"; + const char *Wifi_Set_DNS = "wifi_set_dns.sh"; + const char *Wifi_Set_Static_IP = "wifi_set_static_ip.sh"; + const char *Wifi_Set_Gateway = "wifi_set_gateway.sh"; + const char *Wifi_Set_SubnetMask = "wifi_set_subnetmask.sh"; + const char *Wifi_Start_WPA_Supplicant = "wifi_start_wpa_supplicant.sh"; + const char *WifiSettings_SSID = "wifi/ssid"; + const char *WifiSettings_MacAddress = "wifi/macAddress"; + const char *WifiSettings_ConfPath = "wifi/confPath"; + const char *WifiSettings_Security_Types = "wifi/security"; + const char *WifiSettings_IPAddress = "wifi/ipAddress"; + const char *WifiSettings_Gateway = "wifi/gateway"; + const char *WifiSettings_SubnetMask = "wifi/subnetmask"; + const char *WifiSettings_DNS = "wifi/dns"; + const char *WifiSettings_UseDHCP = "wifi/useDHCP"; } Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -14,6 +14,9 @@ */ #pragma once +// Qt +#include + /*! * Contains the shared constants between storage classes. */ @@ -33,9 +36,40 @@ // Scripts extern const char *Scripts_Path_Name; + // Treatment + extern const char *Treatment_Log_Folder; + // Date and Time extern const char *Date_Time_Set_Sh; - // Treatment - extern const char *Treatment_Log_Folder; + // WiFi + extern const char *Wifi_Scripts_Dir; + extern const char *Wifi_Disconnect_Network; + extern const char *Wifi_Generate_WPA_Supplicant; + extern const char *Wifi_Read_DNS; + extern const char *Wifi_Read_Gateway; + extern const char *Wifi_Read_IP_Settings; + extern const char *Wifi_Get_Auto_Assigned_IP; + extern const char *Wifi_Reset_Adapter; + extern const char *Wifi_Reset_Interface; + extern const char *Wifi_Scan_For_Networks; + extern const char *Wifi_Set_Auto_Assigned_IP; + extern const char *Wifi_Set_DNS; + extern const char *Wifi_Set_Static_IP; + extern const char *Wifi_Set_Gateway; + extern const char *Wifi_Set_SubnetMask; + extern const char *Wifi_Start_WPA_Supplicant; + + // WiFi - Settings + extern QSettings WifiSettings; + extern const char *WifiSettings_SSID; + extern const char *WifiSettings_MacAddress; + extern const char *WifiSettings_ConfPath; + extern const char *WifiSettings_Security_Types; + extern const char *WifiSettings_IPAddress; + extern const char *WifiSettings_Gateway; + extern const char *WifiSettings_SubnetMask; + extern const char *WifiSettings_DNS; + extern const char *WifiSettings_UseDHCP; + } Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -27,6 +27,11 @@ #define ADDTOLOG(vINDEX) index = vINDEX; logContent += _titles[index] + sep + _values[index] + sep + _units[index] + "\n"; +/*! + * \brief TreatmentLog::TreatmentLog + * The constructor to initial the Treatment Log + * \param parent + */ TreatmentLog::TreatmentLog(QObject *parent) : QObject(parent) { initConnections(); _treatmentLogPath = QString("%1%2") @@ -45,6 +50,11 @@ this , SLOT(onSave ())); } +/*! + * \brief TreatmentLog::initModel + * Initializing the model for the constant values. + * \param vData - the response model data. + */ void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData) { // Formatted values @@ -56,11 +66,12 @@ QString mTreatmentDuration = QTime (0, 0).addSecs(vData.mTreatmentDuration ).toString("HH:mm"); QString mActualTreatmentDuration = QTime (0, 0).addSecs(vData.mActualTreatmentDuration ).toString("HH:mm"); - QString mTreatmentDateTime = QDateTime::fromSecsSinceEpoch ( vData.mTreatmentDateTime ).toString("yyyy/MM/dd HH:mm"); + QString mTreatmentDateTime = QDateTime::fromSecsSinceEpoch ( vData.mTreatmentDateTime ).toString("yyyy/MM/dd HH:mm"); + quint32 mHeparinConcentration = 1000; // vData.mHeparinConcentration - //// TODO: The settings needs modification not only to define the category and groups in a common header but also the settings itself needs some mods. - //// - the category shall become as part of the group - //// - the structure of the settings should become horizontal which vertical now. + // TODO : The settings needs modification not only to define the category and groups in a common header but also the settings itself needs some mods. + // - the category shall become as part of the group + // - the structure of the settings should become horizontal which vertical now. QString mAcidConcentrateType = _Settings.key("Acid Concentrate" , vData.mAcidConcentrateType ); QString mBicarbonateConcentrateType = _Settings.key("Bicarbonate Concentrate" , vData.mBicarbonateConcentrateType ); QString mDialyzerType = _Settings.key("Dialyzer Type" , vData.mDialyzerType ); @@ -88,7 +99,7 @@ _values[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,0,'f',3); _values[eDialyzerType ] = mDialyzerType ; _values[eHeparinType ] = mHeparinType ; - _values[eHeparinConcentration ] = mStrText.arg(vData.mHeparinConcentration ); + _values[eHeparinConcentration ] = mStrText.arg(mHeparinConcentration ); // Decided to be removed, but has to be here until it is actually removed from the message _values[eHeparinBolusVolume ] = mStrText.arg(vData.mHeparinBolusVolume ,0,'f',3); _values[eHeparinDispenseRate ] = mStrText.arg(vData.mHeparinDispenseRate ,0,'f',3); _values[eHeparinStop ] = mStrText.arg(vData.mHeparinStop ); @@ -110,20 +121,33 @@ } // ----- Save +/*! + * \brief TreatmentLog::doSave + * The save slot to be exposed to the UI to be able to request for save + */ void TreatmentLog::doSave() { if (_saveWatcher.isRunning()) return; isIdle(false); saveLogConcurrent(); } +/*! + * \brief TreatmentLog::saveLogConcurrent + * The treatment log save which is using a thread pool to run the save process. + */ void TreatmentLog::saveLogConcurrent() { LOG_EVENT("Save Treatment Log Started"); QFuture mFuture = QtConcurrent::run(this, &TreatmentLog::saveLog); _saveWatcher.setFuture(mFuture); } +/*! + * \brief TreatmentLog::saveLog + * The actual treatment log save function which does the save into the treatment log + * \return true on successful save and false otherwise. + */ bool TreatmentLog::saveLog() { bool ok = (unsigned)_values.count() >= eTreatmentLogIndexCount; @@ -135,22 +159,39 @@ uint index = 0; logContent += tr("Patient ID") + sep + QString("None") + "\n"; - ADDTOLOG(eBloodFlowRate); - ADDTOLOG(eDialysateFlowRate); - ADDTOLOG(eTreatmentDuration); - ADDTOLOG(eAcidConcentrateType); - ADDTOLOG(eBicarbonateConcentrateType); - ADDTOLOG(ePotassiumConcentration); - ADDTOLOG(eCalciumConcentration); - ADDTOLOG(eBicarbonateConcentration); - ADDTOLOG(eSodiumConcentration); - ADDTOLOG(eDialysateTemperature); - ADDTOLOG(eDialyzerType); - ADDTOLOG(eHeparinType); - ADDTOLOG(eHeparinConcentration); - ADDTOLOG(eHeparinBolusVolume); - ADDTOLOG(eHeparinDispenseRate); - ADDTOLOG(eHeparinStop); + ADDTOLOG( eDeviceID ); + ADDTOLOG( eBloodFlowRate ); + ADDTOLOG( eDialysateFlowRate ); + ADDTOLOG( eTreatmentDuration ); + ADDTOLOG( eActualTreatmentDuration ); + ADDTOLOG( eAcidConcentrateType ); + ADDTOLOG( eBicarbonateConcentrateType ); + ADDTOLOG( ePotassiumConcentration ); + ADDTOLOG( eCalciumConcentration ); + ADDTOLOG( eBicarbonateConcentration ); + ADDTOLOG( eSodiumConcentration ); + ADDTOLOG( eDialysateTemperature ); + ADDTOLOG( eDialyzerType ); + ADDTOLOG( eHeparinType ); + ADDTOLOG( eHeparinConcentration ); + ADDTOLOG( eHeparinBolusVolume ); + ADDTOLOG( eHeparinDispenseRate ); + ADDTOLOG( eHeparinStop ); + ADDTOLOG( eHeparinDeliveredVolume ); + ADDTOLOG( eTreatmentDateTime ); + ADDTOLOG( eWaterSampleTestResult ); + ADDTOLOG( eDialysateVolumeUsed ); + ADDTOLOG( eTargetUFVolume ); + ADDTOLOG( eActualUFVolume ); + ADDTOLOG( eTargetUFRate ); + ADDTOLOG( eActualUFRate ); + ADDTOLOG( eSalineBolusVolume ); + ADDTOLOG( eAverageBloodFlow ); + ADDTOLOG( eAverageDialysateFlow ); + ADDTOLOG( eAverageDialysateTemp ); + ADDTOLOG( eAverageArterialPressure ); + ADDTOLOG( eAverageVenousPressure ); + ADDTOLOG( eEndTreatmentEarlyAlarm ); QString mDateTime = _values[eTreatmentDateTime]; mDateTime.replace("/", "" ); // remove date separator @@ -167,27 +208,44 @@ return ok; } +/*! + * \brief TreatmentLog::onSave + * The private save slot which is called after the save process is finished saving. + */ void TreatmentLog::onSave() { LOG_EVENT(QString("Save Treatment Log Ended: %1").arg(_saveWatcher.result())); isIdle(true); } // ----- Export +/*! + * \brief TreatmentLog::doExport + * The export treatment log slot to be exposed to the UI to be able to request for the export. + */ void TreatmentLog::doExport() { if (_exportWatcher.isRunning()) return; isIdle(false); exportLogConcurrent(); } +/*! + * \brief TreatmentLog::exportLogConcurrent + * The treatment log export which is using a thread pool to run the save process. + */ void TreatmentLog::exportLogConcurrent() { LOG_EVENT("Export Treatment Log Started"); QFuture mFuture = QtConcurrent::run(this, &TreatmentLog::exportLog); _exportWatcher.setFuture(mFuture); } +/*! + * \brief TreatmentLog::exportLog + * The actual treatment log export function which does the export of the treatment log into the USB drive. + * \return + */ bool TreatmentLog::exportLog() { bool ok; @@ -197,6 +255,10 @@ return ok; } +/*! + * \brief TreatmentLog::onExport + * The private export slot which is called after the export process is finished exporting. + */ void TreatmentLog::onExport() { LOG_EVENT(QString("Export Treatment Log Ended: %1").arg(_exportWatcher.result())); Index: sources/storage/TreatmentLog.h =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -37,6 +37,7 @@ QFutureWatcher _saveWatcher; QFutureWatcher _exportWatcher; + // TODO : A Unit class needs to be created to have all the unit string and all the required conversions. QString _unitTextFlowRate = tr("mL/min" ); QString _unitTextDuration = tr("min" ); QString _unitTextConcentration = tr("mEg/L" ); Index: sources/view/VView.h =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/view/VView.h (.../VView.h) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/view/VView.h (.../VView.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -105,6 +105,7 @@ REGISTER_TYPE( VSettings ) \ REGISTER_TYPE( VAdjustmentVersions ) \ REGISTER_TYPE( VDateTime ) \ + REGISTER_TYPE( VNetworkModel ) \ \ REGISTER_TYPE( VAlarmStatus ) \ REGISTER_TYPE( VPowerOff ) \ Index: sources/view/dg/data/VDGHeatersData.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/view/dg/data/VDGHeatersData.cpp (.../VDGHeatersData.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/view/dg/data/VDGHeatersData.cpp (.../VDGHeatersData.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -8,7 +8,7 @@ * \file VDGHeatersData.cpp * \author (last) Behrouz NematiPour * \date (last) 16-Oct-2020 - * \author (original) Behrouz NemaiPour + * \author (original) Behrouz NematiPour * \date (original) 02-Jul-2020 * */ Index: sources/view/dg/data/VDGHeatersData.h =================================================================== diff -u -rf688ed9f1c64a2603a6d10fbb090b257a43e1f6f -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/view/dg/data/VDGHeatersData.h (.../VDGHeatersData.h) (revision f688ed9f1c64a2603a6d10fbb090b257a43e1f6f) +++ sources/view/dg/data/VDGHeatersData.h (.../VDGHeatersData.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -8,7 +8,7 @@ * \file VDGHeatersData.h * \author (last) Behrouz NematiPour * \date (last) 16-Oct-2020 - * \author (original) Behrouz NemaiPour + * \author (original) Behrouz NematiPour * \date (original) 02-Jul-2020 * */ @@ -36,9 +36,9 @@ { Q_OBJECT - PROPERTY( quint32, mainPrimaryDC , 0) - PROPERTY( quint32, smallPrimaryDC , 0) - PROPERTY( quint32, trimmerDC , 0) + PROPERTY( float , mainPrimaryDC , 0) + PROPERTY( float , smallPrimaryDC , 0) + PROPERTY( float , trimmerDC , 0) VIEW_DEC(VDGHeaters, DGHeatersData) }; Index: sources/view/hd/data/treatment/VHDTreatmentStatesData.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/view/hd/data/treatment/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/data/treatment/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -76,7 +76,7 @@ // Treatment states - Dialysis txDialysis ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_DIALYSIS_STATE ); - // NOTE: For Rinseback and Recirculate + // NOTE : For Rinseback and Recirculate // 1 - it seems we may never need the txRinseback // since in the Rinseback state parameter of the Treatment State the first state of each has the same meaning // it may only be used to know when those parameters have valid values to update the properties. Index: sources/view/settings/VNetworkModel.cpp =================================================================== diff -u --- sources/view/settings/VNetworkModel.cpp (revision 0) +++ sources/view/settings/VNetworkModel.cpp (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,400 @@ + +// Qt +#include + +// Project +#include "VNetworkModel.h" +#include "WifiInterface.h" +#include "Logger.h" + +using namespace View; + +VNetworkModel::VNetworkModel(QAbstractListModel *parent) : QAbstractListModel(parent) { + initConnections(); +} + +/*! + * \brief VNetworkModel::initConnections + * Makes the necessary connections. Called inside VIEW_DEF_CLASS + */ +void VNetworkModel::initConnections() +{ + // incoming + connect(&_WifiInterface, SIGNAL(didAddNetwork (const WifiNetworkData &)), + this, SLOT( onAddNetwork (const WifiNetworkData &))); + + connect(&_WifiInterface, SIGNAL(didScanStatusChanged(bool)), + this, SLOT( onScanStatusChanged(bool))); + + connect(&_WifiInterface, SIGNAL( didConnectToNetwork(const WifiNetworkData &)), + this, SLOT( onConnectToNetwork(const WifiNetworkData &))); + + connect(&_WifiInterface, SIGNAL(didDisconnectNetwork(const WifiNetworkData &)), + this, SLOT( onDisconnectNetwork(const WifiNetworkData &))); + + connect(&_WifiInterface, SIGNAL( didError (const QString &)), + this, SLOT(onStatusChanged (const QString &))); + + connect(&_WifiInterface, SIGNAL(didStatusChanged (const QString &)), + this, SLOT( onStatusChanged (const QString &))); + + // incoming - static IP address assignment + connect(&_WifiInterface, SIGNAL(didSetStaticIPAddress ()), + this, SLOT( onSetStaticIPAddressSuccess())); + + connect(&_WifiInterface, SIGNAL(didSetGateway ()), + this, SLOT( onSetGatewaySuccess())); + + connect(&_WifiInterface, SIGNAL(didSetSubnetMask ()), + this, SLOT( onSetSubnetMaskSuccess())); + + connect(&_WifiInterface, SIGNAL(didSetDNS ()), + this, SLOT( onSetDNSSuccess())); + + // outgoing + connect(this, SIGNAL(didScan()), + &_WifiInterface, SLOT( doScan())); + + connect(this, SIGNAL(didJoinNetwork (const WifiNetworkData &, const QString &)), + &_WifiInterface, SLOT( doJoinNetwork (const WifiNetworkData &, const QString &))); + + connect(this, SIGNAL(didDisconnectNetwork(const WifiNetworkData &)), + &_WifiInterface, SLOT( doDisconnectNetwork(const WifiNetworkData &))); + + connect(this, SIGNAL(didRequestIPSettings()), + &_WifiInterface, SLOT( doRequestIPSettings())); + + // outgoing - static IP address assignment + connect(this, SIGNAL(didRequestSetIPAddress (const QString &)), + &_WifiInterface, SLOT( doRequestSetIPAddress (const QString &))); + + connect(this, SIGNAL(didRequestSetGateway (const QString &)), + &_WifiInterface, SLOT( doRequestSetGateway (const QString &))); + + connect(this, SIGNAL(didRequestSetSubnetMask (const QString &)), + &_WifiInterface, SLOT( doRequestSetSubnetMask (const QString &))); + + connect(this, SIGNAL(didRequestSetDNS (const QString &)), + &_WifiInterface, SLOT( doRequestSetDNS (const QString &))); + + +} + +/*! + * \brief VNetworkModel::addNetwork + * Adds a network to the network model + * \param network (Network) - the network to add to the model + */ +void VNetworkModel::addNetwork(const WifiNetworkData &vNetwork) +{ + LOG_DEBUG(QString("Adding network with SSID: %1").arg(vNetwork.ssid())); + beginInsertRows(QModelIndex(), rowCount(), rowCount()); + _networks << vNetwork; + endInsertRows(); + // For testing w/out a display: in main.qml call doScan() using Component.onCompleted, + // then call doJoinNetwork here when the desired network's mac address has been detected +} + +/*! + * \brief VNetworkModel::removeRows + * Removes all rows from the model + */ +void VNetworkModel::removeAllRows() +{ + beginRemoveRows(QModelIndex(), 0, rowCount()); + _networks.clear(); + endRemoveRows(); +} + +/*! + * \brief VNetworkModel::doInit + * \details Initializes the view or what needs to be done when for example getting into the WiFi setting screen (do scan for now). + */ +void VNetworkModel::doInit() +{ + doScan(); +} + +/*! + * \brief VNetworkModel::rowCount + * Gets the number of networks + * \param parent - (QModelIndex) the parent QModelIndex + * \return (int) - the number of networks + */ +int VNetworkModel::rowCount(const QModelIndex & parent) const +{ + Q_UNUSED(parent); + return _networks.count(); +} + +/*! + * \brief VNetworkModel::data + * Returns the network properties at the specified index + * \param index (QModelIndex) contains the row of data to lookup + * \param role - (int) the property index to return. See NetworkDataRole + * \return (QVariant) - the value for the specified network property + */ +QVariant VNetworkModel::data(const QModelIndex & index, int role) const +{ + if (index.row() < 0 || index.row() >= _networks.count()) + return QVariant(); + + const WifiNetworkData &network = _networks[index.row()]; + + switch (role) + { + case MacAddressRole: + return network.macAddress(); + case SSIDRole: + return network.ssid(); + case SecurityTypesRole: + return MWifiNetwork::securityTypesToStringList(network.securityTypes()).join("/"); + case StatusRole: + return network.status(); + case SignalLevelRole: + return network.signalLevel(); + } + + return QVariant(); +} + +/*! + * \brief VNetworkModel::roleNames + * Translates how to access specific properties of the data for QML from the NetworkDataRole enum + * \return (QHash) - maps enums to property names + */ +QHash VNetworkModel::roleNames() const { + QHash roles; + roles[MacAddressRole] = "macAddress"; + roles[SSIDRole] = "ssid"; + roles[SecurityTypesRole] = "securityTypes"; + roles[StatusRole] = "status"; + roles[SignalLevelRole] = "signalLevel"; + return roles; +} + +/*! + * \brief VNetworkModel::doScan + * Handles when a user clicks the Scan button + */ +void VNetworkModel::doScan() { + LOG_DEBUG("Clearing networks before re-scanning."); + removeAllRows(); + status(tr("Scanning...")); + emit didScan(); +} + +/*! + * \brief VNetworkModel::onAddNetwork + * Slot that receives a request to add a new network + * \param vNetwork - (Network) the new network to add + */ +void VNetworkModel::onAddNetwork(const WifiNetworkData &vNetwork) +{ + if (!_networks.contains(vNetwork)) + { + LOG_DEBUG(QString("Adding network with SSID: %1.").arg(vNetwork.ssid())); + addNetwork(vNetwork); + } + else + { + LOG_DEBUG(QString("Skipping adding network with SSID: %1. It already exists").arg(vNetwork.ssid())); + } +} + +/*! + * \brief VNetworkModel::onScanStatusChanged + * Called when the scan status changes. Updates QML with the current state + * \param vScanning - (bool) true if scanning, false otherwise + */ +void VNetworkModel::onScanStatusChanged(const bool &vScanning) +{ + if (!vScanning) + status(tr("Scan Finished")); + + scanInProgress(vScanning); +} + +/*! + * \brief VNetworkModel::doCheckIfConnected + * Checks whether the network specified by the mac address is connected or not + * \param vMacAddress - (QString) the unique mac address for the network + */ +bool VNetworkModel::doCheckIfConnected(const QString &vMacAddress) +{ + if (vMacAddress == macAddress()) + return true; + return false; +} + +/*! + * \brief VNetworkModel::doJoinNetwork + * Handles request from qml to join a network + * \param vMacAddress - (QString) the mac address of the network to join + * \param vPassword - (QString) the password for the network provided by the user + */ +void VNetworkModel::doJoinNetwork(const QString &vMacAddress, const QString &vPassword) +{ + clearSelectedNetwork(); + for (const WifiNetworkData &network : _networks) + { + if (network.macAddress() == vMacAddress) + { + status(tr("Connecting to %1...").arg(network.ssid())); + emit didJoinNetwork(network, vPassword); + return; + } + } +} + +/*! + * \brief VNetworkModel::doDisconnectNetwork + * Handles request from qml to disconnect from a network + * \param vMacAddress - (QString) the mac address of the network to disconnect from + */ +void VNetworkModel::doDisconnectNetwork(const QString &vMacAddress) +{ + for (const WifiNetworkData &network : _networks) + { + if (network.macAddress() == vMacAddress) + { + status(tr("Disconnecting from %1...").arg(network.ssid())); + emit didDisconnectNetwork(network); + return; + } + } +} + +/*! + * \brief VNetworkModel::onConnectedToNetwork + * Called when we have connected to a network. + * \param vNetwork - (Network) the network we have connected to + */ +void VNetworkModel::onConnectToNetwork(const WifiNetworkData &vNetwork) +{ + LOG_DEBUG(QString("Connected to %1.").arg(vNetwork.ssid())); + ipAddress(vNetwork.mIPSettings.mIPAddress.trimmed()); + gateway(vNetwork.mIPSettings.mGateway.trimmed()); + subnetMask(vNetwork.mIPSettings.mSubnetMask.trimmed()); + dns(vNetwork.mIPSettings.mDNS.trimmed()); + ssid(vNetwork.ssid().trimmed()); + macAddress(vNetwork.macAddress().trimmed()); + status(tr("Connected to %1.").arg(vNetwork.ssid()).trimmed()); +} + +/*! + * \brief VNetworkModel::onDisconnectedNetwork + * Called when we have disconnected from a network. + * \param vNetwork - (Network) the network we have disconnected from + */ +void VNetworkModel::onDisconnectNetwork(const WifiNetworkData &vNetwork) +{ + LOG_DEBUG(QString("Disconnected from %1.").arg(vNetwork.ssid())); + clearSelectedNetwork(); + status(tr("Disconnected from %1.").arg(vNetwork.ssid())); +} + +/*! + * \brief VNetworkModel::doRequestIPSettings + * Called when QML requests the IP settings + */ +void VNetworkModel::doRequestIPSettings() +{ + emit didRequestIPSettings(); +} + +/*! + * \brief VNetworkModel::onStatusChanged + * Called when the wifi interface status changes + * \param vMessage - (QString) the error message + */ +void VNetworkModel::onStatusChanged(const QString &vMessage) +{ + status(vMessage); +} + +/*! + * \brief VNetworkModel::doSetIPAddress + * \param vIPAddress (QString) the ip address + */ +void VNetworkModel::doSetIPAddress(const QString &vIPAddress) +{ + emit didRequestSetIPAddress(vIPAddress.trimmed()); +} + +/*! + * \brief VNetworkModel::doSetGateway + * \param vGateway (QString) the gateway + */ +void VNetworkModel::doSetGateway(const QString &vGateway) +{ + emit didRequestSetGateway(vGateway.trimmed()); +} + +/*! + * \brief VNetworkModel::doSetSubnetMask + * \param vSubnetMask (QString) the subnet mask + */ +void VNetworkModel::doSetSubnetMask(const QString &vSubnetMask) +{ + emit didRequestSetSubnetMask(vSubnetMask.trimmed()); +} + +/*! + * \brief VNetworkModel::doSetDNS + * \param vDNS (QString) the DNS + */ +void VNetworkModel::doSetDNS(const QString &vDNS) +{ + emit didRequestSetDNS(vDNS.trimmed()); +} + +/*! + * \brief VNetworkModel::clearWifiSettings + * Clears the selected network settings + */ +void VNetworkModel::clearSelectedNetwork() +{ + ipAddress(""); + gateway(""); + subnetMask(""); + dns(""); + ssid(""); + macAddress(""); +} + +/*! + * \brief VNetworkModel::onSetIPAddressSuccess + * Called when the IP address has been set + */ +void VNetworkModel::onSetStaticIPAddressSuccess() +{ + status(tr("Successfully set the IP address.")); +} + +/*! + * \brief VNetworkModel::onSetGatewaySuccess + * Called when the gateway has been set + */ +void VNetworkModel::onSetGatewaySuccess() +{ + status(tr("Successfully set the gateway.")); +} + +/*! + * \brief VNetworkModel::onSetSubnetMaskSuccess + * Called when the subnet mask has been set + */ +void VNetworkModel::onSetSubnetMaskSuccess() +{ + status(tr("Successfully set the subnet mask.")); +} + +/*! + * \brief VNetworkModel::onSetDNSSuccess + * Called when the DNS has been set + */ +void VNetworkModel::onSetDNSSuccess() +{ + status(tr("Successfully set the DNS.")); +} Index: sources/view/settings/VNetworkModel.h =================================================================== diff -u --- sources/view/settings/VNetworkModel.h (revision 0) +++ sources/view/settings/VNetworkModel.h (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,103 @@ +#pragma once + +// Qt +#include +#include + +// Project +#include "main.h" +#include "VView.h" +#include "MWifiNetwork.h" + + +// forward declarations +class tst_views; + +namespace View { + +/*! + * \brief The VNetworkModel class + * Interface between QML and the networks + * \details Exposes networks to QML and provides an interface to connect and disconnect from those networks. + * References: https://doc.qt.io/qt-5.12/qtquick-modelviewsdata-cppmodels.html + * + */ +class VNetworkModel : public QAbstractListModel +{ + Q_OBJECT + + PROPERTY(bool , isIdle , true ) + PROPERTY(bool , scanInProgress , false) + PROPERTY(QString , status , "") + PROPERTY(QString , ipAddress , "") + PROPERTY(QString , gateway , "") + PROPERTY(QString , subnetMask , "") + PROPERTY(QString , dns , "") + PROPERTY(QString , ssid , "") + PROPERTY(QString , macAddress , "") + +public: + // Note: VIEW_DEC_CLASS(VNetworkModel) requires QObject as the parent, so it's necessary to define it here + // Otherwise a VIEW_DEC_CLASS macro could allow specifying the parent class with QObject as the default + explicit VNetworkModel(QAbstractListModel *parent = nullptr); + + enum NetworkDataRole { + MacAddressRole = Qt::UserRole + 1, + SSIDRole, + SecurityTypesRole, + StatusRole, + SignalLevelRole, + }; + + void addNetwork (const WifiNetworkData &network); + int rowCount (const QModelIndex &parent = QModelIndex()) const; + QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const; + void removeAllRows(); +signals: + void didScan(); + void didJoinNetwork(const WifiNetworkData, const QString); + void didDisconnectNetwork(const WifiNetworkData); + void didRequestIPSettings(); + + // set IP addresses + void didRequestSetIPAddress(const QString); + void didRequestSetGateway(const QString); + void didRequestSetSubnetMask(const QString); + void didRequestSetDNS(const QString); + +public slots: + void doInit(); + void doScan(); + bool doCheckIfConnected(const QString &vMacAddress); + void doJoinNetwork(const QString &vMacAddress, const QString &vPassword); + void doDisconnectNetwork(const QString &vMacAddress); + void doRequestIPSettings(); + + // static IP address assignment + void doSetIPAddress(const QString &vIPAddress); + void doSetGateway(const QString &vGateway); + void doSetSubnetMask(const QString &vSubnetMask); + void doSetDNS(const QString &vDNS); + +protected: + QHash roleNames() const; +private: + void initConnections(); + void clearSelectedNetwork(); + + QList _networks; + +private slots: + void onAddNetwork(const WifiNetworkData &vNetwork); + void onScanStatusChanged(const bool &vScanning); + void onStatusChanged(const QString &vNewStatus); + void onConnectToNetwork(const WifiNetworkData &vNetwork); + void onDisconnectNetwork(const WifiNetworkData &vNetwork); + + // static IP address assignment confirmation + void onSetStaticIPAddressSuccess(); + void onSetGatewaySuccess(); + void onSetSubnetMaskSuccess(); + void onSetDNSSuccess(); +}; +} Index: sources/wifi/WifiInterface.cpp =================================================================== diff -u --- sources/wifi/WifiInterface.cpp (revision 0) +++ sources/wifi/WifiInterface.cpp (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,918 @@ +#include "WifiInterface.h" + +// Qt +#include +#include +#include +#include + +// Project +#include "main.h" +#include "Logger.h" + +using namespace Storage; + +WifiInterface::WifiInterface(QObject *parent) : QObject(parent) +{ + _processScan .setParent(this); + _processDisconnectNetwork .setParent(this); + _processReadIPSettings .setParent(this); + _processReadGateway .setParent(this); + _processReadDNS .setParent(this); + _processGenerateWPASupplicant .setParent(this); + _processStartWPASupplicant .setParent(this); + _processRequestAutoAssignedIP .setParent(this); + _processSetStaticIPAddress .setParent(this); + _processSetStaticGateway .setParent(this); + _processSetStaticSubnetMask .setParent(this); + _processSetDNS .setParent(this); +} + + +/*! + * \brief WifiInterface::hasConnectedToWifi + * Checks whether we have previously connected to a WiFi network + * \return (bool) true if we have, false otherwise + */ +bool WifiInterface::hasConnectedToWifi() +{ + if (WifiSettings.value(WifiSettings_MacAddress).toString().isEmpty()) + return false; + + if (!QFile(_wpaSupplicantConfPath).exists()) + return false; + + return true; +} + +/*! + * \brief WifiInterface::getLastWifiNetworkConnectedTo + * Gets the last network we connected to from settings + * \return (Network) the network we last connected to + */ +WifiNetworkData WifiInterface::getLastWifiNetworkConnectedTo() +{ + QString macAddress = WifiSettings.value(WifiSettings_MacAddress).toString(); + QString ssid = WifiSettings.value(WifiSettings_SSID).toString(); + QList securityTypesVar = WifiSettings.value(WifiSettings_Security_Types).toList(); + MWifiNetwork::STATUS status = MWifiNetwork::STATUS::NOT_CONNECTED; + MWifiNetwork::SIGNAL_LEVEL signalLevel = MWifiNetwork::SIGNAL_LEVEL::NO_SIGNAL; + _useDHCP = WifiSettings.value(WifiSettings_UseDHCP).toBool(); + return WifiNetworkData(macAddress, ssid, variantListToSecurityTypes(securityTypesVar), status, signalLevel); +} + +/*! + * \brief WifiInterface::rejoinLastWifiNetwork + * Attempts to rejoin the network we last connected to + */ +void WifiInterface::rejoinLastWifiNetwork() +{ + _network = getLastWifiNetworkConnectedTo(); + if (_processStartWPASupplicant.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processStartWPASupplicant.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Start_WPA_Supplicant) ) return; + _processStartWPASupplicant.start(script, + QStringList() << _iface + << _wpaSupplicantConfPath); +} + +void WifiInterface::initConnections() +{ + connect(this, SIGNAL(didStart()), + this, SLOT( onStart())); + + connect(this, SIGNAL(didStatusChanged(const QString)), + this, SLOT( onStatusChanged(const QString))); + + connect(this, SIGNAL( didError(const QString)), + this, SLOT( onStatusChanged(const QString))); + + connect(&_processScan , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedScan(int, QProcess::ExitStatus))); + + connect(&_processReadIPSettings , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedReadIP(int, QProcess::ExitStatus))); + + connect(&_processReadGateway , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedReadGateway(int, QProcess::ExitStatus))); + + connect(&_processReadDNS , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedReadDNS(int, QProcess::ExitStatus))); + + connect(&_processGenerateWPASupplicant , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedGenerateWPASupplicant(int, QProcess::ExitStatus))); + + connect(&_processStartWPASupplicant , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedStartWPASupplicant(int, QProcess::ExitStatus))); + + connect(&_processRequestAutoAssignedIP , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedRequestAutoAssignedIP(int, QProcess::ExitStatus))); + + connect(&_processDisconnectNetwork , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedDisconnectNetwork(int, QProcess::ExitStatus))); + + connect(&_processSetStaticIPAddress , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedSetIPAddress(int, QProcess::ExitStatus))); + + connect(&_processSetStaticGateway , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedSetGateway(int, QProcess::ExitStatus))); + + connect(&_processSetStaticSubnetMask , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedSetSubnetMask(int, QProcess::ExitStatus))); + + connect(&_processSetDNS , SIGNAL( finished(int, QProcess::ExitStatus)), + this , SLOT( onProcessFinishedSetDNS(int, QProcess::ExitStatus))); + + connect(this, SIGNAL(didRequestAutoAssignedIP()), + this, SLOT( onRequestAutoAssignedIP())); + +} + +/*! + * \brief WifiInterface::init + * \details Initialized the Class by calling the init() method first + * And initializes the thread vThread by calling initThread + * on success init(). + * \param vThread - the thread + * \return returns the return value of the init() method + */ +bool WifiInterface::init(QThread &vThread) +{ + if (!init()) return false; + initThread(vThread); + return true; +} + + +/*! + * \brief ApplicationController::initThread + * \details Moves this object into the thread vThread. + * And checks that this method is called from main thread. + * Also connects quitThread to application aboutToQuit. + * \param vThread - the thread + */ +void WifiInterface::initThread(QThread &vThread) +{ + // runs in main thread + Q_ASSERT_X(QThread::currentThread() == qApp->thread() , __func__, "The Class initialization must be done in Main Thread" ); + _thread = &vThread; + _thread->setObjectName(QString("%1_Thread").arg(metaObject()->className())); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit())); + _thread->start(); + moveToThread(_thread); +} + +/*! + * \brief MessageAcknowModel::quit + * \details quits the class + * Calls quitThread + */ +void WifiInterface::quit() +{ + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + quitThread(); +} +// coco end + +/*! + * \brief MessageAcknowModel::quitThread + * \details Moves this object to main thread to be handled by QApplicaiton + * And to be destroyed there. + */ +void WifiInterface::quitThread() +{ + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + + if (!_thread) return; + + // runs in thread + moveToThread(qApp->thread()); +} +// coco end + + +/*! + * \brief WifiInterface::init + * \details Initializes the class by setting the connections + * \return true on first initialization, false if it has already been initialized + */ +bool WifiInterface::init() +{ + if (_init) return false; + _init = true; + + initConnections(); + LOG_EVENT("UI," + tr("%1 Initialized").arg(metaObject()->className())); + return true; +} + +/*! + * \brief WifiInterface::start + * Starts the WifiInterface + */ +void WifiInterface::start() +{ + emit didStart({}); +} + +/*! + * \brief WifiInterface::onStart + * Called when the WifiInterface has started + */ +void WifiInterface::onStart() +{ + if (hasConnectedToWifi()) + rejoinLastWifiNetwork(); +} + +/*! + * \brief WifiInterface::doScan + * Scans for WiFi Access Points + */ +void WifiInterface::doScan() +{ + if (_scanRunning) { + LOG_DEBUG("WiFi network scan is already running."); + return; + } + if (_processScan.state() != QProcess::NotRunning) { + LOG_DEBUG("The Running WiFi Scan Ignored."); + return; + } + QString script; if ( ! checkScript(script, Wifi_Scan_For_Networks) ) return; + _scanRunning = true; + emit didScanStatusChanged(_scanRunning); + _processScan.start(script, QStringList() << _iface); + LOG_DEBUG("WiFi Scan Started"); +} + +/*! + * \brief WifiInterface::onScanFinished + * Called when the scan process has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedScan(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitCode) + Q_UNUSED(vExitStatus) + QString out = _processScan.readAllStandardOutput(); + QString err = _processScan.readAllStandardError(); + LOG_DEBUG(QString("stdout: %1").arg(out)); + LOG_DEBUG(QString("stderr: %1").arg(err)); + _scanRunning = false; + emit didScanStatusChanged(_scanRunning); + parseWifiScan(out); + LOG_DEBUG("WiFi Scan Finished"); +} + +/*! + * \brief getTextBetweenDelimiters + * Gets the text between two delimiters + * \param vText - (QString) the text to search + * \param vLeftDelim - (QString) the left delimiter + * \param vRightDelim - (QString) the right delimiter + * \return (QString) the text between the delimiters if found, "" otherwise + */ +QString WifiInterface::getTextBetweenDelimiters(const QString &vText, const QString &vLeftDelim, const QString &vRightDelim) +{ + QString result = ""; + QString rightHalf = ""; + QStringList tokenList = vText.split(vLeftDelim); + if (tokenList.length() > 1) + rightHalf = tokenList[1]; + + tokenList = rightHalf.split(vRightDelim); + if (tokenList.length() > 1) + result = tokenList[0]; + return result; +} + +/*! + * \brief Network::parseWifiScan + * Extract desired information from the WiFi scan output. Sorts by signal stength + * + * \param vOutput - (QString) output collected from QProcess execution + */ +QList WifiInterface::parseWifiScan(const QString &vOutput) +{ + QList networks; + QString outputNoReturns = vOutput; + outputNoReturns = outputNoReturns.replace("\r", ""); + QStringList temp = outputNoReturns.split("Cell"); + const QString searchTermSignalLevel = "Signal level="; + const QString searchTermMacAddress = "Address:"; + const QString searchTermSSID = "ESSID:"; + + for (const QString &cell : temp) + { + if (cell.contains(searchTermSSID) && cell.contains(searchTermMacAddress) && cell.contains(searchTermSignalLevel)) + { + QString ssid = getTextBetweenDelimiters(cell, searchTermSSID, "\n").replace("\"", "").trimmed(); + if (ssid == "") + continue; + QString macAddress = getTextBetweenDelimiters(cell, searchTermMacAddress, "\n").trimmed(); + int signalLevel = getTextBetweenDelimiters(cell, searchTermSignalLevel, "dBm").trimmed().toInt(); + QList securityTypes; + bool requiresKey = QRegularExpression("Encryption key:on").match(cell).hasMatch(); + + QStringList infoElement = cell.split("IE: "); + if (infoElement.length() > 1) + { + QString element = infoElement[1]; + bool isWPA2 = QRegularExpression(".*WPA2 ").match(element).hasMatch(); + bool isWPA = QRegularExpression(".*WPA ").match(element).hasMatch(); + bool supportsAES = QRegularExpression("Pairwise Ciphers.*CCMP").match(element).hasMatch(); + bool requiresPSK = QRegularExpression("Authentication Suites.*PSK").match(element).hasMatch(); + bool supportsTKIP = QRegularExpression("Pairwise Ciphers.*TKIP").match(element).hasMatch(); + + MWifiNetwork::SECURITY_TYPE securityType = MWifiNetwork::SECURITY_TYPE::UNSUPPORTED; + + if (isWPA2 && requiresPSK && supportsAES && !supportsTKIP) + securityType = MWifiNetwork::SECURITY_TYPE::WPA2_AES; + else if (isWPA && requiresPSK && supportsAES && supportsTKIP) + securityType = MWifiNetwork::SECURITY_TYPE::WPA_TKIP_AES; + else if (isWPA && requiresPSK && supportsTKIP) + securityType = MWifiNetwork::SECURITY_TYPE::WPA_TKIP; + else if (isWPA && requiresPSK && supportsAES) + securityType = MWifiNetwork::SECURITY_TYPE::WPA_AES; + else if (!isWPA && !isWPA2 && !requiresPSK && !supportsAES && !supportsTKIP && requiresKey) + securityType = MWifiNetwork::SECURITY_TYPE::WEP; + + if (securityType != MWifiNetwork::SECURITY_TYPE::UNSUPPORTED) + securityTypes.append(securityType); + } + + WifiNetworkData network(macAddress, ssid, securityTypes, MWifiNetwork::STATUS::NOT_CONNECTED, signalLevel); + networks.append(network); + emit didAddNetwork(network); + } + } + LOG_DEBUG(QString("WifiInterface::%1 Finished").arg(__FUNCTION__)); + return networks; +} + +/*! + * \brief WifiInterface::onStatusChanged + * Ensures any status changes are logged + * \param vMessage (QString) the message detail + */ +void WifiInterface::onStatusChanged(const QString &vMessage) +{ + LOG_DEBUG(vMessage); +} + +/*! + * \brief WifiInterface::doJoinNetwork + * Handles request to join a network + * \param vMacAddress - (QString) the mac address of the network to join + * \param vPassword - (QString) the password for the network provided by the user + */ +void WifiInterface::doJoinNetwork(const WifiNetworkData &vNetwork, const QString &vPassword) +{ + _network = vNetwork; + _useDHCP = true; + WifiSettings.setValue(WifiSettings_UseDHCP, _useDHCP); + LOG_DEBUG(QString("Joining Network %1").arg(vNetwork.ssid())); + if (_processGenerateWPASupplicant.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processGenerateWPASupplicant.objectName())); + return; + } + QString securityType; + if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA2_AES)) + securityType = "wpa2"; + else if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_TKIP_AES) + || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_AES) + || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_TKIP)) + securityType = "wpa"; + else if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WEP)) + securityType = "wep"; + else + { + LOG_DEBUG(QString("Network %1 has an unsupported security type.").arg(vNetwork.ssid())); + emit didError(QString("Network %1 has an unsupported security type.").arg(vNetwork.ssid())); + } + + QString script; if ( ! checkScript(script, Wifi_Generate_WPA_Supplicant) ) return; + WifiSettings.setValue(WifiSettings_SSID, vNetwork.ssid()); + WifiSettings.setValue(WifiSettings_MacAddress, vNetwork.macAddress()); + WifiSettings.setValue(WifiSettings_ConfPath, _wpaSupplicantConfPath); + WifiSettings.setValue(WifiSettings_Security_Types, securityTypesToStringList(vNetwork.securityTypes())); + _processGenerateWPASupplicant.start(script, + QStringList() << vNetwork.ssid() + << vPassword + << _wpaSupplicantConfPath + << securityType); +} + +/*! + * \brief WifiInterface::onProcessFinishedGenerateWPASupplicant + * Called when the process that generates the WPA supplicant file has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedGenerateWPASupplicant(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError("Could not configure network."); + return; + } + + if (_processStartWPASupplicant.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processStartWPASupplicant.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Start_WPA_Supplicant) ) return; + _processStartWPASupplicant.start(script, + QStringList() << _iface + << _wpaSupplicantConfPath); +} + +/*! + * \brief WifiInterface::onProcessFinishedStartWPASupplicant + * Called when the process that starts the WPA supplicant has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedStartWPASupplicant(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError("Could not configure network."); + return; + } + emit didRequestAutoAssignedIP(); +} + +/*! + * \brief WifiInterface::onRequestAutoAssignedIP + * Handles the request for an auto assigned IP address + */ +void WifiInterface::onRequestAutoAssignedIP() +{ + if (_processRequestAutoAssignedIP.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processRequestAutoAssignedIP.objectName())); + return; + } + emit didStatusChanged(tr("Obtaining IP Address...")); + QString script; if ( ! checkScript(script, Wifi_Get_Auto_Assigned_IP) ) return; + _processRequestAutoAssignedIP.start(script, + QStringList() << _iface); +} + +/*! + * \brief WifiInterface::onProcessFinishedRequestAutoAssignedIP + * Called when the process that requests an auto-assigned IP has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedRequestAutoAssignedIP(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + if (_dhcpAttemptsLeft > 0) + { + _dhcpAttemptsLeft--; + emit didRequestAutoAssignedIP(); + } else + { + emit didError(QString("Could not connect to %1").arg(_network.ssid())); + _dhcpAttemptsLeft = 5; + } + return; + } + _dhcpAttemptsLeft = 5; + doRequestIPSettings(); +} + +/*! + * \brief WifiInterface::doRequestIPSettings + * Handles a request to read the IP settings of the device. + */ +void WifiInterface::doRequestIPSettings() +{ + if (_processReadIPSettings.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processReadIPSettings.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Read_IP_Settings) ) return; + _processReadIPSettings.start(script, + QStringList() << _iface); +} + +/*! + * \brief WifiInterface::onProcessFinishedReadIP + * Parses the IP settings of the device when the process has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedReadIP(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitCode); + Q_UNUSED(vExitStatus); + QString output = _processReadIPSettings.readAllStandardOutput(); + _network.mIPSettings.mIPAddress = parseIP(output); + _network.mIPSettings.mBroadcast = parseBroadcast(output); + _network.mIPSettings.mSubnetMask = parseSubnetMask(output); + if (_processReadGateway.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processReadGateway.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Read_Gateway) ) return; + _processReadGateway.start(script); +} + +/*! + * \brief WifiInterface::onProcessFinishedReadGateway + * Parses the gateway of the device when the process has finished then + * initiates reading the DNS + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedReadGateway(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitCode); + Q_UNUSED(vExitStatus); + _network.mIPSettings.mGateway = parseGateway(_processReadGateway.readAllStandardOutput()); + if (_processReadDNS.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processReadDNS.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Read_DNS) ) return; + _processReadDNS.start(script); +} + +/*! + * \brief WifiInterface::onProcessFinishedReadDNS + * Parses the DNS of the device when the process has finished then + * emits the newtwork with all the ip address information filled + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedReadDNS(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitCode); + Q_UNUSED(vExitStatus); + _network.mIPSettings.mDNS = parseDNS(_processReadDNS.readAllStandardOutput()); + if (!_useDHCP) + { + // Use current static IP settings + QString ipAddress = WifiSettings.value(WifiSettings_IPAddress).toString().trimmed(); + QString gateway = WifiSettings.value(WifiSettings_Gateway).toString().trimmed(); + QString subnetMask = WifiSettings.value(WifiSettings_SubnetMask).toString().trimmed(); + QString dns = WifiSettings.value(WifiSettings_DNS).toString().trimmed(); + if (!ipAddress.isEmpty()) + doRequestSetIPAddress(_network.mIPSettings.mIPAddress); + if (!gateway.isEmpty()) + doRequestSetGateway(_network.mIPSettings.mGateway); + if (!subnetMask.isEmpty()) + doRequestSetSubnetMask(_network.mIPSettings.mSubnetMask); + if (!dns.isEmpty()) + doRequestSetDNS(_network.mIPSettings.mDNS); + } + emit didConnectToNetwork(_network); +} + +/*! + * \brief WifiInterface::doDisconnectNetwork + * Disconnects from the specified network + * \param vNetwork - (Network) the network to disconnect from + */ +void WifiInterface::doDisconnectNetwork(const WifiNetworkData &vNetwork) +{ + LOG_DEBUG(QString("Disconnecting from Network %1").arg(vNetwork.ssid())); + if (_processDisconnectNetwork.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processDisconnectNetwork.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Disconnect_Network) ) return; + _processDisconnectNetwork.start(script, + QStringList() << _iface); +} + +/*! + * \brief WifiInterface::onProcessFinishedDisconnectNetwork + * Called when we disconnect from the WiFi network + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedDisconnectNetwork(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError(tr("Failed to disconnect from %1").arg(_network.ssid())); + return; + } + emit didDisconnectNetwork(_network); + _network.clearSettings(); +} + +/*! + * \brief WifiInterface::parseIP + * Parses the IP from the IP address output + * \param vOutput - (QString) the console output + * \return (QString) the IP Address only + */ +QString WifiInterface::parseIP(const QString &vOutput) +{ + const QString leftDelim = "inet addr:"; + const QString rightDelim = "Bcast:"; + return getTextBetweenDelimiters(vOutput, leftDelim, rightDelim); +} + +/*! + * \brief WifiInterface::parseBroadcast + * Parses the Broadcast from the IP address output + * \param vOutput - (QString) the console output + * \return (QString) the Broadcast IP if found, "" otherwise + */ +QString WifiInterface::parseBroadcast(const QString &vOutput) +{ + const QString leftDelim = "Bcast:"; + const QString rightDelim = "Mask:"; + return getTextBetweenDelimiters(vOutput, leftDelim, rightDelim); +} + +/*! + * \brief WifiInterface::parseSubnetMask + * Parses the subnet mask from the provided output + * \param vOutput - (QString) the console output + * \return (QString) the subnet mask if found, "" otherwise + */ +QString WifiInterface::parseSubnetMask(const QString &vOutput) +{ + const QString leftDelim = "Mask:"; + const QString rightDelim = "\n"; + return getTextBetweenDelimiters(vOutput, leftDelim, rightDelim); +} + +/*! + * \brief WifiInterface::parseGateway + * Parses the gateway from the provided output + * \param vOutput - (QString) the console output + * \return (QString) the gateway if found, "" otherwise + */ +QString WifiInterface::parseGateway(const QString &vOutput) +{ + const QString leftDelim = "default via"; + const QString rightDelim = "dev"; + return getTextBetweenDelimiters(vOutput, leftDelim, rightDelim); +} + +/*! + * \brief WifiInterface::parseDNS + * Parses the DNS from the provided output + * \param vOutput - (QString) the console output + * \return (QString) the first DNS found, "" otherwise + */ +QString WifiInterface::parseDNS(const QString &vOutput) +{ + const QString leftDelim = "nameserver"; + const QString rightDelim = "\n"; + return getTextBetweenDelimiters(vOutput, leftDelim, rightDelim); +} + +/*! + * \brief WifiInterface::doRequestSetIPAddress + * Issues command to set a static IP address + * \param vIPAddress - (QString) the IP address + */ +void WifiInterface::doRequestSetIPAddress(const QString &vIPAddress) +{ + Q_UNUSED(vIPAddress) + LOG_DEBUG(QString("Handling request to set static IP address: %1").arg(vIPAddress)); + if (_processSetStaticIPAddress.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processSetStaticIPAddress.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Set_Static_IP) ) return; + WifiSettings.setValue(WifiSettings_IPAddress, vIPAddress); + _useDHCP = false; + WifiSettings.setValue(WifiSettings_UseDHCP, _useDHCP); + _processSetStaticIPAddress.start(script, + QStringList() << _iface << vIPAddress); +} + +/*! + * \brief WifiInterface::onProcessFinishedSetIPAddress + * Called when settings a static IP address finishes + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedSetIPAddress(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError(tr("Failed to set static IP Address")); + return; + } + emit didSetStaticIPAddress(); +} + +/*! + * \brief WifiInterface::doRequestSetGateway + * Issues command to set a static gateway + * \param vGateway - (QString) the gateway + */ +void WifiInterface::doRequestSetGateway(const QString &vGateway) +{ + Q_UNUSED(vGateway) + LOG_DEBUG(QString("Handling request to set static gateway: %1").arg(vGateway)); + + if (_processSetStaticGateway.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processSetStaticGateway.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Set_Gateway) ) return; + WifiSettings.setValue(WifiSettings_Gateway, vGateway); + _useDHCP = false; + WifiSettings.setValue(WifiSettings_UseDHCP, _useDHCP); + _processSetStaticGateway.start(script, + QStringList() << vGateway); +} + +/*! + * \brief WifiInterface::onProcessFinishedSetGateway + * Called when the the process to set the gateway has finished + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedSetGateway(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError(tr("Failed to set gateway.")); + return; + } + emit didSetGateway(); +} + +/*! + * \brief WifiInterface::doRequestSetSubnetMask + * Issues command to set the subnet mask + * \param vSubnetMask - (QString) the subnet mask + */ +void WifiInterface::doRequestSetSubnetMask(const QString &vSubnetMask) +{ + Q_UNUSED(vSubnetMask) + LOG_DEBUG(QString("Handling request to set static subnet mask: %1").arg(vSubnetMask)); + if (_processSetStaticSubnetMask.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processSetStaticSubnetMask.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Set_SubnetMask) ) return; + WifiSettings.setValue(WifiSettings_SubnetMask, vSubnetMask); + _useDHCP = false; + WifiSettings.setValue(WifiSettings_UseDHCP, _useDHCP); + _processSetStaticSubnetMask.start(script, + QStringList() << _iface << vSubnetMask); +} + +/*! + * \brief WifiInterface::onProcessFinishedSetSubnetMask + * Called when the process to set the subnet mask finishes + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedSetSubnetMask(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError(tr("Failed to set subnet mask.")); + return; + } + emit didSetSubnetMask(); +} + +/*! + * \brief WifiInterface::doRequestSetDNS + * Issues a command to set the DNS + * \param vDNS - (QString) the DNS + */ +void WifiInterface::doRequestSetDNS(const QString &vDNS) +{ + LOG_DEBUG(QString("Handling request to set DNS: %1").arg(vDNS)); + if (_processSetDNS.state() != QProcess::NotRunning) + { + LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") + .arg(__FUNCTION__) + .arg(_processSetDNS.objectName())); + return; + } + QString script; if ( ! checkScript(script, Wifi_Set_DNS ) ) return; + WifiSettings.setValue(WifiSettings_DNS, vDNS); + _processSetDNS.start(script, + QStringList() << vDNS); +} + +/*! + * \brief WifiInterface::onProcessFinishedSetDNS + * Called when the process that finishes setting the DNS completes + * \param vExitCode - (int) the exit code + * \param vExitStatus - (QProcess::ExitStatus) the exit status + */ +void WifiInterface::onProcessFinishedSetDNS(int vExitCode, QProcess::ExitStatus vExitStatus) +{ + Q_UNUSED(vExitStatus) + if (vExitCode != 0) + { + emit didError(tr("Failed to set DNS.")); + return; + } + emit didSetDNS(); +} + +/*! + * \brief WifiInterface::securityTypesToStringList + * Converts a QList of network security types to a QStringList + * \param securityTypes (QList) the list of security type + * \return (QStringList) the security types as a string list + */ +QStringList WifiInterface::securityTypesToStringList(const QList &securityTypes) +{ + QStringList securityTypesStrList; + for (const MWifiNetwork::SECURITY_TYPE &type : securityTypes) + { + securityTypesStrList.append(QString("%1").arg(type)); + } + return securityTypesStrList; +} + +/*! + * \brief variantListToSecurityTypes + * Converts a QVariantList of security types to a QList + * \param securityTypesVar (QVariantList) security types + * \return (QList) the list of network security types + */ +QList WifiInterface::variantListToSecurityTypes(const QList &securityTypesVar) +{ + QList securityTypes; + for (const QVariant &type : securityTypesVar) + { + bool ok = false; + MWifiNetwork::SECURITY_TYPE val = MWifiNetwork::SECURITY_TYPE(type.toInt(&ok)); + if (ok) + securityTypes.append(val); + } + return securityTypes; +} + +/*! + * \brief WifiInterface::checkScript + * \details Prepends the script folder path to the script name and checks if the script exists and is executable. + * \param vScript : The script name with full path which will be set in this parameter passed argument. + * \param vShellScript : The shell script name + * \return true if succeeds and false otherwise */ +bool WifiInterface::checkScript(QString &vScript, const QString &vShellScript) +{ + vScript = _scriptsFolder + vShellScript; + QFileInfo info(vScript); + if ( ! info.exists () ) { LOG_DEBUG(QString("script %1 does not exist." ).arg(vScript)); return false; } + if ( ! info.isExecutable() ) { LOG_DEBUG(QString("script %1 is not executable." ).arg(vScript)); return false; } + return true; +} Index: sources/wifi/WifiInterface.h =================================================================== diff -u --- sources/wifi/WifiInterface.h (revision 0) +++ sources/wifi/WifiInterface.h (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -0,0 +1,136 @@ +#pragma once + +// Qt +#include +#include +#include + +// Project +#include "main.h" +#include "StorageGlobals.h" +#include "MWifiNetwork.h" + +// define +#define _WifiInterface WifiInterface::I() + +using namespace Model; + +class tst_utilities; + +/*! + * \brief The WifiInterface class + * Communicates with Access Points + * \details + * - Scans for Access Points + * - Authenticates with Access Points + * - Disconnects from Access Points + */ +class WifiInterface : public QObject +{ + Q_OBJECT + + friend class ::tst_utilities; + + QThread *_thread = nullptr; + bool _init = false; + bool _scanRunning = false; + bool _useDHCP = true; + int _defaultTimeout = 5000; + int _dhcpTimeout = 10000; + int _scanTimeout = 30000; + int _processCounter = 0; + int _dhcpAttemptsLeft = 5; + QProcess _processScan; + QProcess _processDisconnectNetwork; + QProcess _processReadIPSettings; + QProcess _processReadGateway; + QProcess _processReadDNS; + QProcess _processGenerateWPASupplicant; + QProcess _processStartWPASupplicant; + QProcess _processRequestAutoAssignedIP; + QProcess _processSetStaticIPAddress; + QProcess _processSetStaticGateway; + QProcess _processSetStaticSubnetMask; + QProcess _processSetDNS; + WifiNetworkData _network; + + const QString _scriptsFolder = Storage::Scripts_Path_Name; + const QString _iface = "wlan0"; + const QString _wpaSupplicantConfPath = "/etc/wpa_supplicant.conf"; + +// Singleton +SINGLETON(WifiInterface) + +private: + bool checkScript(QString &vScript, const QString &vShellScript); + QString getTextBetweenDelimiters(const QString &vText, const QString &vLeftDelim, const QString &vRightDelim); + QList parseWifiScan(const QString &vOutput); + QString parseIP(const QString &vOutput); + QString parseBroadcast(const QString &vOutput); + QString parseSubnetMask(const QString &vOutput); + QString parseGateway(const QString &vOutput); + QString parseDNS(const QString &vOutput); + void initConnections(); + void initThread(QThread &vThread); + void quitThread(); + bool hasConnectedToWifi(); + WifiNetworkData getLastWifiNetworkConnectedTo(); + void rejoinLastWifiNetwork(); + QStringList securityTypesToStringList(const QList &securityTypes); + QList variantListToSecurityTypes(const QList &securityTypesVar); + +public: + void start(); + +public slots: + bool init(QThread &vThread); + bool init(); + + void doScan (); + void doJoinNetwork (const WifiNetworkData &vNetwork, const QString &vPassword); + void doDisconnectNetwork (const WifiNetworkData &vNetwork); + void doRequestIPSettings (); + + // static IP address assignment + void doRequestSetIPAddress (const QString &vIPAddress ); + void doRequestSetGateway (const QString &vGateway ); + void doRequestSetSubnetMask (const QString &vSubnetMask ); + void doRequestSetDNS (const QString &vDNS ); + +signals: + void didStart(QPrivateSignal); + void didAddNetwork (const WifiNetworkData & ); + void didDisconnectNetwork (const WifiNetworkData & ); + void didRejectRequest (const QString &vFunction, const QString &vReason); + void didBusyChanged ( bool vBusy); + void didStatusChanged (const QString &vNewStatus ); + void didRequestAutoAssignedIP (); + // static IP address settings + void didSetStaticIPAddress (); + void didSetGateway (); + void didSetSubnetMask (); + void didSetDNS (); + + // emitted from separate threads + void didScanStatusChanged ( bool ); + void didConnectToNetwork (const WifiNetworkData &); + void didError (const QString &); + +private slots: + void quit(); + void onStart(); + void onStatusChanged(const QString &vMessage); + void onRequestAutoAssignedIP(); + void onProcessFinishedScan (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedReadIP (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedReadGateway (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedReadDNS (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedGenerateWPASupplicant (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedStartWPASupplicant (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedRequestAutoAssignedIP (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedDisconnectNetwork (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedSetIPAddress (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedSetGateway (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedSetSubnetMask (int vExitCode, QProcess::ExitStatus vExitStatus); + void onProcessFinishedSetDNS (int vExitCode, QProcess::ExitStatus vExitStatus); +};