Package refactoring.
This commit is contained in:
parent
f33d55b092
commit
4a91b68ed7
|
@ -17,8 +17,8 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.events.EventComboPumpUpdateGUI;
|
||||
|
|
|
@ -29,11 +29,11 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
|
|||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||
import info.nightscout.androidaps.plugins.Overview.events.EventOverviewBolusProgress;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.events.EventComboPumpUpdateGUI;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.RuffyCommands;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.RuffyCommands;
|
||||
import info.nightscout.utils.DateUtil;
|
||||
import info.nightscout.utils.SP;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import android.support.annotation.Nullable;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
class ComboPump {
|
||||
@Nullable
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
|
@ -24,22 +24,22 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.BolusCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.CancelTbrCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.Command;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.CommandException;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.GetPumpStateCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.ReadBasalProfileCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.ReadHistoryCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.ReadReserverLevelCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.SetBasalProfileCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.SetTbrCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.BasalProfile;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpHistory;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.RuffyCommands;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.BolusCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.CancelTbrCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.Command;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.CommandException;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.GetPumpStateCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadBasalProfileCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadHistoryCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadReserverLevelCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.SetBasalProfileCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.SetTbrCommand;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BasalProfile;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpHistory;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.RuffyCommands;
|
||||
|
||||
// TODO regularly read "My data" history (boluses, TBR) to double check all commands ran successfully.
|
||||
// Automatically compare against AAPS db, or log all requests in the PumpInterface (maybe Milos
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
|
||||
public abstract class BaseCommand implements Command {
|
||||
// RS will inject itself here
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
|
@ -11,11 +11,11 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.PumpCombo.spi.BolusProgressReporter.State.*;
|
||||
import static info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter.State.*;
|
||||
|
||||
public class BolusCommand extends BaseCommand {
|
||||
private static final Logger log = LoggerFactory.getLogger(BolusCommand.class);
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -7,9 +7,9 @@ import org.slf4j.LoggerFactory;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpState;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
// TODO robustness: can a TBR run out, whilst we're trying to cancel it?
|
||||
// Hm, we could just ignore TBRs that run out within the next 60s (0:01 or even 0:02
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
/**
|
||||
* Interface for all commands to be executed by the pump.
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class CommandException extends RuntimeException {
|
||||
public boolean success = false;
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
|
@ -10,8 +10,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class GetBasalRateProfileCommand extends BaseCommand {
|
||||
private static final Logger log = LoggerFactory.getLogger(GetBasalRateProfileCommand.class);
|
|
@ -1,13 +1,13 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands.GetPumpStateCommand.Stepper.runStep;
|
||||
import static info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.GetPumpStateCommand.Stepper.runStep;
|
||||
|
||||
public class GetPumpStateCommand extends BaseCommand {
|
||||
interface Step {
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class ReadBasalProfileCommand implements Command {
|
||||
@Override
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.PumpHistory;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpHistory;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class ReadHistoryCommand implements Command {
|
||||
public ReadHistoryCommand(PumpHistory knownHistory) {
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class ReadReserverLevelCommand implements Command {
|
||||
@Override
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.BasalProfile;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BasalProfile;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyScripter;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class SetBasalProfileCommand implements Command {
|
||||
public SetBasalProfileCommand(BasalProfile basalProfile) {
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class SetBasalRateProfileCommand extends BaseCommand {
|
||||
@Override
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.scripter.internal.commands;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.spi.CommandResult;
|
||||
import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
|
||||
|
||||
public class SetTbrCommand extends BaseCommand {
|
||||
private static final Logger log = LoggerFactory.getLogger(SetTbrCommand.class);
|
|
@ -0,0 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
public class BasalProfile {
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
public interface BolusProgressReporter {
|
||||
enum State {
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
public class PumpHistory {
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
|
||||
public class BasalProfile {
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.PumpCombo.spi;
|
||||
|
||||
public class PumpHistory {
|
||||
}
|
Loading…
Reference in a new issue