Documentation ¶
Index ¶
- Constants
- func AlarmRedisKey(sourceType int, sourceId string) string
- func AlarmRedisKey_Agg(structId int, factorId int) string
- type AggData
- type AggThreshold
- type AggThresholdItem
- type AggThresholdItems
- type Alarm
- type AlarmCode
- type AlarmMsg
- type AnalyzeData
- type Annotations
- type CacheWinSave
- type CacheWindow
- func (c *CacheWindow) CheckExpiration() bool
- func (c *CacheWindow) DeQueue() any
- func (c *CacheWindow) DeQueueAll() []any
- func (c *CacheWindow) DeQueueAllAnalyzeData() []AnalyzeData
- func (c *CacheWindow) DeQueueAllData() ([]float64, bool)
- func (c *CacheWindow) DeQueueAllRaw() ([]float64, bool)
- func (c *CacheWindow) EnQueue(d any)
- func (c *CacheWindow) EnQueueAnalyzeData(d AnalyzeData)
- func (c *CacheWindow) Latest() any
- func (c *CacheWindow) LatestByAnalyzeData() (AnalyzeData, bool)
- func (c *CacheWindow) LatestByRange(size int) []any
- func (c *CacheWindow) Len() int
- func (c *CacheWindow) MarshalBinary() (data []byte, err error)
- func (c *CacheWindow) ReInitialRing()
- func (c *CacheWindow) Size() int
- func (c *CacheWindow) ToSaveCache() CacheWinSave
- func (c *CacheWindow) UnmarshalBinary(data []byte) error
- type CorrItemData
- type Data
- type DataUnit
- type DataUnitArray
- type DeployInstance
- type DeviceData
- type DeviceFactorProto
- type DeviceInfo
- type DeviceMeta
- type DeviceNode
- type DeviceProto
- type DeviceTree
- type Dimension
- type EsGroupTheme
- type EsRaw
- type EsRawResp
- type EsTheme
- type EsThemeResp
- type EsVbRaw
- type Factor
- type Filter
- type FilterItem
- type FilterItems
- type FilterParams
- type Formula
- type FormulaParam
- type GroupItem
- type HitRaw
- type HitTheme
- type IDataTrace
- type IRpcData
- type InternalParams
- type IoFields
- type IotaAlarm
- type IotaData
- type IotaDevice
- type IotaInstance
- type IotaInstances
- type IotaScheme
- type ItemParam
- type Labels
- type NodeArgs
- type ProcessData
- type Proto
- type ProtoItem
- type RpcReply
- type SecureStationDevice
- type Station
- type StationArrayObj
- type StationData
- type StationGroup
- func (g *StationGroup) AllCorrItems() []GroupItem
- func (g *StationGroup) GetItem(stationId int) *GroupItem
- func (g *StationGroup) GetSettlementBaseItem() *GroupItem
- func (g *StationGroup) MarshalBinary() (data []byte, err error)
- func (g *StationGroup) R() string
- func (g *StationGroup) UnmarshalBinary(data []byte) error
- type StationGroupInfo
- type StationInfo
- type Structure
- type ThingStruct
- type Threshold
- type ThresholdAlarmDetail
- type ThresholdItem
- type ThresholdItems
- type ToFrom
- type VibrationData
Constants ¶
const ( Iota_Alarm_Status_Resolved = "resolved" Iota_Alarm_Status_Firing = "firing" Iota_Alarm_OutOfRange = "OutOfRange" Iota_Alarm_LinkStatus = "LinkStatus" Alarm_Mode_Generation = "AlarmGeneration" //自动恢复 Alarm_Mode_AutoElimination = "AlarmAutoElimination" // 告警类型 Alarm_Type_Dtu_LinkStatus = "2001" // DTU下线 Alarm_Type_Device_Status = "3001" Alarm_Type_Timeout = "3003" Alarm_Type_Data_Parse_Error = "3004" Alarm_Type_OutRange = "3005" Alarm_Type_Data_Interupt = "3006" // 超阈值 Alarm_Type_Over_Threshold = "3007" // 变化速率超阈值 Alarm_Type_Over_ChangeRate_Threshold = "3008" Alarm_Type_OutRange_Legacy = "5001" // 告警码 Alarm_Code_OutRange = "30050001" Alarm_Code_OutRange_Iota = "5001" Alarm_Code_OffLine = "20010001" // 告警源类型:DTU Alarm_Source_DTU = 0 // 告警源类型: 设备 Alarm_Source_Device = 1 // 告警源类型: 测点 Alarm_Source_Station = 2 // 发起者: et-recv Alarm_Sponsor_Recv = "et.recv" // 发起者 et-analyze Alarm_Sponsor_Threshold = "et.analyze" Alarm_Sponsor_Operator = "operator" // 智慧应用 Alarm_Sponsor_SmartApp = "smart.app" // Alarm 缓存相关常量 Alarm_Cache_Prefix = "alarm" Alarm_Cache_Prefix_Agg = "AggThreshold" ALARM_SOURCE_DEVICE = 1 ALARM_SOURCE_STATION = 2 )
const ( RawTypeVib = "vib" RawTypeDiag = "diag" )
const ( Filter_CalcMedian = 1 // 取中值 Filter_LimitAmp = 2 // 限幅 Filter_CalcMeanValue = 3 // 滑动平均 Filter_CalcStvMean = 4 // 方差判断平均 Filter_CalcWindow = 5 // 滤波算法 Filter_ExtreAverage = 6 // 去极值移动平均 Filter_WeightAverage = 7 // 加权滑动平均 Filter_MedianMean = 8 // 中值平均 Filter_RangeMean = 9 // 限幅平均 Filter_Interrupt = 10 // 中断 Filter_RandomReplacer = 9999 // 特殊算法: 数据替换 )
const ( // 无公式 FormulaType_None = 0 // 振动 FormulaType_vibCalc = 122 // 爆破(三向)振动 FormulaType_vibThreeCalc = 222 // 振动索力识别公式 FormulaType_cableRecognize = 120 // 噪声 FormulaType_vibNoise = 141 // 动应变 FormulaType_vibStrain = 148 // 渗流计算 FormulaType_seepage = 106 // 应变花 FormulaType_strainRosette = 207 // 输电塔自动调平计算公式 FormulaType_towerBalance = 212 // 雷达物位计干滩计算公式 FormulaType_radarDryBeach = 213 // 单轴倾角仪测量双向角度 FormulaType_comp2 = 214 // 单向位移计测三向位移 FormulaType_comp3 = 215 // 进水量监测 FormulaType_Inflow = 208 // 流量/渗流量 计算 FormulaType_Flow = 110 // 管道轴向应力 FormulaType_AxialStress = 216 // 出水量计算 FormulaType_Outflow = 136 // 三角堰经验公式 FormulaType_TriSeepageEmp = 137 // 空气数据修正公式 FormulaType_AirCorrect = 142 // 插值计算 FormulaType_Interpolation = 144 // radar插值计算 FormulaType_InterpolationRadar = 157 // radar插值计算2 (初值-测值) FormulaType_InterpolationRadar2 = 158 // 差异沉降倾斜率 FormulaType_InclinationSlope = 221 // 减除值,取极值 FormulaType_DefaultMaxMin = 156 // 雷达物位计干滩计算公式 FormulaType_radarDryBeach2 = 224 // 北斗星空支撑轴力公式1 FormulaType_axialSupportForce1 = 261 // 北斗星空支撑轴力公式2 FormulaType_axialSupportForce2 = 262 // 东江大桥应变温补公式 FormulaType_strainCompensationByTemperature = 303 )
Variables ¶
This section is empty.
Functions ¶
func AlarmRedisKey ¶
AlarmRedisKey 格式:alarm:sourceType:sourceId, 如:alarm:2:100
func AlarmRedisKey_Agg ¶
AlarmRedisKey_Agg 格式:AggThreshold:structId:factorId, 如:AggThreshold:1:106
Types ¶
type AggData ¶
type AggData struct { Date time.Time SensorId int StructId int FactorId int AggTypeId int // 聚集类型 : 10分钟/30分钟/3小时/6小时/12小时/时/日/周/月聚集 AggMethodId int // 聚集方法 : 平均值/最大值/最小值 Agg map[string]float64 // 聚集数据 Changed map[string]float64 // 变化量 ThingId string }
func (*AggData) GetDeviceId ¶ added in v0.0.9
GetDeviceId 返回SensorId
func (*AggData) GetThingId ¶ added in v0.0.8
type AggThreshold ¶
type AggThreshold struct {
Items AggThresholdItems
}
AggThreshold 阈值模型
func (*AggThreshold) FindThresholdInRange ¶
func (t *AggThreshold) FindThresholdInRange(items []AggThresholdItem, m float64) *AggThresholdItem
FindThresholdInRange 阈值判断
func (*AggThreshold) GetThresholdsByItem ¶
func (t *AggThreshold) GetThresholdsByItem(items []AggThresholdItem, itemID int) []AggThresholdItem
GetThresholdsByItem 根据监测项ID获取阈值
func (*AggThreshold) GetThresholdsByTime ¶
func (t *AggThreshold) GetThresholdsByTime(date time.Time) []AggThresholdItem
GetThresholdsByTime 根据时间获取阈值
type AggThresholdItem ¶
type AggThresholdItem struct { Item int `json:"item"` // item -> t_factor_proto_item(id) FieldName string `json:"field_name"` Name string `json:"name"` Level int `json:"level"` Lower float64 `json:"lower"` Upper float64 `json:"upper"` Begin *int `json:"begin"` // 分时阈值起始时间(24小时制 0~24) End *int `json:"end"` // 分时阈值结束时间(24小时制 0~24) AggCategory *int `json:"agg_category,omitempty"` // 在JSON编码时,如果此字段为空,则忽略该字段 FuncType *int `json:"func_type,omitempty"` // 在JSON编码时,如果此字段为空,则忽略该字段 }
AggThresholdItem 阈值项模型
func (*AggThresholdItem) IsTimeSegmented ¶
func (t *AggThresholdItem) IsTimeSegmented() bool
func (*AggThresholdItem) RangeText ¶
func (t *AggThresholdItem) RangeText() string
type AggThresholdItems ¶
type AggThresholdItems []AggThresholdItem
AggThresholdItems 自定义类型,[]AggThresholdItem 的别名
func (*AggThresholdItems) MarshalBinary ¶
func (t *AggThresholdItems) MarshalBinary() (data []byte, err error)
func (*AggThresholdItems) UnmarshalBinary ¶
func (t *AggThresholdItems) UnmarshalBinary(data []byte) error
type Alarm ¶
type Alarm struct { IsAlarm bool Code string AlarmType string Level int Content string Sponsor string }
func NewAlarmOverThreshold ¶
NewAlarmOverThreshold 超阈值告警
func NewAlarmRecoverThreshold ¶
func NewAlarmRecoverThreshold() *Alarm
NewAlarmRecoverThreshold 阈值恢复告警
func NewOverChangingRateThreshold ¶
NewOverChangingRateThreshold 变化速率超阈值告警
func NewRecoverChangingRateThreshold ¶
func NewRecoverChangingRateThreshold() *Alarm
NewRecoverChangingRateThreshold 变化速率阈值恢复告警
func (*Alarm) ToAlarmMsg ¶
func (a *Alarm) ToAlarmMsg(stationInfo StationInfo, acqTime time.Time) AlarmMsg
ToAlarmMsg 将测点信息 -> 告警信息
type AlarmCode ¶
type AlarmCode struct { Id int `json:"id"` Code string `json:"code"` Name string `json:"name"` TypeCode string `json:"typeCode"` Level int `json:"level"` }
func (*AlarmCode) MarshalBinary ¶
redis序列化
type AlarmMsg ¶
type AlarmMsg struct { MessageMode string `json:"messageMode"` StructureId int `json:"structureId"` StructureName string `json:"structureName"` SourceId string `json:"sourceId"` SourceName string `json:"sourceName"` AlarmTypeCode string `json:"alarmTypeCode"` AlarmCode string `json:"alarmCode"` Content string `json:"content"` AcqTime time.Time `json:"time"` SourceTypeId int `json:"sourceTypeId"` // 0:DTU, 1:传感器, 2:测点 Sponsor string `json:"sponsor"` // 消息的发起者 "et.recv" Extras map[string]any `json:"extras"` SubDevices []string `json:"subDevices"` }
type AnalyzeData ¶
type Annotations ¶
type CacheWinSave ¶
type CacheWinSave struct { *CacheWindow AllData []AnalyzeData `json:"allData"` }
type CacheWindow ¶
type CacheWindow struct { Id string WindowSize int //窗体大小 MethodId int //滑窗方法 CreatReason string //创建原因 LatestData any Params FilterParams //过期控制 Expire expirationInfo // contains filtered or unexported fields }
CacheWindow 存储大量测点缓存数据
func NewCacheWindow ¶
func NewCacheWindow(id string, size, methodId int, params FilterParams, creatReason string) CacheWindow
func (*CacheWindow) CheckExpiration ¶
func (c *CacheWindow) CheckExpiration() bool
func (*CacheWindow) DeQueue ¶
func (c *CacheWindow) DeQueue() any
func (*CacheWindow) DeQueueAll ¶
func (c *CacheWindow) DeQueueAll() []any
func (*CacheWindow) DeQueueAllAnalyzeData ¶
func (c *CacheWindow) DeQueueAllAnalyzeData() []AnalyzeData
func (*CacheWindow) DeQueueAllData ¶
func (c *CacheWindow) DeQueueAllData() ([]float64, bool)
func (*CacheWindow) DeQueueAllRaw ¶
func (c *CacheWindow) DeQueueAllRaw() ([]float64, bool)
func (*CacheWindow) EnQueue ¶
func (c *CacheWindow) EnQueue(d any)
func (*CacheWindow) EnQueueAnalyzeData ¶
func (c *CacheWindow) EnQueueAnalyzeData(d AnalyzeData)
func (*CacheWindow) Latest ¶
func (c *CacheWindow) Latest() any
func (*CacheWindow) LatestByAnalyzeData ¶
func (c *CacheWindow) LatestByAnalyzeData() (AnalyzeData, bool)
func (*CacheWindow) LatestByRange ¶
func (c *CacheWindow) LatestByRange(size int) []any
func (*CacheWindow) MarshalBinary ¶
func (c *CacheWindow) MarshalBinary() (data []byte, err error)
redis序列化
func (*CacheWindow) ReInitialRing ¶
func (c *CacheWindow) ReInitialRing()
func (*CacheWindow) Size ¶
func (c *CacheWindow) Size() int
func (*CacheWindow) ToSaveCache ¶
func (c *CacheWindow) ToSaveCache() CacheWinSave
func (*CacheWindow) UnmarshalBinary ¶
func (c *CacheWindow) UnmarshalBinary(data []byte) error
redis序列化
type CorrItemData ¶ added in v0.0.8
type CorrItemData struct { StationId int `json:"station_id"` StationName string `json:"station_name"` IsBase *bool `json:"is_base,omitempty"` PhyData map[string]interface{} `json:"phy_data"` ThemeData map[string]interface{} `json:"theme_data"` }
级联测点数据
type Data ¶
type DataUnitArray ¶
type DataUnitArray []DataUnit
func (*DataUnitArray) MarshalBinary ¶
func (m *DataUnitArray) MarshalBinary() (data []byte, err error)
redis序列化
func (*DataUnitArray) UnmarshalBinary ¶
func (m *DataUnitArray) UnmarshalBinary(data []byte) error
redis序列化
type DeployInstance ¶
type DeviceData ¶
type DeviceData struct { DeviceId string Name string ThingId string StructId int TaskId string AcqTime time.Time RealTime time.Time ErrCode int Raw map[string]any RawUnit map[string]string DeviceInfo DeviceInfo DimensionId string //数据类型 常见有 comm="" ,RawTypeVib="vib" DataType string }
func (*DeviceData) GetVibrationData ¶
func (d *DeviceData) GetVibrationData() VibrationData
type DeviceFactorProto ¶
type DeviceFactorProto struct { Formula int `json:"formula"` FieldVal map[string]string `json:"field_val"` //MultiFormula interface{} `json:"multi_formula"` //MultiFields interface{} `json:"multi_fields"` //UnitConversion interface{} `json:"unit_conversion"` //纪录 数据输入输出的转换系数 FieldValUnitK map[string]float64 }
func (*DeviceFactorProto) MarshalBinary ¶
func (m *DeviceFactorProto) MarshalBinary() (data []byte, err error)
redis序列化
func (*DeviceFactorProto) UnmarshalBinary ¶
func (m *DeviceFactorProto) UnmarshalBinary(data []byte) error
redis序列化
type DeviceInfo ¶
type DeviceInfo struct { Id string `json:"id"` Name string `json:"name"` Structure Structure `json:"structure"` DeviceMeta DeviceMeta `json:"device_meta"` }
type DeviceMeta ¶
type DeviceMeta struct { Id string `json:"id"` Name string `json:"name"` Model string `json:"model"` Properties []iotaProperty `json:"properties"` Capabilities []iotaCapability `json:"capabilities"` }
func (*DeviceMeta) GetOutputProps ¶
func (m *DeviceMeta) GetOutputProps() (out map[string]string)
func (*DeviceMeta) GetOutputUnit ¶
func (m *DeviceMeta) GetOutputUnit() (out map[string]string)
func (*DeviceMeta) MarshalBinary ¶
func (m *DeviceMeta) MarshalBinary() (data []byte, err error)
redis序列化
func (*DeviceMeta) UnmarshalBinary ¶
func (m *DeviceMeta) UnmarshalBinary(data []byte) error
redis序列化
type DeviceNode ¶
type DeviceNode struct { Id string Name string Depth int Child []DeviceNode // contains filtered or unexported fields }
func (*DeviceNode) SearchSub ¶
func (the *DeviceNode) SearchSub(deviceId string) (subList []string)
func (*DeviceNode) SearchSubAll ¶
func (the *DeviceNode) SearchSubAll(deviceId string) (subList []string)
type DeviceProto ¶
type DeviceTree ¶
type DeviceTree struct {
Node DeviceNode
}
type EsGroupTheme ¶
type EsGroupTheme struct { StructId int `json:"struct_id"` GroupId int `json:"group_id"` GroupName string `json:"group_name"` GroupType string `json:"group_type"` TaskId string `json:"task_id"` CorrItems []StationGroupInfo `json:"corr_items"` Data []CorrItemData `json:"data"` CollectTime time.Time `json:"collect_time"` CreateTime time.Time `json:"create_time"` }
EsGroupTheme 分组主题数据结构体
func (EsGroupTheme) MarshalJSON ¶ added in v0.0.11
func (the EsGroupTheme) MarshalJSON() ([]byte, error)
type EsRawResp ¶
type EsRawResp struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total int `json:"total"` Successful int `json:"successful"` Skipped int `json:"skipped"` Failed int `json:"failed"` } `json:"_shards"` Hits struct { Total int `json:"total"` MaxScore float64 `json:"max_score"` Hits []HitRaw `json:"hits"` } `json:"hits"` }
type EsTheme ¶
type EsTheme struct { SensorName string `json:"sensor_name"` FactorName string `json:"factor_name"` FactorProtoCode string `json:"factor_proto_code"` Data map[string]any `json:"data"` FactorProtoName string `json:"factor_proto_name"` Factor int `json:"factor"` CollectTime time.Time `json:"collect_time"` Sensor int `json:"sensor"` Structure int `json:"structure"` IotaDevice []string `json:"iota_device"` CreateTime time.Time `json:"create_time"` }
func (EsTheme) MarshalJSON ¶ added in v0.0.11
type EsThemeResp ¶
type EsThemeResp struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total int `json:"total"` Successful int `json:"successful"` Skipped int `json:"skipped"` Failed int `json:"failed"` } `json:"_shards"` Hits struct { Total int `json:"total"` MaxScore float64 `json:"max_score"` Hits []HitTheme `json:"hits"` } `json:"hits"` }
type EsVbRaw ¶
type EsVbRaw struct { StructId int `json:"structId"` IotaDeviceName string `json:"iota_device_name"` Param map[string]any `json:"param"` Data map[string]any `json:"data"` CollectTime time.Time `json:"collect_time"` IotaDevice string `json:"iota_device"` CreateTime time.Time `json:"create_time"` // contains filtered or unexported fields }
func (*EsVbRaw) FlatMapDynamicVib ¶
FlatMapDynamicVib 振动数据打散
type Factor ¶
type Factor struct { Id int `json:"id"` Name string `json:"name"` ProtoCode string `json:"protoCode"` ProtoName string `json:"protoName"` Items []ProtoItem `json:"items"` Units map[string]string `json:"units"` }
func (*Factor) GetProtoItem ¶
type Filter ¶
type Filter struct {
Items FilterItems
}
type FilterItem ¶
type FilterItem struct { Item int `json:"item"` FieldName string `json:"field_name"` Name string `json:"name"` MethodId int `json:"method"` Params FilterParams `json:"Params"` WindowSize int `json:"window_size"` Iswork string `json:"iswork"` //没用,默认都是false,只要存在都是启用的 RInit float64 `json:"RInit"` InternalParams InternalParams `json:"internal_params"` R float64 `json:"R"` InvalidCount int `json:"InvalidCount"` }
type FilterItems ¶
type FilterItems []FilterItem
func (*FilterItems) MarshalBinary ¶
func (t *FilterItems) MarshalBinary() (data []byte, err error)
func (*FilterItems) UnmarshalBinary ¶
func (t *FilterItems) UnmarshalBinary(data []byte) error
type FilterParams ¶
type Formula ¶
type Formula struct { Id int `json:"id"` Expression string `json:"expression"` Params []FormulaParam `json:"params"` IoFields IoFields `json:"ioFields"` Type string `json:"type"` }
type FormulaParam ¶
type GroupItem ¶
type IDataTrace ¶ added in v0.0.8
type InternalParams ¶
type IotaAlarm ¶
type IotaData ¶
type IotaData struct { UserId string `json:"userId"` ThingId string `json:"thingId"` DimensionId string `json:"dimensionId"` DimCapId string `json:"dimCapId"` CapId string `json:"capId"` DeviceId string `json:"deviceId"` ScheduleId string `json:"scheduleId"` TaskId string `json:"taskId"` JobId int `json:"jobId"` JobRepeatId int `json:"jobRepeatId"` TriggerTime time.Time `json:"triggerTime"` RealTime time.Time `json:"realTime"` FinishTime time.Time `json:"finishTime"` Seq int `json:"seq"` Released bool `json:"released"` Data Data `json:"data"` }
func (*IotaData) GetDeviceId ¶ added in v0.0.9
func (*IotaData) GetThingId ¶ added in v0.0.8
func (*IotaData) ReadTaskId ¶
ReadTaskId 支持内部字段定义任务ID (_acq_number)
type IotaDevice ¶
type IotaDevice struct { Id string `json:"id"` Name string `json:"name"` Properties string `json:"properties"` DeviceMetaId string `json:"deviceMetaId"` ThingId string `json:"thingId"` DeviceMeta DeviceMeta `json:"deviceMeta"` }
func (*IotaDevice) MarshalBinary ¶
func (m *IotaDevice) MarshalBinary() (data []byte, err error)
redis序列化
func (*IotaDevice) UnmarshalBinary ¶
func (m *IotaDevice) UnmarshalBinary(data []byte) error
redis序列化
type IotaInstance ¶
type IotaInstance struct { Instance DeployInstance `json:"instance"` Type string `json:"type"` //s.l or s.d or s.iota }
type IotaInstances ¶
type IotaInstances struct {
Instances map[string]IotaInstance `json:"instances"`
}
func (*IotaInstances) MarshalBinary ¶
func (m *IotaInstances) MarshalBinary() (data []byte, err error)
redis序列化
func (*IotaInstances) UnmarshalBinary ¶
func (m *IotaInstances) UnmarshalBinary(data []byte) error
redis序列化
type IotaScheme ¶
type IotaScheme struct { Id string `json:"id"` Name string `json:"name"` Mode string `json:"mode"` Interval int `json:"interval"` Unit string `json:"unit"` BeginTime *time.Time `json:"beginTime"` EndTime *time.Time `json:"endTime,omitempty"` Dimension Dimension `json:"dimension"` }
func (*IotaScheme) MarshalBinary ¶
func (s *IotaScheme) MarshalBinary() (data []byte, err error)
redis序列化
func (*IotaScheme) SimpleEquals ¶
func (s *IotaScheme) SimpleEquals(other *IotaScheme) bool
SimpleEquals 调度模式一致(模式 & 间隔 & 时间单位)
func (*IotaScheme) SimpleEqualsInt ¶
func (s *IotaScheme) SimpleEqualsInt(iv int) bool
SimpleEqualsInt 周期调度的分钟数相等(周期 & 间隔 & 分钟)
func (*IotaScheme) UnmarshalBinary ¶
func (s *IotaScheme) UnmarshalBinary(data []byte) error
redis序列化
type ProcessData ¶
type ProcessData struct { //设备信息 DeviceData DeviceData //测点信息 Stations []Station //设备可对应多个测点 }
type Proto ¶
type Proto struct { Code string `json:"code"` Name string `json:"name"` Items []ProtoItem `json:"items"` }
func (*Proto) GetProtoItem ¶
type SecureStationDevice ¶
type SecureStationDevice struct { FormulaId int `json:"formula_id"` //单设备测点 公式id redis里面原本没有 20240326后加 Params map[string]any `json:"params"` IotaDeviceId string `json:"iota_device_id"` IotaDeviceSerial int `json:"iota_device_serial"` FormulaInfo Formula DeviceFactorProto DeviceFactorProto }
func (*SecureStationDevice) LogMsg ¶
func (s *SecureStationDevice) LogMsg() string
type Station ¶
type Station struct { // 测点基本信息:名称、监测因素、监测原型、结构物、IOT-Things信息等 Info StationInfo // 测点数据包括:设备数据 + 主题数据 Data StationData // 测点阈值 Threshold *Threshold }
Station 测点模型 = 基本信息 + 数据 + 阈值
func (*Station) GetProtoFields ¶
GetProtoFields 获取监测原型的监测项
func (*Station) MarshalBinary ¶
redis序列化
type StationArrayObj ¶
type StationArrayObj []Station
func (*StationArrayObj) MarshalBinary ¶
func (m *StationArrayObj) MarshalBinary() (data []byte, err error)
redis序列化
func (*StationArrayObj) UnmarshalBinary ¶
func (m *StationArrayObj) UnmarshalBinary(data []byte) error
redis序列化
type StationData ¶
type StationData struct { //测点包含-计算后的设备单点数据 DeviceCalcData map[string]any //测点最终数据(主题数据) ThemeData map[string]any PhyData map[string]any CollectTime time.Time AlarmLevel int }
func (*StationData) GetThemeFields ¶
func (s *StationData) GetThemeFields() []string
GetThemeFields 获取主题数据的监测项
func (*StationData) GetValidThemeData ¶
func (s *StationData) GetValidThemeData() (map[string]float64, bool)
GetValidThemeData 获取有效的主题数据(数据规整为:非空float64)
type StationGroup ¶
type StationGroup struct { Id int `json:"id"` Name string `json:"name"` GroupType string `json:"group_type"` Items []GroupItem `json:"items"` Params map[string]interface{} }
func (*StationGroup) AllCorrItems ¶
func (g *StationGroup) AllCorrItems() []GroupItem
AllCorrItems 分组的关联项 = Items + 该分组的级联 ref_base、ref_point(可能有多层)
func (*StationGroup) GetItem ¶ added in v0.0.8
func (g *StationGroup) GetItem(stationId int) *GroupItem
func (*StationGroup) GetSettlementBaseItem ¶
func (g *StationGroup) GetSettlementBaseItem() *GroupItem
GetSettlementBaseItem 获取沉降分组的基点
func (*StationGroup) MarshalBinary ¶
func (g *StationGroup) MarshalBinary() (data []byte, err error)
redis序列化
func (*StationGroup) R ¶
func (g *StationGroup) R() string
func (*StationGroup) UnmarshalBinary ¶
func (g *StationGroup) UnmarshalBinary(data []byte) error
redis序列化
type StationGroupInfo ¶
type StationGroupInfo struct { StationId int `json:"station"` GroupId int `json:"group"` Params map[string]interface{} `json:"params"` Name string `json:"name"` GroupType string `json:"group_type"` }
StationGroupInfo 测点的分组信息(对应 ET3.0 的 secure_station_group )
func (*StationGroupInfo) MarshalBinary ¶
func (g *StationGroupInfo) MarshalBinary() (data []byte, err error)
redis序列化
func (*StationGroupInfo) UnmarshalBinary ¶
func (g *StationGroupInfo) UnmarshalBinary(data []byte) error
redis序列化
type StationInfo ¶
type StationInfo struct { Id int `json:"id"` Name string `json:"name"` StructureId int `json:"structure"` ThingId string `json:"thingId"` StructureName string `json:"struct_name"` FactorId int `json:"factor"` IsManualData bool `json:"manual_data"` FormulaId int `json:"formula"` ParamsValue map[string]any `json:"params_value"` Factor Factor ProtoCode string `json:"proto"` Proto Proto Devices []SecureStationDevice Labels string CombineInfo string Group StationGroup `json:"group,omitempty"` CorrGroups []StationGroup `json:"corr_group_ids,omitempty"` // 关联的分组ID }
func (*StationInfo) GetDeviceIdArray ¶
func (the *StationInfo) GetDeviceIdArray() []string
func (*StationInfo) MarshalBinary ¶
func (m *StationInfo) MarshalBinary() (data []byte, err error)
redis序列化
func (*StationInfo) UnmarshalBinary ¶
func (m *StationInfo) UnmarshalBinary(data []byte) error
redis序列化
type ThingStruct ¶
type ThingStruct struct { ThingId string `json:"thingId"` Id int `json:"id"` Name string `json:"name"` Type string `json:"type"` OrgId int `json:"orgId"` }
func (*ThingStruct) MarshalBinary ¶
func (m *ThingStruct) MarshalBinary() (data []byte, err error)
redis序列化
func (*ThingStruct) UnmarshalBinary ¶
func (m *ThingStruct) UnmarshalBinary(data []byte) error
redis序列化
type Threshold ¶
type Threshold struct {
Items ThresholdItems
}
Threshold 阈值模型
func (*Threshold) FindThresholdInRange ¶
func (t *Threshold) FindThresholdInRange(items []ThresholdItem, m float64) *ThresholdItem
FindThresholdInRange 阈值判断
func (*Threshold) GetThresholdsByItem ¶
func (t *Threshold) GetThresholdsByItem(items []ThresholdItem, itemID int) []ThresholdItem
GetThresholdsByItem 根据监测项ID获取阈值
func (*Threshold) GetThresholdsByTime ¶
func (t *Threshold) GetThresholdsByTime(date time.Time) []ThresholdItem
GetThresholdsByTime 根据时间获取阈值
type ThresholdAlarmDetail ¶
func (ThresholdAlarmDetail) ToString ¶
func (t ThresholdAlarmDetail) ToString() string
type ThresholdItem ¶
type ThresholdItem struct { Item int `json:"item"` // item -> t_factor_proto_item(id) FieldName string `json:"field_name"` Name string `json:"name"` Level int `json:"level"` Lower float64 `json:"lower"` Upper float64 `json:"upper"` Begin *int `json:"begin"` // 分时阈值起始时间(24小时制 0~24) End *int `json:"end"` // 分时阈值结束时间(24小时制 0~24) AggCategory *int `json:"agg_category,omitempty"` // 在JSON编码时,如果此字段为空,则忽略该字段 }
ThresholdItem 阈值项模型
func (*ThresholdItem) IsTimeSegmented ¶
func (t *ThresholdItem) IsTimeSegmented() bool
func (*ThresholdItem) RangeText ¶
func (t *ThresholdItem) RangeText() string
type ThresholdItems ¶
type ThresholdItems []ThresholdItem
ThresholdItems 自定义类型,[]ThresholdItem的别名
func (*ThresholdItems) MarshalBinary ¶
func (t *ThresholdItems) MarshalBinary() (data []byte, err error)
func (*ThresholdItems) UnmarshalBinary ¶
func (t *ThresholdItems) UnmarshalBinary(data []byte) error
type VibrationData ¶
type VibrationData struct { Version byte SampleFreq float64 FilterFreq float64 GainAmplifier byte TriggerType byte Data []float64 // 原始波形数据 Unit string }
VibrationData 振动数据
func (*VibrationData) FormatParams ¶
func (v *VibrationData) FormatParams() map[string]any
Source Files ¶
- IotaData.go
- aggData.go
- alarm.go
- alarmMsg.go
- cacheData.go
- constant.go
- dataTrace.go
- dataUnit.go
- deviceData.go
- deviceFactorProto.go
- deviceInfo.go
- deviceMeta.go
- esGroupTheme.go
- esRaw.go
- esTheme.go
- esVbRaw.go
- factor.go
- filter.go
- formula.go
- formulaType.go
- iotaAlarm.go
- iotaDeploy.go
- iotaDevice.go
- iotaScheme.go
- processData.go
- rpc_node.go
- staionGroup.go
- station.go
- structure.go
- threshold.go
- threshold_agg.go