public BarrierHistory this[IBarrierValue Barrier] { get { return(this.Histories[Barrier.BarrierUniqueKey]); } }
private BarrierHistory(IBarrierValue Barrier, string PositionStates, string RangeStates, Dictionary <EventType, int> LastMatchedLengths) { this.Barrier = Barrier; this.PositionStates = PositionStates; this.RangeStates = RangeStates; this.LastMatchedLengths = LastMatchedLengths; }
public BarrierEventObject(EventType EventType, Direction Direction, IBarrierValue Barrier, StudyValue StudyValue, int BarNumber) { this.EventType = EventType; this.Direction = Direction; this.Barrier = Barrier; this.StudyValue = StudyValue; this.BarNumber = BarNumber; }
public void UpdateState(IBarrierValue Barrier, BarrierHistory.Position Position, BarrierHistory.Range Range) { if (!this.Histories.ContainsKey(Barrier.BarrierUniqueKey)) { this.Histories.Add(Barrier.BarrierUniqueKey, new BarrierHistory(Barrier)); } this.Histories[Barrier.BarrierUniqueKey].UpdateState(Barrier, Position, Range); }
private BarrierEventObject GetEvent( EventPatternKey EventPatternKey, IBarrierValue Barrier, StudyValue StudyValue, int BarNumber) { if (this.Histories[Barrier.BarrierUniqueKey].IsEvent(EventPatternKey)) { return(new BarrierEventObject(EventPatternKey.EventType, EventPatternKey.Direction, Barrier, StudyValue, BarNumber)); } else { return(null); } }
public BarrierHistory(IBarrierValue Barrier) { this.Barrier = Barrier; this.PositionStates = String.Empty; this.RangeStates = String.Empty; this.LastMatchedLengths = new Dictionary <EventType, int>(); EventType[] eventTypes = (EventType[])Enum.GetValues(typeof(EventType)); foreach (EventType type in eventTypes) { if (type != EventType.NotSet) { this.LastMatchedLengths.Add(type, 0); } } }
public void UpdateState(IBarrierValue Barrier, Position Position, Range Range) { if (this.Barrier.BarrierUniqueKey != Barrier.BarrierUniqueKey) { throw new ApplicationException("Wrong barrier."); } this.Barrier = Barrier; char position = AllPositionStates.SingleOrDefault(s => s.Key == Position).Value; char range = AllRangeStates.SingleOrDefault(s => s.Key == Range).Value; if ((String.IsNullOrEmpty(this.PositionStates)) || (!this.PositionStates.EndsWith(Convert.ToString(position)))) { this.PositionStates = String.Concat(this.PositionStates, position); } if ((String.IsNullOrEmpty(this.RangeStates)) || (!this.RangeStates.EndsWith(Convert.ToString(range)))) { this.RangeStates = String.Concat(this.RangeStates, range); } }