Revert "Fix Wear Control Kotlin doesn't like regex... (AAPS crashed on these lines with ""\\s+", replaced by a space)"
=> Second proposal better than my first one, split works with regex if it is of type Regex (it doesn't recognize first \ as a regex string but as an escape character...)
This reverts commit 480542a1
This commit is contained in:
parent
480542a143
commit
72e541908c
1 changed files with 2 additions and 2 deletions
|
@ -86,7 +86,7 @@ class ActionStringHandler @Inject constructor(
|
||||||
var rMessage = ""
|
var rMessage = ""
|
||||||
var rAction = ""
|
var rAction = ""
|
||||||
// do the parsing and check constraints
|
// do the parsing and check constraints
|
||||||
val act = actionString.split(" ").toTypedArray()
|
val act = actionString.split("\\s+".toRegex()).toTypedArray()
|
||||||
if ("fillpreset" == act[0]) { ///////////////////////////////////// PRIME/FILL
|
if ("fillpreset" == act[0]) { ///////////////////////////////////// PRIME/FILL
|
||||||
val amount: Double = if ("1" == act[1]) {
|
val amount: Double = if ("1" == act[1]) {
|
||||||
sp.getDouble("fill_button1", 0.3)
|
sp.getDouble("fill_button1", 0.3)
|
||||||
|
@ -470,7 +470,7 @@ class ActionStringHandler @Inject constructor(
|
||||||
if (System.currentTimeMillis() - lastSentTimestamp > TIMEOUT) return
|
if (System.currentTimeMillis() - lastSentTimestamp > TIMEOUT) return
|
||||||
lastConfirmActionString = null
|
lastConfirmActionString = null
|
||||||
// do the parsing, check constraints and enact!
|
// do the parsing, check constraints and enact!
|
||||||
val act = actionString.split(" ").toTypedArray()
|
val act = actionString.split("\\s+".toRegex()).toTypedArray()
|
||||||
if ("fill" == act[0]) {
|
if ("fill" == act[0]) {
|
||||||
val amount = SafeParse.stringToDouble(act[1])
|
val amount = SafeParse.stringToDouble(act[1])
|
||||||
val insulinAfterConstraints = constraintChecker.applyBolusConstraints(Constraint(amount)).value()
|
val insulinAfterConstraints = constraintChecker.applyBolusConstraints(Constraint(amount)).value()
|
||||||
|
|
Loading…
Reference in a new issue