Formatting.
This commit is contained in:
parent
b000824b8a
commit
f41d597c07
|
@ -1,5 +1,7 @@
|
||||||
package de.jotomo.ruffyscripter;
|
package de.jotomo.ruffyscripter;
|
||||||
|
|
||||||
/** The history data read from "My data" */
|
/**
|
||||||
|
* The history data read from "My data"
|
||||||
|
*/
|
||||||
public class History {
|
public class History {
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package de.jotomo.ruffyscripter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by adrian on 26/07/17.
|
* Created by adrian on 26/07/17.
|
||||||
*
|
* <p>
|
||||||
* Contains the capabilities of the current pump model.
|
* Contains the capabilities of the current pump model.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,12 @@ public class PumpState {
|
||||||
public int tbrPercent = -1;
|
public int tbrPercent = -1;
|
||||||
public double tbrRate = -1;
|
public double tbrRate = -1;
|
||||||
public int tbrRemainingDuration = -1;
|
public int tbrRemainingDuration = -1;
|
||||||
/** This is the error message (if any) displayed by the pump if there is an alarm,
|
/**
|
||||||
e.g. if a "TBR cancelled alarm" is active, the value will be "TBR CANCELLED".
|
* This is the error message (if any) displayed by the pump if there is an alarm,
|
||||||
Generally, an error code is also displayed, but it flashes and it might take
|
* e.g. if a "TBR cancelled alarm" is active, the value will be "TBR CANCELLED".
|
||||||
longer to read that and the pump connection gets interrupted if we're not
|
* Generally, an error code is also displayed, but it flashes and it might take
|
||||||
reacting quickly.
|
* longer to read that and the pump connection gets interrupted if we're not
|
||||||
|
* reacting quickly.
|
||||||
*/
|
*/
|
||||||
public String errorMsg;
|
public String errorMsg;
|
||||||
public boolean suspended;
|
public boolean suspended;
|
||||||
|
|
|
@ -7,12 +7,13 @@ import de.jotomo.ruffyscripter.RuffyScripter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for all commands to be executed by the pump.
|
* Interface for all commands to be executed by the pump.
|
||||||
*
|
* <p>
|
||||||
* Note on cammond methods and timing: a method shall wait before and after executing
|
* Note on cammond methods and timing: a method shall wait before and after executing
|
||||||
* as necessary to not cause timing issues, so the caller can just call methods in
|
* as necessary to not cause timing issues, so the caller can just call methods in
|
||||||
* sequence, letting the methods take care of waits.
|
* sequence, letting the methods take care of waits.
|
||||||
*/
|
*/
|
||||||
public interface Command {
|
public interface Command {
|
||||||
CommandResult execute(RuffyScripter ruffyScripter, PumpState initialPumpState);
|
CommandResult execute(RuffyScripter ruffyScripter, PumpState initialPumpState);
|
||||||
|
|
||||||
List<String> validateArguments();
|
List<String> validateArguments();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ public class CommandException extends RuntimeException {
|
||||||
public Exception exception = null;
|
public Exception exception = null;
|
||||||
public String message = null;
|
public String message = null;
|
||||||
|
|
||||||
public CommandException() {}
|
public CommandException() {
|
||||||
|
}
|
||||||
|
|
||||||
public CommandException success(boolean success) {
|
public CommandException success(boolean success) {
|
||||||
this.success = success;
|
this.success = success;
|
||||||
|
|
|
@ -2,8 +2,6 @@ package de.jotomo.ruffyscripter.commands;
|
||||||
|
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
|
||||||
import com.j256.ormlite.stmt.query.In;
|
|
||||||
|
|
||||||
import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute;
|
import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute;
|
||||||
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
||||||
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime;
|
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime;
|
||||||
|
@ -12,7 +10,6 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import de.jotomo.ruffyscripter.PumpCapabilities;
|
import de.jotomo.ruffyscripter.PumpCapabilities;
|
||||||
import de.jotomo.ruffyscripter.PumpState;
|
import de.jotomo.ruffyscripter.PumpState;
|
||||||
|
|
|
@ -18,7 +18,8 @@ public class GetBasalCommand implements Command {
|
||||||
|
|
||||||
private RuffyScripter scripter;
|
private RuffyScripter scripter;
|
||||||
|
|
||||||
public GetBasalCommand() {}
|
public GetBasalCommand() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> validateArguments() {
|
public List<String> validateArguments() {
|
||||||
|
@ -106,8 +107,7 @@ public class GetBasalCommand implements Command {
|
||||||
try {
|
try {
|
||||||
Map<Integer, Double> rate = new HashMap<>();
|
Map<Integer, Double> rate = new HashMap<>();
|
||||||
|
|
||||||
for(int i = 0; i < 24;i++)
|
for (int i = 0; i < 24; i++) {
|
||||||
{
|
|
||||||
Log.v("BASAL_RATE", "BASAL_RATE from " + String.format("%02d", i) + ":00 = " + rate.get(i));
|
Log.v("BASAL_RATE", "BASAL_RATE from " + String.format("%02d", i) + ":00 = " + rate.get(i));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
* The alerter frequently checks the result of the last executed command via the lastCmdResult
|
* The alerter frequently checks the result of the last executed command via the lastCmdResult
|
||||||
* field and shows a notification with sound and vibration if an error occurred.
|
* field and shows a notification with sound and vibration if an error occurred.
|
||||||
* More details on the error can then be looked up in the Combo tab.
|
* More details on the error can then be looked up in the Combo tab.
|
||||||
*
|
* <p>
|
||||||
* The alarm is re-raised every 5 minutes for as long as the error persist. As soon
|
* The alarm is re-raised every 5 minutes for as long as the error persist. As soon
|
||||||
* as a command succeeds no more new alerts are raised.
|
* as a command succeeds no more new alerts are raised.
|
||||||
*/
|
*/
|
||||||
|
@ -228,6 +228,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean keepUnbound = false;
|
private boolean keepUnbound = false;
|
||||||
|
|
||||||
private void unbindRuffyService() {
|
private void unbindRuffyService() {
|
||||||
keepUnbound = true;
|
keepUnbound = true;
|
||||||
ruffyScripter.unbind();
|
ruffyScripter.unbind();
|
||||||
|
|
Loading…
Reference in a new issue