NSC: process objective 0 properly
This commit is contained in:
parent
1e5172a66a
commit
0d4d187775
|
@ -88,6 +88,8 @@ class NsIncomingDataProcessor @Inject constructor(
|
|||
*/
|
||||
@Suppress("SpellCheckingInspection")
|
||||
fun processSgvs(sgvs: Any): Boolean {
|
||||
// Objective0
|
||||
sp.putBoolean(app.aaps.core.utils.R.string.key_objectives_bg_is_available_in_ns, true)
|
||||
|
||||
if (!nsClientSource.isEnabled() && !sp.getBoolean(app.aaps.core.utils.R.string.key_ns_receive_cgm, false)) return false
|
||||
|
||||
|
|
|
@ -561,8 +561,6 @@ class NSClientService : DaggerService() {
|
|||
val sgvs = data.getJSONArray("sgvs")
|
||||
if (sgvs.length() > 0) {
|
||||
rxBus.send(EventNSClientNewLog("◄ DATA", "received " + sgvs.length() + " sgvs"))
|
||||
// Objective0
|
||||
sp.putBoolean(app.aaps.core.utils.R.string.key_objectives_bg_is_available_in_ns, true)
|
||||
nsIncomingDataProcessor.processSgvs(sgvs)
|
||||
storeDataForDb.storeGlucoseValuesToDb()
|
||||
}
|
||||
|
|
|
@ -61,8 +61,6 @@ class LoadBgWorker(
|
|||
if (sgvs.isNotEmpty()) {
|
||||
val action = if (isFirstLoad) "RCV-F" else "RCV"
|
||||
rxBus.send(EventNSClientNewLog("◄ $action", "${sgvs.size} SVGs from ${dateUtil.dateAndTimeAndSecondsString(lastLoaded)}"))
|
||||
// Objective0
|
||||
sp.putBoolean(app.aaps.core.utils.R.string.key_objectives_bg_is_available_in_ns, true)
|
||||
// Schedule processing of fetched data and continue of loading
|
||||
continueLoading = response.code != 304 && nsIncomingDataProcessor.processSgvs(sgvs)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue