public void SendToIoTCall_1(object state) { //tab0的暂停效果 if (tab0_tab1_or_not != 5) //如果等于5,就说明tab0和tab1已经完事了 { Action <bool> action = (x) => //每次都对当前所有节点进行一次监测 { switch (tab0_tab1_or_not) { case 0: tab0_tab1_or_not = 5; SecondPicture_tab1.Play(); tabcontrol.SelectedIndex = 1; break; } }; this.Dispatcher.Invoke(action, true); } if (DiaoXian_timer <= 1200)//此定时器是三秒触发一次,所以此处的实际时间是一个小时左右 { ++DiaoXian_timer; } else { DiaoXian_timer = 0; Action <bool> action = (x) =>//每次都对当前所有节点进行一次监测 { update_jiedians_DiaoXian(); }; this.Dispatcher.Invoke(action, true); } //节点报警声音 Action <bool> action_warning = (x) =>//每次都对当前所有节点进行一次监测 { bool flag_warning = false; for (int i = 0; i < ellipse_list_tab2.Count; ++i) { if (ellipse_list_tab2[i].Fill == System.Windows.Media.Brushes.Red || ellipse_list_tab2[i].Fill == System.Windows.Media.Brushes.Yellow) { flag_warning = true; break; } } if (flag_warning == true) { MessageBeep((uint)0x00000010); } }; this.Dispatcher.Invoke(action_warning, true); }
public void SendToIoTCall(object state) { //tab0的暂停效果 if (tab0_tab1_or_not != 5) //如果等于5,就说明tab0和tab1已经完事了 { Action <bool> action = (x) => //每次都对当前所有节点进行一次监测 { switch (tab0_tab1_or_not) { case 0: tab0_tab1_or_not = 5; SecondPicture_tab1.Play(); tabcontrol.SelectedIndex = 1; break; } }; this.Dispatcher.Invoke(action, true); } //string temp_str = "ep=J4JFAJUGYS3GGF7Z&pw=123456"; //byte[] buff = System.Text.Encoding.ASCII.GetBytes(temp_str); //byte[] array_byte = new byte[4] { 115, 29, 240, 46 };//设定远程ip地址 //IPAddress ip = new IPAddress(array_byte); //IPEndPoint lep = new IPEndPoint(ip, 6000); //mysql_Thread.newsock.Connect(lep); //mysql_Thread.newsock.Send(buff); //如果程序长期开启,会在每小时检测有无节点掉线 if (DateTime.Now.ToString("mm:ss") == "00:00") { update_jiedians_DiaoXian(); } }
private void SecondPicture_tab1_MouseUp(object sender, MouseButtonEventArgs e) { tabcontrol.SelectedIndex = 2;//Ìøתµ½tab2 SecondPicture_tab1.Pause(); }