tsl

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FUNCTION_PROPERTY = 1
	FUNCTION_FUNCTION = 2
	FUNCTION_EVENT    = 3

	PROP_REPORT = "propReport"
)
View Source
const (
	READ_WRITE = 1
	READ_ONLEY = 2

	EVENT_ALARM = 1
	EVENT_FAULT = 2
	EVENT_INFO  = 3

	MEDIA_PLAY    = "PushStream"
	MEDIA_CLOSE   = "StopStream"
	MEDIA_CHANNEL = "channel"
	MEDIA_STREAM  = "streamDestination"

	PROPS_DEVICE_INFO   = "deviceInfo"
	PROPS_HARDWARE_INFO = "hardwareInfo"
	PROPS_SOFTWARE_INFO = "softwareInfo"
	PROPS_POSITION      = "position"
	PROPS_ENCLOSURE     = "enclosure"
	PROPS_GPSINFO       = "gpsInfo"
	TOPOCHANGED         = "topoChanged"

	//功能类的属性
	PROPS_GPSSTORAGE = "GPSStorage"

	FUNC_PTCCONTROL   = "PTZControl"   //云台控制
	FUNC_SHUTDOWN     = "shutdown"     //关机
	FUNC_REBOOT       = "reboot"       //重启
	FUNC_REMOTEACCESS = "remoteAccess" //远程功能
	FUNC_LOGREPORT    = "logReport"    //本地日志

	EVENT_OUTOFBOUND       = "outOfBoundAlert"      //围栏报警
	EVENT_INFEREVENT       = "InferEvent"           //edgex硬编码的设置的算法推理流数据
	EVENT_CPU              = "cpuPercentAlarm"      //cpu报警
	EVENT_MEM              = "memPercentAlarm"      //内存报警
	EVENT_DISK             = "diskPercentAlarm"     //硬盘报警
	EVENT_HOST_TEMPERATURE = "hostTemperatureAlarm" //温度报警
	EVENT_VIDEO_RECORD     = "videoRecordAlarm"     //视频记录报警
	EVENT_RESOURCE         = "edgexResourceAlarm"   //资源报警
	EVENT_MODE_CHANGE      = "modeChange"           //模式改变
	IS_OBJECT_POWERS       = "powers"
	IS_OBJECT_TEMPERATURES = "temperatures"
)

Variables

View Source
var CONFIG_QUERY = []string{1: "tsl", 2: "dp", 3: "algo", 4: "sys", 5: "ota.customfirmware", 6: "ota.image", 7: "ota.mcu", 8: "ota.ema", 9: "license", 10: "ota.edgex", 11: "ota.adapter"}
View Source
var EVENT_TYPES = []string{1: "alarm", 2: "fault", 3: "info"}
View Source
var HARDWARE_INFO = []string{"cpuPercent", "hostTemperature", "memPercent", "diskPercent", "powers", "temperatures"}

Functions

This section is empty.

Types

type ConfigSystem

type ConfigSystem struct {
	TimeCycle Cycle `json:"timeCycle"`
}

配置数据结构

type Cycle

type Cycle struct {
	//以下所有参数单位都是秒,特殊指定除外
	Heartbeat int `json:"heartbeat,omitempty"`
	GpsInfo   int `json:"gpsInfo,omitempty"`
}

配置数据结构

type DiskPercent

type DiskPercent struct {
	Mountpoint  string `json:"mountpoint"`
	DiskPercent int    `json:"diskPercent"`
}

远程系统配置

type EdgexResourceAlarm

type EdgexResourceAlarm struct {
	Total       int     `json:"total"`
	Used        int     `json:"used"`
	Free        int     `json:"free"`
	UsedPercent float64 `json:"usedPercent"`
}

远程系统配置

type EveValueType

type EveValueType struct {
	Type       string                   `json:"type"`
	Properties []map[string]interface{} `json:"properties"`
}

type Event

type Event struct {
	Id               string       `json:"id"`
	Name             string       `json:"name"`
	DataType         string       `json:"dataType,omitempty"`
	ValueType        EveValueType `json:"valueType"`
	PropertyReadType int          `json:"propertyReadType,omitempty"` // 属性_读写类型   1:读写  2:只读
}

type Function

type Function struct {
	Id      string                   `json:"id"`
	Name    string                   `json:"name"`
	Inputs  []map[string]interface{} `json:"inputs"`
	Outputs []map[string]interface{} `json:"outputs,omitempty"`
}

type HardwarePower

type HardwarePower struct {
	Name  string `json:"name"`
	Power struct {
		Average string `json:"average"`
		Current string `json:"current"`
	} `json:"power"`
}

远程系统配置

type HardwareTemperature

type HardwareTemperature struct {
	Name        string `json:"name"`
	Temperature string `json:"temperature"`
}

远程系统配置

type HostAlarm

type HostAlarm struct {
	CpuPercent      int `json:"cpuPercent"`
	MemPercent      int `json:"memPercent"`
	DiskPercent     int `json:"diskPercent"`
	HostTemperature int `json:"hostTemperature"`
}

远程系统配置

type Invoke

type Invoke struct {
	Name string `json:"name"`
}

type Item

type Item struct {
	Id                     string                   `json:"id,omitempty"`                     //
	FunctionType           int                      `json:"functionType"`                     // 功能类型  1:属性  2:行为  3:事件
	Name                   string                   `json:"name"`                             // 名称
	Code                   string                   `json:"code"`                             // 标识符
	PropertyDataType       string                   `json:"propertyDataType,omitempty"`       // 属性_数据类型
	PropertyReadType       int                      `json:"propertyReadType,omitempty"`       // 属性_读写类型   1:读写  2:只读
	PropertyDataDefinition map[string]interface{}   `json:"propertyDataDefinition,omitempty"` // 属性_数据定义
	PropertyExpand         map[string]interface{}   `json:"propertyExpand,omitempty"`         // 属性_扩展描述
	ActionCall             []map[string]interface{} `json:"actionCall,omitempty"`             // 行为_调用参数
	ActionReturn           []map[string]interface{} `json:"actionReturn,omitempty"`           // 行为_返回参数
	EventType              int                      `json:"eventType,omitempty"`              // 事件类型 1:告警  2:故障  3:信息
	Events                 []map[string]interface{} `json:"events,omitempty"`                 // 事件参数
	Original               string                   `json:"original,omitempty"`               // JSON报文
}

func MediaPackageItems

func MediaPackageItems(mod string) []Item

媒体播放物模型包

func Unmarshal

func Unmarshal(mod Model) (list []Item)

将物模型结构转成sql记录

type Media

type Media struct {
	Function string       `json:"function"`
	Inputs   []MediaInput `json:"inputs"`
}

func MediaCloseInputs

func MediaCloseInputs(channel string) Media

func MediaPlayInputs

func MediaPlayInputs(channel, stream string) Media

type MediaDeviceChannel

type MediaDeviceChannel struct {
	Address         string      `json:"address"`
	Children        interface{} `json:"children"`
	CivilCode       string      `json:"civilCode"`
	DeviceID        string      `json:"deviceId"`
	LivePublisher   interface{} `json:"livePublisher"`
	LiveSubSP       string      `json:"liveSubSP"`
	Manufacturer    string      `json:"manufacturer"`
	Model           string      `json:"model"`
	Name            string      `json:"name"`
	Owner           string      `json:"owner"`
	ParentID        string      `json:"parentId"`
	Parental        int64       `json:"parental"`
	RecordEndTime   string      `json:"recordEndTime"`
	RecordPublisher interface{} `json:"recordPublisher"`
	RecordStartTime string      `json:"recordStartTime"`
	Records         interface{} `json:"records"`
	RegisterWay     int64       `json:"registerWay"`
	SafetyWay       int64       `json:"safetyWay"`
	Secrecy         int64       `json:"secrecy"`
	Status          string      `json:"status"`
}

type MediaDeviceInfo

type MediaDeviceInfo struct {
	Addr         string               `json:"addr"`
	Channels     []MediaDeviceChannel `json:"channels"`
	ID           string               `json:"id"`
	RegisterTime string               `json:"registerTime"`
	SipIP        string               `json:"sipIP"`
	Status       string               `json:"status"`
	UpdateTime   string               `json:"updateTime"`
}

type MediaInput

type MediaInput struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Model

type Model struct {
	//属性
	Properties []Property `json:"properties,omitempty"`
	//行为或功能
	Functions []Function `json:"functions,omitempty"`
	//事件
	Events []Event `json:"events,omitempty"`

	PropsReport Event `json:"-"` //属性上报事件
}

func Marshal

func Marshal(list []Item) (mod Model)

将sql记录转成物模型结构

type Ntp

type Ntp struct {
	Enabled      bool   `json:"enabled"`
	Interval     int    `json:"interval"`
	MainServer   string `json:"mainServer"`
	SecondServer string `json:"secondServer"`
}

远程系统配置

type NvControl

type NvControl struct {
	NvpMode     int  `json:"nvpMode"`
	JetsonClock bool `json:"jetsonClock"`
	FanMode     int  `json:"fanMode"`
	FanSpeed    int  `json:"fanSpeed"`
}

远程系统配置

type Property

type Property struct {
	Id        string                 `json:"id"`
	Name      string                 `json:"name"`
	DataType  string                 `json:"dataType,omitempty"`
	ValueType map[string]interface{} `json:"valueType"`
	Expands   map[string]interface{} `json:"expands,omitempty"`
}

type PropertyDataDefinition

type PropertyDataDefinition struct {
	Expands struct {
		ReadOnly bool
	}
	Type string
}

type SystemCfg

type SystemCfg struct {
	SystemStatusCollectInterval  int       `json:"systemStatusCollectInterval"`
	SystemStatusReportInMiniMode bool      `json:"systemStatusReportInMiniMode"`
	TdengineKeep                 int       `json:"tdengineKeep"`
	OffdataRange                 int       `json:"offdataRange"`
	WorkMode                     WorkMode  `json:"workMode"`
	License                      string    `json:"license"`
	DeviceDescription            string    `json:"deviceDescription"`
	Ntp                          Ntp       `json:"ntp"`
	NvControl                    NvControl `json:"nvControl"`
	HostAlarm                    HostAlarm `json:"hostAlarm"`
	DeviceHeartbeat              int       `json:"deviceHeartbeat"`
}

远程系统配置

type VideoRecordAlarm

type VideoRecordAlarm struct {
	Total       int     `json:"total"`
	Used        int     `json:"used"`
	Free        int     `json:"free"`
	UsedPercent float64 `json:"usedPercent"`
}

远程系统配置

type WorkMode

type WorkMode struct {
	WorkMode int `json:"workMode"`
}

远程系统配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL