Esempio n. 1
0
        public void Test_TAGProcessorStateBase_SetICTemperatureValue()
        {
            var state = new TAGProcessorStateBase();

            Assert.True(state.ICTemperatureValues.GetLatest() == CellPassConsts.NullMaterialTemperatureValue, "Initial value incorrect");
            state.SetICTemperatureValue(100);
            Assert.True(state.ICTemperatureValues.NumAttrs == 2 && state.ICTemperatureValues.GetLatest() == 100, "Initial value incorrect");
        }
Esempio n. 2
0
        public override bool ProcessEmptyValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                               TAGDictionaryItem valueType)
        {
            state.HaveSeenAnAbsoluteTemperature = false;

            valueSink.SetICTemperatureValue(CellPassConsts.NullMaterialTemperatureValue);

            return(true);
        }
Esempio n. 3
0
        public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                         TAGDictionaryItem valueType, uint value)
        {
            // Value is absolute temperature value
            state.HaveSeenAnAbsoluteTemperature = true;

            bool result = false;

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

            return(result);
        }
Esempio n. 4
0
        public override bool ProcessIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                 TAGDictionaryItem valueType, int value)
        {
            bool result = false;

            if (state.HaveSeenAnAbsoluteTemperature)
            {
                if (valueType.Type == TAGDataType.t4bitInt || valueType.Type == TAGDataType.t8bitInt)
                {
                    if ((ushort)valueSink.ICTemperatureValues.GetLatest() + value >= 0)
                    {
                        valueSink.SetICTemperatureValue((ushort)((ushort)valueSink.ICTemperatureValues.GetLatest() + value));
                        result = true;
                    }
                }
            }

            return(result);
        }