Merge branch 'dev' into double_bolus_debug
This commit is contained in:
commit
4917292806
40 changed files with 471 additions and 336 deletions
|
@ -78,7 +78,7 @@ public class MainActivity extends NoSplashAppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
Iconify.with(new FontAwesomeModule());
|
||||
LocaleHelper.onCreate(this, "en");
|
||||
LocaleHelper.INSTANCE.update(getApplicationContext());
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
setSupportActionBar(findViewById(R.id.toolbar));
|
||||
|
@ -117,24 +117,6 @@ public class MainActivity extends NoSplashAppCompatActivity {
|
|||
VersionCheckerUtilsKt.triggerCheckVersion();
|
||||
|
||||
FabricPrivacy.setUserStats();
|
||||
}
|
||||
|
||||
private void checkPluginPreferences(ViewPager viewPager) {
|
||||
if (pluginPreferencesMenuItem == null) return;
|
||||
if (((TabPageAdapter) viewPager.getAdapter()).getPluginAt(viewPager.getCurrentItem()).getPreferencesId() != -1)
|
||||
pluginPreferencesMenuItem.setEnabled(true);
|
||||
else pluginPreferencesMenuItem.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
|
||||
super.onPostCreate(savedInstanceState, persistentState);
|
||||
actionBarDrawerToggle.syncState();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
setupTabs();
|
||||
setupViews();
|
||||
|
@ -143,8 +125,7 @@ public class MainActivity extends NoSplashAppCompatActivity {
|
|||
.toObservable(EventRebuildTabs.class)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(event -> {
|
||||
String lang = SP.getString(R.string.key_language, "en");
|
||||
LocaleHelper.setLocale(getApplicationContext(), lang);
|
||||
LocaleHelper.INSTANCE.update(getApplicationContext());
|
||||
if (event.getRecreate()) {
|
||||
recreate();
|
||||
} else {
|
||||
|
@ -175,9 +156,22 @@ public class MainActivity extends NoSplashAppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkPluginPreferences(ViewPager viewPager) {
|
||||
if (pluginPreferencesMenuItem == null) return;
|
||||
if (((TabPageAdapter) viewPager.getAdapter()).getPluginAt(viewPager.getCurrentItem()).getPreferencesId() != -1)
|
||||
pluginPreferencesMenuItem.setEnabled(true);
|
||||
else pluginPreferencesMenuItem.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
public void onPostCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
|
||||
super.onPostCreate(savedInstanceState, persistentState);
|
||||
actionBarDrawerToggle.syncState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
disposable.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,9 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
|||
import info.nightscout.androidaps.plugins.constraints.dstHelper.DstHelperPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.storage.StorageConstraintPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.automation.AutomationPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.careportal.CareportalPlugin;
|
||||
|
@ -48,9 +50,7 @@ import info.nightscout.androidaps.plugins.general.nsclient.receivers.AckAlarmRec
|
|||
import info.nightscout.androidaps.plugins.general.nsclient.receivers.DBAccessReceiver;
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.persistentNotification.PersistentNotificationPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin;
|
||||
import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.xdripStatusline.StatuslinePlugin;
|
||||
import info.nightscout.androidaps.plugins.insulin.InsulinOrefFreePeakPlugin;
|
||||
|
@ -88,6 +88,7 @@ import info.nightscout.androidaps.receivers.NSAlarmReceiver;
|
|||
import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver;
|
||||
import info.nightscout.androidaps.services.Intents;
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy;
|
||||
import info.nightscout.androidaps.utils.LocaleHelper;
|
||||
import io.fabric.sdk.android.Fabric;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtilsKt.triggerCheckVersion;
|
||||
|
@ -124,6 +125,7 @@ public class MainApp extends Application {
|
|||
log.debug("onCreate");
|
||||
sInstance = this;
|
||||
sResources = getResources();
|
||||
LocaleHelper.INSTANCE.update(this);
|
||||
sConstraintsChecker = new ConstraintChecker();
|
||||
sDatabaseHelper = OpenHelperManager.getHelper(sInstance, DatabaseHelper.class);
|
||||
|
||||
|
@ -191,9 +193,9 @@ public class MainApp extends Application {
|
|||
pluginsList.add(TreatmentsPlugin.getPlugin());
|
||||
if (!Config.NSCLIENT) pluginsList.add(SafetyPlugin.getPlugin());
|
||||
if (!Config.NSCLIENT) pluginsList.add(VersionCheckerPlugin.INSTANCE);
|
||||
if (!Config.NSCLIENT) pluginsList.add(StorageConstraintPlugin.getPlugin());
|
||||
if (!Config.NSCLIENT) pluginsList.add(SignatureVerifierPlugin.getPlugin());
|
||||
if (!Config.APS) pluginsList.add(ObjectivesPlugin.INSTANCE);
|
||||
if (Config.APS) pluginsList.add(StorageConstraintPlugin.getPlugin());
|
||||
if (Config.APS) pluginsList.add(SignatureVerifierPlugin.getPlugin());
|
||||
if (Config.APS) pluginsList.add(ObjectivesPlugin.INSTANCE);
|
||||
pluginsList.add(SourceXdripPlugin.getPlugin());
|
||||
pluginsList.add(SourceNSClientPlugin.getPlugin());
|
||||
pluginsList.add(SourceMM640gPlugin.getPlugin());
|
||||
|
|
|
@ -70,8 +70,6 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
|||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
RxBus.INSTANCE.send(new EventPreferenceChange(key));
|
||||
if (key.equals("language")) {
|
||||
String lang = sharedPreferences.getString("language", "en");
|
||||
LocaleHelper.setLocale(getApplicationContext(), lang);
|
||||
RxBus.INSTANCE.send(new EventRebuildTabs(true));
|
||||
//recreate() does not update language so better close settings
|
||||
finish();
|
||||
|
|
|
@ -51,7 +51,6 @@ class ObjectivesFragment : Fragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
objectives_recyclerview.layoutManager = LinearLayoutManager(view.context)
|
||||
objectives_recyclerview.adapter = objectivesAdapter
|
||||
objectives_fake.setOnClickListener { updateGUI() }
|
||||
|
@ -208,6 +207,13 @@ class ObjectivesFragment : Fragment() {
|
|||
holder.accomplished.setTextColor(-0x3e3e3f)
|
||||
holder.verify.setOnClickListener {
|
||||
holder.verify.visibility = View.INVISIBLE
|
||||
NetworkChangeReceiver.fetch()
|
||||
if (objectives_fake.isChecked) {
|
||||
objective.accomplishedOn = DateUtil.now()
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else
|
||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||
override fun run() {
|
||||
activity?.runOnUiThread {
|
||||
|
@ -218,9 +224,9 @@ class ObjectivesFragment : Fragment() {
|
|||
} else if (success) {
|
||||
if (objective.isCompleted(time)) {
|
||||
objective.accomplishedOn = time
|
||||
notifyDataSetChanged()
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else {
|
||||
ToastUtils.showToastInUiThread(context, R.string.requirementnotmet)
|
||||
}
|
||||
|
@ -233,8 +239,15 @@ class ObjectivesFragment : Fragment() {
|
|||
}
|
||||
holder.start.setOnClickListener {
|
||||
holder.start.visibility = View.INVISIBLE
|
||||
NetworkChangeReceiver.fetch()
|
||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||
override fun run() {
|
||||
if (objectives_fake.isChecked) {
|
||||
objective.startedOn = time
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else
|
||||
activity?.runOnUiThread {
|
||||
holder.start.visibility = View.VISIBLE
|
||||
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
||||
|
@ -242,9 +255,9 @@ class ObjectivesFragment : Fragment() {
|
|||
ToastUtils.showToastInUiThread(context, R.string.notconnected)
|
||||
} else if (success) {
|
||||
objective.startedOn = time
|
||||
notifyDataSetChanged()
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else {
|
||||
ToastUtils.showToastInUiThread(context, R.string.failedretrievetime)
|
||||
}
|
||||
|
@ -259,8 +272,8 @@ class ObjectivesFragment : Fragment() {
|
|||
val prevObj = ObjectivesPlugin.objectives[position - 1]
|
||||
prevObj.accomplishedOn = 0
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
scrollToCurrentObjective()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
}
|
||||
if (objective.hasSpecialInput && !objective.isAccomplished && objective.isStarted) {
|
||||
// generate random request code if none exists
|
||||
|
@ -274,7 +287,7 @@ class ObjectivesFragment : Fragment() {
|
|||
holder.enterButton.setOnClickListener {
|
||||
val input = holder.input.text.toString()
|
||||
objective.specialAction(activity, input)
|
||||
notifyDataSetChanged()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
}
|
||||
} else {
|
||||
holder.enterButton.visibility = View.GONE
|
||||
|
|
|
@ -21,8 +21,8 @@ import java.util.*
|
|||
object ObjectivesPlugin : PluginBase(PluginDescription()
|
||||
.mainType(PluginType.CONSTRAINTS)
|
||||
.fragmentClass(ObjectivesFragment::class.qualifiedName)
|
||||
.alwaysEnabled(!Config.NSCLIENT)
|
||||
.showInList(!Config.NSCLIENT)
|
||||
.alwaysEnabled(Config.APS)
|
||||
.showInList(Config.APS)
|
||||
.pluginName(R.string.objectives)
|
||||
.shortName(R.string.objectives_shortname)
|
||||
.description(R.string.description_objectives)), ConstraintsInterface {
|
||||
|
|
|
@ -57,12 +57,11 @@ class ObjectivesExamDialog : DialogFragment() {
|
|||
objectives_exam_question.setText(task.question)
|
||||
// Options
|
||||
objectives_exam_options.removeAllViews()
|
||||
for (o in task.options) {
|
||||
val option: Option = o as Option;
|
||||
val cb = option.generate(context)
|
||||
task.options.forEach {
|
||||
val cb = it.generate(context)
|
||||
if (task.answered) {
|
||||
cb.isEnabled = false
|
||||
if (option.isCorrect)
|
||||
if (it.isCorrect)
|
||||
cb.isChecked = true
|
||||
}
|
||||
objectives_exam_options.addView(cb)
|
||||
|
|
|
@ -230,7 +230,7 @@ public abstract class Objective {
|
|||
return question;
|
||||
}
|
||||
|
||||
public List getOptions() {
|
||||
public List<Objective.Option> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
@ -199,6 +199,11 @@ public class Objective2 extends Objective {
|
|||
.hint(new Hint(R.string.profileswitchtime_hint1))
|
||||
);
|
||||
|
||||
tasks.add(new ExamTask(R.string.other_medication_label, R.string.other_medication_text,"otherMedicationWarning")
|
||||
.option(new Option(R.string.yes, true))
|
||||
.option(new Option(R.string.no, false))
|
||||
);
|
||||
|
||||
for (Task task : tasks)
|
||||
Collections.shuffle(((ExamTask)task).options);
|
||||
}
|
||||
|
|
|
@ -74,14 +74,11 @@ class AutomationFragment : Fragment() {
|
|||
|
||||
@Synchronized
|
||||
private fun updateGui() {
|
||||
if (eventListAdapter == null) return
|
||||
eventListAdapter?.notifyDataSetChanged()
|
||||
val sb = StringBuilder()
|
||||
for (l in AutomationPlugin.executionLog.reversed()) {
|
||||
sb.append(l)
|
||||
sb.append("\n")
|
||||
}
|
||||
automation_logView.text = sb.toString()
|
||||
for (l in AutomationPlugin.executionLog.reversed())
|
||||
sb.append(l).append("\n")
|
||||
automation_logView?.text = sb.toString()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class NsClientReceiverDelegate {
|
|||
|
||||
private final Context context;
|
||||
|
||||
private NetworkChangeReceiver networkChangeReceiver = new NetworkChangeReceiver();
|
||||
private NetworkChangeReceiver networkChangeReceiver = NetworkChangeReceiver.instance;
|
||||
private ChargingStateReceiver chargingStateReceiver = new ChargingStateReceiver();
|
||||
|
||||
private boolean allowedChargingState = true;
|
||||
|
|
|
@ -30,6 +30,7 @@ import kotlinx.android.synthetic.main.overview_wizard_dialog.*
|
|||
import org.slf4j.LoggerFactory
|
||||
import java.text.DecimalFormat
|
||||
import java.util.*
|
||||
import kotlin.math.abs
|
||||
|
||||
class WizardDialog : DialogFragment() {
|
||||
private val log = LoggerFactory.getLogger(WizardDialog::class.java)
|
||||
|
@ -69,10 +70,10 @@ class WizardDialog : DialogFragment() {
|
|||
|
||||
override fun onSaveInstanceState(savedInstanceState: Bundle) {
|
||||
super.onSaveInstanceState(savedInstanceState)
|
||||
savedInstanceState.putDouble("treatments_wizard_bginput", treatments_wizard_bginput.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_carbsinput", treatments_wizard_carbsinput.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_correctioninput", treatments_wizard_correctioninput.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_carbtimeinput", treatments_wizard_carbtimeinput.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_bg_input", treatments_wizard_bg_input.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_carbs_input", treatments_wizard_carbs_input.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_correction_input", treatments_wizard_correction_input.value)
|
||||
savedInstanceState.putDouble("treatments_wizard_carb_time_input", treatments_wizard_carb_time_input.value)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
|
@ -94,19 +95,19 @@ class WizardDialog : DialogFragment() {
|
|||
val maxCarbs = MainApp.getConstraintChecker().maxCarbsAllowed.value()
|
||||
val maxCorrection = MainApp.getConstraintChecker().maxBolusAllowed.value()
|
||||
|
||||
treatments_wizard_bginput.setParams(savedInstanceState?.getDouble("treatments_wizard_bginput")
|
||||
treatments_wizard_bg_input.setParams(savedInstanceState?.getDouble("treatments_wizard_bg_input")
|
||||
?: 0.0, 0.0, 500.0, 0.1, DecimalFormat("0.0"), false, ok, textWatcher)
|
||||
treatments_wizard_carbsinput.setParams(savedInstanceState?.getDouble("treatments_wizard_carbsinput")
|
||||
treatments_wizard_carbs_input.setParams(savedInstanceState?.getDouble("treatments_wizard_carbs_input")
|
||||
?: 0.0, 0.0, maxCarbs.toDouble(), 1.0, DecimalFormat("0"), false, ok, textWatcher)
|
||||
val bolusstep = ConfigBuilderPlugin.getPlugin().activePump?.pumpDescription?.bolusStep
|
||||
val bolusStep = ConfigBuilderPlugin.getPlugin().activePump?.pumpDescription?.bolusStep
|
||||
?: 0.1
|
||||
treatments_wizard_correctioninput.setParams(savedInstanceState?.getDouble("treatments_wizard_correctioninput")
|
||||
?: 0.0, -maxCorrection, maxCorrection, bolusstep, DecimalFormatter.pumpSupportedBolusFormat(), false, ok, textWatcher)
|
||||
treatments_wizard_carbtimeinput.setParams(savedInstanceState?.getDouble("treatments_wizard_carbtimeinput")
|
||||
treatments_wizard_correction_input.setParams(savedInstanceState?.getDouble("treatments_wizard_correction_input")
|
||||
?: 0.0, -maxCorrection, maxCorrection, bolusStep, DecimalFormatter.pumpSupportedBolusFormat(), false, ok, textWatcher)
|
||||
treatments_wizard_carb_time_input.setParams(savedInstanceState?.getDouble("treatments_wizard_carb_time_input")
|
||||
?: 0.0, -60.0, 60.0, 5.0, DecimalFormat("0"), false, ok, textWatcher)
|
||||
initDialog()
|
||||
|
||||
treatments_wizard_percent_used.text = SP.getInt(R.string.key_boluswizard_percentage, 100).toString() + "%"
|
||||
treatments_wizard_percent_used.text = MainApp.gs(R.string.format_percent, SP.getInt(R.string.key_boluswizard_percentage, 100))
|
||||
// ok button
|
||||
ok.setOnClickListener {
|
||||
if (okClicked) {
|
||||
|
@ -130,10 +131,13 @@ class WizardDialog : DialogFragment() {
|
|||
treatments_wizard_bgtrendcheckbox.setOnCheckedChangeListener { buttonView, _ -> onCheckedChanged(buttonView) }
|
||||
treatments_wizard_sbcheckbox.setOnCheckedChangeListener { buttonView, _ -> onCheckedChanged(buttonView) }
|
||||
|
||||
treatments_wizard_delimiter.visibility = View.GONE
|
||||
treatments_wizard_resulttable.visibility = View.GONE
|
||||
val showCalc = SP.getBoolean(MainApp.gs(R.string.key_wizard_calculation_visible), false)
|
||||
treatments_wizard_delimiter.visibility = if (showCalc) View.VISIBLE else View.GONE
|
||||
treatments_wizard_resulttable.visibility = if (showCalc) View.VISIBLE else View.GONE
|
||||
treatments_wizard_calculationcheckbox.isChecked = showCalc
|
||||
treatments_wizard_calculationcheckbox.setOnCheckedChangeListener { _, isChecked ->
|
||||
run {
|
||||
SP.putBoolean(MainApp.gs(R.string.key_wizard_calculation_visible), isChecked)
|
||||
treatments_wizard_delimiter.visibility = if (isChecked) View.VISIBLE else View.GONE
|
||||
treatments_wizard_resulttable.visibility = if (isChecked) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
@ -168,7 +172,7 @@ class WizardDialog : DialogFragment() {
|
|||
disposable.clear()
|
||||
}
|
||||
|
||||
fun onCheckedChanged(buttonView: CompoundButton) {
|
||||
private fun onCheckedChanged(buttonView: CompoundButton) {
|
||||
saveCheckedStates()
|
||||
treatments_wizard_ttcheckbox.isEnabled = treatments_wizard_bgcheckbox.isChecked && TreatmentsPlugin.getPlugin().tempTargetFromHistory != null
|
||||
if (buttonView.id == treatments_wizard_cobcheckbox.id)
|
||||
|
@ -220,17 +224,17 @@ class WizardDialog : DialogFragment() {
|
|||
val units = profile.units
|
||||
treatments_wizard_bgunits.text = units
|
||||
if (units == Constants.MGDL)
|
||||
treatments_wizard_bginput.setStep(1.0)
|
||||
treatments_wizard_bg_input.setStep(1.0)
|
||||
else
|
||||
treatments_wizard_bginput.setStep(0.1)
|
||||
treatments_wizard_bg_input.setStep(0.1)
|
||||
|
||||
// Set BG if not old
|
||||
val lastBg = DatabaseHelper.actualBg()
|
||||
|
||||
if (lastBg != null) {
|
||||
treatments_wizard_bginput.value = lastBg.valueToUnits(units)
|
||||
treatments_wizard_bg_input.value = lastBg.valueToUnits(units)
|
||||
} else {
|
||||
treatments_wizard_bginput.value = 0.0
|
||||
treatments_wizard_bg_input.value = 0.0
|
||||
}
|
||||
treatments_wizard_ttcheckbox.isEnabled = TreatmentsPlugin.getPlugin().tempTargetFromHistory != null
|
||||
|
||||
|
@ -263,29 +267,29 @@ class WizardDialog : DialogFragment() {
|
|||
if (specificProfile == null) return
|
||||
|
||||
// Entered values
|
||||
var c_bg = SafeParse.stringToDouble(treatments_wizard_bginput.text)
|
||||
val c_carbs = SafeParse.stringToInt(treatments_wizard_carbsinput.text)
|
||||
val c_correction = SafeParse.stringToDouble(treatments_wizard_correctioninput.text)
|
||||
val carbsAfterConstraint = MainApp.getConstraintChecker().applyCarbsConstraints(Constraint(c_carbs)).value()
|
||||
if (Math.abs(c_carbs - carbsAfterConstraint) > 0.01) {
|
||||
treatments_wizard_carbsinput.value = 0.0
|
||||
var bg = SafeParse.stringToDouble(treatments_wizard_bg_input.text)
|
||||
val carbs = SafeParse.stringToInt(treatments_wizard_carbs_input.text)
|
||||
val correction = SafeParse.stringToDouble(treatments_wizard_correction_input.text)
|
||||
val carbsAfterConstraint = MainApp.getConstraintChecker().applyCarbsConstraints(Constraint(carbs)).value()
|
||||
if (abs(carbs - carbsAfterConstraint) > 0.01) {
|
||||
treatments_wizard_carbs_input.value = 0.0
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().applicationContext, MainApp.gs(R.string.carbsconstraintapplied))
|
||||
return
|
||||
}
|
||||
|
||||
c_bg = if (treatments_wizard_bgcheckbox.isChecked) c_bg else 0.0
|
||||
bg = if (treatments_wizard_bgcheckbox.isChecked) bg else 0.0
|
||||
val tempTarget = if (treatments_wizard_ttcheckbox.isChecked) TreatmentsPlugin.getPlugin().tempTargetFromHistory else null
|
||||
|
||||
// COB
|
||||
var c_cob = 0.0
|
||||
var cob = 0.0
|
||||
if (treatments_wizard_cobcheckbox.isChecked) {
|
||||
val cobInfo = IobCobCalculatorPlugin.getPlugin().getCobInfo(false, "Wizard COB")
|
||||
cobInfo.displayCob?.let { c_cob = it }
|
||||
cobInfo.displayCob?.let { cob = it }
|
||||
}
|
||||
|
||||
val carbTime = SafeParse.stringToInt(treatments_wizard_carbtimeinput.text)
|
||||
val carbTime = SafeParse.stringToInt(treatments_wizard_carb_time_input.text)
|
||||
|
||||
wizard = BolusWizard(specificProfile, profileName, tempTarget, carbsAfterConstraint, c_cob, c_bg, c_correction,
|
||||
wizard = BolusWizard(specificProfile, profileName, tempTarget, carbsAfterConstraint, cob, bg, correction,
|
||||
SP.getInt(R.string.key_boluswizard_percentage, 100).toDouble(),
|
||||
treatments_wizard_bgcheckbox.isChecked,
|
||||
treatments_wizard_cobcheckbox.isChecked,
|
||||
|
@ -297,10 +301,10 @@ class WizardDialog : DialogFragment() {
|
|||
treatment_wizard_notes.text.toString(), carbTime)
|
||||
|
||||
wizard?.let { wizard ->
|
||||
treatments_wizard_bg.text = String.format(MainApp.gs(R.string.format_bg_isf), BgReading().value(Profile.toMgdl(c_bg, specificProfile.units)).valueToUnitsToString(specificProfile.units), wizard.sens)
|
||||
treatments_wizard_bg.text = String.format(MainApp.gs(R.string.format_bg_isf), BgReading().value(Profile.toMgdl(bg, specificProfile.units)).valueToUnitsToString(specificProfile.units), wizard.sens)
|
||||
treatments_wizard_bginsulin.text = StringUtils.formatInsulin(wizard.insulinFromBG)
|
||||
|
||||
treatments_wizard_carbs.text = String.format(MainApp.gs(R.string.format_carbs_ic), c_carbs.toDouble(), wizard.ic)
|
||||
treatments_wizard_carbs.text = String.format(MainApp.gs(R.string.format_carbs_ic), carbs.toDouble(), wizard.ic)
|
||||
treatments_wizard_carbsinsulin.text = StringUtils.formatInsulin(wizard.insulinFromCarbs)
|
||||
|
||||
treatments_wizard_bolusiobinsulin.text = StringUtils.formatInsulin(wizard.insulinFromBolusIOB)
|
||||
|
@ -324,7 +328,7 @@ class WizardDialog : DialogFragment() {
|
|||
|
||||
// COB
|
||||
if (treatments_wizard_cobcheckbox.isChecked) {
|
||||
treatments_wizard_cob.text = String.format(MainApp.gs(R.string.format_cob_ic), c_cob, wizard.ic)
|
||||
treatments_wizard_cob.text = String.format(MainApp.gs(R.string.format_cob_ic), cob, wizard.ic)
|
||||
treatments_wizard_cobinsulin.text = StringUtils.formatInsulin(wizard.insulinFromCOB)
|
||||
} else {
|
||||
treatments_wizard_cob.text = ""
|
||||
|
@ -332,12 +336,12 @@ class WizardDialog : DialogFragment() {
|
|||
}
|
||||
|
||||
if (wizard.calculatedTotalInsulin > 0.0 || carbsAfterConstraint > 0.0) {
|
||||
val insulinText = if (wizard.calculatedTotalInsulin > 0.0) DecimalFormatter.toPumpSupportedBolus(wizard.calculatedTotalInsulin) + "U" else ""
|
||||
val carbsText = if (carbsAfterConstraint > 0.0) DecimalFormatter.to0Decimal(carbsAfterConstraint.toDouble()) + "g" else ""
|
||||
treatments_wizard_total.text = MainApp.gs(R.string.result) + ": " + insulinText + " " + carbsText
|
||||
val insulinText = if (wizard.calculatedTotalInsulin > 0.0) MainApp.gs(R.string.formatinsulinunits, wizard.calculatedTotalInsulin) else ""
|
||||
val carbsText = if (carbsAfterConstraint > 0.0) MainApp.gs(R.string.format_carbs, carbsAfterConstraint) else ""
|
||||
treatments_wizard_total.text = MainApp.gs(R.string.result_insulin_carbs, insulinText, carbsText)
|
||||
ok.visibility = View.VISIBLE
|
||||
} else {
|
||||
treatments_wizard_total.text = MainApp.gs(R.string.missing) + " " + DecimalFormatter.to0Decimal(wizard.carbsEquivalent) + "g"
|
||||
treatments_wizard_total.text = MainApp.gs(R.string.missing_carbs, wizard.carbsEquivalent.toInt())
|
||||
ok.visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class EventTidepoolStatus(val status: String) : Event() {
|
|||
log.debug("New status: $status")
|
||||
}
|
||||
|
||||
private var timeFormat = SimpleDateFormat("HH:mm:ss", LocaleHelper.getLocale())
|
||||
private var timeFormat = SimpleDateFormat("HH:mm:ss", LocaleHelper.currentLocale())
|
||||
|
||||
fun toPreparedHtml(): StringBuilder {
|
||||
val stringBuilder = StringBuilder()
|
||||
|
|
|
@ -250,4 +250,29 @@ public class DateTimeUtil {
|
|||
|
||||
return minutes.getMinutes();
|
||||
}
|
||||
|
||||
|
||||
public static long getMillisFromATDWithAddedMinutes(long atd, int minutesDiff) {
|
||||
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
|
||||
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
|
||||
|
||||
return oldestEntryTime.getTimeInMillis();
|
||||
}
|
||||
|
||||
|
||||
public static long getATDWithAddedMinutes(long atd, int minutesDiff) {
|
||||
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
|
||||
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
|
||||
|
||||
return oldestEntryTime.getTimeInMillis();
|
||||
}
|
||||
|
||||
|
||||
public static long getATDWithAddedMinutes(GregorianCalendar oldestEntryTime, int minutesDiff) {
|
||||
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
|
||||
|
||||
return toATechDate(oldestEntryTime);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import com.google.gson.GsonBuilder;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.joda.time.LocalDateTime;
|
||||
import org.joda.time.Minutes;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -20,6 +22,7 @@ import java.util.Map;
|
|||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||
import info.nightscout.androidaps.db.CareportalEvent;
|
||||
import info.nightscout.androidaps.db.DatabaseHelper;
|
||||
import info.nightscout.androidaps.db.DbObjectBase;
|
||||
import info.nightscout.androidaps.db.ExtendedBolus;
|
||||
|
@ -27,6 +30,7 @@ import info.nightscout.androidaps.db.Source;
|
|||
import info.nightscout.androidaps.db.TDD;
|
||||
import info.nightscout.androidaps.db.TemporaryBasal;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
||||
|
@ -46,6 +50,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst;
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
||||
import info.nightscout.androidaps.plugins.treatments.Treatment;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.SP;
|
||||
|
||||
|
||||
|
@ -59,6 +64,7 @@ import info.nightscout.androidaps.utils.SP;
|
|||
// all times that time changed (TZ, DST, etc.). Data needs to be returned in batches (time_changed batches, so that we can
|
||||
// handle it. It would help to assign sort_ids to items (from oldest (1) to newest (x)
|
||||
|
||||
// All things marked with "TODO: Fix db code" needs to be updated in new 2.5 database code
|
||||
|
||||
public class MedtronicHistoryData {
|
||||
|
||||
|
@ -384,6 +390,22 @@ public class MedtronicHistoryData {
|
|||
*/
|
||||
public void processNewHistoryData() {
|
||||
|
||||
// TODO: Fix db code
|
||||
// Prime (for reseting autosense)
|
||||
List<PumpHistoryEntry> primeRecords = getFilteredItems(PumpHistoryEntryType.Prime);
|
||||
|
||||
if (isLogEnabled())
|
||||
LOG.debug("ProcessHistoryData: Prime [count={}, items={}]", primeRecords.size(), gson.toJson(primeRecords));
|
||||
|
||||
if (isCollectionNotEmpty(primeRecords)) {
|
||||
try {
|
||||
processPrime(primeRecords);
|
||||
} catch (Exception ex) {
|
||||
LOG.error("ProcessHistoryData: Error processing Prime entries: " + ex.getMessage(), ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
// TDD
|
||||
List<PumpHistoryEntry> tdds = getFilteredItems(PumpHistoryEntryType.EndResultTotals, getTDDType());
|
||||
|
||||
|
@ -456,6 +478,49 @@ public class MedtronicHistoryData {
|
|||
}
|
||||
|
||||
|
||||
private void processPrime(List<PumpHistoryEntry> primeRecords) {
|
||||
|
||||
long maxAllowedTimeInPast = DateTimeUtil.getATDWithAddedMinutes(new GregorianCalendar(), -30);
|
||||
|
||||
long lastPrimeRecord = 0L;
|
||||
|
||||
for (PumpHistoryEntry primeRecord : primeRecords) {
|
||||
|
||||
if (primeRecord.atechDateTime > maxAllowedTimeInPast) {
|
||||
if (lastPrimeRecord < primeRecord.atechDateTime) {
|
||||
lastPrimeRecord = primeRecord.atechDateTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastPrimeRecord != 0L) {
|
||||
long lastPrimeFromAAPS = SP.getLong(MedtronicConst.Statistics.LastPrime, 0L);
|
||||
|
||||
if (lastPrimeRecord != lastPrimeFromAAPS) {
|
||||
uploadCareportalEvent(DateTimeUtil.toMillisFromATD(lastPrimeRecord), CareportalEvent.SITECHANGE);
|
||||
|
||||
SP.putLong(MedtronicConst.Statistics.LastPrime, lastPrimeRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void uploadCareportalEvent(long date, String event) {
|
||||
if (MainApp.getDbHelper().getCareportalEventFromTimestamp(date) != null)
|
||||
return;
|
||||
try {
|
||||
JSONObject data = new JSONObject();
|
||||
String enteredBy = SP.getString("careportal_enteredby", "");
|
||||
if (!enteredBy.equals("")) data.put("enteredBy", enteredBy);
|
||||
data.put("created_at", DateUtil.toISOString(date));
|
||||
data.put("eventType", event);
|
||||
NSUpload.uploadCareportalEntryToNS(data);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void processTDDs(List<PumpHistoryEntry> tddsIn) {
|
||||
|
||||
List<PumpHistoryEntry> tdds = filterTDDs(tddsIn);
|
||||
|
|
|
@ -42,6 +42,7 @@ public class MedtronicConst {
|
|||
public static final String StandardBoluses = StatsPrefix + "std_boluses_delivered";
|
||||
public static final String SMBBoluses = StatsPrefix + "smb_boluses_delivered";
|
||||
public static final String LastPumpHistoryEntry = StatsPrefix + "pump_history_entry";
|
||||
public static final String LastPrime = StatsPrefix + "last_sent_prime";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.pump.virtual;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.db.ExtendedBolus;
|
||||
import info.nightscout.androidaps.db.TemporaryBasal;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
|
||||
|
||||
public class VirtualPumpFragment extends Fragment {
|
||||
private static Logger log = LoggerFactory.getLogger(VirtualPumpFragment.class);
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
|
||||
TextView basaBasalRateView;
|
||||
TextView tempBasalView;
|
||||
TextView extendedBolusView;
|
||||
TextView batteryView;
|
||||
TextView reservoirView;
|
||||
TextView pumpTypeView;
|
||||
TextView pumpSettingsView;
|
||||
|
||||
|
||||
private static Handler sLoopHandler = new Handler();
|
||||
private static Runnable sRefreshLoop = null;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (sRefreshLoop == null) {
|
||||
sRefreshLoop = () -> {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(this::updateGui);
|
||||
sLoopHandler.postDelayed(sRefreshLoop, 60 * 1000L);
|
||||
};
|
||||
sLoopHandler.postDelayed(sRefreshLoop, 60 * 1000L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.virtualpump_fragment, container, false);
|
||||
basaBasalRateView = (TextView) view.findViewById(R.id.virtualpump_basabasalrate);
|
||||
tempBasalView = (TextView) view.findViewById(R.id.virtualpump_tempbasal);
|
||||
extendedBolusView = (TextView) view.findViewById(R.id.virtualpump_extendedbolus);
|
||||
batteryView = (TextView) view.findViewById(R.id.virtualpump_battery);
|
||||
reservoirView = (TextView) view.findViewById(R.id.virtualpump_reservoir);
|
||||
pumpTypeView = (TextView) view.findViewById(R.id.virtualpump_type);
|
||||
pumpSettingsView = (TextView) view.findViewById(R.id.virtualpump_type_def);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onResume() {
|
||||
super.onResume();
|
||||
disposable.add(RxBus.INSTANCE
|
||||
.toObservable(EventVirtualPumpUpdateGui.class)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(event -> updateGui(), FabricPrivacy::logException)
|
||||
);
|
||||
updateGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onPause() {
|
||||
super.onPause();
|
||||
disposable.clear();
|
||||
}
|
||||
|
||||
protected void updateGui() {
|
||||
VirtualPumpPlugin virtualPump = VirtualPumpPlugin.getPlugin();
|
||||
basaBasalRateView.setText(virtualPump.getBaseBasalRate() + "U");
|
||||
TemporaryBasal activeTemp = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(System.currentTimeMillis());
|
||||
if (activeTemp != null) {
|
||||
tempBasalView.setText(activeTemp.toStringFull());
|
||||
} else {
|
||||
tempBasalView.setText("");
|
||||
}
|
||||
ExtendedBolus activeExtendedBolus = TreatmentsPlugin.getPlugin().getExtendedBolusFromHistory(System.currentTimeMillis());
|
||||
if (activeExtendedBolus != null) {
|
||||
extendedBolusView.setText(activeExtendedBolus.toString());
|
||||
} else {
|
||||
extendedBolusView.setText("");
|
||||
}
|
||||
batteryView.setText(virtualPump.batteryPercent + "%");
|
||||
reservoirView.setText(virtualPump.reservoirInUnits + "U");
|
||||
|
||||
virtualPump.refreshConfiguration();
|
||||
|
||||
PumpType pumpType = virtualPump.getPumpType();
|
||||
|
||||
pumpTypeView.setText(pumpType.getDescription());
|
||||
|
||||
String template = MainApp.gs(R.string.virtualpump_pump_def);
|
||||
|
||||
|
||||
pumpSettingsView.setText(pumpType.getFullDescription(template, pumpType.hasExtendedBasals()));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package info.nightscout.androidaps.plugins.pump.virtual
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.events.EventExtendedBolusChange
|
||||
import info.nightscout.androidaps.events.EventTempBasalChange
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.T
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import kotlinx.android.synthetic.main.virtualpump_fragment.*
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
class VirtualPumpFragment : Fragment() {
|
||||
private val disposable = CompositeDisposable()
|
||||
|
||||
private val loopHandler = Handler()
|
||||
private lateinit var refreshLoop: Runnable
|
||||
|
||||
init {
|
||||
refreshLoop = Runnable {
|
||||
activity?.runOnUiThread { updateGui() }
|
||||
loopHandler.postDelayed(refreshLoop, T.mins(1).msecs())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.virtualpump_fragment, container, false)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
disposable.add(RxBus
|
||||
.toObservable(EventVirtualPumpUpdateGui::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
)
|
||||
disposable.add(RxBus
|
||||
.toObservable(EventTempBasalChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
)
|
||||
disposable.add(RxBus
|
||||
.toObservable(EventExtendedBolusChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
)
|
||||
loopHandler.postDelayed(refreshLoop, T.mins(1).msecs())
|
||||
updateGui()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
disposable.clear()
|
||||
loopHandler.removeCallbacks(refreshLoop)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun updateGui() {
|
||||
val virtualPump = VirtualPumpPlugin.getPlugin()
|
||||
virtualpump_basabasalrate?.text = MainApp.gs(R.string.pump_basebasalrate, virtualPump.baseBasalRate)
|
||||
virtualpump_tempbasal?.text = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull()
|
||||
?: ""
|
||||
virtualpump_extendedbolus?.text = TreatmentsPlugin.getPlugin().getExtendedBolusFromHistory(System.currentTimeMillis())?.toString() ?: ""
|
||||
virtualpump_battery?.text = MainApp.gs(R.string.format_percent, virtualPump.batteryPercent)
|
||||
virtualpump_reservoir?.text = MainApp.gs(R.string.formatinsulinunits, virtualPump.reservoirInUnits.toDouble())
|
||||
|
||||
virtualPump.refreshConfiguration()
|
||||
val pumpType = virtualPump.pumpType
|
||||
|
||||
virtualpump_type?.text = pumpType.description
|
||||
virtualpump_type_def?.text = pumpType.getFullDescription(MainApp.gs(R.string.virtualpump_pump_def), pumpType.hasExtendedBasals())
|
||||
}
|
||||
}
|
|
@ -24,6 +24,17 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
|
|||
|
||||
private static EventNetworkChange lastEvent = null;
|
||||
|
||||
public static final NetworkChangeReceiver instance = new NetworkChangeReceiver();
|
||||
|
||||
// TODO: Split NSClient into network state component that can be used by several plugins and logic for plugin
|
||||
public static void fetch() {
|
||||
NetworkChangeReceiver.instance.grabNetworkStatus(MainApp.instance().getApplicationContext());
|
||||
}
|
||||
|
||||
private NetworkChangeReceiver() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, final Intent intent) {
|
||||
EventNetworkChange event = grabNetworkStatus(context);
|
||||
|
|
|
@ -91,8 +91,7 @@ public class SWDefinition {
|
|||
.preferenceId(R.string.key_language).label(R.string.language)
|
||||
.comment(R.string.setupwizard_language_prompt))
|
||||
.validator(() -> {
|
||||
String lang = SP.getString("language", "en");
|
||||
LocaleHelper.setLocale(MainApp.instance().getApplicationContext(), lang);
|
||||
LocaleHelper.INSTANCE.update(MainApp.instance().getApplicationContext());
|
||||
return SP.contains(R.string.key_language);
|
||||
});
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class SetupWizardActivity extends NoSplashAppCompatActivity {
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
LocaleHelper.onCreate(this, "en");
|
||||
LocaleHelper.INSTANCE.update(getApplicationContext());
|
||||
setContentView(R.layout.activity_setupwizard);
|
||||
|
||||
scrollView = (ScrollView) findViewById(R.id.sw_scrollview);
|
||||
|
|
|
@ -124,7 +124,7 @@ public class FabricPrivacy {
|
|||
.replace(".net/", ":");
|
||||
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled);
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("Language", LocaleHelper.getLanguage());
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("Language", LocaleHelper.INSTANCE.currentLanguage());
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("Version", BuildConfig.VERSION);
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("HEAD", BuildConfig.HEAD);
|
||||
MainApp.getFirebaseAnalytics().setUserProperty("Remote", remote);
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
package info.nightscout.androidaps.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* This class is used to change your application locale and persist this change for the next time
|
||||
* that your app is going to be used.
|
||||
* <p/>
|
||||
* You can also change the locale of your application on the fly by using the setLocale method.
|
||||
* <p/>
|
||||
* Created by gunhansancar on 07/10/15.
|
||||
*/
|
||||
public class LocaleHelper {
|
||||
|
||||
private static final String SELECTED_LANGUAGE = "Locale.Helper.Selected.Language";
|
||||
|
||||
public static void onCreate(Context context) {
|
||||
String lang = getPersistedData(Locale.getDefault().getLanguage());
|
||||
setLocale(context, lang);
|
||||
}
|
||||
|
||||
public static void onCreate(Context context, String defaultLanguage) {
|
||||
String lang = getPersistedData(defaultLanguage);
|
||||
setLocale(context, lang);
|
||||
}
|
||||
|
||||
public static String getLanguage() {
|
||||
return getPersistedData(Locale.getDefault().getLanguage());
|
||||
}
|
||||
|
||||
public static void setLocale(Context context, String language) {
|
||||
persist(context, language);
|
||||
updateResources(context, language);
|
||||
}
|
||||
|
||||
private static String getPersistedData(String defaultLanguage) {
|
||||
return SP.getString(SELECTED_LANGUAGE, defaultLanguage);
|
||||
}
|
||||
|
||||
private static void persist(Context context, String language) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putString(SELECTED_LANGUAGE, language);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private static void updateResources(Context context, String language) {
|
||||
Locale locale = new Locale(language);
|
||||
Locale.setDefault(locale);
|
||||
|
||||
Resources resources = context.getResources();
|
||||
|
||||
Configuration configuration = resources.getConfiguration();
|
||||
configuration.locale = locale;
|
||||
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
}
|
||||
|
||||
public static Locale getLocale() {
|
||||
return new Locale(getPersistedData("en"));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package info.nightscout.androidaps.utils
|
||||
|
||||
import android.content.Context
|
||||
import info.nightscout.androidaps.R
|
||||
import java.util.*
|
||||
|
||||
object LocaleHelper {
|
||||
fun update(context: Context) =
|
||||
updateResources(context, currentLanguage())
|
||||
|
||||
fun currentLanguage(): String =
|
||||
SP.getString(R.string.key_language, Locale.getDefault().language)
|
||||
|
||||
fun currentLocale(): Locale =
|
||||
Locale(SP.getString(R.string.key_language, Locale.getDefault().language))
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun updateResources(context: Context, language: String) {
|
||||
var locale = Locale(language)
|
||||
if (language.contains("_")) {
|
||||
// language with country like pt_BR defined in arrays.xml
|
||||
val lang = language.substring(0, 2)
|
||||
val country = language.substring(3, 5)
|
||||
locale = Locale(lang, country)
|
||||
}
|
||||
|
||||
Locale.setDefault(locale)
|
||||
val resources = context.resources
|
||||
resources.configuration.setLocale(locale)
|
||||
resources.updateConfiguration(resources.configuration, resources.displayMetrics)
|
||||
}
|
||||
}
|
|
@ -105,7 +105,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Disabled to:"
|
||||
android:text="Disabled until:"
|
||||
android:textColor="#FF5722"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="33dp"
|
||||
android:layout_height="match_parent"
|
||||
app:srcCompat="@drawable/icon_calculator" />
|
||||
|
||||
<TextView
|
||||
|
@ -31,9 +32,9 @@
|
|||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/boluswizard"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/colorCalculatorButton"
|
||||
android:text="@string/boluswizard" />
|
||||
android:textColor="@color/colorCalculatorButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -55,7 +56,7 @@
|
|||
android:textStyle="bold" />
|
||||
|
||||
<info.nightscout.androidaps.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_bginput"
|
||||
android:id="@+id/treatments_wizard_bg_input"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp" />
|
||||
|
||||
|
@ -85,7 +86,7 @@
|
|||
android:textStyle="bold" />
|
||||
|
||||
<info.nightscout.androidaps.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_carbsinput"
|
||||
android:id="@+id/treatments_wizard_carbs_input"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
@ -116,7 +117,7 @@
|
|||
android:textStyle="bold" />
|
||||
|
||||
<info.nightscout.androidaps.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_correctioninput"
|
||||
android:id="@+id/treatments_wizard_correction_input"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
@ -146,7 +147,7 @@
|
|||
android:textStyle="bold" />
|
||||
|
||||
<info.nightscout.androidaps.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_carbtimeinput"
|
||||
android:id="@+id/treatments_wizard_carb_time_input"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<string name="description_smb">Mees onlangse algoritme vir gevorderde gebruikers</string>
|
||||
<string name="description_overview">Wys die huidige staat van jou lus en knoppies vir mees algemene optrede</string>
|
||||
<string name="description_persistent_notification">Toon \'n voortgesette kennisgewing met \'n kort oorsig van wat jou lus besig is om te doen</string>
|
||||
<string name="description_profile_local">Definieer\'n profiel wat beskikbaar is aflyn.</string>
|
||||
<string name="description_profile_nightscout">Bied die profiel wat jy het beskryf het in Nightscout</string>
|
||||
<string name="description_profile_simple">Definieer \'n profiel met net een tydblok.</string>
|
||||
<string name="description_pump_combo">Pomp Integrasie met Accu-Chek Combo pompe, vereis dat ruffy geïnstalleer is</string>
|
||||
|
@ -1336,6 +1337,27 @@
|
|||
<string name="medtronic_cmd_desc_get_tbr">Verkry Tydelike Basale</string>
|
||||
<string name="medtronic_cmd_desc_set_tbr">Stel Tydelike Basale</string>
|
||||
<string name="medtronic_cmd_desc_set_bolus">Stel Bolus</string>
|
||||
<string name="profilename">Verander profiel na</string>
|
||||
<string name="changengetoprofilename">Verander profiel na %1$s</string>
|
||||
<string name="automation_trigger_pump_last_connection_label">Laaste konneksie na pomp</string>
|
||||
<string name="automation_trigger_pump_last_connection_description">Laaste konneksie na pomp [minute gelede]</string>
|
||||
<string name="automation_trigger_pump_last_connection_compared">Vorige konneksie na pomp %1$s %2$s min terug</string>
|
||||
<string name="sendsmsactionlabel">Stuur\'n SMS: %1$s</string>
|
||||
<string name="sendsmsactiondescription">Stuur SMS na alle fone in voorkeure</string>
|
||||
<string name="sendsmsactiontext">Stuur\'n SMS met die teks</string>
|
||||
<string name="bolusconstraintappliedwarning"><![CDATA[<font color=\'%1$s\'>Bolus beperking aangewend: %2$.2fU to %3$.2fU</font>]]></string>
|
||||
<string name="reservoirvalue">%1$.0f / %2$d U</string>
|
||||
<string name="loading">Laai tans...</string>
|
||||
<string name="snooze">Sluimer</string>
|
||||
<string name="time_range">Tyd reeks</string>
|
||||
<string name="timerange_value">Tyd is tussen %1$s en %2$s</string>
|
||||
<string name="between">Tussen </string>
|
||||
<string name="close">Maak toe</string>
|
||||
<string name="smscommunicator_messagebody">Ongeldig boodskap teks</string>
|
||||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Bolus slimjan</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
</resources>
|
||||
|
|
|
@ -1368,6 +1368,7 @@
|
|||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fгр Чувств: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fгр Чувств: %2$.1f</string>
|
||||
<string name="format_percent">%1$d %%</string>
|
||||
<string name="boluswizard">Болус калкулатор</string>
|
||||
<string name="unit_minute_short">мин</string>
|
||||
</resources>
|
||||
|
|
|
@ -1369,6 +1369,7 @@
|
|||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Bolusová kalkulačka</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
</resources>
|
||||
|
|
|
@ -478,7 +478,7 @@
|
|||
<string name="settings_password">Passwort für die Einstellungen</string>
|
||||
<string name="unlock_settings">Einstellungen freischalten</string>
|
||||
<string name="approachingdailylimit">Tagesinsulin-Limit wird bald erreicht</string>
|
||||
<string name="nsclientinternal">Nighscout-Client</string>
|
||||
<string name="nsclientinternal">Nightscout-Client</string>
|
||||
<string name="nsclientinternal_shortname">NSCl</string>
|
||||
<string name="nsclientinternal_url">URL:</string>
|
||||
<string name="nsclientinternal_autoscroll">Auto-Scrollen</string>
|
||||
|
@ -1370,6 +1370,7 @@ Unerwartetes Verhalten.</string>
|
|||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Bolus-Rechner</string>
|
||||
<string name="unit_minute_short">Min.</string>
|
||||
</resources>
|
||||
|
|
|
@ -426,13 +426,13 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
|
|||
<string name="actions_shortname">ACT</string>
|
||||
<string name="configbuilder_shortname">CONF</string>
|
||||
<string name="loop_shortname">BOUCLE</string>
|
||||
<string name="simpleprofile_shortname">SP</string>
|
||||
<string name="simpleprofile_shortname">P.S.</string>
|
||||
<string name="oaps_shortname">OAPS</string>
|
||||
<string name="localprofile_shortname">LP</string>
|
||||
<string name="localprofile_shortname">P.L.</string>
|
||||
<string name="danarpump_shortname">DANA</string>
|
||||
<string name="overview_shortname">ACCUEIL</string>
|
||||
<string name="virtualpump_shortname">POMPEV</string>
|
||||
<string name="profileviewer_shortname">PROFIL NS</string>
|
||||
<string name="profileviewer_shortname">P.NS</string>
|
||||
<string name="treatments_shortname">TRAIT</string>
|
||||
<string name="careportal_shortname">CP</string>
|
||||
<string name="objectives_shortname">OBJ</string>
|
||||
|
@ -1370,6 +1370,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
|
|||
<string name="format_bg_isf">%1$s SI: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg G/I: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg G/I: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Assistant Bolus</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
</resources>
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<string name="nsprofileview_target_label">Tikslas</string>
|
||||
<string name="noprofileset">Nenustatytas profilis</string>
|
||||
<string name="treatments_insulin_label_string">Insulinas:</string>
|
||||
<string name="treatments_carbs_label_string">Angliavandeniai:</string>
|
||||
<string name="treatments_carbs_label_string">AV:</string>
|
||||
<string name="treatments_iob_label_string">AIO:</string>
|
||||
<string name="sms_iob">AIO:</string>
|
||||
<string name="treatments_iobtotal_label_string">Visas AIO:</string>
|
||||
|
@ -76,10 +76,10 @@
|
|||
<string name="tempbasals_iob_label_string">AIO:</string>
|
||||
<string name="tempbasals_iobtotal_label_string">Visas AIO:</string>
|
||||
<string name="treatments_newtreatment_insulinamount_label">Insulinas</string>
|
||||
<string name="treatments_newtreatment_carbsamount_label">Angliavandeniai</string>
|
||||
<string name="treatments_newtreatment_carbsamount_label">AV</string>
|
||||
<string name="treatments_wizard_bg_label">KG</string>
|
||||
<string name="treatments_wizard_tt_label">LT</string>
|
||||
<string name="treatments_wizard_carbs_label">Angliavandeniai</string>
|
||||
<string name="treatments_wizard_carbs_label">AV</string>
|
||||
<string name="treatments_wizard_correction_label">Korekcija</string>
|
||||
<string name="insulin_unit_shortname">vv</string>
|
||||
<string name="treatments_wizard_bolusiob_label">Bolusų AIO</string>
|
||||
|
@ -158,7 +158,7 @@
|
|||
<string name="sms_bolus">Bolusas:</string>
|
||||
<string name="basal">Valandinė bazė</string>
|
||||
<string name="sms_basal">Valandinė bazė:</string>
|
||||
<string name="carbs">Angliavandeniai</string>
|
||||
<string name="carbs">AV</string>
|
||||
<string name="changeyourinput">Pakeiskite įvestus duomenis!</string>
|
||||
<string name="setextendedbolusquestion">Nustatyti naują ištęstą bolusą:</string>
|
||||
<string name="configbuilder_bgsource">KG šaltinis</string>
|
||||
|
@ -341,7 +341,7 @@
|
|||
<string name="quickwizard">Greitasis patarėjas</string>
|
||||
<string name="quickwizardsettings">Greitojo patarėjo nustatymai</string>
|
||||
<string name="overview_editquickwizard_buttontext">Mygtuko tekstas:</string>
|
||||
<string name="overview_editquickwizard_carbs">Angliavandeniai:</string>
|
||||
<string name="overview_editquickwizard_carbs">AV:</string>
|
||||
<string name="overview_editquickwizard_valid">Galioja:</string>
|
||||
<string name="overview_editquickwizardlistactivity_add">Pridėti</string>
|
||||
<string name="overview_quickwizard_item_edit_button">Redaguoti</string>
|
||||
|
@ -787,7 +787,7 @@
|
|||
<string name="let_temp_basal_run">Paleisti laikinąją bazę</string>
|
||||
<string name="mute">Nutildyti</string>
|
||||
<string name="overview_insulin_label">Insulinas</string>
|
||||
<string name="overview_carbs_label">Angliavandeniai</string>
|
||||
<string name="overview_carbs_label">AV</string>
|
||||
<string name="overview_buttons_selection">Mygtukai</string>
|
||||
<string name="show_calibration_button_summary">Siunčia kalibravimą į xDrip+ arba atidaro G5 kalibravimo dialogą</string>
|
||||
<string name="show_cgm_button_summary">Atidaro xDrip+, o mygtukas ATGAL gražina į AAPS</string>
|
||||
|
@ -1369,6 +1369,7 @@
|
|||
<string name="format_bg_isf">%1$s JIF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IA: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IA: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Boluso patarėjas</string>
|
||||
<string name="unit_minute_short">min.</string>
|
||||
</resources>
|
||||
|
|
|
@ -1348,6 +1348,7 @@
|
|||
<string name="changengetoprofilename">Alterar perfil para %1$s</string>
|
||||
<string name="automation_trigger_pump_last_connection_label">Última ligação à bomba</string>
|
||||
<string name="automation_trigger_pump_last_connection_description">Última ligação à bomba [minutos atrás]</string>
|
||||
<string name="automation_trigger_pump_last_connection_compared">Última ligação à bomba %1$s %2$s min atrás</string>
|
||||
<string name="sendsmsactionlabel">Enviar SMS: %1$s</string>
|
||||
<string name="sendsmsactiondescription">Enviar SMS para todos os números nas preferências</string>
|
||||
<string name="sendsmsactiontext">Enviar SMS com texto</string>
|
||||
|
|
|
@ -7,14 +7,21 @@
|
|||
<string name="dia_minimumis5h">O valor mínimo é de 5 horas.</string>
|
||||
<string name="dia_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html?#insulin</string>
|
||||
<string name="dia_meaningisequaltodiapump">O significado é igual ao parâmetro DIA usado na bomba.</string>
|
||||
<string name="dia_valuemustbedetermined">É necessário determinar o seu valor individual (mas não menos de 5 horas).</string>
|
||||
<string name="hypott_label">Tópico: Alvo-Temp. Hipo</string>
|
||||
<string name="hypott_whenhypott">O que é a razão principal para definir TT hipoglicemia?</string>
|
||||
<string name="hypott_goinglow">Para evitar que a Glic fique baixa se já estiver em funcionamento um temp zero.</string>
|
||||
<string name="hypott_preventoversmb">Para evitar o AAPS dosear demasiada insulina após uma subida rápida causada por hidratos de actuação rápida para tratar hipoglicemia.</string>
|
||||
<string name="hypott_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html</string>
|
||||
<string name="offlineprofile_whatprofile">Qual perfil pode ser usado e configurado offline?</string>
|
||||
<string name="offlineprofile_label">Tópico: Perfil Offline</string>
|
||||
<string name="offlineprofile_nsprofile">Perfil NS pode ser usado, mas não configurado.</string>
|
||||
<string name="offlineprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#profile</string>
|
||||
<string name="pumpdisconnect_label">Tópico: Desligar a Bomba</string>
|
||||
<string name="pumpdisconnect_whattodo">O que deve ser feito ao desligar a bomba?</string>
|
||||
<string name="pumpdisconnect_letknow">Clique em \'Desligar bomba\' para que o AAPS saiba que nenhuma insulina está a ser entregue.</string>
|
||||
<string name="pumpdisconnect_suspend">Clique em \'Suspender loop\' para que AAPS pare o looping enquanto a bomba estiver desconectada.</string>
|
||||
<string name="pumpdisconnect_dontchnage">Não altere nada no AAPS, apenas desconecte a bomba.</string>
|
||||
<string name="pumpdisconnect_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#other-settings</string>
|
||||
<string name="objectives_label">Tópico: Definições do AndroidAPS</string>
|
||||
<string name="objectives_howtosave">Quais são as práticas recomendadas para fazer cópia de segurança das configurações?</string>
|
||||
|
@ -35,19 +42,27 @@
|
|||
<string name="noisycgm_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Smoothing-Blood-Glucose-Data-in-xDrip.html#smoothing-blood-glucose-data</string>
|
||||
<string name="noisycgm_checksmoothing">Verifique que a app do CGM suaviza os dados da Glicose.</string>
|
||||
<string name="exercise_label">Tópico: Exercício</string>
|
||||
<string name="exercise_whattodo">Como você pode ajudar o sistema a lidar com exercícios?</string>
|
||||
<string name="exercise_setactivitytt">Usando o recurso de alvo-temp.</string>
|
||||
<string name="exercise_switchprofilebelow100">Fazer uma mudança de perfil inferior a 100%.</string>
|
||||
<string name="exercise_switchprofileabove100">Fazer uma mudança de perfil acima de 100%.</string>
|
||||
<string name="exercise_stoploop">Parar o loop.</string>
|
||||
<string name="exercise_doitbeforestart">Definir um alvo-temp de actividade antes de iniciar o exercício.</string>
|
||||
<string name="exercise_afterstart">Definir um alvo-temp de actividade após iniciar o exercício leva a resultados piores do que se iniciado antes.</string>
|
||||
<string name="exercise_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
|
||||
<string name="suspendloop_label">Tópico: Loop Desactivado/Suspenso</string>
|
||||
<string name="suspendloop_doigetinsulin">Eu recebo insulina quando o loop estiver desactivado/suspenso?</string>
|
||||
<string name="suspendloop_yes">Sim, a insulina basal continua a ser entregue.</string>
|
||||
<string name="suspendloop_no">Não, a entrega da insulina está parada.</string>
|
||||
<string name="basaltest_label">Topic: Testar Basal, FSI e IC</string>
|
||||
<string name="basaltest_when">Quando devo validar valores das basais, FSI e de IC?</string>
|
||||
<string name="basaltest_beforeloop">Antes de começar com o looping.</string>
|
||||
<string name="basaltest_havingregularhypo">Quando ocorrer frequentemente Glic baixa.</string>
|
||||
<string name="basaltest_havingregularhyper">Quando ocorrer frequentemente Glic alta.</string>
|
||||
<string name="basaltest_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#androidaps-settings</string>
|
||||
<string name="prerequisites_label">Tópico: Pré-requisitos</string>
|
||||
<string name="prerequisites_what">O que preciso?</string>
|
||||
<string name="prerequisites_determinedcorrectprofile">Informações do perfil validadas (Basal, IC, FSI, DIA).</string>
|
||||
<string name="prerequisites_computer">Um computador para criar um APK.</string>
|
||||
<string name="prerequisites_phone">Um telefone compatível.</string>
|
||||
<string name="prerequisites_car">Um Carro.</string>
|
||||
|
@ -79,40 +94,64 @@
|
|||
<string name="troubleshooting_hint2">https://www.facebook.com/groups/AndroidAPSUsers/</string>
|
||||
<string name="troubleshooting_hint3">https://gitter.im/MilosKozak/AndroidAPS</string>
|
||||
<string name="insulin_label">Tópico: Plugins de Insulina</string>
|
||||
<string name="insulin_ultrarapid">Qual marca de insulina pode ser usada com o plugin \'Ultra-Rapid-Oref\'?</string>
|
||||
<string name="insulin_fiasp">Fiasp®</string>
|
||||
<string name="insulin_novorapid">NovoRapid ®</string>
|
||||
<string name="insulin_humalog">Humalog ®</string>
|
||||
<string name="insulin_actrapid">Actrapid ®</string>
|
||||
<string name="insulin_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#insulin</string>
|
||||
<string name="sensitivity_label">Tópico: Plugins de Sensibilidade</string>
|
||||
<string name="sensitivity_which">Qual algoritmo de sensibilidade tem um intervalo de tempo configurável?</string>
|
||||
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
|
||||
<string name="sensitivityuam_which">Qual plugin de sensibilidade deve ser usado para o recurso UAM?</string>
|
||||
<string name="wrongcarbs_label">Tópico: Erros de Entrada de Hidratos</string>
|
||||
<string name="wrongcarbs_whattodo">O que deve fazer se tiver feito uma entrada incorrecta de hidratos?</string>
|
||||
<string name="wrongcarbs_treatmentstab">Em Tratamentos, excluir a entrada incorrecta de hidratos. Insira novos hidratos.</string>
|
||||
<string name="wrongcarbs_addfakeinsulin">Como adicionar insulina falsa utilizando a função Recarregar</string>
|
||||
<string name="extendedcarbs_label">Tópico: Alimentos com Gordura e Proteína</string>
|
||||
<string name="extendedcarbs_handling">O que fazer se a comida contém uma grande quantidade de gordura e/ou proteínas?</string>
|
||||
<string name="extendedcarbs_useextendedcarbs">Recalcular gordura e proteínas em hidratos e usar recurso de \"Hidratos Estendidos\".</string>
|
||||
<string name="extendedcarbs_add">Recalcular gordura e proteínas em hidratos e adicionar ao cálculo de bólus.</string>
|
||||
<string name="extendedcarbs_useextendedbolus">Use o bólus estendido para cobrir gordura e proteínas.</string>
|
||||
<string name="extendedcarbs_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Extended-Carbs.html</string>
|
||||
<string name="nsclient_label">Tópico: Monitorização Remota</string>
|
||||
<string name="nsclient_howcanyou">Como pode monitorizar AAPS do seu filho remotamente?</string>
|
||||
<string name="nsclient_nightscout">Usando um site Nightscout.</string>
|
||||
<string name="nsclient_dexcomfollow">App Dex om Follow se estiver a usar a app original Dexcom (Glic apenas).</string>
|
||||
<string name="nsclient_dexcomfollowxdrip">Dexcom Follow se estiver a usar a app xDrip.</string>
|
||||
<string name="nsclient_xdripfollower">xDrip a correr no modo seguidor.</string>
|
||||
<string name="nsclient_looponiphone">App de Loop no iPhone.</string>
|
||||
<string name="nsclient_spikeiphone">App Spike no iPhone.</string>
|
||||
<string name="nsclient_hint1">https://androidaps.readthedocs.io/en/latest/EN/Children/Children.html</string>
|
||||
<string name="isf_label">Tópico: Factor de Sensibilidade de Insulina</string>
|
||||
<string name="isf_increasingvalue">Valores elevados de FSI levam a uma entrega de menos insulina quando o AAPS corrige Glic alta.</string>
|
||||
<string name="isf_decreasingvalue">Valores baixos de FSI levam a uma entrega de menos insulina quando o AAPS corrige Glic alta.</string>
|
||||
<string name="isf_noeffect">Alterar os valores FSI não tem efeito sobre a quantidade de insulina entregue quando a AAPS corrige Glic alta.</string>
|
||||
<string name="isf_preferences">É necessário inserir FSI nas Preferências.</string>
|
||||
<string name="isf_profile">A alteração do valor do FSI no seu perfil é suficiente para aplicar a mudança.</string>
|
||||
<string name="isf_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u</string>
|
||||
<string name="isf_hint2">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html</string>
|
||||
<string name="ic_label">Tópico: Rácio IC</string>
|
||||
<string name="ic_increasingvalue">Rácios IC mais altos levam a menos insulina entregue para uma dada quantidade de hidratos.</string>
|
||||
<string name="ic_decreasingvalue">Rácios IC mais baixos levam a menos insulina entregue para uma dada quantidade de hidratos.</string>
|
||||
<string name="ic_noeffect">Se tiver 0 COB, alterar o rácio IC irá levar a uma quantidade diferente de insulina para corrigir um determinado valor da Glic.</string>
|
||||
<string name="ic_different">IC será diferente se contar a unidade de pão como 10g ou 12g.</string>
|
||||
<string name="ic_meaning">O significado do IC é: Quantas unidades de pão são cobertas por 1U de insulina.</string>
|
||||
<string name="ic_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u</string>
|
||||
<string name="profileswitch_label">Tópico: Mudança De Perfil</string>
|
||||
<string name="profileswitch_pctwillchange"> Ao especificar 90% na mudança de perfil…</string>
|
||||
<string name="profileswitch_basalhigher">Basais são 10% superiores.</string>
|
||||
<string name="profileswitch_basallower">Basais serão 10% inferiores.</string>
|
||||
<string name="profileswitch_ichigher">Valor IC será 10% superior.</string>
|
||||
<string name="profileswitch_iclower">Valor IC será 10% inferior.</string>
|
||||
<string name="profileswitch_isfhigher">O valor FSI será 10% mais alto.</string>
|
||||
<string name="profileswitch_isflower">O valor FSI será 10% mais baixo.</string>
|
||||
<string name="profileswitch_overall">Você receberá aproximadamente 10% menos insulina no total.</string>
|
||||
<string name="profileswitch_targethigher">Alvo será 10% superior.</string>
|
||||
<string name="profileswitch_targetlower">Alvo será 10% inferior.</string>
|
||||
<string name="profileswitch_targetbottom">Só alvo inferior será 10% menor.</string>
|
||||
<string name="profileswitch_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch</string>
|
||||
<string name="profileswitchtime_iwant">Se acordar 1h mais cedo do que o normal, como deve notificar a AAPS da mudança no seu horário?</string>
|
||||
<string name="profileswitchtime_1">Iniciar uma mudança de perfil com uma alteração de turno de 1</string>
|
||||
<string name="profileswitchtime__1">Iniciar uma mudança de perfil com uma alteração de turno de -1</string>
|
||||
<string name="profileswitchtime_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#timeshift</string>
|
||||
|
|
|
@ -7,7 +7,21 @@
|
|||
<string name="nth_objective">%1$d. Objectivo</string>
|
||||
<string name="objectivenotstarted">Objetivo %1$d não iniciado</string>
|
||||
<string name="objectivenotfinished">Objetivo %1$d não terminado</string>
|
||||
<string name="objectives_0_objective">A configurar visualização e monitorização, e análise de rácios e basais</string>
|
||||
<string name="objectives_0_gate">Verificar se a Glic está disponível no Nightscout, e se os dados da bomba de insulina estão a ser carregados</string>
|
||||
<string name="objectives_openloop_objective">A iniciar em Open Loop</string>
|
||||
<string name="objectives_openloop_gate">Utilizar em modo de Open Loop por alguns dias e dar manualmente muitas basais temporárias. Configurar e usar alvos temporários e alvos padrão temporários (por exemplo, para actividade ou tratamentos de hipo com hidratos)</string>
|
||||
<string name="objectives_maxbasal_objective">Compreender o seu open loop, incluindo as recomendações de basais temporárias</string>
|
||||
<string name="objectives_maxbasal_gate">Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências</string>
|
||||
<string name="objectives_maxiobzero_objective">Começar o close loop com Suspensão por Glicose Baixa</string>
|
||||
<string name="objectives_maxiobzero_gate">Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose</string>
|
||||
<string name="objectives_maxiob_objective">Ajustar o close loop, aumentar IOB máxima acima de 0 e reduzir gradualmente os alvos de Glic</string>
|
||||
<string name="objectives_maxiob_gate">Utilizar por alguns dias e pelo menos uma noite sem alarmes de Glic baixa, antes de baixar Glic</string>
|
||||
<string name="objectives_autosens_objective">Ajuste as basais e os rácios, se necessário, e, em seguida, active o auto-sens</string>
|
||||
<string name="objectives_autosens_gate">1 semana de looping durante o dia com sucesso com entrada regular de hidratos de carbono</string>
|
||||
<string name="objectives_ama_objective">A activar recursos adicionais para uso durante o dia, como assistente avançado de refeição</string>
|
||||
<string name="objectives_smb_objective">Activando recursos adicionais para uso durante o dia, como SMB</string>
|
||||
<string name="objectives_smb_gate">Deverá ler a wiki e aumentar a IOB máx para que os SMBs funcionem devidamente! Inicialmente poderá considerar maxIOB=média dos bólus + 3 x a basal máxima</string>
|
||||
<string name="objectives_bgavailableinns">Glic disponível no NS</string>
|
||||
<string name="objectives_pumpstatusavailableinns">Estado da Bomba disponível no NS</string>
|
||||
<string name="objectives_manualenacts">Execução manual</string>
|
||||
|
@ -16,6 +30,9 @@
|
|||
<string name="objectives_usage_gate">Executar diferentes acções no AndroidAPS</string>
|
||||
<string name="objectives_useprofileswitch">Definir perfil de 90% por 10 min (pressione longo no nome de perfil na Visão Geral)</string>
|
||||
<string name="objectives_usedisconnectpump">Simular chuveiro. Desligar a bomba de 1h (Pressione longo em Open Loop)</string>
|
||||
<string name="objectives_usereconnectpump">... e volte a ligar de volta da mesma forma</string>
|
||||
<string name="objectives_usetemptarget">Crie um alvo temporário personalizado com 10 min de duração (pressione longo no seu alvo actual)</string>
|
||||
<string name="objectives_useactions">No Configurador active o plugiin de Acções, torne-o visível e exiba o seu conteúdo no menu superior</string>
|
||||
<string name="objectives_useloop">Mostrar conteúdo do plugin Loop</string>
|
||||
<string name="objectives_usescale">Utilizar a função de escala premindo longamente gráfico Glic</string>
|
||||
<string name="objectives_button_enter">Inserir</string>
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
<string name="danar_history_dailyinsulin">Insulina diária</string>
|
||||
<string name="danar_history_errors">Erros</string>
|
||||
<string name="danar_history_glucose">Glicose</string>
|
||||
<string name="danar_history_refill">Reabastecimento</string>
|
||||
<string name="danar_history_refill">Recarregar</string>
|
||||
<string name="danar_history_syspend">Suspender</string>
|
||||
<string name="danar_history_connectingfor">A ligar durante %1$d s</string>
|
||||
<string name="danar_password_title">Senha da bomba</string>
|
||||
|
@ -1369,6 +1369,7 @@
|
|||
<string name="format_bg_isf">%1$s FSI: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Assistente de Bólus</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
</resources>
|
||||
|
|
|
@ -1371,6 +1371,7 @@ Context | Edit Context</string>
|
|||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Мастер Болюса</string>
|
||||
<string name="unit_minute_short">мин</string>
|
||||
</resources>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<item>@string/ko_lang</item>
|
||||
<item>@string/lt_lang</item>
|
||||
<item>@string/pt_lang</item>
|
||||
<item>@string/pt_BR_lang</item>
|
||||
<item>@string/ro_lang</item>
|
||||
<item>@string/ru_lang</item>
|
||||
<item>@string/sk_lang</item>
|
||||
|
@ -46,6 +47,7 @@
|
|||
<item>ko</item>
|
||||
<item>lt</item>
|
||||
<item>pt</item>
|
||||
<item>pt_BR</item>
|
||||
<item>ro</item>
|
||||
<item>ru</item>
|
||||
<item>sk</item>
|
||||
|
|
|
@ -162,5 +162,8 @@
|
|||
<string name="basalhelp_diabetesteam">Your diabetes team</string>
|
||||
<string name="basalhelp_google">Google</string>
|
||||
<string name="basalhelp_facebook">Facebook</string>
|
||||
<string name="other_medication_label">Other Medication</string>
|
||||
<string name="other_medication_text">AAPS reduces BR to raise blood sugar. Drugs from the group of SGLT2 inhibitors (gliflozins) can prevent the expected increase in BG and thus may produce a dangerous insulin deficiency (DKA).
|
||||
\nCommon brand names are: Invokana®, Forxiga®, Jardiance®, Steglatro®, Suglat®, Apleway®, Deberza®, Synjardy®, Vokanamet®, Xigduo®.\n\nI hereby promise that I will not take such drugs when using AAPS or will deactivate the loop before using these drugs.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<string name="codeinvalid">Code invalid</string>
|
||||
<string name="objectives_exam_objective">Prove your knowledge</string>
|
||||
<string name="objectives_exam_gate">Study and answer questions correctly</string>
|
||||
<string name="answerdisabledto">Answering disabled to: %1$s</string>
|
||||
<string name="answerdisabledto">Answering disabled until: %1$s</string>
|
||||
<string name="wronganswer">Wrong answer!</string>
|
||||
<string name="unfinshed_button">Next unfinished</string>
|
||||
<string name="requestcode">Request code: %1$s</string>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<string name="lt_lang" translatable="false">Lithuanian</string>
|
||||
<string name="pl_lang" translatable="false">Polish</string>
|
||||
<string name="pt_lang" translatable="false">Portuguese</string>
|
||||
<!-- <string name="pt_BR_lang" translatable="false">Portuguese, Brazilian</string> -->
|
||||
<string name="pt_BR_lang" translatable="false">Portuguese, Brazilian</string>
|
||||
<string name="ro_lang" translatable="false">Romanian</string>
|
||||
<string name="ru_lang" translatable="false">Russian</string>
|
||||
<string name="sk_lang" translatable="false">Slovak</string>
|
||||
|
@ -121,6 +121,7 @@
|
|||
<string name="openapsma_profile_label">Profile</string>
|
||||
<string name="openapsma_mealdata_label">Meal data</string>
|
||||
<string name="result">Result</string>
|
||||
<string name="result_insulin_carbs">Result: %1$s %2$s</string>
|
||||
<string name="openapsma_noglucosedata">No glucose data available</string>
|
||||
<string name="nochangerequested">No change requested</string>
|
||||
<string name="openapsma_request_label">Request</string>
|
||||
|
@ -245,7 +246,7 @@
|
|||
<string name="overview_tempbasal_button">TempBasal</string>
|
||||
<string name="overview_extendedbolus_button">Extended Bolus</string>
|
||||
<string name="configbuilder_nightscoutversion_label">Nightscout version:</string>
|
||||
<string name="missing">Missing</string>
|
||||
<string name="missing_carbs">Missing %1$dg</string>
|
||||
<string name="exported">Preferences exported</string>
|
||||
<string name="export_to">Export settings to</string>
|
||||
<string name="import_from">Import settings from</string>
|
||||
|
@ -611,9 +612,9 @@
|
|||
<string name="key_statuslights_res_critical" translatable="false">key_statuslights_res_critical</string>
|
||||
<string name="statuslights_res_critical">Threshold critical reservoir level [U]</string>
|
||||
<string name="key_statuslights_bat_warning" translatable="false">key_statuslights_bat_warning</string>
|
||||
<string name="statuslights_bat_warning">Threshold warning battery level [%%]</string>
|
||||
<string name="statuslights_bat_warning">Threshold warning battery level [%]</string>
|
||||
<string name="key_statuslights_bat_critical" translatable="false">key_statuslights_bat_critical</string>
|
||||
<string name="statuslights_bat_critical">Threshold critical battery level [%%]</string>
|
||||
<string name="statuslights_bat_critical">Threshold critical battery level [%]</string>
|
||||
<string name="iob">IOB</string>
|
||||
<string name="cob">COB</string>
|
||||
<string name="virtualpump_firmware_label">Firmware</string>
|
||||
|
@ -1602,7 +1603,10 @@
|
|||
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
|
||||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Bolus wizard</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
<string name="key_wizard_calculation_visible" translatable="false">wizard_calculation_visible</string>
|
||||
<string name="format_carbs">%1$dg</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue