Esempio n. 1
0
        public void buttonAddHeater_Click(object sender, EventArgs e)
        {
            Heater heater = new Heater(Data.getNewHeaterID());

            Room.Heaters.Add(heater);
            HeaterPanel heaterPanel = new HeaterPanel(heater);

            heaterPanel.HeaterPanelDeleted  += new HeaterPanelDeletedEventHandler(heaterPanelDeleted);
            heaterPanel.HeaterPanelCopied   += new HeaterPanelCopiedEventHandler(heaterPanelCopied);
            heaterPanel.HeaterPanelLearning += new HeaterPanelLearningEventHandler(heaterPanel_HeaterPanelLearning);
            heater.setManual(Data.calibration.manualSoll);
            flowLayoutPanel1.Controls.Add(heaterPanel);

            //Simplified
            //HeaterPanelSimplified roomPanelSimple = new HeaterPanelSimplified(heater.ID+1);

            rps.addHeater(heater.ID + 1);
            heaterPanel.textBoxID.TextChanged   += new EventHandler(((HeaterPanelSimplified)rps.tableLayoutPanel1.Controls[rps.tableLayoutPanel1.Controls.Count - 1]).textChanged);
            heaterPanel.numericSoll.TextChanged += new EventHandler(((HeaterPanelSimplified)rps.tableLayoutPanel1.Controls[rps.tableLayoutPanel1.Controls.Count - 1]).numericSollChanged);
            heaterPanel.isValue.TextChanged     += new EventHandler(((HeaterPanelSimplified)rps.tableLayoutPanel1.Controls[rps.tableLayoutPanel1.Controls.Count - 1]).isValueChanged);
            heaterPanel.isTemp.TextChanged      += new EventHandler(((HeaterPanelSimplified)rps.tableLayoutPanel1.Controls[rps.tableLayoutPanel1.Controls.Count - 1]).isTempChanged);
            heaterPanel.Mode.TextChanged        += new EventHandler(((HeaterPanelSimplified)rps.tableLayoutPanel1.Controls[rps.tableLayoutPanel1.Controls.Count - 1]).modusChanged);


            /*
             *             ()(((FormMain)mainforms).flowLayoutPanel2.Controls[this.Room.ID]).Hide();
             * roomPanel.textBoxName.TextChanged += new EventHandler(roomPanelSimple.nameBoxChanging);
             * roomPanel.moduleSoll.TextChanged += new EventHandler(roomPanelSimple.sollModuleChanging);
             * roomPanel.moduleIst.TextChanged += new EventHandler(roomPanelSimple.istModuleChanging);
             * roomPanel.textBox1.TextChanged += new EventHandler(roomPanelSimple.sollSollChanging);
             * roomPanel.moduleID.TextChanged += new EventHandler(roomPanelSimple.moduleIDChanging);
             * roomPanelSimple.sollButton.Click += new EventHandler(roomPanel.showGraph_Click);
             * roomPanel.buttonAddHeater.Click += new EventHandler(roomPanelSimple.addHeater);
             * */
        }