def show(place_no): """ 预览 :param place_no: 业务参数-摄像头位置说明 :return: """ confObj = read_conf(path.join(BASE_DIR, "conf", "conf.ini")) confHK = confObj["HIKVISION_" + place_no] f = HKCManage(confHK.place, confHK.ip, eval(confHK.port), confHK.user, confHK.pwd) f.show()
def get_screenshot(place_no, carNo): """ 截图一帧 :param place_no: 业务参数-摄像头位置说明 :param carNo: 业务参数-要监控的车号 :return: """ confObj = read_conf(path.join(BASE_DIR, "conf", "conf.ini")) confHK = confObj["HIKVISION_" + place_no] f = HKCManage(confHK.place, confHK.ip, eval(confHK.port), confHK.user, confHK.pwd) f.get_screenshot(carNo)
def videotape_seconds(place_no, carNo, t_seconds): """ 录制t_seconds秒 :param place_no: 业务参数-摄像头位置说明 :param carNo: 业务参数-要监控的车号 :param t_seconds: 要录制的时间(秒) :return: """ confObj = read_conf(path.join(BASE_DIR, "conf", "conf.ini")) confHK = confObj["HIKVISION_" + place_no] f = HKCManage(confHK.place, confHK.ip, eval(confHK.port), confHK.user, confHK.pwd) f.videotape_seconds(carNo, t_seconds)
def main(): confObj = read_conf("./conf/conf.ini") # 扇区号 sectorNum = int(confObj.CONF.sectorNum) # 起始块号 bStartBlockNumber = int(confObj.CONF.bStartBlockNumber) # 默认密码 defaultPwd = eval(confObj.CONF.defaultPwd) # 新密码 newPwd = eval(confObj.CONF.newPwd) # dll文件 dllPath = confObj.F3.dllPath # 串口 comNum = int(confObj.F3.comNum) # 波特率 bps = int(confObj.F3.bps) # 卡机地址 cAddr = int(confObj.F3.cAddr) # 初始化 f = F3Manage(dllPath) # 连接com ret = f.connect(comNum=comNum, bps=bps, cAddr=cAddr) if ret != hex(0): return # 检测传感器信息:[49, 49, 49, 48, 48, 48, 49, 48, 48, 48, 48, 48] senserStatusResp, senserStatus = f.getSenserDetail() if senserStatusResp != hex(0): return # 移动卡到射频位置 f.moveToReadyWrite() defaultPwd = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff] newPwdList = [0x1, 0x2, 0x3, 0x4, 0x5, 0x5] # 修改密码 f.changePassword(sectorNum=sectorNum, fWithKeyA=True, oldPwdList=defaultPwd, newPwdList=newPwdList) # cardTxt = f.readSector(sectorNum=1, bStartBlockNumber=1, bBlocksToRead=1) # print(cardTxt) # 断开com连接 f.disconnect()
def main(): confObj = read_conf("./conf/conf.ini") # 扇区号 sectorNum = int(confObj.CONF.sectorNum) # 起始块号 bStartBlockNumber = int(confObj.CONF.bStartBlockNumber) # 默认密码 defaultPwd = eval(confObj.CONF.defaultPwd) # 新密码 newPwd = eval(confObj.CONF.newPwd) # dll文件 dllPath = confObj.F2.dllPath # 串口 comNum = int(confObj.F2.comNum) # 波特率 bps = int(confObj.F2.bps) # 卡机地址 cAddr = int(confObj.F2.cAddr) # 初始化 f = F2Manage(dllPath) # 连接com ret = f.connect(comNum=comNum, bps=bps, cAddr=cAddr) if ret != hex(0): return # 初始化卡内容.回收卡,默认密码即发卡时修改后的密码 f.initCard(sectorNum=sectorNum, bStartBlockNumber=bStartBlockNumber, defaultPwd=newPwd, newPwdList=defaultPwd) # 弹出卡 f.moveToOut() # 断开com连接 f.disconnect()
# coding:utf8 import sys, json, time from tools.JuYingManage import JuYingManage from ez_utils import read_conf confObj = read_conf("./conf/conf.ini") # 聚英继电器控制相关 confObjJuYing = confObj.JuYing def consoleLog(*args): print(*args) def workON(switchNum): """ 指令on:开启某路开关 :param switchNum: :return: """ # 初始化 f = JuYingManage(confObjJuYing) # 连接 ret = f.connect() if ret != 0: consoleLog("*", "连接设备失败") return # 打开开关 if switchNum == 0: