예제 #1
0
        public void Test_TAGProcessorStateBase_SetICFrequency()
        {
            var state = new TAGProcessorStateBase();

            Assert.True(state.ICFrequencys.GetLatest() == CellPassConsts.NullFrequency, "Initial value incorrect");
            state.SetICFrequency(100);
            Assert.True(state.ICFrequencys.NumAttrs == 2 && state.ICFrequencys.GetLatest() == 100, "Initial value incorrect");
        }
예제 #2
0
        public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                               TAGDictionaryItem valueType)
        {
            state.HaveSeenAnAbsoluteFrequency = false;

            valueSink.SetICFrequency(CellPassConsts.NullFrequency);

            return(true);
        }
예제 #3
0
        public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                         TAGDictionaryItem valueType, uint value)
        {
            state.HaveSeenAnAbsoluteFrequency = true;

            bool result = false;

            if (valueType.Type == TAGDataType.t12bitUInt)
            {
                valueSink.SetICFrequency((ushort)value);
                result = true;
            }

            return(result);
        }
예제 #4
0
        public override bool ProcessIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                 TAGDictionaryItem valueType, int value)
        {
            bool result = false;

            if (state.HaveSeenAnAbsoluteFrequency &&
                (valueType.Type == TAGDataType.t4bitInt || valueType.Type == TAGDataType.t8bitInt))
            {
                if (((ushort)(valueSink.ICFrequencys.GetLatest()) + value) >= 0)
                {
                    valueSink.SetICFrequency((ushort)((ushort)(valueSink.ICFrequencys.GetLatest()) + value));
                    result = true;
                }
            }

            return(result);
        }