main.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package main
  2. import (
  3. "lc-smartX/lc"
  4. "lc-smartX/util/gopool"
  5. "time"
  6. )
  7. func main() {
  8. gopool.SetCap(64)
  9. gopool.Go(lc.StartEventServer)
  10. //等事件服务先启动
  11. time.Sleep(1 * time.Second)
  12. ctl := &lc.IntersectionCtl{
  13. Main: time.NewTicker(5 * time.Second),
  14. Sub: time.NewTicker(5 * time.Second),
  15. ReTicker: time.NewTicker(18 * time.Second),
  16. }
  17. lc.StartSmartXServer(ctl)
  18. //conn, err := net.Dial("tcp", "192.168.110.200:5000")
  19. //if err != nil {
  20. // logrus.Fatalln("建立连接失败:", err)
  21. //}
  22. //client := lc.NewScreen("支路1屏", conn)
  23. //开关机
  24. //client.TurnOnOff(false)
  25. //清除所有文件
  26. //client.DelFile("")
  27. //删除指定文件
  28. //client.DelFile("P002")
  29. //发送flash文件节目
  30. //file := lc.FlashFile{}
  31. //file.SetMsg("龙弛智慧", lc.Green)
  32. //file.SetMode(lc.DefaultRunMode, lc.DefaultDispMode)
  33. //file.SetOrigin(0, true, 0)
  34. //file.SetArea(64, true, 16)
  35. //client.TextFlash(file)
  36. //发送位图文件-不报错,不成功
  37. //file, err := os.ReadFile("./lc/bitmap/T000.bcm")
  38. //if err != nil {
  39. // logrus.Error("读取图库文件失败:", err)
  40. // return
  41. //}
  42. //client.Bitmap("T000", file)
  43. //发送动态区
  44. //file1 := lc.FlashFile{}
  45. //file1.SetMsg("动态", lc.Blue)
  46. //file1.SetMode(lc.DefaultRunMode, lc.DefaultDispMode)
  47. //file1.SetOrigin(32, true, 0)
  48. //file1.SetArea(32, true, 16)
  49. //client.TextFlash(file1)
  50. //client.TextRam(file1)
  51. //锁定/解锁节目
  52. //client.Lock(1, "P000")
  53. //删除动态区
  54. //client.DelRamText(0)
  55. //client.Lock(1, "P000")
  56. //time.Sleep(time.Second * 1)
  57. ////查询当前状态
  58. //client.State()
  59. //time.Sleep(time.Second * 1)
  60. //client.Info()
  61. //time.Sleep(time.Second * 2)
  62. }