From 040c76d83989a72fd8b3131233d0af855f51d7b4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 8 May 2020 14:59:30 +0200 Subject: [PATCH] move pass 1 --- .../activities/MyPreferenceFragment.kt | 1 - .../dependencyInjection/ActivitiesModule.kt | 1 + .../dependencyInjection/PluginsModule.kt | 1 - .../plugins/aps/loop/LoopPlugin.java | 89 ++++--- .../general/maintenance/ImportExportPrefs.kt | 1 - .../plugins/general/nsclient/UploadQueue.java | 3 +- .../PersistentNotificationPlugin.kt | 1 - .../plugins/pump/combo/ComboPlugin.java | 2 +- .../pump/common/PumpPluginAbstract.java | 2 +- .../pump/danaR/AbstractDanaRPlugin.java | 2 +- .../plugins/pump/danaR/DanaRPlugin.java | 2 +- .../danaR/activities/DanaRHistoryActivity.kt | 10 +- .../plugins/pump/danaR/comm/MsgHistoryAll.kt | 2 +- .../pump/danaRKorean/DanaRKoreanPlugin.java | 2 +- .../plugins/pump/danaRv2/DanaRv2Plugin.java | 4 +- .../pump/medtronic/MedtronicPumpPlugin.java | 2 +- .../pump/omnipod/OmnipodPumpPlugin.java | 1 - .../plugins/treatments/TreatmentsPlugin.java | 23 +- .../androidNotification/NotificationHolder.kt | 9 +- app/src/main/jniLibs/README.md | 1 - app/src/main/res/values/strings.xml | 41 ---- .../bolusInfo/DetailedBolusInfoStorageTest.kt | 2 - core/build.gradle | 1 + .../activities/BolusProgressHelperActivity.kt | 0 .../activities/DialogAppCompatActivity.kt | 0 .../activities/ErrorHelperActivity.kt | 5 +- .../androidaps/dialogs/BolusProgressDialog.kt | 4 +- .../androidaps/dialogs/ErrorDialog.kt | 13 +- .../androidaps/events/EventAppExit.kt | 0 .../androidaps/events/EventChargingState.kt | 0 .../events/EventConfigBuilderChange.kt | 0 .../events/EventInitializationChanged.kt | 0 .../androidaps/events/EventNetworkChange.kt | 0 .../events/EventProfileNeedsUpdate.kt | 0 .../events/EventPumpStatusChanged.kt | 4 +- .../androidaps/events/EventStatus.kt | 2 +- .../androidaps/interfaces/DanaRInterface.java | 0 .../interfaces/IobCobCalculatorInterface.java | 3 + .../androidaps/interfaces/LoopInterface.kt | 24 ++ .../interfaces/NotificationHolderInterface.kt | 10 + .../interfaces/UploadQueueInterface.java | 8 + .../plugins/aps/loop/DeviceStatus.java | 0 .../plugins/general/nsclient/NSUpload.java | 232 ++++++++++-------- .../EventDismissBolusProgressIfRunning.kt | 0 .../events/EventOverviewBolusProgress.kt | 0 .../bolusInfo/DetailedBolusInfoStorage.kt | 2 - .../receivers/NetworkChangeReceiver.kt | 0 .../receivers/ReceiverStatusStore.kt | 0 .../androidaps/services/AlarmSoundService.kt | 6 +- .../androidaps/utils/StringUtils.java | 3 - .../extensions/HexByteArrayConversion.kt | 0 .../textValidator/DefaultEditTextValidator.kt | 2 +- .../textValidator/EditTextValidator.java | 0 .../ValidatingEditTextPreference.kt | 2 +- .../validators/AlphaNumericValidator.kt | 0 .../validators/AlphaValidator.kt | 0 .../textValidator/validators/AndValidator.kt | 0 .../validators/CreditCardValidator.kt | 0 .../textValidator/validators/DateValidator.kt | 0 .../validators/DigitLengthRangeValidator.kt | 0 .../validators/DomainValidator.kt | 0 .../validators/DummyValidator.kt | 0 .../validators/EmailValidator.kt | 0 .../validators/EmptyValidator.kt | 0 .../validators/FloatNumericRangeValidator.kt | 0 .../validators/HttpsUrlValidator.kt | 0 .../validators/IpAddressValidator.kt | 0 .../validators/MinDigitLengthValidator.kt | 0 .../validators/MultiPhoneValidator.kt | 0 .../validators/MultiValidator.kt | 0 .../textValidator/validators/NotValidator.kt | 0 .../validators/NumericRangeValidator.kt | 0 .../validators/NumericValidator.kt | 0 .../textValidator/validators/OrValidator.kt | 0 .../validators/PatternValidator.kt | 0 .../validators/PersonFullNameValidator.kt | 0 .../validators/PersonNameValidator.kt | 0 .../validators/PhoneValidator.kt | 0 .../validators/PinStrengthValidator.kt | 0 .../validators/RegexpValidator.kt | 0 .../validators/SameValueValidator.kt | 0 .../textValidator/validators/Validator.kt | 0 .../validators/WebUrlValidator.kt | 0 .../main/res/layout/dialog_bolusprogress.xml | 0 .../src/main/res/layout/dialog_error.xml | 0 .../src/main/res/layout/okcancel.xml | 0 {app => core}/src/main/res/raw/error.mp3 | Bin .../src/main/res/values/fet_attrs.xml | 0 core/src/main/res/values/strings.xml | 28 +++ .../src/main/res/values/validator.xml | 0 danars/build.gradle | 3 + .../plugins/pump/danaR/DanaRFragment.kt | 0 .../plugins/pump/danaR/comm/RecordTypes.kt | 0 .../pump/danaR/events/EventDanaRNewStatus.kt | 0 .../plugins/pump/danaRS/DanaRSPlugin.kt | 51 ++-- .../danaRS/activities/EnterPinActivity.kt | 4 +- .../danaRS/comm/DanaRSMessageHashTable.kt | 0 .../pump/danaRS/comm/DanaRS_Packet.java | 0 ...RS_Packet_APS_Basal_Set_Temporary_Basal.kt | 0 .../comm/DanaRS_Packet_APS_History_Events.kt | 4 +- .../DanaRS_Packet_APS_Set_Event_History.kt | 0 .../DanaRS_Packet_Basal_Get_Basal_Rate.kt | 2 +- ...aRS_Packet_Basal_Get_Profile_Basal_Rate.kt | 0 .../DanaRS_Packet_Basal_Get_Profile_Number.kt | 0 ..._Packet_Basal_Get_Temporary_Basal_State.kt | 0 .../DanaRS_Packet_Basal_Set_Basal_Rate.kt | 0 ...Packet_Basal_Set_Cancel_Temporary_Basal.kt | 0 ...aRS_Packet_Basal_Set_Profile_Basal_Rate.kt | 0 .../DanaRS_Packet_Basal_Set_Profile_Number.kt | 0 .../DanaRS_Packet_Basal_Set_Suspend_Off.kt | 0 .../DanaRS_Packet_Basal_Set_Suspend_On.kt | 0 ...DanaRS_Packet_Basal_Set_Temporary_Basal.kt | 0 .../DanaRS_Packet_Bolus_Get_Bolus_Option.kt | 1 + .../DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt | 0 ...acket_Bolus_Get_Calculation_Information.kt | 0 ...et_Carbohydrate_Calculation_Information.kt | 0 .../DanaRS_Packet_Bolus_Get_Dual_Bolus.kt | 0 .../DanaRS_Packet_Bolus_Get_Extended_Bolus.kt | 0 ...S_Packet_Bolus_Get_Extended_Bolus_State.kt | 0 ...et_Bolus_Get_Extended_Menu_Option_State.kt | 0 .../DanaRS_Packet_Bolus_Get_Initial_Bolus.kt | 0 ...Packet_Bolus_Get_Step_Bolus_Information.kt | 0 .../DanaRS_Packet_Bolus_Set_Bolus_Option.kt | 0 .../DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt | 0 .../DanaRS_Packet_Bolus_Set_Dual_Bolus.kt | 0 .../DanaRS_Packet_Bolus_Set_Extended_Bolus.kt | 0 ..._Packet_Bolus_Set_Extended_Bolus_Cancel.kt | 0 .../DanaRS_Packet_Bolus_Set_Initial_Bolus.kt | 0 ...anaRS_Packet_Bolus_Set_Step_Bolus_Start.kt | 0 ...DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt | 0 .../comm/DanaRS_Packet_Etc_Keep_Connection.kt | 0 .../DanaRS_Packet_Etc_Set_History_Save.kt | 0 .../DanaRS_Packet_General_Delivery_Status.kt | 0 ...aRS_Packet_General_Get_More_Information.kt | 0 .../DanaRS_Packet_General_Get_Password.kt | 0 .../DanaRS_Packet_General_Get_Pump_Check.kt | 0 ...Packet_General_Get_Shipping_Information.kt | 0 ...aRS_Packet_General_Get_Shipping_Version.kt | 0 ...Packet_General_Get_Today_Delivery_Total.kt | 0 ...acket_General_Get_User_Time_Change_Flag.kt | 0 ...cket_General_Initial_Screen_Information.kt | 0 ..._Packet_General_Set_History_Upload_Mode.kt | 0 ...General_Set_User_Time_Change_Flag_Clear.kt | 0 .../danaRS/comm/DanaRS_Packet_History_.kt | 0 .../comm/DanaRS_Packet_History_Alarm.kt | 0 .../comm/DanaRS_Packet_History_All_History.kt | 0 .../comm/DanaRS_Packet_History_Basal.kt | 0 .../DanaRS_Packet_History_Blood_Glucose.kt | 0 .../comm/DanaRS_Packet_History_Bolus.kt | 0 .../DanaRS_Packet_History_Carbohydrate.kt | 0 .../comm/DanaRS_Packet_History_Daily.kt | 0 .../comm/DanaRS_Packet_History_Prime.kt | 0 .../comm/DanaRS_Packet_History_Refill.kt | 0 .../comm/DanaRS_Packet_History_Suspend.kt | 0 .../comm/DanaRS_Packet_History_Temporary.kt | 0 .../danaRS/comm/DanaRS_Packet_Notify_Alarm.kt | 0 .../DanaRS_Packet_Notify_Delivery_Complete.kt | 0 ...aRS_Packet_Notify_Delivery_Rate_Display.kt | 0 ...DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt | 0 .../DanaRS_Packet_Option_Get_Pump_Time.kt | 0 .../DanaRS_Packet_Option_Get_User_Option.kt | 0 .../DanaRS_Packet_Option_Set_Pump_Time.kt | 0 .../DanaRS_Packet_Option_Set_User_Option.kt | 0 .../comm/DanaRS_Packet_Review_Bolus_Avg.kt | 0 ...DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt | 0 .../pump/danaRS/encryption/BleEncryption.java | 0 .../plugins/pump/danaRS/services/BLEComm.kt | 0 .../pump/danaRS/services/DanaRSService.kt | 1 - .../jniLibs/arm64-v8a/libBleEncryption.so | Bin .../jniLibs/armeabi-v7a/libBleEncryption.so | Bin .../src/main/jniLibs/x86/libBleEncryption.so | Bin .../main/jniLibs/x86_64/libBleEncryption.so | Bin .../res/layout/danars_enter_pin_activity.xml | 0 danars/src/main/res/values/strings.xml | 19 +- .../src/main/res/xml/pref_danars.xml | 0 175 files changed, 349 insertions(+), 287 deletions(-) delete mode 100644 app/src/main/jniLibs/README.md rename {app => core}/src/main/java/info/nightscout/androidaps/activities/BolusProgressHelperActivity.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt (86%) rename {app => core}/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt (98%) rename {app => core}/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt (89%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventAppExit.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventChargingState.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventConfigBuilderChange.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventInitializationChanged.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventNetworkChange.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventProfileNeedsUpdate.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt (94%) rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventStatus.kt (84%) rename {app => core}/src/main/java/info/nightscout/androidaps/interfaces/DanaRInterface.java (100%) create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/LoopInterface.kt create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/NotificationHolderInterface.kt create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/UploadQueueInterface.java rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/aps/loop/DeviceStatus.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java (66%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventOverviewBolusProgress.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt (95%) rename {app => core}/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt (91%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/StringUtils.java (86%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/extensions/HexByteArrayConversion.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt (99%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.java (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt (97%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt (100%) rename {app => core}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt (100%) rename {app => core}/src/main/res/layout/dialog_bolusprogress.xml (100%) rename {app => core}/src/main/res/layout/dialog_error.xml (100%) rename {app => core}/src/main/res/layout/okcancel.xml (100%) rename {app => core}/src/main/res/raw/error.mp3 (100%) rename {app => core}/src/main/res/values/fet_attrs.xml (100%) rename {app => core}/src/main/res/values/validator.xml (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRFragment.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/RecordTypes.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/events/EventDanaRNewStatus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt (93%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt (97%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTable.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet.java (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_Basal.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt (98%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_History.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt (98%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Basal_Rate.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Number.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_State.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Basal_Rate.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Cancel_Temporary_Basal.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Basal_Rate.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Number.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_Off.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_On.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Temporary_Basal.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt (99%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Calculation_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Dual_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus_State.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Menu_Option_State.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Initial_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Step_Bolus_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Bolus_Option.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Dual_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Initial_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Start.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Keep_Connection.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Set_History_Save.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Delivery_Status.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_More_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Password.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Pump_Check.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Version.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Today_Delivery_Total.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_User_Time_Change_Flag.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Initial_Screen_Information.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_History_Upload_Mode.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_User_Time_Change_Flag_Clear.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Alarm.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_All_History.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Basal.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Blood_Glucose.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Bolus.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Carbohydrate.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Daily.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Prime.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Refill.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Suspend.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Temporary.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Alarm.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Complete.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Rate_Display.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_Pump_Time.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_User_Option.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_Pump_Time.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_User_Option.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Bolus_Avg.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/encryption/BleEncryption.java (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/BLEComm.kt (100%) rename {app => danars}/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt (99%) rename {app => danars}/src/main/jniLibs/arm64-v8a/libBleEncryption.so (100%) rename {app => danars}/src/main/jniLibs/armeabi-v7a/libBleEncryption.so (100%) rename {app => danars}/src/main/jniLibs/x86/libBleEncryption.so (100%) rename {app => danars}/src/main/jniLibs/x86_64/libBleEncryption.so (100%) rename {app => danars}/src/main/res/layout/danars_enter_pin_activity.xml (100%) rename {app => danars}/src/main/res/xml/pref_danars.xml (100%) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index 0b8fc440ca..f7872853f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -41,7 +41,6 @@ import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin -import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt index f4b6e9a27a..dbfd40c33d 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt @@ -4,6 +4,7 @@ import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.activities.* +import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.historyBrowser.HistoryBrowseActivity import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImportListActivity diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt index de00d631e4..e7b1903389 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/PluginsModule.kt @@ -41,7 +41,6 @@ import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin -import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java index c5c723731c..f04035277e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java @@ -41,9 +41,11 @@ import info.nightscout.androidaps.interfaces.APSInterface; import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.interfaces.CommandQueueProvider; import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.androidaps.interfaces.LoopInterface; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginType; +import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpDescription; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.logging.AAPSLogger; @@ -53,7 +55,6 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui; import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification; import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker; -import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; @@ -65,15 +66,15 @@ import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.androidaps.receivers.ReceiverStatusStore; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; +import info.nightscout.androidaps.utils.HardLimits; import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; -import info.nightscout.androidaps.utils.HardLimits; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.schedulers.Schedulers; @Singleton -public class LoopPlugin extends PluginBase { +public class LoopPlugin extends PluginBase implements LoopInterface { private final HasAndroidInjector injector; private final SP sp; private final RxBusWrapper rxBus; @@ -89,6 +90,7 @@ public class LoopPlugin extends PluginBase { private final IobCobCalculatorPlugin iobCobCalculatorPlugin; private final ReceiverStatusStore receiverStatusStore; private final FabricPrivacy fabricPrivacy; + private final NSUpload nsUpload; private final HardLimits hardLimits; private CompositeDisposable disposable = new CompositeDisposable(); @@ -101,21 +103,15 @@ public class LoopPlugin extends PluginBase { private boolean isSuperBolus; private boolean isDisconnected; - public class LastRun { - public APSResult request = null; - public APSResult constraintsProcessed = null; - public PumpEnactResult tbrSetByPump = null; - public PumpEnactResult smbSetByPump = null; - public String source = null; - public long lastAPSRun = DateUtil.now(); - public long lastTBREnact = 0; - public long lastSMBEnact = 0; - public long lastTBRRequest = 0; - public long lastSMBRequest = 0; - public long lastOpenModeAccept; + @Nullable public LastRun lastRun = null; + + @Nullable @Override public LastRun getLastRun() { + return lastRun; } - @Nullable public LastRun lastRun = null; + @Override public void setLastRun(@Nullable LastRun lastRun) { + this.lastRun = lastRun; + } @Inject public LoopPlugin( @@ -135,6 +131,7 @@ public class LoopPlugin extends PluginBase { IobCobCalculatorPlugin iobCobCalculatorPlugin, ReceiverStatusStore receiverStatusStore, FabricPrivacy fabricPrivacy, + NSUpload nsUpload, HardLimits hardLimits ) { super(new PluginDescription() @@ -161,6 +158,7 @@ public class LoopPlugin extends PluginBase { this.iobCobCalculatorPlugin = iobCobCalculatorPlugin; this.receiverStatusStore = receiverStatusStore; this.fabricPrivacy = fabricPrivacy; + this.nsUpload = nsUpload; this.hardLimits = hardLimits; loopSuspendedTill = sp.getLong("loopSuspendedTill", 0L); @@ -292,7 +290,7 @@ public class LoopPlugin extends PluginBase { return true; } - public boolean isLGS(){ + public boolean isLGS() { Constraint closedLoopEnabled = constraintChecker.isClosedLoopAllowed(); Double MaxIOBallowed = constraintChecker.getMaxIOBAllowed().value(); String APSmode = sp.getString(R.string.key_aps_mode, "open"); @@ -403,18 +401,18 @@ public class LoopPlugin extends PluginBase { } if (lastRun == null) lastRun = new LastRun(); - lastRun.request = result; - lastRun.constraintsProcessed = resultAfterConstraints; - lastRun.lastAPSRun = DateUtil.now(); - lastRun.source = ((PluginBase) usedAPS).getName(); - lastRun.tbrSetByPump = null; - lastRun.smbSetByPump = null; - lastRun.lastTBREnact = 0; - lastRun.lastTBRRequest = 0; - lastRun.lastSMBEnact = 0; - lastRun.lastSMBRequest = 0; + lastRun.setRequest(result); + lastRun.setConstraintsProcessed(resultAfterConstraints); + lastRun.setLastAPSRun(DateUtil.now()); + lastRun.setSource(((PluginBase) usedAPS).getName()); + lastRun.setTbrSetByPump(null); + lastRun.setSmbSetByPump(null); + lastRun.setLastTBREnact(0); + lastRun.setLastTBRRequest(0); + lastRun.setLastSMBEnact(0); + lastRun.setLastSMBRequest(0); - NSUpload.uploadDeviceStatus(this, iobCobCalculatorPlugin, profileFunction, activePlugin.getActivePump(), receiverStatusStore); + nsUpload.uploadDeviceStatus(this, iobCobCalculatorPlugin, profileFunction, activePlugin.getActivePump(), receiverStatusStore); if (isSuspended()) { getAapsLogger().debug(LTag.APS, resourceHelper.gs(R.string.loopsuspended)); @@ -437,27 +435,27 @@ public class LoopPlugin extends PluginBase { final PumpEnactResult waiting = new PumpEnactResult(getInjector()); waiting.queued = true; if (resultAfterConstraints.tempBasalRequested) - lastRun.tbrSetByPump = waiting; + lastRun.setTbrSetByPump(waiting); if (resultAfterConstraints.bolusRequested) - lastRun.smbSetByPump = waiting; + lastRun.setSmbSetByPump(waiting); rxBus.send(new EventLoopUpdateGui()); fabricPrivacy.logCustom("APSRequest"); applyTBRRequest(resultAfterConstraints, profile, new Callback() { @Override public void run() { if (result.enacted || result.success) { - lastRun.tbrSetByPump = result; - lastRun.lastTBRRequest = lastRun.lastAPSRun; - lastRun.lastTBREnact = DateUtil.now(); + lastRun.setTbrSetByPump(result); + lastRun.setLastTBRRequest(lastRun.getLastAPSRun()); + lastRun.setLastTBREnact(DateUtil.now()); rxBus.send(new EventLoopUpdateGui()); applySMBRequest(resultAfterConstraints, new Callback() { @Override public void run() { //Callback is only called if a bolus was acutally requested if (result.enacted || result.success) { - lastRun.smbSetByPump = result; - lastRun.lastSMBRequest = lastRun.lastAPSRun; - lastRun.lastSMBEnact = DateUtil.now(); + lastRun.setTbrSetByPump(result); + lastRun.setLastTBRRequest(lastRun.getLastAPSRun()); + lastRun.setLastTBREnact(DateUtil.now()); } else { new Thread(() -> { SystemClock.sleep(1000); @@ -472,8 +470,8 @@ public class LoopPlugin extends PluginBase { } }); } else { - lastRun.tbrSetByPump = null; - lastRun.smbSetByPump = null; + lastRun.setTbrSetByPump(null); + lastRun.setSmbSetByPump(null); } } else { if (resultAfterConstraints.isChangeRequested() && allowNotification) { @@ -531,15 +529,15 @@ public class LoopPlugin extends PluginBase { public void acceptChangeRequest() { Profile profile = profileFunction.getProfile(); final LoopPlugin lp = this; - applyTBRRequest(lastRun.constraintsProcessed, profile, new Callback() { + applyTBRRequest(lastRun.getConstraintsProcessed(), profile, new Callback() { @Override public void run() { if (result.enacted) { - lastRun.tbrSetByPump = result; - lastRun.lastTBRRequest = lastRun.lastAPSRun; - lastRun.lastTBREnact = DateUtil.now(); - lastRun.lastOpenModeAccept = DateUtil.now(); - NSUpload.uploadDeviceStatus(lp, iobCobCalculatorPlugin, profileFunction, activePlugin.getActivePump(), receiverStatusStore); + lastRun.setTbrSetByPump(result); + lastRun.setLastTBRRequest(lastRun.getLastAPSRun()); + lastRun.setLastTBREnact(DateUtil.now()); + lastRun.setLastOpenModeAccept(DateUtil.now()); + nsUpload.uploadDeviceStatus(lp, iobCobCalculatorPlugin, profileFunction, activePlugin.getActivePump(), receiverStatusStore); sp.incInt(R.string.key_ObjectivesmanualEnacts); } rxBus.send(new EventAcceptOpenLoopChange()); @@ -773,6 +771,7 @@ public class LoopPlugin extends PluginBase { event.eventType = CareportalEvent.OPENAPSOFFLINE; event.json = data.toString(); MainApp.getDbHelper().createOrUpdate(event); - NSUpload.uploadOpenAPSOffline(event); + nsUpload.uploadOpenAPSOffline(event); } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt index 4d9021bb71..4fa6c43fce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt @@ -20,7 +20,6 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.general.maintenance.formats.* -import info.nightscout.androidaps.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java index 0786aae250..d9bd5a6307 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java @@ -16,6 +16,7 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.DbRequest; +import info.nightscout.androidaps.interfaces.UploadQueueInterface; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; @@ -27,7 +28,7 @@ import info.nightscout.androidaps.utils.SP; /** * Created by mike on 21.02.2016. */ -public class UploadQueue { +public class UploadQueue implements UploadQueueInterface { private static Logger log = StacktraceLoggerWrapper.getLogger(LTag.NSCLIENT); public static String status() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index e8d32ed386..ca4b8c1720 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -14,7 +14,6 @@ import info.nightscout.androidaps.Constants import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.R import info.nightscout.androidaps.data.Profile -import info.nightscout.androidaps.db.DatabaseHelper import info.nightscout.androidaps.events.* import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index ace9df0a97..de9b4e66fc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -485,7 +485,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr getAapsLogger().error("deliverTreatment: Invalid input"); return new PumpEnactResult(getInjector()).success(false).enacted(false) .bolusDelivered(0d).carbsDelivered(0d) - .comment(getResourceHelper().gs(R.string.danar_invalidinput)); + .comment(getResourceHelper().gs(R.string.invalidinput)); } else if (detailedBolusInfo.insulin > 0) { // bolus needed, ask pump to deliver it return deliverBolus(detailedBolusInfo); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java index 0bb38acb76..6d06f2e788 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java @@ -413,7 +413,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements PumpI // neither carbs nor bolus requested aapsLogger.error("deliverTreatment: Invalid input"); return new PumpEnactResult(getInjector()).success(false).enacted(false).bolusDelivered(0d).carbsDelivered(0d) - .comment(getResourceHelper().gs(R.string.danar_invalidinput)); + .comment(getResourceHelper().gs(R.string.invalidinput)); } else if (detailedBolusInfo.insulin > 0) { // bolus needed, ask pump to deliver it return deliverBolus(detailedBolusInfo); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java index 064e7c8d5b..b055cacda3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java @@ -224,7 +224,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump result.isTempCancel = false; result.enacted = false; result.success = false; - result.comment = getResourceHelper().gs(R.string.danar_invalidinput); + result.comment = getResourceHelper().gs(R.string.invalidinput); getAapsLogger().error("setTempBasalPercent: Invalid input"); return result; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java index d0d1442225..aae520eb06 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java @@ -180,7 +180,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin { result.success = false; result.bolusDelivered = 0d; result.carbsDelivered = 0d; - result.comment = resourceHelper.gs(R.string.danar_invalidinput); + result.comment = resourceHelper.gs(R.string.invalidinput); aapsLogger.error("deliverTreatment: Invalid input"); return result; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/activities/DanaRHistoryActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/activities/DanaRHistoryActivity.kt index 18ffab8460..eb63a70a0e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/activities/DanaRHistoryActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/activities/DanaRHistoryActivity.kt @@ -151,7 +151,7 @@ class DanaRHistoryActivity : NoSplashAppCompatActivity() { holder.duration.text = DecimalFormatter.to0Decimal(record.recordDuration.toDouble()) holder.alarm.text = record.recordAlarm when (showingType) { - RecordTypes.RECORD_TYPE_ALARM -> { + RecordTypes.RECORD_TYPE_ALARM -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.GONE @@ -163,7 +163,7 @@ class DanaRHistoryActivity : NoSplashAppCompatActivity() { holder.alarm.visibility = View.VISIBLE } - RecordTypes.RECORD_TYPE_BOLUS -> { + RecordTypes.RECORD_TYPE_BOLUS -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.GONE @@ -175,7 +175,7 @@ class DanaRHistoryActivity : NoSplashAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_DAILY -> { + RecordTypes.RECORD_TYPE_DAILY -> { holder.dailyBasal.text = resourceHelper.gs(R.string.formatinsulinunits, record.recordDailyBasal) holder.dailyBolus.text = resourceHelper.gs(R.string.formatinsulinunits, record.recordDailyBolus) holder.dailyTotal.text = resourceHelper.gs(R.string.formatinsulinunits, record.recordDailyBolus + record.recordDailyBasal) @@ -191,7 +191,7 @@ class DanaRHistoryActivity : NoSplashAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_GLUCOSE -> { + RecordTypes.RECORD_TYPE_GLUCOSE -> { holder.value.text = Profile.toUnitsString(record.recordValue, record.recordValue * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()) holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE @@ -216,7 +216,7 @@ class DanaRHistoryActivity : NoSplashAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_SUSPEND -> { + RecordTypes.RECORD_TYPE_SUSPEND -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.GONE holder.stringValue.visibility = View.VISIBLE diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgHistoryAll.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgHistoryAll.kt index 3572e0eb54..b25a5b9b1f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgHistoryAll.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgHistoryAll.kt @@ -136,7 +136,7 @@ open class MsgHistoryAll( danaRHistoryRecord.stringRecordValue = strRecordValue } - 17.toByte() -> failed = true + 17.toByte() -> failed = true } MainApp.getDbHelper().createOrUpdate(danaRHistoryRecord) rxBus.send(EventDanaRSyncStatus(dateUtil.dateAndTimeString(danaRHistoryRecord.recordDate) + " " + messageType)) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java index 201b43f184..ad079c06ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java @@ -182,7 +182,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin { result.success = false; result.bolusDelivered = 0d; result.carbsDelivered = 0d; - result.comment = resourceHelper.gs(R.string.danar_invalidinput); + result.comment = resourceHelper.gs(R.string.invalidinput); aapsLogger.error("deliverTreatment: Invalid input"); return result; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java index d9f41d0b3f..992819a136 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java @@ -200,7 +200,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { result.success = false; result.bolusDelivered = 0d; result.carbsDelivered = 0d; - result.comment = resourceHelper.gs(R.string.danar_invalidinput); + result.comment = resourceHelper.gs(R.string.invalidinput); aapsLogger.error("deliverTreatment: Invalid input"); return result; } @@ -301,7 +301,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { result.isTempCancel = false; result.enacted = false; result.success = false; - result.comment = resourceHelper.gs(R.string.danar_invalidinput); + result.comment = resourceHelper.gs(R.string.invalidinput); aapsLogger.error("setTempBasalPercent: Invalid input"); return result; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java index 95a3f68c12..77df3be676 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java @@ -201,7 +201,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter if (pref.getKey().equals(getResourceHelper().gs(R.string.key_rileylink_mac_address))) { String value = sp.getStringOrNull(R.string.key_rileylink_mac_address, null); - pref.setSummary(value == null ? getResourceHelper().gs(R.string.rileylink_error_address_not_set_short) : value); + pref.setSummary(value == null ? getResourceHelper().gs(R.string.not_set_short) : value); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 0c51b5901c..8d5c7b8b41 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -24,7 +24,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.activities.ErrorHelperActivity; import info.nightscout.androidaps.data.DetailedBolusInfo; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java index 3dd183bff6..4d28d2dcdd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPlugin.java @@ -75,6 +75,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface private final ResourceHelper resourceHelper; private final ProfileFunction profileFunction; private final ActivePluginProvider activePlugin; + private final NSUpload nsUpload; private final FabricPrivacy fabricPrivacy; private final DateUtil dateUtil; @@ -101,6 +102,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface SP sp, ProfileFunction profileFunction, ActivePluginProvider activePlugin, + NSUpload nsUpload, FabricPrivacy fabricPrivacy, DateUtil dateUtil ) { @@ -122,6 +124,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface this.activePlugin = activePlugin; this.fabricPrivacy = fabricPrivacy; this.dateUtil = dateUtil; + this.nsUpload = nsUpload; } @Override @@ -553,13 +556,13 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface if (newRecordCreated) { if (extendedBolus.durationInMinutes == 0) { if (activePlugin.getActivePump().isFakingTempsByExtendedBoluses()) - NSUpload.uploadTempBasalEnd(extendedBolus.date, true, extendedBolus.pumpId); + nsUpload.uploadTempBasalEnd(extendedBolus.date, true, extendedBolus.pumpId); else - NSUpload.uploadExtendedBolusEnd(extendedBolus.date, extendedBolus.pumpId); + nsUpload.uploadExtendedBolusEnd(extendedBolus.date, extendedBolus.pumpId); } else if (activePlugin.getActivePump().isFakingTempsByExtendedBoluses()) - NSUpload.uploadTempBasalStartAbsolute(new TemporaryBasal(extendedBolus), extendedBolus.insulin); + nsUpload.uploadTempBasalStartAbsolute(new TemporaryBasal(extendedBolus), extendedBolus.insulin); else - NSUpload.uploadExtendedBolus(extendedBolus); + nsUpload.uploadExtendedBolus(extendedBolus); } return newRecordCreated; } @@ -586,11 +589,11 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface boolean newRecordCreated = MainApp.getDbHelper().createOrUpdate(tempBasal); if (newRecordCreated) { if (tempBasal.durationInMinutes == 0) - NSUpload.uploadTempBasalEnd(tempBasal.date, false, tempBasal.pumpId); + nsUpload.uploadTempBasalEnd(tempBasal.date, false, tempBasal.pumpId); else if (tempBasal.isAbsolute) - NSUpload.uploadTempBasalStartAbsolute(tempBasal, null); + nsUpload.uploadTempBasalStartAbsolute(tempBasal, null); else - NSUpload.uploadTempBasalStartPercent(tempBasal, profileFunction.getProfile(tempBasal.date)); + nsUpload.uploadTempBasalStartPercent(tempBasal, profileFunction.getProfile(tempBasal.date)); } return newRecordCreated; } @@ -641,7 +644,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface //log.debug("Adding new Treatment record" + carbsTreatment); } if (newRecordCreated && detailedBolusInfo.isValid) - NSUpload.uploadTreatmentRecord(detailedBolusInfo); + nsUpload.uploadTreatmentRecord(detailedBolusInfo); if (!allowUpdate && !creatOrUpdateResult.success) { getAapsLogger().error("Treatment could not be added to DB", new Exception()); @@ -710,7 +713,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface public void addToHistoryTempTarget(TempTarget tempTarget) { //log.debug("Adding new TemporaryBasal record" + profileSwitch.log()); MainApp.getDbHelper().createOrUpdate(tempTarget); - NSUpload.uploadTempTarget(tempTarget, profileFunction); + nsUpload.uploadTempTarget(tempTarget, profileFunction); } @Override @@ -733,7 +736,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface //log.debug("Adding new TemporaryBasal record" + profileSwitch.log()); rxBus.send(new EventDismissNotification(Notification.PROFILE_SWITCH_MISSING)); MainApp.getDbHelper().createOrUpdate(profileSwitch); - NSUpload.uploadProfileSwitch(profileSwitch); + nsUpload.uploadProfileSwitch(profileSwitch); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolder.kt b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolder.kt index 6ee23a85f5..028c63086e 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolder.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolder.kt @@ -10,6 +10,7 @@ import androidx.core.app.TaskStackBuilder import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.NotificationHolderInterface import info.nightscout.androidaps.utils.resources.IconsProvider import info.nightscout.androidaps.utils.resources.ResourceHelper import javax.inject.Inject @@ -20,11 +21,11 @@ class NotificationHolder @Inject constructor( private val resourceHelper: ResourceHelper, private val context: Context, private val iconsProvider: IconsProvider -) { +) : NotificationHolderInterface { - val channelID = "AndroidAPS-Ongoing" - val notificationID = 4711 - var notification: Notification + override val channelID = "AndroidAPS-Ongoing" + override val notificationID = 4711 + override lateinit var notification: Notification init { val stackBuilder = TaskStackBuilder.create(context) diff --git a/app/src/main/jniLibs/README.md b/app/src/main/jniLibs/README.md deleted file mode 100644 index 7041df4e10..0000000000 --- a/app/src/main/jniLibs/README.md +++ /dev/null @@ -1 +0,0 @@ -# danars-support-lib \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 35a25bca9b..b36ff01254 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -62,7 +62,6 @@ Pump integration for DANA Diabecare R pumps Pump integration for domestic DANA Diabecare R pumps Pump integration for DANA Diabecare R pumps with upgraded firmware - Pump integration for DANA Diabecare RS pumps Pump integration for people who do multiple daily injections for their diabetes therapy Pump integration for pumps which don\'t have any driver yet (Open Loop) Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences. @@ -161,7 +160,6 @@ Plugin is disabled Constraints violation Bolus delivery error - Tempbasal delivery error Basal value [%] Accept new temp basal: Treatment @@ -283,9 +281,6 @@ in directory: %1$s DanaR - Connecting - Connected - Disconnected Dana pump settings End User License Agreement MUST NOT BE USED TO MAKE MEDICAL DECISIONS. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @@ -297,8 +292,6 @@ Pump IOB Daily units Last bolus - Invalid input data - Value not set properly Reload profile View profile SMS Communicator @@ -328,7 +321,6 @@ DanaR profile settings DIA [h] Duration of Insulin Activity - Failed to update basal profile Reload Uploading E bolus @@ -351,7 +343,6 @@ Glucose Refill Suspend - Connecting for %1$d s Pump password (v1 only) Pump password Wrong pump password! @@ -363,8 +354,6 @@ Occlusion Stop STOP PRESSED - Waiting for pump - Going to deliver %1$.2fU You reached allowed limit Loop has been disabled Loop has been enabled @@ -406,11 +395,9 @@ Meal Corr Actions - AndroidAPS started NS upload only (disabled sync) NS upload only. Not effective on SGV unless a local source like xDrip is selected. Not effective on Profiles while NS-Profiles is used. Pump not initialized! - Pump not initialized, profile not set! Prime/Fill Please make sure the amount matches the specification of your infusion set! Other @@ -439,7 +426,6 @@ DanaR Korean Basal rate: Setting of basal profile failed - Basal profile in pump updated Disable EasyUI mode in pump Enable extended boluses on pump Change mode from U/d to U/h on pump @@ -531,7 +517,6 @@ Setting extended bolus Stopping extended bolus Updating basal rates - Disconnecting Executing Virtual pump settings Upload status to NS @@ -609,7 +594,6 @@ COB Superbolus Log app start to NS - ns_logappstartedevent Exiting application to apply settings. DanaRv2 Which type of insulin are you using? @@ -751,20 +735,12 @@ Date INVALID Pairing - danars_pairing_key_ - danars_v3_randompairing_key_ - danars_v3_pairing_key_ - danars_v3_randomsync_key_ Empty reservoir Blood sugar measurement alert Remaining insulin level Missed bolus - DanaRS - Dana Selected pump Bolus speed - danars_bolusspeed - Set basal step to 0.01 U/h Serial number wizard_include_cob wizard_include_trend_bg @@ -938,7 +914,6 @@ History browser Notify on SMB Show SMB on the watch like a standard bolus. - ns_create_announcements_from_errors Create announcements from errors Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments) EVR @@ -994,20 +969,15 @@ SMB disabled in preferences UAM disabled in preferences UAM disabled because it rely on Oref1 sensitivity plugin - Limiting max basal rate to %1$.2f U/h because of %2$s - pump limit openapsma_max_basal openapsama_current_basal_safety_multiplier openapsama_max_daily_safety_multiplier - it must be positive value max basal multiplier max daily basal multiplier openapsma_max_iob A bolus was delivered within the last 3 minutes, skipping SMB Basal set correctly - Limiting max percent rate to %1$d%% because of %2$s treatmentssafety_maxbolus - Limiting bolus to %1$.1f U because of %2$s Limiting extended bolus to %1$.1f U because of %2$s Limiting max IOB to %1$.1f U because of %2$s Limiting carbs to %1$d g because of %2$s @@ -1044,7 +1014,6 @@ Setup Wizard FINISH Select your language - Asked: %1$.2fU Delivered: %2$.2fU Error code: %3$s First insulin increment Second insulin increment Third insulin increment @@ -1183,12 +1152,7 @@ Preferred APS mode Total Calc - Handshaking Send today\'s log files to developers along with this time. Unexpected situation. - Max bolus violation - Command error - Speed error - Insulin limit violation Minimal request change [%] Open Loop will popup new change request only if change is bigger than this value in %. Default value is 20% short_tabtitles @@ -1521,7 +1485,6 @@ TuneUp Failed Pump unreachable Pod unreachable - Not set Medtronic Pump @@ -1636,7 +1599,6 @@ Time and/or Timezone change on pump No pump selected Select units you want to display values in - ns_uploadlocalprofile Upload local profile changes to NS wear_detailediob wear_showbgi @@ -1674,7 +1636,6 @@ BG Tools Show calcuation - Error 12h 24h Automation event @@ -1741,10 +1702,8 @@ Predictions Deviation slope graphconfig - rs_loginsulinchange Log reservoir change Add \"Insulin Change\" event to careportal when detected in history - rs_logcanulachange Log canula change Add \"Site Change\" event to careportal when detected in history Authorization failed diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorageTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorageTest.kt index 28117e5583..9f483da250 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorageTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorageTest.kt @@ -2,13 +2,11 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.logging.AAPSLogger import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.mockito.Mock import org.powermock.modules.junit4.PowerMockRunner @RunWith(PowerMockRunner::class) diff --git a/core/build.gradle b/core/build.gradle index bde94da837..b3045c0f35 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -46,6 +46,7 @@ dependencies { implementation "androidx.preference:preference-ktx:1.1.1" implementation "androidx.activity:activity:${activityVersion}" implementation "androidx.activity:activity-ktx:${activityVersion}" + implementation 'com.google.android.material:material:1.1.0' implementation "com.google.dagger:dagger-android:$dagger_version" implementation "com.google.dagger:dagger-android-support:$dagger_version" diff --git a/app/src/main/java/info/nightscout/androidaps/activities/BolusProgressHelperActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/BolusProgressHelperActivity.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/activities/BolusProgressHelperActivity.kt rename to core/src/main/java/info/nightscout/androidaps/activities/BolusProgressHelperActivity.kt diff --git a/app/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt rename to core/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt rename to core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt index ce02742381..11affb41d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.activities import android.os.Bundle -import info.nightscout.androidaps.R +import info.nightscout.androidaps.core.R import info.nightscout.androidaps.dialogs.ErrorDialog import info.nightscout.androidaps.plugins.general.nsclient.NSUpload import info.nightscout.androidaps.utils.sharedPreferences.SP @@ -9,6 +9,7 @@ import javax.inject.Inject class ErrorHelperActivity : DialogAppCompatActivity() { @Inject lateinit var sp : SP + @Inject lateinit var nsUpload: NSUpload @Override override fun onCreate(savedInstanceState: Bundle?) { @@ -21,7 +22,7 @@ class ErrorHelperActivity : DialogAppCompatActivity() { errorDialog.show(supportFragmentManager, "Error") if (sp.getBoolean(R.string.key_ns_create_announcements_from_errors, true)) { - NSUpload.uploadError(intent.getStringExtra("status")) + nsUpload.uploadError(intent.getStringExtra("status")) } } } diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt rename to core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index 8152c25ab0..98e459a5b9 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -9,8 +9,8 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.BolusProgressHelperActivity +import info.nightscout.androidaps.core.R import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.logging.AAPSLogger @@ -71,7 +71,7 @@ class BolusProgressDialog : DaggerDialogFragment() { savedInstanceState?.let { amount = it.getDouble("amount") } - overview_bolusprogress_title.text = resourceHelper.gs(R.string.overview_bolusprogress_goingtodeliver, amount) + overview_bolusprogress_title.text = resourceHelper.gs(R.string.goingtodeliver, amount) overview_bolusprogress_stop.setOnClickListener { aapsLogger.debug(LTag.UI, "Stop bolus delivery button pressed") stopPressed = true diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt rename to core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt index 07917899bf..9d2035b279 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.dialogs +import android.content.Context import android.content.Intent import android.os.Build import android.os.Bundle @@ -9,9 +10,8 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.MainApp -import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.ErrorHelperActivity +import info.nightscout.androidaps.core.R import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.services.AlarmSoundService import kotlinx.android.synthetic.main.dialog_error.* @@ -19,7 +19,6 @@ import javax.inject.Inject class ErrorDialog : DaggerDialogFragment() { @Inject lateinit var aapsLogger: AAPSLogger - @Inject lateinit var mainApp: MainApp var helperActivity: ErrorHelperActivity? = null var status: String = "" @@ -82,16 +81,16 @@ class ErrorDialog : DaggerDialogFragment() { private fun startAlarm() { if (sound != 0) { - val alarm = Intent(mainApp, AlarmSoundService::class.java) + val alarm = Intent(context, AlarmSoundService::class.java) alarm.putExtra("soundid", sound) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - mainApp.startForegroundService(alarm) + context?.startForegroundService(alarm) } else { - mainApp.startService(alarm) + context?.startService(alarm) } } } private fun stopAlarm() = - mainApp.stopService(Intent(mainApp, AlarmSoundService::class.java)) + context?.stopService(Intent(context, AlarmSoundService::class.java)) } diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventAppExit.kt b/core/src/main/java/info/nightscout/androidaps/events/EventAppExit.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventAppExit.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventAppExit.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventChargingState.kt b/core/src/main/java/info/nightscout/androidaps/events/EventChargingState.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventChargingState.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventChargingState.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventConfigBuilderChange.kt b/core/src/main/java/info/nightscout/androidaps/events/EventConfigBuilderChange.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventConfigBuilderChange.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventConfigBuilderChange.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventInitializationChanged.kt b/core/src/main/java/info/nightscout/androidaps/events/EventInitializationChanged.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventInitializationChanged.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventInitializationChanged.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventNetworkChange.kt b/core/src/main/java/info/nightscout/androidaps/events/EventNetworkChange.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventNetworkChange.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventNetworkChange.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventProfileNeedsUpdate.kt b/core/src/main/java/info/nightscout/androidaps/events/EventProfileNeedsUpdate.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventProfileNeedsUpdate.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventProfileNeedsUpdate.kt diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt b/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt index cc92defe8d..0b9ce7ebf0 100644 --- a/app/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt +++ b/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.R +import info.nightscout.androidaps.core.R import info.nightscout.androidaps.utils.resources.ResourceHelper class EventPumpStatusChanged : EventStatus { @@ -46,7 +46,7 @@ class EventPumpStatusChanged : EventStatus { // status for startup wizard override fun getStatus(resourceHelper: ResourceHelper): String { return when (status) { - Status.CONNECTING -> String.format(resourceHelper.gs(R.string.danar_history_connectingfor), secondsElapsed) + Status.CONNECTING -> String.format(resourceHelper.gs(R.string.connectingfor), secondsElapsed) Status.HANDSHAKING -> resourceHelper.gs(R.string.handshaking) Status.CONNECTED -> resourceHelper.gs(R.string.connected) Status.PERFORMING -> performingAction diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventStatus.kt b/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt similarity index 84% rename from app/src/main/java/info/nightscout/androidaps/events/EventStatus.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt index 360b62f0e9..88c8073e69 100644 --- a/app/src/main/java/info/nightscout/androidaps/events/EventStatus.kt +++ b/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt @@ -3,6 +3,6 @@ package info.nightscout.androidaps.events import info.nightscout.androidaps.utils.resources.ResourceHelper // pass string to startup wizard -abstract class EventStatus :Event() { +abstract class EventStatus : Event() { abstract fun getStatus(resourceHelper: ResourceHelper) : String } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/DanaRInterface.java b/core/src/main/java/info/nightscout/androidaps/interfaces/DanaRInterface.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/interfaces/DanaRInterface.java rename to core/src/main/java/info/nightscout/androidaps/interfaces/DanaRInterface.java diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculatorInterface.java b/core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculatorInterface.java index 2d06449082..75a57b2c07 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculatorInterface.java +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculatorInterface.java @@ -2,10 +2,13 @@ package info.nightscout.androidaps.interfaces; import androidx.collection.LongSparseArray; +import info.nightscout.androidaps.data.IobTotal; +import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData; public interface IobCobCalculatorInterface { LongSparseArray getAutosensDataTable(); + IobTotal[] calculateIobArrayInDia(Profile profile); String lastDataTime(); AutosensData getAutosensData(long toTime); } diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/LoopInterface.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/LoopInterface.kt new file mode 100644 index 0000000000..2ec67b461b --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/LoopInterface.kt @@ -0,0 +1,24 @@ +package info.nightscout.androidaps.interfaces + +import info.nightscout.androidaps.data.PumpEnactResult +import info.nightscout.androidaps.plugins.aps.loop.APSResult +import info.nightscout.androidaps.utils.DateUtil + +interface LoopInterface { + + class LastRun { + var request: APSResult? = null + var constraintsProcessed: APSResult? = null + var tbrSetByPump: PumpEnactResult? = null + var smbSetByPump: PumpEnactResult? = null + var source: String? = null + var lastAPSRun = DateUtil.now() + var lastTBREnact: Long = 0 + var lastSMBEnact: Long = 0 + var lastTBRRequest: Long = 0 + var lastSMBRequest: Long = 0 + var lastOpenModeAccept: Long = 0 + } + + var lastRun: LastRun? +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/NotificationHolderInterface.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/NotificationHolderInterface.kt new file mode 100644 index 0000000000..cbba8f326a --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/NotificationHolderInterface.kt @@ -0,0 +1,10 @@ +package info.nightscout.androidaps.interfaces + +import android.app.Notification + +interface NotificationHolderInterface { + val channelID : String + val notificationID : Int + var notification: Notification + +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/UploadQueueInterface.java b/core/src/main/java/info/nightscout/androidaps/interfaces/UploadQueueInterface.java new file mode 100644 index 0000000000..d051d43501 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/UploadQueueInterface.java @@ -0,0 +1,8 @@ +package info.nightscout.androidaps.interfaces; + +import info.nightscout.androidaps.db.DbRequest; + +public interface UploadQueueInterface { + + void add(DbRequest dbRequest); +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/DeviceStatus.java b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/DeviceStatus.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/DeviceStatus.java rename to core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/DeviceStatus.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java b/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java similarity index 66% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java rename to core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java index 48a2b31b35..85331b0f3a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSUpload.java @@ -1,31 +1,29 @@ package info.nightscout.androidaps.plugins.general.nsclient; +import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.content.pm.ResolveInfo; import android.os.Build; import android.os.Bundle; import androidx.annotation.Nullable; -import androidx.preference.PreferenceManager; import org.apache.commons.lang3.StringUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import org.slf4j.Logger; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.R; +import javax.inject.Singleton; + +import info.nightscout.androidaps.core.R; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.Profile; -import info.nightscout.androidaps.interfaces.ProfileStore; import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.DbRequest; @@ -33,27 +31,50 @@ import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.db.TemporaryBasal; +import info.nightscout.androidaps.interfaces.IobCobCalculatorInterface; +import info.nightscout.androidaps.interfaces.LoopInterface; +import info.nightscout.androidaps.interfaces.ProfileFunction; +import info.nightscout.androidaps.interfaces.ProfileStore; import info.nightscout.androidaps.interfaces.PumpInterface; +import info.nightscout.androidaps.interfaces.UploadQueueInterface; +import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.LTag; -import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; import info.nightscout.androidaps.plugins.aps.loop.APSResult; import info.nightscout.androidaps.plugins.aps.loop.DeviceStatus; -import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin; -import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.receivers.ReceiverStatusStore; import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.JsonHelper; -import info.nightscout.androidaps.utils.SP; +import info.nightscout.androidaps.utils.resources.ResourceHelper; +import info.nightscout.androidaps.utils.sharedPreferences.SP; /** * Created by mike on 26.05.2017. */ +@Singleton public class NSUpload { - private static Logger log = StacktraceLoggerWrapper.getLogger(LTag.NSCLIENT); - public static void uploadTempBasalStartAbsolute(TemporaryBasal temporaryBasal, Double originalExtendedAmount) { + private final AAPSLogger aapsLogger; + private final ResourceHelper resourceHelper; + private final SP sp; + private final Context context; + private final UploadQueueInterface uploadQueue; + + public NSUpload( + AAPSLogger aapsLogger, + ResourceHelper resourceHelper, + SP sp, + Context context, + UploadQueueInterface uploadQueue + ) { + this.aapsLogger = aapsLogger; + this.resourceHelper = resourceHelper; + this.sp = sp; + this.context = context; + this.uploadQueue = uploadQueue; + } + + public void uploadTempBasalStartAbsolute(TemporaryBasal temporaryBasal, Double originalExtendedAmount) { try { JSONObject data = new JSONObject(); data.put("eventType", CareportalEvent.TEMPBASAL); @@ -63,19 +84,18 @@ public class NSUpload { if (temporaryBasal.pumpId != 0) data.put("pumpId", temporaryBasal.pumpId); data.put("created_at", DateUtil.toISOString(temporaryBasal.date)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); if (originalExtendedAmount != null) data.put("originalExtendedAmount", originalExtendedAmount); // for back synchronization - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadTempBasalStartPercent(TemporaryBasal temporaryBasal, Profile profile) { + public void uploadTempBasalStartPercent(TemporaryBasal temporaryBasal, Profile profile) { try { - SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); - boolean useAbsolute = SP.getBoolean("ns_sync_use_absolute", false); + boolean useAbsolute = sp.getBoolean("ns_sync_use_absolute", false); double absoluteRate = 0; if (profile != null) { absoluteRate = profile.getBasal(temporaryBasal.date) * temporaryBasal.percentRate / 100d; @@ -97,31 +117,31 @@ public class NSUpload { if (temporaryBasal.pumpId != 0) data.put("pumpId", temporaryBasal.pumpId); data.put("created_at", DateUtil.toISOString(temporaryBasal.date)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadTempBasalEnd(long time, boolean isFakedTempBasal, long pumpId) { + public void uploadTempBasalEnd(long time, boolean isFakedTempBasal, long pumpId) { try { JSONObject data = new JSONObject(); data.put("eventType", CareportalEvent.TEMPBASAL); data.put("created_at", DateUtil.toISOString(time)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); if (isFakedTempBasal) data.put("isFakedTempBasal", isFakedTempBasal); if (pumpId != 0) data.put("pumpId", pumpId); - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadExtendedBolus(ExtendedBolus extendedBolus) { + public void uploadExtendedBolus(ExtendedBolus extendedBolus) { try { JSONObject data = new JSONObject(); data.put("eventType", CareportalEvent.COMBOBOLUS); @@ -133,14 +153,14 @@ public class NSUpload { if (extendedBolus.pumpId != 0) data.put("pumpId", extendedBolus.pumpId); data.put("created_at", DateUtil.toISOString(extendedBolus.date)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadExtendedBolusEnd(long time, long pumpId) { + public void uploadExtendedBolusEnd(long time, long pumpId) { try { JSONObject data = new JSONObject(); data.put("eventType", CareportalEvent.COMBOBOLUS); @@ -150,59 +170,59 @@ public class NSUpload { data.put("enteredinsulin", 0); data.put("relative", 0); data.put("created_at", DateUtil.toISOString(time)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); if (pumpId != 0) data.put("pumpId", pumpId); - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadDeviceStatus(LoopPlugin loopPlugin, IobCobCalculatorPlugin iobCobCalculatorPlugin, ProfileFunction profileFunction, PumpInterface pumpInterface, ReceiverStatusStore receiverStatusStore) { + public void uploadDeviceStatus(LoopInterface loopPlugin, IobCobCalculatorInterface iobCobCalculatorPlugin, ProfileFunction profileFunction, PumpInterface pumpInterface, ReceiverStatusStore receiverStatusStore) { Profile profile = profileFunction.getProfile(); String profileName = profileFunction.getProfileName(); if (profile == null) { - log.error("Profile is null. Skipping upload"); + aapsLogger.error("Profile is null. Skipping upload"); return; } DeviceStatus deviceStatus = new DeviceStatus(); try { - LoopPlugin.LastRun lastRun = loopPlugin.lastRun; - if (lastRun != null && lastRun.lastAPSRun > System.currentTimeMillis() - 300 * 1000L) { + LoopInterface.LastRun lastRun = loopPlugin.getLastRun(); + if (lastRun != null && lastRun.getLastAPSRun() > System.currentTimeMillis() - 300 * 1000L) { // do not send if result is older than 1 min - APSResult apsResult = lastRun.request; - apsResult.json().put("timestamp", DateUtil.toISOString(lastRun.lastAPSRun)); + APSResult apsResult = lastRun.getRequest(); + apsResult.json().put("timestamp", DateUtil.toISOString(lastRun.getLastAPSRun())); deviceStatus.suggested = apsResult.json(); - deviceStatus.iob = lastRun.request.iob.json(); - deviceStatus.iob.put("time", DateUtil.toISOString(lastRun.lastAPSRun)); + deviceStatus.iob = lastRun.getRequest().iob.json(); + deviceStatus.iob.put("time", DateUtil.toISOString(lastRun.getLastAPSRun())); JSONObject requested = new JSONObject(); - if (lastRun.tbrSetByPump != null && lastRun.tbrSetByPump.enacted) { // enacted - deviceStatus.enacted = lastRun.request.json(); - deviceStatus.enacted.put("rate", lastRun.tbrSetByPump.json(profile).get("rate")); - deviceStatus.enacted.put("duration", lastRun.tbrSetByPump.json(profile).get("duration")); + if (lastRun.getTbrSetByPump() != null && lastRun.getTbrSetByPump().enacted) { // enacted + deviceStatus.enacted = lastRun.getRequest().json(); + deviceStatus.enacted.put("rate", lastRun.getTbrSetByPump().json(profile).get("rate")); + deviceStatus.enacted.put("duration", lastRun.getTbrSetByPump().json(profile).get("duration")); deviceStatus.enacted.put("recieved", true); - requested.put("duration", lastRun.request.duration); - requested.put("rate", lastRun.request.rate); + requested.put("duration", lastRun.getRequest().duration); + requested.put("rate", lastRun.getRequest().rate); requested.put("temp", "absolute"); deviceStatus.enacted.put("requested", requested); } - if (lastRun.smbSetByPump != null && lastRun.smbSetByPump.enacted) { // enacted + if (lastRun.getTbrSetByPump() != null && lastRun.getTbrSetByPump().enacted) { // enacted if (deviceStatus.enacted == null) { - deviceStatus.enacted = lastRun.request.json(); + deviceStatus.enacted = lastRun.getRequest().json(); } - deviceStatus.enacted.put("smb", lastRun.smbSetByPump.bolusDelivered); - requested.put("smb", lastRun.request.smb); + deviceStatus.enacted.put("smb", lastRun.getTbrSetByPump().bolusDelivered); + requested.put("smb", lastRun.getRequest().smb); deviceStatus.enacted.put("requested", requested); } } else { if (L.isEnabled(LTag.NSCLIENT)) - log.debug("OpenAPS data too old to upload, sending iob only"); + aapsLogger.debug("OpenAPS data too old to upload, sending iob only"); IobTotal[] iob = iobCobCalculatorPlugin.calculateIobArrayInDia(profile); if (iob.length > 0) { deviceStatus.iob = iob[0].json(); @@ -219,13 +239,13 @@ public class NSUpload { deviceStatus.uploaderBattery = batteryLevel; deviceStatus.created_at = DateUtil.toISOString(new Date()); - UploadQueue.add(new DbRequest("dbAdd", "devicestatus", deviceStatus.mongoRecord())); + uploadQueue.add(new DbRequest("dbAdd", "devicestatus", deviceStatus.mongoRecord())); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadTreatmentRecord(DetailedBolusInfo detailedBolusInfo) { + public void uploadTreatmentRecord(DetailedBolusInfo detailedBolusInfo) { JSONObject data = new JSONObject(); try { data.put("eventType", detailedBolusInfo.eventType); @@ -248,21 +268,21 @@ public class NSUpload { data.put("notes", detailedBolusInfo.notes); } } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } uploadCareportalEntryToNS(data); } - public static void uploadProfileSwitch(ProfileSwitch profileSwitch) { + public void uploadProfileSwitch(ProfileSwitch profileSwitch) { try { JSONObject data = getJson(profileSwitch); uploadCareportalEntryToNS(data); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadTempTarget(TempTarget tempTarget, ProfileFunction profileFunction) { + public void uploadTempTarget(TempTarget tempTarget, ProfileFunction profileFunction) { try { JSONObject data = new JSONObject(); data.put("eventType", CareportalEvent.TEMPORARYTARGET); @@ -274,21 +294,21 @@ public class NSUpload { data.put("units", profileFunction.getUnits()); } data.put("created_at", DateUtil.toISOString(tempTarget.date)); - data.put("enteredBy", MainApp.gs(R.string.app_name)); + data.put("enteredBy", "AndroidAPS"); uploadCareportalEntryToNS(data); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void updateProfileSwitch(ProfileSwitch profileSwitch) { + public void updateProfileSwitch(ProfileSwitch profileSwitch) { try { JSONObject data = getJson(profileSwitch); if (profileSwitch._id != null) { - UploadQueue.add(new DbRequest("dbUpdate", "treatments", profileSwitch._id, data)); + uploadQueue.add(new DbRequest("dbUpdate", "treatments", profileSwitch._id, data)); } } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } @@ -305,12 +325,12 @@ public class NSUpload { data.put("percentage", profileSwitch.percentage); } data.put("created_at", DateUtil.toISOString(profileSwitch.date)); - data.put("enteredBy", MainApp.gs(R.string.app_name)); + data.put("enteredBy", "AndroidAPS"); return data; } - public static void uploadCareportalEntryToNS(JSONObject data) { + public void uploadCareportalEntryToNS(JSONObject data) { try { if (data.has("preBolus") && data.has("carbs")) { JSONObject prebolus = new JSONObject(); @@ -325,48 +345,48 @@ public class NSUpload { uploadCareportalEntryToNS(prebolus); } DbRequest dbr = new DbRequest("dbAdd", "treatments", data); - log.debug("Prepared: " + dbr.log()); - UploadQueue.add(dbr); + aapsLogger.debug("Prepared: " + dbr.log()); + uploadQueue.add(dbr); } catch (Exception e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void removeCareportalEntryFromNS(String _id) { - UploadQueue.add(new DbRequest("dbRemove", "treatments", _id)); + public void removeCareportalEntryFromNS(String _id) { + uploadQueue.add(new DbRequest("dbRemove", "treatments", _id)); } - public static void uploadOpenAPSOffline(CareportalEvent event) { + public void uploadOpenAPSOffline(CareportalEvent event) { try { JSONObject data = new JSONObject(event.json); data.put("created_at", DateUtil.toISOString(event.date)); - data.put("enteredBy", "openaps://" + MainApp.gs(R.string.app_name)); - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + data.put("enteredBy", "openaps://" + "AndroidAPS"); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void uploadError(String error) { + public void uploadError(String error) { uploadError(error, new Date()); } - public static void uploadError(String error, Date date) { + public void uploadError(String error, Date date) { JSONObject data = new JSONObject(); try { data.put("eventType", "Announcement"); data.put("created_at", DateUtil.toISOString(date)); - data.put("enteredBy", SP.getString("careportal_enteredby", MainApp.gs(R.string.app_name))); + data.put("enteredBy", sp.getString("careportal_enteredby", "AndroidAPS")); data.put("notes", error); data.put("isAnnouncement", true); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } - public static void uploadBg(BgReading reading, String source) { + public void uploadBg(BgReading reading, String source) { JSONObject data = new JSONObject(); try { data.put("device", source); @@ -376,56 +396,56 @@ public class NSUpload { data.put("direction", reading.direction); data.put("type", "sgv"); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } - UploadQueue.add(new DbRequest("dbAdd", "entries", data)); + uploadQueue.add(new DbRequest("dbAdd", "entries", data)); } - public static void uploadAppStart() { - if (SP.getBoolean(R.string.key_ns_logappstartedevent, true)) { + public void uploadAppStart() { + if (sp.getBoolean(R.string.key_ns_logappstartedevent, true)) { JSONObject data = new JSONObject(); try { data.put("eventType", "Note"); data.put("created_at", DateUtil.toISOString(new Date())); - data.put("notes", MainApp.gs(R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL); + data.put("notes", resourceHelper.gs(R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL); } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } } - public static void uploadProfileStore(JSONObject profileStore) { - if (SP.getBoolean(R.string.key_ns_uploadlocalprofile, false)) { - UploadQueue.add(new DbRequest("dbAdd", "profile", profileStore)); + public void uploadProfileStore(JSONObject profileStore) { + if (sp.getBoolean(R.string.key_ns_uploadlocalprofile, false)) { + uploadQueue.add(new DbRequest("dbAdd", "profile", profileStore)); } } - public static void uploadEvent(String careportalEvent, long time, @Nullable String notes) { + public void uploadEvent(String careportalEvent, long time, @Nullable String notes) { JSONObject data = new JSONObject(); try { data.put("eventType", careportalEvent); data.put("created_at", DateUtil.toISOString(time)); - data.put("enteredBy", SP.getString("careportal_enteredby", MainApp.gs(R.string.app_name))); + data.put("enteredBy", sp.getString("careportal_enteredby", "AndroidAPS")); if (notes != null) { data.put("notes", notes); } } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } - UploadQueue.add(new DbRequest("dbAdd", "treatments", data)); + uploadQueue.add(new DbRequest("dbAdd", "treatments", data)); } - public static void removeFoodFromNS(String _id) { + public void removeFoodFromNS(String _id) { try { - UploadQueue.add(new DbRequest("dbRemove", "food", _id)); + uploadQueue.add(new DbRequest("dbRemove", "food", _id)); } catch (Exception e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void sendToXdrip(BgReading bgReading) { + public void sendToXdrip(BgReading bgReading) { final String XDRIP_PLUS_NS_EMULATOR = "com.eveningoutpost.dexdrip.NS_EMULATOR"; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US); @@ -450,22 +470,22 @@ public class NSUpload { bundle.putString("data", entriesBody.toString()); final Intent intent = new Intent(XDRIP_PLUS_NS_EMULATOR); intent.putExtras(bundle).addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); - MainApp.instance().sendBroadcast(intent); - List receivers = MainApp.instance().getPackageManager().queryBroadcastReceivers(intent, 0); + context.sendBroadcast(intent); + List receivers = context.getPackageManager().queryBroadcastReceivers(intent, 0); if (receivers.size() < 1) { - log.debug("No xDrip receivers found. "); + aapsLogger.debug("No xDrip receivers found. "); } else { - log.debug(receivers.size() + " xDrip receivers"); + aapsLogger.debug(receivers.size() + " xDrip receivers"); } } catch (JSONException e) { - log.error("Unhandled exception", e); + aapsLogger.error("Unhandled exception", e); } } - public static void createNSTreatment(JSONObject data, ProfileStore profileStore, ProfileFunction profileFunction, long eventTime) { + public void createNSTreatment(JSONObject data, ProfileStore profileStore, ProfileFunction profileFunction, long eventTime) { if (JsonHelper.safeGetString(data, "eventType", "").equals(CareportalEvent.PROFILESWITCH)) { ProfileSwitch profileSwitch = profileFunction.prepareProfileSwitch( profileStore, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt rename to core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventOverviewBolusProgress.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventOverviewBolusProgress.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventOverviewBolusProgress.kt rename to core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventOverviewBolusProgress.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt rename to core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt index 51a63f62bb..b74fc2ac00 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt @@ -2,9 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.logging.AAPSLogger -import info.nightscout.androidaps.logging.L import info.nightscout.androidaps.logging.LTag -import info.nightscout.androidaps.logging.StacktraceLoggerWrapper import info.nightscout.androidaps.utils.T import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt b/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt rename to core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt b/core/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt rename to core/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt diff --git a/app/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt rename to core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt index 0d261b5071..140cfda5b4 100644 --- a/app/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt +++ b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt @@ -6,17 +6,17 @@ import android.media.AudioManager import android.media.MediaPlayer import android.os.IBinder import dagger.android.DaggerService -import info.nightscout.androidaps.R +import info.nightscout.androidaps.core.R +import info.nightscout.androidaps.interfaces.NotificationHolderInterface import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag -import info.nightscout.androidaps.utils.androidNotification.NotificationHolder import info.nightscout.androidaps.utils.resources.ResourceHelper import javax.inject.Inject class AlarmSoundService : DaggerService() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var resourceHelper: ResourceHelper - @Inject lateinit var notificationHolder: NotificationHolder + @Inject lateinit var notificationHolder: NotificationHolderInterface private var player: MediaPlayer? = null private var resourceId = R.raw.error diff --git a/app/src/main/java/info/nightscout/androidaps/utils/StringUtils.java b/core/src/main/java/info/nightscout/androidaps/utils/StringUtils.java similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/utils/StringUtils.java rename to core/src/main/java/info/nightscout/androidaps/utils/StringUtils.java index ebd31dea17..01b92a680f 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/StringUtils.java +++ b/core/src/main/java/info/nightscout/androidaps/utils/StringUtils.java @@ -1,8 +1,5 @@ package info.nightscout.androidaps.utils; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.R; - /** * class contains useful String functions */ diff --git a/app/src/main/java/info/nightscout/androidaps/utils/extensions/HexByteArrayConversion.kt b/core/src/main/java/info/nightscout/androidaps/utils/extensions/HexByteArrayConversion.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/extensions/HexByteArrayConversion.kt rename to core/src/main/java/info/nightscout/androidaps/utils/extensions/HexByteArrayConversion.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt index 21146a9a72..2956a8d2b8 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt @@ -7,7 +7,7 @@ import android.text.TextUtils import android.text.TextWatcher import android.widget.EditText import com.google.android.material.textfield.TextInputLayout -import info.nightscout.androidaps.R +import info.nightscout.androidaps.core.R import info.nightscout.androidaps.utils.textValidator.validators.* class DefaultEditTextValidator : EditTextValidator { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.java b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.java rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.java diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt index 6130d7acf6..ae75641b4c 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt @@ -6,7 +6,7 @@ import android.util.AttributeSet import androidx.preference.EditTextPreference import androidx.preference.EditTextPreference.OnBindEditTextListener import androidx.preference.PreferenceViewHolder -import info.nightscout.androidaps.R +import info.nightscout.androidaps.core.R class ValidatingEditTextPreference(ctx: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : EditTextPreference(ctx, attrs, defStyleAttr, defStyleRes) { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt diff --git a/app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt rename to core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt diff --git a/app/src/main/res/layout/dialog_bolusprogress.xml b/core/src/main/res/layout/dialog_bolusprogress.xml similarity index 100% rename from app/src/main/res/layout/dialog_bolusprogress.xml rename to core/src/main/res/layout/dialog_bolusprogress.xml diff --git a/app/src/main/res/layout/dialog_error.xml b/core/src/main/res/layout/dialog_error.xml similarity index 100% rename from app/src/main/res/layout/dialog_error.xml rename to core/src/main/res/layout/dialog_error.xml diff --git a/app/src/main/res/layout/okcancel.xml b/core/src/main/res/layout/okcancel.xml similarity index 100% rename from app/src/main/res/layout/okcancel.xml rename to core/src/main/res/layout/okcancel.xml diff --git a/app/src/main/res/raw/error.mp3 b/core/src/main/res/raw/error.mp3 similarity index 100% rename from app/src/main/res/raw/error.mp3 rename to core/src/main/res/raw/error.mp3 diff --git a/app/src/main/res/values/fet_attrs.xml b/core/src/main/res/values/fet_attrs.xml similarity index 100% rename from app/src/main/res/values/fet_attrs.xml rename to core/src/main/res/values/fet_attrs.xml diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index b69a63c11c..2842da7183 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -17,6 +17,34 @@ hypo_target low_mark high_mark + ns_create_announcements_from_errors + ns_logappstartedevent + ns_uploadlocalprofile + + + Error + Not set + Failed to update basal profile + Basal profile in pump updated + Invalid input data + Tempbasal delivery error + Going to deliver %1$.2fU + Waiting for pump + Connecting for %1$d s + Handshaking + Connecting + Connected + Disconnected + Disconnecting + AndroidAPS started + + + Limiting max basal rate to %1$.2f U/h because of %2$s + pump limit + Limiting max percent rate to %1$d%% because of %2$s + it must be positive value + Limiting bolus to %1$.1f U because of %2$s + Pump not initialized, profile not set! Confirmation diff --git a/app/src/main/res/values/validator.xml b/core/src/main/res/values/validator.xml similarity index 100% rename from app/src/main/res/values/validator.xml rename to core/src/main/res/values/validator.xml diff --git a/danars/build.gradle b/danars/build.gradle index 96753367b4..a80ef58dfb 100644 --- a/danars/build.gradle +++ b/danars/build.gradle @@ -50,9 +50,12 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.2.0' + implementation "androidx.preference:preference-ktx:1.1.1" implementation "androidx.activity:activity:${activityVersion}" implementation "androidx.activity:activity-ktx:${activityVersion}" + // Graphview cannot be upgraded + implementation "com.jjoe64:graphview:4.0.1" implementation "com.google.dagger:dagger-android:$dagger_version" implementation "com.google.dagger:dagger-android-support:$dagger_version" diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRFragment.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRFragment.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRFragment.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRFragment.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/RecordTypes.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/RecordTypes.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/RecordTypes.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/comm/RecordTypes.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/events/EventDanaRNewStatus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/events/EventDanaRNewStatus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/events/EventDanaRNewStatus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/events/EventDanaRNewStatus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt index 8eb3b26d4e..2cf3e44656 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.kt @@ -8,8 +8,7 @@ import android.os.IBinder import android.text.format.DateFormat import androidx.preference.Preference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.R +import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.data.PumpEnactResult @@ -34,7 +33,6 @@ import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes import info.nightscout.androidaps.plugins.pump.danaRS.events.EventDanaRSDeviceChange import info.nightscout.androidaps.plugins.pump.danaRS.services.DanaRSService -import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP @@ -56,13 +54,14 @@ class DanaRSPlugin @Inject constructor( resourceHelper: ResourceHelper, private val constraintChecker: ConstraintChecker, private val profileFunction: ProfileFunction, - private val treatmentsPlugin: TreatmentsPlugin, + private val activePluginProvider: ActivePluginProvider, private val sp: SP, commandQueue: CommandQueueProvider, private val danaRPump: DanaRPump, private val detailedBolusInfoStorage: DetailedBolusInfoStorage, private val fabricPrivacy: FabricPrivacy, - private val dateUtil: DateUtil + private val dateUtil: DateUtil, + private val config: ConfigInterface ) : PumpPluginBase(PluginDescription() .mainType(PluginType.PUMP) .fragmentClass(DanaRFragment::class.java.name) @@ -85,7 +84,7 @@ class DanaRSPlugin @Inject constructor( if (pref.key == resourceHelper.gs(R.string.key_danars_name)) { val value = sp.getStringOrNull(R.string.key_danars_name, null) pref.summary = value - ?: resourceHelper.gs(R.string.rileylink_error_address_not_set_short) + ?: resourceHelper.gs(R.string.not_set_short) } } @@ -320,7 +319,7 @@ class DanaRSPlugin @Inject constructor( 0x80 -> error = resourceHelper.gs(R.string.insulinlimitviolation) } result.comment = String.format(resourceHelper.gs(R.string.boluserrorcode), detailedBolusInfo.insulin, t.insulin, error) - } else result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + } else result.comment = resourceHelper.gs(R.string.ok) aapsLogger.debug(LTag.PUMP, "deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.bolusDelivered) result } else { @@ -328,7 +327,7 @@ class DanaRSPlugin @Inject constructor( result.success = false result.bolusDelivered = 0.0 result.carbsDelivered = 0.0 - result.comment = resourceHelper.gs(R.string.danar_invalidinput) + result.comment = resourceHelper.gs(R.string.invalidinput) aapsLogger.error("deliverTreatment: Invalid input") result } @@ -348,7 +347,7 @@ class DanaRSPlugin @Inject constructor( val doHighTemp = absoluteAfterConstrain > baseBasalRate if (doTempOff) { // If temp in progress - if (treatmentsPlugin.isTempBasalInProgress) { + if (activePluginProvider.activeTreatments.isTempBasalInProgress) { aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Stopping temp basal (doTempOff)") return cancelTempBasal(false) } @@ -366,7 +365,7 @@ class DanaRSPlugin @Inject constructor( if (percentRate > 500) // Special high temp 500/15min percentRate = 500 // Check if some temp is already in progress - val activeTemp = treatmentsPlugin.getTempBasalFromHistory(System.currentTimeMillis()) + val activeTemp = activePluginProvider.activeTreatments.getTempBasalFromHistory(System.currentTimeMillis()) if (activeTemp != null) { aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: currently running: $activeTemp") // Correct basal already set ? @@ -413,18 +412,18 @@ class DanaRSPlugin @Inject constructor( result.isTempCancel = false result.enacted = false result.success = false - result.comment = resourceHelper.gs(R.string.danar_invalidinput) + result.comment = resourceHelper.gs(R.string.invalidinput) aapsLogger.error("setTempBasalPercent: Invalid input") return result } if (percentAfterConstraint > pumpDescription.maxTempPercent) percentAfterConstraint = pumpDescription.maxTempPercent val now = System.currentTimeMillis() - val activeTemp = treatmentsPlugin.getTempBasalFromHistory(now) + val activeTemp = activePluginProvider.activeTreatments.getTempBasalFromHistory(now) if (activeTemp != null && activeTemp.percentRate == percentAfterConstraint && activeTemp.plannedRemainingMinutes > 4 && !enforceNew) { result.enacted = false result.success = true result.isTempCancel = false - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) result.duration = danaRPump.tempBasalRemainingMin result.percent = danaRPump.tempBasalPercent result.isPercent = true @@ -442,7 +441,7 @@ class DanaRSPlugin @Inject constructor( if (connectionOK && danaRPump.isTempBasalInProgress && danaRPump.tempBasalPercent == percentAfterConstraint) { result.enacted = true result.success = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) result.isTempCancel = false result.duration = danaRPump.tempBasalRemainingMin result.percent = danaRPump.tempBasalPercent @@ -463,7 +462,7 @@ class DanaRSPlugin @Inject constructor( if (connectionOK && danaRPump.isTempBasalInProgress && danaRPump.tempBasalPercent == percent) { result.enacted = true result.success = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) result.isTempCancel = false result.duration = danaRPump.tempBasalRemainingMin result.percent = danaRPump.tempBasalPercent @@ -485,11 +484,11 @@ class DanaRSPlugin @Inject constructor( val durationInHalfHours = max(durationInMinutes / 30, 1) insulinAfterConstraint = Round.roundTo(insulinAfterConstraint, pumpDescription.extendedBolusStep) val result = PumpEnactResult(injector) - val runningEB = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis()) + val runningEB = activePluginProvider.activeTreatments.getExtendedBolusFromHistory(System.currentTimeMillis()) if (runningEB != null && abs(runningEB.insulin - insulinAfterConstraint) < pumpDescription.extendedBolusStep) { result.enacted = false result.success = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) result.duration = danaRPump.extendedBolusRemainingMinutes result.absolute = danaRPump.extendedBolusAbsoluteRate result.isPercent = false @@ -502,7 +501,7 @@ class DanaRSPlugin @Inject constructor( if (connectionOK && danaRPump.isExtendedInProgress && abs(danaRPump.extendedBolusAbsoluteRate - insulinAfterConstraint) < pumpDescription.extendedBolusStep) { result.enacted = true result.success = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) result.isTempCancel = false result.duration = danaRPump.extendedBolusRemainingMinutes result.absolute = danaRPump.extendedBolusAbsoluteRate @@ -521,7 +520,7 @@ class DanaRSPlugin @Inject constructor( @Synchronized override fun cancelTempBasal(force: Boolean): PumpEnactResult { val result = PumpEnactResult(injector) - val runningTB = treatmentsPlugin.getTempBasalFromHistory(System.currentTimeMillis()) + val runningTB = activePluginProvider.activeTreatments.getTempBasalFromHistory(System.currentTimeMillis()) if (runningTB != null) { danaRSService?.tempBasalStop() result.enacted = true @@ -530,7 +529,7 @@ class DanaRSPlugin @Inject constructor( return if (!danaRPump.isTempBasalInProgress) { result.success = true result.isTempCancel = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK") result } else { @@ -544,7 +543,7 @@ class DanaRSPlugin @Inject constructor( @Synchronized override fun cancelExtendedBolus(): PumpEnactResult { val result = PumpEnactResult(injector) - val runningEB = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis()) + val runningEB = activePluginProvider.activeTreatments.getExtendedBolusFromHistory(System.currentTimeMillis()) if (runningEB != null) { danaRSService?.extendedBolusStop() result.enacted = true @@ -552,7 +551,7 @@ class DanaRSPlugin @Inject constructor( } return if (!danaRPump.isExtendedInProgress) { result.success = true - result.comment = resourceHelper.gs(R.string.virtualpump_resultok) + result.comment = resourceHelper.gs(R.string.ok) aapsLogger.debug(LTag.PUMP, "cancelExtendedBolus: OK") result } else { @@ -581,13 +580,13 @@ class DanaRSPlugin @Inject constructor( extended.put("LastBolus", dateUtil.dateAndTimeString(danaRPump.lastBolusTime)) extended.put("LastBolusAmount", danaRPump.lastBolusAmount) } - val tb = treatmentsPlugin.getTempBasalFromHistory(now) + val tb = activePluginProvider.activeTreatments.getTempBasalFromHistory(now) if (tb != null) { extended.put("TempBasalAbsoluteRate", tb.tempBasalConvertedToAbsolute(now, profile)) extended.put("TempBasalStart", dateUtil.dateAndTimeString(tb.date)) extended.put("TempBasalRemaining", tb.plannedRemainingMinutes) } - val eb = treatmentsPlugin.getExtendedBolusFromHistory(now) + val eb = activePluginProvider.activeTreatments.getExtendedBolusFromHistory(now) if (eb != null) { extended.put("ExtendedBolusAbsoluteRate", eb.absoluteRate()) extended.put("ExtendedBolusStart", dateUtil.dateAndTimeString(eb.date)) @@ -636,11 +635,11 @@ class DanaRSPlugin @Inject constructor( if (danaRPump.lastBolusTime != 0L) ret += "LastBolus: ${DecimalFormatter.to2Decimal(danaRPump.lastBolusAmount)}U @${DateFormat.format("HH:mm", danaRPump.lastBolusTime)}" - val activeTemp = treatmentsPlugin.getRealTempBasalFromHistory(System.currentTimeMillis()) + val activeTemp = activePluginProvider.activeTreatments.getRealTempBasalFromHistory(System.currentTimeMillis()) if (activeTemp != null) ret += "Temp: ${activeTemp.toStringFull()}" - val activeExtendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis()) + val activeExtendedBolus = activePluginProvider.activeTreatments.getExtendedBolusFromHistory(System.currentTimeMillis()) if (activeExtendedBolus != null) ret += "Extended: $activeExtendedBolus\n" diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt index 13eebbaa0e..2c25053da2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/activities/EnterPinActivity.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.danaRS.activities import android.os.Bundle import android.util.Base64 -import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.NoSplashAppCompatActivity +import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin @@ -56,7 +56,7 @@ class EnterPinActivity : NoSplashAppCompatActivity() { bleComm.finishV3Pairing() finish() } - else OKDialog.show(this, resourceHelper.gs(R.string.error), resourceHelper.gs(R.string.danar_invalidinput)) + else OKDialog.show(this, resourceHelper.gs(R.string.error), resourceHelper.gs(R.string.invalidinput)) } } cancel.setOnClickListener { finish() } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTable.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTable.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTable.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTable.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet.java b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet.java rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_Basal.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_Basal.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_Basal.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_Basal.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt index 676290cbba..3427c46b2a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_Events.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R +import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.db.CareportalEvent import info.nightscout.androidaps.db.ExtendedBolus @@ -195,7 +195,7 @@ open class DanaRS_Packet_APS_History_Events( status = "PRIMECANNULA " + dateUtil.timeString(datetime) } - else -> { + else -> { aapsLogger.debug(LTag.PUMPCOMM, "Event: " + recordCode + " " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Param1: " + param1 + " Param2: " + param2) status = "UNKNOWN " + dateUtil.timeString(datetime) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_History.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_History.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_History.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_History.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt index b25bc2c587..76dde13995 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_Rate.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R +import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Basal_Rate.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Basal_Rate.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Basal_Rate.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Basal_Rate.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Number.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Number.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Number.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_Number.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_State.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_State.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_State.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_State.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Basal_Rate.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Basal_Rate.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Basal_Rate.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Basal_Rate.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Cancel_Temporary_Basal.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Cancel_Temporary_Basal.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Cancel_Temporary_Basal.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Cancel_Temporary_Basal.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Basal_Rate.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Basal_Rate.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Basal_Rate.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Basal_Rate.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Number.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Number.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Number.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Profile_Number.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_Off.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_Off.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_Off.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_Off.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_On.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_On.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_On.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Suspend_On.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Temporary_Basal.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Temporary_Basal.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Temporary_Basal.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Set_Temporary_Basal.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt index 432f0792dd..252ce8761a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R +import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_CIR_CF_Array.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Calculation_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Calculation_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Calculation_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Calculation_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Dual_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Dual_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Dual_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Dual_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus_State.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus_State.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus_State.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Bolus_State.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Menu_Option_State.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Menu_Option_State.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Menu_Option_State.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Extended_Menu_Option_State.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Initial_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Initial_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Initial_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Initial_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Step_Bolus_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Step_Bolus_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Step_Bolus_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Get_Step_Bolus_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Bolus_Option.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Bolus_Option.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Bolus_Option.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Bolus_Option.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_CIR_CF_Array.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Dual_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Dual_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Dual_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Dual_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Initial_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Initial_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Initial_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Initial_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Start.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Start.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Start.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Start.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_Stop.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Keep_Connection.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Keep_Connection.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Keep_Connection.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Keep_Connection.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Set_History_Save.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Set_History_Save.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Set_History_Save.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Etc_Set_History_Save.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Delivery_Status.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Delivery_Status.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Delivery_Status.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Delivery_Status.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_More_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_More_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_More_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_More_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Password.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Password.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Password.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Password.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Pump_Check.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Pump_Check.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Pump_Check.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Pump_Check.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Version.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Version.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Version.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Shipping_Version.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Today_Delivery_Total.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Today_Delivery_Total.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Today_Delivery_Total.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_Today_Delivery_Total.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_User_Time_Change_Flag.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_User_Time_Change_Flag.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_User_Time_Change_Flag.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Get_User_Time_Change_Flag.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Initial_Screen_Information.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Initial_Screen_Information.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Initial_Screen_Information.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Initial_Screen_Information.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_History_Upload_Mode.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_History_Upload_Mode.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_History_Upload_Mode.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_History_Upload_Mode.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_User_Time_Change_Flag_Clear.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_User_Time_Change_Flag_Clear.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_User_Time_Change_Flag_Clear.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_General_Set_User_Time_Change_Flag_Clear.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Alarm.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Alarm.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Alarm.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Alarm.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_All_History.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_All_History.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_All_History.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_All_History.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Basal.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Basal.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Basal.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Basal.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Blood_Glucose.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Blood_Glucose.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Blood_Glucose.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Blood_Glucose.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Bolus.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Bolus.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Bolus.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Bolus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Carbohydrate.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Carbohydrate.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Carbohydrate.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Carbohydrate.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Daily.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Daily.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Daily.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Daily.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Prime.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Prime.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Prime.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Prime.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Refill.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Refill.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Refill.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Refill.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Suspend.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Suspend.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Suspend.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Suspend.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Temporary.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Temporary.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Temporary.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_History_Temporary.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Alarm.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Alarm.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Alarm.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Alarm.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Complete.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Complete.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Complete.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Complete.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Rate_Display.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Rate_Display.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Rate_Display.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_Rate_Display.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Missed_Bolus_Alarm.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_Pump_Time.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_Pump_Time.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_Pump_Time.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_Pump_Time.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_User_Option.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_User_Option.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_User_Option.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Get_User_Option.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_Pump_Time.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_Pump_Time.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_Pump_Time.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_Pump_Time.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_User_Option.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_User_Option.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_User_Option.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Option_Set_User_Option.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Bolus_Avg.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Bolus_Avg.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Bolus_Avg.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Bolus_Avg.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Review_Get_Pump_Dec_Ratio.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/encryption/BleEncryption.java b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/encryption/BleEncryption.java similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/encryption/BleEncryption.java rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/encryption/BleEncryption.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/BLEComm.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/BLEComm.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/BLEComm.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/BLEComm.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt rename to danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt index c40eda80fb..43dc6eb34e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt +++ b/danars/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/services/DanaRSService.kt @@ -9,7 +9,6 @@ import android.os.SystemClock import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.Constants -import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.data.PumpEnactResult diff --git a/app/src/main/jniLibs/arm64-v8a/libBleEncryption.so b/danars/src/main/jniLibs/arm64-v8a/libBleEncryption.so similarity index 100% rename from app/src/main/jniLibs/arm64-v8a/libBleEncryption.so rename to danars/src/main/jniLibs/arm64-v8a/libBleEncryption.so diff --git a/app/src/main/jniLibs/armeabi-v7a/libBleEncryption.so b/danars/src/main/jniLibs/armeabi-v7a/libBleEncryption.so similarity index 100% rename from app/src/main/jniLibs/armeabi-v7a/libBleEncryption.so rename to danars/src/main/jniLibs/armeabi-v7a/libBleEncryption.so diff --git a/app/src/main/jniLibs/x86/libBleEncryption.so b/danars/src/main/jniLibs/x86/libBleEncryption.so similarity index 100% rename from app/src/main/jniLibs/x86/libBleEncryption.so rename to danars/src/main/jniLibs/x86/libBleEncryption.so diff --git a/app/src/main/jniLibs/x86_64/libBleEncryption.so b/danars/src/main/jniLibs/x86_64/libBleEncryption.so similarity index 100% rename from app/src/main/jniLibs/x86_64/libBleEncryption.so rename to danars/src/main/jniLibs/x86_64/libBleEncryption.so diff --git a/app/src/main/res/layout/danars_enter_pin_activity.xml b/danars/src/main/res/layout/danars_enter_pin_activity.xml similarity index 100% rename from app/src/main/res/layout/danars_enter_pin_activity.xml rename to danars/src/main/res/layout/danars_enter_pin_activity.xml diff --git a/danars/src/main/res/values/strings.xml b/danars/src/main/res/values/strings.xml index 5cef8b70b6..73b38830ee 100644 --- a/danars/src/main/res/values/strings.xml +++ b/danars/src/main/res/values/strings.xml @@ -4,13 +4,28 @@ danars_name danar_password danars_password + danars_bolusspeed + danars_pairing_key_ + danars_v3_randompairing_key_ + danars_v3_pairing_key_ + danars_v3_randomsync_key_ + rs_logcanulachange + rs_loginsulinchange Pairing No device found so far Pairing OK Pairing timed out Waiting for pairing on pump - OK - Cancel + DanaRS + Dana + Pump integration for DANA Diabecare RS pumps + Max bolus violation + Command error + Speed error + Insulin limit violation + Asked: %1$.2fU Delivered: %2$.2fU Error code: %3$s + Value not set properly + Set basal step to 0.01 U/h diff --git a/app/src/main/res/xml/pref_danars.xml b/danars/src/main/res/xml/pref_danars.xml similarity index 100% rename from app/src/main/res/xml/pref_danars.xml rename to danars/src/main/res/xml/pref_danars.xml