public void GetSimplePlanCollection(DateTime startDate, DateTime endDate, string signalId) { MOE.Common.Business.PlansBase ds = new PlansBase(signalId, startDate, endDate); for (int i = 0; i < ds.Events.Count; i++) { //if this is the last plan then we want the end of the plan //to cooincide with the end of the graph if (ds.Events.Count - 1 == i) { if (ds.Events[i].Timestamp != endDate) { Plan plan = new Plan(ds.Events[i].Timestamp, endDate, ds.Events[i].EventParam); this.AddItem(plan); } } //else we add the plan with the next plans' time stamp as the end of the plan else { if (ds.Events[i].Timestamp != ds.Events[i + 1].Timestamp) { Plan plan = new Plan(ds.Events[i].Timestamp, ds.Events[i + 1].Timestamp, ds.Events[i].EventParam); this.AddItem(plan); } } } }
public void GetPlanCollection(DateTime startDate, DateTime endDate, List <Models.Controller_Event_Log> cycleEvents, List <Models.Controller_Event_Log> detectorEvents, List <Models.Controller_Event_Log> preemptEvents) { MOE.Common.Business.PlansBase ds = new PlansBase(approach.SignalID, startDate, endDate); for (int i = 0; i < ds.Events.Count; i++) { //if this is the last plan then we want the end of the plan //to cooincide with the end of the graph if (ds.Events.Count - 1 == i) { if (ds.Events[i].Timestamp != endDate) { Plan plan = new Plan(ds.Events[i].Timestamp, endDate, ds.Events[i].EventParam, cycleEvents, detectorEvents, preemptEvents, Approach); this.AddItem(plan); } } //else we add the plan with the next plans' time stamp as the end of the plan else { if (ds.Events[i].Timestamp != ds.Events[i + 1].Timestamp) { Plan plan = new Plan(ds.Events[i].Timestamp, ds.Events[i + 1].Timestamp, ds.Events[i].EventParam, cycleEvents, detectorEvents, preemptEvents, Approach); this.AddItem(plan); } } } }