예제 #1
0
        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");
        }
예제 #2
0
        public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                               TAGDictionaryItem valueType)
        {
            state.HaveSeenAnAbsoluteAmplitude = false;

            valueSink.SetICAmplitude(CellPassConsts.NullAmplitude);

            return(true);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }