コード例 #1
0
ファイル: Vallox.cs プロジェクト: windkh/valloxserial.net
        // 1 1 1 1 1 1 1 1
        // | | | | _______
        // | | | |     |  
        // | | | |     +--- 0-3 set adjustment interval of CO2 and %RH in minutes 
        // | | | |   
        // | | | |   
        // | | | | 
        // | | | +--------- 4 automatic RH basic level seeker state
        // | | +----------- 5 boost switch modde (1=boost, 0 = fireplace)
        // | +------------- 6 radiator type 0 = electric, 1 = water
        // +--------------- 7 cascade adjust 0 = off, 1 = on
        public static void ConvertProgram(Byte program, out int adjustmentIntervalMinutes, out bool automaticHumidityLevelSeekerState, out BoostSwitchMode boostSwitchMode, out RadiatorType radiatorType, out bool cascadeAdjust)
        {
            adjustmentIntervalMinutes = program & 0x0F;

            automaticHumidityLevelSeekerState = (program & 0x10) != 0;
            if ((program & 0x20) == 0)
            {
                boostSwitchMode = BoostSwitchMode.Fireplace;
            }
            else
            {
                boostSwitchMode = BoostSwitchMode.Boost;
            }

            if ((program & 0x40) == 0)
            {
                radiatorType = RadiatorType.Electric;
            }
            else
            {
                radiatorType = RadiatorType.Water;
            }

            cascadeAdjust = (program & 0x80) != 0;
        }
コード例 #2
0
ファイル: Vallox.cs プロジェクト: tetorma/valloxserial.net
        // 1 1 1 1 1 1 1 1
        // | | | | _______
        // | | | |     |
        // | | | |     +--- 0-3 set adjustment interval of CO2 and %RH in minutes
        // | | | |
        // | | | |
        // | | | |
        // | | | +--------- 4 automatic RH basic level seeker state
        // | | +----------- 5 boost switch modde (1=boost, 0 = fireplace)
        // | +------------- 6 radiator type 0 = electric, 1 = water
        // +--------------- 7 cascade adjust 0 = off, 1 = on
        public static void ConvertProgram(Byte program, out int adjustmentIntervalMinutes, out bool automaticHumidityLevelSeekerState, out BoostSwitchMode boostSwitchMode, out RadiatorType radiatorType, out bool cascadeAdjust)
        {
            adjustmentIntervalMinutes = program & 0x0F;

            automaticHumidityLevelSeekerState = (program & 0x10) != 0;
            if ((program & 0x20) == 0)
            {
                boostSwitchMode = BoostSwitchMode.Fireplace;
            }
            else
            {
                boostSwitchMode = BoostSwitchMode.Boost;
            }

            if ((program & 0x40) == 0)
            {
                radiatorType = RadiatorType.Electric;
            }
            else
            {
                radiatorType = RadiatorType.Water;
            }

            cascadeAdjust = (program & 0x80) != 0;
        }