Exemplo n.º 1
0
 public CookingSurfase(string deviceName, bool deviceState, Burner upperLeftBurner, Burner upperRightBurner, Burner bottomLeftBurner, Burner bottomRightBurner)
     : base(deviceName, deviceState)
 {
     this.BottomLeftBurner = bottomLeftBurner;
     this.BottomRightBurner = bottomRightBurner;
     this.UpperLeftBurner = upperLeftBurner;
     this.UpperRightBurner = upperRightBurner;
 }
Exemplo n.º 2
0
 public Stove(string name, bool state, Burner topLeftBurner, Burner topRightBurner, Burner buttomLeftBurner,
     Burner buttomRightBurner, Oven oven)
     : base(name, state)
 {
     this.topLeftBurner = topLeftBurner;
     this.topRightBurner = topRightBurner;
     this.buttomLeftBurner = buttomLeftBurner;
     this.buttomRightBurner = buttomRightBurner;
     this.oven = oven;
 }
Exemplo n.º 3
0
        public void Handle()
        {
            eq.Add("вытяжка", new KitchenHood("вытяжка", false, EnumeRegimeMinMax.Min));
            eq.Add("котел", new Heating("котел", false, 0, EnumClimatRegime.summer, 0, 40));
            eq.Add("кондиционер", new Split("кондиционер", false, 0, EnumClimatRegime.summer, 0, 40));
            eq.Add("лампа", new Light("лампа", false));
            Oven o1 = new Oven("духовка", false, EnumRegimeOven.regimNul, 0);
            Burner b1 = new Burner("верхняя левая комфорка", false,EnumeRegimeMinMax.Min);
            Burner b2 = new Burner("верхняя правая комфорка", false,EnumeRegimeMinMax.Min);
            Burner b3 = new Burner("нижняя левая комфорка", false, EnumeRegimeMinMax.Min);
            Burner b4 = new Burner("нижняя правая комфорка", false, EnumeRegimeMinMax.Min);
            eq.Add("плита", new Stove("плита", false, b1, b2, b3, b4, o1));

                while(true)
                {
                ShowHeaderMainMenu();
                Console.WriteLine("\n" + "Введите команду" + "\n");
                string command = Console.ReadLine();
                string[] c1 = command.Split(' ');
                ShowMainMenu(c1[0]);
                }
        }
Exemplo n.º 4
0
        private void CreateComponent2(string comp)
        {
            while(true)
            {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine("введите '1' чтобы создать компонент");
            Console.WriteLine("введите '0' что бы вернуться");
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            char a = Console.ReadKey().KeyChar;
            switch (a)
            {
                case '1':
                    switch (comp)
                    {
                        case "лампа":
                            Light light = new Light();
                            menuConfiguration.CreateaComponent(light);
                            key = light.Name;
                            eq.Add(key, light);
                            Console.Clear();
                            Console.WriteLine("\n Создано устройство:\n" + "\n" + light.ToString());
                            break;
                        case "кондиционер":
                            Split split = new Split();
                            menuConfiguration.CreateaComponent(split);
                            menuConfiguration.MenuForCreateTemperatureControl(split);
                            key = split.Name;
                            eq.Add(key, split);
                            Console.Clear();
                            string onOff;
                            if (split.State)
                            {
                                onOff = "включен";
                            }
                            else
                            {
                                onOff = "выключен";
                            }
                            Console.WriteLine("\n Создано устройство:\n" + "\n" + split.Name +
                                " в состоянии: " + onOff + "\n минимальная температура: " + split.MinTemperatire +
            "\n максимальная темпертура: " + split.MaxTemperature);
                            break;
                        case "котел":
                            Heating heating = new Heating();
                            menuConfiguration.CreateaComponent(heating);
                            menuConfiguration.MenuForCreateTemperatureControl(heating);
                            key = heating.Name;
                            eq.Add(key, heating);
                            Console.Clear();
                            if (heating.State)
                            {
                                onOff = "включен";
                            }
                            else
                            {
                                onOff = "выключен";
                            }
                            Console.WriteLine("\n Создано устройство:\n" + "\n" + heating.Name +
                                " в состоянии: " + onOff + "\n минимальная температура: " + heating.MinTemperatire +
            "\n максимальная темпертура: " + heating.MaxTemperature);
                            break;
                        case "плита":
                            Oven O = new Oven();
                            Burner B1 = new Burner();
                            Burner B2 = new Burner();
                            Burner B3 = new Burner();
                            Burner B4 = new Burner();
                            Stove stove = new Stove("плита", false, B1, B2, B3, B4, O);
                            menuConfiguration.CreateaComponent(stove);
                            key = stove.Name;
                            eq.Add(key, stove);
                            Console.Clear();
                            if (stove.State)
                            {
                                onOff = "включен";
                            }
                            else
                            {
                                onOff = "выключен";
                            }
                            Console.WriteLine("\n Создано устройство:\n" + "\n" + stove.Name + " в состоянии: " + onOff);
                            break;
                        case "вытяжка":
                            KitchenHood kitchenHood = new KitchenHood();
                            menuConfiguration.CreateaComponent(kitchenHood);
                            key = kitchenHood.Name;
                            eq.Add(key, kitchenHood);
                            Console.Clear();
                            if (kitchenHood.State)
                            {
                                onOff = "включен";
                            }
                            else
                            {
                                onOff = "выключен";
                            }
                            Console.WriteLine("\n Создано устройство:\n" + "\n" + kitchenHood.Name +
                                " в состоянии: " + onOff);
                            break;
                        case "вернуться":

                            break;
                     }
                    break;
                case '0':
                    return;
                }
            }
        }