You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

594 lines
40 KiB
JavaScript

2 weeks ago
define(function (require, exports, module) {
function e() {
this.m_oSHttpCapa = {}, this.m_oDeviceInfo = {}, this.m_oDeviceCapa = {}, this.m_oDevicePort = {
iSHttpPort: 80,
iRtspPort: 554,
iManagePort: 8e3
}, this.m_oWait = null, this.m_oChannelType = {
ANALOG: "AnalogChannelInfo",
DIGITAL: "DigitalChannelInfo",
ZERO: "ZeroChannelInfo"
}, this.m_oAlarmOutputType = {
ANALOG: "AnalogAlarmOutputInfo",
DIGITAL: "DigitalAlarmOutputInfo"
}, this.m_oAlarmInputType = {
ANALOG: "AnalogAlarmInputInfo",
DIGITAL: "DigitalAlarmInputInfo"
}, this.m_iDeviceMinusLocalTime = 0, a.m_bAnonymous || (this.getDeviceMinusLocalTime(), this.getDeviceInfo(), this.getDeviceCapa(), this.getVCAResource(), this.getTrafficCap(1), this.getDisplayParamSwitchSupport(), this.getTHScreenSupport(), this.isSupportPrivacyMask(), this.isSupportGIS(), this.isSupportVandalProofAlarm(), this.isSupportPanoramaImageParam(), this.getPTZCtrlCap(), this.getSmartDetectionCap()), this.getSHttpCapa(), this.getRTSPPort()
}
var a, t, i;
a = require("common"), t = require("utils"), i = require("dialog"), e.prototype = {
getSHttpCapa: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "sHttpCapa", null, {
async: !1, success: function (a, i) {
e.m_oSHttpCapa.bSupportShttpPlay = t.nodeValue(i, "isSupportHttpPlay", "b"), e.m_oSHttpCapa.bSupportShttpPlayback = t.nodeValue(i, "isSupportHttpPlayback", "b"), e.m_oSHttpCapa.bSupportShttpsPlay = t.nodeValue(i, "isSupportHttpsPlay", "b"), e.m_oSHttpCapa.bSupportShttpsPlayback = t.nodeValue(i, "isSupportHttpsPlayback", "b"), e.m_oSHttpCapa.bSupportShttpPlaybackTransCode = t.nodeValue(i, "isSupportHttpTransCodePlayback", "b"), e.m_oSHttpCapa.bSupportShttpsPlaybackTransCode = t.nodeValue(i, "isSupportHttpsTransCodePlayback", "b"), $(i).find("ipChanBase").length > 0 && (e.m_oSHttpCapa.iIpChanBase = t.nodeValue(i, "ipChanBase", "i")), e.m_oSHttpCapa.aTransCodeResolution = $(i).find("transCodePlaybackCap").length > 0 ? $(i).find("transCodePlaybackchannelList").eq(0).find("resolution").eq(0).attr("opt").split(",") : ["255"]
}
})
}, getDeviceInfo: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "deviceInfo", null, {
async: !1, success: function (a, i) {
e.m_oDeviceInfo.szDeviceType = t.nodeValue(i, "deviceType"), e.m_oDeviceInfo.szModel = t.nodeValue(i, "model"), e.m_oDeviceInfo.szDeviceName = t.nodeValue(i, "deviceName")
}
})
}, getDeviceMinusLocalTime: function () {
var e = this;
return e.m_iDeviceMinusLocalTime = 0, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "timeInfo", null, {
async: !1, success: function (a, i) {
var n = t.nodeValue(i, "localTime").substring(0, 19),
o = n.match(/(\d+)-(\d+)-(\d+)(\D+)(\d+):(\d+):(\d+)/);
if (8 === o.length) {
var r = new Date(o[1], o[2] - 1, o[3], o[5], o[6], o[7]), s = t.nodeValue(i, "timeZone"), l = 0,
c = s.indexOf("DST");
if (-1 != c) {
var u = new Date(r.getTime());
u.setMinutes(0), u.setSeconds(0);
var d = new Date(r.getTime());
d.setMinutes(0), d.setSeconds(0);
var m = s.split(",")[1], p = s.split(",")[2],
f = parseInt(m.split(".")[0].replace("M", ""), 10);
u.setMonth(f - 1);
var g = parseInt(m.split(".")[1], 10), h = parseInt(m.split(".")[2].split("/")[0]),
v = parseInt(m.split(".")[2].split("/")[1].split(":")[0], 10);
u.setHours(v);
for (var S = 0, P = 0, b = 1; 31 >= b && (u.setDate(b), u.getMonth() === f - 1) && (u.getDay() != h || (S++, P = b, S != g)); b++) ;
u.setDate(P), u.setMonth(f - 1);
var C = parseInt(p.split(".")[0].replace("M", ""), 10);
d.setMonth(C - 1), d.setYear(d.getFullYear() + (f > C ? 1 : 0));
var I = parseInt(p.split(".")[1], 10), y = parseInt(p.split(".")[2].split("/")[0]),
_ = parseInt(p.split(".")[2].split("/")[1].split(":")[0], 10);
d.setHours(_), S = 0, P = 0;
for (var b = 1; 31 >= b && (d.setDate(b), d.getMonth() === C - 1) && (d.getDay() != y || (S++, P = b, S != I)); b++) ;
if (d.setDate(P), d.setMonth(C - 1), r.getTime() >= u.getTime() && r.getTime() <= d.getTime()) {
var D = s.substring(c + 3, c + 11);
l = 60 * parseInt(D.split(":")[0], 10) + parseInt(D.split(":")[1], 10)
}
}
var T = s.match(/\D+([+-])(\d+):(\d+):(\d+)/);
if (5 == T.length) {
var L = new Date, V = L.getTimezoneOffset(), A = 60 * parseInt(T[2]) + parseInt(T[3]);
A = "+" === T[1] ? A : -A, e.m_iDeviceMinusLocalTime = 1e3 * 60 * (V - A + l)
}
}
}
}), e.m_iDeviceMinusLocalTime
}, getChannel: function (e) {
var t = null;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, e, null, {
async: !1, success: function (e, a) {
t = a
}
}), t
}, getChannelStatus: function () {
var e = null;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "DigitalChannelStatus", null, {
async: !1,
success: function (a, t) {
e = t
}
}), e
}, getAlarmOutput: function (e) {
var t = null;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, e, null, {
async: !1, success: function (e, a) {
t = a
}
}), t
}, getAlarmInput: function (e) {
var t = null;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, e, null, {
async: !1, success: function (e, a) {
t = a
}
}), t
}, getRTSPPort: function () {
var e = this, a = !1;
a = e.getPPPOEStatus(), a ? e.getInternalRTSPPort() : e.getUPnPStatus()
}, getPPPOEStatus: function () {
var e = !1;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "PPPoEStatus", null, {
async: !1,
success: function (a, i) {
e = $(i).find("ipAddress").length > 0 ? t.isDIPAddress(t.nodeValue(i, "ipAddress")) : $(i).find("ipv6Address").length > 0 ? t.isIPv6Address(t.nodeValue(i, "ipv6Address")) : !1
}
}), e
}, getInternalRTSPPort: function () {
var e = this, i = "";
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "portInfo", null, {
async: !1, success: function (a, n) {
$(n).find("AdminAccessProtocol").each(function () {
i = t.nodeValue(this, "protocol").toLowerCase(), "rtsp" === i ? e.m_oDevicePort.iRtspPort = t.nodeValue(this, "portNo", "i") : "http" === i ? e.m_oDevicePort.iSHttpPort = t.nodeValue(this, "portNo", "i") : "dev_manage" === i && (e.m_oDevicePort.iManagePort = t.nodeValue(this, "portNo", "i"))
})
}
})
}, getUPnPStatus: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "upnpStatus", null, {
async: !1, success: function (i, n) {
var o = 554, r = 80, s = "";
$(n).find("portStatusList").eq(0).find("portStatus").each(function () {
s = t.nodeValue(this, "internalPort").toLowerCase(), "rtsp" === s && (o = t.nodeValue(this, "externalPort", "i")), "http" === s && (r = t.nodeValue(this, "externalPort", "i"))
}), a.m_bAnonymous || e.getNetworkBond(o, r)
}, error: function () {
e.getInternalRTSPPort()
}
})
}, getNetworkBond: function (e, i) {
var n = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "networkBond", null, {
async: !1, success: function (o, r) {
t.nodeValue(r, "enabled", "b") ? t.isIPv6Address(a.m_szHostNameOriginal) ? t.nodeValue(r, "ipv6Address") !== a.m_szHostNameOriginal ? (n.m_oDevicePort.iRtspPort = e, n.m_oDevicePort.iSHttpPort = i) : n.getInternalRTSPPort() : t.nodeValue(r, "ipAddress") !== a.m_szHostName ? (n.m_oDevicePort.iRtspPort = e, n.m_oDevicePort.iSHttpPort = i) : n.getInternalRTSPPort() : n.getNetworkInterface(e, i)
}, error: function () {
n.getNetworkInterface(e, i)
}
})
}, getNetworkInterface: function (e, i) {
var n = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "networkInterface", null, {
async: !1, success: function (o, r) {
var s = !1;
t.isIPv6Address(a.m_szHostNameOriginal) ? ($(r).find("NetworkInterface").each(function () {
t.nodeValue(this, "ipv6Address") === a.m_szHostNameOriginal && (s = !0)
}), s ? n.getInternalRTSPPort() : (n.m_oDevicePort.iRtspPort = e, n.m_oDevicePort.iSHttpPort = i)) : ($(r).find("NetworkInterface").each(function () {
t.nodeValue(this, "ipAddress") === a.m_szHostName && (s = !0)
}), s ? n.getInternalRTSPPort() : (n.m_oDevicePort.iRtspPort = e, n.m_oDevicePort.iSHttpPort = i))
}
})
}, getDeviceCapa: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "deviceCapa", null, {
async: !1, success: function (a, i) {
var n = $(i);
e.m_oDeviceCapa.bSupportTransCode = t.nodeValue(n.find("RacmCap").eq(0), "isSupportTransCode", "b"), n.find("PTZCtrlCap").length > 0 && (e.m_oDeviceCapa.bSupportPatrols = t.nodeValue(n.find("PTZCtrlCap").eq(0), "isSupportPatrols", "b")), e.m_oDeviceCapa.bSupportStreamEncrypt = t.nodeValue(i, "isSupportStreamingEncrypt", "b"), e.m_oDeviceCapa.bSupportPicDown = t.nodeValue(i, "isSupportSrcIDSearch", "b"), e.m_oDeviceCapa.bSupportReversePlayback = "true" === n.find("isSupportReversePlayback").eq(0).text(), e.m_oDeviceCapa.bSupportHoliday = t.nodeValue(i, "isSupportHolidy", "b"), e.m_oDeviceCapa.bSupportFtp = t.nodeValue(i, "isSupportFtp", "b"), e.m_oDeviceCapa.bSupportExtHdCfg = t.nodeValue(i, "isSupportExtHdCfg", "b"), e.m_oDeviceCapa.bSupportPnp = t.nodeValue(i, "isSupportPNP", "b"), e.m_oDeviceCapa.bSupportZeroChan = t.nodeValue(i, "RacmCap isSupportZeroChan", "b"), e.m_oDeviceCapa.bSupportDST = t.nodeValue(i, "isSupportDst", "b"), e.m_oDeviceCapa.bSupport232Config = t.nodeValue(n.find("SerialCap").eq(0), "supportRS232Config", "b");
var o = t.nodeValue(n.find("RacmCap").eq(0), "isSupportPTZRs485Proxy", "b");
e.m_oDeviceCapa.bSupport485 = t.nodeValue(n.find("SerialCap").eq(0), "rs485PortNums", "i") > 0 || o, e.m_oDeviceCapa.bSupportEZVIZ = t.nodeValue(i, "isSupportEZVIZ", "b"), e.m_oDeviceCapa.bSupportEhome = t.nodeValue(i, "isSupportEhome", "b"), e.m_oDeviceCapa.bSupportDdns = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportDdns", "b"), e.m_oDeviceCapa.bSupportPPPoE = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportPPPoE", "b"), e.m_oDeviceCapa.bSupportUpnp = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportUpnp", "b"), e.m_oDeviceCapa.bSupportWirelessDial = t.nodeValue(n, "isSupportWirelessDial", "b"), e.m_oDeviceCapa.bSupportSnmp = t.nodeValue(n.find("SnmpCap").eq(0), "isSupport", "b"), e.m_oDeviceCapa.bSupportFtp = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportFtp", "b"), e.m_oDeviceCapa.bSupportHttps = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportHttps", "b"), e.m_oDeviceCapa.bSupportNetworkOther = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportExtNetCfg", "b"), e.m_oDeviceCapa.bSupportIpcStreamType = t.nodeValue(n.find("RacmCap").eq(0), "isSupportIpcStreamType", "b"), e.m_oDeviceCapa.bSupportNetPreviewStrategy = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportNetPreviewStrategy", "b"), e.m_oDeviceCapa.bSupportIpcImport = t.nodeValue(n.find("RacmCap").eq(0), "isSupportIpcImport", "b"), e.m_oDeviceCapa.bSupportNfs = t.nodeValue(n.find("RacmCap").eq(0), "nasNums", "i") > 0 || t.nodeValue(n.find("RacmCap").eq(0), "ipSanNums", "i") > 0, e.m_oDeviceCapa.bSupportAnalogChan = t.nodeValue(n.find("VideoCap").eq(0), "videoInputPortNums", "i") > 0, e.m_oDeviceCapa.bSupportDigitalChan = t.nodeValue(n.find("RacmCap").eq(0), "inputProxyNums", "i") > 0, e.m_oDeviceCapa.bSupportMenu = t.nodeValue(n.find("VideoCap").eq(0), "menuNums", "i") > 0, e.m_oDeviceCapa.bSupportAudio = n.find("AudioCap").length > 0;
var r = t.nodeValue(n.find("RacmCap").eq(0), "isSupportIOInputProxy", "b");
e.m_oDeviceCapa.bSupportVideoLoss = t.nodeValue(n.find("EventCap").eq(0), "isSupportVideoLoss", "b"), e.m_oDeviceCapa.bSupportAlarmIn = t.nodeValue(n.find("IOCap").eq(0), "IOInputPortNums", "i") > 0 || r;
var s = t.nodeValue(n.find("RacmCap").eq(0), "isSupportIOOutputProxy", "b");
e.m_oDeviceCapa.bSupportAlarmOut = t.nodeValue(n.find("IOCap").eq(0), "IOOutputPortNums", "i") > 0 || s, e.m_oDeviceCapa.iAlarmOutNum = t.nodeValue(n.find("IOCap").eq(0), "IOOutputPortNums", "i"), e.m_oDeviceCapa.bSupportIPFilter = t.nodeValue(i, "isSupportIPFilter", "b"), e.m_oDeviceCapa.bSupportHddTest = t.nodeValue(i, "isSupportSMARTTest", "b"), e.m_oDeviceCapa.bSupportCapture = t.nodeValue(i, "isSupportSnapshot", "b"), e.m_oDeviceCapa.bSupportPlatformAccess = t.nodeValue(n.find("MegaPlatformCap").eq(0), "isSupportPlatformAccess", "b"), e.m_oDeviceCapa.bSupportPlatformNMSAccess = t.nodeValue(n.find("MegaPlatformCap").eq(0), "isSupportNetManagerAccess", "b"), e.m_oDeviceCapa.bSupportPlatformReset = t.nodeValue(n.find("MegaPlatformCap").eq(0), "isSupportVSB", "b"), e.m_oDeviceCapa.bSupportPlatformVBS = t.nodeValue(n.find("MegaPlatformCap").eq(0), "isSupportPlatReset", "b"), e.m_oDeviceCapa.bSupport8021x = t.nodeValue(n.find("NetworkCap").eq(0), "isSupport802_1x", "b"), e.m_oDeviceCapa.bSupportWifi = t.nodeValue(n.find("NetworkCap").eq(0), "isSupportWireless", "b"), e.m_oDeviceCapa.bSupport28181Service = t.nodeValue($(i).find("NetworkCap").eq(0), "isSupportGB28181Service", "b"), e.m_oDeviceCapa.bSupportWPS = t.nodeValue($(i).find("NetworkCap").eq(0), "isSupportWPS", "b");
var l = n.find("WLAlarmCap").eq(0);
e.m_oDeviceCapa.bSupportTeleCtrl = t.nodeValue(l, "isSupportTeleControl", "b"), e.m_oDeviceCapa.bSupportWLS = t.nodeValue(l, "isSupportWLSensors", "b"), e.m_oDeviceCapa.bSupportPIR = t.nodeValue(l, "isSupportPIR", "b"), e.m_oDeviceCapa.bSupportCH = t.nodeValue(l, "isSupportCallHelp", "b");
var c = n.find("SmartCap").eq(0);
if (e.m_oDeviceCapa.bSupportROI = t.nodeValue(c, "isSupportROI", "b"), e.m_oDeviceCapa.bSupportIntelliTrace = t.nodeValue(c, "isSupportIntelliTrace", "b"), e.m_oDeviceCapa.bSupportAudioDection = t.nodeValue(c, "isSupportAudioDetection", "b"), e.m_oDeviceCapa.bSupportDefousDection = t.nodeValue(c, "isSupportDefocusDetection", "b"), e.m_oDeviceCapa.bSupportSceneChangeDetection = t.nodeValue(c, "isSupportSceneChangeDetection", "b"), e.m_oDeviceCapa.bSupportFaceDect = t.nodeValue(c, "isSupportFaceDetect", "b"), e.m_oDeviceCapa.bSupportLineDection = t.nodeValue(c, "isSupportLineDetection", "b"), e.m_oDeviceCapa.bSupportFieldDection = t.nodeValue(c, "isSupportFieldDetection", "b"), e.m_oDeviceCapa.bSupportRegionEntrance = t.nodeValue(c, "isSupportRegionEntrance", "b"), e.m_oDeviceCapa.bSupportRegionExit = t.nodeValue(c, "isSupportRegionExiting", "b"), e.m_oDeviceCapa.bSupportLoiter = t.nodeValue(c, "isSupportLoitering", "b"), e.m_oDeviceCapa.bSupportGroup = t.nodeValue(c, "isSupportGroup", "b"), e.m_oDeviceCapa.bSupportRapidMove = t.nodeValue(c, "isSupportRapidMove", "b"), e.m_oDeviceCapa.bSupportPark = t.nodeValue(c, "isSupportParking", "b"), e.m_oDeviceCapa.bSupportUnattendedBaggage = t.nodeValue(c, "isSupportUnattendedBaggage", "b"), e.m_oDeviceCapa.bSupportAttendedBaggage = t.nodeValue(c, "isSupportAttendedBaggage", "b"), e.m_oDeviceCapa.bSupportPeopleDetection = t.nodeValue(c, "isSupportPeopleDetection", "b"), e.m_oDeviceCapa.bSupportPeopleCount = {
bSptPeople: !1,
bSptObjCount: !1
}, t.nodeValue(n.find("VideoCap").eq(0), "isSupportCounting", "b")) {
var u = "object" == t.nodeValue(n.find("VideoCap").eq(0), "countingType");
e.m_oDeviceCapa.bSupportPeopleCount.bSptObjCount = u, e.m_oDeviceCapa.bSupportPeopleCount.bSptPeople = !u
} else e.m_oDeviceCapa.bSupportPeopleCount.bSptObjCount = !1, e.m_oDeviceCapa.bSupportPeopleCount.bSptPeople = !1;
e.m_oDeviceCapa.bSupportHeatmap = t.nodeValue(n.find("VideoCap").eq(0), "isSupportHeatmap", "b"), e.m_oDeviceCapa.bPTZ = "IPDome" === e.m_oDeviceInfo.szDeviceType, e.m_oDeviceCapa.bIPZoom = "IPZoom" === e.m_oDeviceInfo.szDeviceType, e.m_oDeviceCapa.bSupportFaceCaptureCount = t.nodeValue(n, "isSupportFaceCaptureStatistics", "b"), e.m_oDeviceCapa.bSupportWLANAP = t.nodeValue(n, "NetworkCap isSupportWirelessServer", "b"), e.m_oDeviceCapa.bSupportExternalDevice = t.nodeValue(n, "isSupportExternalDevice", "b"), e.m_oDeviceCapa.bSupportPicOver = n.find("VideoCap isSupportPicture").length ? t.nodeValue(n, "VideoCap isSupportPicture", "b") : !0, e.m_oDeviceCapa.bSupportCompass = t.nodeValue(n, "isSupportCompass", "b"), e.m_oDeviceCapa.bSupportRoadInfo = t.nodeValue(n, "isSupportRoadInfoOverlays", "b"), e.m_oDeviceCapa.bSupportAnonymous = t.nodeValue(n, "isSupportAnonymous", "b"), e.m_oDeviceCapa.bSupportOnlineUser = t.nodeValue(n, "isSupportOnlineUser", "b"), e.m_oDeviceCapa.bSupportUploadCalibrationData = t.nodeValue(n, "isSupportUploadCalibrationData", "b"), e.m_oDeviceCapa.bSupportElectronicsEnlarge = $(i).find("isSupportElectronicsEnlarge").length ? t.nodeValue(n, "isSupportElectronicsEnlarge", "b") : !e.m_oDeviceCapa.bPTZ, e.m_oDeviceCapa.bSupportStorage = !t.nodeValue(n, "isSupportRemoveStorage", "b"), e.m_oDeviceCapa.bSupportMotion = t.nodeValue(n, "isSupportMotionDetection", "b");
var d = n.find("NetworkCap").eq(0);
e.m_oDeviceCapa.bSptVerificationCode = !!$(d).find("VerificationCodeModification").length, e.m_oDeviceCapa.bSptVerificationCode && (e.m_oDeviceCapa.oVerifyCodeInfo = {
bEmpty: "empty" === t.nodeValue(d, "verificationCodeType"),
bModified: t.nodeValue(d, "verificationCodeModify", "b"),
szDeclarationURL: t.nodeValue(d, "declarationURL"),
szPrivacyPolicyURL: t.nodeValue(d, "privacyPolicyURL")
})
}
})
}, getImageCap: function (e) {
var i = {bSupportRegionalExposure: !1, bSupportRegionalFocus: !1};
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "imageCap", {channel: e}, {
async: !1,
success: function (e, a) {
i.bSupportRegionalExposure = t.nodeValue(a, "isSupportRegionalExposure", "b"), i.bSupportRegionalFocus = t.nodeValue(a, "isSupportRegionalFocus", "b"), i.bSupportImgRestore = t.nodeValue(a, "isSupportRestore", "b")
}
}), i
}, getPTZChanelCap: function (e) {
var i = {bSupportPosition3D: !1, bSupportWiperStatus: !1};
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "rs485Capa", {channel: e}, {
async: !1,
success: function (e, a) {
if ($(a).find("PTZChanelCap").length > 0) {
var n = $(a).find("PTZChanelCap").eq(0);
i.bSupportPosition3D = t.nodeValue(n, "isSupportPosition3D", "b"), i.bSupportWiperStatus = !("false" == $(n).find("wiperStatusSupport").eq(0).text())
}
}
}), i
}, getRegCropCap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "regCropCap", {channel: 1, videoStream: "03"}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bIsSupportRegCrop = !0
}
})
}, getDualVCACap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "DualVCACap", {channel: 1}, {
async: !1, success: function () {
e.m_oDeviceCapa.bIsSupportDualVCA = !0
}
})
}, getTalkInfo: function () {
var e = this;
e.m_oDeviceCapa.iTaklNum = 0, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "talkListInfo", null, {
async: !1,
success: function (a, i) {
$(i).find("associateVideoInputs").length > 0 && (e.m_oDeviceCapa.bSupportTalkset = !0), e.m_oDeviceCapa.iTaklNum = $(i).find("TwoWayAudioChannel").length, e.m_oDeviceCapa.iTaklNum > 0 && $(i).find("audioCompressionType").length > 0 && (e.m_oDeviceCapa.m_szaudioCompressionType = $(i).find("audioCompressionType").eq(0).text()), e.m_oDeviceCapa.m_iAudioBitRate = $(i).find("audioBitRate").length > 0 ? 1e3 * t.nodeValue(i, "audioBitRate", "i") : 0, e.m_oDeviceCapa.m_iAudioSamplingRate = $(i).find("audioSamplingRate").length > 0 ? parseInt(1e3 * t.nodeValue(i, "audioSamplingRate", "f"), 10) : 0
}
})
}, getNetworkVersion: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "networkInterface", null, {
async: !1, success: function (a, i) {
e.m_oDeviceCapa.szIPVersion = t.nodeValue(i, "ipVersion")
}
})
}, get28181Support: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "cfg28181", null, {
async: !1, success: function () {
e.m_oDeviceCapa.bSupport28181 = !0
}, error: function () {
e.m_oDeviceCapa.bSupport28181 = !1
}
})
}, getAuthSupport: function () {
var e = this;
e.m_oDeviceCapa.oSupportAuth = {}, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "rtspAuth", null, {
async: !1,
success: function (a, t) {
var i = $(t).find("Security").eq(0).find("enabled").eq(0).text();
e.m_oDeviceCapa.oSupportAuth.bRtsp = "" == i ? !1 : !0
},
error: function () {
e.m_oDeviceCapa.oSupportAuth.bRtsp = !1
}
}), WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "webAuth", null, {
async: !1, success: function () {
e.m_oDeviceCapa.oSupportAuth.bWeb = !0
}, error: function () {
e.m_oDeviceCapa.oSupportAuth.bWeb = !1
}
})
}, isEnableHoliday: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "holidayInfo", null, {
async: !1, success: function (a, i) {
for (var n = $(i).find("holiday").length, o = 0; n > o; o++) if (t.nodeValue($(i).find("holiday").eq(o), "enabled", "b")) {
e.m_oDeviceCapa.bEnableHoliday = !0;
break
}
o === n && (e.m_oDeviceCapa.bEnableHoliday = !1)
}
})
}, getIntelliSupport: function () {
var e = this;
e.m_oDeviceCapa.bSupportIntelligent = !1, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "VCADeviceCap", null, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportIntelligent = !0
},
error: function () {
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "VCAIntelliCap", {channel: 1}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportIntelligent = !0
}
})
}
})
}, getQuotaCap: function () {
var e = this;
e.m_oDeviceCapa.bSupporttQuota = !1, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "quotaCap", null, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupporttQuota = !0
}
})
}, getCloudStorage: function () {
var e = this;
e.m_oDeviceCapa.bSupportCloudStorage = !1, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "cloudStorage", {
channel: 1,
cloud: 1
}, {
async: !1, success: function () {
e.m_oDeviceCapa.bSupportCloudStorage = !0
}
})
}, getLiteStorage: function () {
var e = this;
e.m_oDeviceCapa.bSupportLiteStorage = !1, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "liteStorage", {channel: 1}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportLiteStorage = !0
}
})
}, getVCAResource: function () {
var e = this;
e.m_oDeviceCapa.oVCAResourceType = "", WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "VCAResource", {channel: 1}, {
async: !1,
success: function (a, t) {
e.m_oDeviceCapa.oVCAResourceType = $(t).find("type").text()
}
})
}, getVehicleCap: function () {
var e = this;
return e.m_oDeviceCapa.oSupportVehicle = {
vehicle: !1,
HVTVehicle: !1
}, "smartVehicleDetection" == e.m_oDeviceCapa.oVCAResourceType ? (e.m_oDeviceCapa.oSupportVehicle.vehicle = !0, void 0) : "smartHVTDetection" == e.m_oDeviceCapa.oVCAResourceType ? (e.m_oDeviceCapa.oSupportVehicle.HVTVehicle = !0, void 0) : "smart264AndRoadDetection" == e.m_oDeviceCapa.oVCAResourceType ? (e.m_oDeviceCapa.oSupportVehicle.vehicle = !0, e.m_oDeviceCapa.oSupportVehicle.HVTVehicle = !0, void 0) : (e.m_oDeviceCapa.oVCAResourceType && "" != e.m_oDeviceCapa.oVCAResourceType || WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "roadDetectionCap", {channel: 1}, {
async: !1,
success: function (a, t) {
e.m_oDeviceCapa.oSupportVehicle.vehicle = "true" == $(t).find("isSupportVehicleDetection").text(), e.m_oDeviceCapa.oSupportVehicle.HVTVehicle = "true" == $(t).find("isSupportHVTVehicleDetection").text()
}
}), void 0)
}, getDeviceLinkageCap: function (e, t, i) {
var n = this;
return n.m_oLinkageCap || WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "eventTriggerCap", null, {
async: !1,
success: function (e, a) {
n.m_oLinkageCap = a
},
error: function () {
n.m_oLinkageCap = "noSupport"
}
}), "string" == typeof n.m_oLinkageCap && "noSupport" == n.m_oLinkageCap ? !1 : t ? $(n.m_oLinkageCap).find(t).length > 0 : "i" == i ? parseInt($(n.m_oLinkageCap).find(e).eq(0).text(), 10) || 0 : "s" == i ? $(n.m_oLinkageCap).find(e).eq(0).text() : "true" == $(n.m_oLinkageCap).find(e).eq(0).text()
}, getTrafficCap: function (e) {
var t = this;
t.m_oDeviceCapa.oSupportTraffic || (t.m_oDeviceCapa.oSupportTraffic = {
bSupport: !1,
aUploadEvidence: [],
aUploadEvent: [],
aAidType: [],
bSupportVCR: !1,
bSupportManualEvidence: !1,
bSupportManualTrack: !1
}, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "evidenceCap", {channel: e}, {
async: !1,
success: function (e, a) {
t.m_oDeviceCapa.oSupportTraffic.bSupport = "true" == $(a).find("isEvidenceGettingSupport").text() || "true" == $(a).find("isIntellMonitorSupport").text();
var i = $(a).find("aidTypeSupport").text();
i && (t.m_oDeviceCapa.oSupportTraffic.aAidType = i.split(","));
var n = $(a).find("uploadDataTypesSupport").text(), o = [];
n && (o = n.split(",")), t.m_oDeviceCapa.oSupportTraffic.aUploadEvidence.length = 0, t.m_oDeviceCapa.oSupportTraffic.aUploadEvent.length = 0, t.m_oDeviceCapa.oSupportTraffic.bSupportVCR = "true" == $(a).find("isVCRSupport").text(), t.m_oDeviceCapa.oSupportTraffic.bSupportManualEvidence = "true" == $(a).find("isEdfManualItsCapSupport").text(), t.m_oDeviceCapa.oSupportTraffic.bSupportManualTrack = "true" == $(a).find("isEdfManualTrackSupport").text();
for (var r = o.length, s = 0; r > s; s++) o[s].indexOf("Evidence") > 0 ? t.m_oDeviceCapa.oSupportTraffic.aUploadEvidence.push(o[s]) : t.m_oDeviceCapa.oSupportTraffic.aUploadEvent.push(o[s])
}
}))
}, getSecurityService: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "telnetService", null, {
async: !1, success: function () {
e.m_oDeviceCapa.bSupportTelnet = !0
}, error: function () {
e.m_oDeviceCapa.bSupportTelnet = !1
}
}), WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "sshService", null, {
async: !1, success: function () {
e.m_oDeviceCapa.bSupportSSH = !0
}, error: function () {
e.m_oDeviceCapa.bSupportSSH = !1
}
}), WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "illegalLoginLockService", null, {
async: !1,
success: function () {
e.m_oDeviceCapa.bLoginLock = !0
},
error: function () {
e.m_oDeviceCapa.bLoginLock = !1
}
})
}, getVehicleType: function (e) {
var t = this;
if ("smartVehicleDetection" == t.m_oDeviceCapa.oVCAResourceType) return t.m_oDeviceCapa.szVehicle = "vehicleDetection", void 0;
if ("smartHVTDetection" == t.m_oDeviceCapa.oVCAResourceType) return t.m_oDeviceCapa.szVehicle = "hvtVehicleDetection", void 0;
if ("smart264AndRoadDetection" == t.m_oDeviceCapa.oVCAResourceType) ; else if (t.m_oDeviceCapa.oVCAResourceType && "" != t.m_oDeviceCapa.oVCAResourceType) return t.m_oDeviceCapa.szVehicle = "vehicleDetection", void 0;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "vehicleDetectionType", {channel: e}, {
async: !1,
success: function (e, a) {
t.m_oDeviceCapa.szVehicle = $(a).find("CurMode").text()
}
})
}, testNet: function (e, n, o) {
var r = this;
r.m_oWait = i.wait("", o.Testing), WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, e, null, {
data: n,
success: function (e, a) {
setTimeout(function () {
r.m_oWait && r.m_oWait.close();
var e = o.TestFailed, n = t.nodeValue($(a), "errorDescription");
switch (n) {
case"ok":
e = o.TestSuccess;
break;
case"connect server fail":
e = o.ConnectServerFail;
break;
case"no nas directory":
e = o.NoNasDirectory;
break;
case"no permission":
e = o.NoNasPermission;
break;
case"no dns":
e = o.NoDns;
break;
case"no gateway":
e = o.NoGateway;
break;
case"password error":
e = o.PasswordError;
break;
case"exchange server fail":
e = o.ExchangeServerFail;
break;
case"create directory failed":
e = o.CreateDirectoryFail;
break;
case"no write permission":
e = o.NoWritePermission;
break;
case"port error":
e = o.portError;
break;
case"user or password error":
e = o.PasswordError;
break;
case"no storage pool":
e = o.StoragePoolError;
break;
case"storage pool full":
e = o.StoragePoolFull;
break;
case"unknown error":
e = o.UnknownError;
break;
default:
}
i.alert(e)
}, 2e3)
},
error: function () {
setTimeout(function () {
r.m_oWait && r.m_oWait.close(), i.alert(o.TestFailed)
}, 2e3)
}
})
}, getChannelStreamSupport: function () {
var e = {};
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "StreamChannels", null, {
async: !1,
success: function (a, t) {
var i, n, o;
$(t).find("StreamingChannel").each(function () {
i = $(this).find("id").eq(0).text(), n = parseInt(i[i.length - 1]), o = i.slice(0, i.length - 2), e[o] = e[o] || [], e[o].push(n)
})
}
}), e
}, getChannelStreamNum: function (e) {
var a = this, t = 2, i = a.getChannelStreamSupport(), n = i[e];
return n && (t = n.pop()), t
}, getDisplayParamSwitchSupport: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "displayParamSwitchCap", {channel: 1}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportDisplayParamSwitch = !0
}
})
}, getTHScreenSupport: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "externalDevice", {channel: 1}, {
async: !1,
success: function (a, t) {
e.m_oDeviceCapa.bSupportTHScreen = !!$(t).find("THScreen").length
}
})
}, isSupportPrivacyMask: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "ptzPrivacyMask", null, {
async: !1, success: function () {
e.m_oDeviceCapa.bSupportPrivacyMask = !0
}
})
}, getPanoramicMapCap: function () {
var e = this;
e.m_oDeviceCapa.oPanorama || (e.m_oDeviceCapa.oPanorama = {
bSupport: !1,
bSupportGenerate: !1,
bSupportPreset: !1,
bSupportPosition: !1
}, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "panoramicMapCap", {}, {
async: !1, success: function (a, t) {
"true" == $(t).find("isSupportGeneratePanorama").text() && (e.m_oDeviceCapa.oPanorama.bSupport = !0, e.m_oDeviceCapa.oPanorama.bSupportGenerate = !0)
}
}))
}, getImageInfo: function () {
var e = null;
return WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "imageInfo", null, {
async: !1, success: function (a, t) {
e = t
}
}), e
}, isSupportPanoramaImageParam: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "imageParamCap", {channel: 1}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportPanoramaImageParam = !0
}
}), WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "imageParam", {channel: 1}, {
async: !1,
success: function (a, i) {
e.m_oDeviceCapa.bSupportPanoramaImageSensor = "panorama" === t.nodeValue(i, "fusionMode")
}
})
}, getPTZCtrlCap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "ptzCtrlCap", null, {
async: !1, success: function (a, i) {
e.m_oDeviceCapa.bSupportPTZWithPreview = t.nodeValue(i, "isSupportPTZWithPreview", "b")
}
})
}, getSmartDetectionCap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "rwlockCap", null, {
async: !1, success: function (a, i) {
e.m_oDeviceCapa.bSupportSmartDetection = "HIK" === t.nodeValue(i, "SDCardType")
}
})
}, ITCCap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "roadDetectionCap", null, {
async: !1, success: function (a, i) {
e.m_oDeviceCapa.bSupportIllegalDict = t.nodeValue(i, "isSupportIllegalDictionary", "b")
}, error: function () {
}
})
}, isSupportGIS: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "gisInfo", {channel: 1}, {
async: !1, success: function (a, i) {
"Location" === t.nodeValue(i, "showFunctionType") && (e.m_oDeviceCapa.bSupportGIS = !0)
}
})
}, isSupportVandalProofAlarm: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "compassCap", {channel: 1}, {
async: !1,
success: function (a, t) {
e.m_oDeviceCapa.bSupportVandalProofAlarm = !!$(t).find("VandalProofAlarm").length, e.m_oDeviceCapa.szSupportCompassDevType = $(t).find("supportDevType").text(), e.m_oDeviceCapa.bSupportCompassAzimuth = !!$(t).find("AzimuthInfo").length
}
})
}, isSupportVandalProofAlarmEvent: function () {
var e = this;
e.m_oDeviceCapa.bSupportVandalProofAlarmEvent = !1, WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "exceptionLink", {exception: "vandalProofAlarm"}, {
async: !1,
success: function () {
e.m_oDeviceCapa.bSupportVandalProofAlarmEvent = !0
}
})
}, getPictureSearchCap: function () {
var e = this;
WebSDK.WSDK_GetDeviceConfig(a.m_szHostName, "imgTypeCapa", null, {
async: !1, success: function (a, t) {
var i = $(t).find("pictureSearchType").eq(0).attr("opt");
e.m_oDeviceCapa.bSupportPicSearch = $(t).find("pictureSearchType").length > 0 && "" !== i ? !0 : !1
}
})
}
}, module.exports = new e
});