文件名称调整,网络通信信号头优化,个人信息界面文件支持双击下载,v1.4.2

This commit is contained in:
dathlin
2017-09-20 12:20:37 +08:00
parent cad8cd3de4
commit 51ed4031c5
9 changed files with 277 additions and 234 deletions

View File

@@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HslCommunication;
namespace CommonLibrary
{
/*********************************************************************************************
*
* 说明:用于同步网络和异步网络的各种消息头的区别。
*
* 关于 NetHandle
* 一个数据结构值无论实际数据还是用法上等同于int可以和int数据无缝的转化
* 将4个字节的int数据拆分成了三个属性一个ushort和两个byte可以分别访问
*
* 2个低字节 第二高字节 最高的字节
* [byte1][byte2] [byte3] [byte4]
* CodeIdentifier CodeMinor CodeMajor
*
*********************************************************************************************/
/// <summary>
/// 用于网络通信的二级协议头说明
/// </summary>
public class CommonHeadCode
{
/// <summary>
/// 同步通信的指令头说明从1.1.x到1.255.x
/// </summary>
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Auto)]
public class SimplifyHeadCode
{
/*******************************************************************************************
*
* 1.1.* 的指令为系统相关
*
*******************************************************************************************/
public static NetHandle { get; } = new NetHandle(1, 1, 00001);
public static NetHandle { get; } = new NetHandle(1, 1, 00002);
public static NetHandle { get; } = new NetHandle(1, 1, 00003);
public static NetHandle { get; } = new NetHandle(1, 1, 00004);
public static NetHandle { get; } = new NetHandle(1, 1, 00005);
public static NetHandle { get; } = new NetHandle(1, 1, 00006);
public static NetHandle { get; } = new NetHandle(1, 1, 00007);
public static NetHandle { get; } = new NetHandle(1, 1, 00008);
public static NetHandle { get; } = new NetHandle(1, 1, 00009);
public static NetHandle { get; } = new NetHandle(1, 1, 00010);
public static NetHandle { get; } = new NetHandle(1, 1, 00011);
public static NetHandle { get; } = new NetHandle(1, 1, 00012);
public static NetHandle { get; } = new NetHandle(1, 1, 00013);
public static NetHandle { get; } = new NetHandle(1, 1, 00014);
public static NetHandle { get; } = new NetHandle(1, 1, 00015);
public static NetHandle MD5 { get; } = new NetHandle(1, 1, 00016);
public static NetHandle { get; } = new NetHandle(1, 1, 00017);
public static NetHandle { get; } = new NetHandle(1, 1, 00018);
/*******************************************************************************************
*
* 1.2.* 的指令为日志的请求与查看相关
*
*******************************************************************************************/
public static NetHandle { get; } = new NetHandle(1, 2, 00001);//1.2.开头的是日志请求和清空
public static NetHandle { get; } = new NetHandle(1, 2, 00002);
public static NetHandle { get; } = new NetHandle(1, 2, 00003);
public static NetHandle { get; } = new NetHandle(1, 2, 00004);
public static NetHandle { get; } = new NetHandle(1, 2, 00005);
public static NetHandle { get; } = new NetHandle(1, 2, 00006);
public static NetHandle { get; } = new NetHandle(1, 2, 00007);
public static NetHandle { get; } = new NetHandle(1, 2, 00008);
public static NetHandle { get; } = new NetHandle(1, 2, 00009);
public static NetHandle { get; } = new NetHandle(1, 2, 00010);
public static NetHandle { get; } = new NetHandle(1, 2, 00011);
public static NetHandle { get; } = new NetHandle(1, 2, 00012);
public static NetHandle UDP日志查看 { get; } = new NetHandle(1, 2, 00013);
public static NetHandle UDP日志清空 { get; } = new NetHandle(1, 2, 00014);
public static NetHandle { get; } = new NetHandle(1, 2, 00015);
public static NetHandle { get; } = new NetHandle(1, 2, 00016);
public static NetHandle { get; } = new NetHandle(1, 2, 00017);
public static NetHandle { get; } = new NetHandle(1, 2, 00018);
/**************************************************************************************
*
* 为了保证您的指令头不和系统的冲突您的指令头应该以1.3.x及之后开头
*
**************************************************************************************/
}
/// <summary>
/// 异步通信的头说明从2.1.x到2.255.x
/// </summary>
public class MultiNetHeadCode
{
/*******************************************************************************************
*
* 2.1.* 的指令为异步网络的系统相关指令
*
*******************************************************************************************/
public static NetHandle 线 { get; } = new NetHandle(2, 1, 00001);
public static NetHandle { get; } = new NetHandle(2, 1, 00002);
public static NetHandle { get; } = new NetHandle(2, 1, 00003);
public static NetHandle { get; } = new NetHandle(2, 1, 00004);
public static NetHandle { get; } = new NetHandle(2, 1, 00005);
public static NetHandle { get; } = new NetHandle(2, 1, 00006);
public static NetHandle { get; } = new NetHandle(2, 1, 00007);
/**************************************************************************************
*
* 为了保证您的指令头不和系统的冲突您的指令头应该以2.2.x 2.3.x开头
*
**************************************************************************************/
}
//可以在下面进行扩展,需要保证长度都是统一的,新建您自己的类型 可以用3.1.x 4.1.x开头的指令
}
}