diff --git a/config/local_cgy.yml b/config/local_cgy.yml index cc8eb9b..0929f8b 100644 --- a/config/local_cgy.yml +++ b/config/local_cgy.yml @@ -6,7 +6,7 @@ server: # 数据源 datasource: # 数据库访问url - dsn: root:localdb@tcp(192.168.53.11:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC + dsn: root:localdb@tcp(192.168.1.211:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC # 日志配置 logging: @@ -27,7 +27,7 @@ logging: # 是否压缩日志 compress: false # 控制台是否输出 - stdout: false + stdout: true # 消息配置 messaging: diff --git a/third_party/interlock/beijing12/interlock.go b/third_party/interlock/beijing12/interlock.go index 70694f0..b673574 100644 --- a/third_party/interlock/beijing12/interlock.go +++ b/third_party/interlock/beijing12/interlock.go @@ -33,13 +33,26 @@ type InterlockProxy interface { var interlockMap = make(map[string]InterlockProxy) var initMutex sync.Mutex -func Default(c *config.InterlockConfig) InterlockProxy { - initMutex.Lock() - defer initMutex.Unlock() - if interlockMap[c.Code] == nil { - interlockMap[c.Code] = &interlockProxy{runConfig: c} +//func Default(c *config.InterlockConfig) InterlockProxy { +// initMutex.Lock() +// defer initMutex.Unlock() +// if interlockMap[c.Code] == nil { +// interlockMap[c.Code] = &interlockProxy{runConfig: c} +// } +// return interlockMap[c.Code] +//} + +func Start(c *config.InterlockConfig, manager InterlockMessageManager) { + proxy := &interlockProxy{runConfig: c} + proxy.Start(manager) + interlockMap[c.Code] = proxy +} + +func Stop(c *config.InterlockConfig) { + proxy := interlockMap[c.Code] + if proxy != nil { + proxy.Stop() } - return interlockMap[c.Code] } type interlockProxy struct { diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index e1161a0..ec05733 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -756,6 +756,10 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_pro for _, xcj := range repo.Xcjs { xcjMap[xcj.Id] = xcj } + sectionMap := make(map[string]*proto.PhysicalSection) + for _, section := range repo.PhysicalSections { + sectionMap[section.Id] = section + } ciecs := stationMap[stationUid] //联锁集中站 if ciecs == nil { panic(fmt.Errorf("联锁集中站[%s]不存在", stationUid)) @@ -907,6 +911,27 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_pro }) } } + case data_proto.RelatedRef_Section: + { + section, ok := sectionMap[GenerateElementUid(city, lineId, []string{station}, relationship.Code)] + if !ok { + continue + } + for _, group := range relationship.Combinationtypes { + var componentIds []string + for _, relayId := range group.RefRelays { + if relayUidStructure.RelayIds[relayId] == nil { + continue + } + componentIds = append(componentIds, relayUidStructure.RelayIds[relayId].Uid) + } + section.ElectronicComponentGroups = append(section.ElectronicComponentGroups, + &proto.ElectronicComponentGroup{ + Code: group.Code, + ComponentIds: componentIds, + }) + } + } } } //门控箱 diff --git a/ts/test_simulation_manage.go b/ts/test_simulation_manage.go index cd2d704..dbec7c9 100644 --- a/ts/test_simulation_manage.go +++ b/ts/test_simulation_manage.go @@ -126,7 +126,7 @@ func runThirdParty(s *memory.VerifySimulation) error { case "11": beijing11.Start(c, s) default: - beijing12.Default(c).Start(s) + beijing12.Start(c, s) } } // 计轴RSSP启动 @@ -162,7 +162,7 @@ func stopThirdParty(s *memory.VerifySimulation) { case "11": beijing11.Stop() default: - beijing12.Default(c).Stop() + beijing12.Stop(c) } } //计轴RSSP启动销毁