synchronized access to basal_v

This commit is contained in:
Milos Kozak 2018-01-21 15:56:07 +01:00
parent 060895b33f
commit eedc38fbcf
3 changed files with 4 additions and 5 deletions

View file

@ -193,7 +193,7 @@ public class Profile {
return sparse; return sparse;
} }
public boolean isValid(String from) { public synchronized boolean isValid(String from) {
if (!isValid) if (!isValid)
return false; return false;
if (!isValidated) { if (!isValidated) {
@ -404,7 +404,7 @@ public class Profile {
return getBasal(secondsFromMidnight(time)); return getBasal(secondsFromMidnight(time));
} }
public Double getBasal(Integer timeAsSeconds) { public synchronized Double getBasal(Integer timeAsSeconds) {
if (basal_v == null) { if (basal_v == null) {
basal_v = convertToSparseArray(basal); basal_v = convertToSparseArray(basal);
} }
@ -425,7 +425,7 @@ public class Profile {
public Double value; public Double value;
} }
public BasalValue[] getBasalValues() { public synchronized BasalValue[] getBasalValues() {
if (basal_v == null) if (basal_v == null)
basal_v = convertToSparseArray(basal); basal_v = convertToSparseArray(basal);
BasalValue[] ret = new BasalValue[basal_v.size()]; BasalValue[] ret = new BasalValue[basal_v.size()];

View file

@ -733,7 +733,6 @@
<string name="active"><![CDATA[<Huidig>]]></string> <string name="active"><![CDATA[<Huidig>]]></string>
<string name="none"><![CDATA[<geen>]]></string> <string name="none"><![CDATA[<geen>]]></string>
<string name="app_name">AndroidAPS</string> <string name="app_name">AndroidAPS</string>
<string name="zerovalueinprofile" formatted="false">Nul waarde in basaal profiel %s</string>
<string name="hasbgdata">BG beschikbaar op gekozen bron</string> <string name="hasbgdata">BG beschikbaar op gekozen bron</string>
<string name="positiveonly">Enkel positief</string> <string name="positiveonly">Enkel positief</string>
<string name="negativeonly">Enkel negatief</string> <string name="negativeonly">Enkel negatief</string>

View file

@ -810,7 +810,7 @@
<string name="maxiobset">Maximal IOB set properly</string> <string name="maxiobset">Maximal IOB set properly</string>
<string name="hasbgdata">BG available from selected source</string> <string name="hasbgdata">BG available from selected source</string>
<string name="basalprofilenotaligned" formatted="false">Basal values not aligned to hours: %s</string> <string name="basalprofilenotaligned" formatted="false">Basal values not aligned to hours: %s</string>
<string name="zerovalueinprofile" formatted="false">Zero value in profile: %s</string> <string name="zerovalueinprofile" formatted="false">Invalid profile: %s</string>
<string name="combo_programming_bolus">Programming pump for bolusing</string> <string name="combo_programming_bolus">Programming pump for bolusing</string>
<string name="combo_refresh">Refresh</string> <string name="combo_refresh">Refresh</string>
<string name="combo_tdds">TDDS</string> <string name="combo_tdds">TDDS</string>