资源简介
标准PelcoD协议C#源码,不必造轮子,直接调用岂不更方便.
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace VWMS.CommonClass
{
class PelcoD
{
private string watchdir = ““;//监控方向
private static readonly byte STX = 0xFF;//同步字节
#region 监控方向和定时监控实体
public string WatchDir
{
get
{
return watchdir;
}
set
{
watchdir = value;
}
}
#endregion
#region 基本指令定义
#region 指令码1
private const byte FocusNear = 0x01;//增加聚焦
private const byte IrisOpen = 0x02;//减小光圈
private const byte IrisClose = 0x04;//增加光圈
private const byte CameraOnOff = 0x08;//摄像机打开和关闭
private const byte AutoManualScan = 0x10;//自动和手动扫描
private const byte Sense = 0x80;//Sence码
#endregion
#region 指令码2
private const byte PanRight = 0x02;//右
private const byte PanLeft = 0x04;//左
private const byte TiltUp = 0x08;//上
private const byte TiltDown = 0x10;//下
private const byte ZoomTele = 0x20;//增加对焦
private const byte ZoomWide = 0x40;//减小对焦
private const byte FocusFar = 0x80;//减小聚焦
#endregion
#region 镜头左右平移的速度
private const byte PanSpeedMin = 0x00;//停止
private const byte PanSpeedMax = 0xFF;//最高速
#endregion
#region 镜头上下移动的速度
private const byte TiltSpeedMin = 0x00;//停止
private const byte TiltSpeedMax = 0x3F;//最高速
#endregion
#endregion
#region 云台控制枚举
public enum Switch { On = 0x01 Off = 0x02 }//雨刷控制
public enum Focus { Near = FocusNear Far = FocusFar }//聚焦控制
public enum Zoom { Wide = ZoomWide Tele = ZoomTele }//对焦控制
public enum Tilt { Up = TiltUp Down = TiltDown }//上下控制
public enum Pan { Left = PanLeft Right = PanRight }//左右控制
public enum Scan { Auto Manual }//自动和手动控制
public enum Iris { Open = IrisOpen Close = IrisClose }//光圈控制
#endregion
#region 云台控制方法
//雨刷控制
public byte[] CameraSwitch(uint deviceAddress Switch action)
{
byte m_action = CameraOnOff;
if (action == Switch.On)
m_action = CameraOnOff + Sense;
return Message.GetMessage(deviceAddress m_action 0x00 0x00 0x00);
}
//光圈控制
public byte[] CameraIrisSwitch(uint deviceAddress Iris action)
{
return Message.GetMessage(deviceAddress (byte)action 0x00 0x0
- 上一篇:C#文件加密解密完整项目
- 下一篇:STK与C#联合编程
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- 语音播报系统叫号系统的
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论