From 8a3286edc0188bee12e429afc0b05320abac9605 Mon Sep 17 00:00:00 2001 From: CZ Date: Wed, 15 May 2024 16:38:35 +0800 Subject: [PATCH] =?UTF-8?q?PLC=E8=BF=9E=E6=8E=A5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ModbusTcpMaster/ModbusDecoder.cs | 8 + .../ModbusTcpMaster/ModbusTcpMaster.cs | 2 +- HybirdFrameworkServices/EquipmentInit.cs | 136 +- .../Init/Entity/PlcInfo.cs | 18 +- HybirdFrameworkServices/Plc/HostToPlc.cs | 87 + HybirdFrameworkServices/Plc/PlcFault.cs | 23 + .../Plc/PlcReadAndWrite1.cs | 66 - .../Plc/PlcReadAndWrite2.cs | 68 - HybirdFrameworkServices/Plc/PlcReadonly.cs | 446 --- HybirdFrameworkServices/Plc/PlcToHost.cs | 69 + HybirdFrameworkServices/Plc/PlcTurnsRatio.cs | 291 -- WinFormStarter/Form2.cs | 3 +- WinFormStarter/Form2.resx | 120 + WinFormStarter/FrmPLCConnect.Designer.cs | 2902 ----------------- WinFormStarter/FrmPLCConnect.cs | 648 ---- WinFormStarter/FrmPlc.Designer.cs | 2048 ++++++++++++ WinFormStarter/FrmPlc.cs | 555 ++++ .../{FrmPLCConnect.resx => FrmPlc.resx} | 0 WinFormStarter/WinFormStarter.csproj.user | 2 +- 19 files changed, 2998 insertions(+), 4494 deletions(-) create mode 100644 HybirdFrameworkServices/Plc/HostToPlc.cs create mode 100644 HybirdFrameworkServices/Plc/PlcFault.cs delete mode 100644 HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs delete mode 100644 HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs delete mode 100644 HybirdFrameworkServices/Plc/PlcReadonly.cs create mode 100644 HybirdFrameworkServices/Plc/PlcToHost.cs delete mode 100644 HybirdFrameworkServices/Plc/PlcTurnsRatio.cs create mode 100644 WinFormStarter/Form2.resx delete mode 100644 WinFormStarter/FrmPLCConnect.Designer.cs delete mode 100644 WinFormStarter/FrmPLCConnect.cs create mode 100644 WinFormStarter/FrmPlc.Designer.cs create mode 100644 WinFormStarter/FrmPlc.cs rename WinFormStarter/{FrmPLCConnect.resx => FrmPlc.resx} (100%) diff --git a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs index cad2fff..6406245 100644 --- a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs +++ b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs @@ -11,6 +11,9 @@ public static class ModbusDecoder public static T Decode(byte[] bytes, T t) where T : class, new() { + try + { + List fields = t.GetType().GetProperties() .Where(it => it.PropertyType.GetGenericTypeDefinition() == typeof(ModbusProperty<>)) .Select(p => p.GetValue(t)).ToList(); @@ -109,6 +112,11 @@ public static class ModbusDecoder } } + } + } + catch (Exception ex) + { + } return t; } diff --git a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs index d795efa..3208725 100644 --- a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs +++ b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs @@ -93,7 +93,7 @@ public class ModbusTcpMaster { try { - ReadAction(this); + ReadAction(this); Thread.Sleep(Duration); } catch (Exception e) diff --git a/HybirdFrameworkServices/EquipmentInit.cs b/HybirdFrameworkServices/EquipmentInit.cs index 34abf8a..b18b662 100644 --- a/HybirdFrameworkServices/EquipmentInit.cs +++ b/HybirdFrameworkServices/EquipmentInit.cs @@ -1,4 +1,6 @@ -using HybirdFrameworkCore.Autofac.Attribute; +using HslCommunication.ModBus; +using HslCommunication; +using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkDriver.ModbusTcpMaster; using HybirdFrameworkDriver.TcpServer; using HybirdFrameworkEntity.DbModel; @@ -16,6 +18,7 @@ namespace HybirdFrameworkServices [Scope("SingleInstance")] public class EquipmentInit { + #region BsNetEqmParamInfoRepository _bsNetEqmParamInfoRepository; public EquipmentInit(BsNetEqmParamInfoRepository bsNetEqmParamInfoRepository) { @@ -40,28 +43,6 @@ namespace HybirdFrameworkServices DestAddr = "1", }; - - // //PLC删除 - // IEnumerable> queryConnectParams =; - // _bsNetEqmParamInfoRepository.QueryConnectParams(new List() { 1, 2, 101 }); - // int count = 0; - // IEnumerable> connectParams = - //queryConnectParams as IGrouping[] ?? queryConnectParams.ToArray(); - // foreach (IGrouping device in connectParams) - // { - // Console.WriteLine(device.Key); - // count = device.Key switch - // { - // //1 => ConnectCharger(device), - // //101 => ConnectCharger(device), - // //2 => ConnectWaterCooler(device), - // 3 => ConnectPlc(device), - // _ => - // // 处理所有其他情况,可能抛出异常、记录日志或返回默认值 - // throw new InvalidOperationException("Unknown device key: " + device.Key), - // }; - // } - ConnectPlc(bsNetEqmParamInfo); } @@ -72,17 +53,15 @@ namespace HybirdFrameworkServices /// public int ConnectPlc(/*IGrouping param*/ BsNetEqmParamInfo p) { - /*int connectNum = 0; - foreach (var p in param) - { - connectNum++;*/ - Thread thread = new Thread(() => ConnectPlcAsync(p)); thread.Start(); - /*}*/ return 0; } + /// + /// 连接PLC + /// + /// private void ConnectPlcAsync(BsNetEqmParamInfo p) { bool connected = false; @@ -94,12 +73,11 @@ namespace HybirdFrameworkServices master = new ModbusTcpMaster() { - Ip = "127.0.0.1", - Port = 102, + Ip = "172.0.20.66", + Port = 502, }; master.ReadAction = BatchReadPlc;//启动线程一直读 master.Duration = 3000; - master.Duration = 3000; connected = master.Connect(); if (connected) @@ -111,6 +89,7 @@ namespace HybirdFrameworkServices } ModbusSession modbusSession = new ModbusSession(master); + master.connectId = master.Ip + master.Port; SessionMgr.RegisterModbusSession(master.connectId, modbusSession); SessionMgr.SetAttrModbus(modbusSession, "eqm_sn", p.EqmSn); PlcInfo waterColdInfo = new PlcInfo(master.connectId, p.EqmSn); @@ -121,45 +100,72 @@ namespace HybirdFrameworkServices */ private static void BatchReadPlc(ModbusTcpMaster master) { - int sn = (int)SessionMgr.GetAttrModbus(master.connectId, "eqm_sn"); - - ChargerStaticInfo.PlcInfos.TryGetValue(sn, out PlcInfo plcInfo); - if (plcInfo == null) + while (true) { - return; - } + int sn = 3;//(int)SessionMgr.GetAttrModbus(master.connectId, "eqm_sn"); - byte[]? bytes01 = master.BatchRead(0, 22); - if (bytes01 != null) - { - ModbusDecoder.DecodeByT(bytes01, plcInfo.PlcReadAndWritten2); - } - byte[]? bytes02 = master.BatchRead(256, 170); - if (bytes02 != null) - { - ModbusDecoder.DecodeByT(bytes02, plcInfo.PlcReadonly); - } - byte[]? bytes03 = master.BatchRead(39424, 108); - if (bytes03 != null) - { - ModbusDecoder.DecodeByT(bytes03, plcInfo.PlcTurnsRatio); - } + ChargerStaticInfo.PlcInfos.TryGetValue(sn, out PlcInfo plcInfo); + if (plcInfo != null) + { + var bytes01 = master.BatchRead(1, 115); + if (bytes01 != null) + { + ModbusDecoder.Decode(bytes01, plcInfo.hostToPlc); + } + var bytes02 = master.BatchRead(201, 222); + if (bytes02 != null) + { + ModbusDecoder.Decode(bytes02, plcInfo.plcToHost); + } + var bytes03 = master.BatchRead(701, 10); + if (bytes03 != null) + { + ModbusDecoder.Decode(bytes03, plcInfo.plcFault); + } + //OperateResult result2 = ModbusTcpNet.Read("x=3;201", 222); - byte[]? bytes04 = master.BatchRead(40960, 3);//写编程使能。本机modbus地址。波特率 - byte[]? bytes05 = master.BatchRead(2566, 1);//校验位 - byte[]? bytes06 = master.BatchRead(42, 1);//秒脉冲/无功电能选择 - byte[]? bytes07 = master.BatchRead(48, 1);//电流接线反向 - byte[]? bytes08 = master.BatchRead(4576, 1);//电表清零 + } + /* + if (plcInfo != null) + { + byte[]? bytes01 = master.BatchRead(0, 22); + if (bytes01 != null) + { + ModbusDecoder.DecodeByT(bytes01, plcInfo.PlcReadAndWritten2); + } + byte[]? bytes02 = master.BatchRead(256, 170); + if (bytes02 != null) + { + ModbusDecoder.DecodeByT(bytes02, plcInfo.PlcReadonly); + } + byte[]? bytes03 = master.BatchRead(39424, 108); + if (bytes03 != null) + { + ModbusDecoder.DecodeByT(bytes03, plcInfo.PlcTurnsRatio); + } + + byte[]? bytes04 = master.BatchRead(40960, 3);//写编程使能。本机modbus地址。波特率 + byte[]? bytes05 = master.BatchRead(2566, 1);//校验位 + byte[]? bytes06 = master.BatchRead(42, 1);//秒脉冲/无功电能选择 + byte[]? bytes07 = master.BatchRead(48, 1);//电流接线反向 + byte[]? bytes08 = master.BatchRead(4576, 1);//电表清零 + + if (bytes04 != null) + { + ModbusDecoder.DecodeByT(bytes04, plcInfo.PlcReadAndWritten1); + } + plcInfo.PlcReadAndWritten1.CheckBit = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes05, 0); + plcInfo.PlcReadAndWritten1.PulsePerSecond = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes06, 0); + plcInfo.PlcReadAndWritten1.CurrentReversal = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes07, 0); + plcInfo.PlcReadAndWritten1.MeterReset = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes08, 0); + + } + */ - if (bytes04 != null) - { - ModbusDecoder.DecodeByT(bytes04, plcInfo.PlcReadAndWritten1); } - plcInfo.PlcReadAndWritten1.CheckBit = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes05, 0); - plcInfo.PlcReadAndWritten1.PulsePerSecond = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes06, 0); - plcInfo.PlcReadAndWritten1.CurrentReversal = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes07, 0); - plcInfo.PlcReadAndWritten1.MeterReset = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes08, 0); } + + #endregion PLC } } diff --git a/HybirdFrameworkServices/Init/Entity/PlcInfo.cs b/HybirdFrameworkServices/Init/Entity/PlcInfo.cs index 8ebc716..71d4d3b 100644 --- a/HybirdFrameworkServices/Init/Entity/PlcInfo.cs +++ b/HybirdFrameworkServices/Init/Entity/PlcInfo.cs @@ -56,10 +56,10 @@ namespace HybirdFrameworkServices.Init.Entity public int EqmSn; - public PlcReadAndWrite1 PlcReadAndWritten1 { get; set; } - public PlcReadAndWrite2 PlcReadAndWritten2 { get; set; } - public PlcReadonly PlcReadonly { get; set; } - public PlcTurnsRatio PlcTurnsRatio { get; set; } + public HostToPlc hostToPlc=new HostToPlc(); + public PlcToHost plcToHost =new PlcToHost(); + public PlcFault plcFault = new PlcFault(); + public PlcInfo(string channelId, int eqmSn) { @@ -67,12 +67,20 @@ namespace HybirdFrameworkServices.Init.Entity EqmSn = eqmSn; } - public bool WriteUint16(string addr, ModbusProperty value) + public bool WriteUint16(ModbusProperty value) { bool bResult = false; ModbusSession session = SessionMgr.GetModbusSession(ChannelId); bResult = session.Write(value); return bResult; } + + public bool Writeint16(ModbusProperty value) + { + bool bResult = false; + ModbusSession session = SessionMgr.GetModbusSession(ChannelId); + bResult = session.Write(value); + return bResult; + } } } diff --git a/HybirdFrameworkServices/Plc/HostToPlc.cs b/HybirdFrameworkServices/Plc/HostToPlc.cs new file mode 100644 index 0000000..88eae77 --- /dev/null +++ b/HybirdFrameworkServices/Plc/HostToPlc.cs @@ -0,0 +1,87 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkDriver.ModbusTcpMaster; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Plc +{ + public class HostToPlc + { + public ModbusProperty ProtocolVersion1 { get; set; } = new(40001); // 协议版本 + public ModbusProperty ProtocolVersion2 { get; set; } = new(40002); // 协议版本 + public ModbusProperty ProtocolVersion3 { get; set; } = new(40003); // 协议版本 + public ModbusProperty CommunicationDiagnosis { get; set; } = new(40004); // 通讯诊断 + public ModbusProperty ModeControl { get; set; } = new(40005); // 模式控制 + public ModbusProperty EquipmentControl { get; set; } = new(40006); // 设备控制 + public ModbusProperty ExhaustFanControl { get; set; } = new(40007); // 排风扇控制 + public ModbusProperty LightingControl { get; set; } = new(40008); // 灯光控制 + public ModbusProperty Standby1 { get; set; } = new(40009); // 备用 + public ModbusProperty Standby2 { get; set; } = new(40010); // 备用 + public ModbusProperty Seconds { get; set; } = new(40011); // 对时时钟:秒 + public ModbusProperty Points { get; set; } = new(40012); // 对时时钟:分 + public ModbusProperty Hour { get; set; } = new(40013); // 对时时钟:时 + public ModbusProperty Day { get; set; } = new(40014); // 对时时钟:天 + public ModbusProperty Month { get; set; } = new(40015); // 对时时钟:月 + public ModbusProperty Years { get; set; } = new(40016); // 对时时钟:年 + public ModbusProperty Standby3 { get; set; } = new(40017, length: 4); // 备用3 + public ModbusProperty ChargingStatus { get; set; } = new(40021, length: 40); // 仓位充电状态 + public ModbusProperty ChargingStatus01 { get; set; } = new(40021); // 仓位充电状态 + public ModbusProperty ChargingStatus02 { get; set; } = new(40022); // 仓位充电状态 + public ModbusProperty ChargingStatus03 { get; set; } = new(40023); // 仓位充电状态 + public ModbusProperty ChargingStatus04 { get; set; } = new(40024); // 仓位充电状态 + public ModbusProperty ChargingStatus05 { get; set; } = new(40025); // 仓位充电状态 + public ModbusProperty ChargingStatus06 { get; set; } = new(40026); // 仓位充电状态 + public ModbusProperty ChargingStatus07 { get; set; } = new(40027); // 仓位充电状态 + public ModbusProperty ChargingStatus08 { get; set; } = new(40028); // 仓位充电状态 + public ModbusProperty ChargingStatus09 { get; set; } = new(40029); // 仓位充电状态 + public ModbusProperty ChargingStatus10 { get; set; } = new(40030); // 仓位充电状态 + public ModbusProperty ChargingStatus11 { get; set; } = new(40031); // 仓位充电状态 + public ModbusProperty ChargingStatus12 { get; set; } = new(40032); // 仓位充电状态 + public ModbusProperty ChargingStatus13 { get; set; } = new(40033); // 仓位充电状态 + public ModbusProperty ChargingStatus14 { get; set; } = new(40034); // 仓位充电状态 + public ModbusProperty ChargingStatus15 { get; set; } = new(40035); // 仓位充电状态 + public ModbusProperty ChargingStatus16 { get; set; } = new(40036); // 仓位充电状态 + public ModbusProperty ChargingStatus17 { get; set; } = new(40037); // 仓位充电状态 + public ModbusProperty ChargingStatus18 { get; set; } = new(40038); // 仓位充电状态 + public ModbusProperty ChargingStatus19 { get; set; } = new(40039); // 仓位充电状态 + public ModbusProperty ChargingStatus20 { get; set; } = new(40040); // 仓位充电状态 + public ModbusProperty BatteryType { get; set; } = new(40061, length: 40); // 仓位所在电池型号 + + public ModbusProperty BatteryType01 { get; set; } = new(40061); // 仓位所在电池型号 + public ModbusProperty BatteryType02 { get; set; } = new(40062); // 仓位所在电池型号 + public ModbusProperty BatteryType03 { get; set; } = new(40063); // 仓位所在电池型号 + public ModbusProperty BatteryType04 { get; set; } = new(40064); // 仓位所在电池型号 + public ModbusProperty BatteryType05 { get; set; } = new(40065); // 仓位所在电池型号 + public ModbusProperty BatteryType06 { get; set; } = new(40066); // 仓位所在电池型号 + public ModbusProperty BatteryType07 { get; set; } = new(40067); // 仓位所在电池型号 + public ModbusProperty BatteryType08 { get; set; } = new(40068); // 仓位所在电池型号 + public ModbusProperty BatteryType09 { get; set; } = new(40069); // 仓位所在电池型号 + public ModbusProperty BatteryType10 { get; set; } = new(40070); // 仓位所在电池型号 + public ModbusProperty BatteryType11 { get; set; } = new(40071); // 仓位所在电池型号 + public ModbusProperty BatteryType12 { get; set; } = new(40072); // 仓位所在电池型号 + public ModbusProperty BatteryType13 { get; set; } = new(40073); // 仓位所在电池型号 + public ModbusProperty BatteryType14 { get; set; } = new(40074); // 仓位所在电池型号 + public ModbusProperty BatteryType15 { get; set; } = new(40075); // 仓位所在电池型号 + public ModbusProperty BatteryType16 { get; set; } = new(40076); // 仓位所在电池型号 + public ModbusProperty BatteryType17 { get; set; } = new(40077); // 仓位所在电池型号 + public ModbusProperty BatteryType18 { get; set; } = new(40078); // 仓位所在电池型号 + public ModbusProperty BatteryType19 { get; set; } = new(40079); // 仓位所在电池型号 + public ModbusProperty BatteryType20 { get; set; } = new(40080); // 仓位所在电池型号 + + public ModbusProperty VehicleParkingLocation { get; set; } = new(40101); // 车辆驻车位置 + public ModbusProperty VehicleParkingStatus { get; set; } = new(40102); // 车辆驻车状态 + public ModbusProperty LightIn { get; set; } = new(40103); // "三色灯控制整站状态(入口)" + public ModbusProperty LightOut { get; set; } = new(40104); // "三色灯控制整站状态(出口)" + public ModbusProperty StopCommand { get; set; } = new(40105); // 电池包锁止异常,暂停命令 + public ModbusProperty Standby4 { get; set; } = new(40106, length: 5); // 备用4 + public ModbusProperty TaskType { get; set; } = new(40111); // 任务类型 + public ModbusProperty EntrySelection { get; set; } = new(40112); // 入仓位选择 + public ModbusProperty ExitSelection { get; set; } = new(40113); // 出仓仓位选择 + public ModbusProperty BatteryPackType { get; set; } = new(40114); // 电池包类型 + public ModbusProperty TaskEnablement { get; set; } = new(40115); // 任务使能 + + } +} diff --git a/HybirdFrameworkServices/Plc/PlcFault.cs b/HybirdFrameworkServices/Plc/PlcFault.cs new file mode 100644 index 0000000..0b35d9a --- /dev/null +++ b/HybirdFrameworkServices/Plc/PlcFault.cs @@ -0,0 +1,23 @@ +using HybirdFrameworkDriver.ModbusTcpMaster; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Plc +{ + public class PlcFault + { + public ModbusProperty ErrorCode01 { get; set; } = new(40701); // 错误码 + public ModbusProperty ErrorCode02 { get; set; } = new(40702); // 错误码 + public ModbusProperty ErrorCode03 { get; set; } = new(40703); // 错误码 + public ModbusProperty ErrorCode04 { get; set; } = new(40704); // 错误码 + public ModbusProperty ErrorCode05 { get; set; } = new(40705); // 错误码 + public ModbusProperty ErrorCode06 { get; set; } = new(40706); // 错误码 + public ModbusProperty ErrorCode07 { get; set; } = new(40707); // 错误码 + public ModbusProperty ErrorCode08 { get; set; } = new(40708); // 错误码 + public ModbusProperty ErrorCode09 { get; set; } = new(40709); // 错误码 + public ModbusProperty ErrorCode10 { get; set; } = new(40710); // 错误码 + } +} diff --git a/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs b/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs deleted file mode 100644 index 9b51cf8..0000000 --- a/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs +++ /dev/null @@ -1,66 +0,0 @@ -using HybirdFrameworkCore.Autofac.Attribute; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HybirdFrameworkServices.Plc -{ - /// - /// 可读可写区 - /// - public class PlcReadAndWrite1 - { - /// - /// 写编程使能 写 0x5AA5,打开写使能 - /// - [Property(0, 2, PropertyReadConstant.Byte)] - public ushort ProgrammingEnable { get; set; } - /// - /// 本机modbus地址 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Modbus1Addres { get; set; } - /// - /// 波特率 - /// 0:1200 - /// 1:2400 - /// 2:4800 - /// 3:9600 - /// 4:19200 - /// - [Property(4, 2, PropertyReadConstant.Byte)] - public ushort BaudRate { get; set; } - /// - /// 校验位 - /// 0:无 - /// 1:奇 - /// 2:偶 - /// - //[Property(2, 2, PropertyReadConstant.Byte)] - public ushort CheckBit { get; set; } - - /// - /// 秒脉冲/无功电能选择 - /// 0x5A02:秒脉冲输出 - /// 其他:无功电能输出) - /// - //[Property(2, 2, PropertyReadConstant.Byte)] - public ushort PulsePerSecond { get; set; } - /// - /// 电流接线反向 - /// 0x00:不反接(默认值) - /// 0x01:反接 - /// - //[Property(2, 2, PropertyReadConstant.Byte)] - public ushort CurrentReversal { get; set; } - /// - /// 电表清零 - /// 写 0x0000 清零,其他不清 - /// - //[Property(2, 2, PropertyReadConstant.Byte)] - public ushort MeterReset { get; set; } - - } -} diff --git a/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs b/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs deleted file mode 100644 index 04a9441..0000000 --- a/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs +++ /dev/null @@ -1,68 +0,0 @@ -using HybirdFrameworkCore.Autofac.Attribute; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HybirdFrameworkServices.Plc -{ - public class PlcReadAndWrite2 - { - /// - /// 秒 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Seconds { get; set; } - /// - /// 分 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Points { get; set; } - /// - /// 时 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte When { get; set; } - /// - /// 周 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Weeks { get; set; } - /// - /// 日 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Day { get; set; } - /// - /// 月 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Month { get; set; } - /// - /// 年 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Years { get; set; } - /// - /// 本机modbus地址 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Modbus1Addres2 { get; set; } - /// - /// 保留 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Reserve { get; set; } - /// - /// 电压变比 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort VoltageRatio { get; set; } - /// - /// 电流变比 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort CurrentRatio { get; set; } - } -} diff --git a/HybirdFrameworkServices/Plc/PlcReadonly.cs b/HybirdFrameworkServices/Plc/PlcReadonly.cs deleted file mode 100644 index 60b2bdb..0000000 --- a/HybirdFrameworkServices/Plc/PlcReadonly.cs +++ /dev/null @@ -1,446 +0,0 @@ -using HybirdFrameworkCore.Autofac.Attribute; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HybirdFrameworkServices.Plc -{ - /// - /// 只读数据区 - /// - public class PlcReadonly - { - /// - /// 组合有功总电能 - /// - [Property(0, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupHaveAll { get; set; } - /// - /// 组合有功尖电能 - /// - [Property(4, 4, PropertyReadConstant.Byte, 0.01)] - public float GroupHaveTip { get; set; } - /// - /// 组合有功峰电能 - /// - [Property(8, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupHavePeak { get; set; } - /// - /// 组合有功平电能 - /// - [Property(12, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupHaveFlat { get; set; } - /// - /// 组合有功谷电能 - /// - [Property(16, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupHaveValley { get; set; } - /// - /// 正向有功总电能 - /// - [Property(20, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveAll { get; set; } - /// - /// 正向有功尖电能 - /// - [Property(24, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveTip { get; set; } - /// - /// 正向有功峰电能 - /// - [Property(28, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHavePeak { get; set; } - /// - /// 正向有功平电能 - /// - [Property(32, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveFlat { get; set; } - /// - /// 正向有功谷电能 - /// - [Property(36, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveValley { get; set; } - /// - /// 反向有功总电能 - /// - [Property(40, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveAll { get; set; } - /// - /// 反向有功尖电能 - /// - [Property(44, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveTip { get; set; } - /// - /// 反向有功峰电能 - /// - [Property(48, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHavePeak { get; set; } - /// - /// 反向有功平电能 - /// - [Property(52, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveFlat { get; set; } - /// - /// 反向有功谷电能 - /// - [Property(56, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveValley { get; set; } - /// - /// 组合无功1总电能 - /// - [Property(60, 4, PropertyReadConstant.Byte, 0.01)] - public float GroupNoAll1 { get; set; } - /// - /// 组合无功1尖电能 - /// - [Property(64, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoTip1 { get; set; } - /// - /// 组合无功1峰电能 - /// - [Property(68, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoPeak1 { get; set; } - /// - /// 组合无功1平电能 - /// - [Property(72, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoFlat1 { get; set; } - /// - /// 组合无功1谷电能 - /// - [Property(76, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoValley1 { get; set; } - /// - /// 组合无功2总电能 - /// - [Property(80, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoAll2 { get; set; } - /// - /// 组合无功2尖电能 - /// - [Property(84, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoTip2 { get; set; } - /// - /// 组合无功2峰电能 - /// - [Property(88, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoPeak2 { get; set; } - /// - /// 组合无功2平电能 - /// - [Property(92, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoFlat2 { get; set; } - /// - /// 组合无功2谷电能 - /// - [Property(96, 4, PropertyReadConstant.Byte, 0.01)] - public Int32 GroupNoValley2 { get; set; } - /// - /// 一象限无功总电能 - /// - [Property(100, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoAll1 { get; set; } - /// - /// 一象限无功尖电能 - /// - [Property(104, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoTip1 { get; set; } - /// - /// 一象限无功峰电能 - /// - [Property(108, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoPeak1 { get; set; } - /// - /// 一象限无功平电能 - /// - [Property(112, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoFlat1 { get; set; } - /// - /// 一象限无功谷电能 - /// - [Property(116, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoValley1 { get; set; } - /// - /// 二象限无功总电能 - /// - [Property(120, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoAll2 { get; set; } - /// - /// 二象限无功尖电能 - /// - [Property(124, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoTip2 { get; set; } - /// - /// 二象限无功峰电能 - /// - [Property(128, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoPeak2 { get; set; } - /// - /// 二象限无功平电能 - /// - [Property(132, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoFlat2 { get; set; } - /// - /// 二象限无功谷电能 - /// - [Property(136, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoValley2 { get; set; } - /// - /// 三象限无功总电能 - /// - [Property(140, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoAll3 { get; set; } - /// - /// 三象限无功尖电能 - /// - [Property(144, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoTip3 { get; set; } - /// - /// 三象限无功峰电能 - /// - [Property(148, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoPeak3 { get; set; } - /// - /// 三象限无功平电能 - /// - [Property(152, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoFlat3 { get; set; } - /// - /// 三象限无功谷电能 - /// - [Property(156, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoValley3 { get; set; } - /// - /// 四象限无功总电能 - /// - [Property(160, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoAll4 { get; set; } - /// - /// 四象限无功尖电能 - /// - [Property(164, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoTip4 { get; set; } - /// - /// 四象限无功峰电能 - /// - [Property(168, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoPeak4 { get; set; } - /// - /// 四象限无功平电能 - /// - [Property(172, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoFlat4 { get; set; } - /// - /// 四象限无功谷电能 - /// - [Property(176, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 QuadrantNoValley4 { get; set; } - /// - /// 正向视在总电能 - /// - [Property(180, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveApparentAll { get; set; } - /// - /// 正向视在尖电能 - /// - [Property(184, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveApparentTip { get; set; } - /// - /// 正向视在峰电能 - /// - [Property(188, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveApparentPeak { get; set; } - /// - /// 正向视在平电能 - /// - [Property(192, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveApparentFlat { get; set; } - /// - /// 正向视在谷电能 - /// - [Property(196, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ForwardHaveApparentValley { get; set; } - /// - /// 反向视在总电能 - /// - [Property(200, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveApparentAll { get; set; } - /// - /// 反向视在尖电能 - /// - [Property(204, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveApparentTip { get; set; } - /// - /// 反向视在峰电能 - /// - [Property(208, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveApparentPeak { get; set; } - /// - /// 反向视在平电能 - /// - [Property(212, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveApparentFlat { get; set; } - /// - /// 反向视在谷电能 - /// - [Property(216, 4, PropertyReadConstant.Byte, 0.01)] - public UInt32 ReverseHaveApparentValley { get; set; } - /// - /// A 相电压 - /// - [Property(220, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseVoltageA { get; set; } - /// - /// B 相电压 - /// - [Property(224, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseVoltageB { get; set; } - /// - /// C 相电压 - /// - [Property(228, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseVoltageC { get; set; } - /// - /// A 相电流 - /// - [Property(232, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseElectricityA { get; set; } - /// - /// B 相电流 - /// - [Property(236, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseElectricityB { get; set; } - /// - /// C 相电流 - /// - [Property(240, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 PhaseElectricityC { get; set; } - /// - /// 有功总功率 - /// - [Property(244, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalActivePower { get; set; } - /// - /// A 相有功总功率 - /// - [Property(248, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalActivePowerA { get; set; } - /// - /// B 相有功总功率 - /// - [Property(252, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalActivePowerB { get; set; } - /// - /// C 相有功总功率 - /// - [Property(256, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalActivePowerC { get; set; } - /// - /// 无功总功率 - /// - [Property(260, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalReactivePower { get; set; } - /// - /// A 相无功总功率 - /// - [Property(264, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalReactivePowerA { get; set; } - /// - /// B 相无功总功率 - /// - [Property(268, 4, PropertyReadConstant.Byte, 0.0001)] - public Int32 TotalReactivePowerB { get; set; } - /// - /// C 相无功总功率 - /// - [Property(272, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 TotalReactivePowerC { get; set; } - /// - /// 总视在功率 - /// - [Property(276, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 TotalApparentPower { get; set; } - /// - /// A 相视在功率 - /// - [Property(280, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 TotalApparentPowerA { get; set; } - /// - /// B 相视在功率 - /// - [Property(284, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 TotalApparentPowerB { get; set; } - /// - /// C 相视在功率 - /// - [Property(288, 4, PropertyReadConstant.Byte, 0.0001)] - public UInt32 TotalApparentPowerC { get; set; } - /// - /// 总功率因数 - /// - [Property(292, 2, PropertyReadConstant.Byte, 0.001)] - public short OverallPowerFactor { get; set; } - /// - /// A 相功率因数 - /// - [Property(294, 2, PropertyReadConstant.Byte, 0.001)] - public short OverallPowerFactorA { get; set; } - /// - /// B 相功率因数 - /// - [Property(296, 2, PropertyReadConstant.Byte, 0.001)] - public short OverallPowerFactorB { get; set; } - /// - /// C 相功率因数 - /// - [Property(298, 2, PropertyReadConstant.Byte, 0.001)] - public short OverallPowerFactorC { get; set; } - /// - /// A 相相角 - /// - [Property(300, 2, PropertyReadConstant.Byte, 0.01)] - public ushort PhaseAngleA { get; set; } - /// - /// B 相相角 - /// - [Property(302, 2, PropertyReadConstant.Byte, 0.01)] - public ushort PhaseAngleB { get; set; } - /// - /// C 相相角 - /// - [Property(304, 2, PropertyReadConstant.Byte, 0.01)] - public ushort PhaseAngleC { get; set; } - /// - /// 电网频率 - /// - [Property(306, 2, PropertyReadConstant.Byte, 0.01)] - public ushort LineFrequency { get; set; } - /// - /// A 相线电压 - /// - [Property(308, 4, PropertyReadConstant.Byte, 0.0001)] - public float PhaseLineVoltageA { get; set; } - /// - /// B 相线电压 - /// - [Property(312, 4, PropertyReadConstant.Byte, 0.0001)] - public float PhaseLineVoltageB { get; set; } - /// - /// C 相线电压 - /// - [Property(316, 4, PropertyReadConstant.Byte, 0.0001)] - public float PhaseLineVoltageC { get; set; } - /// - /// 三相平均线电压 - /// - [Property(320, 4, PropertyReadConstant.Byte, 0.0001)] - public float ThreePhaseMeanLineVoltage { get; set; } - /// - /// 三相平均相电压 - /// - [Property(324, 4, PropertyReadConstant.Byte, 0.0001)] - public float ThreePhaseMeanPhaseVoltage { get; set; } - } -} diff --git a/HybirdFrameworkServices/Plc/PlcToHost.cs b/HybirdFrameworkServices/Plc/PlcToHost.cs new file mode 100644 index 0000000..3345a61 --- /dev/null +++ b/HybirdFrameworkServices/Plc/PlcToHost.cs @@ -0,0 +1,69 @@ +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); // 协议版本 + public ModbusProperty CommunicationDiagnosis { get; set; } = new(40204); // 通讯诊断 + 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提示预警 + + public ModbusProperty RemoteLocalControlState { get; set; } = new(40207); // 遥本控状态 + public ModbusProperty LightStatus { get; set; } = new(40208); // 灯光状态 + public ModbusProperty ExhaustFanStatus { get; set; } = new(40209); // 排风扇状态 + public ModbusProperty WaterStatusStation { get; set; } = new(40210); // 站内积水状态 + public ModbusProperty value09 { get; set; } = new(40211, length: 30); // 备用 + public ModbusProperty InPosition { get; set; } = new(40241, length: 40); // 在位状态 + public ModbusProperty value11 { get; set; } = new(40281, length: 20); // 备用 + 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); // 备用 + public ModbusProperty PercentageTorqueX { get; set; } = new(40306); // x轴扭矩百分比 + public ModbusProperty PercentageTorqueY { get; set; } = new(40307); // y轴扭矩百分比 + public ModbusProperty PercentageTorqueZ { get; set; } = new(40308); // z轴扭矩百分比 + public ModbusProperty value20 { get; set; } = new(40309, length: 92); // 备用 + public ModbusProperty RadarStatesIn{ get; set; } = new(40401); // " 入口雷达状态" + public ModbusProperty RadarStatesOut { get; set; } = new(40402); // " 出口雷达状态" + public ModbusProperty SpotPhotoelectricSignal { get; set; } = new(40403); // 到位光电信号 + public ModbusProperty PhysicalButtonState { get; set; } = new(40404); // 实体按钮状态 + public ModbusProperty LightIn { get; set; } = new(40405); // "三色灯控制通道状态(入口)" + public ModbusProperty LightOut { get; set; } = new(40406); // "三色灯控制通道状态(出口)" + public ModbusProperty TaskType { get; set; } = new(40407); // "任务类型状态(是否允许允许执行任务)" + public ModbusProperty TaskStates { get; set; } = new(40408); // 任务状态 + public ModbusProperty OperationalTrainNumber { get; set; } = new(40409); // 执行任务行车号 + public ModbusProperty ChannelLocationState { get; set; } = new(40410); // 通道定位状态 + public ModbusProperty DeviationX { get; set; } = new(40411); // x偏差 + public ModbusProperty DeviationY { get; set; } = new(40412); // y偏差 + public ModbusProperty DeviationZ { get; set; } = new(40413); // z偏差 + public ModbusProperty value44 { get; set; } = new(40414, length: 7); // 备用 + + + + } +} diff --git a/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs b/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs deleted file mode 100644 index 975690a..0000000 --- a/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs +++ /dev/null @@ -1,291 +0,0 @@ -using HybirdFrameworkCore.Autofac.Attribute; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HybirdFrameworkServices.Plc -{ - /// - /// 乘变比电能数据区(浮点数)(乘变比) - /// - public class PlcTurnsRatio - { - /// - /// 组合有功总电能 - /// - [Property(0, 4, PropertyReadConstant.Byte)] - public float GroupHaveAll { get; set; } - /// - /// 组合有功尖电能 - /// - [Property(4, 4, PropertyReadConstant.Byte)] - public float GroupHaveTip { get; set; } - /// - /// 组合有功峰电能 - /// - [Property(8, 4, PropertyReadConstant.Byte)] - public float GroupHavePeak { get; set; } - /// - /// 组合有功平电能 - /// - [Property(12, 4, PropertyReadConstant.Byte)] - public float GroupHaveFlat { get; set; } - /// - /// 组合有功谷电能 - /// - [Property(16, 4, PropertyReadConstant.Byte)] - public float GroupHaveValley { get; set; } - /// - /// 正向有功总电能 - /// - [Property(20, 4, PropertyReadConstant.Byte)] - public float ForwardHaveAll { get; set; } - /// - /// 正向有功尖电能 - /// - [Property(24, 4, PropertyReadConstant.Byte)] - public float ForwardHaveTip { get; set; } - /// - /// 正向有功峰电能 - /// - [Property(28, 4, PropertyReadConstant.Byte)] - public float ForwardHavePeak { get; set; } - /// - /// 正向有功平电能 - /// - [Property(32, 4, PropertyReadConstant.Byte)] - public float ForwardHaveFlat { get; set; } - /// - /// 正向有功谷电能 - /// - [Property(36, 4, PropertyReadConstant.Byte)] - public float ForwardHaveValley { get; set; } - /// - /// 反向有功总电能 - /// - [Property(40, 4, PropertyReadConstant.Byte)] - public float ReverseHaveAll { get; set; } - /// - /// 反向有功尖电能 - /// - [Property(44, 4, PropertyReadConstant.Byte)] - public float ReverseHaveTip { get; set; } - /// - /// 反向有功峰电能 - /// - [Property(48, 4, PropertyReadConstant.Byte)] - public float ReverseHavePeak { get; set; } - /// - /// 反向有功平电能 - /// - [Property(52, 4, PropertyReadConstant.Byte)] - public float ReverseHaveFlat { get; set; } - /// - /// 反向有功谷电能 - /// - [Property(56, 4, PropertyReadConstant.Byte)] - public float ReverseHaveValley { get; set; } - /// - /// 组合无功1总电能 - /// - [Property(60, 4, PropertyReadConstant.Byte)] - public float GroupNoAll1 { get; set; } - /// - /// 组合无功1尖电能 - /// - [Property(64, 4, PropertyReadConstant.Byte)] - public float GroupNoTip1 { get; set; } - /// - /// 组合无功1峰电能 - /// - [Property(68, 4, PropertyReadConstant.Byte)] - public float GroupNoPeak1 { get; set; } - /// - /// 组合无功1平电能 - /// - [Property(72, 4, PropertyReadConstant.Byte)] - public float GroupNoFlat1 { get; set; } - /// - /// 组合无功1谷电能 - /// - [Property(76, 4, PropertyReadConstant.Byte)] - public float GroupNoValley1 { get; set; } - /// - /// 组合无功2总电能 - /// - [Property(80, 4, PropertyReadConstant.Byte)] - public float GroupNoAll2 { get; set; } - /// - /// 组合无功2尖电能 - /// - [Property(84, 4, PropertyReadConstant.Byte)] - public float GroupNoTip2 { get; set; } - /// - /// 组合无功2峰电能 - /// - [Property(88, 4, PropertyReadConstant.Byte)] - public float GroupNoPeak2 { get; set; } - /// - /// 组合无功2平电能 - /// - [Property(92, 4, PropertyReadConstant.Byte)] - public float GroupNoFlat2 { get; set; } - /// - /// 组合无功2谷电能 - /// - [Property(96, 4, PropertyReadConstant.Byte)] - public float GroupNoValley2 { get; set; } - /// - /// 一象限无功总电能 - /// - [Property(100, 4, PropertyReadConstant.Byte)] - public float QuadrantNoAll1 { get; set; } - /// - /// 一象限无功尖电能 - /// - [Property(104, 4, PropertyReadConstant.Byte)] - public float QuadrantNoTip1 { get; set; } - /// - /// 一象限无功峰电能 - /// - [Property(108, 4, PropertyReadConstant.Byte)] - public float QuadrantNoPeak1 { get; set; } - /// - /// 一象限无功平电能 - /// - [Property(112, 4, PropertyReadConstant.Byte)] - public float QuadrantNoFlat1 { get; set; } - /// - /// 一象限无功谷电能 - /// - [Property(116, 4, PropertyReadConstant.Byte)] - public float QuadrantNoValley1 { get; set; } - /// - /// 二象限无功总电能 - /// - [Property(120, 4, PropertyReadConstant.Byte)] - public float QuadrantNoAll2 { get; set; } - /// - /// 二象限无功尖电能 - /// - [Property(124, 4, PropertyReadConstant.Byte)] - public float QuadrantNoTip2 { get; set; } - /// - /// 二象限无功峰电能 - /// - [Property(128, 4, PropertyReadConstant.Byte)] - public float QuadrantNoPeak2 { get; set; } - /// - /// 二象限无功平电能 - /// - [Property(132, 4, PropertyReadConstant.Byte)] - public float QuadrantNoFlat2 { get; set; } - /// - /// 二象限无功谷电能 - /// - [Property(136, 4, PropertyReadConstant.Byte)] - public float QuadrantNoValley2 { get; set; } - /// - /// 三象限无功总电能 - /// - [Property(140, 4, PropertyReadConstant.Byte)] - public float QuadrantNoAll3 { get; set; } - /// - /// 三象限无功尖电能 - /// - [Property(144, 4, PropertyReadConstant.Byte)] - public float QuadrantNoTip3 { get; set; } - /// - /// 三象限无功峰电能 - /// - [Property(148, 4, PropertyReadConstant.Byte)] - public float QuadrantNoPeak3 { get; set; } - /// - /// 三象限无功平电能 - /// - [Property(152, 4, PropertyReadConstant.Byte)] - public float QuadrantNoFlat3 { get; set; } - /// - /// 三象限无功谷电能 - /// - [Property(156, 4, PropertyReadConstant.Byte)] - public float QuadrantNoValley3 { get; set; } - /// - /// 四象限无功总电能 - /// - [Property(160, 4, PropertyReadConstant.Byte)] - public float QuadrantNoAll4 { get; set; } - /// - /// 四象限无功尖电能 - /// - [Property(164, 4, PropertyReadConstant.Byte)] - public float QuadrantNoTip4 { get; set; } - /// - /// 四象限无功峰电能 - /// - [Property(168, 4, PropertyReadConstant.Byte)] - public float QuadrantNoPeak4 { get; set; } - /// - /// 四象限无功平电能 - /// - [Property(172, 4, PropertyReadConstant.Byte)] - public float QuadrantNoFlat4 { get; set; } - /// - /// 四象限无功谷电能 - /// - [Property(176, 4, PropertyReadConstant.Byte)] - public float QuadrantNoValley4 { get; set; } - /// - /// 正向视在总电能 - /// - [Property(180, 4, PropertyReadConstant.Byte)] - public float ForwardHaveApparentAll { get; set; } - /// - /// 正向视在尖电能 - /// - [Property(184, 4, PropertyReadConstant.Byte)] - public float ForwardHaveApparentTip { get; set; } - /// - /// 正向视在峰电能 - /// - [Property(188, 4, PropertyReadConstant.Byte)] - public float ForwardHaveApparentPeak { get; set; } - /// - /// 正向视在平电能 - /// - [Property(192, 4, PropertyReadConstant.Byte)] - public float ForwardHaveApparentFlat { get; set; } - /// - /// 正向视在谷电能 - /// - [Property(196, 4, PropertyReadConstant.Byte)] - public float ForwardHaveApparentValley { get; set; } - /// - /// 反向视在总电能 - /// - [Property(200, 4, PropertyReadConstant.Byte)] - public float ReverseHaveApparentAll { get; set; } - /// - /// 反向视在尖电能 - /// - [Property(204, 4, PropertyReadConstant.Byte)] - public float ReverseHaveApparentTip { get; set; } - /// - /// 反向视在峰电能 - /// - [Property(208, 4, PropertyReadConstant.Byte)] - public float ReverseHaveApparentPeak { get; set; } - /// - /// 反向视在平电能 - /// - [Property(212, 4, PropertyReadConstant.Byte)] - public float ReverseHaveApparentFlat { get; set; } - /// - /// 反向视在谷电能 - /// - [Property(216, 4, PropertyReadConstant.Byte)] - public float ReverseHaveApparentValley { get; set; } - } -} diff --git a/WinFormStarter/Form2.cs b/WinFormStarter/Form2.cs index d92fc85..2e65abb 100644 --- a/WinFormStarter/Form2.cs +++ b/WinFormStarter/Form2.cs @@ -12,6 +12,7 @@ public partial class Form2 : Form InitializeComponent(); _server.Start(9000); - new FrmPLCConnect().Show(); + new FrmPlc().Show(); + //new FrmPLCConnect().Show(); } } \ No newline at end of file diff --git a/WinFormStarter/Form2.resx b/WinFormStarter/Form2.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinFormStarter/Form2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFormStarter/FrmPLCConnect.Designer.cs b/WinFormStarter/FrmPLCConnect.Designer.cs deleted file mode 100644 index 969f8cc..0000000 --- a/WinFormStarter/FrmPLCConnect.Designer.cs +++ /dev/null @@ -1,2902 +0,0 @@ -namespace WinFormStarter -{ - partial class FrmPLCConnect - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - BtnWrite18 = new Button(); - textBox18 = new TextBox(); - label18 = new Label(); - BtnWrite17 = new Button(); - textBox17 = new TextBox(); - label17 = new Label(); - BtnWrite16 = new Button(); - textBox16 = new TextBox(); - label16 = new Label(); - BtnWrite15 = new Button(); - textBox15 = new TextBox(); - label15 = new Label(); - groupBox1 = new GroupBox(); - BtnCollectionAssignment = new Button(); - label22 = new Label(); - label21 = new Label(); - label20 = new Label(); - TxtSite = new TextBox(); - LblConState = new Label(); - BtnConnect = new Button(); - TxtPort = new TextBox(); - TxtIp = new TextBox(); - BtnWrite14 = new Button(); - textBox14 = new TextBox(); - label14 = new Label(); - BtnWrite13 = new Button(); - textBox13 = new TextBox(); - label13 = new Label(); - BtnWrite12 = new Button(); - textBox12 = new TextBox(); - label12 = new Label(); - BtnWrite11 = new Button(); - textBox11 = new TextBox(); - label11 = new Label(); - BtnWrite10 = new Button(); - textBox10 = new TextBox(); - label10 = new Label(); - BtnWrite09 = new Button(); - textBox9 = new TextBox(); - label9 = new Label(); - BtnWrite08 = new Button(); - textBox8 = new TextBox(); - label8 = new Label(); - BtnWrite07 = new Button(); - textBox7 = new TextBox(); - label7 = new Label(); - BtnWrite06 = new Button(); - textBox6 = new TextBox(); - label6 = new Label(); - BtnWrite05 = new Button(); - textBox5 = new TextBox(); - label5 = new Label(); - BtnWrite04 = new Button(); - textBox4 = new TextBox(); - label4 = new Label(); - BtnWrite03 = new Button(); - textBox3 = new TextBox(); - label3 = new Label(); - BtnWrite02 = new Button(); - textBox2 = new TextBox(); - label2 = new Label(); - BtnWrite01 = new Button(); - textBox1 = new TextBox(); - label1 = new Label(); - groupBox2 = new GroupBox(); - groupBox3 = new GroupBox(); - BtnToggle = new Button(); - label186 = new Label(); - label187 = new Label(); - label188 = new Label(); - label189 = new Label(); - label190 = new Label(); - label191 = new Label(); - label192 = new Label(); - label193 = new Label(); - label176 = new Label(); - label177 = new Label(); - label178 = new Label(); - label179 = new Label(); - label180 = new Label(); - label181 = new Label(); - label182 = new Label(); - label183 = new Label(); - label184 = new Label(); - label185 = new Label(); - label142 = new Label(); - label143 = new Label(); - label152 = new Label(); - label153 = new Label(); - label162 = new Label(); - label163 = new Label(); - label174 = new Label(); - label175 = new Label(); - label172 = new Label(); - label173 = new Label(); - label164 = new Label(); - label165 = new Label(); - label166 = new Label(); - label167 = new Label(); - label168 = new Label(); - label169 = new Label(); - label170 = new Label(); - label171 = new Label(); - label154 = new Label(); - label155 = new Label(); - label156 = new Label(); - label157 = new Label(); - label158 = new Label(); - label159 = new Label(); - label160 = new Label(); - label161 = new Label(); - label144 = new Label(); - label145 = new Label(); - label146 = new Label(); - label147 = new Label(); - label148 = new Label(); - label149 = new Label(); - label150 = new Label(); - label151 = new Label(); - label132 = new Label(); - label133 = new Label(); - label134 = new Label(); - label135 = new Label(); - label136 = new Label(); - label137 = new Label(); - label138 = new Label(); - label139 = new Label(); - label140 = new Label(); - label141 = new Label(); - label122 = new Label(); - label123 = new Label(); - label124 = new Label(); - label125 = new Label(); - label126 = new Label(); - label127 = new Label(); - label128 = new Label(); - label129 = new Label(); - label130 = new Label(); - label131 = new Label(); - label112 = new Label(); - label113 = new Label(); - label114 = new Label(); - label115 = new Label(); - label116 = new Label(); - label117 = new Label(); - label118 = new Label(); - label119 = new Label(); - label120 = new Label(); - label121 = new Label(); - label102 = new Label(); - label103 = new Label(); - label104 = new Label(); - label105 = new Label(); - label106 = new Label(); - label107 = new Label(); - label108 = new Label(); - label109 = new Label(); - label110 = new Label(); - label111 = new Label(); - label92 = new Label(); - label93 = new Label(); - label94 = new Label(); - label95 = new Label(); - label96 = new Label(); - label97 = new Label(); - label98 = new Label(); - label99 = new Label(); - label100 = new Label(); - label101 = new Label(); - label82 = new Label(); - label83 = new Label(); - label84 = new Label(); - label85 = new Label(); - label86 = new Label(); - label87 = new Label(); - label88 = new Label(); - label89 = new Label(); - label90 = new Label(); - label91 = new Label(); - label72 = new Label(); - label73 = new Label(); - label74 = new Label(); - label75 = new Label(); - label76 = new Label(); - label77 = new Label(); - label78 = new Label(); - label79 = new Label(); - label80 = new Label(); - label81 = new Label(); - label62 = new Label(); - label63 = new Label(); - label64 = new Label(); - label65 = new Label(); - label66 = new Label(); - label67 = new Label(); - label68 = new Label(); - label69 = new Label(); - label70 = new Label(); - label71 = new Label(); - label52 = new Label(); - label53 = new Label(); - label54 = new Label(); - label55 = new Label(); - label56 = new Label(); - label57 = new Label(); - label58 = new Label(); - label59 = new Label(); - label60 = new Label(); - label61 = new Label(); - label42 = new Label(); - label43 = new Label(); - label44 = new Label(); - label45 = new Label(); - label46 = new Label(); - label47 = new Label(); - label48 = new Label(); - label49 = new Label(); - label50 = new Label(); - label51 = new Label(); - label32 = new Label(); - label33 = new Label(); - label34 = new Label(); - label35 = new Label(); - label36 = new Label(); - label37 = new Label(); - label38 = new Label(); - label39 = new Label(); - label40 = new Label(); - label41 = new Label(); - label30 = new Label(); - label31 = new Label(); - label28 = new Label(); - label29 = new Label(); - label26 = new Label(); - label27 = new Label(); - label24 = new Label(); - label25 = new Label(); - label23 = new Label(); - label19 = new Label(); - groupBox1.SuspendLayout(); - groupBox2.SuspendLayout(); - groupBox3.SuspendLayout(); - SuspendLayout(); - // - // BtnWrite18 - // - BtnWrite18.Location = new Point(1040, 210); - BtnWrite18.Name = "BtnWrite18"; - BtnWrite18.Size = new Size(94, 29); - BtnWrite18.TabIndex = 171; - BtnWrite18.Text = "写"; - BtnWrite18.UseVisualStyleBackColor = true; - BtnWrite18.Click += BtnWrite18_Click; - // - // textBox18 - // - textBox18.Location = new Point(880, 211); - textBox18.Name = "textBox18"; - textBox18.Size = new Size(125, 27); - textBox18.TabIndex = 170; - // - // label18 - // - label18.AutoSize = true; - label18.Location = new Point(795, 211); - label18.Name = "label18"; - label18.Size = new Size(69, 20); - label18.TabIndex = 169; - label18.Text = "电表清零"; - // - // BtnWrite17 - // - BtnWrite17.Location = new Point(655, 209); - BtnWrite17.Name = "BtnWrite17"; - BtnWrite17.Size = new Size(94, 29); - BtnWrite17.TabIndex = 168; - BtnWrite17.Text = "写"; - BtnWrite17.UseVisualStyleBackColor = true; - BtnWrite17.Click += BtnWrite17_Click; - // - // textBox17 - // - textBox17.Location = new Point(495, 210); - textBox17.Name = "textBox17"; - textBox17.Size = new Size(125, 27); - textBox17.TabIndex = 167; - // - // label17 - // - label17.AutoSize = true; - label17.Location = new Point(410, 210); - label17.Name = "label17"; - label17.Size = new Size(99, 20); - label17.TabIndex = 166; - label17.Text = "电流接线反向"; - // - // BtnWrite16 - // - BtnWrite16.Location = new Point(255, 212); - BtnWrite16.Name = "BtnWrite16"; - BtnWrite16.Size = new Size(94, 29); - BtnWrite16.TabIndex = 165; - BtnWrite16.Text = "写"; - BtnWrite16.UseVisualStyleBackColor = true; - BtnWrite16.Click += BtnWrite16_Click; - // - // textBox16 - // - textBox16.Location = new Point(95, 213); - textBox16.Name = "textBox16"; - textBox16.Size = new Size(125, 27); - textBox16.TabIndex = 164; - // - // label16 - // - label16.AutoSize = true; - label16.Location = new Point(10, 213); - label16.Name = "label16"; - label16.Size = new Size(150, 20); - label16.TabIndex = 163; - label16.Text = "秒脉冲/无功电能选择"; - // - // BtnWrite15 - // - BtnWrite15.Location = new Point(1040, 177); - BtnWrite15.Name = "BtnWrite15"; - BtnWrite15.Size = new Size(94, 29); - BtnWrite15.TabIndex = 162; - BtnWrite15.Text = "写"; - BtnWrite15.UseVisualStyleBackColor = true; - BtnWrite15.Click += BtnWrite15_Click; - // - // textBox15 - // - textBox15.Location = new Point(880, 178); - textBox15.Name = "textBox15"; - textBox15.Size = new Size(125, 27); - textBox15.TabIndex = 161; - // - // label15 - // - label15.AutoSize = true; - label15.Location = new Point(795, 178); - label15.Name = "label15"; - label15.Size = new Size(69, 20); - label15.TabIndex = 160; - label15.Text = "电流变比"; - // - // groupBox1 - // - groupBox1.Controls.Add(BtnCollectionAssignment); - groupBox1.Controls.Add(label22); - groupBox1.Controls.Add(label21); - groupBox1.Controls.Add(label20); - groupBox1.Controls.Add(TxtSite); - groupBox1.Controls.Add(LblConState); - groupBox1.Controls.Add(BtnConnect); - groupBox1.Controls.Add(TxtPort); - groupBox1.Controls.Add(TxtIp); - groupBox1.Location = new Point(30, 28); - groupBox1.Name = "groupBox1"; - groupBox1.Size = new Size(1124, 56); - groupBox1.TabIndex = 159; - groupBox1.TabStop = false; - groupBox1.Text = "通讯连接"; - // - // BtnCollectionAssignment - // - BtnCollectionAssignment.Enabled = false; - BtnCollectionAssignment.Location = new Point(859, 17); - BtnCollectionAssignment.Name = "BtnCollectionAssignment"; - BtnCollectionAssignment.Size = new Size(94, 29); - BtnCollectionAssignment.TabIndex = 120; - BtnCollectionAssignment.Text = "采集赋值"; - BtnCollectionAssignment.UseVisualStyleBackColor = true; - BtnCollectionAssignment.Click += BtnCollectionAssignment_Click; - // - // label22 - // - label22.AutoSize = true; - label22.Location = new Point(490, 26); - label22.Name = "label22"; - label22.Size = new Size(39, 20); - label22.TabIndex = 119; - label22.Text = "站号"; - // - // label21 - // - label21.AutoSize = true; - label21.Location = new Point(258, 20); - label21.Name = "label21"; - label21.Size = new Size(49, 20); - label21.TabIndex = 118; - label21.Text = "PORT"; - // - // label20 - // - label20.AutoSize = true; - label20.Location = new Point(17, 24); - label20.Name = "label20"; - label20.Size = new Size(22, 20); - label20.TabIndex = 117; - label20.Text = "IP"; - // - // TxtSite - // - TxtSite.Location = new Point(550, 17); - TxtSite.Name = "TxtSite"; - TxtSite.Size = new Size(125, 27); - TxtSite.TabIndex = 45; - // - // LblConState - // - LblConState.AutoSize = true; - LblConState.Location = new Point(1030, 22); - LblConState.Name = "LblConState"; - LblConState.Size = new Size(69, 20); - LblConState.TabIndex = 44; - LblConState.Text = "连接状态"; - // - // BtnConnect - // - BtnConnect.Location = new Point(715, 17); - BtnConnect.Name = "BtnConnect"; - BtnConnect.Size = new Size(94, 29); - BtnConnect.TabIndex = 2; - BtnConnect.Text = "连接"; - BtnConnect.UseVisualStyleBackColor = true; - BtnConnect.Click += BtnConnect_Click; - // - // TxtPort - // - TxtPort.Location = new Point(344, 21); - TxtPort.Name = "TxtPort"; - TxtPort.Size = new Size(125, 27); - TxtPort.TabIndex = 1; - // - // TxtIp - // - TxtIp.Location = new Point(85, 22); - TxtIp.Name = "TxtIp"; - TxtIp.Size = new Size(125, 27); - TxtIp.TabIndex = 0; - // - // BtnWrite14 - // - BtnWrite14.Location = new Point(655, 176); - BtnWrite14.Name = "BtnWrite14"; - BtnWrite14.Size = new Size(94, 29); - BtnWrite14.TabIndex = 158; - BtnWrite14.Text = "写"; - BtnWrite14.UseVisualStyleBackColor = true; - BtnWrite14.Click += BtnWrite14_Click; - // - // textBox14 - // - textBox14.Location = new Point(495, 177); - textBox14.Name = "textBox14"; - textBox14.Size = new Size(125, 27); - textBox14.TabIndex = 157; - // - // label14 - // - label14.AutoSize = true; - label14.Location = new Point(410, 177); - label14.Name = "label14"; - label14.Size = new Size(69, 20); - label14.TabIndex = 156; - label14.Text = "电压变比"; - // - // BtnWrite13 - // - BtnWrite13.Location = new Point(255, 175); - BtnWrite13.Name = "BtnWrite13"; - BtnWrite13.Size = new Size(94, 29); - BtnWrite13.TabIndex = 155; - BtnWrite13.Text = "写"; - BtnWrite13.UseVisualStyleBackColor = true; - BtnWrite13.Click += BtnWrite13_Click; - // - // textBox13 - // - textBox13.Location = new Point(95, 176); - textBox13.Name = "textBox13"; - textBox13.Size = new Size(125, 27); - textBox13.TabIndex = 154; - // - // label13 - // - label13.AutoSize = true; - label13.Location = new Point(10, 176); - label13.Name = "label13"; - label13.Size = new Size(39, 20); - label13.TabIndex = 153; - label13.Text = "保留"; - // - // BtnWrite12 - // - BtnWrite12.Location = new Point(1040, 144); - BtnWrite12.Name = "BtnWrite12"; - BtnWrite12.Size = new Size(94, 29); - BtnWrite12.TabIndex = 152; - BtnWrite12.Text = "写"; - BtnWrite12.UseVisualStyleBackColor = true; - BtnWrite12.Click += BtnWrite12_Click; - // - // textBox12 - // - textBox12.Location = new Point(880, 145); - textBox12.Name = "textBox12"; - textBox12.Size = new Size(125, 27); - textBox12.TabIndex = 151; - // - // label12 - // - label12.AutoSize = true; - label12.Location = new Point(795, 145); - label12.Name = "label12"; - label12.Size = new Size(129, 20); - label12.TabIndex = 150; - label12.Text = "本机modbus地址"; - // - // BtnWrite11 - // - BtnWrite11.Location = new Point(655, 144); - BtnWrite11.Name = "BtnWrite11"; - BtnWrite11.Size = new Size(94, 29); - BtnWrite11.TabIndex = 149; - BtnWrite11.Text = "写"; - BtnWrite11.UseVisualStyleBackColor = true; - BtnWrite11.Click += BtnWrite11_Click; - // - // textBox11 - // - textBox11.Location = new Point(495, 145); - textBox11.Name = "textBox11"; - textBox11.Size = new Size(125, 27); - textBox11.TabIndex = 148; - // - // label11 - // - label11.AutoSize = true; - label11.Location = new Point(410, 145); - label11.Name = "label11"; - label11.Size = new Size(24, 20); - label11.TabIndex = 147; - label11.Text = "年"; - // - // BtnWrite10 - // - BtnWrite10.Location = new Point(255, 143); - BtnWrite10.Name = "BtnWrite10"; - BtnWrite10.Size = new Size(94, 29); - BtnWrite10.TabIndex = 146; - BtnWrite10.Text = "写"; - BtnWrite10.UseVisualStyleBackColor = true; - BtnWrite10.Click += BtnWrite10_Click; - // - // textBox10 - // - textBox10.Location = new Point(95, 144); - textBox10.Name = "textBox10"; - textBox10.Size = new Size(125, 27); - textBox10.TabIndex = 145; - // - // label10 - // - label10.AutoSize = true; - label10.Location = new Point(10, 144); - label10.Name = "label10"; - label10.Size = new Size(24, 20); - label10.TabIndex = 144; - label10.Text = "月"; - // - // BtnWrite09 - // - BtnWrite09.Location = new Point(1040, 110); - BtnWrite09.Name = "BtnWrite09"; - BtnWrite09.Size = new Size(94, 29); - BtnWrite09.TabIndex = 143; - BtnWrite09.Text = "写"; - BtnWrite09.UseVisualStyleBackColor = true; - BtnWrite09.Click += BtnWrite09_Click; - // - // textBox9 - // - textBox9.Location = new Point(880, 111); - textBox9.Name = "textBox9"; - textBox9.Size = new Size(125, 27); - textBox9.TabIndex = 142; - // - // label9 - // - label9.AutoSize = true; - label9.Location = new Point(795, 111); - label9.Name = "label9"; - label9.Size = new Size(24, 20); - label9.TabIndex = 141; - label9.Text = "日"; - // - // BtnWrite08 - // - BtnWrite08.Location = new Point(655, 109); - BtnWrite08.Name = "BtnWrite08"; - BtnWrite08.Size = new Size(94, 29); - BtnWrite08.TabIndex = 140; - BtnWrite08.Text = "写"; - BtnWrite08.UseVisualStyleBackColor = true; - BtnWrite08.Click += BtnWrite08_Click; - // - // textBox8 - // - textBox8.Location = new Point(495, 110); - textBox8.Name = "textBox8"; - textBox8.Size = new Size(125, 27); - textBox8.TabIndex = 139; - // - // label8 - // - label8.AutoSize = true; - label8.Location = new Point(410, 110); - label8.Name = "label8"; - label8.Size = new Size(24, 20); - label8.TabIndex = 138; - label8.Text = "周"; - // - // BtnWrite07 - // - BtnWrite07.Location = new Point(255, 108); - BtnWrite07.Name = "BtnWrite07"; - BtnWrite07.Size = new Size(94, 29); - BtnWrite07.TabIndex = 137; - BtnWrite07.Text = "写"; - BtnWrite07.UseVisualStyleBackColor = true; - BtnWrite07.Click += BtnWrite07_Click; - // - // textBox7 - // - textBox7.Location = new Point(95, 109); - textBox7.Name = "textBox7"; - textBox7.Size = new Size(125, 27); - textBox7.TabIndex = 136; - // - // label7 - // - label7.AutoSize = true; - label7.Location = new Point(10, 109); - label7.Name = "label7"; - label7.Size = new Size(24, 20); - label7.TabIndex = 135; - label7.Text = "时"; - // - // BtnWrite06 - // - BtnWrite06.Location = new Point(1040, 77); - BtnWrite06.Name = "BtnWrite06"; - BtnWrite06.Size = new Size(94, 29); - BtnWrite06.TabIndex = 134; - BtnWrite06.Text = "写"; - BtnWrite06.UseVisualStyleBackColor = true; - BtnWrite06.Click += BtnWrite06_Click; - // - // textBox6 - // - textBox6.Location = new Point(880, 78); - textBox6.Name = "textBox6"; - textBox6.Size = new Size(125, 27); - textBox6.TabIndex = 133; - // - // label6 - // - label6.AutoSize = true; - label6.Location = new Point(795, 78); - label6.Name = "label6"; - label6.Size = new Size(24, 20); - label6.TabIndex = 132; - label6.Text = "分"; - // - // BtnWrite05 - // - BtnWrite05.Location = new Point(655, 76); - BtnWrite05.Name = "BtnWrite05"; - BtnWrite05.Size = new Size(94, 29); - BtnWrite05.TabIndex = 131; - BtnWrite05.Text = "写"; - BtnWrite05.UseVisualStyleBackColor = true; - BtnWrite05.Click += BtnWrite05_Click; - // - // textBox5 - // - textBox5.Location = new Point(495, 77); - textBox5.Name = "textBox5"; - textBox5.Size = new Size(125, 27); - textBox5.TabIndex = 130; - // - // label5 - // - label5.AutoSize = true; - label5.Location = new Point(410, 77); - label5.Name = "label5"; - label5.Size = new Size(24, 20); - label5.TabIndex = 129; - label5.Text = "秒"; - // - // BtnWrite04 - // - BtnWrite04.Location = new Point(255, 75); - BtnWrite04.Name = "BtnWrite04"; - BtnWrite04.Size = new Size(94, 29); - BtnWrite04.TabIndex = 128; - BtnWrite04.Text = "写"; - BtnWrite04.UseVisualStyleBackColor = true; - BtnWrite04.Click += BtnWrite04_Click; - // - // textBox4 - // - textBox4.Location = new Point(95, 76); - textBox4.Name = "textBox4"; - textBox4.Size = new Size(125, 27); - textBox4.TabIndex = 127; - // - // label4 - // - label4.AutoSize = true; - label4.Location = new Point(10, 76); - label4.Name = "label4"; - label4.Size = new Size(54, 20); - label4.TabIndex = 126; - label4.Text = "校验位"; - // - // BtnWrite03 - // - BtnWrite03.Location = new Point(1040, 42); - BtnWrite03.Name = "BtnWrite03"; - BtnWrite03.Size = new Size(94, 29); - BtnWrite03.TabIndex = 125; - BtnWrite03.Text = "写"; - BtnWrite03.UseVisualStyleBackColor = true; - BtnWrite03.Click += BtnWrite03_Click; - // - // textBox3 - // - textBox3.Location = new Point(880, 43); - textBox3.Name = "textBox3"; - textBox3.Size = new Size(125, 27); - textBox3.TabIndex = 124; - // - // label3 - // - label3.AutoSize = true; - label3.Location = new Point(795, 43); - label3.Name = "label3"; - label3.Size = new Size(54, 20); - label3.TabIndex = 123; - label3.Text = "波特率"; - // - // BtnWrite02 - // - BtnWrite02.Location = new Point(655, 41); - BtnWrite02.Name = "BtnWrite02"; - BtnWrite02.Size = new Size(94, 29); - BtnWrite02.TabIndex = 122; - BtnWrite02.Text = "写"; - BtnWrite02.UseVisualStyleBackColor = true; - BtnWrite02.Click += BtnWrite02_Click; - // - // textBox2 - // - textBox2.Location = new Point(495, 42); - textBox2.Name = "textBox2"; - textBox2.Size = new Size(125, 27); - textBox2.TabIndex = 121; - // - // label2 - // - label2.AutoSize = true; - label2.Location = new Point(410, 42); - label2.Name = "label2"; - label2.Size = new Size(129, 20); - label2.TabIndex = 120; - label2.Text = "本机modbus地址"; - // - // BtnWrite01 - // - BtnWrite01.Location = new Point(255, 40); - BtnWrite01.Name = "BtnWrite01"; - BtnWrite01.Size = new Size(94, 29); - BtnWrite01.TabIndex = 119; - BtnWrite01.Text = "写"; - BtnWrite01.UseVisualStyleBackColor = true; - BtnWrite01.Click += BtnWrite01_Click; - // - // textBox1 - // - textBox1.Location = new Point(95, 41); - textBox1.Name = "textBox1"; - textBox1.Size = new Size(125, 27); - textBox1.TabIndex = 118; - // - // label1 - // - label1.AutoSize = true; - label1.Location = new Point(10, 41); - label1.Name = "label1"; - label1.Size = new Size(84, 20); - label1.TabIndex = 117; - label1.Text = "写编程使能"; - // - // groupBox2 - // - groupBox2.Controls.Add(textBox2); - groupBox2.Controls.Add(textBox12); - groupBox2.Controls.Add(label12); - groupBox2.Controls.Add(textBox5); - groupBox2.Controls.Add(BtnWrite18); - groupBox2.Controls.Add(label1); - groupBox2.Controls.Add(textBox18); - groupBox2.Controls.Add(textBox1); - groupBox2.Controls.Add(label18); - groupBox2.Controls.Add(BtnWrite01); - groupBox2.Controls.Add(BtnWrite17); - groupBox2.Controls.Add(label2); - groupBox2.Controls.Add(textBox17); - groupBox2.Controls.Add(label17); - groupBox2.Controls.Add(BtnWrite02); - groupBox2.Controls.Add(BtnWrite16); - groupBox2.Controls.Add(label3); - groupBox2.Controls.Add(textBox16); - groupBox2.Controls.Add(textBox3); - groupBox2.Controls.Add(label16); - groupBox2.Controls.Add(BtnWrite03); - groupBox2.Controls.Add(BtnWrite15); - groupBox2.Controls.Add(label4); - groupBox2.Controls.Add(textBox15); - groupBox2.Controls.Add(textBox4); - groupBox2.Controls.Add(label15); - groupBox2.Controls.Add(BtnWrite04); - groupBox2.Controls.Add(label5); - groupBox2.Controls.Add(BtnWrite14); - groupBox2.Controls.Add(BtnWrite05); - groupBox2.Controls.Add(textBox14); - groupBox2.Controls.Add(label6); - groupBox2.Controls.Add(label14); - groupBox2.Controls.Add(textBox6); - groupBox2.Controls.Add(BtnWrite13); - groupBox2.Controls.Add(BtnWrite06); - groupBox2.Controls.Add(textBox13); - groupBox2.Controls.Add(label7); - groupBox2.Controls.Add(label13); - groupBox2.Controls.Add(textBox7); - groupBox2.Controls.Add(BtnWrite12); - groupBox2.Controls.Add(BtnWrite07); - groupBox2.Controls.Add(label8); - groupBox2.Controls.Add(textBox8); - groupBox2.Controls.Add(BtnWrite11); - groupBox2.Controls.Add(BtnWrite08); - groupBox2.Controls.Add(textBox11); - groupBox2.Controls.Add(label9); - groupBox2.Controls.Add(label11); - groupBox2.Controls.Add(textBox9); - groupBox2.Controls.Add(BtnWrite10); - groupBox2.Controls.Add(BtnWrite09); - groupBox2.Controls.Add(textBox10); - groupBox2.Controls.Add(label10); - groupBox2.Location = new Point(32, 90); - groupBox2.Name = "groupBox2"; - groupBox2.Size = new Size(1145, 250); - groupBox2.TabIndex = 172; - groupBox2.TabStop = false; - groupBox2.Text = "可读可写"; - // - // groupBox3 - // - groupBox3.Controls.Add(BtnToggle); - groupBox3.Controls.Add(label186); - groupBox3.Controls.Add(label187); - groupBox3.Controls.Add(label188); - groupBox3.Controls.Add(label189); - groupBox3.Controls.Add(label190); - groupBox3.Controls.Add(label191); - groupBox3.Controls.Add(label192); - groupBox3.Controls.Add(label193); - groupBox3.Controls.Add(label176); - groupBox3.Controls.Add(label177); - groupBox3.Controls.Add(label178); - groupBox3.Controls.Add(label179); - groupBox3.Controls.Add(label180); - groupBox3.Controls.Add(label181); - groupBox3.Controls.Add(label182); - groupBox3.Controls.Add(label183); - groupBox3.Controls.Add(label184); - groupBox3.Controls.Add(label185); - groupBox3.Controls.Add(label142); - groupBox3.Controls.Add(label143); - groupBox3.Controls.Add(label152); - groupBox3.Controls.Add(label153); - groupBox3.Controls.Add(label162); - groupBox3.Controls.Add(label163); - groupBox3.Controls.Add(label174); - groupBox3.Controls.Add(label175); - groupBox3.Controls.Add(label172); - groupBox3.Controls.Add(label173); - groupBox3.Controls.Add(label164); - groupBox3.Controls.Add(label165); - groupBox3.Controls.Add(label166); - groupBox3.Controls.Add(label167); - groupBox3.Controls.Add(label168); - groupBox3.Controls.Add(label169); - groupBox3.Controls.Add(label170); - groupBox3.Controls.Add(label171); - groupBox3.Controls.Add(label154); - groupBox3.Controls.Add(label155); - groupBox3.Controls.Add(label156); - groupBox3.Controls.Add(label157); - groupBox3.Controls.Add(label158); - groupBox3.Controls.Add(label159); - groupBox3.Controls.Add(label160); - groupBox3.Controls.Add(label161); - groupBox3.Controls.Add(label144); - groupBox3.Controls.Add(label145); - groupBox3.Controls.Add(label146); - groupBox3.Controls.Add(label147); - groupBox3.Controls.Add(label148); - groupBox3.Controls.Add(label149); - groupBox3.Controls.Add(label150); - groupBox3.Controls.Add(label151); - groupBox3.Controls.Add(label132); - groupBox3.Controls.Add(label133); - groupBox3.Controls.Add(label134); - groupBox3.Controls.Add(label135); - groupBox3.Controls.Add(label136); - groupBox3.Controls.Add(label137); - groupBox3.Controls.Add(label138); - groupBox3.Controls.Add(label139); - groupBox3.Controls.Add(label140); - groupBox3.Controls.Add(label141); - groupBox3.Controls.Add(label122); - groupBox3.Controls.Add(label123); - groupBox3.Controls.Add(label124); - groupBox3.Controls.Add(label125); - groupBox3.Controls.Add(label126); - groupBox3.Controls.Add(label127); - groupBox3.Controls.Add(label128); - groupBox3.Controls.Add(label129); - groupBox3.Controls.Add(label130); - groupBox3.Controls.Add(label131); - groupBox3.Controls.Add(label112); - groupBox3.Controls.Add(label113); - groupBox3.Controls.Add(label114); - groupBox3.Controls.Add(label115); - groupBox3.Controls.Add(label116); - groupBox3.Controls.Add(label117); - groupBox3.Controls.Add(label118); - groupBox3.Controls.Add(label119); - groupBox3.Controls.Add(label120); - groupBox3.Controls.Add(label121); - groupBox3.Controls.Add(label102); - groupBox3.Controls.Add(label103); - groupBox3.Controls.Add(label104); - groupBox3.Controls.Add(label105); - groupBox3.Controls.Add(label106); - groupBox3.Controls.Add(label107); - groupBox3.Controls.Add(label108); - groupBox3.Controls.Add(label109); - groupBox3.Controls.Add(label110); - groupBox3.Controls.Add(label111); - groupBox3.Controls.Add(label92); - groupBox3.Controls.Add(label93); - groupBox3.Controls.Add(label94); - groupBox3.Controls.Add(label95); - groupBox3.Controls.Add(label96); - groupBox3.Controls.Add(label97); - groupBox3.Controls.Add(label98); - groupBox3.Controls.Add(label99); - groupBox3.Controls.Add(label100); - groupBox3.Controls.Add(label101); - groupBox3.Controls.Add(label82); - groupBox3.Controls.Add(label83); - groupBox3.Controls.Add(label84); - groupBox3.Controls.Add(label85); - groupBox3.Controls.Add(label86); - groupBox3.Controls.Add(label87); - groupBox3.Controls.Add(label88); - groupBox3.Controls.Add(label89); - groupBox3.Controls.Add(label90); - groupBox3.Controls.Add(label91); - groupBox3.Controls.Add(label72); - groupBox3.Controls.Add(label73); - groupBox3.Controls.Add(label74); - groupBox3.Controls.Add(label75); - groupBox3.Controls.Add(label76); - groupBox3.Controls.Add(label77); - groupBox3.Controls.Add(label78); - groupBox3.Controls.Add(label79); - groupBox3.Controls.Add(label80); - groupBox3.Controls.Add(label81); - groupBox3.Controls.Add(label62); - groupBox3.Controls.Add(label63); - groupBox3.Controls.Add(label64); - groupBox3.Controls.Add(label65); - groupBox3.Controls.Add(label66); - groupBox3.Controls.Add(label67); - groupBox3.Controls.Add(label68); - groupBox3.Controls.Add(label69); - groupBox3.Controls.Add(label70); - groupBox3.Controls.Add(label71); - groupBox3.Controls.Add(label52); - groupBox3.Controls.Add(label53); - groupBox3.Controls.Add(label54); - groupBox3.Controls.Add(label55); - groupBox3.Controls.Add(label56); - groupBox3.Controls.Add(label57); - groupBox3.Controls.Add(label58); - groupBox3.Controls.Add(label59); - groupBox3.Controls.Add(label60); - groupBox3.Controls.Add(label61); - groupBox3.Controls.Add(label42); - groupBox3.Controls.Add(label43); - groupBox3.Controls.Add(label44); - groupBox3.Controls.Add(label45); - groupBox3.Controls.Add(label46); - groupBox3.Controls.Add(label47); - groupBox3.Controls.Add(label48); - groupBox3.Controls.Add(label49); - groupBox3.Controls.Add(label50); - groupBox3.Controls.Add(label51); - groupBox3.Controls.Add(label32); - groupBox3.Controls.Add(label33); - groupBox3.Controls.Add(label34); - groupBox3.Controls.Add(label35); - groupBox3.Controls.Add(label36); - groupBox3.Controls.Add(label37); - groupBox3.Controls.Add(label38); - groupBox3.Controls.Add(label39); - groupBox3.Controls.Add(label40); - groupBox3.Controls.Add(label41); - groupBox3.Controls.Add(label30); - groupBox3.Controls.Add(label31); - groupBox3.Controls.Add(label28); - groupBox3.Controls.Add(label29); - groupBox3.Controls.Add(label26); - groupBox3.Controls.Add(label27); - groupBox3.Controls.Add(label24); - groupBox3.Controls.Add(label25); - groupBox3.Controls.Add(label23); - groupBox3.Controls.Add(label19); - groupBox3.Location = new Point(30, 355); - groupBox3.Name = "groupBox3"; - groupBox3.Size = new Size(1147, 645); - groupBox3.TabIndex = 173; - groupBox3.TabStop = false; - groupBox3.Text = "A 相线电压"; - // - // BtnToggle - // - BtnToggle.Location = new Point(1023, 508); - BtnToggle.Name = "BtnToggle"; - BtnToggle.Size = new Size(114, 29); - BtnToggle.TabIndex = 150; - BtnToggle.Text = "数据显示切换"; - BtnToggle.UseVisualStyleBackColor = true; - BtnToggle.Click += BtnToggle_Click; - // - // label186 - // - label186.AutoSize = true; - label186.Location = new Point(815, 545); - label186.Name = "label186"; - label186.Size = new Size(49, 20); - label186.TabIndex = 177; - label186.Text = "0.001"; - // - // label187 - // - label187.AutoSize = true; - label187.Location = new Point(691, 545); - label187.Name = "label187"; - label187.Size = new Size(95, 20); - label187.TabIndex = 176; - label187.Text = "A相功率因数"; - // - // label188 - // - label188.AutoSize = true; - label188.Location = new Point(584, 545); - label188.Name = "label188"; - label188.Size = new Size(49, 20); - label188.TabIndex = 175; - label188.Text = "0.001"; - // - // label189 - // - label189.AutoSize = true; - label189.Location = new Point(460, 545); - label189.Name = "label189"; - label189.Size = new Size(95, 20); - label189.TabIndex = 174; - label189.Text = "A相功率因数"; - // - // label190 - // - label190.AutoSize = true; - label190.Location = new Point(355, 545); - label190.Name = "label190"; - label190.Size = new Size(49, 20); - label190.TabIndex = 173; - label190.Text = "0.001"; - // - // label191 - // - label191.AutoSize = true; - label191.Location = new Point(227, 545); - label191.Name = "label191"; - label191.Size = new Size(95, 20); - label191.TabIndex = 172; - label191.Text = "A相功率因数"; - // - // label192 - // - label192.AutoSize = true; - label192.Location = new Point(143, 545); - label192.Name = "label192"; - label192.Size = new Size(49, 20); - label192.TabIndex = 171; - label192.Text = "0.001"; - // - // label193 - // - label193.AutoSize = true; - label193.Location = new Point(19, 545); - label193.Name = "label193"; - label193.Size = new Size(88, 20); - label193.TabIndex = 170; - label193.Text = "总功率因数 "; - // - // label176 - // - label176.AutoSize = true; - label176.Location = new Point(1061, 615); - label176.Name = "label176"; - label176.Size = new Size(68, 20); - label176.TabIndex = 169; - label176.Text = "0.0001V"; - // - // label177 - // - label177.AutoSize = true; - label177.Location = new Point(923, 615); - label177.Name = "label177"; - label177.Size = new Size(114, 20); - label177.TabIndex = 168; - label177.Text = "三相平均相电压"; - // - // label178 - // - label178.AutoSize = true; - label178.Location = new Point(813, 615); - label178.Name = "label178"; - label178.Size = new Size(68, 20); - label178.TabIndex = 167; - label178.Text = "0.0001V"; - // - // label179 - // - label179.AutoSize = true; - label179.Location = new Point(689, 615); - label179.Name = "label179"; - label179.Size = new Size(122, 20); - label179.TabIndex = 166; - label179.Text = "三相平均线电压 "; - // - // label180 - // - label180.AutoSize = true; - label180.Location = new Point(582, 615); - label180.Name = "label180"; - label180.Size = new Size(68, 20); - label180.TabIndex = 165; - label180.Text = "0.0001V"; - // - // label181 - // - label181.AutoSize = true; - label181.Location = new Point(458, 615); - label181.Name = "label181"; - label181.Size = new Size(84, 20); - label181.TabIndex = 164; - label181.Text = "A 相线电压"; - // - // label182 - // - label182.AutoSize = true; - label182.Location = new Point(353, 615); - label182.Name = "label182"; - label182.Size = new Size(68, 20); - label182.TabIndex = 163; - label182.Text = "0.0001V"; - // - // label183 - // - label183.AutoSize = true; - label183.Location = new Point(225, 615); - label183.Name = "label183"; - label183.Size = new Size(84, 20); - label183.TabIndex = 162; - label183.Text = "A 相线电压"; - // - // label184 - // - label184.AutoSize = true; - label184.Location = new Point(141, 615); - label184.Name = "label184"; - label184.Size = new Size(68, 20); - label184.TabIndex = 161; - label184.Text = "0.0001V"; - // - // label185 - // - label185.AutoSize = true; - label185.Location = new Point(17, 615); - label185.Name = "label185"; - label185.Size = new Size(84, 20); - label185.TabIndex = 160; - label185.Text = "A 相线电压"; - // - // label142 - // - label142.AutoSize = true; - label142.Location = new Point(817, 581); - label142.Name = "label142"; - label142.Size = new Size(59, 20); - label142.TabIndex = 159; - label142.Text = "0.01Hz"; - // - // label143 - // - label143.AutoSize = true; - label143.Location = new Point(693, 581); - label143.Name = "label143"; - label143.Size = new Size(69, 20); - label143.TabIndex = 158; - label143.Text = "电网频率"; - // - // label152 - // - label152.AutoSize = true; - label152.Location = new Point(586, 581); - label152.Name = "label152"; - label152.Size = new Size(46, 20); - label152.TabIndex = 157; - label152.Text = "0.01°"; - // - // label153 - // - label153.AutoSize = true; - label153.Location = new Point(462, 581); - label153.Name = "label153"; - label153.Size = new Size(69, 20); - label153.TabIndex = 156; - label153.Text = "A 相相角"; - // - // label162 - // - label162.AutoSize = true; - label162.Location = new Point(357, 581); - label162.Name = "label162"; - label162.Size = new Size(46, 20); - label162.TabIndex = 155; - label162.Text = "0.01°"; - // - // label163 - // - label163.AutoSize = true; - label163.Location = new Point(229, 581); - label163.Name = "label163"; - label163.Size = new Size(69, 20); - label163.TabIndex = 154; - label163.Text = "A 相相角"; - // - // label174 - // - label174.AutoSize = true; - label174.Location = new Point(145, 581); - label174.Name = "label174"; - label174.Size = new Size(46, 20); - label174.TabIndex = 153; - label174.Text = "0.01°"; - // - // label175 - // - label175.AutoSize = true; - label175.Location = new Point(21, 581); - label175.Name = "label175"; - label175.Size = new Size(69, 20); - label175.TabIndex = 152; - label175.Text = "A 相相角"; - // - // label172 - // - label172.AutoSize = true; - label172.Location = new Point(1022, 419); - label172.Name = "label172"; - label172.Size = new Size(69, 20); - label172.TabIndex = 151; - label172.Text = "0.0001A"; - // - // label173 - // - label173.AutoSize = true; - label173.Location = new Point(938, 419); - label173.Name = "label173"; - label173.Size = new Size(64, 20); - label173.TabIndex = 150; - label173.Text = "C相电流"; - // - // label164 - // - label164.AutoSize = true; - label164.Location = new Point(815, 512); - label164.Name = "label164"; - label164.Size = new Size(87, 20); - label164.TabIndex = 147; - label164.Text = "0.0001kVA"; - // - // label165 - // - label165.AutoSize = true; - label165.Location = new Point(691, 512); - label165.Name = "label165"; - label165.Size = new Size(99, 20); - label165.TabIndex = 146; - label165.Text = "A 相视在功率"; - // - // label166 - // - label166.AutoSize = true; - label166.Location = new Point(584, 512); - label166.Name = "label166"; - label166.Size = new Size(87, 20); - label166.TabIndex = 145; - label166.Text = "0.0001kVA"; - // - // label167 - // - label167.AutoSize = true; - label167.Location = new Point(460, 512); - label167.Name = "label167"; - label167.Size = new Size(99, 20); - label167.TabIndex = 144; - label167.Text = "A 相视在功率"; - // - // label168 - // - label168.AutoSize = true; - label168.Location = new Point(355, 512); - label168.Name = "label168"; - label168.Size = new Size(87, 20); - label168.TabIndex = 143; - label168.Text = "0.0001kVA"; - // - // label169 - // - label169.AutoSize = true; - label169.Location = new Point(227, 512); - label169.Name = "label169"; - label169.Size = new Size(99, 20); - label169.TabIndex = 142; - label169.Text = "A 相视在功率"; - // - // label170 - // - label170.AutoSize = true; - label170.Location = new Point(143, 512); - label170.Name = "label170"; - label170.Size = new Size(87, 20); - label170.TabIndex = 141; - label170.Text = "0.0001kVA"; - // - // label171 - // - label171.AutoSize = true; - label171.Location = new Point(19, 512); - label171.Name = "label171"; - label171.Size = new Size(84, 20); - label171.TabIndex = 140; - label171.Text = "总视在功率"; - // - // label154 - // - label154.AutoSize = true; - label154.Location = new Point(817, 482); - label154.Name = "label154"; - label154.Size = new Size(88, 20); - label154.TabIndex = 137; - label154.Text = "0.0001kvar"; - // - // label155 - // - label155.AutoSize = true; - label155.Location = new Point(693, 482); - label155.Name = "label155"; - label155.Size = new Size(118, 20); - label155.TabIndex = 136; - label155.Text = "A 相无功总功率 "; - // - // label156 - // - label156.AutoSize = true; - label156.Location = new Point(586, 482); - label156.Name = "label156"; - label156.Size = new Size(88, 20); - label156.TabIndex = 135; - label156.Text = "0.0001kvar"; - // - // label157 - // - label157.AutoSize = true; - label157.Location = new Point(462, 482); - label157.Name = "label157"; - label157.Size = new Size(118, 20); - label157.TabIndex = 134; - label157.Text = "A 相无功总功率 "; - // - // label158 - // - label158.AutoSize = true; - label158.Location = new Point(357, 482); - label158.Name = "label158"; - label158.Size = new Size(88, 20); - label158.TabIndex = 133; - label158.Text = "0.0001kvar"; - // - // label159 - // - label159.AutoSize = true; - label159.Location = new Point(229, 482); - label159.Name = "label159"; - label159.Size = new Size(118, 20); - label159.TabIndex = 132; - label159.Text = "A 相无功总功率 "; - // - // label160 - // - label160.AutoSize = true; - label160.Location = new Point(145, 482); - label160.Name = "label160"; - label160.Size = new Size(88, 20); - label160.TabIndex = 131; - label160.Text = "0.0001kvar"; - // - // label161 - // - label161.AutoSize = true; - label161.Location = new Point(21, 482); - label161.Name = "label161"; - label161.Size = new Size(88, 20); - label161.TabIndex = 130; - label161.Text = "无功总功率 "; - // - // label144 - // - label144.AutoSize = true; - label144.Location = new Point(817, 450); - label144.Name = "label144"; - label144.Size = new Size(81, 20); - label144.TabIndex = 127; - label144.Text = "0.0001kW"; - // - // label145 - // - label145.AutoSize = true; - label145.Location = new Point(693, 450); - label145.Name = "label145"; - label145.Size = new Size(114, 20); - label145.TabIndex = 126; - label145.Text = "A 相有功总功率"; - // - // label146 - // - label146.AutoSize = true; - label146.Location = new Point(586, 450); - label146.Name = "label146"; - label146.Size = new Size(81, 20); - label146.TabIndex = 125; - label146.Text = "0.0001kW"; - // - // label147 - // - label147.AutoSize = true; - label147.Location = new Point(462, 450); - label147.Name = "label147"; - label147.Size = new Size(114, 20); - label147.TabIndex = 124; - label147.Text = "A 相有功总功率"; - // - // label148 - // - label148.AutoSize = true; - label148.Location = new Point(357, 450); - label148.Name = "label148"; - label148.Size = new Size(81, 20); - label148.TabIndex = 123; - label148.Text = "0.0001kW"; - // - // label149 - // - label149.AutoSize = true; - label149.Location = new Point(229, 450); - label149.Name = "label149"; - label149.Size = new Size(114, 20); - label149.TabIndex = 122; - label149.Text = "A 相有功总功率"; - // - // label150 - // - label150.AutoSize = true; - label150.Location = new Point(145, 450); - label150.Name = "label150"; - label150.Size = new Size(81, 20); - label150.TabIndex = 121; - label150.Text = "0.0001kW"; - // - // label151 - // - label151.AutoSize = true; - label151.Location = new Point(21, 450); - label151.Name = "label151"; - label151.Size = new Size(84, 20); - label151.TabIndex = 120; - label151.Text = "有功总功率"; - // - // label132 - // - label132.AutoSize = true; - label132.Location = new Point(836, 419); - label132.Name = "label132"; - label132.Size = new Size(69, 20); - label132.TabIndex = 119; - label132.Text = "0.0001A"; - // - // label133 - // - label133.AutoSize = true; - label133.Location = new Point(752, 419); - label133.Name = "label133"; - label133.Size = new Size(63, 20); - label133.TabIndex = 118; - label133.Text = "B相电流"; - // - // label134 - // - label134.AutoSize = true; - label134.Location = new Point(646, 419); - label134.Name = "label134"; - label134.Size = new Size(69, 20); - label134.TabIndex = 117; - label134.Text = "0.0001A"; - // - // label135 - // - label135.AutoSize = true; - label135.Location = new Point(571, 419); - label135.Name = "label135"; - label135.Size = new Size(69, 20); - label135.TabIndex = 116; - label135.Text = "A 相电流"; - // - // label136 - // - label136.AutoSize = true; - label136.Location = new Point(450, 419); - label136.Name = "label136"; - label136.Size = new Size(68, 20); - label136.TabIndex = 115; - label136.Text = "0.0001V"; - // - // label137 - // - label137.AutoSize = true; - label137.Location = new Point(380, 419); - label137.Name = "label137"; - label137.Size = new Size(64, 20); - label137.TabIndex = 114; - label137.Text = "C相电压"; - // - // label138 - // - label138.AutoSize = true; - label138.Location = new Point(270, 419); - label138.Name = "label138"; - label138.Size = new Size(68, 20); - label138.TabIndex = 113; - label138.Text = "0.0001V"; - // - // label139 - // - label139.AutoSize = true; - label139.Location = new Point(201, 419); - label139.Name = "label139"; - label139.Size = new Size(63, 20); - label139.TabIndex = 112; - label139.Text = "B相电压"; - // - // label140 - // - label140.AutoSize = true; - label140.Location = new Point(100, 419); - label140.Name = "label140"; - label140.Size = new Size(68, 20); - label140.TabIndex = 111; - label140.Text = "0.0001V"; - // - // label141 - // - label141.AutoSize = true; - label141.Location = new Point(21, 419); - label141.Name = "label141"; - label141.Size = new Size(73, 20); - label141.TabIndex = 110; - label141.Text = "A 相电压 "; - // - // label122 - // - label122.AutoSize = true; - label122.Location = new Point(1067, 369); - label122.Name = "label122"; - label122.Size = new Size(82, 20); - label122.TabIndex = 109; - label122.Text = "0.01kVAh "; - // - // label123 - // - label123.AutoSize = true; - label123.Location = new Point(929, 369); - label123.Name = "label123"; - label123.Size = new Size(114, 20); - label123.TabIndex = 108; - label123.Text = "组合有功谷电能"; - // - // label124 - // - label124.AutoSize = true; - label124.Location = new Point(819, 369); - label124.Name = "label124"; - label124.Size = new Size(82, 20); - label124.TabIndex = 107; - label124.Text = "0.01kVAh "; - // - // label125 - // - label125.AutoSize = true; - label125.Location = new Point(695, 369); - label125.Name = "label125"; - label125.Size = new Size(118, 20); - label125.TabIndex = 106; - label125.Text = "组合有功平电能 "; - // - // label126 - // - label126.AutoSize = true; - label126.Location = new Point(588, 369); - label126.Name = "label126"; - label126.Size = new Size(82, 20); - label126.TabIndex = 105; - label126.Text = "0.01kVAh "; - // - // label127 - // - label127.AutoSize = true; - label127.Location = new Point(464, 369); - label127.Name = "label127"; - label127.Size = new Size(118, 20); - label127.TabIndex = 104; - label127.Text = "组合有功峰电能 "; - // - // label128 - // - label128.AutoSize = true; - label128.Location = new Point(359, 369); - label128.Name = "label128"; - label128.Size = new Size(82, 20); - label128.TabIndex = 103; - label128.Text = "0.01kVAh "; - // - // label129 - // - label129.AutoSize = true; - label129.Location = new Point(231, 369); - label129.Name = "label129"; - label129.Size = new Size(122, 20); - label129.TabIndex = 102; - label129.Text = "组合有功尖电能 "; - // - // label130 - // - label130.AutoSize = true; - label130.Location = new Point(147, 369); - label130.Name = "label130"; - label130.Size = new Size(82, 20); - label130.TabIndex = 101; - label130.Text = "0.01kVAh "; - // - // label131 - // - label131.AutoSize = true; - label131.Location = new Point(23, 369); - label131.Name = "label131"; - label131.Size = new Size(114, 20); - label131.TabIndex = 100; - label131.Text = "反向视在总电能"; - // - // label112 - // - label112.AutoSize = true; - label112.Location = new Point(1067, 338); - label112.Name = "label112"; - label112.Size = new Size(82, 20); - label112.TabIndex = 99; - label112.Text = "0.01kVAh "; - // - // label113 - // - label113.AutoSize = true; - label113.Location = new Point(929, 338); - label113.Name = "label113"; - label113.Size = new Size(114, 20); - label113.TabIndex = 98; - label113.Text = "组合有功谷电能"; - // - // label114 - // - label114.AutoSize = true; - label114.Location = new Point(819, 338); - label114.Name = "label114"; - label114.Size = new Size(82, 20); - label114.TabIndex = 97; - label114.Text = "0.01kVAh "; - // - // label115 - // - label115.AutoSize = true; - label115.Location = new Point(695, 338); - label115.Name = "label115"; - label115.Size = new Size(118, 20); - label115.TabIndex = 96; - label115.Text = "组合有功平电能 "; - // - // label116 - // - label116.AutoSize = true; - label116.Location = new Point(588, 338); - label116.Name = "label116"; - label116.Size = new Size(82, 20); - label116.TabIndex = 95; - label116.Text = "0.01kVAh "; - // - // label117 - // - label117.AutoSize = true; - label117.Location = new Point(464, 338); - label117.Name = "label117"; - label117.Size = new Size(118, 20); - label117.TabIndex = 94; - label117.Text = "组合有功峰电能 "; - // - // label118 - // - label118.AutoSize = true; - label118.Location = new Point(359, 338); - label118.Name = "label118"; - label118.Size = new Size(82, 20); - label118.TabIndex = 93; - label118.Text = "0.01kVAh "; - // - // label119 - // - label119.AutoSize = true; - label119.Location = new Point(231, 338); - label119.Name = "label119"; - label119.Size = new Size(122, 20); - label119.TabIndex = 92; - label119.Text = "组合有功尖电能 "; - // - // label120 - // - label120.AutoSize = true; - label120.Location = new Point(147, 338); - label120.Name = "label120"; - label120.Size = new Size(82, 20); - label120.TabIndex = 91; - label120.Text = "0.01kVAh "; - // - // label121 - // - label121.AutoSize = true; - label121.Location = new Point(23, 338); - label121.Name = "label121"; - label121.Size = new Size(118, 20); - label121.TabIndex = 90; - label121.Text = "正向视在总电能 "; - // - // label102 - // - label102.AutoSize = true; - label102.Location = new Point(1065, 308); - label102.Name = "label102"; - label102.Size = new Size(79, 20); - label102.TabIndex = 89; - label102.Text = "0.01kvarh"; - // - // label103 - // - label103.AutoSize = true; - label103.Location = new Point(927, 308); - label103.Name = "label103"; - label103.Size = new Size(114, 20); - label103.TabIndex = 88; - label103.Text = "组合有功谷电能"; - // - // label104 - // - label104.AutoSize = true; - label104.Location = new Point(817, 308); - label104.Name = "label104"; - label104.Size = new Size(79, 20); - label104.TabIndex = 87; - label104.Text = "0.01kvarh"; - // - // label105 - // - label105.AutoSize = true; - label105.Location = new Point(693, 308); - label105.Name = "label105"; - label105.Size = new Size(118, 20); - label105.TabIndex = 86; - label105.Text = "组合有功平电能 "; - // - // label106 - // - label106.AutoSize = true; - label106.Location = new Point(586, 308); - label106.Name = "label106"; - label106.Size = new Size(79, 20); - label106.TabIndex = 85; - label106.Text = "0.01kvarh"; - // - // label107 - // - label107.AutoSize = true; - label107.Location = new Point(462, 308); - label107.Name = "label107"; - label107.Size = new Size(118, 20); - label107.TabIndex = 84; - label107.Text = "组合有功峰电能 "; - // - // label108 - // - label108.AutoSize = true; - label108.Location = new Point(357, 308); - label108.Name = "label108"; - label108.Size = new Size(79, 20); - label108.TabIndex = 83; - label108.Text = "0.01kvarh"; - // - // label109 - // - label109.AutoSize = true; - label109.Location = new Point(229, 308); - label109.Name = "label109"; - label109.Size = new Size(122, 20); - label109.TabIndex = 82; - label109.Text = "组合有功尖电能 "; - // - // label110 - // - label110.AutoSize = true; - label110.Location = new Point(145, 308); - label110.Name = "label110"; - label110.Size = new Size(79, 20); - label110.TabIndex = 81; - label110.Text = "0.01kvarh"; - // - // label111 - // - label111.AutoSize = true; - label111.Location = new Point(21, 308); - label111.Name = "label111"; - label111.Size = new Size(129, 20); - label111.TabIndex = 80; - label111.Text = "四象限无功总电能"; - // - // label92 - // - label92.AutoSize = true; - label92.Location = new Point(1065, 276); - label92.Name = "label92"; - label92.Size = new Size(79, 20); - label92.TabIndex = 79; - label92.Text = "0.01kvarh"; - // - // label93 - // - label93.AutoSize = true; - label93.Location = new Point(927, 276); - label93.Name = "label93"; - label93.Size = new Size(114, 20); - label93.TabIndex = 78; - label93.Text = "组合有功谷电能"; - // - // label94 - // - label94.AutoSize = true; - label94.Location = new Point(817, 276); - label94.Name = "label94"; - label94.Size = new Size(79, 20); - label94.TabIndex = 77; - label94.Text = "0.01kvarh"; - // - // label95 - // - label95.AutoSize = true; - label95.Location = new Point(693, 276); - label95.Name = "label95"; - label95.Size = new Size(118, 20); - label95.TabIndex = 76; - label95.Text = "组合有功平电能 "; - // - // label96 - // - label96.AutoSize = true; - label96.Location = new Point(586, 276); - label96.Name = "label96"; - label96.Size = new Size(79, 20); - label96.TabIndex = 75; - label96.Text = "0.01kvarh"; - // - // label97 - // - label97.AutoSize = true; - label97.Location = new Point(462, 276); - label97.Name = "label97"; - label97.Size = new Size(118, 20); - label97.TabIndex = 74; - label97.Text = "组合有功峰电能 "; - // - // label98 - // - label98.AutoSize = true; - label98.Location = new Point(357, 276); - label98.Name = "label98"; - label98.Size = new Size(79, 20); - label98.TabIndex = 73; - label98.Text = "0.01kvarh"; - // - // label99 - // - label99.AutoSize = true; - label99.Location = new Point(229, 276); - label99.Name = "label99"; - label99.Size = new Size(122, 20); - label99.TabIndex = 72; - label99.Text = "组合有功尖电能 "; - // - // label100 - // - label100.AutoSize = true; - label100.Location = new Point(145, 276); - label100.Name = "label100"; - label100.Size = new Size(79, 20); - label100.TabIndex = 71; - label100.Text = "0.01kvarh"; - // - // label101 - // - label101.AutoSize = true; - label101.Location = new Point(21, 276); - label101.Name = "label101"; - label101.Size = new Size(129, 20); - label101.TabIndex = 70; - label101.Text = "三象限无功总电能"; - // - // label82 - // - label82.AutoSize = true; - label82.Location = new Point(1063, 244); - label82.Name = "label82"; - label82.Size = new Size(79, 20); - label82.TabIndex = 69; - label82.Text = "0.01kvarh"; - // - // label83 - // - label83.AutoSize = true; - label83.Location = new Point(925, 244); - label83.Name = "label83"; - label83.Size = new Size(114, 20); - label83.TabIndex = 68; - label83.Text = "组合有功谷电能"; - // - // label84 - // - label84.AutoSize = true; - label84.Location = new Point(815, 244); - label84.Name = "label84"; - label84.Size = new Size(79, 20); - label84.TabIndex = 67; - label84.Text = "0.01kvarh"; - // - // label85 - // - label85.AutoSize = true; - label85.Location = new Point(691, 244); - label85.Name = "label85"; - label85.Size = new Size(118, 20); - label85.TabIndex = 66; - label85.Text = "组合有功平电能 "; - // - // label86 - // - label86.AutoSize = true; - label86.Location = new Point(584, 244); - label86.Name = "label86"; - label86.Size = new Size(79, 20); - label86.TabIndex = 65; - label86.Text = "0.01kvarh"; - // - // label87 - // - label87.AutoSize = true; - label87.Location = new Point(460, 244); - label87.Name = "label87"; - label87.Size = new Size(118, 20); - label87.TabIndex = 64; - label87.Text = "组合有功峰电能 "; - // - // label88 - // - label88.AutoSize = true; - label88.Location = new Point(355, 244); - label88.Name = "label88"; - label88.Size = new Size(79, 20); - label88.TabIndex = 63; - label88.Text = "0.01kvarh"; - // - // label89 - // - label89.AutoSize = true; - label89.Location = new Point(227, 244); - label89.Name = "label89"; - label89.Size = new Size(122, 20); - label89.TabIndex = 62; - label89.Text = "组合有功尖电能 "; - // - // label90 - // - label90.AutoSize = true; - label90.Location = new Point(143, 244); - label90.Name = "label90"; - label90.Size = new Size(79, 20); - label90.TabIndex = 61; - label90.Text = "0.01kvarh"; - // - // label91 - // - label91.AutoSize = true; - label91.Location = new Point(19, 244); - label91.Name = "label91"; - label91.Size = new Size(129, 20); - label91.TabIndex = 60; - label91.Text = "二象限无功总电能"; - // - // label72 - // - label72.AutoSize = true; - label72.Location = new Point(1063, 210); - label72.Name = "label72"; - label72.Size = new Size(79, 20); - label72.TabIndex = 59; - label72.Text = "0.01kvarh"; - // - // label73 - // - label73.AutoSize = true; - label73.Location = new Point(925, 210); - label73.Name = "label73"; - label73.Size = new Size(114, 20); - label73.TabIndex = 58; - label73.Text = "组合有功谷电能"; - // - // label74 - // - label74.AutoSize = true; - label74.Location = new Point(815, 210); - label74.Name = "label74"; - label74.Size = new Size(79, 20); - label74.TabIndex = 57; - label74.Text = "0.01kvarh"; - // - // label75 - // - label75.AutoSize = true; - label75.Location = new Point(691, 210); - label75.Name = "label75"; - label75.Size = new Size(118, 20); - label75.TabIndex = 56; - label75.Text = "组合有功平电能 "; - // - // label76 - // - label76.AutoSize = true; - label76.Location = new Point(584, 210); - label76.Name = "label76"; - label76.Size = new Size(79, 20); - label76.TabIndex = 55; - label76.Text = "0.01kvarh"; - // - // label77 - // - label77.AutoSize = true; - label77.Location = new Point(460, 210); - label77.Name = "label77"; - label77.Size = new Size(118, 20); - label77.TabIndex = 54; - label77.Text = "组合有功峰电能 "; - // - // label78 - // - label78.AutoSize = true; - label78.Location = new Point(355, 210); - label78.Name = "label78"; - label78.Size = new Size(79, 20); - label78.TabIndex = 53; - label78.Text = "0.01kvarh"; - // - // label79 - // - label79.AutoSize = true; - label79.Location = new Point(227, 210); - label79.Name = "label79"; - label79.Size = new Size(122, 20); - label79.TabIndex = 52; - label79.Text = "组合有功尖电能 "; - // - // label80 - // - label80.AutoSize = true; - label80.Location = new Point(143, 210); - label80.Name = "label80"; - label80.Size = new Size(79, 20); - label80.TabIndex = 51; - label80.Text = "0.01kvarh"; - // - // label81 - // - label81.AutoSize = true; - label81.Location = new Point(19, 210); - label81.Name = "label81"; - label81.Size = new Size(129, 20); - label81.TabIndex = 50; - label81.Text = "一象限无功总电能"; - // - // label62 - // - label62.AutoSize = true; - label62.Location = new Point(1063, 179); - label62.Name = "label62"; - label62.Size = new Size(79, 20); - label62.TabIndex = 49; - label62.Text = "0.01kvarh"; - // - // label63 - // - label63.AutoSize = true; - label63.Location = new Point(925, 179); - label63.Name = "label63"; - label63.Size = new Size(114, 20); - label63.TabIndex = 48; - label63.Text = "组合有功谷电能"; - // - // label64 - // - label64.AutoSize = true; - label64.Location = new Point(815, 179); - label64.Name = "label64"; - label64.Size = new Size(79, 20); - label64.TabIndex = 47; - label64.Text = "0.01kvarh"; - // - // label65 - // - label65.AutoSize = true; - label65.Location = new Point(691, 179); - label65.Name = "label65"; - label65.Size = new Size(118, 20); - label65.TabIndex = 46; - label65.Text = "组合有功平电能 "; - // - // label66 - // - label66.AutoSize = true; - label66.Location = new Point(584, 179); - label66.Name = "label66"; - label66.Size = new Size(79, 20); - label66.TabIndex = 45; - label66.Text = "0.01kvarh"; - // - // label67 - // - label67.AutoSize = true; - label67.Location = new Point(460, 179); - label67.Name = "label67"; - label67.Size = new Size(118, 20); - label67.TabIndex = 44; - label67.Text = "组合有功峰电能 "; - // - // label68 - // - label68.AutoSize = true; - label68.Location = new Point(355, 179); - label68.Name = "label68"; - label68.Size = new Size(79, 20); - label68.TabIndex = 43; - label68.Text = "0.01kvarh"; - // - // label69 - // - label69.AutoSize = true; - label69.Location = new Point(227, 179); - label69.Name = "label69"; - label69.Size = new Size(122, 20); - label69.TabIndex = 42; - label69.Text = "组合有功尖电能 "; - // - // label70 - // - label70.AutoSize = true; - label70.Location = new Point(143, 179); - label70.Name = "label70"; - label70.Size = new Size(79, 20); - label70.TabIndex = 41; - label70.Text = "0.01kvarh"; - // - // label71 - // - label71.AutoSize = true; - label71.Location = new Point(19, 179); - label71.Name = "label71"; - label71.Size = new Size(127, 20); - label71.TabIndex = 40; - label71.Text = "组合无功2总电能 "; - // - // label52 - // - label52.AutoSize = true; - label52.Location = new Point(1065, 149); - label52.Name = "label52"; - label52.Size = new Size(79, 20); - label52.TabIndex = 39; - label52.Text = "0.01kvarh"; - // - // label53 - // - label53.AutoSize = true; - label53.Location = new Point(927, 149); - label53.Name = "label53"; - label53.Size = new Size(127, 20); - label53.TabIndex = 38; - label53.Text = "组合无功1谷电能 "; - // - // label54 - // - label54.AutoSize = true; - label54.Location = new Point(817, 149); - label54.Name = "label54"; - label54.Size = new Size(79, 20); - label54.TabIndex = 37; - label54.Text = "0.01kvarh"; - // - // label55 - // - label55.AutoSize = true; - label55.Location = new Point(693, 149); - label55.Name = "label55"; - label55.Size = new Size(127, 20); - label55.TabIndex = 36; - label55.Text = "组合无功1平电能 "; - // - // label56 - // - label56.AutoSize = true; - label56.Location = new Point(586, 149); - label56.Name = "label56"; - label56.Size = new Size(79, 20); - label56.TabIndex = 35; - label56.Text = "0.01kvarh"; - // - // label57 - // - label57.AutoSize = true; - label57.Location = new Point(462, 149); - label57.Name = "label57"; - label57.Size = new Size(127, 20); - label57.TabIndex = 34; - label57.Text = "组合无功1峰电能 "; - // - // label58 - // - label58.AutoSize = true; - label58.Location = new Point(357, 149); - label58.Name = "label58"; - label58.Size = new Size(79, 20); - label58.TabIndex = 33; - label58.Text = "0.01kvarh"; - // - // label59 - // - label59.AutoSize = true; - label59.Location = new Point(229, 149); - label59.Name = "label59"; - label59.Size = new Size(127, 20); - label59.TabIndex = 32; - label59.Text = "组合无功1尖电能 "; - // - // label60 - // - label60.AutoSize = true; - label60.Location = new Point(145, 149); - label60.Name = "label60"; - label60.Size = new Size(79, 20); - label60.TabIndex = 31; - label60.Text = "0.01kvarh"; - // - // label61 - // - label61.AutoSize = true; - label61.Location = new Point(21, 149); - label61.Name = "label61"; - label61.Size = new Size(123, 20); - label61.TabIndex = 30; - label61.Text = "组合无功1总电能"; - // - // label42 - // - label42.AutoSize = true; - label42.Location = new Point(1063, 120); - label42.Name = "label42"; - label42.Size = new Size(72, 20); - label42.TabIndex = 29; - label42.Text = "0.01kWh"; - // - // label43 - // - label43.AutoSize = true; - label43.Location = new Point(925, 120); - label43.Name = "label43"; - label43.Size = new Size(114, 20); - label43.TabIndex = 28; - label43.Text = "正向有功谷电能"; - // - // label44 - // - label44.AutoSize = true; - label44.Location = new Point(815, 120); - label44.Name = "label44"; - label44.Size = new Size(72, 20); - label44.TabIndex = 27; - label44.Text = "0.01kWh"; - // - // label45 - // - label45.AutoSize = true; - label45.Location = new Point(691, 120); - label45.Name = "label45"; - label45.Size = new Size(118, 20); - label45.TabIndex = 26; - label45.Text = "正向有功平电能 "; - // - // label46 - // - label46.AutoSize = true; - label46.Location = new Point(584, 120); - label46.Name = "label46"; - label46.Size = new Size(72, 20); - label46.TabIndex = 25; - label46.Text = "0.01kWh"; - // - // label47 - // - label47.AutoSize = true; - label47.Location = new Point(460, 120); - label47.Name = "label47"; - label47.Size = new Size(118, 20); - label47.TabIndex = 24; - label47.Text = "正向有功峰电能 "; - // - // label48 - // - label48.AutoSize = true; - label48.Location = new Point(355, 120); - label48.Name = "label48"; - label48.Size = new Size(80, 20); - label48.TabIndex = 23; - label48.Text = "0.01kWh "; - // - // label49 - // - label49.AutoSize = true; - label49.Location = new Point(227, 120); - label49.Name = "label49"; - label49.Size = new Size(122, 20); - label49.TabIndex = 22; - label49.Text = "正向有功尖电能 "; - // - // label50 - // - label50.AutoSize = true; - label50.Location = new Point(143, 120); - label50.Name = "label50"; - label50.Size = new Size(80, 20); - label50.TabIndex = 21; - label50.Text = "0.01kWh "; - // - // label51 - // - label51.AutoSize = true; - label51.Location = new Point(19, 120); - label51.Name = "label51"; - label51.Size = new Size(118, 20); - label51.TabIndex = 20; - label51.Text = "反向有功总电能 "; - // - // label32 - // - label32.AutoSize = true; - label32.Location = new Point(1065, 81); - label32.Name = "label32"; - label32.Size = new Size(72, 20); - label32.TabIndex = 19; - label32.Text = "0.01kWh"; - // - // label33 - // - label33.AutoSize = true; - label33.Location = new Point(927, 81); - label33.Name = "label33"; - label33.Size = new Size(114, 20); - label33.TabIndex = 18; - label33.Text = "组合有功谷电能"; - // - // label34 - // - label34.AutoSize = true; - label34.Location = new Point(817, 81); - label34.Name = "label34"; - label34.Size = new Size(72, 20); - label34.TabIndex = 17; - label34.Text = "0.01kWh"; - // - // label35 - // - label35.AutoSize = true; - label35.Location = new Point(693, 81); - label35.Name = "label35"; - label35.Size = new Size(118, 20); - label35.TabIndex = 16; - label35.Text = "组合有功平电能 "; - // - // label36 - // - label36.AutoSize = true; - label36.Location = new Point(586, 81); - label36.Name = "label36"; - label36.Size = new Size(72, 20); - label36.TabIndex = 15; - label36.Text = "0.01kWh"; - // - // label37 - // - label37.AutoSize = true; - label37.Location = new Point(462, 81); - label37.Name = "label37"; - label37.Size = new Size(118, 20); - label37.TabIndex = 14; - label37.Text = "组合有功峰电能 "; - // - // label38 - // - label38.AutoSize = true; - label38.Location = new Point(357, 81); - label38.Name = "label38"; - label38.Size = new Size(80, 20); - label38.TabIndex = 13; - label38.Text = "0.01kWh "; - // - // label39 - // - label39.AutoSize = true; - label39.Location = new Point(229, 81); - label39.Name = "label39"; - label39.Size = new Size(122, 20); - label39.TabIndex = 12; - label39.Text = "组合有功尖电能 "; - // - // label40 - // - label40.AutoSize = true; - label40.Location = new Point(145, 81); - label40.Name = "label40"; - label40.Size = new Size(80, 20); - label40.TabIndex = 11; - label40.Text = "0.01kWh "; - // - // label41 - // - label41.AutoSize = true; - label41.Location = new Point(21, 81); - label41.Name = "label41"; - label41.Size = new Size(118, 20); - label41.TabIndex = 10; - label41.Text = "正向有功总电能 "; - // - // label30 - // - label30.AutoSize = true; - label30.Location = new Point(1065, 43); - label30.Name = "label30"; - label30.Size = new Size(72, 20); - label30.TabIndex = 9; - label30.Text = "0.01kWh"; - // - // label31 - // - label31.AutoSize = true; - label31.Location = new Point(927, 43); - label31.Name = "label31"; - label31.Size = new Size(114, 20); - label31.TabIndex = 8; - label31.Text = "组合有功谷电能"; - // - // label28 - // - label28.AutoSize = true; - label28.Location = new Point(817, 43); - label28.Name = "label28"; - label28.Size = new Size(72, 20); - label28.TabIndex = 7; - label28.Text = "0.01kWh"; - // - // label29 - // - label29.AutoSize = true; - label29.Location = new Point(693, 43); - label29.Name = "label29"; - label29.Size = new Size(118, 20); - label29.TabIndex = 6; - label29.Text = "组合有功平电能 "; - // - // label26 - // - label26.AutoSize = true; - label26.Location = new Point(586, 43); - label26.Name = "label26"; - label26.Size = new Size(72, 20); - label26.TabIndex = 5; - label26.Text = "0.01kWh"; - // - // label27 - // - label27.AutoSize = true; - label27.Location = new Point(462, 43); - label27.Name = "label27"; - label27.Size = new Size(118, 20); - label27.TabIndex = 4; - label27.Text = "组合有功峰电能 "; - // - // label24 - // - label24.AutoSize = true; - label24.Location = new Point(357, 43); - label24.Name = "label24"; - label24.Size = new Size(80, 20); - label24.TabIndex = 3; - label24.Text = "0.01kWh "; - // - // label25 - // - label25.AutoSize = true; - label25.Location = new Point(229, 43); - label25.Name = "label25"; - label25.Size = new Size(122, 20); - label25.TabIndex = 2; - label25.Text = "组合有功尖电能 "; - // - // label23 - // - label23.AutoSize = true; - label23.Location = new Point(145, 43); - label23.Name = "label23"; - label23.Size = new Size(80, 20); - label23.TabIndex = 1; - label23.Text = "0.01kWh "; - // - // label19 - // - label19.AutoSize = true; - label19.Location = new Point(21, 43); - label19.Name = "label19"; - label19.Size = new Size(118, 20); - label19.TabIndex = 0; - label19.Text = "组合有功总电能 "; - // - // FrmPLCConnect - // - AutoScaleDimensions = new SizeF(9F, 20F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1195, 1023); - Controls.Add(groupBox3); - Controls.Add(groupBox2); - Controls.Add(groupBox1); - Name = "FrmPLCConnect"; - Text = "FrmPLCConnect"; - groupBox1.ResumeLayout(false); - groupBox1.PerformLayout(); - groupBox2.ResumeLayout(false); - groupBox2.PerformLayout(); - groupBox3.ResumeLayout(false); - groupBox3.PerformLayout(); - ResumeLayout(false); - } - - #endregion - private Button BtnWrite18; - private TextBox textBox18; - private Label label18; - private Button BtnWrite17; - private TextBox textBox17; - private Label label17; - private Button BtnWrite16; - private TextBox textBox16; - private Label label16; - private Button BtnWrite15; - private TextBox textBox15; - private Label label15; - private GroupBox groupBox1; - private Button BtnCollectionAssignment; - private Label label22; - private Label label21; - private Label label20; - private TextBox TxtSite; - private Label LblConState; - private Button BtnConnect; - private TextBox TxtPort; - private TextBox TxtIp; - private Button BtnWrite14; - private TextBox textBox14; - private Label label14; - private Button BtnWrite13; - private TextBox textBox13; - private Label label13; - private Button BtnWrite12; - private TextBox textBox12; - private Label label12; - private Button BtnWrite11; - private TextBox textBox11; - private Label label11; - private Button BtnWrite10; - private TextBox textBox10; - private Label label10; - private Button BtnWrite09; - private TextBox textBox9; - private Label label9; - private Button BtnWrite08; - private TextBox textBox8; - private Label label8; - private Button BtnWrite07; - private TextBox textBox7; - private Label label7; - private Button BtnWrite06; - private TextBox textBox6; - private Label label6; - private Button BtnWrite05; - private TextBox textBox5; - private Label label5; - private Button BtnWrite04; - private TextBox textBox4; - private Label label4; - private Button BtnWrite03; - private TextBox textBox3; - private Label label3; - private Button BtnWrite02; - private TextBox textBox2; - private Label label2; - private Button BtnWrite01; - private TextBox textBox1; - private Label label1; - private GroupBox groupBox2; - private GroupBox groupBox3; - private Label label164; - private Label label165; - private Label label166; - private Label label167; - private Label label168; - private Label label169; - private Label label170; - private Label label171; - private Label label154; - private Label label155; - private Label label156; - private Label label157; - private Label label158; - private Label label159; - private Label label160; - private Label label161; - private Label label144; - private Label label145; - private Label label146; - private Label label147; - private Label label148; - private Label label149; - private Label label150; - private Label label151; - private Label label132; - private Label label133; - private Label label134; - private Label label135; - private Label label136; - private Label label137; - private Label label138; - private Label label139; - private Label label140; - private Label label141; - private Label label122; - private Label label123; - private Label label124; - private Label label125; - private Label label126; - private Label label127; - private Label label128; - private Label label129; - private Label label130; - private Label label131; - private Label label112; - private Label label113; - private Label label114; - private Label label115; - private Label label116; - private Label label117; - private Label label118; - private Label label119; - private Label label120; - private Label label121; - private Label label102; - private Label label103; - private Label label104; - private Label label105; - private Label label106; - private Label label107; - private Label label108; - private Label label109; - private Label label110; - private Label label111; - private Label label92; - private Label label93; - private Label label94; - private Label label95; - private Label label96; - private Label label97; - private Label label98; - private Label label99; - private Label label100; - private Label label101; - private Label label82; - private Label label83; - private Label label84; - private Label label85; - private Label label86; - private Label label87; - private Label label88; - private Label label89; - private Label label90; - private Label label91; - private Label label72; - private Label label73; - private Label label74; - private Label label75; - private Label label76; - private Label label77; - private Label label78; - private Label label79; - private Label label80; - private Label label81; - private Label label62; - private Label label63; - private Label label64; - private Label label65; - private Label label66; - private Label label67; - private Label label68; - private Label label69; - private Label label70; - private Label label71; - private Label label52; - private Label label53; - private Label label54; - private Label label55; - private Label label56; - private Label label57; - private Label label58; - private Label label59; - private Label label60; - private Label label61; - private Label label42; - private Label label43; - private Label label44; - private Label label45; - private Label label46; - private Label label47; - private Label label48; - private Label label49; - private Label label50; - private Label label51; - private Label label32; - private Label label33; - private Label label34; - private Label label35; - private Label label36; - private Label label37; - private Label label38; - private Label label39; - private Label label40; - private Label label41; - private Label label30; - private Label label31; - private Label label28; - private Label label29; - private Label label26; - private Label label27; - private Label label24; - private Label label25; - private Label label23; - private Label label19; - private Button BtnToggle; - private Label label186; - private Label label187; - private Label label188; - private Label label189; - private Label label190; - private Label label191; - private Label label192; - private Label label193; - private Label label176; - private Label label177; - private Label label178; - private Label label179; - private Label label180; - private Label label181; - private Label label182; - private Label label183; - private Label label184; - private Label label185; - private Label label142; - private Label label143; - private Label label152; - private Label label153; - private Label label162; - private Label label163; - private Label label174; - private Label label175; - private Label label172; - private Label label173; - } -} \ No newline at end of file diff --git a/WinFormStarter/FrmPLCConnect.cs b/WinFormStarter/FrmPLCConnect.cs deleted file mode 100644 index 4474d0e..0000000 --- a/WinFormStarter/FrmPLCConnect.cs +++ /dev/null @@ -1,648 +0,0 @@ -using HslCommunication; -using HslCommunication.Core.Address; -using HslCommunication.ModBus; -using HybirdFrameworkCore.Utils; -using HybirdFrameworkDriver.ModbusTcpMaster; -using HybirdFrameworkDriver.TcpServer; -using HybirdFrameworkServices.Init.Entity; -using HybirdFrameworkServices.Plc; -using SqlSugar; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using static StackExchange.Redis.Role; -using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button; - -namespace WinFormStarter -{ - public partial class FrmPLCConnect : Form - { - #region 连接参数 - /// - /// ModbusTcp客户端 - /// - public static ModbusTcpNet _client = null; - public string _ipaddr - { - get - { - return TxtIp.Text; - } - set { } - } - public int _port - { - get - { - return Convert.ToInt32(TxtPort.Text); - } - set { } - } - public byte _site - { - get - { - return Convert.ToByte(TxtSite.Text); - } - set { } - } - #endregion - - PlcDate PlcDate = new PlcDate(); - - public FrmPLCConnect() - { - InitializeComponent(); - } - - #region 连接 - private void BtnConnect_Click(object sender, EventArgs e) - { - //简单判断 - if (string.IsNullOrEmpty(_ipaddr)) - { - MessageBox.Show("IP地址不能为空"); - return; - } - if (string.IsNullOrEmpty(TxtPort.Text)) - { - MessageBox.Show("端口号不能为空"); - return; - } - if (string.IsNullOrEmpty(TxtSite.Text)) - { - MessageBox.Show("站号不能为空"); - return; - } - _client = new ModbusTcpNet(_ipaddr, _port, _site); - OperateResult OptRet = _client.ConnectServer(); - if (OptRet.IsSuccess) - { - LblConState.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "连接成功"; - BtnCollectionAssignment.Enabled = true; - //OperateResult writeResult = _client.Write("x=6;1", ""); - } - if (OptRet.IsSuccess) - { - LblConState.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "连接失败"; - } - } - #endregion - - #region 读取 - private void BtnCollectionAssignment_Click(object sender, EventArgs e) - { - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo==null) - { - MessageBox.Show("PLC未连接"); - return; - } - - textBox1.Text = plcInfo.PlcReadAndWritten1.ProgrammingEnable.ToString(); - textBox2.Text = plcInfo.PlcReadAndWritten1.Modbus1Addres.ToString(); - textBox3.Text = plcInfo.PlcReadAndWritten1.BaudRate.ToString(); - textBox4.Text = plcInfo.PlcReadAndWritten1.CheckBit.ToString(); - textBox5.Text = plcInfo.PlcReadAndWritten2.Seconds.ToString(); - textBox6.Text = plcInfo.PlcReadAndWritten2.Points.ToString(); - textBox7.Text = plcInfo.PlcReadAndWritten2.When.ToString(); - textBox8.Text = plcInfo.PlcReadAndWritten2.Weeks.ToString(); - textBox9.Text = plcInfo.PlcReadAndWritten2.Day.ToString(); - textBox10.Text = plcInfo.PlcReadAndWritten2.Month.ToString(); - textBox11.Text = plcInfo.PlcReadAndWritten2.Years.ToString(); - textBox12.Text = plcInfo.PlcReadAndWritten2.Modbus1Addres2.ToString(); - textBox13.Text = plcInfo.PlcReadAndWritten2.Reserve.ToString(); - textBox14.Text = plcInfo.PlcReadAndWritten2.VoltageRatio.ToString(); - textBox15.Text = plcInfo.PlcReadAndWritten2.CurrentRatio.ToString(); - textBox16.Text = plcInfo.PlcReadAndWritten1.PulsePerSecond.ToString(); - textBox17.Text = plcInfo.PlcReadAndWritten1.CurrentReversal.ToString(); - textBox18.Text = plcInfo.PlcReadAndWritten1.MeterReset.ToString(); - string datetime = plcInfo.PlcReadAndWritten2.Years + "-" + - plcInfo.PlcReadAndWritten2.Month + "-" + - plcInfo.PlcReadAndWritten2.Day + " " + - plcInfo.PlcReadAndWritten2.When + ":" + - plcInfo.PlcReadAndWritten2.Points + ":" + - plcInfo.PlcReadAndWritten2.Seconds; - } - #endregion - - #region 切换数据 - bool now; - private void BtnToggle_Click(object sender, EventArgs e) - { - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - - now = !now; - if (now) - { - - #region - label31.Text = plcInfo.PlcReadonly.GroupHaveAll.ToString(); - label29.Text = plcInfo.PlcReadonly.GroupHaveTip.ToString(); - label27.Text = plcInfo.PlcReadonly.GroupHavePeak.ToString(); - label25.Text = plcInfo.PlcReadonly.GroupHaveFlat.ToString(); - label19.Text = plcInfo.PlcReadonly.GroupHaveValley.ToString(); - label40.Text = plcInfo.PlcReadonly.ForwardHaveAll.ToString(); - label38.Text = plcInfo.PlcReadonly.ForwardHaveTip.ToString(); - label36.Text = plcInfo.PlcReadonly.ForwardHavePeak.ToString(); - label34.Text = plcInfo.PlcReadonly.ForwardHaveFlat.ToString(); - label32.Text = plcInfo.PlcReadonly.ForwardHaveValley.ToString(); - label50.Text = plcInfo.PlcReadonly.ReverseHaveAll.ToString(); - label48.Text = plcInfo.PlcReadonly.ReverseHaveTip.ToString(); - label46.Text = plcInfo.PlcReadonly.ReverseHavePeak.ToString(); - label44.Text = plcInfo.PlcReadonly.ReverseHaveFlat.ToString(); - label42.Text = plcInfo.PlcReadonly.ReverseHaveValley.ToString(); - label60.Text = plcInfo.PlcReadonly.GroupNoAll1.ToString(); - label58.Text = plcInfo.PlcReadonly.GroupNoTip1.ToString(); - label56.Text = plcInfo.PlcReadonly.GroupNoPeak1.ToString(); - label54.Text = plcInfo.PlcReadonly.GroupNoFlat1.ToString(); - label52.Text = plcInfo.PlcReadonly.GroupNoValley1.ToString(); - label70.Text = plcInfo.PlcReadonly.GroupNoAll2.ToString(); - label68.Text = plcInfo.PlcReadonly.GroupNoTip2.ToString(); - label66.Text = plcInfo.PlcReadonly.GroupNoPeak2.ToString(); - label64.Text = plcInfo.PlcReadonly.GroupNoFlat2.ToString(); - label62.Text = plcInfo.PlcReadonly.GroupNoValley2.ToString(); - label80.Text = plcInfo.PlcReadonly.QuadrantNoAll1.ToString(); - label78.Text = plcInfo.PlcReadonly.QuadrantNoTip1.ToString(); - label76.Text = plcInfo.PlcReadonly.QuadrantNoPeak1.ToString(); - label74.Text = plcInfo.PlcReadonly.QuadrantNoFlat1.ToString(); - label72.Text = plcInfo.PlcReadonly.QuadrantNoValley1.ToString(); - label90.Text = plcInfo.PlcReadonly.QuadrantNoAll2.ToString(); - label88.Text = plcInfo.PlcReadonly.QuadrantNoTip2.ToString(); - label86.Text = plcInfo.PlcReadonly.QuadrantNoPeak2.ToString(); - label84.Text = plcInfo.PlcReadonly.QuadrantNoFlat2.ToString(); - label82.Text = plcInfo.PlcReadonly.QuadrantNoValley2.ToString(); - label100.Text = plcInfo.PlcReadonly.QuadrantNoAll3.ToString(); - label98.Text = plcInfo.PlcReadonly.QuadrantNoTip3.ToString(); - label96.Text = plcInfo.PlcReadonly.QuadrantNoPeak3.ToString(); - label94.Text = plcInfo.PlcReadonly.QuadrantNoFlat3.ToString(); - label92.Text = plcInfo.PlcReadonly.QuadrantNoValley3.ToString(); - label110.Text = plcInfo.PlcReadonly.QuadrantNoAll4.ToString(); - label108.Text = plcInfo.PlcReadonly.QuadrantNoTip4.ToString(); - label106.Text = plcInfo.PlcReadonly.QuadrantNoPeak4.ToString(); - label104.Text = plcInfo.PlcReadonly.QuadrantNoFlat4.ToString(); - label102.Text = plcInfo.PlcReadonly.QuadrantNoValley4.ToString(); - label120.Text = plcInfo.PlcReadonly.ForwardHaveApparentAll.ToString(); - label118.Text = plcInfo.PlcReadonly.ForwardHaveApparentTip.ToString(); - label116.Text = plcInfo.PlcReadonly.ForwardHaveApparentPeak.ToString(); - label114.Text = plcInfo.PlcReadonly.ForwardHaveApparentFlat.ToString(); - label112.Text = plcInfo.PlcReadonly.ForwardHaveApparentValley.ToString(); - label130.Text = plcInfo.PlcReadonly.ReverseHaveApparentAll.ToString(); - label128.Text = plcInfo.PlcReadonly.ReverseHaveApparentTip.ToString(); - label126.Text = plcInfo.PlcReadonly.ReverseHaveApparentPeak.ToString(); - label124.Text = plcInfo.PlcReadonly.ReverseHaveApparentFlat.ToString(); - label122.Text = plcInfo.PlcReadonly.ReverseHaveApparentValley.ToString(); - - - label140.Text = plcInfo.PlcReadonly.PhaseVoltageA.ToString(); - label138.Text = plcInfo.PlcReadonly.PhaseVoltageB.ToString(); - label136.Text = plcInfo.PlcReadonly.PhaseVoltageC.ToString(); - label134.Text = plcInfo.PlcReadonly.PhaseElectricityA.ToString(); - label132.Text = plcInfo.PlcReadonly.PhaseElectricityB.ToString(); - label172.Text = plcInfo.PlcReadonly.PhaseElectricityC.ToString(); - - label150.Text = plcInfo.PlcReadonly.TotalActivePower.ToString(); - label148.Text = plcInfo.PlcReadonly.TotalActivePowerA.ToString(); - label146.Text = plcInfo.PlcReadonly.TotalActivePowerB.ToString(); - label144.Text = plcInfo.PlcReadonly.TotalActivePowerC.ToString(); - - label160.Text = plcInfo.PlcReadonly.TotalReactivePower.ToString(); - label158.Text = plcInfo.PlcReadonly.TotalReactivePowerA.ToString(); - label156.Text = plcInfo.PlcReadonly.TotalReactivePowerB.ToString(); - label144.Text = plcInfo.PlcReadonly.TotalReactivePowerC.ToString(); - - label170.Text = plcInfo.PlcReadonly.TotalApparentPower.ToString(); - label168.Text = plcInfo.PlcReadonly.TotalApparentPowerA.ToString(); - label166.Text = plcInfo.PlcReadonly.TotalApparentPowerB.ToString(); - label164.Text = plcInfo.PlcReadonly.TotalApparentPowerC.ToString(); - - label192.Text = plcInfo.PlcReadonly.OverallPowerFactor.ToString(); - label190.Text = plcInfo.PlcReadonly.OverallPowerFactorA.ToString(); - label188.Text = plcInfo.PlcReadonly.OverallPowerFactorB.ToString(); - label184.Text = plcInfo.PlcReadonly.OverallPowerFactorC.ToString(); - - label174.Text = plcInfo.PlcReadonly.PhaseAngleA.ToString(); - label162.Text = plcInfo.PlcReadonly.PhaseAngleB.ToString(); - label152.Text = plcInfo.PlcReadonly.PhaseAngleC.ToString(); - label142.Text = plcInfo.PlcReadonly.LineFrequency.ToString(); - - label184.Text = plcInfo.PlcReadonly.PhaseLineVoltageA.ToString(); - label182.Text = plcInfo.PlcReadonly.PhaseLineVoltageB.ToString(); - label180.Text = plcInfo.PlcReadonly.PhaseLineVoltageC.ToString(); - label178.Text = plcInfo.PlcReadonly.ThreePhaseMeanLineVoltage.ToString(); - label176.Text = plcInfo.PlcReadonly.ThreePhaseMeanPhaseVoltage.ToString(); - - #endregion - } - if (now) - { - #region - label31.Text = plcInfo.PlcTurnsRatio.GroupHaveAll.ToString(); - label29.Text = plcInfo.PlcTurnsRatio.GroupHaveTip.ToString(); - label27.Text = plcInfo.PlcTurnsRatio.GroupHavePeak.ToString(); - label25.Text = plcInfo.PlcTurnsRatio.GroupHaveFlat.ToString(); - label19.Text = plcInfo.PlcTurnsRatio.GroupHaveValley.ToString(); - label40.Text = plcInfo.PlcTurnsRatio.ForwardHaveAll.ToString(); - label38.Text = plcInfo.PlcTurnsRatio.ForwardHaveTip.ToString(); - label36.Text = plcInfo.PlcTurnsRatio.ForwardHavePeak.ToString(); - label34.Text = plcInfo.PlcTurnsRatio.ForwardHaveFlat.ToString(); - label32.Text = plcInfo.PlcTurnsRatio.ForwardHaveValley.ToString(); - label50.Text = plcInfo.PlcTurnsRatio.ReverseHaveAll.ToString(); - label48.Text = plcInfo.PlcTurnsRatio.ReverseHaveTip.ToString(); - label46.Text = plcInfo.PlcTurnsRatio.ReverseHavePeak.ToString(); - label44.Text = plcInfo.PlcTurnsRatio.ReverseHaveFlat.ToString(); - label42.Text = plcInfo.PlcTurnsRatio.ReverseHaveValley.ToString(); - label60.Text = plcInfo.PlcTurnsRatio.GroupNoAll1.ToString(); - label58.Text = plcInfo.PlcTurnsRatio.GroupNoTip1.ToString(); - label56.Text = plcInfo.PlcTurnsRatio.GroupNoPeak1.ToString(); - label54.Text = plcInfo.PlcTurnsRatio.GroupNoFlat1.ToString(); - label52.Text = plcInfo.PlcTurnsRatio.GroupNoValley1.ToString(); - label70.Text = plcInfo.PlcTurnsRatio.GroupNoAll2.ToString(); - label68.Text = plcInfo.PlcTurnsRatio.GroupNoTip2.ToString(); - label66.Text = plcInfo.PlcTurnsRatio.GroupNoPeak2.ToString(); - label64.Text = plcInfo.PlcTurnsRatio.GroupNoFlat2.ToString(); - label62.Text = plcInfo.PlcTurnsRatio.GroupNoValley2.ToString(); - label80.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll1.ToString(); - label78.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip1.ToString(); - label76.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak1.ToString(); - label74.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat1.ToString(); - label72.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley1.ToString(); - label90.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll2.ToString(); - label88.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip2.ToString(); - label86.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak2.ToString(); - label84.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat2.ToString(); - label82.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley2.ToString(); - label100.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll3.ToString(); - label98.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip3.ToString(); - label96.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak3.ToString(); - label94.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat3.ToString(); - label92.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley3.ToString(); - label110.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll4.ToString(); - label108.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip4.ToString(); - label106.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak4.ToString(); - label104.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat4.ToString(); - label102.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley4.ToString(); - label120.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentAll.ToString(); - label118.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentTip.ToString(); - label116.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentPeak.ToString(); - label114.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentFlat.ToString(); - label112.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentValley.ToString(); - label130.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentAll.ToString(); - label128.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentTip.ToString(); - label126.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentPeak.ToString(); - label124.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentFlat.ToString(); - label122.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentValley.ToString(); - #endregion - } - } - #endregion - - #region 方法 - - #endregion 写入方法 - - - private void BtnWrite01_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox1.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if(plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult=session.Write(PlcDate.ProgrammingEnable); - - } - - private void BtnWrite02_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox2.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Modbus1Addres); - } - - private void BtnWrite03_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox3.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.BaudRate); - } - - private void BtnWrite04_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox4.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.CheckBit); - } - - private void BtnWrite05_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox5.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Seconds); - } - - private void BtnWrite06_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox6.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Points); - } - - private void BtnWrite07_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox7.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.When); - } - - private void BtnWrite08_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox8.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Weeks); - } - - private void BtnWrite09_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox9.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Day); - } - - private void BtnWrite10_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox10.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Month); - } - - private void BtnWrite11_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox11.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Years); - } - - private void BtnWrite12_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox12.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Modbus1Addres2); - } - - private void BtnWrite13_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox13.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.Reserve); - } - - private void BtnWrite14_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox14.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.VoltageRatio); - } - - private void BtnWrite15_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox15.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.CurrentRatio); - } - - private void BtnWrite16_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox16.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.PulsePerSecond); - } - - private void BtnWrite17_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox15.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.CurrentReversal); - } - - private void BtnWrite18_Click(object sender, EventArgs e) - { - bool bConvert = int.TryParse(this.textBox16.Text, out int iValue); - if (!bConvert) - { - MessageBox.Show("请输入有效值"); - return; - } - ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); - if (plcInfo == null) - { - MessageBox.Show("PLC未连接"); - return; - } - ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); - bool bResult = session.Write(PlcDate.MeterReset); - } - - #region 进制数据转换 - - - - #endregion - } -} diff --git a/WinFormStarter/FrmPlc.Designer.cs b/WinFormStarter/FrmPlc.Designer.cs new file mode 100644 index 0000000..fb1436c --- /dev/null +++ b/WinFormStarter/FrmPlc.Designer.cs @@ -0,0 +1,2048 @@ +namespace WinFormStarter +{ + partial class FrmPlc + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + BtnCollectionAssignment = new Button(); + groupBox2 = new GroupBox(); + txtValue03 = new TextBox(); + txtValue02 = new TextBox(); + txtValue01 = new TextBox(); + label20 = new Label(); + button6 = new Button(); + button4 = new Button(); + txtValue24 = new TextBox(); + label25 = new Label(); + button5 = new Button(); + txtValue23 = new TextBox(); + label26 = new Label(); + button1 = new Button(); + txtValue22 = new TextBox(); + label19 = new Label(); + button2 = new Button(); + txtValue21 = new TextBox(); + label23 = new Label(); + button3 = new Button(); + txtValue20 = new TextBox(); + label24 = new Label(); + txtValue05 = new TextBox(); + txtValue08 = new TextBox(); + BtnWrite18 = new Button(); + label1 = new Label(); + txtValue19 = new TextBox(); + txtValue04 = new TextBox(); + label18 = new Label(); + BtnWrite01 = new Button(); + BtnWrite17 = new Button(); + label2 = new Label(); + txtValue18 = new TextBox(); + label17 = new Label(); + BtnWrite02 = new Button(); + BtnWrite16 = new Button(); + label3 = new Label(); + txtValue17 = new TextBox(); + txtValue06 = new TextBox(); + label16 = new Label(); + BtnWrite03 = new Button(); + BtnWrite15 = new Button(); + label4 = new Label(); + txtValue16 = new TextBox(); + txtValue07 = new TextBox(); + label15 = new Label(); + BtnWrite04 = new Button(); + label5 = new Label(); + BtnWrite14 = new Button(); + BtnWrite05 = new Button(); + txtValue15 = new TextBox(); + label6 = new Label(); + label14 = new Label(); + txtValue09 = new TextBox(); + BtnWrite06 = new Button(); + label7 = new Label(); + txtValue10 = new TextBox(); + BtnWrite07 = new Button(); + label8 = new Label(); + txtValue11 = new TextBox(); + BtnWrite11 = new Button(); + BtnWrite08 = new Button(); + txtValue14 = new TextBox(); + label9 = new Label(); + label11 = new Label(); + txtValue12 = new TextBox(); + BtnWrite10 = new Button(); + BtnWrite09 = new Button(); + txtValue13 = new TextBox(); + label10 = new Label(); + BtnWrite12 = new Button(); + groupBox3 = new GroupBox(); + tableLayoutPanel1 = new TableLayoutPanel(); + textBox20 = new TextBox(); + textBox19 = new TextBox(); + textBox1 = new TextBox(); + textBox2 = new TextBox(); + textBox17 = new TextBox(); + textBox3 = new TextBox(); + textBox4 = new TextBox(); + textBox5 = new TextBox(); + textBox6 = new TextBox(); + textBox7 = new TextBox(); + textBox9 = new TextBox(); + textBox8 = new TextBox(); + textBox10 = new TextBox(); + textBox13 = new TextBox(); + textBox14 = new TextBox(); + textBox12 = new TextBox(); + textBox11 = new TextBox(); + textBox15 = new TextBox(); + textBox16 = new TextBox(); + textBox18 = new TextBox(); + groupBox1 = new GroupBox(); + tableLayoutPanel2 = new TableLayoutPanel(); + textBox31 = new TextBox(); + button7 = new Button(); + textBox21 = new TextBox(); + textBox24 = new TextBox(); + textBox25 = new TextBox(); + textBox30 = new TextBox(); + textBox26 = new TextBox(); + textBox29 = new TextBox(); + textBox27 = new TextBox(); + textBox28 = new TextBox(); + textBox33 = new TextBox(); + textBox32 = new TextBox(); + textBox35 = new TextBox(); + textBox34 = new TextBox(); + textBox36 = new TextBox(); + textBox37 = new TextBox(); + textBox38 = new TextBox(); + textBox39 = new TextBox(); + textBox40 = new TextBox(); + textBox23 = new TextBox(); + textBox22 = new TextBox(); + groupBox4 = new GroupBox(); + lblValue26 = new Label(); + label74 = new Label(); + lblValue25 = new Label(); + label72 = new Label(); + lblValue24 = new Label(); + label70 = new Label(); + lblValue23 = new Label(); + label68 = new Label(); + lblValue22 = new Label(); + label66 = new Label(); + lblValue21 = new Label(); + label64 = new Label(); + lblValue20 = new Label(); + label62 = new Label(); + lblValue19 = new Label(); + label60 = new Label(); + lblValue18 = new Label(); + label58 = new Label(); + lblValue17 = new Label(); + label56 = new Label(); + lblValue16 = new Label(); + label54 = new Label(); + lblValue15 = new Label(); + label52 = new Label(); + lblValue14 = new Label(); + label50 = new Label(); + lblValue13 = new Label(); + label48 = new Label(); + lblValue12 = new Label(); + label46 = new Label(); + lblValue11 = new Label(); + label44 = new Label(); + lblValue10 = new Label(); + label42 = new Label(); + lblValue09 = new Label(); + label40 = new Label(); + lblValue08 = new Label(); + label38 = new Label(); + lblValue07 = new Label(); + label36 = new Label(); + lblValue06 = new Label(); + label34 = new Label(); + lblValue05 = new Label(); + label32 = new Label(); + lblValue04 = new Label(); + label30 = new Label(); + lblValue03 = new Label(); + label28 = new Label(); + lblValue02 = new Label(); + label22 = new Label(); + lblValue01 = new Label(); + label12 = new Label(); + groupBox2.SuspendLayout(); + groupBox3.SuspendLayout(); + tableLayoutPanel1.SuspendLayout(); + groupBox1.SuspendLayout(); + tableLayoutPanel2.SuspendLayout(); + groupBox4.SuspendLayout(); + SuspendLayout(); + // + // BtnCollectionAssignment + // + BtnCollectionAssignment.Enabled = false; + BtnCollectionAssignment.Location = new Point(1159, 198); + BtnCollectionAssignment.Name = "BtnCollectionAssignment"; + BtnCollectionAssignment.Size = new Size(94, 29); + BtnCollectionAssignment.TabIndex = 120; + BtnCollectionAssignment.Text = "采集赋值"; + BtnCollectionAssignment.UseVisualStyleBackColor = true; + BtnCollectionAssignment.Click += BtnCollectionAssignment_Click; + // + // groupBox2 + // + groupBox2.Controls.Add(txtValue03); + groupBox2.Controls.Add(txtValue02); + groupBox2.Controls.Add(txtValue01); + groupBox2.Controls.Add(label20); + groupBox2.Controls.Add(BtnCollectionAssignment); + groupBox2.Controls.Add(button6); + groupBox2.Controls.Add(button4); + groupBox2.Controls.Add(txtValue24); + groupBox2.Controls.Add(label25); + groupBox2.Controls.Add(button5); + groupBox2.Controls.Add(txtValue23); + groupBox2.Controls.Add(label26); + groupBox2.Controls.Add(button1); + groupBox2.Controls.Add(txtValue22); + groupBox2.Controls.Add(label19); + groupBox2.Controls.Add(button2); + groupBox2.Controls.Add(txtValue21); + groupBox2.Controls.Add(label23); + groupBox2.Controls.Add(button3); + groupBox2.Controls.Add(txtValue20); + groupBox2.Controls.Add(label24); + groupBox2.Controls.Add(txtValue05); + groupBox2.Controls.Add(txtValue08); + groupBox2.Controls.Add(BtnWrite18); + groupBox2.Controls.Add(label1); + groupBox2.Controls.Add(txtValue19); + groupBox2.Controls.Add(txtValue04); + groupBox2.Controls.Add(label18); + groupBox2.Controls.Add(BtnWrite01); + groupBox2.Controls.Add(BtnWrite17); + groupBox2.Controls.Add(label2); + groupBox2.Controls.Add(txtValue18); + groupBox2.Controls.Add(label17); + groupBox2.Controls.Add(BtnWrite02); + groupBox2.Controls.Add(BtnWrite16); + groupBox2.Controls.Add(label3); + groupBox2.Controls.Add(txtValue17); + groupBox2.Controls.Add(txtValue06); + groupBox2.Controls.Add(label16); + groupBox2.Controls.Add(BtnWrite03); + groupBox2.Controls.Add(BtnWrite15); + groupBox2.Controls.Add(label4); + groupBox2.Controls.Add(txtValue16); + groupBox2.Controls.Add(txtValue07); + groupBox2.Controls.Add(label15); + groupBox2.Controls.Add(BtnWrite04); + groupBox2.Controls.Add(label5); + groupBox2.Controls.Add(BtnWrite14); + groupBox2.Controls.Add(BtnWrite05); + groupBox2.Controls.Add(txtValue15); + groupBox2.Controls.Add(label6); + groupBox2.Controls.Add(label14); + groupBox2.Controls.Add(txtValue09); + groupBox2.Controls.Add(BtnWrite06); + groupBox2.Controls.Add(label7); + groupBox2.Controls.Add(txtValue10); + groupBox2.Controls.Add(BtnWrite07); + groupBox2.Controls.Add(label8); + groupBox2.Controls.Add(txtValue11); + groupBox2.Controls.Add(BtnWrite11); + groupBox2.Controls.Add(BtnWrite08); + groupBox2.Controls.Add(txtValue14); + groupBox2.Controls.Add(label9); + groupBox2.Controls.Add(label11); + groupBox2.Controls.Add(txtValue12); + groupBox2.Controls.Add(BtnWrite10); + groupBox2.Controls.Add(BtnWrite09); + groupBox2.Controls.Add(txtValue13); + groupBox2.Controls.Add(label10); + groupBox2.Location = new Point(17, 12); + groupBox2.Name = "groupBox2"; + groupBox2.Size = new Size(1277, 244); + groupBox2.TabIndex = 173; + groupBox2.TabStop = false; + groupBox2.Text = "可读可写"; + // + // txtValue03 + // + txtValue03.Location = new Point(161, 27); + txtValue03.Name = "txtValue03"; + txtValue03.Size = new Size(28, 27); + txtValue03.TabIndex = 191; + // + // txtValue02 + // + txtValue02.Location = new Point(112, 27); + txtValue02.Name = "txtValue02"; + txtValue02.Size = new Size(32, 27); + txtValue02.TabIndex = 190; + // + // txtValue01 + // + txtValue01.Location = new Point(76, 27); + txtValue01.Name = "txtValue01"; + txtValue01.Size = new Size(30, 27); + txtValue01.TabIndex = 189; + // + // label20 + // + label20.AutoSize = true; + label20.Location = new Point(11, 30); + label20.Name = "label20"; + label20.Size = new Size(69, 20); + label20.TabIndex = 188; + label20.Text = "协议版本"; + // + // button6 + // + button6.Location = new Point(213, 26); + button6.Name = "button6"; + button6.Size = new Size(94, 29); + button6.TabIndex = 187; + button6.Text = "写"; + button6.UseVisualStyleBackColor = true; + button6.Click += button6_Click; + // + // button4 + // + button4.Location = new Point(531, 194); + button4.Name = "button4"; + button4.Size = new Size(94, 29); + button4.TabIndex = 186; + button4.Text = "写"; + button4.UseVisualStyleBackColor = true; + button4.Click += button4_Click; + // + // txtValue24 + // + txtValue24.Location = new Point(429, 195); + txtValue24.Name = "txtValue24"; + txtValue24.Size = new Size(80, 27); + txtValue24.TabIndex = 185; + // + // label25 + // + label25.AutoSize = true; + label25.Location = new Point(344, 198); + label25.Name = "label25"; + label25.Size = new Size(69, 20); + label25.TabIndex = 184; + label25.Text = "任务使能"; + // + // button5 + // + button5.Location = new Point(213, 194); + button5.Name = "button5"; + button5.Size = new Size(94, 29); + button5.TabIndex = 183; + button5.Text = "写"; + button5.UseVisualStyleBackColor = true; + button5.Click += button5_Click; + // + // txtValue23 + // + txtValue23.Location = new Point(97, 195); + txtValue23.Name = "txtValue23"; + txtValue23.Size = new Size(80, 27); + txtValue23.TabIndex = 182; + // + // label26 + // + label26.AutoSize = true; + label26.Location = new Point(12, 198); + label26.Name = "label26"; + label26.Size = new Size(84, 20); + label26.TabIndex = 181; + label26.Text = "电池包类型"; + // + // button1 + // + button1.Location = new Point(1159, 159); + button1.Name = "button1"; + button1.Size = new Size(94, 29); + button1.TabIndex = 180; + button1.Text = "写"; + button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click; + // + // txtValue22 + // + txtValue22.Location = new Point(1062, 160); + txtValue22.Name = "txtValue22"; + txtValue22.Size = new Size(80, 27); + txtValue22.TabIndex = 179; + // + // label19 + // + label19.AutoSize = true; + label19.Location = new Point(954, 163); + label19.Name = "label19"; + label19.Size = new Size(99, 20); + label19.TabIndex = 178; + label19.Text = "出仓仓位选择"; + // + // button2 + // + button2.Location = new Point(838, 159); + button2.Name = "button2"; + button2.Size = new Size(94, 29); + button2.TabIndex = 177; + button2.Text = "写"; + button2.UseVisualStyleBackColor = true; + button2.Click += button2_Click; + // + // txtValue21 + // + txtValue21.Location = new Point(736, 160); + txtValue21.Name = "txtValue21"; + txtValue21.Size = new Size(80, 27); + txtValue21.TabIndex = 176; + // + // label23 + // + label23.AutoSize = true; + label23.Location = new Point(651, 163); + label23.Name = "label23"; + label23.Size = new Size(84, 20); + label23.TabIndex = 175; + label23.Text = "入仓位选择"; + // + // button3 + // + button3.Location = new Point(531, 159); + button3.Name = "button3"; + button3.Size = new Size(94, 29); + button3.TabIndex = 174; + button3.Text = "写"; + button3.UseVisualStyleBackColor = true; + button3.Click += button3_Click; + // + // txtValue20 + // + txtValue20.Location = new Point(429, 160); + txtValue20.Name = "txtValue20"; + txtValue20.Size = new Size(80, 27); + txtValue20.TabIndex = 173; + // + // label24 + // + label24.AutoSize = true; + label24.Location = new Point(344, 163); + label24.Name = "label24"; + label24.Size = new Size(69, 20); + label24.TabIndex = 172; + label24.Text = "任务类型"; + // + // txtValue05 + // + txtValue05.Location = new Point(736, 27); + txtValue05.Name = "txtValue05"; + txtValue05.Size = new Size(80, 27); + txtValue05.TabIndex = 121; + // + // txtValue08 + // + txtValue08.Location = new Point(429, 62); + txtValue08.Name = "txtValue08"; + txtValue08.Size = new Size(80, 27); + txtValue08.TabIndex = 130; + // + // BtnWrite18 + // + BtnWrite18.Location = new Point(213, 159); + BtnWrite18.Name = "BtnWrite18"; + BtnWrite18.Size = new Size(94, 29); + BtnWrite18.TabIndex = 171; + BtnWrite18.Text = "写"; + BtnWrite18.UseVisualStyleBackColor = true; + BtnWrite18.Click += BtnWrite18_Click; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new Point(344, 30); + label1.Name = "label1"; + label1.Size = new Size(69, 20); + label1.TabIndex = 117; + label1.Text = "通讯诊断"; + // + // txtValue19 + // + txtValue19.Location = new Point(97, 160); + txtValue19.Name = "txtValue19"; + txtValue19.Size = new Size(80, 27); + txtValue19.TabIndex = 170; + // + // txtValue04 + // + txtValue04.Location = new Point(429, 27); + txtValue04.Name = "txtValue04"; + txtValue04.Size = new Size(80, 27); + txtValue04.TabIndex = 118; + // + // label18 + // + label18.AutoSize = true; + label18.Location = new Point(-40, 163); + label18.Name = "label18"; + label18.Size = new Size(189, 20); + label18.TabIndex = 169; + label18.Text = "电池包锁止异常,暂停命令"; + // + // BtnWrite01 + // + BtnWrite01.Location = new Point(531, 26); + BtnWrite01.Name = "BtnWrite01"; + BtnWrite01.Size = new Size(94, 29); + BtnWrite01.TabIndex = 119; + BtnWrite01.Text = "写"; + BtnWrite01.UseVisualStyleBackColor = true; + BtnWrite01.Click += BtnWrite01_Click; + // + // BtnWrite17 + // + BtnWrite17.Location = new Point(1159, 124); + BtnWrite17.Name = "BtnWrite17"; + BtnWrite17.Size = new Size(94, 29); + BtnWrite17.TabIndex = 168; + BtnWrite17.Text = "写"; + BtnWrite17.UseVisualStyleBackColor = true; + BtnWrite17.Click += BtnWrite17_Click; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(659, 30); + label2.Name = "label2"; + label2.Size = new Size(69, 20); + label2.TabIndex = 120; + label2.Text = "模式控制"; + // + // txtValue18 + // + txtValue18.Location = new Point(1062, 125); + txtValue18.Name = "txtValue18"; + txtValue18.Size = new Size(80, 27); + txtValue18.TabIndex = 167; + // + // label17 + // + label17.AutoSize = true; + label17.Location = new Point(961, 128); + label17.Name = "label17"; + label17.Size = new Size(84, 20); + label17.TabIndex = 166; + label17.Text = "三色灯控制"; + // + // BtnWrite02 + // + BtnWrite02.Location = new Point(838, 26); + BtnWrite02.Name = "BtnWrite02"; + BtnWrite02.Size = new Size(94, 29); + BtnWrite02.TabIndex = 122; + BtnWrite02.Text = "写"; + BtnWrite02.UseVisualStyleBackColor = true; + BtnWrite02.Click += BtnWrite02_Click; + // + // BtnWrite16 + // + BtnWrite16.Location = new Point(838, 124); + BtnWrite16.Name = "BtnWrite16"; + BtnWrite16.Size = new Size(94, 29); + BtnWrite16.TabIndex = 165; + BtnWrite16.Text = "写"; + BtnWrite16.UseVisualStyleBackColor = true; + BtnWrite16.Click += BtnWrite16_Click; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(969, 30); + label3.Name = "label3"; + label3.Size = new Size(69, 20); + label3.TabIndex = 123; + label3.Text = "设备控制"; + // + // txtValue17 + // + txtValue17.Location = new Point(736, 125); + txtValue17.Name = "txtValue17"; + txtValue17.Size = new Size(80, 27); + txtValue17.TabIndex = 164; + // + // txtValue06 + // + txtValue06.Location = new Point(1062, 27); + txtValue06.Name = "txtValue06"; + txtValue06.Size = new Size(80, 27); + txtValue06.TabIndex = 124; + // + // label16 + // + label16.AutoSize = true; + label16.Location = new Point(651, 128); + label16.Name = "label16"; + label16.Size = new Size(84, 20); + label16.TabIndex = 163; + label16.Text = "三色灯控制"; + // + // BtnWrite03 + // + BtnWrite03.Location = new Point(1159, 26); + BtnWrite03.Name = "BtnWrite03"; + BtnWrite03.Size = new Size(94, 29); + BtnWrite03.TabIndex = 125; + BtnWrite03.Text = "写"; + BtnWrite03.UseVisualStyleBackColor = true; + BtnWrite03.Click += BtnWrite03_Click; + // + // BtnWrite15 + // + BtnWrite15.Location = new Point(531, 124); + BtnWrite15.Name = "BtnWrite15"; + BtnWrite15.Size = new Size(94, 29); + BtnWrite15.TabIndex = 162; + BtnWrite15.Text = "写"; + BtnWrite15.UseVisualStyleBackColor = true; + BtnWrite15.Click += BtnWrite15_Click; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new Point(12, 65); + label4.Name = "label4"; + label4.Size = new Size(84, 20); + label4.TabIndex = 126; + label4.Text = "排风扇控制"; + // + // txtValue16 + // + txtValue16.Location = new Point(429, 125); + txtValue16.Name = "txtValue16"; + txtValue16.Size = new Size(80, 27); + txtValue16.TabIndex = 161; + // + // txtValue07 + // + txtValue07.Location = new Point(97, 62); + txtValue07.Name = "txtValue07"; + txtValue07.Size = new Size(80, 27); + txtValue07.TabIndex = 127; + // + // label15 + // + label15.AutoSize = true; + label15.Location = new Point(329, 128); + label15.Name = "label15"; + label15.Size = new Size(99, 20); + label15.TabIndex = 160; + label15.Text = "车辆驻车状态"; + // + // BtnWrite04 + // + BtnWrite04.Location = new Point(213, 61); + BtnWrite04.Name = "BtnWrite04"; + BtnWrite04.Size = new Size(94, 29); + BtnWrite04.TabIndex = 128; + BtnWrite04.Text = "写"; + BtnWrite04.UseVisualStyleBackColor = true; + BtnWrite04.Click += BtnWrite04_Click; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new Point(344, 65); + label5.Name = "label5"; + label5.Size = new Size(69, 20); + label5.TabIndex = 129; + label5.Text = "灯光控制"; + // + // BtnWrite14 + // + BtnWrite14.Location = new Point(213, 124); + BtnWrite14.Name = "BtnWrite14"; + BtnWrite14.Size = new Size(94, 29); + BtnWrite14.TabIndex = 158; + BtnWrite14.Text = "写"; + BtnWrite14.UseVisualStyleBackColor = true; + BtnWrite14.Click += BtnWrite14_Click; + // + // BtnWrite05 + // + BtnWrite05.Location = new Point(531, 61); + BtnWrite05.Name = "BtnWrite05"; + BtnWrite05.Size = new Size(94, 29); + BtnWrite05.TabIndex = 131; + BtnWrite05.Text = "写"; + BtnWrite05.UseVisualStyleBackColor = true; + BtnWrite05.Click += BtnWrite05_Click; + // + // txtValue15 + // + txtValue15.Location = new Point(97, 125); + txtValue15.Name = "txtValue15"; + txtValue15.Size = new Size(80, 27); + txtValue15.TabIndex = 157; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new Point(681, 65); + label6.Name = "label6"; + label6.Size = new Size(24, 20); + label6.TabIndex = 132; + label6.Text = "秒"; + // + // label14 + // + label14.AutoSize = true; + label14.Location = new Point(5, 128); + label14.Name = "label14"; + label14.Size = new Size(99, 20); + label14.TabIndex = 156; + label14.Text = "车辆驻车位置"; + // + // txtValue09 + // + txtValue09.Location = new Point(736, 62); + txtValue09.Name = "txtValue09"; + txtValue09.Size = new Size(80, 27); + txtValue09.TabIndex = 133; + // + // BtnWrite06 + // + BtnWrite06.Location = new Point(838, 61); + BtnWrite06.Name = "BtnWrite06"; + BtnWrite06.Size = new Size(94, 29); + BtnWrite06.TabIndex = 134; + BtnWrite06.Text = "写"; + BtnWrite06.UseVisualStyleBackColor = true; + BtnWrite06.Click += BtnWrite06_Click; + // + // label7 + // + label7.AutoSize = true; + label7.Location = new Point(991, 65); + label7.Name = "label7"; + label7.Size = new Size(24, 20); + label7.TabIndex = 135; + label7.Text = "分"; + // + // txtValue10 + // + txtValue10.Location = new Point(1062, 62); + txtValue10.Name = "txtValue10"; + txtValue10.Size = new Size(80, 27); + txtValue10.TabIndex = 136; + // + // BtnWrite07 + // + BtnWrite07.Location = new Point(1159, 61); + BtnWrite07.Name = "BtnWrite07"; + BtnWrite07.Size = new Size(94, 29); + BtnWrite07.TabIndex = 137; + BtnWrite07.Text = "写"; + BtnWrite07.UseVisualStyleBackColor = true; + BtnWrite07.Click += BtnWrite07_Click; + // + // label8 + // + label8.AutoSize = true; + label8.Location = new Point(42, 93); + label8.Name = "label8"; + label8.Size = new Size(24, 20); + label8.TabIndex = 138; + label8.Text = "时"; + // + // txtValue11 + // + txtValue11.Location = new Point(97, 90); + txtValue11.Name = "txtValue11"; + txtValue11.Size = new Size(80, 27); + txtValue11.TabIndex = 139; + // + // BtnWrite11 + // + BtnWrite11.Location = new Point(1159, 89); + BtnWrite11.Name = "BtnWrite11"; + BtnWrite11.Size = new Size(94, 29); + BtnWrite11.TabIndex = 149; + BtnWrite11.Text = "写"; + BtnWrite11.UseVisualStyleBackColor = true; + BtnWrite11.Click += BtnWrite11_Click; + // + // BtnWrite08 + // + BtnWrite08.Location = new Point(213, 89); + BtnWrite08.Name = "BtnWrite08"; + BtnWrite08.Size = new Size(94, 29); + BtnWrite08.TabIndex = 140; + BtnWrite08.Text = "写"; + BtnWrite08.UseVisualStyleBackColor = true; + BtnWrite08.Click += BtnWrite08_Click; + // + // txtValue14 + // + txtValue14.Location = new Point(1062, 90); + txtValue14.Name = "txtValue14"; + txtValue14.Size = new Size(80, 27); + txtValue14.TabIndex = 148; + // + // label9 + // + label9.AutoSize = true; + label9.Location = new Point(366, 93); + label9.Name = "label9"; + label9.Size = new Size(24, 20); + label9.TabIndex = 141; + label9.Text = "日"; + // + // label11 + // + label11.AutoSize = true; + label11.Location = new Point(991, 93); + label11.Name = "label11"; + label11.Size = new Size(24, 20); + label11.TabIndex = 147; + label11.Text = "年"; + // + // txtValue12 + // + txtValue12.Location = new Point(429, 90); + txtValue12.Name = "txtValue12"; + txtValue12.Size = new Size(80, 27); + txtValue12.TabIndex = 142; + // + // BtnWrite10 + // + BtnWrite10.Location = new Point(838, 89); + BtnWrite10.Name = "BtnWrite10"; + BtnWrite10.Size = new Size(94, 29); + BtnWrite10.TabIndex = 146; + BtnWrite10.Text = "写"; + BtnWrite10.UseVisualStyleBackColor = true; + BtnWrite10.Click += BtnWrite10_Click; + // + // BtnWrite09 + // + BtnWrite09.Location = new Point(531, 89); + BtnWrite09.Name = "BtnWrite09"; + BtnWrite09.Size = new Size(94, 29); + BtnWrite09.TabIndex = 143; + BtnWrite09.Text = "写"; + BtnWrite09.UseVisualStyleBackColor = true; + BtnWrite09.Click += BtnWrite09_Click; + // + // txtValue13 + // + txtValue13.Location = new Point(736, 90); + txtValue13.Name = "txtValue13"; + txtValue13.Size = new Size(80, 27); + txtValue13.TabIndex = 145; + // + // label10 + // + label10.AutoSize = true; + label10.Location = new Point(681, 93); + label10.Name = "label10"; + label10.Size = new Size(24, 20); + label10.TabIndex = 144; + label10.Text = "月"; + // + // BtnWrite12 + // + BtnWrite12.Location = new Point(1153, 33); + BtnWrite12.Name = "BtnWrite12"; + BtnWrite12.Size = new Size(94, 25); + BtnWrite12.TabIndex = 152; + BtnWrite12.Text = "写"; + BtnWrite12.UseVisualStyleBackColor = true; + // + // groupBox3 + // + groupBox3.Controls.Add(tableLayoutPanel1); + groupBox3.Location = new Point(17, 273); + groupBox3.Name = "groupBox3"; + groupBox3.Size = new Size(1277, 87); + groupBox3.TabIndex = 174; + groupBox3.TabStop = false; + groupBox3.Text = "写电池仓位状态"; + // + // tableLayoutPanel1 + // + tableLayoutPanel1.ColumnCount = 11; + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel1.Controls.Add(textBox20, 9, 1); + tableLayoutPanel1.Controls.Add(BtnWrite12, 10, 1); + tableLayoutPanel1.Controls.Add(textBox19, 8, 1); + tableLayoutPanel1.Controls.Add(textBox1, 0, 0); + tableLayoutPanel1.Controls.Add(textBox2, 1, 0); + tableLayoutPanel1.Controls.Add(textBox17, 6, 1); + tableLayoutPanel1.Controls.Add(textBox3, 2, 0); + tableLayoutPanel1.Controls.Add(textBox4, 3, 0); + tableLayoutPanel1.Controls.Add(textBox5, 4, 0); + tableLayoutPanel1.Controls.Add(textBox6, 5, 0); + tableLayoutPanel1.Controls.Add(textBox7, 6, 0); + tableLayoutPanel1.Controls.Add(textBox9, 7, 0); + tableLayoutPanel1.Controls.Add(textBox8, 8, 0); + tableLayoutPanel1.Controls.Add(textBox10, 9, 0); + tableLayoutPanel1.Controls.Add(textBox13, 2, 1); + tableLayoutPanel1.Controls.Add(textBox14, 3, 1); + tableLayoutPanel1.Controls.Add(textBox12, 1, 1); + tableLayoutPanel1.Controls.Add(textBox11, 0, 1); + tableLayoutPanel1.Controls.Add(textBox15, 4, 1); + tableLayoutPanel1.Controls.Add(textBox16, 5, 1); + tableLayoutPanel1.Controls.Add(textBox18, 7, 1); + tableLayoutPanel1.Dock = DockStyle.Fill; + tableLayoutPanel1.Location = new Point(3, 23); + tableLayoutPanel1.Name = "tableLayoutPanel1"; + tableLayoutPanel1.RowCount = 2; + tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); + tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); + tableLayoutPanel1.Size = new Size(1271, 61); + tableLayoutPanel1.TabIndex = 0; + // + // textBox20 + // + textBox20.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox20.Location = new Point(1038, 33); + textBox20.Name = "textBox20"; + textBox20.Size = new Size(109, 27); + textBox20.TabIndex = 172; + // + // textBox19 + // + textBox19.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox19.Location = new Point(923, 33); + textBox19.Name = "textBox19"; + textBox19.Size = new Size(109, 27); + textBox19.TabIndex = 171; + // + // textBox1 + // + textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox1.Location = new Point(3, 3); + textBox1.Name = "textBox1"; + textBox1.Size = new Size(109, 27); + textBox1.TabIndex = 153; + // + // textBox2 + // + textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox2.Location = new Point(118, 3); + textBox2.Name = "textBox2"; + textBox2.Size = new Size(109, 27); + textBox2.TabIndex = 154; + // + // textBox17 + // + textBox17.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox17.Location = new Point(693, 33); + textBox17.Name = "textBox17"; + textBox17.Size = new Size(109, 27); + textBox17.TabIndex = 169; + // + // textBox3 + // + textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox3.Location = new Point(233, 3); + textBox3.Name = "textBox3"; + textBox3.Size = new Size(109, 27); + textBox3.TabIndex = 155; + // + // textBox4 + // + textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox4.Location = new Point(348, 3); + textBox4.Name = "textBox4"; + textBox4.Size = new Size(109, 27); + textBox4.TabIndex = 156; + // + // textBox5 + // + textBox5.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox5.Location = new Point(463, 3); + textBox5.Name = "textBox5"; + textBox5.Size = new Size(109, 27); + textBox5.TabIndex = 157; + // + // textBox6 + // + textBox6.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox6.Location = new Point(578, 3); + textBox6.Name = "textBox6"; + textBox6.Size = new Size(109, 27); + textBox6.TabIndex = 158; + // + // textBox7 + // + textBox7.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox7.Location = new Point(693, 3); + textBox7.Name = "textBox7"; + textBox7.Size = new Size(109, 27); + textBox7.TabIndex = 159; + // + // textBox9 + // + textBox9.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox9.Location = new Point(808, 3); + textBox9.Name = "textBox9"; + textBox9.Size = new Size(109, 27); + textBox9.TabIndex = 161; + // + // textBox8 + // + textBox8.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox8.Location = new Point(923, 3); + textBox8.Name = "textBox8"; + textBox8.Size = new Size(109, 27); + textBox8.TabIndex = 160; + // + // textBox10 + // + textBox10.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox10.Location = new Point(1038, 3); + textBox10.Name = "textBox10"; + textBox10.Size = new Size(109, 27); + textBox10.TabIndex = 162; + // + // textBox13 + // + textBox13.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox13.Location = new Point(233, 33); + textBox13.Name = "textBox13"; + textBox13.Size = new Size(109, 27); + textBox13.TabIndex = 165; + // + // textBox14 + // + textBox14.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox14.Location = new Point(348, 33); + textBox14.Name = "textBox14"; + textBox14.Size = new Size(109, 27); + textBox14.TabIndex = 166; + // + // textBox12 + // + textBox12.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox12.Location = new Point(118, 33); + textBox12.Name = "textBox12"; + textBox12.Size = new Size(109, 27); + textBox12.TabIndex = 164; + // + // textBox11 + // + textBox11.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox11.Location = new Point(3, 33); + textBox11.Name = "textBox11"; + textBox11.Size = new Size(109, 27); + textBox11.TabIndex = 163; + // + // textBox15 + // + textBox15.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox15.Location = new Point(463, 33); + textBox15.Name = "textBox15"; + textBox15.Size = new Size(109, 27); + textBox15.TabIndex = 167; + // + // textBox16 + // + textBox16.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox16.Location = new Point(578, 33); + textBox16.Name = "textBox16"; + textBox16.Size = new Size(109, 27); + textBox16.TabIndex = 168; + // + // textBox18 + // + textBox18.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox18.Location = new Point(808, 33); + textBox18.Name = "textBox18"; + textBox18.Size = new Size(109, 27); + textBox18.TabIndex = 170; + // + // groupBox1 + // + groupBox1.Controls.Add(tableLayoutPanel2); + groupBox1.Location = new Point(17, 366); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new Size(1277, 87); + groupBox1.TabIndex = 175; + groupBox1.TabStop = false; + groupBox1.Text = "仓位电池型号"; + // + // tableLayoutPanel2 + // + tableLayoutPanel2.ColumnCount = 11; + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 9.090909F)); + tableLayoutPanel2.Controls.Add(textBox31, 0, 1); + tableLayoutPanel2.Controls.Add(button7, 10, 1); + tableLayoutPanel2.Controls.Add(textBox21, 0, 0); + tableLayoutPanel2.Controls.Add(textBox24, 3, 0); + tableLayoutPanel2.Controls.Add(textBox25, 4, 0); + tableLayoutPanel2.Controls.Add(textBox30, 9, 0); + tableLayoutPanel2.Controls.Add(textBox26, 5, 0); + tableLayoutPanel2.Controls.Add(textBox29, 8, 0); + tableLayoutPanel2.Controls.Add(textBox27, 6, 0); + tableLayoutPanel2.Controls.Add(textBox28, 7, 0); + tableLayoutPanel2.Controls.Add(textBox33, 2, 1); + tableLayoutPanel2.Controls.Add(textBox32, 1, 1); + tableLayoutPanel2.Controls.Add(textBox35, 4, 1); + tableLayoutPanel2.Controls.Add(textBox34, 3, 1); + tableLayoutPanel2.Controls.Add(textBox36, 5, 1); + tableLayoutPanel2.Controls.Add(textBox37, 6, 1); + tableLayoutPanel2.Controls.Add(textBox38, 7, 1); + tableLayoutPanel2.Controls.Add(textBox39, 8, 1); + tableLayoutPanel2.Controls.Add(textBox40, 9, 1); + tableLayoutPanel2.Controls.Add(textBox23, 2, 0); + tableLayoutPanel2.Controls.Add(textBox22, 1, 0); + tableLayoutPanel2.Dock = DockStyle.Fill; + tableLayoutPanel2.Location = new Point(3, 23); + tableLayoutPanel2.Name = "tableLayoutPanel2"; + tableLayoutPanel2.RowCount = 2; + tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); + tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); + tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); + tableLayoutPanel2.Size = new Size(1271, 61); + tableLayoutPanel2.TabIndex = 0; + // + // textBox31 + // + textBox31.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox31.Location = new Point(3, 33); + textBox31.Name = "textBox31"; + textBox31.Size = new Size(109, 27); + textBox31.TabIndex = 183; + // + // button7 + // + button7.Location = new Point(1153, 33); + button7.Name = "button7"; + button7.Size = new Size(109, 25); + button7.TabIndex = 152; + button7.Text = "写"; + button7.UseVisualStyleBackColor = true; + // + // textBox21 + // + textBox21.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox21.Location = new Point(3, 3); + textBox21.Name = "textBox21"; + textBox21.Size = new Size(109, 27); + textBox21.TabIndex = 173; + // + // textBox24 + // + textBox24.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox24.Location = new Point(348, 3); + textBox24.Name = "textBox24"; + textBox24.Size = new Size(109, 27); + textBox24.TabIndex = 176; + // + // textBox25 + // + textBox25.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox25.Location = new Point(463, 3); + textBox25.Name = "textBox25"; + textBox25.Size = new Size(109, 27); + textBox25.TabIndex = 177; + // + // textBox30 + // + textBox30.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox30.Location = new Point(1038, 3); + textBox30.Name = "textBox30"; + textBox30.Size = new Size(109, 27); + textBox30.TabIndex = 182; + // + // textBox26 + // + textBox26.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox26.Location = new Point(578, 3); + textBox26.Name = "textBox26"; + textBox26.Size = new Size(109, 27); + textBox26.TabIndex = 178; + // + // textBox29 + // + textBox29.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox29.Location = new Point(923, 3); + textBox29.Name = "textBox29"; + textBox29.Size = new Size(109, 27); + textBox29.TabIndex = 181; + // + // textBox27 + // + textBox27.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox27.Location = new Point(693, 3); + textBox27.Name = "textBox27"; + textBox27.Size = new Size(109, 27); + textBox27.TabIndex = 179; + // + // textBox28 + // + textBox28.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox28.Location = new Point(808, 3); + textBox28.Name = "textBox28"; + textBox28.Size = new Size(109, 27); + textBox28.TabIndex = 185; + // + // textBox33 + // + textBox33.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox33.Location = new Point(233, 33); + textBox33.Name = "textBox33"; + textBox33.Size = new Size(109, 27); + textBox33.TabIndex = 186; + // + // textBox32 + // + textBox32.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox32.Location = new Point(118, 33); + textBox32.Name = "textBox32"; + textBox32.Size = new Size(109, 27); + textBox32.TabIndex = 184; + // + // textBox35 + // + textBox35.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox35.Location = new Point(463, 33); + textBox35.Name = "textBox35"; + textBox35.Size = new Size(109, 27); + textBox35.TabIndex = 188; + // + // textBox34 + // + textBox34.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox34.Location = new Point(348, 33); + textBox34.Name = "textBox34"; + textBox34.Size = new Size(109, 27); + textBox34.TabIndex = 187; + // + // textBox36 + // + textBox36.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + textBox36.Location = new Point(578, 33); + textBox36.Name = "textBox36"; + textBox36.Size = new Size(109, 27); + textBox36.TabIndex = 189; + // + // textBox37 + // + textBox37.Location = new Point(693, 33); + textBox37.Name = "textBox37"; + textBox37.Size = new Size(109, 27); + textBox37.TabIndex = 190; + // + // textBox38 + // + textBox38.Location = new Point(808, 33); + textBox38.Name = "textBox38"; + textBox38.Size = new Size(109, 27); + textBox38.TabIndex = 191; + // + // textBox39 + // + textBox39.Location = new Point(923, 33); + textBox39.Name = "textBox39"; + textBox39.Size = new Size(109, 27); + textBox39.TabIndex = 192; + // + // textBox40 + // + textBox40.Location = new Point(1038, 33); + textBox40.Name = "textBox40"; + textBox40.Size = new Size(109, 27); + textBox40.TabIndex = 193; + // + // textBox23 + // + textBox23.Location = new Point(233, 3); + textBox23.Name = "textBox23"; + textBox23.Size = new Size(109, 27); + textBox23.TabIndex = 194; + // + // textBox22 + // + textBox22.Location = new Point(118, 3); + textBox22.Name = "textBox22"; + textBox22.Size = new Size(109, 27); + textBox22.TabIndex = 195; + // + // groupBox4 + // + groupBox4.Controls.Add(lblValue26); + groupBox4.Controls.Add(label74); + groupBox4.Controls.Add(lblValue25); + groupBox4.Controls.Add(label72); + groupBox4.Controls.Add(lblValue24); + groupBox4.Controls.Add(label70); + groupBox4.Controls.Add(lblValue23); + groupBox4.Controls.Add(label68); + groupBox4.Controls.Add(lblValue22); + groupBox4.Controls.Add(label66); + groupBox4.Controls.Add(lblValue21); + groupBox4.Controls.Add(label64); + groupBox4.Controls.Add(lblValue20); + groupBox4.Controls.Add(label62); + groupBox4.Controls.Add(lblValue19); + groupBox4.Controls.Add(label60); + groupBox4.Controls.Add(lblValue18); + groupBox4.Controls.Add(label58); + groupBox4.Controls.Add(lblValue17); + groupBox4.Controls.Add(label56); + groupBox4.Controls.Add(lblValue16); + groupBox4.Controls.Add(label54); + groupBox4.Controls.Add(lblValue15); + groupBox4.Controls.Add(label52); + groupBox4.Controls.Add(lblValue14); + groupBox4.Controls.Add(label50); + groupBox4.Controls.Add(lblValue13); + groupBox4.Controls.Add(label48); + groupBox4.Controls.Add(lblValue12); + groupBox4.Controls.Add(label46); + groupBox4.Controls.Add(lblValue11); + groupBox4.Controls.Add(label44); + groupBox4.Controls.Add(lblValue10); + groupBox4.Controls.Add(label42); + groupBox4.Controls.Add(lblValue09); + groupBox4.Controls.Add(label40); + groupBox4.Controls.Add(lblValue08); + groupBox4.Controls.Add(label38); + groupBox4.Controls.Add(lblValue07); + groupBox4.Controls.Add(label36); + groupBox4.Controls.Add(lblValue06); + groupBox4.Controls.Add(label34); + groupBox4.Controls.Add(lblValue05); + groupBox4.Controls.Add(label32); + groupBox4.Controls.Add(lblValue04); + groupBox4.Controls.Add(label30); + groupBox4.Controls.Add(lblValue03); + groupBox4.Controls.Add(label28); + groupBox4.Controls.Add(lblValue02); + groupBox4.Controls.Add(label22); + groupBox4.Controls.Add(lblValue01); + groupBox4.Controls.Add(label12); + groupBox4.Location = new Point(17, 474); + groupBox4.Name = "groupBox4"; + groupBox4.Size = new Size(1277, 238); + groupBox4.TabIndex = 176; + groupBox4.TabStop = false; + groupBox4.Text = "读"; + // + // lblValue26 + // + lblValue26.AutoSize = true; + lblValue26.Location = new Point(336, 180); + lblValue26.Name = "lblValue26"; + lblValue26.Size = new Size(24, 20); + lblValue26.TabIndex = 51; + lblValue26.Text = "值"; + // + // label74 + // + label74.AutoSize = true; + label74.Location = new Point(245, 180); + label74.Name = "label74"; + label74.Size = new Size(46, 20); + label74.TabIndex = 50; + label74.Text = "z偏差"; + // + // lblValue25 + // + lblValue25.AutoSize = true; + lblValue25.Location = new Point(127, 180); + lblValue25.Name = "lblValue25"; + lblValue25.Size = new Size(24, 20); + lblValue25.TabIndex = 49; + lblValue25.Text = "值"; + // + // label72 + // + label72.AutoSize = true; + label72.Location = new Point(36, 180); + label72.Name = "label72"; + label72.Size = new Size(47, 20); + label72.TabIndex = 48; + label72.Text = "y偏差"; + // + // lblValue24 + // + lblValue24.AutoSize = true; + lblValue24.Location = new Point(1179, 141); + lblValue24.Name = "lblValue24"; + lblValue24.Size = new Size(24, 20); + lblValue24.TabIndex = 47; + lblValue24.Text = "值"; + // + // label70 + // + label70.AutoSize = true; + label70.Location = new Point(1088, 141); + label70.Name = "label70"; + label70.Size = new Size(47, 20); + label70.TabIndex = 46; + label70.Text = "x偏差"; + // + // lblValue23 + // + lblValue23.AutoSize = true; + lblValue23.Location = new Point(961, 141); + lblValue23.Name = "lblValue23"; + lblValue23.Size = new Size(24, 20); + lblValue23.TabIndex = 45; + lblValue23.Text = "值"; + // + // label68 + // + label68.AutoSize = true; + label68.Location = new Point(870, 141); + label68.Name = "label68"; + label68.Size = new Size(99, 20); + label68.TabIndex = 44; + label68.Text = "通道定位状态"; + // + // lblValue22 + // + lblValue22.AutoSize = true; + lblValue22.Location = new Point(750, 141); + lblValue22.Name = "lblValue22"; + lblValue22.Size = new Size(24, 20); + lblValue22.TabIndex = 43; + lblValue22.Text = "值"; + // + // label66 + // + label66.AutoSize = true; + label66.Location = new Point(659, 141); + label66.Name = "label66"; + label66.Size = new Size(114, 20); + label66.TabIndex = 42; + label66.Text = "执行任务行车号"; + // + // lblValue21 + // + lblValue21.AutoSize = true; + lblValue21.Location = new Point(538, 141); + lblValue21.Name = "lblValue21"; + lblValue21.Size = new Size(24, 20); + lblValue21.TabIndex = 41; + lblValue21.Text = "值"; + // + // label64 + // + label64.AutoSize = true; + label64.Location = new Point(447, 141); + label64.Name = "label64"; + label64.Size = new Size(69, 20); + label64.TabIndex = 40; + label64.Text = "任务状态"; + // + // lblValue20 + // + lblValue20.AutoSize = true; + lblValue20.Location = new Point(336, 141); + lblValue20.Name = "lblValue20"; + lblValue20.Size = new Size(24, 20); + lblValue20.TabIndex = 39; + lblValue20.Text = "值"; + // + // label62 + // + label62.AutoSize = true; + label62.Location = new Point(245, 141); + label62.Name = "label62"; + label62.Size = new Size(99, 20); + label62.TabIndex = 38; + label62.Text = "任务类型状态"; + // + // lblValue19 + // + lblValue19.AutoSize = true; + lblValue19.Location = new Point(125, 141); + lblValue19.Name = "lblValue19"; + lblValue19.Size = new Size(24, 20); + lblValue19.TabIndex = 37; + lblValue19.Text = "值"; + // + // label60 + // + label60.AutoSize = true; + label60.Location = new Point(34, 141); + label60.Name = "label60"; + label60.Size = new Size(84, 20); + label60.TabIndex = 36; + label60.Text = "三色灯出口"; + // + // lblValue18 + // + lblValue18.AutoSize = true; + lblValue18.Location = new Point(1179, 105); + lblValue18.Name = "lblValue18"; + lblValue18.Size = new Size(24, 20); + lblValue18.TabIndex = 35; + lblValue18.Text = "值"; + // + // label58 + // + label58.AutoSize = true; + label58.Location = new Point(1088, 105); + label58.Name = "label58"; + label58.Size = new Size(84, 20); + label58.TabIndex = 34; + label58.Text = "三色灯入口"; + // + // lblValue17 + // + lblValue17.AutoSize = true; + lblValue17.Location = new Point(961, 105); + lblValue17.Name = "lblValue17"; + lblValue17.Size = new Size(24, 20); + lblValue17.TabIndex = 33; + lblValue17.Text = "值"; + // + // label56 + // + label56.AutoSize = true; + label56.Location = new Point(870, 105); + label56.Name = "label56"; + label56.Size = new Size(99, 20); + label56.TabIndex = 32; + label56.Text = "实体按钮状态"; + // + // lblValue16 + // + lblValue16.AutoSize = true; + lblValue16.Location = new Point(750, 105); + lblValue16.Name = "lblValue16"; + lblValue16.Size = new Size(24, 20); + lblValue16.TabIndex = 31; + lblValue16.Text = "值"; + // + // label54 + // + label54.AutoSize = true; + label54.Location = new Point(659, 105); + label54.Name = "label54"; + label54.Size = new Size(99, 20); + label54.TabIndex = 30; + label54.Text = "到位光电信号"; + // + // lblValue15 + // + lblValue15.AutoSize = true; + lblValue15.Location = new Point(538, 105); + lblValue15.Name = "lblValue15"; + lblValue15.Size = new Size(24, 20); + lblValue15.TabIndex = 29; + lblValue15.Text = "值"; + // + // label52 + // + label52.AutoSize = true; + label52.Location = new Point(447, 105); + label52.Name = "label52"; + label52.Size = new Size(99, 20); + label52.TabIndex = 28; + label52.Text = "出口雷达状态"; + // + // lblValue14 + // + lblValue14.AutoSize = true; + lblValue14.Location = new Point(336, 105); + lblValue14.Name = "lblValue14"; + lblValue14.Size = new Size(24, 20); + lblValue14.TabIndex = 27; + lblValue14.Text = "值"; + // + // label50 + // + label50.AutoSize = true; + label50.Location = new Point(245, 105); + label50.Name = "label50"; + label50.Size = new Size(99, 20); + label50.TabIndex = 26; + label50.Text = "入口雷达状态"; + // + // lblValue13 + // + lblValue13.AutoSize = true; + lblValue13.Location = new Point(127, 105); + lblValue13.Name = "lblValue13"; + lblValue13.Size = new Size(24, 20); + lblValue13.TabIndex = 25; + lblValue13.Text = "值"; + // + // label48 + // + label48.AutoSize = true; + label48.Location = new Point(36, 105); + label48.Name = "label48"; + label48.Size = new Size(106, 20); + label48.TabIndex = 24; + label48.Text = "z轴扭矩百分比"; + // + // lblValue12 + // + lblValue12.AutoSize = true; + lblValue12.Location = new Point(1179, 66); + lblValue12.Name = "lblValue12"; + lblValue12.Size = new Size(24, 20); + lblValue12.TabIndex = 23; + lblValue12.Text = "值"; + // + // label46 + // + label46.AutoSize = true; + label46.Location = new Point(1088, 66); + label46.Name = "label46"; + label46.Size = new Size(107, 20); + label46.TabIndex = 22; + label46.Text = "y轴扭矩百分比"; + // + // lblValue11 + // + lblValue11.AutoSize = true; + lblValue11.Location = new Point(961, 66); + lblValue11.Name = "lblValue11"; + lblValue11.Size = new Size(24, 20); + lblValue11.TabIndex = 21; + lblValue11.Text = "值"; + // + // label44 + // + label44.AutoSize = true; + label44.Location = new Point(870, 66); + label44.Name = "label44"; + label44.Size = new Size(107, 20); + label44.TabIndex = 20; + label44.Text = "x轴扭矩百分比"; + // + // lblValue10 + // + lblValue10.AutoSize = true; + lblValue10.Location = new Point(750, 66); + lblValue10.Name = "lblValue10"; + lblValue10.Size = new Size(24, 20); + lblValue10.TabIndex = 19; + lblValue10.Text = "值"; + // + // label42 + // + label42.AutoSize = true; + label42.Location = new Point(659, 66); + label42.Name = "label42"; + label42.Size = new Size(114, 20); + label42.TabIndex = 18; + label42.Text = "载行车设备状态"; + // + // lblValue09 + // + lblValue09.AutoSize = true; + lblValue09.Location = new Point(538, 66); + lblValue09.Name = "lblValue09"; + lblValue09.Size = new Size(24, 20); + lblValue09.TabIndex = 17; + lblValue09.Text = "值"; + // + // label40 + // + label40.AutoSize = true; + label40.Location = new Point(447, 66); + label40.Name = "label40"; + label40.Size = new Size(69, 20); + label40.TabIndex = 16; + label40.Text = "在位状态"; + // + // lblValue08 + // + lblValue08.AutoSize = true; + lblValue08.Location = new Point(336, 66); + lblValue08.Name = "lblValue08"; + lblValue08.Size = new Size(24, 20); + lblValue08.TabIndex = 15; + lblValue08.Text = "值"; + // + // label38 + // + label38.AutoSize = true; + label38.Location = new Point(245, 66); + label38.Name = "label38"; + label38.Size = new Size(99, 20); + label38.TabIndex = 14; + label38.Text = "站内积水状态"; + // + // lblValue07 + // + lblValue07.AutoSize = true; + lblValue07.Location = new Point(127, 66); + lblValue07.Name = "lblValue07"; + lblValue07.Size = new Size(24, 20); + lblValue07.TabIndex = 13; + lblValue07.Text = "值"; + // + // label36 + // + label36.AutoSize = true; + label36.Location = new Point(36, 66); + label36.Name = "label36"; + label36.Size = new Size(84, 20); + label36.TabIndex = 12; + label36.Text = "排风扇状态"; + // + // lblValue06 + // + lblValue06.AutoSize = true; + lblValue06.Location = new Point(1179, 32); + lblValue06.Name = "lblValue06"; + lblValue06.Size = new Size(24, 20); + lblValue06.TabIndex = 11; + lblValue06.Text = "值"; + // + // label34 + // + label34.AutoSize = true; + label34.Location = new Point(1088, 32); + label34.Name = "label34"; + label34.Size = new Size(69, 20); + label34.TabIndex = 10; + label34.Text = "灯光状态"; + // + // lblValue05 + // + lblValue05.AutoSize = true; + lblValue05.Location = new Point(961, 32); + lblValue05.Name = "lblValue05"; + lblValue05.Size = new Size(24, 20); + lblValue05.TabIndex = 9; + lblValue05.Text = "值"; + // + // label32 + // + label32.AutoSize = true; + label32.Location = new Point(870, 32); + label32.Name = "label32"; + label32.Size = new Size(84, 20); + label32.TabIndex = 8; + label32.Text = "遥本控状态"; + // + // lblValue04 + // + lblValue04.AutoSize = true; + lblValue04.Location = new Point(750, 32); + lblValue04.Name = "lblValue04"; + lblValue04.Size = new Size(24, 20); + lblValue04.TabIndex = 7; + lblValue04.Text = "值"; + // + // label30 + // + label30.AutoSize = true; + label30.Location = new Point(659, 32); + label30.Name = "label30"; + label30.Size = new Size(99, 20); + label30.TabIndex = 6; + label30.Text = "设备系统状态"; + // + // lblValue03 + // + lblValue03.AutoSize = true; + lblValue03.Location = new Point(538, 32); + lblValue03.Name = "lblValue03"; + lblValue03.Size = new Size(24, 20); + lblValue03.TabIndex = 5; + lblValue03.Text = "值"; + // + // label28 + // + label28.AutoSize = true; + label28.Location = new Point(447, 32); + label28.Name = "label28"; + label28.Size = new Size(69, 20); + label28.TabIndex = 4; + label28.Text = "模式状态"; + // + // lblValue02 + // + lblValue02.AutoSize = true; + lblValue02.Location = new Point(336, 32); + lblValue02.Name = "lblValue02"; + lblValue02.Size = new Size(24, 20); + lblValue02.TabIndex = 3; + lblValue02.Text = "值"; + // + // label22 + // + label22.AutoSize = true; + label22.Location = new Point(245, 32); + label22.Name = "label22"; + label22.Size = new Size(69, 20); + label22.TabIndex = 2; + label22.Text = "通讯诊断"; + // + // lblValue01 + // + lblValue01.AutoSize = true; + lblValue01.Location = new Point(127, 32); + lblValue01.Name = "lblValue01"; + lblValue01.Size = new Size(24, 20); + lblValue01.TabIndex = 1; + lblValue01.Text = "值"; + // + // label12 + // + label12.AutoSize = true; + label12.Location = new Point(36, 32); + label12.Name = "label12"; + label12.Size = new Size(69, 20); + label12.TabIndex = 0; + label12.Text = "协议版本"; + // + // FrmPlc + // + AutoScaleDimensions = new SizeF(9F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1319, 724); + Controls.Add(groupBox4); + Controls.Add(groupBox1); + Controls.Add(groupBox3); + Controls.Add(groupBox2); + Name = "FrmPlc"; + Text = "FrmPlc"; + groupBox2.ResumeLayout(false); + groupBox2.PerformLayout(); + groupBox3.ResumeLayout(false); + tableLayoutPanel1.ResumeLayout(false); + tableLayoutPanel1.PerformLayout(); + groupBox1.ResumeLayout(false); + tableLayoutPanel2.ResumeLayout(false); + tableLayoutPanel2.PerformLayout(); + groupBox4.ResumeLayout(false); + groupBox4.PerformLayout(); + ResumeLayout(false); + } + + #endregion + private Button BtnCollectionAssignment; + private GroupBox groupBox2; + private TextBox txtValue05; + private TextBox txtValue08; + private Button BtnWrite18; + private Label label1; + private TextBox txtValue19; + private TextBox txtValue04; + private Label label18; + private Button BtnWrite01; + private Button BtnWrite17; + private Label label2; + private TextBox txtValue18; + private Label label17; + private Button BtnWrite02; + private Button BtnWrite16; + private Label label3; + private TextBox txtValue17; + private TextBox txtValue06; + private Label label16; + private Button BtnWrite03; + private Button BtnWrite15; + private Label label4; + private TextBox txtValue16; + private TextBox txtValue07; + private Label label15; + private Button BtnWrite04; + private Label label5; + private Button BtnWrite14; + private Button BtnWrite05; + private TextBox txtValue15; + private Label label6; + private Label label14; + private TextBox txtValue09; + private Button BtnWrite06; + private Label label7; + private TextBox txtValue10; + private Button BtnWrite12; + private Button BtnWrite07; + private Label label8; + private TextBox txtValue11; + private Button BtnWrite11; + private Button BtnWrite08; + private TextBox txtValue14; + private Label label9; + private Label label11; + private TextBox txtValue12; + private Button BtnWrite10; + private Button BtnWrite09; + private TextBox txtValue13; + private Label label10; + private Button button1; + private TextBox txtValue22; + private Label label19; + private Button button2; + private TextBox txtValue21; + private Label label23; + private Button button3; + private TextBox txtValue20; + private Label label24; + private Button button4; + private TextBox txtValue24; + private Label label25; + private Button button5; + private TextBox txtValue23; + private Label label26; + private GroupBox groupBox3; + private Button button6; + private TextBox txtValue03; + private TextBox txtValue02; + private TextBox txtValue01; + private Label label20; + private TableLayoutPanel tableLayoutPanel1; + private GroupBox groupBox1; + private TableLayoutPanel tableLayoutPanel2; + private Button button7; + private GroupBox groupBox4; + private Label lblValue24; + private Label label70; + private Label lblValue23; + private Label label68; + private Label lblValue22; + private Label label66; + private Label lblValue21; + private Label label64; + private Label lblValue20; + private Label label62; + private Label lblValue19; + private Label label60; + private Label lblValue18; + private Label label58; + private Label lblValue17; + private Label label56; + private Label lblValue16; + private Label label54; + private Label lblValue15; + private Label label52; + private Label lblValue14; + private Label label50; + private Label lblValue13; + private Label label48; + private Label lblValue12; + private Label label46; + private Label lblValue11; + private Label label44; + private Label lblValue10; + private Label label42; + private Label lblValue09; + private Label label40; + private Label lblValue08; + private Label label38; + private Label lblValue07; + private Label label36; + private Label lblValue06; + private Label label34; + private Label lblValue05; + private Label label32; + private Label lblValue04; + private Label label30; + private Label lblValue03; + private Label label28; + private Label lblValue02; + private Label label22; + private Label lblValue01; + private Label label12; + private Label lblValue26; + private Label label74; + private Label lblValue25; + private Label label72; + private TextBox textBox20; + private TextBox textBox19; + private TextBox textBox1; + private TextBox textBox2; + private TextBox textBox17; + private TextBox textBox3; + private TextBox textBox4; + private TextBox textBox5; + private TextBox textBox6; + private TextBox textBox7; + private TextBox textBox9; + private TextBox textBox8; + private TextBox textBox10; + private TextBox textBox13; + private TextBox textBox14; + private TextBox textBox12; + private TextBox textBox11; + private TextBox textBox15; + private TextBox textBox16; + private TextBox textBox18; + private TextBox textBox32; + private TextBox textBox31; + private TextBox textBox30; + private TextBox textBox29; + private TextBox textBox27; + private TextBox textBox26; + private TextBox textBox25; + private TextBox textBox24; + private TextBox textBox21; + private TextBox textBox28; + private TextBox textBox33; + private TextBox textBox35; + private TextBox textBox34; + private TextBox textBox36; + private TextBox textBox37; + private TextBox textBox38; + private TextBox textBox39; + private TextBox textBox40; + private TextBox textBox23; + private TextBox textBox22; + } +} \ No newline at end of file diff --git a/WinFormStarter/FrmPlc.cs b/WinFormStarter/FrmPlc.cs new file mode 100644 index 0000000..8c10e8b --- /dev/null +++ b/WinFormStarter/FrmPlc.cs @@ -0,0 +1,555 @@ +using HslCommunication.ModBus; +using HslCommunication; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using HybirdFrameworkDriver.ModbusTcpMaster; +using HybirdFrameworkServices.Init.Entity; +using HybirdFrameworkServices.Plc; +using HybirdFrameworkDriver.TcpServer; +using Newtonsoft.Json.Linq; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace WinFormStarter +{ + public partial class FrmPlc : Form + { + public FrmPlc() + { + InitializeComponent(); + } + + ModbusTcpNet ModbusTcpNet; + int heart = 0; + + private void BtnWrite01_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue04.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.CommunicationDiagnosis.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.CommunicationDiagnosis); + } + + private void BtnWrite02_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue05.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.ModeControl.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.ModeControl); + } + + private void BtnWrite03_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue06.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.EquipmentControl.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.EquipmentControl); + } + + private void BtnWrite04_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue07.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.ExhaustFanControl.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.ExhaustFanControl); + } + + private void BtnWrite05_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue08.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.LightingControl.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.LightingControl); + } + + private void BtnWrite06_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue09.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Seconds.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Seconds); + } + + private void BtnWrite07_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue10.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Points.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Points); + } + + private void BtnWrite08_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue11.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Hour.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Hour); + } + + private void BtnWrite09_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue12.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Day.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Day); + } + + private void BtnWrite10_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue13.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Month.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Month); + } + + private void BtnWrite11_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue14.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.Years.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.Years); + } + + /// + /// 车辆驻车位置 + /// + /// + /// + private void BtnWrite14_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue15.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.VehicleParkingLocation.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.VehicleParkingLocation); + } + + private void BtnWrite15_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue16.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.VehicleParkingStatus.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.VehicleParkingStatus); + } + + /// + /// 三色灯 + /// + /// + /// + private void BtnWrite16_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue17.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.LightIn.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.LightIn); + } + + private void BtnWrite17_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue16.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.LightOut.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.LightOut); + } + /// + /// 锁止异常 + /// + /// + /// + private void BtnWrite18_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue19.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.StopCommand.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.StopCommand); + } + + private void button3_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue20.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.TaskType.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.TaskType); + } + /// + /// 入仓仓位选择 + /// + /// + /// + private void button2_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue21.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.EntrySelection.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.EntrySelection); + } + + private void button1_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue22.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.ExitSelection.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.ExitSelection); + } + + private void button5_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue23.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.BatteryPackType.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.BatteryPackType); + } + + private void button4_Click(object sender, EventArgs e) + { + bool bConvert = ushort.TryParse(this.txtValue24.Text, out ushort iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + plcInfo.hostToPlc.TaskEnablement.Value = iValue; + bool bResult = plcInfo.WriteUint16(plcInfo.hostToPlc.TaskEnablement); + } + + private void button6_Click(object sender, EventArgs e) + { + bool bConvert1 = short.TryParse(this.txtValue01.Text, out short iValue1); + bool bConvert2 = short.TryParse(this.txtValue02.Text, out short iValue2); + bool bConvert3 = short.TryParse(this.txtValue03.Text, out short iValue3); + + ChargerStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo); + if (plcInfo != null) + { + HostToPlc hostToPlc = new HostToPlc(); + hostToPlc.ProtocolVersion1.Value = iValue1; + hostToPlc.ProtocolVersion2.Value = iValue2; + hostToPlc.ProtocolVersion3.Value = iValue3; + plcInfo.Writeint16(hostToPlc.ProtocolVersion1); + plcInfo.Writeint16(hostToPlc.ProtocolVersion2); + plcInfo.Writeint16(hostToPlc.ProtocolVersion3); + } + } + + /// + /// 把采集值显示上来 + /// + /// + /// + private void BtnCollectionAssignment_Click(object sender, EventArgs e) + { + ChargerStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo); + if (plcInfo != null) + { + lblValue01.Text = plcInfo.plcToHost.ProtocolVersion1.Value + "." + + plcInfo.plcToHost.ProtocolVersion2.Value + "." + + plcInfo.plcToHost.ProtocolVersion3.Value; + + lblValue02.Text = plcInfo.plcToHost.CommunicationDiagnosis.Value.ToString(); + lblValue03.Text = plcInfo.plcToHost.ModeControl.Value.ToString(); + lblValue04.Text = plcInfo.plcToHost.DeviceSystemStatus.Value.ToString(); + lblValue05.Text = plcInfo.plcToHost.RemoteLocalControlState.Value.ToString(); + lblValue06.Text = plcInfo.plcToHost.LightStatus.Value.ToString(); + lblValue07.Text = plcInfo.plcToHost.ExhaustFanStatus.Value.ToString(); + lblValue08.Text = plcInfo.plcToHost.WaterStatusStation.Value.ToString(); + lblValue09.Text = plcInfo.plcToHost.InPosition.Value.ToString(); + lblValue10.Text = plcInfo.plcToHost.CarStatus.Value.ToString(); + lblValue11.Text = plcInfo.plcToHost.PercentageTorqueX.Value.ToString(); + lblValue12.Text = plcInfo.plcToHost.PercentageTorqueY.Value.ToString(); + lblValue13.Text = plcInfo.plcToHost.PercentageTorqueZ.Value.ToString(); + lblValue14.Text = plcInfo.plcToHost.RadarStatesIn.Value.ToString(); + lblValue15.Text = plcInfo.plcToHost.RadarStatesOut.Value.ToString(); + lblValue16.Text = plcInfo.plcToHost.SpotPhotoelectricSignal.Value.ToString(); + lblValue17.Text = plcInfo.plcToHost.PhysicalButtonState.Value.ToString(); + lblValue18.Text = plcInfo.plcToHost.LightIn.Value.ToString(); + lblValue19.Text = plcInfo.plcToHost.LightOut.Value.ToString(); + lblValue20.Text = plcInfo.plcToHost.TaskType.Value.ToString(); + lblValue21.Text = plcInfo.plcToHost.TaskStates.Value.ToString(); + lblValue22.Text = plcInfo.plcToHost.OperationalTrainNumber.Value.ToString(); + lblValue23.Text = plcInfo.plcToHost.ChannelLocationState.Value.ToString(); + lblValue24.Text = plcInfo.plcToHost.DeviationX.Value.ToString(); + lblValue25.Text = plcInfo.plcToHost.DeviationY.Value.ToString(); + lblValue26.Text = plcInfo.plcToHost.DeviationZ.Value.ToString(); + + txtValue01.Text = plcInfo.hostToPlc.ProtocolVersion1.Value.ToString(); + txtValue02.Text = plcInfo.hostToPlc.ProtocolVersion2.Value.ToString(); + txtValue03.Text = plcInfo.hostToPlc.ProtocolVersion3.Value.ToString(); + txtValue04.Text = plcInfo.hostToPlc.CommunicationDiagnosis.Value.ToString(); + txtValue05.Text = plcInfo.hostToPlc.ModeControl.Value.ToString(); + txtValue06.Text = plcInfo.hostToPlc.EquipmentControl.Value.ToString(); + txtValue07.Text = plcInfo.hostToPlc.ExhaustFanControl.Value.ToString(); + txtValue08.Text = plcInfo.hostToPlc.LightingControl.Value.ToString(); + txtValue09.Text = plcInfo.hostToPlc.Seconds.Value.ToString(); + txtValue10.Text = plcInfo.hostToPlc.Points.Value.ToString(); + txtValue11.Text = plcInfo.hostToPlc.Hour.Value.ToString(); + txtValue12.Text = plcInfo.hostToPlc.Day.Value.ToString(); + txtValue13.Text = plcInfo.hostToPlc.Month.Value.ToString(); + txtValue14.Text = plcInfo.hostToPlc.Years.Value.ToString(); + txtValue15.Text = plcInfo.hostToPlc.VehicleParkingLocation.Value.ToString(); + txtValue16.Text = plcInfo.hostToPlc.VehicleParkingStatus.Value.ToString(); + txtValue17.Text = plcInfo.hostToPlc.LightIn.Value.ToString(); + txtValue18.Text = plcInfo.hostToPlc.LightOut.Value.ToString(); + txtValue19.Text = plcInfo.hostToPlc.StopCommand.Value.ToString(); + txtValue20.Text = plcInfo.hostToPlc.TaskType.Value.ToString(); + txtValue21.Text = plcInfo.hostToPlc.EntrySelection.Value.ToString(); + txtValue22.Text = plcInfo.hostToPlc.ExitSelection.Value.ToString(); + txtValue23.Text = plcInfo.hostToPlc.BatteryPackType.Value.ToString(); + txtValue24.Text = plcInfo.hostToPlc.TaskEnablement.Value.ToString(); + + textBox1.Text = plcInfo.hostToPlc.ChargingStatus01.Value.ToString(); + textBox2.Text = plcInfo.hostToPlc.ChargingStatus02.Value.ToString(); + textBox3.Text = plcInfo.hostToPlc.ChargingStatus03.Value.ToString(); + textBox4.Text = plcInfo.hostToPlc.ChargingStatus04.Value.ToString(); + textBox5.Text = plcInfo.hostToPlc.ChargingStatus05.Value.ToString(); + textBox6.Text = plcInfo.hostToPlc.ChargingStatus06.Value.ToString(); + textBox7.Text = plcInfo.hostToPlc.ChargingStatus07.Value.ToString(); + textBox8.Text = plcInfo.hostToPlc.ChargingStatus08.Value.ToString(); + textBox9.Text = plcInfo.hostToPlc.ChargingStatus09.Value.ToString(); + textBox10.Text = plcInfo.hostToPlc.ChargingStatus10.Value.ToString(); + textBox11.Text = plcInfo.hostToPlc.ChargingStatus11.Value.ToString(); + textBox12.Text = plcInfo.hostToPlc.ChargingStatus12.Value.ToString(); + textBox13.Text = plcInfo.hostToPlc.ChargingStatus13.Value.ToString(); + textBox14.Text = plcInfo.hostToPlc.ChargingStatus14.Value.ToString(); + textBox15.Text = plcInfo.hostToPlc.ChargingStatus15.Value.ToString(); + textBox16.Text = plcInfo.hostToPlc.ChargingStatus16.Value.ToString(); + textBox17.Text = plcInfo.hostToPlc.ChargingStatus17.Value.ToString(); + textBox18.Text = plcInfo.hostToPlc.ChargingStatus18.Value.ToString(); + textBox19.Text = plcInfo.hostToPlc.ChargingStatus19.Value.ToString(); + textBox20.Text = plcInfo.hostToPlc.ChargingStatus20.Value.ToString(); + + textBox21.Text = plcInfo.hostToPlc.BatteryType01.Value.ToString(); + textBox22.Text = plcInfo.hostToPlc.BatteryType02.Value.ToString(); + textBox23.Text = plcInfo.hostToPlc.BatteryType03.Value.ToString(); + textBox24.Text = plcInfo.hostToPlc.BatteryType04.Value.ToString(); + textBox25.Text = plcInfo.hostToPlc.BatteryType05.Value.ToString(); + textBox26.Text = plcInfo.hostToPlc.BatteryType06.Value.ToString(); + textBox27.Text = plcInfo.hostToPlc.BatteryType07.Value.ToString(); + textBox28.Text = plcInfo.hostToPlc.BatteryType08.Value.ToString(); + textBox29.Text = plcInfo.hostToPlc.BatteryType09.Value.ToString(); + textBox30.Text = plcInfo.hostToPlc.BatteryType10.Value.ToString(); + textBox31.Text = plcInfo.hostToPlc.BatteryType11.Value.ToString(); + textBox32.Text = plcInfo.hostToPlc.BatteryType12.Value.ToString(); + textBox33.Text = plcInfo.hostToPlc.BatteryType13.Value.ToString(); + textBox34.Text = plcInfo.hostToPlc.BatteryType14.Value.ToString(); + textBox35.Text = plcInfo.hostToPlc.BatteryType15.Value.ToString(); + textBox36.Text = plcInfo.hostToPlc.BatteryType16.Value.ToString(); + textBox37.Text = plcInfo.hostToPlc.BatteryType17.Value.ToString(); + textBox38.Text = plcInfo.hostToPlc.BatteryType18.Value.ToString(); + textBox39.Text = plcInfo.hostToPlc.BatteryType19.Value.ToString(); + textBox40.Text = plcInfo.hostToPlc.BatteryType20.Value.ToString(); + } + } + } +} diff --git a/WinFormStarter/FrmPLCConnect.resx b/WinFormStarter/FrmPlc.resx similarity index 100% rename from WinFormStarter/FrmPLCConnect.resx rename to WinFormStarter/FrmPlc.resx diff --git a/WinFormStarter/WinFormStarter.csproj.user b/WinFormStarter/WinFormStarter.csproj.user index af3b79d..82fa05d 100644 --- a/WinFormStarter/WinFormStarter.csproj.user +++ b/WinFormStarter/WinFormStarter.csproj.user @@ -2,7 +2,7 @@ - + Form