唐山轨道机控制端TCP服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
7.9 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Guidaoji
{
internal class GuiDaoJi
{
/// <summary>
/// 轨道电机控制器编号
/// </summary>
public string uid { get; set; }
/// <summary>
/// 动作类别
/// </summary>
public string action { get; set; }
/// <summary>
/// 时间
/// </summary>
public string date { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string name { get; set; } = "CA";
/// <summary>
/// 主动上报时间间隔
/// 0:不上传,1...n默认2s,单位:秒主动上报时间间隔,0:不上传,1...n默认2s,单位:秒
/// </summary>
public int send_gap { get; set; }
/// <summary>
/// 0,不执行命令 1为执行命令
/// </summary>
public int cont { get; set; }
/// <summary>
/// 位置复位
/// 0:不操作,1:复位到原点
/// </summary>
public int @return { get; set; }
/// <summary>
/// 故障复位
/// 0:不操作,1:故障复位
/// </summary>
public int reset { get; set; }
/// <summary>
/// 灯光状态
/// 0为关,1为红灯,2为红灯闪烁,3为绿灯,4为绿灯闪烁,5为黄灯,6为黄灯闪烁
/// </summary>
public int lamp { get; set; }
/// <summary>
/// 0 不执行行走 1 为执行行走
/// </summary>
public int move { get; set; }
/// <summary>
/// 运行速度
/// 0为停止,1-10为低速运行等级,11-20为高速运行等级
/// </summary>
public double rate { get; set; }
/// <summary>
/// 指定摄像机x轴坐标,单位cm,在轨道的距离
/// </summary>
public string x { get; set; }
/// <summary>
/// 指定摄像机Y轴坐标,单位cm,推杆退出的距离
/// </summary>
public string y { get; set; }
/// <summary>
/// 0 不播报语音 1 播报语音
/// </summary>
public int voice { get; set; }
/// <summary>
/// 语音播放内容
/// </summary>
public string @string { get; set; }
}
internal class GuiDaoJiRet
{
/// <summary>
/// 轨道电机控制器编号
/// </summary>
public string uid { get; set; }
/// <summary>
/// 动作类别
/// </summary>
public string action { get; set; }
/// <summary>
/// 时间
/// </summary>
public string date { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public retData data { get; set; } = new retData();
/// <summary>
/// 返回结果
/// </summary>
public string result { get; set; }
}
public class retData
{
/// <summary>
/// 设备名称
/// </summary>
public string name { get; set; } = "轨道电机控制";
/// <summary>
/// 主动上报时间间隔
/// 0:不上传,1...n默认2s,单位:秒主动上报时间间隔,0:不上传,1...n默认2s,单位:秒
/// </summary>
public int send_gap { get; set; } = 2;
/// <summary>
/// 轨道机启停状态【0——停;1——前进中;2——后退中;3——下降中;4——上升中】
/// </summary>
public string type { get; set; } = "1";
/// <summary>
/// 灯光状态
/// 0为关,1为红灯,2为红灯闪烁,3为绿灯,4为绿灯闪烁,5为黄灯,6为黄灯闪烁
/// </summary>
public int lamp { get; set; } = 2;
/// <summary>
/// 运行速度
/// 0为停止,1-10为低速运行等级,11-20为高速运行等级
/// </summary>
public string rate { get; set; }
/// <summary>
/// 指定摄像机x轴坐标,单位cm,在轨道的距离
/// </summary>
public string x { get; set; }
/// <summary>
/// 指定摄像机Y轴坐标,单位cm,推杆退出的距离
/// </summary>
public string y { get; set; }
/// <summary>
/// 终端供电电压,单位V
/// </summary>
public string vol { get; set; }
/// <summary>
/// 终端工作电流,单位A
/// </summary>
public string cur { get; set; }
/// <summary>
/// 故障
/// </summary>
public int[] alarm { get; set; }
}
public class GuiDaoJiSet
{
/// <summary>
/// 轨道电机控制器编号
/// </summary>
public string uid { get; set; }
/// <summary>
/// 动作类别
/// </summary>
public string action { get; set; }
/// <summary>
/// 时间
/// </summary>
public string date { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string name { get; set; } = "CA";
/// <summary>
/// 主动上报时间间隔
/// 0:不上传,1...n默认2s,单位:秒主动上报时间间隔,0:不上传,1...n默认2s,单位:秒
/// </summary>
public int send_gap { get; set; }
/// <summary>
/// 0,不执行命令 1为执行命令
/// </summary>
public int cont { get; set; }
/// <summary>
/// 0,不执行命令 1为执行命令
/// </summary>
public Contda contda { get; set; } = new Contda();
/// <summary>
/// 0 不执行行走 1 为执行行走
/// </summary>
public int move { get; set; }
/// <summary>
/// 数据为数组,数组大小根据分控器数量而定
/// </summary>
public Moveda moveda { get; set; } = new Moveda();
/// <summary>
/// 0 不播报语音 1 播报语音
/// </summary>
public int voice { get; set; }
/// <summary>
/// 数据为数组,数组大小根据分控器数量而定
/// </summary>
//public List<Voiceda> voiceda { get; set; } = new List<Voiceda>();
public Voiceda voiceda { get; set; } = new Voiceda();
}
public class Contda
{
/// <summary>
/// 位置复位
/// 0:不操作,1:复位到原点
/// </summary>
public int @return { get; set; } = 0;
/// <summary>
/// 故障复位
/// 0:不操作,1:故障复位
/// </summary>
public int reset { get; set; }
/// <summary>
/// 灯光状态
/// 0为关,1为红灯,2为红灯闪烁,3为绿灯,4为绿灯闪烁,5为黄灯,6为黄灯闪烁
/// </summary>
public int lamp { get; set; }
}
public class Moveda
{
/// <summary>
/// 运行速度
/// 0为停止,1-10为低速运行等级,11-20为高速运行等级
/// </summary>
public double rate { get; set; }
/// <summary>
/// 指定摄像机x轴坐标,单位cm,在轨道的距离
/// </summary>
public string x { get; set; }
/// <summary>
/// 指定摄像机Y轴坐标,单位cm,推杆退出的距离
/// </summary>
public string y { get; set; }
}
public class Voiceda
{
/// <summary>
/// 语音播放内容
/// </summary>
public string @string { get; set; }
}
public enum ControlCommands
{
F = 'F', //前进
B = 'B', //后退
U = 'U', //上升
D = 'D', //下降
S = 'S', //停止
R = 'R', //位置复位
E = 'E', //故障复位
}
}