added endTs and startTs to rolling argument
This commit is contained in:
parent
9f356e0a80
commit
1e46100cd2
@ -82,7 +82,8 @@ public class TsRollingArgumentEntry implements ArgumentEntry {
|
||||
for (var e : tsRecords.entrySet()) {
|
||||
values.add(new TbelCfTsDoubleVal(e.getKey(), e.getValue()));
|
||||
}
|
||||
return new TbelCfTsRollingArg(values);
|
||||
long ts = System.currentTimeMillis();
|
||||
return new TbelCfTsRollingArg(ts - timeWindow, ts, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -27,10 +27,16 @@ import static org.thingsboard.script.api.tbel.TbelCfTsDoubleVal.OBJ_SIZE;
|
||||
|
||||
public class TbelCfTsRollingArg implements TbelCfArg, Iterable<TbelCfTsDoubleVal> {
|
||||
|
||||
@Getter
|
||||
private final long startTs;
|
||||
@Getter
|
||||
private final long endTs;
|
||||
@Getter
|
||||
private final List<TbelCfTsDoubleVal> values;
|
||||
|
||||
public TbelCfTsRollingArg(List<TbelCfTsDoubleVal> values) {
|
||||
public TbelCfTsRollingArg(long startTs, long endTs, List<TbelCfTsDoubleVal> values) {
|
||||
this.startTs = startTs;
|
||||
this.endTs = endTs;
|
||||
this.values = Collections.unmodifiableList(values);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user