1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- package main
- import (
- "lc-smartX/lc"
- "lc-smartX/util/gopool"
- "time"
- )
- func main() {
- gopool.SetCap(64)
- gopool.Go(lc.StartEventServer)
- //等事件服务先启动
- time.Sleep(1 * time.Second)
- ctl := &lc.IntersectionCtl{
- Main: time.NewTicker(5 * time.Second),
- Sub: time.NewTicker(5 * time.Second),
- ReTicker: time.NewTicker(18 * time.Second),
- }
- lc.StartSmartXServer(ctl)
- //conn, err := net.Dial("tcp", "192.168.110.200:5000")
- //if err != nil {
- // logrus.Fatalln("建立连接失败:", err)
- //}
- //client := lc.NewScreen("支路1屏", conn)
- //开关机
- //client.TurnOnOff(false)
- //清除所有文件
- //client.DelFile("")
- //删除指定文件
- //client.DelFile("P002")
- //发送flash文件节目
- //file := lc.FlashFile{}
- //file.SetMsg("龙弛智慧", lc.Green)
- //file.SetMode(lc.DefaultRunMode, lc.DefaultDispMode)
- //file.SetOrigin(0, true, 0)
- //file.SetArea(64, true, 16)
- //client.TextFlash(file)
- //发送位图文件-不报错,不成功
- //file, err := os.ReadFile("./lc/bitmap/T000.bcm")
- //if err != nil {
- // logrus.Error("读取图库文件失败:", err)
- // return
- //}
- //client.Bitmap("T000", file)
- //发送动态区
- //file1 := lc.FlashFile{}
- //file1.SetMsg("动态", lc.Blue)
- //file1.SetMode(lc.DefaultRunMode, lc.DefaultDispMode)
- //file1.SetOrigin(32, true, 0)
- //file1.SetArea(32, true, 16)
- //client.TextFlash(file1)
- //client.TextRam(file1)
- //锁定/解锁节目
- //client.Lock(1, "P000")
- //删除动态区
- //client.DelRamText(0)
- //client.Lock(1, "P000")
- //time.Sleep(time.Second * 1)
- ////查询当前状态
- //client.State()
- //time.Sleep(time.Second * 1)
- //client.Info()
- //time.Sleep(time.Second * 2)
- }
|