From 3bec4e518d8d5b5bcd5ddf4f3e6c4b3afdd87f84 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 23 Jan 2025 14:20:40 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=94=AF=E6=8C=81=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E7=89=A9[5222]=E9=9A=A7=E9=81=93=E6=B2=B3=E5=8C=97=E6=89=BF?= =?UTF-8?q?=E5=BE=B7=E5=B9=BF=E4=BB=81=E5=B2=AD=E9=9A=A7=E9=81=93(?= =?UTF-8?q?=E4=B8=8A=E8=A1=8C)=20=20=E7=9A=84=E5=8A=A0=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E4=B8=89=E9=A1=B9=E7=9B=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...云es主题特征to河北公路设施监测.go | 9 ++++++++- consumers/consumerHBJCAS.go | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/adaptors/安心云es主题特征to河北公路设施监测.go b/adaptors/安心云es主题特征to河北公路设施监测.go index ec2bdff..a84555a 100644 --- a/adaptors/安心云es主题特征to河北公路设施监测.go +++ b/adaptors/安心云es主题特征to河北公路设施监测.go @@ -89,7 +89,7 @@ func (the Adaptor_AXYES_HBGL) EsAggTopToHBJCAS(structId int64, factorId int, esA return result } func (the Adaptor_AXYES_HBGL) getMonitorTypeByFactorId(factorId int) protoFiles_hb.MonitoryType { - //桥墩倾斜 15 裂缝18 支座位移20 桥面振动28 + //桥墩倾斜 15 裂缝18 支座位移20 桥面振动28 加速度三项监测592 switch factorId { case 15: return protoFiles_hb.MonitoryType_INC @@ -99,6 +99,8 @@ func (the Adaptor_AXYES_HBGL) getMonitorTypeByFactorId(factorId int) protoFiles_ return protoFiles_hb.MonitoryType_DIS case 28: return protoFiles_hb.MonitoryType_VIB + case 592: + return protoFiles_hb.MonitoryType_VIB default: log.Printf("factorId=%d,无匹配的MonitorType", factorId) return protoFiles_hb.MonitoryType_CMM @@ -154,6 +156,11 @@ func (the Adaptor_AXYES_HBGL) EsAgg2StatisticData(factorId int, monitorCode int6 MaxAbsoluteValue: float32(maxAbsoluteValueX), RootMeanSquare: float32(rootMeanSquareY), }} + case 592: //加速度三项监测 + dataDefinitionStatisticData.StatisticData.DataBody = &protoFiles_hb.StatisticData_Vib{Vib: &protoFiles_hb.VIBStatistic{ + MaxAbsoluteValue: float32(maxAbsoluteValueX), + RootMeanSquare: float32(rootMeanSquareX), + }} } return dataDefinitionStatisticData diff --git a/consumers/consumerHBJCAS.go b/consumers/consumerHBJCAS.go index ea11137..4a6a1e5 100644 --- a/consumers/consumerHBJCAS.go +++ b/consumers/consumerHBJCAS.go @@ -161,7 +161,7 @@ func (the *consumerHBJCAS) getEs10minAggData() { //utils.GetTimeRangeBy10min() 由于振动数据实时性问题 改用一小时统一上报 start, end := utils.GetTimeRangeByHour(-1) log.Printf("查询10min数据时间范围 %s - %s", start, end) - factorIds := []int{28} + factorIds := []int{28, 592} //监测因素 592 -> 结构物[5222]隧道河北承德广仁岭隧道(上行) 的加速度三项监测 structIds := the.getStructIds() for _, structId := range structIds { for _, factorId := range factorIds { @@ -316,7 +316,7 @@ func (the *consumerHBJCAS) getESQueryStrBy10min(structureId int64, factorId int, } func getEsAggSubSqlByFactorId(factorId int) string { - //桥墩倾斜 15 裂缝 18 支座位移20 桥面振动28 + //桥墩倾斜 15 裂缝 18 支座位移20 桥面振动28 加速度三项监测592(承德隧道专用) subAggSQl := "" switch factorId { case 15: @@ -364,6 +364,15 @@ func getEsAggSubSqlByFactorId(factorId int) string { "field": "data.trms" } } +}` + case 592: + subAggSQl = ` +{ + "x": { + "extended_stats": { + "field": "data.z_acc_speed" + } + } }` } return subAggSQl