using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkDriver.ModbusTcpMaster;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices.Plc
{
///
///
///
public class PlcToHost
{
public ModbusProperty ProtocolVersion1 { get; set; } = new(40201); // 协议版本
public ModbusProperty ProtocolVersion2 { get; set; } = new(40202); // 协议版本
public ModbusProperty ProtocolVersion3 { get; set; } = new(40203); // 协议版本
///
/// 通讯诊断 站控PC心跳(0、1 跳变)
///
public ModbusProperty CommunicationDiagnosis { get; set; } = new(40204);
///
/// 模式状态
/// 0:无效值
/// 1000:手动模式
/// 1010:自动模式
///
public ModbusProperty ModeControl { get; set; } = new(40205);
///
/// 设备系统状态
///
public ModbusProperty DeviceSystemStatus { get; set; } = new(40206);
//public ModbusProperty type00 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT0:复位
//public ModbusProperty type01 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT1:启动
//public ModbusProperty type02 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT2:暂停
//public ModbusProperty type03 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT3:急停
//public ModbusProperty type04 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT4:
//public ModbusProperty type05 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT5:整站断电
//public ModbusProperty type06 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT6:自动运行中
//public ModbusProperty type07 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT7:PLC停机报警
//public ModbusProperty type08 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT8:PLC提示预警
///
/// 遥本控状态
/// 0:无效值
/// 1000:本地控制
/// 1010:远程控制
///
public ModbusProperty RemoteLocalControlState { get; set; } = new(40207);
///
/// 灯光状态
/// 0:无状态
/// 1000:已全部打开
/// 1010:已全部关闭
///
public ModbusProperty LightStatus { get; set; } = new(40208);
///
/// 排风扇状态
/// 0:无状态
/// 1000:已全部打开
/// 1010:已全部关闭
///
public ModbusProperty ExhaustFanStatus { get; set; } = new(40209);
///
/// 站内积水状态
/// BIT0:积水预警
/// BIT1:积水报警
///
public ModbusProperty WaterStatusStation { get; set; } = new(40210);
///
/// 备用
///
public ModbusProperty value09 { get; set; } = new(40211, length: 30);
#region 舱位状态 bit0:有料检测 Bit1:有料检测开关故障
public ModbusProperty MaterialDetec01 { get; set; } = new(40241,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec02 { get; set; } = new(40242,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec03 { get; set; } = new(40243,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec04 { get; set; } = new(40244,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec05 { get; set; } = new(40245,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec06 { get; set; } = new(40246,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec07 { get; set; } = new(40247,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec08 { get; set; } = new(40248,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec09 { get; set; } = new(40249,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec10 { get; set; } = new(40250,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec11 { get; set; } = new(40251,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec12 { get; set; } = new(40252,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec13 { get; set; } = new(40253,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec14 { get; set; } = new(40254,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec15 { get; set; } = new(40255,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec16 { get; set; } = new(40256,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec17 { get; set; } = new(40257,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec18 { get; set; } = new(40258,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec19 { get; set; } = new(40259,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetec20 { get; set; } = new(40260,0,0,ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault01 { get; set; } = new(40241, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault02 { get; set; } = new(40242, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault03 { get; set; } = new(40243, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault04 { get; set; } = new(40244, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault05 { get; set; } = new(40245, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault06 { get; set; } = new(40246, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault07 { get; set; } = new(40247, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault08 { get; set; } = new(40248, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault09 { get; set; } = new(40249, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault10 { get; set; } = new(40250, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault11 { get; set; } = new(40251, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault12 { get; set; } = new(40252, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault13 { get; set; } = new(40253, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault14 { get; set; } = new(40254, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault15 { get; set; } = new(40255, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault16 { get; set; } = new(40256, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault17 { get; set; } = new(40257, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault18 { get; set; } = new(40258, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault19 { get; set; } = new(40259, 0, 0, ModbusDataType.Bit);
public ModbusProperty MaterialDetecSwitchFault20 { get; set; } = new(40260, 0, 0, ModbusDataType.Bit);
#endregion 舱位状态
///
/// 备用
///
public ModbusProperty value11 { get; set; } = new(40281, length: 20);
///
/// 载行车设备状态
/// 0:无效值
/// 1000:待机中
/// 1001:定位识别中
/// 1100:取电池中
/// 1101:取电池完成
/// 1102:取电池动作故障
/// 1200:放电池中
/// 1201:放电池完成
/// 1202:放电池动作故障
///
public ModbusProperty CarStatus { get; set; } = new(40301);
public ModbusProperty value13 { get; set; } = new(40302); // 备用
public ModbusProperty value14 { get; set; } = new(40303); // 备用
public ModbusProperty value15 { get; set; } = new(40304); // 备用
public ModbusProperty value16 { get; set; } = new(40305); // 备用
///
/// x轴扭矩百分比
///
public ModbusProperty PercentageTorqueX { get; set; } = new(40306);
///
/// y轴扭矩百分比
///
public ModbusProperty PercentageTorqueY { get; set; } = new(40307);
///
/// z轴扭矩百分比
///
public ModbusProperty PercentageTorqueZ { get; set; } = new(40308);
public ModbusProperty value20 { get; set; } = new(40309, length: 92); // 备用
///
/// 入口雷达状态
/// 0:未触发
/// 1000:感应触发
///
public ModbusProperty RadarStatesIn { get; set; } = new(40401);
///
/// 出口雷达状态
/// 0:未触发
/// 1000:感应触发
///
public ModbusProperty RadarStatesOut { get; set; } = new(40402);
///
/// 到位光电信号
/// 1000:到位
/// 其它值:未到位
///
public ModbusProperty SpotPhotoelectricSignal { get; set; } = new(40403);
///
/// 实体按钮状态
/// 0:无状态
/// 1000:已拍按钮
///
public ModbusProperty PhysicalButtonState { get; set; } = new(40404);
///
/// 三色灯控制通道状态(入口)
/// 0:无颜色
/// 1000:绿灯
/// 1010:绿灯闪烁
/// 1020:红灯
/// 1030:红灯闪烁
/// 1040:黄灯
/// 1050:黄灯闪烁
/// 1100:所有灯亮
///
public ModbusProperty LightIn { get; set; } = new(40405);
///
/// 三色灯控制通道状态(出口)
/// 0:无颜色
/// 1000:绿灯
/// 1010:绿灯闪烁
/// 1020:红灯
/// 1030:红灯闪烁
/// 1040:黄灯
/// 1050:黄灯闪烁
/// 1100:所有灯亮
///
public ModbusProperty LightOut { get; set; } = new(40406);
///
/// 任务类型状态(是否允许允许执行任务)
/// 0.无任务 (不允许换电)
/// 1.换电任务
/// 2.移舱任务
/// 3.移出任务
/// 4.移入任务
/// 5.消防任务
///
public ModbusProperty TaskType { get; set; } = new(40407);
///
/// 任务状态
/// 0:无效值
/// 1000:准备中(Not Ready)
/// 1001:待机中(Ready)
/// 1002:电池拆卸中
/// 1003:电池入库搬运中
/// 1004:电池出库搬运中
/// 1005:电池安装中
/// 1006:电池安装完成
/// 1007:航车回归至安全位置
/// 1008: 缓存-放仓位, 移仓状态
/// 1100:消防任务 执行中
/// 1101:消防任务 出现异常
/// 1200:移仓任务 执行中
/// 1201:移仓任务 出现异常
/// 9000:任务完成
///
public ModbusProperty TaskStates { get; set; } = new(40408);
///
/// 执行任务行车号
///
public ModbusProperty OperationalTrainNumber { get; set; } = new(40409);
///
/// 通道定位状态
/// 0:无效值
/// 1000;拍照OK
/// 1010;拍照NG
/// 1020;拍照超限,请移车
///
public ModbusProperty ChannelLocationState { get; set; } = new(40410);
///
/// x偏差
///
public ModbusProperty DeviationX { get; set; } = new(40411);
///
/// y偏差
///
public ModbusProperty DeviationY { get; set; } = new(40412);
///
/// z偏差
///
public ModbusProperty DeviationZ { get; set; } = new(40413);
public ModbusProperty value44 { get; set; } = new(40414, length: 7); // 备用
}
}