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); }
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"); }
public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink, TAGDictionaryItem valueType) { state.HaveSeenAnAbsoluteCCV = false; valueSink.SetICCCVValue(CellPassConsts.NullCCV); return(true); }
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); }