예제 #1
0
        public RangeDataState GetDataState(DataAttributes data)
        {
            if (this.inRangeTable.ContainsKey(data))
            {
                return((RangeDataState)this.inRangeTable[data]);
            }
            RangeDataState rangeDataState = new RangeDataState(this, data);

            this.inRangeTable.Add(data, rangeDataState);
            return(rangeDataState);
        }
예제 #2
0
        public virtual void PointerValueChanged(DataAttributes data)
        {
            double num  = Math.Min(this.startValue, this.endValue);
            double num2 = Math.Max(this.startValue, this.endValue);

            if (this.Common != null)
            {
                bool playbackMode = false;
                if (((IValueConsumer)data).GetProvider() != null)
                {
                    playbackMode = ((IValueConsumer)data).GetProvider().GetPlayBackMode();
                }
                NamedElement   pointer   = (NamedElement)data.Parent;
                RangeDataState dataState = this.GetDataState(data);
                double         num3      = data.Value;
                if (data.IsPercentBased)
                {
                    num3 = data.GetValueInPercents();
                }
                if (!dataState.IsInRange && num3 >= num && num3 <= num2)
                {
                    dataState.IsInRange = true;
                    this.OnValueRangeEnter(this, new ValueRangeEventArgs(num3, data.DateValueStamp, this.Name, playbackMode, pointer));
                    if (!(this.inRangeTimeout > 0.0))
                    {
                        dataState.IsTimerExceed = true;
                    }
                }
                if (dataState.IsInRange)
                {
                    if (!double.IsNaN(num3) && !(num3 < num) && !(num3 > num2))
                    {
                        return;
                    }
                    dataState.IsInRange     = false;
                    dataState.IsTimerExceed = false;
                    this.OnValueRangeLeave(this, new ValueRangeEventArgs(num3, data.DateValueStamp, this.Name, playbackMode, pointer));
                    double inRangeTimeout2 = this.inRangeTimeout;
                }
            }
        }