Formatting.

This commit is contained in:
Johannes Mockenhaupt 2017-08-17 10:56:33 +02:00
parent b000824b8a
commit f41d597c07
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
9 changed files with 42 additions and 39 deletions

View file

@ -1,5 +1,7 @@
package de.jotomo.ruffyscripter;
/** The history data read from "My data" */
/**
* The history data read from "My data"
*/
public class History {
}

View file

@ -2,7 +2,7 @@ package de.jotomo.ruffyscripter;
/**
* Created by adrian on 26/07/17.
*
* <p>
* Contains the capabilities of the current pump model.
*/

View file

@ -11,11 +11,12 @@ public class PumpState {
public int tbrPercent = -1;
public double tbrRate = -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".
Generally, an error code is also displayed, but it flashes and it might take
longer to read that and the pump connection gets interrupted if we're not
reacting quickly.
/**
* 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".
* Generally, an error code is also displayed, but it flashes and it might take
* longer to read that and the pump connection gets interrupted if we're not
* reacting quickly.
*/
public String errorMsg;
public boolean suspended;

View file

@ -7,12 +7,13 @@ import de.jotomo.ruffyscripter.RuffyScripter;
/**
* 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
* as necessary to not cause timing issues, so the caller can just call methods in
* sequence, letting the methods take care of waits.
*/
public interface Command {
CommandResult execute(RuffyScripter ruffyScripter, PumpState initialPumpState);
List<String> validateArguments();
}

View file

@ -6,7 +6,8 @@ public class CommandException extends RuntimeException {
public Exception exception = null;
public String message = null;
public CommandException() {}
public CommandException() {
}
public CommandException success(boolean success) {
this.success = success;

View file

@ -2,8 +2,6 @@ package de.jotomo.ruffyscripter.commands;
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.MenuType;
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.List;
import java.util.Locale;
import de.jotomo.ruffyscripter.PumpCapabilities;
import de.jotomo.ruffyscripter.PumpState;

View file

@ -18,7 +18,8 @@ public class GetBasalCommand implements Command {
private RuffyScripter scripter;
public GetBasalCommand() {}
public GetBasalCommand() {
}
@Override
public List<String> validateArguments() {
@ -106,8 +107,7 @@ public class GetBasalCommand implements Command {
try {
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));
}
} catch (Exception e) {

View file

@ -124,7 +124,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
* 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.
* 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
* 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 void unbindRuffyService() {
keepUnbound = true;
ruffyScripter.unbind();