udotdevelopment/ATSPM

PlanFactory only looks back 1 hour for a Coordination Pattern Change

ian-cameron opened this issue · 1 comments

The only reference to this method is in PlanFactory.cs where its used to find the first Event 131 (coordination pattern change) that occurs before the start date of a chart. That's the only way to know which plan was running at the start of the chart period.

Was there a reason to change this from -1 Day to -1 Hour? (Our dataset is much smaller, but the query didn't seem to be any slower or faster when going back an hour, day, or week...?)

Our most commonly used charts are full-day (00:00 - 23:59) and limiting this search for the first plan change event to just 1 hour prior to the start date misses a lot of plan changes, and it shows as unknown plan on the charts.

We were actually thinking of changing this to this -1 week so it works when a weekend plan is running: when the first prior plan change event would be >= 48 hours earlier than the start date of a Monday chart. But then noticed you went the other way making it a smaller search window. Would making this 1 week (or even unbounded) cause a problem?

We initially did this as one day but it brought our reports to a screeching halt. It may be worth making this a variable in the config page but it may introduce a slow down that is hard to trace.