|
@@ -379,7 +379,7 @@ func PrepareTimeWindowProducerQueue() {
|
|
|
}
|
|
|
|
|
|
// 12
|
|
|
- if topic == masterConfig.TopicOfCicvLocation && len(masterConfig.RuleOfCicvLocation) > 0 {
|
|
|
+ if topic == masterConfig.TopicOfCicvLocation && (len(masterConfig.RuleOfCicvLocation1) > 0 || len(masterConfig.RuleOfCicvLocation2) > 0) {
|
|
|
subscribers[i], err = goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
|
Node: commonConfig.RosNode,
|
|
|
Topic: topic,
|
|
@@ -402,12 +402,24 @@ func PrepareTimeWindowProducerQueue() {
|
|
|
subscribersMutexes[i].Lock()
|
|
|
faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
lastTimeWindow := commonEntity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
- var faultLabel string
|
|
|
- for _, f := range masterConfig.RuleOfCicvLocation {
|
|
|
- faultLabel = f(data, pjisuvParam)
|
|
|
- if faultLabel != "" {
|
|
|
- saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
|
- break
|
|
|
+ faultLabel := ""
|
|
|
+ if len(masterConfig.RuleOfCicvLocation1) > 0 {
|
|
|
+ for _, f := range masterConfig.RuleOfCicvLocation1 {
|
|
|
+ faultLabel = f(data)
|
|
|
+ if faultLabel != "" {
|
|
|
+ saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if faultLabel == "" && len(masterConfig.RuleOfCicvLocation2) > 0 {
|
|
|
+ for _, f := range masterConfig.RuleOfCicvLocation2 {
|
|
|
+ faultLabel = f(data, pjisuvParam)
|
|
|
+ if faultLabel != "" {
|
|
|
+ saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
subscribersMutexes[i].Unlock()
|