cleanup
This commit is contained in:
parent
7ef97a5334
commit
bbeca6b83e
1 changed files with 42 additions and 54 deletions
|
@ -21,6 +21,7 @@ import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump;
|
|||
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
|
||||
import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin;
|
||||
import info.nightscout.utils.NumberPicker;
|
||||
|
||||
/**
|
||||
* Created by Rumen Georgiev on 5/31/2018.
|
||||
*/
|
||||
|
@ -84,11 +85,6 @@ public class DanaRUserOptionsActivity extends Activity {
|
|||
boolean isRS = MainApp.getSpecificPlugin(DanaRSPlugin.class) != null && MainApp.getSpecificPlugin(DanaRSPlugin.class).isEnabled(PluginType.PUMP);
|
||||
|
||||
|
||||
Activity activity = this;
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DanaRPump pump = DanaRPump.getInstance();
|
||||
//used for debugging
|
||||
log.debug("UserOptionsLoadedd:" + (System.currentTimeMillis() - pump.lastConnection) / 1000 + " s ago"
|
||||
|
@ -112,11 +108,8 @@ public class DanaRUserOptionsActivity extends Activity {
|
|||
beep.setChecked(true);
|
||||
}
|
||||
|
||||
screenTimeout.setValue((double) pump.lcdOnTimeSec);
|
||||
screenTimeout.setStep(5d);
|
||||
screenTimeout.setParams(5d,5d,240d,5d,new DecimalFormat("1"), false);
|
||||
backlightTimeout.setValue((double) pump.backlightOnTimeSec);
|
||||
backlightTimeout.setParams(1d,1d,60d,1d,new DecimalFormat("1"), false);
|
||||
screenTimeout.setParams((double) pump.lcdOnTimeSec, 5d, 240d, 5d, new DecimalFormat("1"), false);
|
||||
backlightTimeout.setParams((double) pump.backlightOnTimeSec, 1d, 60d, 1d, new DecimalFormat("1"), false);
|
||||
if (pump.lastSettingsRead == 0)
|
||||
log.debug("No settings loaded from pump!");
|
||||
if (pump.getUnits() != null) {
|
||||
|
@ -124,13 +117,8 @@ public class DanaRUserOptionsActivity extends Activity {
|
|||
pumpUnits.setChecked(true);
|
||||
}
|
||||
}
|
||||
shutdown.setValue((double) pump.shutdownHour);
|
||||
shutdown.setParams(0d,0d,24d,1d,new DecimalFormat("1"), true);
|
||||
lowReservoir.setValue((double) pump.lowReservoirRate);
|
||||
lowReservoir.setStep(10D);
|
||||
lowReservoir.setParams(10d,10d,60d,10d,new DecimalFormat("10"), false);
|
||||
}
|
||||
});
|
||||
shutdown.setParams((double) pump.shutdownHour, 0d, 24d, 1d, new DecimalFormat("1"), true);
|
||||
lowReservoir.setParams((double) pump.lowReservoirRate, 10d, 60d, 10d, new DecimalFormat("10"), false);
|
||||
}
|
||||
|
||||
public void onSaveClick() {
|
||||
|
|
Loading…
Reference in a new issue