upload cpp setting to NS

This commit is contained in:
Milos Kozak 2017-01-23 09:31:14 +01:00
parent c4f8167424
commit 22f9817f8e
2 changed files with 9 additions and 2 deletions

View file

@ -49,6 +49,7 @@ import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.CircadianPercentageProfile.CircadianPercentageProfilePlugin;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange;
import info.nightscout.client.data.NSProfile;
@ -598,6 +599,12 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
} else {
log.error("No active pump selected");
}
if (MainApp.getConfigBuilder().getActiveProfile() instanceof CircadianPercentageProfilePlugin) {
CircadianPercentageProfilePlugin cpp = (CircadianPercentageProfilePlugin) MainApp.getConfigBuilder().getActiveProfile();
data.put("CircadianPercentageProfile", true);
data.put("timeshift", cpp.timeshift);
data.put("percentage", cpp.percentage);
}
ConfigBuilderPlugin.uploadCareportalEntryToNS(data);
} catch (JSONException e) {
e.printStackTrace();

View file

@ -39,8 +39,8 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
Double car;
Double targetLow;
Double targetHigh;
int percentage;
int timeshift;
public int percentage;
public int timeshift;
double[] basebasal = new double[]{1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d, 1d};
double[] baseisf = new double[]{35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d, 35d};
double[] baseic = new double[]{4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d, 4d};