commit
8185d88d32
29 changed files with 1301 additions and 240 deletions
|
@ -4,3 +4,4 @@
|
|||
* Everyone who’s been looping with AndroidAPS needs to fill out the form after 3 days of looping https://docs.google.com/forms/d/14KcMjlINPMJHVt28MDRupa4sz4DDIooI4SrW0P3HSN8/viewform?c=0&w=1
|
||||
|
||||
[![Gitter](https://badges.gitter.im/MilosKozak/AndroidAPS.svg)](https://gitter.im/MilosKozak/AndroidAPS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[![Build status](https://travis-ci.org/MilosKozak/AndroidAPS.svg?branch=master)](https://travis-ci.org/MilosKozak/AndroidAPS)
|
||||
|
|
|
@ -107,7 +107,7 @@ android {
|
|||
|
||||
dependencies {
|
||||
wearWearApp project(path: ':wear', configuration: 'fullRelease')
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
|
@ -127,6 +127,11 @@ dependencies {
|
|||
compile 'com.jjoe64:graphview:4.0.1'
|
||||
compile 'com.eclipsesource.j2v8:j2v8:3.1.6@aar'
|
||||
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.google.android.gms:play-services-wearable:7.5.0'
|
||||
compile 'junit:junit:4.12'
|
||||
testCompile 'org.json:json:20140107'
|
||||
testCompile 'org.mockito:mockito-core:2.+'
|
||||
androidTestCompile 'org.mockito:mockito-core:2.+'
|
||||
androidTestCompile "com.google.dexmaker:dexmaker:1.2"
|
||||
androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderFragment;
|
|||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||
import info.nightscout.androidaps.plugins.DanaR.DanaRFragment;
|
||||
import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanFragment;
|
||||
import info.nightscout.androidaps.plugins.LocalProfile.LocalProfileFragment;
|
||||
import info.nightscout.androidaps.plugins.Loop.LoopFragment;
|
||||
import info.nightscout.androidaps.plugins.MDI.MDIFragment;
|
||||
import info.nightscout.androidaps.plugins.NSProfile.NSProfileFragment;
|
||||
|
@ -83,6 +84,7 @@ public class MainApp extends Application {
|
|||
if (Config.OPENAPSMAENABLED) pluginsList.add(OpenAPSMAFragment.getPlugin());
|
||||
pluginsList.add(NSProfileFragment.getPlugin());
|
||||
pluginsList.add(SimpleProfileFragment.getPlugin());
|
||||
pluginsList.add(LocalProfileFragment.getPlugin());
|
||||
pluginsList.add(CircadianPercentageProfileFragment.getPlugin());
|
||||
pluginsList.add(TreatmentsFragment.getPlugin());
|
||||
pluginsList.add(TempBasalsFragment.getPlugin());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.CircadianPercentageProfile;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
|
@ -19,10 +20,14 @@ import android.widget.LinearLayout;
|
|||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||
import info.nightscout.androidaps.interfaces.FragmentBase;
|
||||
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
|
||||
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
|
||||
|
@ -60,8 +65,6 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
BasalEditDialog basalEditDialog;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
@ -87,7 +90,6 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
isfeditIcon = (ImageView) layout.findViewById(R.id.circadianpercentageprofile_isfedit);
|
||||
|
||||
|
||||
|
||||
mgdlView.setChecked(circadianPercentageProfilePlugin.mgdl);
|
||||
mmolView.setChecked(circadianPercentageProfilePlugin.mmol);
|
||||
diaView.setText(circadianPercentageProfilePlugin.dia.toString());
|
||||
|
@ -133,7 +135,7 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
timeshiftView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View view, boolean b) {
|
||||
if(b)
|
||||
if (b)
|
||||
ToastUtils.showToastInUiThread(getContext(), getString(R.string.timeshift_hint));
|
||||
|
||||
}
|
||||
|
@ -142,7 +144,7 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
percentageView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View view, boolean b) {
|
||||
if(b)
|
||||
if (b)
|
||||
ToastUtils.showToastInUiThread(getContext(), getString(R.string.percentagefactor_hint));
|
||||
}
|
||||
});
|
||||
|
@ -210,7 +212,7 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
public void onTextChanged(CharSequence s, int start,
|
||||
int before, int count) {
|
||||
|
||||
if(SafeParse.stringToInt(percentageView.getText().toString()) == 0) {
|
||||
if (SafeParse.stringToInt(percentageView.getText().toString()) == 0) {
|
||||
circadianPercentageProfilePlugin.percentage = 100;
|
||||
} else {
|
||||
circadianPercentageProfilePlugin.percentage = SafeParse.stringToInt(percentageView.getText().toString());
|
||||
|
@ -232,6 +234,8 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
percentageView.addTextChangedListener(textWatch);
|
||||
timeshiftView.addTextChangedListener(textWatch);
|
||||
|
||||
onStatusEvent(null);
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
@ -242,7 +246,7 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
sb.append("</h3>");
|
||||
sb.append("<h4>");
|
||||
sb.append(getString(R.string.nsprofileview_basal_label));
|
||||
sb.append( " ( ∑");
|
||||
sb.append(" ( ∑");
|
||||
sb.append(DecimalFormatter.to2Decimal(circadianPercentageProfilePlugin.percentageBasalSum()));
|
||||
sb.append("U )");
|
||||
sb.append("</h4> " + circadianPercentageProfilePlugin.basalString());
|
||||
|
@ -261,21 +265,21 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onStop(){
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if(basalEditDialog != null && basalEditDialog.isVisible()){
|
||||
if (basalEditDialog != null && basalEditDialog.isVisible()) {
|
||||
basalEditDialog.dismiss();
|
||||
}
|
||||
basalEditDialog = null;
|
||||
}
|
||||
|
||||
public static class BasalEditDialog extends DialogFragment{
|
||||
public static class BasalEditDialog extends DialogFragment {
|
||||
|
||||
private double[] values;
|
||||
private String title;
|
||||
private CircadianPercentageProfileFragment fragment;
|
||||
|
||||
public void setup(double[] values, String title, CircadianPercentageProfileFragment fragment){
|
||||
public void setup(double[] values, String title, CircadianPercentageProfileFragment fragment) {
|
||||
this.values = values;
|
||||
this.title = title;
|
||||
this.fragment = fragment;
|
||||
|
@ -289,18 +293,19 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
final EditText[] editTexts = new EditText[24];
|
||||
for (int i = 0; i < 24; i++) {
|
||||
View childview = inflater.inflate(R.layout.circadianpercentageprofile_listelement, container, false);
|
||||
((TextView)childview.findViewById(R.id.basal_time_elem)).setText((i<10?"0":"") + i + ":00: ");
|
||||
((TextView) childview.findViewById(R.id.basal_time_elem)).setText((i < 10 ? "0" : "") + i + ":00: ");
|
||||
|
||||
ImageView copyprevbutton = (ImageView)childview.findViewById(R.id.basal_copyprev_elem);
|
||||
ImageView copyprevbutton = (ImageView) childview.findViewById(R.id.basal_copyprev_elem);
|
||||
|
||||
if(i==0){
|
||||
copyprevbutton.setVisibility(View.INVISIBLE);;
|
||||
if (i == 0) {
|
||||
copyprevbutton.setVisibility(View.INVISIBLE);
|
||||
;
|
||||
} else {
|
||||
final int j = i; //needs to be final to be passed to inner class.
|
||||
copyprevbutton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
editTexts[j].setText(editTexts[j-1].getText());
|
||||
editTexts[j].setText(editTexts[j - 1].getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -315,8 +320,8 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
for (int i = 0; i < 24; i++) {
|
||||
if (editTexts[i].getText().length()!= 0){
|
||||
values[i]= SafeParse.stringToDouble(editTexts[i].getText().toString()) ;
|
||||
if (editTexts[i].getText().length() != 0) {
|
||||
values[i] = SafeParse.stringToDouble(editTexts[i].getText().toString());
|
||||
}
|
||||
}
|
||||
fragment.updateProfileInfo();
|
||||
|
@ -334,11 +339,34 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
|||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
MainApp.bus().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
onStatusEvent(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventInitializationChanged e) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!MainApp.getConfigBuilder().isInitialized() || !MainApp.getConfigBuilder().getPumpDescription().isSetBasalProfileCapable) {
|
||||
profileswitchButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
profileswitchButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ public class DanaRFragment extends Fragment implements FragmentBase {
|
|||
if (DanaRPlugin.getDanaRPump().lastConnection.getTime() != 0) {
|
||||
Long agoMsec = new Date().getTime() - DanaRPlugin.getDanaRPump().lastConnection.getTime();
|
||||
int agoMin = (int) (agoMsec / 60d / 1000d);
|
||||
lastConnectionView.setText(formatTime.format(DanaRPlugin.getDanaRPump().lastConnection) + " (" + agoMin + " " + MainApp.sResources.getString(R.string.minago) + ")");
|
||||
lastConnectionView.setText(formatTime.format(DanaRPlugin.getDanaRPump().lastConnection) + " (" + String.format(MainApp.sResources.getString(R.string.minago), agoMin) + ")");
|
||||
SetWarnColor.setColor(lastConnectionView, agoMin, 16d, 31d);
|
||||
}
|
||||
if (DanaRPlugin.getDanaRPump().lastBolusTime.getTime() != 0) {
|
||||
|
|
|
@ -197,7 +197,7 @@ public class DanaRKoreanFragment extends Fragment implements FragmentBase {
|
|||
if (DanaRKoreanPlugin.getDanaRPump().lastConnection.getTime() != 0) {
|
||||
Long agoMsec = new Date().getTime() - DanaRKoreanPlugin.getDanaRPump().lastConnection.getTime();
|
||||
int agoMin = (int) (agoMsec / 60d / 1000d);
|
||||
lastConnectionView.setText(formatTime.format(DanaRKoreanPlugin.getDanaRPump().lastConnection) + " (" + agoMin + " " + MainApp.sResources.getString(R.string.minago) + ")");
|
||||
lastConnectionView.setText(formatTime.format(DanaRKoreanPlugin.getDanaRPump().lastConnection) + " (" + String.format(MainApp.sResources.getString(R.string.minago), agoMin) + ")");
|
||||
SetWarnColor.setColor(lastConnectionView, agoMin, 16d, 31d);
|
||||
}
|
||||
// if (DanaRKoreanPlugin.getDanaRPump().lastBolusTime.getTime() != 0) {
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
package info.nightscout.androidaps.plugins.LocalProfile;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||
import info.nightscout.androidaps.interfaces.FragmentBase;
|
||||
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
|
||||
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
|
||||
import info.nightscout.utils.SafeParse;
|
||||
import info.nightscout.utils.TimeListEdit;
|
||||
|
||||
public class LocalProfileFragment extends Fragment implements FragmentBase {
|
||||
private static Logger log = LoggerFactory.getLogger(LocalProfileFragment.class);
|
||||
|
||||
private static LocalProfilePlugin localProfilePlugin = new LocalProfilePlugin();
|
||||
|
||||
public static LocalProfilePlugin getPlugin() {
|
||||
return localProfilePlugin;
|
||||
}
|
||||
|
||||
EditText diaView;
|
||||
RadioButton mgdlView;
|
||||
RadioButton mmolView;
|
||||
TimeListEdit icView;
|
||||
TimeListEdit isfView;
|
||||
EditText carView;
|
||||
TimeListEdit basalView;
|
||||
TimeListEdit targetView;
|
||||
Button profileswitchButton;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
Runnable save = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
localProfilePlugin.storeSettings();
|
||||
}
|
||||
};
|
||||
|
||||
View layout = inflater.inflate(R.layout.localprofile_fragment, container, false);
|
||||
diaView = (EditText) layout.findViewById(R.id.localprofile_dia);
|
||||
mgdlView = (RadioButton) layout.findViewById(R.id.localprofile_mgdl);
|
||||
mmolView = (RadioButton) layout.findViewById(R.id.localprofile_mmol);
|
||||
icView = new TimeListEdit(getContext(), layout, R.id.localprofile_ic, MainApp.sResources.getString(R.string.nsprofileview_ic_label), getPlugin().ic, null, new DecimalFormat("0.0"), save);
|
||||
isfView = new TimeListEdit(getContext(), layout, R.id.localprofile_isf, MainApp.sResources.getString(R.string.nsprofileview_isf_label), getPlugin().isf, null, new DecimalFormat("0.0"), save);
|
||||
carView = (EditText) layout.findViewById(R.id.localprofile_car);
|
||||
basalView = new TimeListEdit(getContext(), layout, R.id.localprofile_basal, MainApp.sResources.getString(R.string.nsprofileview_basal_label), getPlugin().basal, null, new DecimalFormat("0.00"), save);
|
||||
targetView = new TimeListEdit(getContext(), layout, R.id.localprofile_target, MainApp.sResources.getString(R.string.nsprofileview_target_label), getPlugin().targetLow, getPlugin().targetHigh, new DecimalFormat("0.0"), save);
|
||||
profileswitchButton = (Button) layout.findViewById(R.id.localprofile_profileswitch);
|
||||
|
||||
onStatusEvent(null);
|
||||
|
||||
mgdlView.setChecked(localProfilePlugin.mgdl);
|
||||
mmolView.setChecked(localProfilePlugin.mmol);
|
||||
diaView.setText(localProfilePlugin.dia.toString());
|
||||
carView.setText(localProfilePlugin.car.toString());
|
||||
|
||||
mgdlView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
localProfilePlugin.mgdl = mgdlView.isChecked();
|
||||
localProfilePlugin.mmol = !localProfilePlugin.mgdl;
|
||||
mmolView.setChecked(localProfilePlugin.mmol);
|
||||
localProfilePlugin.storeSettings();
|
||||
}
|
||||
});
|
||||
mmolView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
localProfilePlugin.mmol = mmolView.isChecked();
|
||||
localProfilePlugin.mgdl = !localProfilePlugin.mmol;
|
||||
mgdlView.setChecked(localProfilePlugin.mgdl);
|
||||
localProfilePlugin.storeSettings();
|
||||
}
|
||||
});
|
||||
|
||||
profileswitchButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
NewNSTreatmentDialog newDialog = new NewNSTreatmentDialog();
|
||||
final OptionsToShow profileswitch = new OptionsToShow(R.id.careportal_profileswitch, R.string.careportal_profileswitch, true, false, false, false, false, false, false, true, false);
|
||||
profileswitch.executeProfileSwitch = true;
|
||||
newDialog.setOptions(profileswitch);
|
||||
newDialog.show(getFragmentManager(), "NewNSTreatmentDialog");
|
||||
}
|
||||
});
|
||||
|
||||
TextWatcher textWatch = new TextWatcher() {
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start,
|
||||
int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start,
|
||||
int before, int count) {
|
||||
localProfilePlugin.dia = SafeParse.stringToDouble(diaView.getText().toString());
|
||||
localProfilePlugin.car = SafeParse.stringToDouble(carView.getText().toString());
|
||||
localProfilePlugin.storeSettings();
|
||||
}
|
||||
};
|
||||
|
||||
diaView.addTextChangedListener(textWatch);
|
||||
carView.addTextChangedListener(textWatch);
|
||||
|
||||
onStatusEvent(null);
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
MainApp.bus().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
onStatusEvent(null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventInitializationChanged e) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!MainApp.getConfigBuilder().isInitialized() || !MainApp.getConfigBuilder().getPumpDescription().isSetBasalProfileCapable) {
|
||||
profileswitchButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
profileswitchButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,300 @@
|
|||
package info.nightscout.androidaps.plugins.LocalProfile;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||
import info.nightscout.androidaps.interfaces.ProfileInterface;
|
||||
import info.nightscout.androidaps.plugins.SimpleProfile.SimpleProfileFragment;
|
||||
import info.nightscout.client.data.NSProfile;
|
||||
import info.nightscout.utils.SafeParse;
|
||||
|
||||
/**
|
||||
* Created by mike on 05.08.2016.
|
||||
*/
|
||||
public class LocalProfilePlugin implements PluginBase, ProfileInterface {
|
||||
private static Logger log = LoggerFactory.getLogger(LocalProfilePlugin.class);
|
||||
|
||||
private static boolean fragmentEnabled = true;
|
||||
private static boolean fragmentVisible = true;
|
||||
|
||||
private static NSProfile convertedProfile = null;
|
||||
|
||||
final private String DEFAULTARRAY = "[{\"timeAsSeconds\":0,\"value\":0}]";
|
||||
|
||||
boolean mgdl;
|
||||
boolean mmol;
|
||||
Double dia;
|
||||
JSONArray ic;
|
||||
JSONArray isf;
|
||||
Double car;
|
||||
JSONArray basal;
|
||||
JSONArray targetLow;
|
||||
JSONArray targetHigh;
|
||||
|
||||
public LocalProfilePlugin() {
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFragmentClass() {
|
||||
return LocalProfileFragment.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return PluginBase.PROFILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return MainApp.instance().getString(R.string.localprofile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int type) {
|
||||
return type == PROFILE && fragmentEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleInTabs(int type) {
|
||||
return type == PROFILE && fragmentVisible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeHidden(int type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFragmentEnabled(int type, boolean fragmentEnabled) {
|
||||
if (type == PROFILE) this.fragmentEnabled = fragmentEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFragmentVisible(int type, boolean fragmentVisible) {
|
||||
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
||||
}
|
||||
|
||||
public void storeSettings() {
|
||||
if (Config.logPrefsChange)
|
||||
log.debug("Storing settings");
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||
SharedPreferences.Editor editor = settings.edit();
|
||||
editor.putBoolean("LocalProfile" + "mmol", mmol);
|
||||
editor.putBoolean("LocalProfile" + "mgdl", mgdl);
|
||||
editor.putString("LocalProfile" + "dia", dia.toString());
|
||||
editor.putString("LocalProfile" + "ic", ic.toString());
|
||||
editor.putString("LocalProfile" + "isf", isf.toString());
|
||||
editor.putString("LocalProfile" + "car", car.toString());
|
||||
editor.putString("LocalProfile" + "basal", basal.toString());
|
||||
editor.putString("LocalProfile" + "targetlow", targetLow.toString());
|
||||
editor.putString("LocalProfile" + "targethigh", targetHigh.toString());
|
||||
|
||||
editor.commit();
|
||||
createConvertedProfile();
|
||||
}
|
||||
|
||||
private void loadSettings() {
|
||||
if (Config.logPrefsChange)
|
||||
log.debug("Loading stored settings");
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||
|
||||
if (settings.contains("LocalProfile" + "mgdl"))
|
||||
try {
|
||||
mgdl = settings.getBoolean("LocalProfile" + "mgdl", false);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
else mgdl = false;
|
||||
if (settings.contains("LocalProfile" + "mmol"))
|
||||
try {
|
||||
mmol = settings.getBoolean("LocalProfile" + "mmol", true);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
else mmol = true;
|
||||
if (settings.contains("LocalProfile" + "dia"))
|
||||
try {
|
||||
dia = SafeParse.stringToDouble(settings.getString("LocalProfile" + "dia", "3"));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
else dia = 3d;
|
||||
if (settings.contains("LocalProfile" + "ic"))
|
||||
try {
|
||||
ic = new JSONArray(settings.getString("LocalProfile" + "ic", DEFAULTARRAY));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
try {
|
||||
ic = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
ic = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (settings.contains("LocalProfile" + "isf"))
|
||||
try {
|
||||
isf = new JSONArray(settings.getString("LocalProfile" + "isf", DEFAULTARRAY));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
try {
|
||||
isf = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
isf = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (settings.contains("LocalProfile" + "car"))
|
||||
try {
|
||||
car = SafeParse.stringToDouble(settings.getString("LocalProfile" + "car", "20"));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
else car = 20d;
|
||||
if (settings.contains("LocalProfile" + "basal"))
|
||||
try {
|
||||
basal = new JSONArray(settings.getString("LocalProfile" + "basal", DEFAULTARRAY));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
try {
|
||||
basal = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
basal = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (settings.contains("LocalProfile" + "targetlow"))
|
||||
try {
|
||||
targetLow = new JSONArray(settings.getString("LocalProfile" + "targetlow", DEFAULTARRAY));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
try {
|
||||
targetLow = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
targetLow = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (settings.contains("LocalProfile" + "targethigh"))
|
||||
try {
|
||||
targetHigh = new JSONArray(settings.getString("LocalProfile" + "targethigh", DEFAULTARRAY));
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
try {
|
||||
targetHigh = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
targetHigh = new JSONArray(DEFAULTARRAY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
createConvertedProfile();
|
||||
}
|
||||
|
||||
/*
|
||||
{
|
||||
"_id": "576264a12771b7500d7ad184",
|
||||
"startDate": "2016-06-16T08:35:00.000Z",
|
||||
"defaultProfile": "Default",
|
||||
"store": {
|
||||
"Default": {
|
||||
"dia": "3",
|
||||
"carbratio": [{
|
||||
"time": "00:00",
|
||||
"value": "30"
|
||||
}],
|
||||
"carbs_hr": "20",
|
||||
"delay": "20",
|
||||
"sens": [{
|
||||
"time": "00:00",
|
||||
"value": "100"
|
||||
}],
|
||||
"timezone": "UTC",
|
||||
"basal": [{
|
||||
"time": "00:00",
|
||||
"value": "0.1"
|
||||
}],
|
||||
"target_low": [{
|
||||
"time": "00:00",
|
||||
"value": "0"
|
||||
}],
|
||||
"target_high": [{
|
||||
"time": "00:00",
|
||||
"value": "0"
|
||||
}],
|
||||
"startDate": "1970-01-01T00:00:00.000Z",
|
||||
"units": "mmol"
|
||||
}
|
||||
},
|
||||
"created_at": "2016-06-16T08:34:41.256Z"
|
||||
}
|
||||
*/
|
||||
void createConvertedProfile() {
|
||||
JSONObject json = new JSONObject();
|
||||
JSONObject store = new JSONObject();
|
||||
JSONObject profile = new JSONObject();
|
||||
|
||||
try {
|
||||
json.put("defaultProfile", "LocalProfile");
|
||||
json.put("store", store);
|
||||
profile.put("dia", dia);
|
||||
profile.put("carbratio", ic);
|
||||
profile.put("carbs_hr", car);
|
||||
profile.put("sens", isf);
|
||||
profile.put("basal", basal);
|
||||
profile.put("target_low", targetLow);
|
||||
profile.put("target_high", targetHigh);
|
||||
profile.put("units", mgdl ? Constants.MGDL : Constants.MMOL);
|
||||
store.put("LocalProfile", profile);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
convertedProfile = new NSProfile(json, "LocalProfile");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NSProfile getProfile() {
|
||||
return convertedProfile;
|
||||
}
|
||||
|
||||
}
|
|
@ -57,7 +57,7 @@ public class MDIPlugin implements PluginBase, PumpInterface {
|
|||
pumpDescription.highTempPercentDuration = 0;
|
||||
pumpDescription.highTempAbsoluteDuration = 0;
|
||||
|
||||
pumpDescription.isSetBasalProfileCapable = true;
|
||||
pumpDescription.isSetBasalProfileCapable = false;
|
||||
pumpDescription.basalStep = 0d;
|
||||
pumpDescription.basalMinimumRate = 0d;
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ import info.nightscout.utils.DateUtil;
|
|||
import info.nightscout.utils.DecimalFormatter;
|
||||
import info.nightscout.utils.Round;
|
||||
import info.nightscout.utils.SafeParse;
|
||||
import info.nightscout.utils.ToastUtils;
|
||||
|
||||
|
||||
public class OverviewFragment extends Fragment {
|
||||
|
@ -590,7 +589,7 @@ public class OverviewFragment extends Fragment {
|
|||
|
||||
Long agoMsec = new Date().getTime() - lastBG.timeIndex;
|
||||
int agoMin = (int) (agoMsec / 60d / 1000d);
|
||||
timeAgoView.setText(agoMin + " " + getString(R.string.minago));
|
||||
timeAgoView.setText(String.format(MainApp.sResources.getString(R.string.minago), agoMin));
|
||||
|
||||
// iob
|
||||
MainApp.getConfigBuilder().getActiveTreatments().updateTotalIOB();
|
||||
|
|
|
@ -11,13 +11,17 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||
|
@ -25,7 +29,9 @@ import info.nightscout.androidaps.interfaces.FragmentBase;
|
|||
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
|
||||
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
|
||||
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
|
||||
import info.nightscout.utils.DecimalFormatter;
|
||||
import info.nightscout.utils.SafeParse;
|
||||
import info.nightscout.utils.TimeListEdit;
|
||||
|
||||
public class SimpleProfileFragment extends Fragment implements FragmentBase {
|
||||
private static Logger log = LoggerFactory.getLogger(SimpleProfileFragment.class);
|
||||
|
@ -136,6 +142,9 @@ public class SimpleProfileFragment extends Fragment implements FragmentBase {
|
|||
basalView.addTextChangedListener(textWatch);
|
||||
targetlowView.addTextChangedListener(textWatch);
|
||||
targethighView.addTextChangedListener(textWatch);
|
||||
|
||||
onStatusEvent(null);
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
@ -149,6 +158,7 @@ public class SimpleProfileFragment extends Fragment implements FragmentBase {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
onStatusEvent(null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -158,7 +168,7 @@ public class SimpleProfileFragment extends Fragment implements FragmentBase {
|
|||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!MainApp.getConfigBuilder().isInitialized()) {
|
||||
if (!MainApp.getConfigBuilder().isInitialized() || !MainApp.getConfigBuilder().getPumpDescription().isSetBasalProfileCapable) {
|
||||
profileswitchButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
profileswitchButton.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -16,7 +16,6 @@ import java.text.Normalizer;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
|
@ -210,13 +209,13 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
int agoMin = (int) (agoMsec / 60d / 1000d);
|
||||
|
||||
if (actualBG != null) {
|
||||
reply = MainApp.sResources.getString(R.string.actualbg) + " " + actualBG.valueToUnitsToString(units) + ", ";
|
||||
reply = MainApp.sResources.getString(R.string.sms_actualbg) + " " + actualBG.valueToUnitsToString(units) + ", ";
|
||||
} else if (lastBG != null) {
|
||||
reply = MainApp.sResources.getString(R.string.lastbg) + " " + lastBG.valueToUnitsToString(units) + " " + agoMin + MainApp.sResources.getString(R.string.minago) + ", ";
|
||||
reply = MainApp.sResources.getString(R.string.sms_lastbg) + " " + lastBG.valueToUnitsToString(units) + " " + String.format(MainApp.sResources.getString(R.string.sms_minago), agoMin) + ", ";
|
||||
}
|
||||
DatabaseHelper.GlucoseStatus glucoseStatus = MainApp.getDbHelper().getGlucoseStatusData();
|
||||
if (glucoseStatus != null)
|
||||
reply += MainApp.sResources.getString(R.string.delta) + ": " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units + ", ";
|
||||
reply += MainApp.sResources.getString(R.string.sms_delta) + " " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units + ", ";
|
||||
|
||||
MainApp.getConfigBuilder().getActiveTreatments().updateTotalIOB();
|
||||
IobTotal bolusIob = MainApp.getConfigBuilder().getActiveTreatments().getLastCalculation().round();
|
||||
|
@ -225,9 +224,9 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
IobTotal basalIob = MainApp.getConfigBuilder().getActiveTempBasals().getLastCalculation().round();
|
||||
if (basalIob == null) basalIob = new IobTotal();
|
||||
|
||||
reply += MainApp.sResources.getString(R.string.treatments_iob_label_string) + " " + DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
|
||||
+ MainApp.sResources.getString(R.string.bolus) + ": " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U "
|
||||
+ MainApp.sResources.getString(R.string.basal) + ": " + DecimalFormatter.to2Decimal(basalIob.basaliob) + "U)";
|
||||
reply += MainApp.sResources.getString(R.string.sms_iob) + " " + DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
|
||||
+ MainApp.sResources.getString(R.string.sms_bolus) + " " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U "
|
||||
+ MainApp.sResources.getString(R.string.sms_basal) + " " + DecimalFormatter.to2Decimal(basalIob.basaliob) + "U)";
|
||||
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
receivedSms.processed = true;
|
||||
|
@ -315,7 +314,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
resetWaitingMessages();
|
||||
sendSMS(cancelTempBasalWaitingForConfirmation = new Sms(receivedSms.phoneNumber, reply, new Date(), passCode));
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.remotebasalnotallowed);
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_remotebasalnotallowed);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
} else {
|
||||
|
@ -329,7 +328,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
sendSMS(tempBasalWaitingForConfirmation = new Sms(receivedSms.phoneNumber, reply, new Date(), passCode));
|
||||
tempBasalWaitingForConfirmation.tempBasal = tempBasal;
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.remotebasalnotallowed);
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_remotebasalnotallowed);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +336,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
break;
|
||||
case "BOLUS":
|
||||
if (new Date().getTime() - lastRemoteBolusTime.getTime() < Constants.remoteBolusMinDistance) {
|
||||
reply = MainApp.sResources.getString(R.string.remotebolusnotallowed);
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_remotebolusnotallowed);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
} else if (splited.length > 1) {
|
||||
amount = SafeParse.stringToDouble(splited[1]);
|
||||
|
@ -351,7 +350,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
sendSMS(bolusWaitingForConfirmation = new Sms(receivedSms.phoneNumber, reply, new Date(), passCode));
|
||||
bolusWaitingForConfirmation.bolusRequested = amount;
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.remotebolusnotallowed);
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_remotebolusnotallowed);
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
}
|
||||
|
@ -365,12 +364,12 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
|||
danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class);
|
||||
PumpEnactResult result = pumpInterface.deliverTreatment(bolusWaitingForConfirmation.bolusRequested, 0, null);
|
||||
if (result.success) {
|
||||
reply = String.format(MainApp.sResources.getString(R.string.bolusdelivered), result.bolusDelivered);
|
||||
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
lastRemoteBolusTime = new Date();
|
||||
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
} else {
|
||||
reply = MainApp.sResources.getString(R.string.bolusfailed);
|
||||
reply = MainApp.sResources.getString(R.string.smscommunicator_bolusfailed);
|
||||
if (danaRPlugin != null) reply += "\n" + danaRPlugin.shortStatus();
|
||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||
}
|
||||
|
|
335
app/src/main/java/info/nightscout/utils/TimeListEdit.java
Normal file
335
app/src/main/java/info/nightscout/utils/TimeListEdit.java
Normal file
|
@ -0,0 +1,335 @@
|
|||
package info.nightscout.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.Editable;
|
||||
import android.text.Layout;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
|
||||
/**
|
||||
* Created by mike on 29.12.2016.
|
||||
*/
|
||||
|
||||
public class TimeListEdit {
|
||||
private static Logger log = LoggerFactory.getLogger(TimeListEdit.class);
|
||||
|
||||
final int ONEHOURINSECONDS = 60 * 60;
|
||||
|
||||
LinearLayout layout;
|
||||
|
||||
Context context;
|
||||
View view;
|
||||
int resLayoutId;
|
||||
String label;
|
||||
JSONArray data1;
|
||||
JSONArray data2;
|
||||
NumberFormat formatter;
|
||||
Runnable save;
|
||||
|
||||
public TimeListEdit(Context context, View view, int resLayoutId, String label, JSONArray data1, JSONArray data2, NumberFormat formatter, Runnable save) {
|
||||
this.context = context;
|
||||
this.view = view;
|
||||
this.resLayoutId = resLayoutId;
|
||||
this.label = label;
|
||||
this.data1 = data1;
|
||||
this.data2 = data2;
|
||||
this.formatter = formatter;
|
||||
this.save = save;
|
||||
buildView();
|
||||
}
|
||||
|
||||
private void buildView() {
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
layout = (LinearLayout) view.findViewById(resLayoutId);
|
||||
|
||||
layout.removeAllViews();
|
||||
|
||||
TextView textlabel = new TextView(context);
|
||||
textlabel.setText(label);
|
||||
textlabel.setGravity(Gravity.LEFT);
|
||||
LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
llp.setMargins(10, 0, 0, 0); // llp.setMargins(left, top, right, bottom);
|
||||
textlabel.setLayoutParams(llp);
|
||||
textlabel.setBackgroundColor(MainApp.sResources.getColor(R.color.linearBlockBackground));
|
||||
if (Build.VERSION.SDK_INT < 23)
|
||||
textlabel.setTextAppearance(context, android.R.style.TextAppearance_Medium);
|
||||
else
|
||||
textlabel.setTextAppearance(android.R.style.TextAppearance_Medium);
|
||||
layout.addView(textlabel);
|
||||
|
||||
for (int i = 0; i < itemsCount(); i++) {
|
||||
View childview = inflater.inflate(R.layout.timelistedit_element, layout, false);
|
||||
final Spinner timeSpinner = (Spinner) childview.findViewById(R.id.timelistedit_time);
|
||||
int previous = i == 0 ? -1 * ONEHOURINSECONDS : secondFromMidnight(i - 1);
|
||||
int next = i == itemsCount() - 1 ? 24 * ONEHOURINSECONDS : secondFromMidnight(i + 1);
|
||||
if (i == 0) next = ONEHOURINSECONDS;
|
||||
fillSpinner(timeSpinner, secondFromMidnight(i), previous, next);
|
||||
|
||||
final EditText editText1 = (EditText) childview.findViewById(R.id.timelistedit_edit1);
|
||||
fillNumber(editText1, value1(i));
|
||||
final EditText editText2 = ((EditText) childview.findViewById(R.id.timelistedit_edit2));
|
||||
fillNumber(editText2, value2(i));
|
||||
if (data2 == null) {
|
||||
editText2.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
ImageView addbutton = (ImageView) childview.findViewById(R.id.timelistedit_add);
|
||||
ImageView removebutton = (ImageView) childview.findViewById(R.id.timelistedit_remove);
|
||||
|
||||
if (itemsCount() == 1 && i == 0) {
|
||||
removebutton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (itemsCount() >= 24) {
|
||||
addbutton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
final int fixedPos = i;
|
||||
addbutton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int seconds = secondFromMidnight(fixedPos);
|
||||
addItem(fixedPos, seconds, 0, 0);
|
||||
// for here for the rest of values
|
||||
for (int i = fixedPos + 1; i < itemsCount(); i++) {
|
||||
if (secondFromMidnight(i - 1) >= secondFromMidnight(i)) {
|
||||
editItem(i, secondFromMidnight(i - 1) + ONEHOURINSECONDS, value1(i), value2(i));
|
||||
}
|
||||
}
|
||||
while (itemsCount() > 24 || secondFromMidnight(itemsCount() - 1) > 23 * ONEHOURINSECONDS)
|
||||
removeItem(itemsCount() - 1);
|
||||
log();
|
||||
buildView();
|
||||
}
|
||||
});
|
||||
|
||||
removebutton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
removeItem(fixedPos);
|
||||
log();
|
||||
buildView();
|
||||
}
|
||||
});
|
||||
|
||||
timeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int seconds = DateUtil.toSeconds(timeSpinner.getSelectedItem().toString());
|
||||
editItem(fixedPos, seconds, value1(fixedPos), value2(fixedPos));
|
||||
log();
|
||||
buildView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
editItem(fixedPos, 0, value1(fixedPos), value2(fixedPos));
|
||||
log();
|
||||
buildView();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
editText1.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
editItem(fixedPos, secondFromMidnight(fixedPos), SafeParse.stringToDouble(editText1.getText().toString()), value2(fixedPos));
|
||||
log();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start,
|
||||
int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start,
|
||||
int before, int count) {
|
||||
}
|
||||
});
|
||||
|
||||
editText2.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
editItem(fixedPos, secondFromMidnight(fixedPos), value1(fixedPos), SafeParse.stringToDouble(editText2.getText().toString()));
|
||||
log();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start,
|
||||
int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start,
|
||||
int before, int count) {
|
||||
}
|
||||
});
|
||||
|
||||
layout.addView(childview);
|
||||
}
|
||||
|
||||
if (!(itemsCount() > 0 && secondFromMidnight(itemsCount() - 1) == 23 * ONEHOURINSECONDS)) {
|
||||
ImageView imageView = new ImageView(context);
|
||||
imageView.setImageResource(R.drawable.add);
|
||||
LinearLayout.LayoutParams illp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
illp.setMargins(0, 25, 0, 25); // llp.setMargins(left, top, right, bottom);
|
||||
illp.gravity = Gravity.CENTER;
|
||||
layout.addView(imageView);
|
||||
imageView.setLayoutParams(illp);
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
addItem(itemsCount(), itemsCount() > 0 ? secondFromMidnight(itemsCount() - 1) + ONEHOURINSECONDS : 0, 0, 0);
|
||||
log();
|
||||
buildView();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void fillSpinner(Spinner spinner, int secondsFromMidnight, int previous, int next) {
|
||||
int posInList = 0;
|
||||
ArrayList<CharSequence> timeList = new ArrayList<>();
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
int pos = 0;
|
||||
for (int t = previous + ONEHOURINSECONDS; t < next; t += ONEHOURINSECONDS) {
|
||||
timeList.add(df.format(DateUtil.toDate(t)));
|
||||
if (secondsFromMidnight == t) posInList = pos;
|
||||
pos++;
|
||||
}
|
||||
|
||||
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(context,
|
||||
android.R.layout.simple_spinner_item, timeList);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner.setAdapter(adapter);
|
||||
spinner.setSelection(posInList, false);
|
||||
}
|
||||
|
||||
public void fillNumber(EditText edit, Double value) {
|
||||
if (value.equals(0d))
|
||||
edit.setText("");
|
||||
else
|
||||
edit.setText(formatter.format(value));
|
||||
}
|
||||
|
||||
public int itemsCount() {
|
||||
return data1.length();
|
||||
}
|
||||
|
||||
public int secondFromMidnight(int index) {
|
||||
try {
|
||||
JSONObject item = (JSONObject) data1.get(index);
|
||||
if (item.has("timeAsSeconds")) {
|
||||
return item.getInt("timeAsSeconds");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double value1(int index) {
|
||||
try {
|
||||
JSONObject item = (JSONObject) data1.get(index);
|
||||
if (item.has("value")) {
|
||||
return item.getDouble("value");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0d;
|
||||
}
|
||||
|
||||
public double value2(int index) {
|
||||
if (data2 != null) {
|
||||
try {
|
||||
JSONObject item = (JSONObject) data2.get(index);
|
||||
if (item.has("value")) {
|
||||
return item.getDouble("value");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return 0d;
|
||||
}
|
||||
|
||||
public void editItem(int index, int timeAsSeconds, double value1, double value2) {
|
||||
try {
|
||||
JSONObject newObject1 = new JSONObject();
|
||||
newObject1.put("timeAsSeconds", timeAsSeconds);
|
||||
newObject1.put("value", value1);
|
||||
data1.put(index, newObject1);
|
||||
if (data2 != null) {
|
||||
JSONObject newObject2 = new JSONObject();
|
||||
newObject2.put("timeAsSeconds", timeAsSeconds);
|
||||
newObject2.put("value", value2);
|
||||
data2.put(index, newObject2);
|
||||
}
|
||||
if (save != null) save.run();
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void addItem(int index, int timeAsSeconds, double value1, double value2) {
|
||||
try {
|
||||
// shift data
|
||||
for (int i = data1.length(); i > index; i--) {
|
||||
data1.put(i, data1.get(i - 1));
|
||||
if (data2 != null)
|
||||
data2.put(i, data2.get(i - 1));
|
||||
}
|
||||
// add new object
|
||||
editItem(index, timeAsSeconds, value1, value2);
|
||||
if (save != null) save.run();
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void removeItem(int index) {
|
||||
data1.remove(index);
|
||||
if (data2 != null)
|
||||
data2.remove(index);
|
||||
if (save != null) save.run();
|
||||
}
|
||||
|
||||
void log() {
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
for (int i = 0; i < data1.length(); i++) {
|
||||
int pos = 0;
|
||||
log.debug(i + ": @" + df.format(DateUtil.toDate(secondFromMidnight(i))) + " " + value1(i) + (data2 != null ? " " + value2(i) : ""));
|
||||
}
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable/add.png
Normal file
BIN
app/src/main/res/drawable/add.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 420 B |
BIN
app/src/main/res/drawable/clone.png
Normal file
BIN
app/src/main/res/drawable/clone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 643 B |
BIN
app/src/main/res/drawable/remove.png
Normal file
BIN
app/src/main/res/drawable/remove.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 741 B |
118
app/src/main/res/layout/localprofile_fragment.xml
Normal file
118
app/src/main/res/layout/localprofile_fragment.xml
Normal file
|
@ -0,0 +1,118 @@
|
|||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".plugins.LocalProfile.LocalProfileFragment">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/units"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:background="@color/linearBlockBackground" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/localprofile_mgdl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/mgdl" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/localprofile_mmol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/mmol" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dia"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:background="@color/linearBlockBackground" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/localprofile_dia"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal"
|
||||
android:textAlignment="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="70dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/localprofile_ic"></LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/localprofile_isf"></LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/absorption_rate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:background="@color/linearBlockBackground" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/localprofile_car"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal"
|
||||
android:textAlignment="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="70dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/localprofile_basal"></LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/localprofile_target">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/localprofile_profileswitch"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/send_to_pump"
|
||||
android:textColor="@color/colorProfileSwitchButton" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</FrameLayout>
|
|
@ -20,6 +20,38 @@
|
|||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_apsmode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/loopmodeborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="Open Loop"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_activeprofile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/pillborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@color/colorProfileSwitchButton" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -42,10 +74,11 @@
|
|||
android:layout_gravity="top|left"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="-5dp"
|
||||
android:paddingRight="-5dp"
|
||||
android:paddingRight="-10dp"
|
||||
android:text="→"
|
||||
android:textSize="60dp"
|
||||
android:textStyle="bold" />
|
||||
android:textSize="70dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="-15dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -55,34 +88,14 @@
|
|||
android:gravity="top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_timeago"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="0.5"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_apsmode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/loopmodeborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="Medium Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_delta"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -98,19 +111,6 @@
|
|||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_activeprofile"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/pillborder"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@color/colorProfileSwitchButton" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -4,41 +4,39 @@
|
|||
android:layout_height="match_parent"
|
||||
tools:context=".plugins.SimpleProfile.SimpleProfileFragment">
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="left|top">
|
||||
|
||||
<TableRow
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/units"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/simpleprofile_mgdl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:text="@string/mgdl" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/simpleprofile_mmol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="3"
|
||||
android:text="@string/mmol" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -48,72 +46,48 @@
|
|||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_dia"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nsprofileview_ic_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_ic"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nsprofileview_isf_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_isf"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/absorption_rate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_car"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/basal_rate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
@ -122,34 +96,32 @@
|
|||
android:id="@+id/simpleprofile_basalrate"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/target_range"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_targetlow"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/simpleprofile_targethigh"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:inputType="numberDecimal" />
|
||||
</TableRow>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/simpleprofile_profileswitch"
|
||||
|
@ -161,11 +133,14 @@
|
|||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/send_to_pump"
|
||||
android:textColor="@color/colorProfileSwitchButton" />
|
||||
</TableLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
|
49
app/src/main/res/layout/timelistedit_element.xml
Normal file
49
app/src/main/res/layout/timelistedit_element.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall">
|
||||
|
||||
<Spinner
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/timelistedit_time"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/timelistedit_edit1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:inputType="numberDecimal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/timelistedit_edit2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:inputType="numberDecimal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/timelistedit_add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/add" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/timelistedit_remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/remove" />
|
||||
</LinearLayout>
|
|
@ -16,12 +16,12 @@
|
|||
<string name="careportal_announcement">Известие</string>
|
||||
<string name="careportal_bgcheck">Проверка на КЗ</string>
|
||||
<string name="careportal_carbscorrection">Корекция с въглехидр.</string>
|
||||
<string name="careportal_cgmsensorinsert">Замяна сензор</string>
|
||||
<string name="careportal_cgmsensorinsert">Смяна на сензор</string>
|
||||
<string name="careportal_cgmsensorstart">Рестарт на сензор</string>
|
||||
<string name="careportal_combobolus">Комбиниран болус</string>
|
||||
<string name="careportal_correctionbolus">Болус за корекция</string>
|
||||
<string name="careportal_exercise">Физ. активност</string>
|
||||
<string name="careportal_insulincartridgechange">Замяна резервоар</string>
|
||||
<string name="careportal_insulincartridgechange">Смяна на резервоар</string>
|
||||
<string name="careportal_mealbolus">Болус за осн. хранене</string>
|
||||
<string name="careportal_newnstreatment_absolute_label">Абсолютна</string>
|
||||
<string name="careportal_newnstreatment_carbs_label">ВХ</string>
|
||||
|
@ -41,7 +41,7 @@
|
|||
<string name="careportal_note">Бележка</string>
|
||||
<string name="careportal_openapsoffline">OpenAPS оффлайн</string>
|
||||
<string name="careportal_profileswitch">Смяна на профил</string>
|
||||
<string name="careportal_pumpsitechange">Замяна сет</string>
|
||||
<string name="careportal_pumpsitechange">Смяна на сет</string>
|
||||
<string name="careportal_question">Въпрос</string>
|
||||
<string name="careportal_snackbolus">Болус за закуска</string>
|
||||
<string name="careportal_tempbasalend">Край на временен базал</string>
|
||||
|
@ -193,7 +193,6 @@
|
|||
<string name="openapsma_maxbasal_summary">Макс. лимит на временен базал [Е/ч] </string>
|
||||
<string name="bg_lang">Български</string>
|
||||
<string name="openapsma_maxiob_summary">Макс. лимит на не болус IOB подаван от openAPS</string>
|
||||
<string name="minago">min ago</string>
|
||||
<string name="connected">Свързан</string>
|
||||
<string name="devicenotfound">Избраното устройство не съществува</string>
|
||||
<string name="disconnected">Прекъснат</string>
|
||||
|
@ -214,7 +213,7 @@
|
|||
<string name="end_user_license_agreement_text">MUST NOT BE USED TO MAKE MEDICAL DECISIONS. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</string>
|
||||
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
|
||||
<string name="bolusdelivered" formatted="false">Болус %.2fU беше подаден успешно</string>
|
||||
<string name="bolusfailed">Болусът не е доставен</string>
|
||||
<string name="smscommunicator_bolusfailed">Болусът не е доставен</string>
|
||||
<string name="canceltemp">Откажи временен базал</string>
|
||||
<string name="virtualpump_lastconnection_label">Последно свързване:</string>
|
||||
<string name="waitingforpumpresult">Изчаква резултат</string>
|
||||
|
@ -222,7 +221,7 @@
|
|||
<string name="smscommunicator_allowednumbers">Позволени телефонни номера</string>
|
||||
<string name="success">Успех</string>
|
||||
<string name="smscommunicator_bolusreplywithcode" formatted="false">За да доставите болус %.2fU отговорете с код %s</string>
|
||||
<string name="remotebolusnotallowed">Отдалечен болус не е разрешен</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">Отдалечен болус не е разрешен</string>
|
||||
<string name="reloadprofile">Обнови профила</string>
|
||||
<string name="percent">Процент</string>
|
||||
<string name="glucosetype_sensor">Сензор</string>
|
||||
|
@ -308,7 +307,7 @@
|
|||
<string name="overview_quickwizard_item_remove_button">Премахни</string>
|
||||
<string name="quickwizard">Бърз болус</string>
|
||||
<string name="quickwizardsettings">Настройки за бърз болус</string>
|
||||
<string name="remotebasalnotallowed">Не са позволени отдалечени настройки</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">Не са позволени отдалечени настройки</string>
|
||||
<string name="smscommunicator_basalreplywithcode" formatted="false">To start basal %.2fU/h reply with code %s</string>
|
||||
<string name="smscommunicator_basalstopreplywithcode" formatted="false">To stop temp basal reply with code %s</string>
|
||||
<string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string>
|
||||
|
@ -356,13 +355,13 @@
|
|||
<string name="basal_rate">Базал:</string>
|
||||
<string name="basalvaluebelowminimum">Базалните стойности са под минимума. Не е зададен профил!</string>
|
||||
<string name="batterydischarged">Батерията на помпата е изтощена</string>
|
||||
<string name="actualbg">КЗ:</string>
|
||||
<string name="sms_actualbg">КЗ:</string>
|
||||
<string name="danar_disableeasymode">Забрани EasyUI режим в помпата</string>
|
||||
<string name="danar_enableextendedbolus">Разреши удължен болус в помпата</string>
|
||||
<string name="danar_switchtouhmode">Промени режима от U/d на U/h в помпата</string>
|
||||
<string name="danarkoreanpump">DanaR за Корея</string>
|
||||
<string name="high_mark">Горна линия</string>
|
||||
<string name="lastbg">Последна КЗ:</string>
|
||||
<string name="sms_lastbg">Последна КЗ:</string>
|
||||
<string name="low_mark">Долна линия</string>
|
||||
<string name="lowbattery">Изтощена батерия</string>
|
||||
<string name="open_settings_on_wear">Отвори Опции на часовника</string>
|
||||
|
@ -376,4 +375,5 @@
|
|||
<string name="resend_all_data">Изпрати всички данни отново</string>
|
||||
<string name="wear">Wear</string>
|
||||
<string name="wrongpumpdriverselected">Избран е грешен тип помпа</string>
|
||||
<string name="minago">преди %d м.</string>
|
||||
</resources>
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
<string name="loop_setbypump_label">Nastaveno pumpou</string>
|
||||
<string name="loopdisabled">SMYČKA ZAKÁZÁNA OMEZENÍM</string>
|
||||
<string name="objectives_manualenacts">Ručně spuštěno</string>
|
||||
<string name="minago">m zpět</string>
|
||||
<string name="objectives_minimalduration">Minimální trvání</string>
|
||||
<string name="nav_backup">Záloha</string>
|
||||
<string name="nav_exit">Ukončit</string>
|
||||
|
@ -227,8 +226,8 @@
|
|||
<string name="virtualpump_lastconnection_label">Poslední spojení:</string>
|
||||
<string name="canceltemp">Zrušit dočasný bazál</string>
|
||||
<string name="bolusdelivered" formatted="false">Bolus %.2fU aplikován úspěšně</string>
|
||||
<string name="bolusfailed">Chyba při aplikování bolusu</string>
|
||||
<string name="remotebolusnotallowed">Vzdálený bolus není momentálně povolen</string>
|
||||
<string name="smscommunicator_bolusfailed">Chyba při aplikování bolusu</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">Vzdálený bolus není momentálně povolen</string>
|
||||
<string name="smscommunicator_bolusreplywithcode" formatted="false">K potvzení bolusu %.2fU odpověz SMS s kódem %s</string>
|
||||
<string name="smscommunicator">SMS komunikátor</string>
|
||||
<string name="smscommunicator_allowednumbers">Povolená tel. čísla</string>
|
||||
|
@ -301,7 +300,7 @@
|
|||
<string name="es_lang">Spanish</string>
|
||||
<string name="noprofileselected">Není vybrán žádný profil</string>
|
||||
<string name="openapsma_valueoutofrange" formatted="false">Hodnota %s je mimo přednastavený rozsah</string>
|
||||
<string name="remotebasalnotallowed">Vzdálené posílání příkazů není povoleno</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">Vzdálené posílání příkazů není povoleno</string>
|
||||
<string name="smscommunicator_basalreplywithcode" formatted="false">Na spuštění bazálu %.2fU/h odpověz SMS s kódem %s</string>
|
||||
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Na ukončení bazálu odpověz SMS s kódem %s</string>
|
||||
<string name="smscommunicator_tempbasalcanceled">Dočaný bazál zastaven</string>
|
||||
|
@ -374,6 +373,16 @@
|
|||
<string name="wrongpumpdriverselected">Vybrán špatný ovladač pumpy</string>
|
||||
<string name="basalvaluebelowminimum">Hodnota bazálu pod minimem. Nenastaveno!</string>
|
||||
<string name="mdi">Pera</string>
|
||||
<string name="actualbg">Glykémie:</string>
|
||||
<string name="lastbg">Poslední glykémie:</string>
|
||||
<string name="sms_actualbg">Glykémie:</string>
|
||||
<string name="sms_lastbg">Poslední glykémie:</string>
|
||||
<string name="minago">před %d min</string>
|
||||
<string name="sms_basal">Bazál:</string>
|
||||
<string name="sms_bolus">Bolus:</string>
|
||||
<string name="sms_delta">Rozdíl:</string>
|
||||
<string name="sms_iob">IOB:</string>
|
||||
<string name="sms_minago">před %d min</string>
|
||||
<string name="smscommunicator_bolusdelivered">Bolus %.2fU aplikován úspěšně</string>
|
||||
<string name="ongoingnotificaction">Průběžné oznámení</string>
|
||||
<string name="old_data">ZASTARALÉ</string>
|
||||
<string name="localprofile">Místní profil</string>
|
||||
</resources>
|
||||
|
|
|
@ -176,7 +176,6 @@
|
|||
<string name="carbsconstraintapplied">Carbs constraint applied</string>
|
||||
<string name="nav_resetdb">Reset Datenbanken</string>
|
||||
<string name="objectives_minimalduration">Minimale Dauer</string>
|
||||
<string name="minago">min ago</string>
|
||||
<string name="nav_refreshtreatments">Erneure treatments von NS</string>
|
||||
<string name="nav_exit">Exit</string>
|
||||
<string name="missing">Fehlend</string>
|
||||
|
@ -198,7 +197,7 @@
|
|||
<string name="nightscout">Nightscout</string>
|
||||
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
|
||||
<string name="absolute">Absolut</string>
|
||||
<string name="bolusfailed">Bolus fehlgeschlagen</string>
|
||||
<string name="smscommunicator_bolusfailed">Bolus fehlgeschlagen</string>
|
||||
<string name="canceltemp">Temp Basal abbrechen</string>
|
||||
<string name="careportal_temporarytarget">Temoräres Ziel</string>
|
||||
<string name="careportal_temporarytargetcancel">Temoräres Ziel abbrechen</string>
|
||||
|
@ -241,7 +240,7 @@
|
|||
<string name="syncprofiletopump_title">Nightscout Profil zur Pumpe synchronisieren</string>
|
||||
<string name="waitingforpumpresult">auf Pumpenergebnis warten</string>
|
||||
<string name="nobtadapter">Kein Bluetoothadapter gefunden</string>
|
||||
<string name="remotebolusnotallowed">Remote Bolus nicht erlaubt</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">Remote Bolus nicht erlaubt</string>
|
||||
<string formatted="false" name="smscommunicator_bolusreplywithcode">Um Bolus %.2fU bitte mit %s antworten</string>
|
||||
<string name="ko_lang">Korean</string>
|
||||
<string name="youareonallowedlimit">Limit erreicht</string>
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
<string name="glucose">Glucosa</string>
|
||||
<string name="delta">Delta</string>
|
||||
<string name="avgdelta">Avg. delta</string>
|
||||
<string name="minago">min antes</string>
|
||||
|
||||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="objectives">Objetivos</string>
|
||||
|
@ -240,10 +239,10 @@
|
|||
<string name="smscommunicator_allowednumbers">Números de teléfono permitidos</string>
|
||||
<string name="smscommunicator_allowednumbers_summary">XXXXXXXXXX +; + YYYYYYYYYY</string>
|
||||
<string formatted="false" name="smscommunicator_bolusreplywithcode">Para entregar bolo% .2fU responder con código% s</string>
|
||||
<string name="bolusfailed">bolo falló</string>
|
||||
<string name="smscommunicator_bolusfailed">bolo falló</string>
|
||||
<string formatted="false" name="bolusdelivered">Bolo% .2fU entregado con éxito</string>
|
||||
<string formatted="false" name="bolusdelivering">Entregando% .2fU</string>
|
||||
<string name="remotebolusnotallowed">Bolo remoto no permitido</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">Bolo remoto no permitido</string>
|
||||
<string name="glucosetype_finger">Dedo</string>
|
||||
<string name="glucosetype_sensor">Sensor</string>
|
||||
<string name="glucosetype_manual">Manual</string>
|
||||
|
@ -334,7 +333,7 @@
|
|||
<string name="ns_upload_only_summary">NS solo subida. No efectivo con SGV salvo que este seleccionada una fuente local como xDrip. No efectivo en perfiles usando perfiles NS</string>
|
||||
<string name="othersettings_title">Otros</string>
|
||||
<string name="pumpNotInitialized">¡Bomba no iniciada!</string>
|
||||
<string name="remotebasalnotallowed">No permitidos ajustes basales remotos</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">No permitidos ajustes basales remotos</string>
|
||||
<string name="reset_db_confirm">¿Realmente quiere resetear la base de datos?</string>
|
||||
<string name="smscommunicator_unknowncommand">Comando desconocido o respuesta incorrecta</string>
|
||||
<string name="fillwarning">¡Por favor asegurar que la cantidad coincide con la especificación del set de infusión!</string>
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
<string name="glucose">혈당</string>
|
||||
<string name="delta">Delta</string>
|
||||
<string name="avgdelta">Avg. delta</string>
|
||||
<string name="minago">분 전</string>
|
||||
|
||||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="objectives">목표</string>
|
||||
|
@ -238,16 +237,15 @@
|
|||
<string name="absolute">Absolute</string>
|
||||
<string name="canceltemp">임시기초주입 취소하기</string>
|
||||
<string name="smscommunicator">SMS 전송</string>
|
||||
<string name="mm640g">MM 640g</string>
|
||||
<string name="waitingforpumpresult">결과 기다리는 중</string>
|
||||
<string name="smscommunicator_allowednumbers">허가된 전화번호</string>
|
||||
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
|
||||
<string name="smscommunicator_bolusreplywithcode" formatted="false">식사주입 %.2fU 을 실행하려면 %s 를 입력하고 답장하세요</string>
|
||||
<string name="bolusfailed">Bolus failed</string>
|
||||
<string name="smscommunicator_bolusfailed">Bolus failed</string>
|
||||
<string name="bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
|
||||
<string name="bolusdelivering" formatted="false">%.2fU 주입중</string>
|
||||
<string name="smscommunicator_remotecommandsallowed">SMS 원격 명령 사용하기</string>
|
||||
<string name="remotebolusnotallowed">원격 식사주입 허용되지 않음</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">원격 식사주입 허용되지 않음</string>
|
||||
<string name="glucosetype_finger">Finger</string>
|
||||
<string name="glucosetype_sensor">Sensor</string>
|
||||
<string name="glucosetype_manual">Manual</string>
|
||||
|
@ -312,7 +310,7 @@
|
|||
<string name="smscommunicator_loopisdisabled">Loop가 중지중입니다.</string>
|
||||
<string name="smscommunicator_loopisenabled">Loop가 실행중입니다.</string>
|
||||
<string name="openapsma_valueoutofrange" formatted="false">값 %s 은 하드리밋(Hard Limit)를 벗어났습니다</string>
|
||||
<string name="remotebasalnotallowed">원격 기초주입설정이 허가되지 않았습니다</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">원격 기초주입설정이 허가되지 않았습니다</string>
|
||||
<string name="smscommunicator_basalreplywithcode" formatted="false">기초주입 %.2fU/h 을 실행하려면 %s 를 입력하고 답장하세요</string>
|
||||
<string name="smscommunicator_tempbasalset" formatted="false">Temp basal %.2fU/h for %d min started successfully</string>
|
||||
<string name="smscommunicator_tempbasalfailed">Temp basal start failed</string>
|
||||
|
@ -381,7 +379,7 @@
|
|||
<string name="danar_enableextendedbolus">펌프에서 확장식사기능을 활성화 하세요</string>
|
||||
<string name="danar_switchtouhmode">펌프에서 U/d에서 U/h로 모드를 변경하세요</string>
|
||||
<string name="basalvaluebelowminimum">기초주입값이 최소값 이하입니다. 프로파일이 설정되지 않습니다!</string>
|
||||
<string name="actualbg">BG:</string>
|
||||
<string name="lastbg">Last BG:</string>
|
||||
<string name="sms_actualbg">BG:</string>
|
||||
<string name="sms_lastbg">Last BG:</string>
|
||||
<string name="mdi">MDI</string>
|
||||
</resources>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<string name="treatments_insulin_label_string">Insulin:</string>
|
||||
<string name="treatments_carbs_label_string">Carbs:</string>
|
||||
<string name="treatments_iob_label_string">IOB:</string>
|
||||
<string name="sms_iob">IOB:</string>
|
||||
<string name="treatments_activity_string">Activity:</string>
|
||||
<string name="treatments_iobtotal_label_string">Toal IOB:</string>
|
||||
<string name="treatments_iobactivitytotal_label_string">Total IOB activity:</string>
|
||||
|
@ -75,8 +76,8 @@
|
|||
<string name="reason">Reason</string>
|
||||
<string name="glucose">Glucose</string>
|
||||
<string name="delta">Delta</string>
|
||||
<string name="sms_delta">Delta:</string>
|
||||
<string name="avgdelta">Avg. delta</string>
|
||||
<string name="minago">m ago</string>
|
||||
|
||||
<string name="configbuilder">Config Builder</string>
|
||||
<string name="objectives">Objectives</string>
|
||||
|
@ -123,7 +124,9 @@
|
|||
<string name="confirmation">Confirmation</string>
|
||||
<string name="entertreatmentquestion">Enter new treatment:</string>
|
||||
<string name="bolus">Bolus</string>
|
||||
<string name="sms_bolus">Bolus:</string>
|
||||
<string name="basal">Basal</string>
|
||||
<string name="sms_basal">Basal:</string>
|
||||
<string name="carbs">Carbs</string>
|
||||
<string name="changeyourinput">Change your input!</string>
|
||||
<string name="setextendedbolusquestion">Set new extended bolus:</string>
|
||||
|
@ -245,11 +248,12 @@
|
|||
<string name="smscommunicator_allowednumbers">Allowed phone numbers</string>
|
||||
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
|
||||
<string name="smscommunicator_bolusreplywithcode" formatted="false">To deliver bolus %.2fU reply with code %s</string>
|
||||
<string name="bolusfailed">Bolus failed</string>
|
||||
<string name="smscommunicator_bolusfailed">Bolus failed</string>
|
||||
<string name="bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
|
||||
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
|
||||
<string name="bolusdelivering" formatted="false">Delivering %.2fU</string>
|
||||
<string name="smscommunicator_remotecommandsallowed">Allow remote commands via SMS</string>
|
||||
<string name="remotebolusnotallowed">Remote bolus not allowed</string>
|
||||
<string name="smscommunicator_remotebolusnotallowed">Remote bolus not allowed</string>
|
||||
<string name="glucosetype_finger">Finger</string>
|
||||
<string name="glucosetype_sensor">Sensor</string>
|
||||
<string name="glucosetype_manual">Manual</string>
|
||||
|
@ -314,7 +318,7 @@
|
|||
<string name="smscommunicator_loopisdisabled">Loop is disabled</string>
|
||||
<string name="smscommunicator_loopisenabled">Loop is enabled</string>
|
||||
<string name="openapsma_valueoutofrange" formatted="false">Value %s is out of hard limits</string>
|
||||
<string name="remotebasalnotallowed">Remote basal setting is not allowed</string>
|
||||
<string name="smscommunicator_remotebasalnotallowed">Remote basal setting is not allowed</string>
|
||||
<string name="smscommunicator_basalreplywithcode" formatted="false">To start basal %.2fU/h reply with code %s</string>
|
||||
<string name="smscommunicator_tempbasalset" formatted="false">Temp basal %.2fU/h for %d min started successfully</string>
|
||||
<string name="smscommunicator_tempbasalfailed">Temp basal start failed</string>
|
||||
|
@ -384,9 +388,12 @@
|
|||
<string name="danar_enableextendedbolus">Enable extended boluses on pump</string>
|
||||
<string name="danar_switchtouhmode">Change mode from U/d to U/h on pump</string>
|
||||
<string name="basalvaluebelowminimum">Basal value below minimum. Profile not set!</string>
|
||||
<string name="actualbg">BG:</string>
|
||||
<string name="lastbg">Last BG:</string>
|
||||
<string name="sms_actualbg">BG:</string>
|
||||
<string name="sms_lastbg">Last BG:</string>
|
||||
<string name="mdi">MDI</string>
|
||||
<string name="ongoingnotificaction">Ongoing Notification</string>
|
||||
<string name="old_data">OLD DATA</string>
|
||||
<string name="minago">%dmin ago</string>
|
||||
<string name="sms_minago">%dmin ago</string>
|
||||
<string name="localprofile">Local Profile</string>
|
||||
</resources>
|
||||
|
|
|
@ -6,20 +6,24 @@ import static org.junit.Assert.*;
|
|||
|
||||
public class RoundTest {
|
||||
|
||||
public RoundTest(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void roundTo() {
|
||||
public void roundToTest() throws Exception {
|
||||
assertEquals( 0.55d, Round.roundTo(0.54d, 0.05d), 0.00000001d );
|
||||
assertEquals( 1d, Round.roundTo(1.49d, 1d), 0.00000001d );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void floorTo() {
|
||||
public void floorToTest() throws Exception {
|
||||
assertEquals( 0.5d, Round.floorTo(0.54d, 0.05d), 0.00000001d );
|
||||
assertEquals( 1d, Round.floorTo(1.59d, 1d), 0.00000001d );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ceilTo() {
|
||||
public void ceilToTest() throws Exception {
|
||||
assertEquals( 0.6d, Round.ceilTo(0.54d, 0.1d), 0.00000001d );
|
||||
assertEquals( 2d, Round.ceilTo(1.49999d, 1d), 0.00000001d );
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package info.nightscout.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Created by mike on 30.12.2016.
|
||||
*/
|
||||
public class TimeListEditTest {
|
||||
|
||||
/*
|
||||
JSONArray data = new JSONArray();
|
||||
JSONArray data2 = new JSONArray();
|
||||
TimeListEdit tle = new TimeListEdit(null, null, 0, "Test1", data, "ic", null, new DecimalFormat("0.00"));
|
||||
TimeListEdit tle2 = new TimeListEdit(null, null, 0, "Test2", data2, "ic", "ic2", new DecimalFormat("0.00"));
|
||||
|
||||
|
||||
@Test
|
||||
public void doArrayTest() throws Exception {
|
||||
tle.addItem(0, 0, 0.1, 0);
|
||||
tle.addItem(1, 60 * 60, 0.2, 0);
|
||||
assertEquals(2, tle.itemsCount());
|
||||
|
||||
tle.editItem(0, 2 * 60 * 60, 1, 0);
|
||||
assertEquals(2, tle.itemsCount());
|
||||
assertEquals(1d, tle.value1(0), 0.00001d);
|
||||
assertEquals( 2 * 60 * 60, tle.secondFromMidnight(0));
|
||||
tle.removeItem(0);
|
||||
assertEquals(0.2d, tle.value1(0), 0.00001d);
|
||||
assertEquals(0, tle.value2(0), 0.00001d);
|
||||
assertEquals(60 * 60, tle.secondFromMidnight(0));
|
||||
|
||||
//System.out.print(tle2.toString());
|
||||
assertEquals(0, tle2.itemsCount());
|
||||
tle2.addItem(0, 0, 1, 2);
|
||||
assertEquals(1, tle2.itemsCount());
|
||||
assertEquals(0, tle2.secondFromMidnight(0));
|
||||
assertEquals(1d, tle2.value1(0), 0.00001d);
|
||||
assertEquals(2d, tle2.value2(0), 0.00001d);
|
||||
}
|
||||
|
||||
*/
|
||||
@Test
|
||||
public void fakeTest() throws Exception {
|
||||
}
|
||||
|
||||
}
|
|
@ -43,6 +43,13 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/full/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/full/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/assets" type="java-test-resource" />
|
||||
|
@ -51,13 +58,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/full/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/full/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/full/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/full/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/full/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/full/assets" type="java-resource" />
|
||||
|
@ -66,14 +66,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/full/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/full/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/full/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/assets" type="java-test-resource" />
|
||||
|
@ -82,6 +74,14 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testFull/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
|
@ -106,14 +106,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
|
@ -122,10 +114,16 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/7.3.0/jars" />
|
||||
|
@ -134,8 +132,11 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/me.denley.wearpreferenceactivity/wearpreferenceactivity/0.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/ustwo-clockwise-debug/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||
<<<<<<< Updated upstream
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
|
@ -144,7 +145,6 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
|
Loading…
Reference in a new issue