qixiaoning
8 天以前 eac932eb827c93e2e998ac1210c3f5e548af0dbf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package vo
 
import (
    "vamicro/camera-common/models"
 
    "basic.com/pubsub/protomsg.git"
)
 
type CameraEditVo struct {
    models.Camera
    AreaId  string          `json:"areaId"`
    Sensors []models.Sensor `json:"sensors"`
}
 
func (v *CameraEditVo) Copy2Camera() models.Camera {
    return v.Camera
}
 
// 摄像机运行状态结构体
type CameraRunVo struct {
    Id        string `json:"id"`         //摄像机id
    Name      string `json:"name"`       //摄像机名称
    IsRunning bool   `json:"is_running"` //是否正在运行(0:未运行任务,1:正在运行任务)
    RunType   int    `json:"run_type"`   //运行类型(0:轮询,1:实时)
    RunEnable bool   `json:"run_enable"` //是否启用
}
 
type CameraChangeRunVo struct {
    CameraIds []string `json:"camera_ids"`
    RunType   int      `json:"run_type"`
}
 
type CameraRunInfo struct {
    models.Camera
    RunServerName string `json:"runServerName"`
    // Tasks         []CameraRunTask `json:"tasks"`
    AllTasks []models.TaskM `json:"allTasks"`
    Status   int            `json:"status"`
    LinkCams [][]LinkCam    `json:"linkCams"` //与此摄像机联动的所有联动摄像机信息,分组
}
 
type LinkCam struct {
    Id   string `json:"id"`
    Name string `json:"name"`
}
 
type CameraRunTask struct {
    TaskName string `json:"taskname"` //场景名称
    HasRule  bool   `json:"hasRule"`
}
 
func (cri *CameraRunInfo) CopyFromCamera(v models.Camera) {
    cri.Camera = v
}
 
func (cri *CameraRunInfo) CopyFromProtoCamera(v protomsg.Camera) {
    cri.Camera = models.Camera{
        Id:               v.Id,
        Name:             v.Name,
        Alias:            v.Alias,
        SnapshotUrl:      v.SnapshotUrl,
        Type:             int(v.Type),
        Addr:             v.Addr,
        Longitude:        v.Longitude,
        Latitude:         v.Latitude,
        Floor:            int(v.Floor),
        Rtsp:             v.Rtsp,
        Ip:               v.Ip,
        Port:             int(v.Port),
        Username:         v.Username,
        Password:         v.Password,
        Brand:            v.Brand,
        Reserved:         v.Reserved,
        IsRunning:        v.IsRunning,
        RunEnable:        v.RunEnable,
        RunType:          int(v.RunType),
        RunServerId:      v.RunServerId,
        ResolutionWidth:  int(v.ResolutionWidth),
        ResolutionHeight: int(v.ResolutionHeight),
        VoiceEnable:      v.VoiceEnable,
        VoiceId:          v.VoiceId,
    }
}
 
type CameraRunStatistic struct {
    ChannelTotal     int `json:"channelTotal"`
    RealTotal        int `json:"realTotal"`
    RealValidCount   int `json:"realValidCount"`
    RealInvalidCount int `json:"realInvalidCount"`
    RealRunningCount int `json:"realRunningCount"`
 
    PollChannelCount int `json:"pollChannelCount"`
    PollTotal        int `json:"pollTotal"`
    PollValidCount   int `json:"pollValidCount"`
    PollInvalidCount int `json:"pollInvalidCount"`
    PollRunningCount int `json:"pollRunningCount"`
 
    StackChannelCount int `json:"stackChannelCount"` //数据栈占用通道数量
    StackTotal        int `json:"stackTotal"`
    StackValidCount   int `json:"stackValidCount"`
    StackInvalidCount int `json:"stackInvalidCount"`
    StackRunningCount int `json:"stackRunningCount"`
 
    DuanliuID []string `json:"duanliuID"` // 山东断流监控
}
 
type CamSensorVo struct {
    models.Camera
    Sensors []models.Sensor `json:"sensors"`
}
 
type CameraQueryVo struct {
    IsOnMap    bool   `json:"isOnMap"`
    Floor      int    `json:"floor"`
    CameraName string `json:"cameraName"`
}
 
type CameraPosVo struct {
    Id        string  `json:"id"`
    Floor     int     `json:"floor"`
    Longitude float32 `json:"longitude"`
    Latitude  float32 `json:"latitude"`
}
 
type CoordTrans struct {
    X0 int `json:"x0"`
    Y0 int `json:"y0"`
    X1 int `json:"x1"`
    Y1 int `json:"y1"`
}
 
type CoordSetVo struct {
    CameraId string       `json:"cameraId"`
    Coords   []CoordTrans `json:"coords"`
}
 
type CoordTransShow struct {
    Coords         []CoordTrans `json:"coords"`         //在本摄像机底图上的标定坐标
    PanoramaCoords []CPoint     `json:"panoramaCoords"` //在全景图上显示的坐标
}
 
type CPoint struct {
    X float32 `json:"x"`
    Y float32 `json:"y"`
}
 
type CCoordResult struct {
    Result []CPoint `json:"result"`
}
 
type SyncCameraResult struct {
    Cameras    []models.Camera     `json:"camera"`
    Area       []models.Area       `json:"area"`
    CameraArea []models.CameraArea `json:"camera_area"`
}
 
type SyncSensorResult struct {
    Sensor       []models.Sensor       `json:"sensor"`
    CameraSensor []models.CameraSensor `json:"camera_sensor"`
}