Ejemplo n.º 1
0
        public frmxml()
        {
            InitializeComponent();

            hvac1.NUM        = 1;
            hvac1.ROOM       = "power";
            hvac1.COMPRESSOR = true;
            hvac1.HEATER     = false;
            hvac1.FAN        = true;
            hvaclist.Add(hvac1);

            TcHVAC hvac2 = new TcHVAC();

            hvac2.NUM        = 2;
            hvac2.ROOM       = "Room";
            hvac2.COMPRESSOR = false;
            hvac2.HEATER     = false;
            hvac2.FAN        = false;
            hvaclist.Add(hvac2);

            TcHVAC hvac3 = new TcHVAC();

            hvac3.NUM        = 3;
            hvac3.ROOM       = "power";
            hvac3.COMPRESSOR = true;
            hvac3.HEATER     = true;
            hvac3.FAN        = true;
            hvaclist.Add(hvac3);
        }
Ejemplo n.º 2
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            try
            {
                if (chbCool.Checked && !chbHeat.Checked)
                {
                    TcHVAC hvac1 = new TcHVAC();
                    hvac1.NUM  = 1;
                    hvac1.ROOM = "Power";

                    TcHVAC hvac2 = new TcHVAC();
                    hvac2.NUM  = 2;
                    hvac2.ROOM = "Power";

                    List <TcHVAC> hvacs = new List <TcHVAC>();
                    hvacs.Add(hvac1);
                    hvacs.Add(hvac2);

                    //TcTemp obj = new TcTemp();
                    //obj.startBrowser();
                    //obj.LoginAsAdmin();
                    // obj.IncreaseTemperature(hvacs);
                }
                else if (chbHeat.Checked)
                {
                    // cooling + heating
                    TcHeat obj = new TcHeat();
                    obj.startBrowser();
                    obj.LoginAsAdmin();
                    mainresult      = obj.TurnPowerRoomHeater(1, true, Convert.ToDouble(tbHeaterOff.Text), Convert.ToDouble(tbHeaterstart.Text));
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    //obj.closeBrowser();
                    System.Threading.Thread.Sleep(10000);
                    mainresult      = obj.TurnPowerRoomHeater(1, false, Convert.ToDouble(tbHeaterOff.Text), Convert.ToDouble(tbHeaterstart.Text));
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());

                    System.Threading.Thread.Sleep(10000);
                    mainresult      = obj.TurnPowerRoomHeater(2, true, Convert.ToDouble(tbHeaterOff.Text), Convert.ToDouble(tbHeaterstart.Text));
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    //obj.closeBrowser();
                    System.Threading.Thread.Sleep(10000);

                    mainresult      = obj.TurnPowerRoomHeater(2, false, Convert.ToDouble(tbHeaterOff.Text), Convert.ToDouble(tbHeaterstart.Text));
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    obj.closeBrowser();
                }
                else if (chbHumidity.Checked)    // chbCool.Checked && chbHeat.Checked &&
                {
                    // only cooling and heating + humidity
                    TcHumid obj = new TcHumid();
                    obj.startBrowser();
                    obj.LoginAsAdmin();
                    //mainresult = obj.TurnHVACDehumidification(1, true);
                    //rtbResult.Text += "\n" + mainresult;
                    //writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    //System.Threading.Thread.Sleep(30000);
                    //mainresult = obj.TurnHVACDehumidification(1, false);
                    //rtbResult.Text += "\n" + mainresult;
                    //writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    //System.Threading.Thread.Sleep(30000);
                    mainresult      = obj.TurnHVACDehumidification(2, true);
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    System.Threading.Thread.Sleep(30000);
                    mainresult      = obj.TurnHVACDehumidification(2, false);
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                }
                else if (chbDiff.Checked) //chbCool.Checked && chbHeat.Checked && chbHumidity.Checked &&
                {
                    // cooling + heating + humidity + diffpressure
                    TcDfPressure obj = new TcDfPressure();
                    obj.startBrowser();
                    obj.LoginAsAdmin();
                    mainresult      = obj.TurnOnDamperDiffPressure(1, true);
                    rtbResult.Text += "\n" + mainresult;
                    writedatainXML(mainresult + "--" + DateTime.Now.ToString());
                    obj.closeBrowser();
                }
                else
                {
                    MessageBox.Show("Select Test");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }