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