model string

This commit is contained in:
Milos Kozak 2020-04-20 21:28:29 +02:00
parent 164a092857
commit e526ad4617
2 changed files with 20 additions and 20 deletions

View file

@ -178,7 +178,7 @@ class DanaRFragment : DaggerFragment() {
if (pump.lastConnection != 0L) { if (pump.lastConnection != 0L) {
val agoMsec = System.currentTimeMillis() - pump.lastConnection val agoMsec = System.currentTimeMillis() - pump.lastConnection
val agoMin = (agoMsec.toDouble() / 60.0 / 1000.0).toInt() val agoMin = (agoMsec.toDouble() / 60.0 / 1000.0).toInt()
danar_lastconnection.text = DateUtil.timeString(pump.lastConnection) + " (" + resourceHelper.gs(R.string.minago, agoMin) + ")" danar_lastconnection?.text = DateUtil.timeString(pump.lastConnection) + " (" + resourceHelper.gs(R.string.minago, agoMin) + ")"
SetWarnColor.setColor(danar_lastconnection, agoMin.toDouble(), 16.0, 31.0) SetWarnColor.setColor(danar_lastconnection, agoMin.toDouble(), 16.0, 31.0)
} }
if (pump.lastBolusTime != 0L) { if (pump.lastBolusTime != 0L) {
@ -186,46 +186,46 @@ class DanaRFragment : DaggerFragment() {
val agoHours = agoMsec.toDouble() / 60.0 / 60.0 / 1000.0 val agoHours = agoMsec.toDouble() / 60.0 / 60.0 / 1000.0
if (agoHours < 6) if (agoHours < 6)
// max 6h back // max 6h back
danar_lastbolus.text = DateUtil.timeString(pump.lastBolusTime) + " " + DateUtil.sinceString(pump.lastBolusTime, resourceHelper) + " " + resourceHelper.gs(R.string.formatinsulinunits, pump.lastBolusAmount) danar_lastbolus?.text = DateUtil.timeString(pump.lastBolusTime) + " " + DateUtil.sinceString(pump.lastBolusTime, resourceHelper) + " " + resourceHelper.gs(R.string.formatinsulinunits, pump.lastBolusAmount)
else else
danar_lastbolus.text = "" danar_lastbolus?.text = ""
} }
danar_dailyunits.text = resourceHelper.gs(R.string.reservoirvalue, pump.dailyTotalUnits, pump.maxDailyTotalUnits) danar_dailyunits?.text = resourceHelper.gs(R.string.reservoirvalue, pump.dailyTotalUnits, pump.maxDailyTotalUnits)
SetWarnColor.setColor(danar_dailyunits, pump.dailyTotalUnits, pump.maxDailyTotalUnits * 0.75, pump.maxDailyTotalUnits * 0.9) SetWarnColor.setColor(danar_dailyunits, pump.dailyTotalUnits, pump.maxDailyTotalUnits * 0.75, pump.maxDailyTotalUnits * 0.9)
danar_basabasalrate.text = "( " + (pump.activeProfile + 1) + " ) " + resourceHelper.gs(R.string.pump_basebasalrate, plugin.baseBasalRate) danar_basabasalrate?.text = "( " + (pump.activeProfile + 1) + " ) " + resourceHelper.gs(R.string.pump_basebasalrate, plugin.baseBasalRate)
// DanaRPlugin, DanaRKoreanPlugin // DanaRPlugin, DanaRKoreanPlugin
if (activePlugin.activePump.isFakingTempsByExtendedBoluses == true) { if (activePlugin.activePump.isFakingTempsByExtendedBoluses == true) {
danar_tempbasal.text = activePlugin.activeTreatments.getRealTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() danar_tempbasal?.text = activePlugin.activeTreatments.getRealTempBasalFromHistory(System.currentTimeMillis())?.toStringFull()
?: "" ?: ""
} else { } else {
// v2 plugin // v2 plugin
danar_tempbasal.text = activePlugin.activeTreatments.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() danar_tempbasal?.text = activePlugin.activeTreatments.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull()
?: "" ?: ""
} }
danar_extendedbolus.text = activePlugin.activeTreatments.getExtendedBolusFromHistory(System.currentTimeMillis())?.toString() danar_extendedbolus?.text = activePlugin.activeTreatments.getExtendedBolusFromHistory(System.currentTimeMillis())?.toString()
?: "" ?: ""
danar_reservoir.text = resourceHelper.gs(R.string.reservoirvalue, pump.reservoirRemainingUnits, 300) danar_reservoir?.text = resourceHelper.gs(R.string.reservoirvalue, pump.reservoirRemainingUnits, 300)
SetWarnColor.setColorInverse(danar_reservoir, pump.reservoirRemainingUnits, 50.0, 20.0) SetWarnColor.setColorInverse(danar_reservoir, pump.reservoirRemainingUnits, 50.0, 20.0)
danar_battery.text = "{fa-battery-" + pump.batteryRemaining / 25 + "}" danar_battery?.text = "{fa-battery-" + pump.batteryRemaining / 25 + "}"
SetWarnColor.setColorInverse(danar_battery, pump.batteryRemaining.toDouble(), 51.0, 26.0) SetWarnColor.setColorInverse(danar_battery, pump.batteryRemaining.toDouble(), 51.0, 26.0)
danar_iob.text = resourceHelper.gs(R.string.formatinsulinunits, pump.iob) danar_iob?.text = resourceHelper.gs(R.string.formatinsulinunits, pump.iob)
danar_firmware.text = resourceHelper.gs(R.string.danar_model, pump.modelFriendlyName(), pump.hwModel, pump.protocol, pump.productCode) danar_firmware?.text = resourceHelper.gs(R.string.dana_model, pump.modelFriendlyName(), pump.hwModel, pump.protocol, pump.productCode)
danar_basalstep.text = pump.basalStep.toString() danar_basalstep?.text = pump.basalStep.toString()
danar_bolusstep.text = pump.bolusStep.toString() danar_bolusstep?.text = pump.bolusStep.toString()
danar_serialnumber.text = pump.serialNumber danar_serialnumber?.text = pump.serialNumber
val status = commandQueue.spannedStatus() val status = commandQueue.spannedStatus()
if (status.toString() == "") { if (status.toString() == "") {
danar_queue.visibility = View.GONE danar_queue?.visibility = View.GONE
} else { } else {
danar_queue.visibility = View.VISIBLE danar_queue?.visibility = View.VISIBLE
danar_queue.text = status danar_queue?.text = status
} }
//hide user options button if not an RS pump or old firmware //hide user options button if not an RS pump or old firmware
// also excludes pump with model 03 because of untested error // also excludes pump with model 03 because of untested error
val isKorean = danaRKoreanPlugin.isEnabled(PluginType.PUMP) val isKorean = danaRKoreanPlugin.isEnabled(PluginType.PUMP)
if (isKorean || pump.hwModel == 0 || pump.hwModel == 3) { if (isKorean || pump.hwModel == 0 || pump.hwModel == 3) {
danar_user_options.visibility = View.GONE danar_user_options?.visibility = View.GONE
} }
} }
} }

View file

@ -529,7 +529,7 @@
<string name="always_use_shortavg_summary">Useful when data from unfiltered sources like xDrip gets noisy.</string> <string name="always_use_shortavg_summary">Useful when data from unfiltered sources like xDrip gets noisy.</string>
<string name="advancedsettings_title">Advanced Settings</string> <string name="advancedsettings_title">Advanced Settings</string>
<string name="key_advancedsettings" translatable="false">key_advancedsettings</string> <string name="key_advancedsettings" translatable="false">key_advancedsettings</string>
<string name="danar_model">%1$s\nModel: %2$02X\nProtocol: %3$02X\nCode: %4$02X</string> <string name="dana_model">%1$s\nModel: %2$02X\nProtocol: %3$02X\nCode: %4$02X</string>
<string name="profile">Profile</string> <string name="profile">Profile</string>
<string name="openapsama_max_daily_safety_multiplier_summary">Default value: 3 This is a key OpenAPS safety cap. What this does is limit your basals to be 3x (in this people) your biggest basal rate. You likely will not need to change this, but you should be aware thats what is discussed about “3x max daily; 4x current” for safety caps.</string> <string name="openapsama_max_daily_safety_multiplier_summary">Default value: 3 This is a key OpenAPS safety cap. What this does is limit your basals to be 3x (in this people) your biggest basal rate. You likely will not need to change this, but you should be aware thats what is discussed about “3x max daily; 4x current” for safety caps.</string>
<string name="openapsama_current_basal_safety_multiplier_summary">Default value: 4 This is the other half of the key OpenAPS safety caps, and the other half of “3x max daily; 4x current” of the safety caps. This means your basal, regardless of max basal set on your pump, cannot be any higher than this number times the current level of your basal. This is to prevent people from getting into dangerous territory by setting excessively high max basals before understanding how the algorithm works. Again, the default is 4x; most people will never need to adjust this and are instead more likely to need to adjust other settings if they feel like they are “running into” this safety cap.</string> <string name="openapsama_current_basal_safety_multiplier_summary">Default value: 4 This is the other half of the key OpenAPS safety caps, and the other half of “3x max daily; 4x current” of the safety caps. This means your basal, regardless of max basal set on your pump, cannot be any higher than this number times the current level of your basal. This is to prevent people from getting into dangerous territory by setting excessively high max basals before understanding how the algorithm works. Again, the default is 4x; most people will never need to adjust this and are instead more likely to need to adjust other settings if they feel like they are “running into” this safety cap.</string>