Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class CommandQueueImplementation @Inject constructor(

@Synchronized
private fun add(command: Command) {
aapsLogger.debug(LTag.PUMPQUEUE, "Adding: " + command.javaClass.simpleName + " - " + command.status())
aapsLogger.debug(LTag.PUMPQUEUE, "Adding: " + command.javaClass.simpleName + " - " + command.log())
synchronized(queue) { queue.add(command) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class QueueThread internal constructor(
if (queue.size() > 0) {
queue.pickup()
val cont = queue.performing()?.let {
aapsLogger.debug(LTag.PUMPQUEUE, "performing " + it.status())
aapsLogger.debug(LTag.PUMPQUEUE, "performing " + it.log())
rxBus.send(EventQueueChanged())
rxBus.send(EventPumpStatusChanged(it.status()))
it.execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ class CommandBolus(
return (if (detailedBolusInfo.insulin > 0) rh.gs(R.string.bolus_u_min, detailedBolusInfo.insulin) else "") +
if (detailedBolusInfo.carbs > 0) rh.gs(R.string.carbs_g, detailedBolusInfo.carbs.toInt()) else ""
}

override fun log(): String {
return (if (detailedBolusInfo.insulin > 0) "BOLUS " + rh.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin) else "") +
if (detailedBolusInfo.carbs > 0) "CARBS " + rh.gs(R.string.format_carbs, detailedBolusInfo.carbs.toInt()) else ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ class CommandCancelExtendedBolus constructor(
}

override fun status(): String = rh.gs(R.string.uel_cancel_extended_bolus)

override fun log(): String = "CANCEL EXTENDEDBOLUS"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ class CommandCancelTempBasal(
}

override fun status(): String = rh.gs(R.string.uel_accepts_temp_basal)

override fun log(): String = "CANCEL TEMPBASAL"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CommandCustomCommand(
callback?.result(result)?.run()
}

override fun status(): String {
return customCommand.statusDescription
}
override fun status(): String = customCommand.statusDescription

override fun log(): String = customCommand.statusDescription
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ class CommandExtendedBolus constructor(
}

override fun status(): String = rh.gs(R.string.extended_bolus_u_min, insulin, durationInMinutes)

override fun log(): String = "EXTENDEDBOLUS $insulin U $durationInMinutes min"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ class CommandInsightSetTBROverNotification constructor(

@Suppress("SpellCheckingInspection")
override fun status(): String = rh.gs(R.string.insight_set_tbr_over_notification)

override fun log(): String = "INSIGHTSETTBROVERNOTIFICATION"
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ class CommandLoadEvents(
}

override fun status(): String = rh.gs(R.string.load_events)

override fun log(): String = "LOAD EVENTS"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ class CommandLoadHistory(
}

override fun status(): String = rh.gs(R.string.load_history, type.toInt())

override fun log(): String = "LOAD HISTORY $type"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ class CommandLoadTDDs(
}

override fun status(): String = rh.gs(R.string.load_tdds)

override fun log(): String = "LOAD TDDs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ class CommandReadStatus(
}

override fun status(): String = rh.gs(R.string.read_status, reason)

override fun log(): String = "READSTATUS $reason"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ class CommandSMBBolus(
}

override fun status(): String = rh.gs(R.string.smb_bolus_u, detailedBolusInfo.insulin)

override fun log(): String = "SMB BOLUS ${rh.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin)}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ class CommandSetProfile constructor(
}

override fun status(): String = rh.gs(R.string.set_profile)

override fun log(): String = "SET PROFILE"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ class CommandSetUserSettings(
}

override fun status(): String = rh.gs(R.string.set_user_settings)

override fun log(): String = "SET USER SETTINGS"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ class CommandStartPump(
}

override fun status(): String = rh.gs(R.string.start_pump)

override fun log(): String = "START PUMP"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ class CommandStopPump(
}

override fun status(): String = rh.gs(R.string.stop_pump)

override fun log(): String = "STOP PUMP"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ class CommandTempBasalAbsolute(
}

override fun status(): String = rh.gs(R.string.temp_basal_absolute, absoluteRate, durationInMinutes)

override fun log(): String = "TEMP BASAL $absoluteRate U/h $durationInMinutes min"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ class CommandTempBasalPercent(
}

override fun status(): String = rh.gs(R.string.temp_basal_percent, percent, durationInMinutes)

override fun log(): String = "TEMP BASAL $percent% $durationInMinutes min"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ abstract class Command(

abstract fun execute()
abstract fun status(): String
abstract fun log(): String

fun cancel() {
val result = PumpEnactResult(injector)
Expand Down