|
@@ -28,8 +28,13 @@ func StartIntersectionServer() {
|
|
|
Sub: time.NewTicker(5 * time.Second), //支路状态回滚
|
|
|
ReTicker: time.NewTicker(30 * time.Second), //重连
|
|
|
}
|
|
|
- is.RadioEventServer = StartRadioEventServer()
|
|
|
- is.CameraEventServer = StartCameraEventServer()
|
|
|
+ if util.Config.Server.SupportCamera {
|
|
|
+ is.CameraEventServer = StartCameraEventServer()
|
|
|
+
|
|
|
+ }
|
|
|
+ if util.Config.Server.SupportRadio {
|
|
|
+ is.RadioEventServer = StartRadioEventServer()
|
|
|
+ }
|
|
|
//等事件服务先启动
|
|
|
time.Sleep(1 * time.Second)
|
|
|
is.Serve()
|
|
@@ -74,7 +79,12 @@ func (is *IntersectionServer) Serve() {
|
|
|
//先创建响应设备
|
|
|
for _, c := range util.Config.Screens {
|
|
|
iDevice := &IntersectionDevice{
|
|
|
- Info: c,
|
|
|
+ Info: OutputDeviceInfo{
|
|
|
+ Name: c.Name,
|
|
|
+ Ip: c.Ip,
|
|
|
+ Port: c.Port,
|
|
|
+ Branch: c.Branch,
|
|
|
+ },
|
|
|
Screen: NewScreen(c.Name, c.Ip, c.Port),
|
|
|
}
|
|
|
if c.Branch == 1 {
|
|
@@ -85,7 +95,11 @@ func (is *IntersectionServer) Serve() {
|
|
|
}
|
|
|
for _, c := range util.Config.Speakers {
|
|
|
iDevice := &IntersectionDevice{
|
|
|
- Info: c,
|
|
|
+ Info: OutputDeviceInfo{
|
|
|
+ Name: c.Name,
|
|
|
+ Ip: c.Ip,
|
|
|
+ Branch: c.Branch,
|
|
|
+ },
|
|
|
Speaker: NewIpCast(c.Name, c.Ip),
|
|
|
}
|
|
|
if c.Branch == 1 {
|