Add dev and engineering mode
This commit is contained in:
parent
3d02c7f57c
commit
cfd3ffc6ed
2 changed files with 15 additions and 7 deletions
|
@ -36,6 +36,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy
|
|||
import info.nightscout.androidaps.utils.MidnightTime
|
||||
import info.nightscout.androidaps.utils.Round
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation
|
||||
import info.nightscout.androidaps.utils.buildHelper.BuildHelper
|
||||
import info.nightscout.shared.SafeParse
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
|
@ -59,6 +60,7 @@ class AutotuneFragment : DaggerFragment() {
|
|||
@Inject lateinit var uel: UserEntryLogger
|
||||
@Inject lateinit var rh: ResourceHelper
|
||||
@Inject lateinit var rxBus: RxBus
|
||||
@Inject lateinit var buildHelper: BuildHelper
|
||||
@Inject lateinit var injector: HasAndroidInjector
|
||||
|
||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||
|
@ -301,16 +303,20 @@ class AutotuneFragment : DaggerFragment() {
|
|||
if (autotunePlugin.calculationRunning) {
|
||||
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_during_run)
|
||||
} else if (autotunePlugin.lastRunSuccess) {
|
||||
binding.autotuneCopylocal.visibility = View.VISIBLE
|
||||
binding.autotuneUpdateProfile.visibility = autotunePlugin.updateButtonVisibility
|
||||
binding.autotuneRevertProfile.visibility = if (autotunePlugin.updateButtonVisibility == View.VISIBLE) View.GONE else View.VISIBLE
|
||||
binding.autotuneProfileswitch.visibility = View.VISIBLE
|
||||
if (buildHelper.isEngineeringMode()) {
|
||||
binding.autotuneCopylocal.visibility = View.VISIBLE
|
||||
binding.autotuneUpdateProfile.visibility = autotunePlugin.updateButtonVisibility
|
||||
binding.autotuneRevertProfile.visibility = if (autotunePlugin.updateButtonVisibility == View.VISIBLE) View.GONE else View.VISIBLE
|
||||
binding.autotuneProfileswitch.visibility = View.VISIBLE
|
||||
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_after_run)
|
||||
} else
|
||||
binding.tuneWarning.text = rh.gs(R.string.autotune_engineering_mode_warning)
|
||||
binding.autotuneCompare.visibility = View.VISIBLE
|
||||
binding.tuneWarning.text = rh.gs(R.string.autotune_warning_after_run)
|
||||
} else {
|
||||
} else if (buildHelper.isDev()) {
|
||||
binding.autotuneRun.visibility = View.VISIBLE
|
||||
binding.autotuneCheckInputProfile.visibility = View.VISIBLE
|
||||
}
|
||||
} else
|
||||
binding.tuneWarning.text = rh.gs(R.string.autotune_dev_warning)
|
||||
binding.tuneLastrun.text = dateUtil.dateAndTimeString(autotunePlugin.lastRun)
|
||||
showResults()
|
||||
}
|
||||
|
|
|
@ -566,6 +566,8 @@
|
|||
<string name="autotune_last_run">Last run :</string>
|
||||
<string name="autotune_warning">Warning :</string>
|
||||
<string name="autotune_select_profile">Select profile to tune</string>
|
||||
<string name="autotune_dev_warning">You can currently only run Autotune on dev builds of AAPS</string>
|
||||
<string name="autotune_engineering_mode_warning">Copy or Activate Tuned profile is only available in engineering mode</string>
|
||||
<string name="autotune_ic_warning">Autotune works with only one IC value, your profile has %1$d values. Average value is %2$.2fg/U</string>
|
||||
<string name="autotune_isf_warning">Autotune works with only one ISF value, your profile has %1$d values. Average value is %2$.1f%3$s/U</string>
|
||||
<string name="autotune_error">Error in input data, try to run again autotune or reduce the number of days</string>
|
||||
|
|
Loading…
Reference in a new issue