adjusting nsclient mode

This commit is contained in:
Milos Kozak 2017-06-04 00:46:44 +02:00
parent b40cf99201
commit 1702ce7702
18 changed files with 69 additions and 36 deletions

View file

@ -11,15 +11,15 @@ public class Config {
public static final boolean LOOPENABLED = APS; public static final boolean LOOPENABLED = APS;
public static final boolean WEAR = BuildConfig.WEAR; public static final boolean WEAR = BuildConfig.WEAR;
public static final boolean NSCLIENT = BuildConfig.NSCLIENTOLNY;
public static final boolean DANAR = true && BuildConfig.PUMPDRIVERS; public static final boolean DANAR = true && BuildConfig.PUMPDRIVERS;
public static final boolean DANARv2 = true; public static final boolean DANARv2 = true && BuildConfig.PUMPDRIVERS;
public static final boolean ACTION = !BuildConfig.NSCLIENTOLNY; public static final boolean ACTION = !BuildConfig.NSCLIENTOLNY;
public static final boolean VIRTUALPUMP = !BuildConfig.NSCLIENTOLNY; public static final boolean VIRTUALPUMP = !BuildConfig.NSCLIENTOLNY;
public static final boolean MDI = !BuildConfig.NSCLIENTOLNY; public static final boolean MDI = !BuildConfig.NSCLIENTOLNY;
public static final boolean OTHERPROFILES = !BuildConfig.NSCLIENTOLNY; public static final boolean OTHERPROFILES = !BuildConfig.NSCLIENTOLNY;
public static final boolean TEMPBASALS = !BuildConfig.NSCLIENTOLNY;
public static final boolean SAFETY = !BuildConfig.NSCLIENTOLNY; public static final boolean SAFETY = !BuildConfig.NSCLIENTOLNY;
public static final boolean SMSCOMMUNICATORENABLED = !BuildConfig.NSCLIENTOLNY; public static final boolean SMSCOMMUNICATORENABLED = !BuildConfig.NSCLIENTOLNY;

View file

@ -19,7 +19,6 @@ import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.PopupMenu; import android.support.v7.widget.PopupMenu;
import android.util.AttributeSet;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -296,7 +295,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
case R.id.nav_about: case R.id.nav_about:
AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext()); AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext());
builder.setTitle(getString(R.string.app_name) + " " + BuildConfig.VERSION); builder.setTitle(getString(R.string.app_name) + " " + BuildConfig.VERSION);
if (BuildConfig.NSCLIENTOLNY) if (Config.NSCLIENT)
builder.setIcon(R.mipmap.yellowowl); builder.setIcon(R.mipmap.yellowowl);
else else
builder.setIcon(R.mipmap.blueowl); builder.setIcon(R.mipmap.blueowl);

View file

@ -114,10 +114,13 @@ public class MainApp extends Application {
pluginsList.add(TreatmentsFragment.getPlugin()); pluginsList.add(TreatmentsFragment.getPlugin());
if (Config.SAFETY) pluginsList.add(SafetyFragment.getPlugin()); if (Config.SAFETY) pluginsList.add(SafetyFragment.getPlugin());
if (Config.APS) pluginsList.add(ObjectivesFragment.getPlugin()); if (Config.APS) pluginsList.add(ObjectivesFragment.getPlugin());
pluginsList.add(SourceXdripFragment.getPlugin()); if (!Config.NSCLIENT)
pluginsList.add(SourceXdripFragment.getPlugin());
pluginsList.add(SourceNSClientFragment.getPlugin()); pluginsList.add(SourceNSClientFragment.getPlugin());
pluginsList.add(SourceMM640gFragment.getPlugin()); if (!Config.NSCLIENT)
pluginsList.add(SourceGlimpFragment.getPlugin()); pluginsList.add(SourceMM640gFragment.getPlugin());
if (!Config.NSCLIENT)
pluginsList.add(SourceGlimpFragment.getPlugin());
if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorFragment.getPlugin()); if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorFragment.getPlugin());
if (Config.WEAR) pluginsList.add(WearFragment.getPlugin(this)); if (Config.WEAR) pluginsList.add(WearFragment.getPlugin(this));

View file

@ -66,8 +66,8 @@ public class ProfileStore {
JSONObject store = json.getJSONObject("store"); JSONObject store = json.getJSONObject("store");
if (store.has(profileName)) { if (store.has(profileName)) {
String units = null; String units = null;
if (store.has("units")) if (json.has("units"))
units = store.getString("units"); units = json.getString("units");
profile = new Profile(store.getJSONObject(profileName), units); profile = new Profile(store.getJSONObject(profileName), units);
} }
} catch (JSONException e) { } catch (JSONException e) {

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.Careportal; package info.nightscout.androidaps.plugins.Careportal;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
@ -57,7 +58,7 @@ public class CareportalPlugin implements PluginBase {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -50,12 +50,15 @@ public class ConfigBuilderFragment extends Fragment {
ListView insulinListView; ListView insulinListView;
ListView bgsourceListView; ListView bgsourceListView;
TextView bgsourceLabel;
ListView pumpListView; ListView pumpListView;
TextView pumpLabel; TextView pumpLabel;
ListView loopListView; ListView loopListView;
TextView loopLabel; TextView loopLabel;
ListView treatmentsListView; ListView treatmentsListView;
TextView treatmentsLabel;
ListView profileListView; ListView profileListView;
TextView profileLabel;
ListView apsListView; ListView apsListView;
TextView apsLabel; TextView apsLabel;
ListView constraintsListView; ListView constraintsListView;
@ -94,12 +97,15 @@ public class ConfigBuilderFragment extends Fragment {
insulinListView = (ListView) view.findViewById(R.id.configbuilder_insulinlistview); insulinListView = (ListView) view.findViewById(R.id.configbuilder_insulinlistview);
bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview); bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview);
bgsourceLabel = (TextView) view.findViewById(R.id.configbuilder_bgsourcelabel);
pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview); pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview);
pumpLabel = (TextView) view.findViewById(R.id.configbuilder_pumplabel); pumpLabel = (TextView) view.findViewById(R.id.configbuilder_pumplabel);
loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview); loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview);
loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel); loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel);
treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview); treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview);
treatmentsLabel = (TextView) view.findViewById(R.id.configbuilder_treatmentslabel);
profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview); profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview);
profileLabel = (TextView) view.findViewById(R.id.configbuilder_profilelabel);
apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview); apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview);
apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel); apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel);
constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview); constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview);
@ -144,6 +150,8 @@ public class ConfigBuilderFragment extends Fragment {
setListViewHeightBasedOnChildren(insulinListView); setListViewHeightBasedOnChildren(insulinListView);
bgsourceDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(BgSourceInterface.class, PluginBase.BGSOURCE), PluginBase.BGSOURCE); bgsourceDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(BgSourceInterface.class, PluginBase.BGSOURCE), PluginBase.BGSOURCE);
bgsourceListView.setAdapter(bgsourceDataAdapter); bgsourceListView.setAdapter(bgsourceDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginBase.BGSOURCE).size() == 0)
bgsourceLabel.setVisibility(View.GONE);
setListViewHeightBasedOnChildren(bgsourceListView); setListViewHeightBasedOnChildren(bgsourceListView);
pumpDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.PUMP), PluginBase.PUMP); pumpDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.PUMP), PluginBase.PUMP);
pumpListView.setAdapter(pumpDataAdapter); pumpListView.setAdapter(pumpDataAdapter);
@ -157,9 +165,13 @@ public class ConfigBuilderFragment extends Fragment {
loopLabel.setVisibility(View.GONE); loopLabel.setVisibility(View.GONE);
treatmentsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.TREATMENT), PluginBase.TREATMENT); treatmentsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.TREATMENT), PluginBase.TREATMENT);
treatmentsListView.setAdapter(treatmentsDataAdapter); treatmentsListView.setAdapter(treatmentsDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginBase.TREATMENT).size() == 0)
treatmentsLabel.setVisibility(View.GONE);
setListViewHeightBasedOnChildren(treatmentsListView); setListViewHeightBasedOnChildren(treatmentsListView);
profileDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(ProfileInterface.class, PluginBase.BGSOURCE), PluginBase.PROFILE); profileDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(ProfileInterface.class, PluginBase.BGSOURCE), PluginBase.PROFILE);
profileListView.setAdapter(profileDataAdapter); profileListView.setAdapter(profileDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginBase.PROFILE).size() == 0)
profileLabel.setVisibility(View.GONE);
setListViewHeightBasedOnChildren(profileListView); setListViewHeightBasedOnChildren(profileListView);
apsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.APS), PluginBase.APS); apsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.APS), PluginBase.APS);
apsListView.setAdapter(apsDataAdapter); apsListView.setAdapter(apsDataAdapter);

View file

@ -22,6 +22,9 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.MealData; import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.data.OverlappingIntervals;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileIntervals;
import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.ProfileSwitch;
@ -40,15 +43,12 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface; import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.plugins.Loop.APSResult; import info.nightscout.androidaps.plugins.Loop.APSResult;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.Overview.Notification; import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventDismissBolusprogressIfRunning; import info.nightscout.androidaps.plugins.Overview.events.EventDismissBolusprogressIfRunning;
import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.NSUpload; import info.nightscout.utils.NSUpload;
import info.nightscout.androidaps.data.OverlappingIntervals;
import info.nightscout.androidaps.data.ProfileIntervals;
/** /**
* Created by mike on 05.08.2016. * Created by mike on 05.08.2016.
@ -679,6 +679,8 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
@Override @Override
public boolean isFakingTempsByExtendedBoluses() { public boolean isFakingTempsByExtendedBoluses() {
if (Config.NSCLIENT)
return false;
return activePump.isFakingTempsByExtendedBoluses(); return activePump.isFakingTempsByExtendedBoluses();
} }

View file

@ -20,6 +20,7 @@ import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventNewBG; import info.nightscout.androidaps.events.EventNewBG;
@ -27,7 +28,6 @@ import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.utils.Round; import info.nightscout.utils.Round;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
@ -232,7 +232,6 @@ public class IobCobCalculatorPlugin implements PluginBase {
return; // app still initializing return; // app still initializing
//log.debug("Locking calculateSensitivityData"); //log.debug("Locking calculateSensitivityData");
synchronized (dataLock) { synchronized (dataLock) {
Profile profile = MainApp.getConfigBuilder().getProfile();
if (bucketed_data == null || bucketed_data.size() < 3) { if (bucketed_data == null || bucketed_data.size() < 3) {
log.debug("calculateSensitivityData: No bucketed data available"); log.debug("calculateSensitivityData: No bucketed data available");
@ -247,6 +246,7 @@ public class IobCobCalculatorPlugin implements PluginBase {
// check if data already exists // check if data already exists
long bgTime = bucketed_data.get(i).date; long bgTime = bucketed_data.get(i).date;
bgTime = roundUpTime(bgTime); bgTime = roundUpTime(bgTime);
Profile profile = MainApp.getConfigBuilder().getProfile(bgTime);
AutosensData existing; AutosensData existing;
if ((existing = autosensDataTable.get(bgTime)) != null) { if ((existing = autosensDataTable.get(bgTime)) != null) {

View file

@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
@ -115,7 +116,7 @@ public class NSClientInternalPlugin implements PluginBase {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -29,6 +29,7 @@ import java.util.Date;
import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.db.DbRequest; import info.nightscout.androidaps.db.DbRequest;
import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventConfigBuilderChange; import info.nightscout.androidaps.events.EventConfigBuilderChange;
@ -50,7 +51,6 @@ import info.nightscout.androidaps.plugins.NSClientInternal.data.NSCal;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSSgv; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSSgv;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSStatus; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSStatus;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSTreatment; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSTreatment;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientNewLog; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientNewLog;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientStatus; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientStatus;

View file

@ -61,6 +61,7 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
@ -955,7 +956,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
tempTargetView.setTextColor(Color.BLACK); tempTargetView.setTextColor(Color.BLACK);
tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground)); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground));
tempTargetView.setVisibility(View.VISIBLE); tempTargetView.setVisibility(View.VISIBLE);
tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits()) + " - " + Profile.toUnitsString(tempTarget.high, Profile.fromMgdlToUnits(tempTarget.high, profile.getUnits()), profile.getUnits())); if (tempTarget.low == tempTarget.high)
tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits()));
else
tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits()) + " - " + Profile.toUnitsString(tempTarget.high, Profile.fromMgdlToUnits(tempTarget.high, profile.getUnits()), profile.getUnits()));
} if (Config.NSCLIENT) {
tempTargetView.setVisibility(View.GONE);
} else { } else {
Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL;
@ -984,7 +990,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
// **** Calibration button **** // **** Calibration button ****
if (MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginBase.BGSOURCE) && profile != null && DatabaseHelper.actualBg() != null) { if (MainApp.getSpecificPlugin(SourceXdripPlugin.class) != null && MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginBase.BGSOURCE) && profile != null && DatabaseHelper.actualBg() != null) {
calibrationButton.setVisibility(View.VISIBLE); calibrationButton.setVisibility(View.VISIBLE);
} else { } else {
calibrationButton.setVisibility(View.GONE); calibrationButton.setVisibility(View.GONE);
@ -1000,10 +1006,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
String basalText = ""; String basalText = "";
if (activeTemp != null) { if (activeTemp != null) {
basalText = activeTemp.toString() + " - "; basalText = activeTemp.toString() + " ";
} }
if (pump.getPumpDescription().isTempBasalCapable) { if (Config.NSCLIENT)
basalText += DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h"; basalText += "( " + DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + " U/h )";
else if (pump.getPumpDescription().isTempBasalCapable) {
basalText += "( " + DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h )";
} }
baseBasalView.setText(basalText); baseBasalView.setText(basalText);
@ -1202,7 +1210,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
double lastTempBasal = 0; double lastTempBasal = 0;
for (long time = fromTime; time < now; time += 1 * 60 * 1000L) { for (long time = fromTime; time < now; time += 1 * 60 * 1000L) {
TemporaryBasal tb = MainApp.getConfigBuilder().getTempBasalFromHistory(time); TemporaryBasal tb = MainApp.getConfigBuilder().getTempBasalFromHistory(time);
double baseBasalValue = profile.getBasal(Profile.secondsFromMidnight(new Date(time))); double baseBasalValue = MainApp.getConfigBuilder().getProfile(time).getBasal(Profile.secondsFromMidnight(time));
double baseLineValue = baseBasalValue; double baseLineValue = baseBasalValue;
double tempBasalValue = 0; double tempBasalValue = 0;
double basal = 0d; double basal = 0d;

View file

@ -14,10 +14,10 @@ import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.Services.Intents; import info.nightscout.androidaps.Services.Intents;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.ProfileInterface; import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI; import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI;
import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin; import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
@ -62,12 +62,12 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface {
@Override @Override
public boolean isEnabled(int type) { public boolean isEnabled(int type) {
return type == PROFILE && fragmentEnabled; return type == PROFILE && (Config.NSCLIENT || fragmentEnabled);
} }
@Override @Override
public boolean isVisibleInTabs(int type) { public boolean isVisibleInTabs(int type) {
return type == PROFILE && fragmentVisible; return type == PROFILE && (Config.NSCLIENT ||fragmentVisible);
} }
@Override @Override
@ -82,7 +82,7 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.SourceNSClient; package info.nightscout.androidaps.plugins.SourceNSClient;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.BgSourceInterface; import info.nightscout.androidaps.interfaces.BgSourceInterface;
@ -35,7 +36,7 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface {
@Override @Override
public boolean isEnabled(int type) { public boolean isEnabled(int type) {
return type == BGSOURCE && fragmentEnabled; return Config.NSCLIENT || type == BGSOURCE && fragmentEnabled;
} }
@Override @Override
@ -55,7 +56,7 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
@ -18,12 +19,14 @@ import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Iob; import info.nightscout.androidaps.data.Iob;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.MealData; import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.data.OverlappingIntervals;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileIntervals;
import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.ProfileSwitch;
import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventProfileSwitchChange; import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventReloadTempBasalData; import info.nightscout.androidaps.events.EventReloadTempBasalData;
import info.nightscout.androidaps.events.EventReloadTreatmentData; import info.nightscout.androidaps.events.EventReloadTreatmentData;
@ -33,9 +36,6 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface; import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData; import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.OverlappingIntervals;
import info.nightscout.androidaps.data.ProfileIntervals;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
/** /**
@ -99,7 +99,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -74,6 +74,7 @@ public class TreatmentsTemporaryBasalsFragment extends Fragment {
holder.netInsulin.setText(""); holder.netInsulin.setText("");
holder.netRatio.setText(""); holder.netRatio.setText("");
holder.extendedFlag.setVisibility(View.GONE); holder.extendedFlag.setVisibility(View.GONE);
holder.iob.setTextColor(holder.netRatio.getCurrentTextColor());
} else { } else {
if (tempBasal.isInProgress()) { if (tempBasal.isInProgress()) {
holder.date.setText(DateUtil.dateAndTimeString(tempBasal.date)); holder.date.setText(DateUtil.dateAndTimeString(tempBasal.date));

View file

@ -11,6 +11,7 @@ import com.squareup.otto.Subscribe;
import java.util.Date; import java.util.Date;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
@ -98,7 +99,7 @@ public class StatuslinePlugin implements PluginBase {
@Override @Override
public boolean showInList(int type) { public boolean showInList(int type) {
return true; return !Config.NSCLIENT;
} }
@Override @Override

View file

@ -43,6 +43,7 @@
<TextView <TextView
android:id="@+id/configbuilder_bgsourcelabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
@ -113,6 +114,7 @@
android:background="@color/cardColorBackground" /> android:background="@color/cardColorBackground" />
<TextView <TextView
android:id="@+id/configbuilder_profilelabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
@ -129,6 +131,7 @@
android:background="@color/cardColorBackground" /> android:background="@color/cardColorBackground" />
<TextView <TextView
android:id="@+id/configbuilder_treatmentslabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"

View file

@ -17,11 +17,12 @@
android:id="@+id/profileview_noprofile" android:id="@+id/profileview_noprofile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/noprofileset" android:text="@string/noprofileset"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/holo_red_light" android:textColor="@android:color/holo_red_light"
android:textStyle="bold" android:textStyle="bold"
android:gravity="center_horizontal" /> android:visibility="gone" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"