public void Test_TAGProcessorStateBase_SetICAmplitude() { var state = new TAGProcessorStateBase(); Assert.True(state.ICAmplitudes.GetLatest() == CellPassConsts.NullAmplitude, "Initial value incorrect"); state.SetICAmplitude(100); Assert.True(state.ICAmplitudes.NumAttrs == 2 && state.ICAmplitudes.GetLatest() == 100, "Initial value incorrect"); }
public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink, TAGDictionaryItem valueType) { state.HaveSeenAnAbsoluteAmplitude = false; valueSink.SetICAmplitude(CellPassConsts.NullAmplitude); return(true); }
public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink, TAGDictionaryItem valueType, uint value) { state.HaveSeenAnAbsoluteAmplitude = true; bool result = false; if (valueType.Type == TAGDataType.t12bitUInt) { valueSink.SetICAmplitude((ushort)value); result = true; } return(result); }
public override bool ProcessIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink, TAGDictionaryItem valueType, int value) { bool result = false; if (state.HaveSeenAnAbsoluteAmplitude && (valueType.Type == TAGDataType.t4bitInt || valueType.Type == TAGDataType.t8bitInt)) { if (((ushort)(valueSink.ICAmplitudes.GetLatest()) + value) >= 0) { valueSink.SetICAmplitude((ushort)((ushort)(valueSink.ICAmplitudes.GetLatest()) + value)); result = true; } } return(result); }