private void btn_led_Click(object sender, EventArgs e) { //MessageBox.Show(Application.StartupPath.ToString()); List <ScreenLEDEntity> listled = ScreenLedFactory.GetAllLed(); foreach (ScreenLEDEntity LEDen in listled) { string[] str = new string[] { "", LEDen.SCREENNAME, LEDen.IPADDRESS, LEDen.PORT, LEDen.WIDTH.ToString(), LEDen.HEIGHT.ToString(), LEDen.CONTROLER, LEDen.SCREENTYPE, LEDen.POSITION, LEDen.STATUS, LEDen.LASTUPDATE.ToString(), LEDen.CADDRESS.ToString() }; ListViewItem Item = new ListViewItem(str); //(0 is green )(1 is yellow)(2 is red) if (LEDen.STATUS == "0") { Item.ImageIndex = 2; } else if (LEDen.STATUS == "1") { Item.ImageIndex = 1; } else { Item.ImageIndex = 0; } ledView.Items.Add(Item); } //this.OpenLed(); }
public void SendLed(string ipaddress) { ScreenLEDEntity screen = ScreenLedFactory.GetByKey(ipaddress); LedPic Led1 = new LedPic(); LedProcFactory LedPlan = new LedProcFactory(null); //LedPic Led1 = new LedPic(twobig);//发送图片 //LedProc LedPlan = new LedProc(null); Led1.Pics = LedPlan.CreatPlanPic(screen.PLINE_CODE); int ses = Led1.Pics.Count * 5000; timer1.Interval = ses > 60000 ? ses : 60000; Led1.SendPics(screen.WIDTH, screen.HEIGHT, screen.CADDRESS, screen.IPADDRESS, screen.PORT); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); //if (IPS.Contains("192.168.113.73")) // this.SendLed("192.168.113.73"); List <ScreenLEDEntity> listscreen = ScreenLedFactory.GetAllLed(); foreach (ScreenLEDEntity screen in listscreen) { if (IPS.Contains(screen.IPADDRESS)) { this.SendLed(screen.IPADDRESS); } } timer1.Start(); }
//连接LED private void OpenLed() { ScreenLEDEntity twobig = ScreenLedFactory.GetByKey("192.168.113.73"); LedDLL.DEVICEPARAM param = new LedDLL.DEVICEPARAM(); GetParam(ref param); dev = LEDSender.LED_Open(ref param, LedDLL.NOTIFY_BLOCK, 0, 0); if (dev == -1) { twobig.STATUS = "2"; ScreenLedFactory.Update(twobig); } else { twobig.STATUS = "1"; ScreenLedFactory.Update(twobig); } }