screen.go 677 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package lc
  2. import (
  3. "fmt"
  4. "lc-smartX/bx"
  5. "net"
  6. )
  7. // Screener 屏接口
  8. type Screener interface {
  9. Display(int)
  10. }
  11. type Screen struct {
  12. Name string
  13. Addr string
  14. conn net.Conn
  15. liveState bool
  16. StateInfo *bx.StateInfo //状态信息
  17. Params *bx.Params //屏参
  18. }
  19. func NewScreen(name string, ip, port string) *Screen {
  20. s := &Screen{
  21. Name: name,
  22. Addr: fmt.Sprintf("%s:%s", ip, port),
  23. StateInfo: &bx.StateInfo{},
  24. Params: &bx.Params{},
  25. }
  26. s.Reconnect()
  27. return s
  28. }
  29. func (s *Screen) Display(id int) {
  30. SwitchProgram(id)
  31. }
  32. // Correct 校正时间
  33. func (s *Screen) Correct() {
  34. }
  35. // Reconnect 重连
  36. func (s *Screen) Reconnect() {
  37. }