예제 #1
0
        /// <summary>
        /// List[0]=AO,List[1]=DO,List[2]=AI,List[3]=DI  //2 temp AI - standart(not enabled)(with recirc)
        /// </summary>
        /// <param name="coolerVM">CoolerViewModel</param>
        /// <returns></returns>
        public List <int> GetPins(CoolerViewModel coolerVM)
        {
            var       heaterM           = new Heater();
            var       liquidM           = new LiquidModel();
            var       electricM         = new ElectricModel();
            DataClass coolerControlData = coolerVM.GetControlData();

            Type  = coolerControlData.StringData[0];
            Dryer = coolerControlData.StringData[1];
            if (Type == "Фреоновый")
            {
                AI         += 1;        //Room temperature
                NumOfStages = coolerControlData.IntData[0];
                DO         += NumOfStages;
            }
            else
            {
                AO += 1;
            }
            if (Dryer == "Да")
            {
                AI += 2;   //Добавляет датчики??
            }
            ExtraHeater = coolerControlData.StringData[2];
            if (ExtraHeater == "Да")
            {
                heaterM.Type = coolerControlData.StringData[3];
                if (heaterM.Type == "Жидкостный")
                {
                    AO += 1;
                    AI += 1;
                    DO += 1;
                    liquidM.AirTemp = coolerControlData.StringData[4];
                    if (liquidM.AirTemp == "Да")
                    {
                        DI += 1;
                    }
                }
                else
                {
                    electricM.FirstStage   = coolerControlData.StringData[4];
                    electricM.NumOfStages  = coolerControlData.IntData[1];
                    electricM.ThermoSwitch = coolerControlData.IntData[2];
                    if (electricM.FirstStage == "Да")
                    {
                        AO += 1;
                    }
                    DO += electricM.NumOfStages;
                    DI += electricM.ThermoSwitch;
                }
            }
            var result = new List <int> {
                AO, DO, AI, DI
            };

            return(result);
        }
예제 #2
0
        /// <summary>
        /// List[0]-AO,List[1]-DO,List[2]-AI,List[3]-DI(+AI with /no recirc 2/1)
        /// </summary>
        public List <int> GetPins(HeaterViewModel heaterVM)
        {
            var liquidM           = new LiquidModel();
            var electricM         = new ElectricModel();
            var extraLiquid       = new LiquidModel();
            var extraElectric     = new ElectricModel();
            var heaterControlData = heaterVM.GetControlData();

            Type = heaterControlData.StringData[0];
            if (Type == "Жидкостный")
            {
                AO += 1;
                DO += 1;
                AI += 1;
                liquidM.AirTemp = heaterControlData.StringData[1];
                if (liquidM.AirTemp == "Да")
                {
                    DI += 1;
                }
            }
            else
            {
                electricM.FirstStage   = heaterControlData.StringData[1];
                electricM.NumOfStages  = heaterControlData.IntData[0];
                electricM.ThermoSwitch = heaterControlData.IntData[1];
                if (electricM.FirstStage == "Да")
                {
                    AO += 1;
                }
                DO += electricM.NumOfStages;
                DI += electricM.ThermoSwitch;
            }
            if (heaterVM.ExtraHeater == true)
            {
                ExtraType = heaterControlData.StringData[2];
                if (ExtraType == "Жидкостный")
                {
                    AO += 1;
                    DO += 1;
                    AI += 1;
                    extraLiquid.AirTemp = heaterControlData.StringData[3];
                    if (extraLiquid.AirTemp == "Да")
                    {
                        DI += 1;
                    }
                }
                else
                {
                    if (Type != "Жидкостный")
                    {
                        extraElectric.FirstStage   = heaterControlData.StringData[3];
                        extraElectric.NumOfStages  = heaterControlData.IntData[2];
                        extraElectric.ThermoSwitch = heaterControlData.IntData[3];
                        if (electricM.FirstStage == "Да")
                        {
                            AO += 1;
                        }
                        DO += extraElectric.NumOfStages;
                        DI += extraElectric.ThermoSwitch;
                    }
                    else
                    {
                        extraElectric.FirstStage   = heaterControlData.StringData[3];
                        extraElectric.NumOfStages  = heaterControlData.IntData[0];
                        extraElectric.ThermoSwitch = heaterControlData.IntData[1];
                        if (electricM.FirstStage == "Да")
                        {
                            AO += 1;
                        }
                        DO += extraElectric.NumOfStages;
                        DI += extraElectric.ThermoSwitch;
                    }
                }
            }
            var result = new List <int> {
                AO, DO, AI, DI
            };

            return(result);
        }