示例#1
0
        public override bool ProcessIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                 TAGDictionaryItem valueType, int value)
        {
            bool result = false;

            if (!state.HaveSeenAnAbsoluteCCV)
            {
                return(false);
            }

            switch (valueType.Type)
            {
            case TAGDataType.t4bitInt:
            case TAGDataType.t8bitInt:
                if (((short)(valueSink.ICCCVValues.GetLatest()) + value) >= 0)
                {
                    valueSink.SetICCCVValue((short)((short)(valueSink.ICCCVValues.GetLatest()) + value));
                    result = true;
                }

                break;
            }

            return(result);
        }
示例#2
0
        public void Test_TAGProcessorStateBase_SetICCCVValue()
        {
            var state = new TAGProcessorStateBase();

            Assert.True(state.ICCCVValues.GetLatest() == CellPassConsts.NullCCV, "Initial value incorrect");
            state.SetICCCVValue(100);
            Assert.True(state.ICCCVValues.NumAttrs == 2 && state.ICCCVValues.GetLatest() == 100, "Initial value incorrect");
        }
示例#3
0
        public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                               TAGDictionaryItem valueType)
        {
            state.HaveSeenAnAbsoluteCCV = false;

            valueSink.SetICCCVValue(CellPassConsts.NullCCV);

            return(true);
        }
示例#4
0
        public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                         TAGDictionaryItem valueType, uint value)
        {
            state.HaveSeenAnAbsoluteCCV = true;

            bool result = false;

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

            return(result);
        }