fix conflicts

This commit is contained in:
Milos Kozak 2017-05-09 10:46:04 +02:00
commit b30d79c4cb
4 changed files with 55 additions and 2 deletions

View file

@ -119,6 +119,7 @@
android:exported="false" /> android:exported="false" />
<service <service
android:name=".plugins.PumpDanaR.services.DanaRExecutionService" android:name=".plugins.PumpDanaR.services.DanaRExecutionService"
android:enabled="true" android:enabled="true"
android:exported="false" /> android:exported="false" />
<service <service

View file

@ -61,6 +61,9 @@ public class ActionsFragment extends Fragment implements View.OnClickListener {
tempBasal.setOnClickListener(this); tempBasal.setOnClickListener(this);
fill.setOnClickListener(this); fill.setOnClickListener(this);
view.findViewById(R.id.actions_50_30).setOnClickListener(this);
view.findViewById(R.id.actions_400_15).setOnClickListener(this);
updateGUIIfVisible(); updateGUIIfVisible();
return view; return view;
} }
@ -148,6 +151,10 @@ public class ActionsFragment extends Fragment implements View.OnClickListener {
FillDialog fillDialog = new FillDialog(); FillDialog fillDialog = new FillDialog();
fillDialog.show(manager, "FillDialog"); fillDialog.show(manager, "FillDialog");
break; break;
case R.id.actions_50_30:
break;
case R.id.actions_400_15:
break;
} }
} }
} }

View file

@ -464,8 +464,7 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
} }
int durationInHours = Math.max(durationInMinutes / 60, 1); int durationInHours = Math.max(durationInMinutes / 60, 1);
boolean connectionOK = false; boolean connectionOK = false;
if (percent < 100) connectionOK = sExecutionService.tempBasal(percent, durationInHours); connectionOK = sExecutionService.tempBasal(percent, durationInHours);
else connectionOK =sExecutionService.highTempBasal(percent);
if (connectionOK && getDanaRPump().isTempBasalInProgress && getDanaRPump().tempBasalPercent == percent) { if (connectionOK && getDanaRPump().isTempBasalInProgress && getDanaRPump().tempBasalPercent == percent) {
result.enacted = true; result.enacted = true;
result.success = true; result.success = true;
@ -485,6 +484,28 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
return result; return result;
} }
public PumpEnactResult setHighTempBasalPercent(Integer percent) {
PumpEnactResult result = new PumpEnactResult();
boolean connectionOK = sExecutionService.highTempBasal(percent);
if (connectionOK && getDanaRPump().isTempBasalInProgress && getDanaRPump().tempBasalPercent == percent) {
result.enacted = true;
result.success = true;
result.comment = MainApp.instance().getString(R.string.virtualpump_resultok);
result.isTempCancel = false;
result.duration = getDanaRPump().tempBasalRemainingMin;
result.percent = getDanaRPump().tempBasalPercent;
result.isPercent = true;
if (Config.logPumpActions)
log.debug("setHighTempBasalPercent: OK");
return result;
}
result.enacted = false;
result.success = false;
result.comment = MainApp.instance().getString(R.string.danar_valuenotsetproperly);
log.error("setHighTempBasalPercent: Failed to set temp basal");
return result;
}
@Override @Override
public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) { public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) {
ConfigBuilderPlugin configBuilderPlugin = MainApp.getConfigBuilder(); ConfigBuilderPlugin configBuilderPlugin = MainApp.getConfigBuilder();

View file

@ -78,6 +78,30 @@
android:text="@string/primefill" android:text="@string/primefill"
android:textColor="@color/colorTreatmentButton" /> android:textColor="@color/colorTreatmentButton" />
<Button
android:id="@+id/actions_400_15"
style="?android:attr/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:layout_weight="0.5"
android:text="NEW Temp 400% 15min" />
<Button
android:id="@+id/actions_50_30"
style="?android:attr/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:layout_weight="0.5"
android:text="NEW Temp 50% 30min" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>