You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One would expect that using the history generation feature of the meta data source, an interval logging point should correctly do its interval logging as though it had been running through that period of time (disregarding the future). However, because of the logic in DataPointRT:savePointValue,
case DataPointVO.LoggingTypes.INTERVAL:
if (!backdated)
intervalSave(newValue);
and pointValue still being initialized to the current point value, interval logging doesn't really work. I noticed I could get this working by doing a few things,
DataPointRT
Change initialize / terminate historical to care about the simulation timer,
public void initializeHistorical() {
if(timer != null) {
pointValue = getPointValueBefore(timer.currentTimeMillis());
initializeIntervalLogging(timer.currentTimeMillis(), false);
} else {
initializeIntervalLogging(0l, false);
}
}
I didn't set the timer back, because the timer is set in the constructor so it just didn't seem right. These points shouldn't be in the runtime manager or anything like that, so it shouldn't matter - these data point RT's are discarded when the historical run is done.
One would expect that using the history generation feature of the meta data source, an interval logging point should correctly do its interval logging as though it had been running through that period of time (disregarding the future). However, because of the logic in DataPointRT:savePointValue,
case DataPointVO.LoggingTypes.INTERVAL:
if (!backdated)
intervalSave(newValue);
and pointValue still being initialized to the current point value, interval logging doesn't really work. I noticed I could get this working by doing a few things,
DataPointRT
Change initialize / terminate historical to care about the simulation timer,
public void initializeHistorical() {
if(timer != null) {
pointValue = getPointValueBefore(timer.currentTimeMillis());
initializeIntervalLogging(timer.currentTimeMillis(), false);
} else {
initializeIntervalLogging(0l, false);
}
}
public void terminateHistorical() {
terminateIntervalLogging();
pointValue = valueCache.getLatestPointValue();
timer = Common.timer;
}
Change initilizeIntervalLogging to correctly set the interval start time:
intervalStartTime = timer == null ? Common.timer.currentTimeMillis() : timer.currentTimeMillis();
Meta edit dwr:
move initialize historical after the delete before code, fix up the generate data source's history
I am going to do the work to the Meta edit dwr as it is simply more correct that way, but it should behave the same until DataPointRT is modified
The text was updated successfully, but these errors were encountered: