positionOperateByVido.js
1.99 KB
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
//摄像机预置位控制类
function CameraController() {
//添加预置位
this.AddPreLocation = function (index) {
//return ContrlPan("savepreplace", index, 0, 0) == "1";
//alert("添加预置位");
//var back = VionVideo.PtzSendCmdEx("V_PRESET_GET", index, "");
var re = VionVideo.PtzSendCmd("V_PRESET_SET", index, "");
return result(re);
}
//删除预置位
this.DeletePreplace = function (index) {
//return ContrlPan("delpreplace", index, 0, 0) == "1";
var re = VionVideo.PtzSendCmd("V_PRESET_DEL", index, "");
return result(re);
}
//转到预置位
this.GoToPreplace = function (index) {
//index = 17;
//return ContrlPan("gotopreplace", index, 0, 0) == "1";
var re = VionVideo.PtzSendCmd("V_PRESET_JMP", index, "");
return result(re);
}
//控制模式相关
//设置当前窗口控制模式为无状态
this.setPtzModeNull = function () {
var re = VionVideo.PtzSendCmd("V_PTZMODE_SET_NULL", 0, "");
return result(re);
}
//设置当前窗口控制模式为3D定位 支持方框 支持点定位
this.setPtzMode3dPtz = function () {
var re = VionVideo.PtzSendCmd("V_PTZMODE_SET_3DPTZ", 0, "");
return result(re);
}
//设置当前窗口控制模式为点击移动 支持鼠标点击 上下左右移动
this.setPtzModeClick = function () {
var re = VionVideo.PtzSendCmd("V_PTZMODE_SET_CLICK", 0, "");
return result(re);
}
var baseLocalPath = "D:\\vion-tech\\";
//删除本地缓存的文件
this.deleteLocalFile = function (szPath) {
var re;
if (szPath == "") {
var d = new Date();
szPath = baseLocalPath + d.getFullYear();
re = VionVideo.FileDelete(szPath, 0);
}
else {
re = VionVideo.FileDelete(szPath, 1);
}
return result(re);
}
function result(re) {
if (re == 1) {
return true;
}
else {
return false;
}
}
}
export {
CameraController
}