コード例 #1
0
ファイル: TabMap.cs プロジェクト: batungbk55/Gateway
        //****************************************************
        private void Emboard_Load(object sender,EventArgs e)
        {
            Database db = new Database();
            comPort.pic = pictureBox1;
            db.setAllFalse();
            txtmac.Hide();
            pnShow.Hide();
            btexit.Enabled = true;
            comPort.txtShowData = tbShow;
            comPort.TimerInit();
            comPort.Time_control = db.getTimeActor();
            comPort.Time_alarm = db.getTimeAlarm();
            db.setFalseBC();
            db.setValOff();
            db.setAllFalse();
#if ACTOR_BAOCHAY
            cbMalenh.Items.Clear();
            cbMalenh.Items.Add("Lay nhiet do, do am");
            for (int i = 1; i < 6; i++)
            {
                cbMalenh.Items.Add("Gui canh bao muc "+i);
            }
#else
            cbMalenh.Items.Clear();
            cbMalenh.Items.Add("Lay nhiet do, do am");
            for (int i = 1; i < 7; i++)
            {
                cbMalenh.Items.Add("Bat van so "+i);
            }
            cbMalenh.Items.Add("Bat tat ca cac van");
            for (int i = 1; i < 7; i++)
            {
                cbMalenh.Items.Add("Tat van so " + i);
            }
            cbMalenh.Items.Add("Tat tat ca cac van");
#endif
            try
                {
                    drawImage.pictureBox = pictureBox1;
                    drawImage.reload(drawImage.pictureBox);
                }
                catch
                {
                    MessageBox.Show("Khong the load ban do");
                }
        }
コード例 #2
0
ファイル: TabMap.cs プロジェクト: ThuTrangK57/sigateWsan
        //****************************************************
        private void Emboard_Load(object sender,EventArgs e)
        {
            Database db = new Database();
            comPort.pic = pictureBox1;
            db.setAllFalse();
            txtmac.Hide();
            pnShow.Hide();
            btexit.Enabled = true;
            comPort.txtShowData = tbShow;
            comPort.PicboxImage = picboxImage;
            comPort.TimerInit();
            comPort.Time_control = db.getTimeActor();
            comPort.Time_alarm = db.getTimeAlarm();
            db.setFalseBC();
            db.setValOff();
            db.setAllFalse();

#region tabpicture begin
            cbnodeImg.Items.Clear();
            Database my_Database = new Database();
            //Hien thi danh sach sensor khu vuon lan
            XmlNodeList nodeSensor = ((XmlElement)my_Database.sensor).GetElementsByTagName("node");
            foreach (XmlNode node in nodeSensor)
            {
                if (node.Attributes["status"].Value == "true" || node.Attributes["status"].Value == "True")
                {
                    string str = "Sensor " + node.Attributes["mac"].Value;
                    cbnodeImg.Items.Add(str);
                }
            }
            XmlNodeList nodeSensor_BC = ((XmlElement)my_Database.sensor_bc).GetElementsByTagName("node");
            foreach (XmlNode node_BC in nodeSensor_BC)
            {
                if (node_BC.Attributes["status"].Value == "true" || node_BC.Attributes["status"].Value == "True")
                {
                    string str = "Sensor " + node_BC.Attributes["mac"].Value;
                    cbnodeImg.Items.Add(str);
                }
            }
#endregion 

#if ACTOR_BAOCHAY
            cbMalenh.Items.Clear();
            cbMalenh.Items.Add("Lay nhiet do, do am");
            for (int i = 1; i < 6; i++)
            {
                cbMalenh.Items.Add("Gui canh bao muc "+i);
            }
#else
            cbMalenh.Items.Clear();
            cbMalenh.Items.Add("Lay nhiet do, do am");
            for (int i = 1; i < 7; i++)
            {
                cbMalenh.Items.Add("Bat van so "+i);
            }
            cbMalenh.Items.Add("Bat tat ca cac van");
            for (int i = 1; i < 7; i++)
            {
                cbMalenh.Items.Add("Tat van so " + i);
            }
            cbMalenh.Items.Add("Tat tat ca cac van");
#endif
            try
                {
                    drawImage.pictureBox = pictureBox1;
                    drawImage.reload(drawImage.pictureBox);
                }
                catch
                {
                    MessageBox.Show("Khong the load ban do");
                }
        }
コード例 #3
0
 //****************************************************
 private void Emboard_Load(object sender,EventArgs e)
 {
     Database myDatabase = new Database();
     send = new Thread(new ThreadStart(comPort.SendRS));
     send.Start();
     comPort.TimerInt();
     #if ACTOR_COOR
     myDatabase.setAllFalse();
     cbMalenh.Items.Clear();
     cbMalenh.Items.Add("Lay nhiet do, do am");
     cbMalenh.Items.Add("Bat van so 1");
     cbMalenh.Items.Add("Bat van so 2");
     cbMalenh.Items.Add("Bat van so 3");
     cbMalenh.Items.Add("Bat van so 4");
     cbMalenh.Items.Add("Bat van so 5");
     cbMalenh.Items.Add("Bat van so 6");
     cbMalenh.Items.Add("Bat tat ca cac van");
     cbMalenh.Items.Add("Tat van so 1");
     cbMalenh.Items.Add("Tat van so 2");
     cbMalenh.Items.Add("Tat van so 3");
     cbMalenh.Items.Add("Tat van so 4");
     cbMalenh.Items.Add("Tat van so 5");
     cbMalenh.Items.Add("Tat van so 6");
     cbMalenh.Items.Add("Tat tat ca cac van");
     #endif
     
     #if BC_COOR
     myDatabase.setFalseActor();
     myDatabase.setNetworkIpActor("B1","0000");
     cbMalenh.Items.Clear();
     cbMalenh.Items.Add("Lay nhiet do, do am");
     cbMalenh.Items.Add("Bat canh bao muc 1");
     cbMalenh.Items.Add("Bat canh bao muc 2");
     cbMalenh.Items.Add("Bat canh bao muc 3");
     cbMalenh.Items.Add("Bat canh bao muc 4");
     cbMalenh.Items.Add("Bat canh bao muc 5");
     #endif
     
     myDatabase.setFalseBC();
     myDatabase.setValOff();
     myDatabase.setTimeVan(1, 0);
     myDatabase.setTimeVan(2, 0);
     myDatabase.setTimeVan(3, 0);
     myDatabase.setTimeVan(4,0);
     myDatabase.setTimeVan(5, 0);
     comPort.Time_alarm = myDatabase.getTimeAlarm();
     comPort.Time_control = myDatabase.getTimeActor();
     comPort.mypanel = pnShow;
     comPort.mytext = txtshow;
     comPort.tb = tbShow;
     txtmac.Hide();
     pnShow.Hide();
     btexit.Enabled = true;
     try
     {
         comPort.pictureBox = pictureBox1;
         comPort.reload(comPort.pictureBox);
     }
     catch
     {
         MessageBox.Show("Khong the load ban do");
     }
   
 }