try to fix cob graph
This commit is contained in:
parent
74e43840a6
commit
9ff714ea2d
1 changed files with 12 additions and 1 deletions
|
@ -352,11 +352,22 @@ public class IobCobCalculatorPlugin implements PluginBase {
|
|||
return iobTotal;
|
||||
}
|
||||
|
||||
private static Long findPreviousTimeFromBucketedData(long time) {
|
||||
for (int index = 0; index < bucketed_data.size(); index++) {
|
||||
if (bucketed_data.get(index).timeIndex < time)
|
||||
return bucketed_data.get(index).timeIndex;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AutosensData getAutosensData(long time) {
|
||||
long now = new Date().getTime();
|
||||
if (time > now)
|
||||
return null;
|
||||
time = roundUpTime(time);
|
||||
Long previous = findPreviousTimeFromBucketedData(time);
|
||||
if (previous == null)
|
||||
return null;
|
||||
time = roundUpTime(previous);
|
||||
AutosensData data = autosensDataTable.get(time);
|
||||
if (data != null) {
|
||||
//log.debug(">>> Cache hit " + data.log(time));
|
||||
|
|
Loading…
Reference in a new issue