Documentation ¶
Index ¶
- type Attribute
- type AttributeModel
- type CameraTimeLapseVideo
- type Device
- func (m *Device) GetByID(id uint) error
- func (m *Device) SaveAttributesFromAttributeModels(attributeModels []*AttributeModel) (err error)
- func (m *Device) SaveTelemetriesFromTelemetryModels(telemetryModels []*TelemetryModel) (err error)
- func (m *Device) SelectDeviceType(deviceType int64)
- func (m *Device) TableName() string
- func (m *Device) ToDevicePBs(data []*Device) []*pb.Device
- type DeviceDashboard
- type DeviceDashboardCamera
- type DeviceDashboardTelemetry
- type DeviceModel
- type Telemetry
- type TelemetryModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { base.DefaultModel DeviceID uint `gorm:"uniqueIndex:attribute_uix"` AttributeModelID uint `gorm:"uniqueIndex:attribute_uix"` AttributeModel AttributeModel Value string `gorm:"size:50;NOT NULL;"` }
Attribute 属性
type AttributeModel ¶
type AttributeModel struct { base.DefaultModel DeviceModelID uint `gorm:"uniqueIndex:attribute_model_uix"` Key string `gorm:"uniqueIndex:attribute_model_uix;size:50"` Name string `gorm:"size:50"` }
AttributeModel 属性模型
func NewAttributeModelFromPB ¶
func NewAttributeModelFromPB(in *pb.CreateAttributeModelRequest) *AttributeModel
NewAttributeModelFromPB ..
type CameraTimeLapseVideo ¶
type CameraTimeLapseVideo struct { base.DefaultModel DeviceID uint Date string `gorm:"size:20"` VideoURL string `gorm:"size:100"` }
CameraTimeLapseVideo 摄像头延时视频,定时每1分钟抓拍图片,第二天1点合成视频
func NewCameraTimeLapseVideo ¶
func NewCameraTimeLapseVideo() *CameraTimeLapseVideo
NewCameraTimeLapseVideo ..
func (*CameraTimeLapseVideo) ToCameraTimeLapseVideoPBs ¶
func (m *CameraTimeLapseVideo) ToCameraTimeLapseVideoPBs(data []*CameraTimeLapseVideo, scheme string) []*pb.CameraTimeLapseVideo
ToCameraTimeLapseVideoPBs ..
type Device ¶
type Device struct { base.DefaultModel DeviceModelID uint DeviceModel DeviceModel Name string `gorm:"size:50;NOT NULL;"` IP string `gorm:"size:50;NOT NULL;"` AccessKey string `gorm:"size:12;NOT NULL;"` //设备key hashid(id,16) SecretKey string `gorm:"size:32;NOT NULL;"` //设备访问密钥,randString() Port uint16 Username string `gorm:"size:32;"` Password string `gorm:"size:32;"` Attributes []*Attribute //属性,由采集程序启动时注册 Telemetries []*Telemetry //遥测,由采集程序按一定频率上传 }
Device 设备
func (*Device) SaveAttributesFromAttributeModels ¶
func (m *Device) SaveAttributesFromAttributeModels( attributeModels []*AttributeModel) (err error)
SaveAttributesFromAttributeModels ..
func (*Device) SaveTelemetriesFromTelemetryModels ¶
func (m *Device) SaveTelemetriesFromTelemetryModels( telemetryModels []*TelemetryModel) (err error)
SaveTelemetriesFromTelemetryModels ..
func (*Device) SelectDeviceType ¶
SelectDeviceType ..
type DeviceDashboard ¶
type DeviceDashboard struct { base.DefaultModel Name string `gorm:"size:50"` IsVisible bool DeviceType uint8 //设备类型,0:默认设备,1:摄像头 Telemetries []*DeviceDashboardTelemetry Cameras []*DeviceDashboardCamera }
DeviceDashboard 设备仪表盘
func NewDeviceDashboardFromPB ¶
func NewDeviceDashboardFromPB(in *pb.CreateDeviceDashboardRequest) *DeviceDashboard
NewDeviceDashboardFromPB ..
func (*DeviceDashboard) ToDeviceDashboardPBs ¶
func (m *DeviceDashboard) ToDeviceDashboardPBs(data []*DeviceDashboard) []*pb.DeviceDashboard
ToDeviceDashboardPBs ..
type DeviceDashboardCamera ¶
type DeviceDashboardCamera struct { base.DefaultModel DeviceDashboardID uint DeviceID uint Device Device }
DeviceDashboardCamera 仪表盘摄像头
func NewDeviceDashboardCamera ¶
func NewDeviceDashboardCamera() *DeviceDashboardCamera
NewDeviceDashboardCamera ..
type DeviceDashboardTelemetry ¶
type DeviceDashboardTelemetry struct { base.DefaultModel DeviceDashboardID uint TelemetryID uint Telemetry Telemetry }
DeviceDashboardTelemetry 仪表盘遥测
func NewDeviceDashboardTelemetry ¶
func NewDeviceDashboardTelemetry() *DeviceDashboardTelemetry
NewDeviceDashboardTelemetry ..
type DeviceModel ¶
type DeviceModel struct { base.DefaultModel Name string `gorm:"size:50"` Desc string `gorm:"size:5000"` DeviceType uint8 //设备类型,0:默认设备,1:摄像头 CameraCompany uint8 //摄像头厂家,0:海康威视,1:大华 AttributeModels []*AttributeModel TelemetryModels []*TelemetryModel }
DeviceModel 设备模型
func NewDeviceModelFromPB ¶
func NewDeviceModelFromPB(in *pb.CreateDeviceModelRequest) *DeviceModel
NewDeviceModelFromPB ..
func (*DeviceModel) IsHikivisionCamera ¶
func (m *DeviceModel) IsHikivisionCamera(deviceType pb.DeviceType, cameraCompany pb.CameraCompany) bool
IsHikivisionCamera ..
func (*DeviceModel) ToDeviceModelPBs ¶
func (m *DeviceModel) ToDeviceModelPBs(data []*DeviceModel) []*pb.DeviceModel
ToDeviceModelPBs ..
type Telemetry ¶
type Telemetry struct { base.DefaultModel DeviceID uint `gorm:"uniqueIndex:telemetry_uix"` Device Device TelemetryModelID uint `gorm:"uniqueIndex:telemetry_uix"` TelemetryModel TelemetryModel }
Telemetry 遥测
type TelemetryModel ¶
type TelemetryModel struct { base.DefaultModel DeviceModelID uint `gorm:"uniqueIndex:telemetry_model_uix"` Key string `gorm:"uniqueIndex:telemetry_model_uix;size:50"` Name string `gorm:"size:50"` Factor float64 Unit string `gorm:"size:10"` UnitName string `gorm:"size:10"` Scale uint8 }
TelemetryModel 遥测模型
func NewTelemetryModelFromPB ¶
func NewTelemetryModelFromPB(in *pb.CreateTelemetryModelRequest) *TelemetryModel
NewTelemetryModelFromPB ..
Click to show internal directories.
Click to hide internal directories.