Minor cleanups.

This commit is contained in:
Johannes Mockenhaupt 2017-12-09 22:40:51 +01:00
parent 6527b13934
commit fe281b9224
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
3 changed files with 5 additions and 30 deletions

View file

@ -29,7 +29,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
private TextView batteryView;
private TextView reservoirView;
private TextView lastConnectionView;
private TextView lastBolusView;
private TextView tempBasalText;
private Button refreshButton;
private Button alertsButton;
@ -48,7 +47,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
batteryView = (TextView) view.findViewById(R.id.combo_pumpstate_battery);
reservoirView = (TextView) view.findViewById(R.id.combo_insulinstate);
lastConnectionView = (TextView) view.findViewById(R.id.combo_lastconnection);
//lastBolusView = (TextView) view.findViewById(R.id.combo_last_bolus);
tempBasalText = (TextView) view.findViewById(R.id.combo_temp_basal);
queueView = (TextView) view.findViewById(R.id.combo_queue);
@ -195,30 +193,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
lastConnectionView.setTextColor(Color.WHITE);
}
/* reading the data that would be displayed here triggers pump bug
// last bolus
Bolus bolus = plugin.getPump().lastBolus;
if (bolus != null && bolus.timestamp + 6 * 60 * 60 * 1000 >= System.currentTimeMillis()) {
long agoMsc = System.currentTimeMillis() - bolus.timestamp;
double bolusMinAgo = agoMsc / 60d / 1000d;
double bolusHoursAgo = agoMsc / 60d / 60d / 1000d;
// TODO i18n
if ((agoMsc < 60 * 1000)) {
lastBolusView.setText(String.format("%.1f U (now)", bolus.amount));
} else if (bolusMinAgo < 60) {
lastBolusView.setText(String.format("%.1f U (%d min ago)", bolus.amount, (int) bolusMinAgo));
// lastBolusView.setText(getString(R.string.combo_last_bolus, bolus.amount,
// getString(R.string.minago, bolusMinAgo), DateUtil.timeString(bolus.timestamp)));
} else {
lastBolusView.setText(String.format("%.1f U (%.1f h ago)", bolus.amount, bolusHoursAgo));
// lastBolusView.setText(getString(R.string.combo_last_bolus, bolus.amount,
// String.format("%.1f", bolusHoursAgo) + getString(R.string.hoursago), DateUtil.timeString(bolus.timestamp)));
}
} else {
lastBolusView.setText("");
}
*/
// TBR
String tbrStr = "";
if (ps.tbrPercent != -1 && ps.tbrPercent != 100) {

View file

@ -53,7 +53,7 @@ import static de.jotomo.ruffy.spi.BolusProgressReporter.State.FINISHED;
* Created by mike on 05.08.2016.
*/
public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterface {
private static Logger log = LoggerFactory.getLogger(ComboPlugin.class);
private static final Logger log = LoggerFactory.getLogger(ComboPlugin.class);
private static ComboPlugin plugin = null;
private boolean fragmentEnabled = false;
@ -91,7 +91,8 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
@NonNull
private final RuffyCommands ruffyScripter;
private static ComboPump pump = new ComboPump();
@NonNull
private static final ComboPump pump = new ComboPump();
private volatile boolean bolusInProgress;
private volatile boolean cancelBolus;
@ -104,7 +105,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
return plugin;
}
private static PumpEnactResult OPERATION_NOT_SUPPORTED = new PumpEnactResult()
private static final PumpEnactResult OPERATION_NOT_SUPPORTED = new PumpEnactResult()
.success(false).enacted(false).comment(MainApp.sResources.getString(R.string.combo_pump_unsupported_operation));
private ComboPlugin() {

View file

@ -27,8 +27,8 @@ public class CommandResult {
public int reservoirLevel = -1;
/** Only set when by ReadReservoirLevelCommand. */
@Nullable
@Deprecated
public Bolus lastBolus;
public CommandResult success(boolean success) {