ComboFragment: use queue to refresh state, explicit disconnects for tdd/alert.s

This commit is contained in:
Johannes Mockenhaupt 2017-12-08 23:19:43 +01:00
parent b8ad44ba43
commit 3316ab2081
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 8 additions and 1 deletions

View file

@ -75,7 +75,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
public void onClick(View view) { public void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.combo_refresh: case R.id.combo_refresh:
new Thread(() -> ComboPlugin.getPlugin().getPumpStatus()).start(); ConfigBuilderPlugin.getCommandQueue().readStatus("User request", null);
break; break;
case R.id.combo_error_history: case R.id.combo_error_history:
ComboAlertHistoryDialog ehd = new ComboAlertHistoryDialog(); ComboAlertHistoryDialog ehd = new ComboAlertHistoryDialog();

View file

@ -869,14 +869,19 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
} }
} }
// TODO queue
void readTddData() { void readTddData() {
readHistory(new PumpHistoryRequest().tddHistory(PumpHistoryRequest.FULL)); readHistory(new PumpHistoryRequest().tddHistory(PumpHistoryRequest.FULL));
ruffyScripter.disconnect();
} }
// TODO queue
void readAlertData() { void readAlertData() {
readHistory(new PumpHistoryRequest().pumpErrorHistory(PumpHistoryRequest.FULL)); readHistory(new PumpHistoryRequest().pumpErrorHistory(PumpHistoryRequest.FULL));
ruffyScripter.disconnect();
} }
// TODO queue
void readAllPumpData() { void readAllPumpData() {
long lastCheckInitiated = System.currentTimeMillis(); long lastCheckInitiated = System.currentTimeMillis();
@ -905,6 +910,8 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
} }
pump.basalProfile = basalResult.basalProfile; pump.basalProfile = basalResult.basalProfile;
ruffyScripter.disconnect();
} }
@Override @Override