From 44127bbe8f2cc0e54b7e6a2e9fbe6d2058b73b5d Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Mon, 15 Jul 2024 15:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E5=91=BD=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Api/Resp/FireResp.cs | 12 +++---- .../FireControl/Client/FireControlClient.cs | 2 +- Service/FireControl/FireAutoMapper.cs | 36 +++++++++---------- .../Controllers/FireControlController.cs | 6 ++-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Entity/Api/Resp/FireResp.cs b/Entity/Api/Resp/FireResp.cs index 6075db0..e375844 100644 --- a/Entity/Api/Resp/FireResp.cs +++ b/Entity/Api/Resp/FireResp.cs @@ -2,12 +2,12 @@ public partial class FireResp { - public Subzone2 Subzone2 = new Subzone2(); - public Subzone5 Subzone5 = new Subzone5(); - public Subzone7 Subzone7 = new Subzone7(); + public Subzone2Resp Subzone2Resp { get; set; } = new Subzone2Resp(); + public Subzone5Resp Subzone5Resp { get; set; }= new Subzone5Resp(); + public Subzone7Resp Subzone7Resp { get; set; } = new Subzone7Resp(); } -public class Subzone2 +public class Subzone2Resp { /// /// 启动喷洒 1:延时结束后,发出启动喷洒 信号0:默认状态 @@ -30,7 +30,7 @@ public class Subzone2 public bool DeflatedDoNotEnter { get; set; } } -public class Subzone5 +public class Subzone5Resp { /// /// 防护区 @@ -123,7 +123,7 @@ public class Subzone5 public byte Smoke006 { get; set; } } -public class Subzone7 +public class Subzone7Resp { /// /// 1#灭火器状态 diff --git a/Service/FireControl/Client/FireControlClient.cs b/Service/FireControl/Client/FireControlClient.cs index 79653d7..38a2547 100644 --- a/Service/FireControl/Client/FireControlClient.cs +++ b/Service/FireControl/Client/FireControlClient.cs @@ -48,7 +48,7 @@ public class FireControlClient: ModbusTcpMaster if (bytes02 != null) { Log.Info("fire read bytes02 success"); - //ModbusDecoder.Decode(bytes02, FireControlMgr.Subzone2, EndingConst.ByteSeq.AB, EndingConst.WordSeq.DC); + //ModbusDecoder.Decode(bytes02, FireControlMgr.Subzone2Resp, EndingConst.ByteSeq.AB, EndingConst.WordSeq.DC); FireControlMgr.Subzone2.GiveAnAlarm.Value = bytes02[0]; FireControlMgr.Subzone2.NumberOfFailures.Value = bytes02[1]; FireControlMgr.Subzone2.SoundSuppression.Value = bytes02[2]; diff --git a/Service/FireControl/FireAutoMapper.cs b/Service/FireControl/FireAutoMapper.cs index 1d60cab..9fb6e28 100644 --- a/Service/FireControl/FireAutoMapper.cs +++ b/Service/FireControl/FireAutoMapper.cs @@ -4,34 +4,34 @@ namespace Service.FireControl; public class FireAutoMapper { - public static Entity.Api.Resp.Subzone2 Subzone2(Service.FireControl.Msg.Subzone2 subzone2) + public static Entity.Api.Resp.Subzone2Resp Subzone2(Service.FireControl.Msg.Subzone2 subzone2) { - Entity.Api.Resp.Subzone2 Subzone2 = new Subzone2(); - Subzone2.PrimingSpray = subzone2.PrimingSpray.Value; - Subzone2.Spray = subzone2.Spray.Value; - Subzone2.AudibleVisualAlarmStatus = subzone2.AudibleVisualAlarmStatus.Value; - Subzone2.DeflatedDoNotEnter = subzone2.DeflatedDoNotEnter.Value; + Entity.Api.Resp.Subzone2Resp subzone2Resp = new Subzone2Resp(); + subzone2Resp.PrimingSpray = subzone2.PrimingSpray.Value; + subzone2Resp.Spray = subzone2.Spray.Value; + subzone2Resp.AudibleVisualAlarmStatus = subzone2.AudibleVisualAlarmStatus.Value; + subzone2Resp.DeflatedDoNotEnter = subzone2.DeflatedDoNotEnter.Value; - return Subzone2; + return subzone2Resp; } - public static Entity.Api.Resp.Subzone5 Subzone5(Service.FireControl.Msg.Subzone5 subzone5) + public static Entity.Api.Resp.Subzone5Resp Subzone5(Service.FireControl.Msg.Subzone5 subzone5) { - Entity.Api.Resp.Subzone5 Subzone5 = new Subzone5(); - Subzone5.DetectorID001 = subzone5.DetectorID001.Value; - Subzone5.Temperature001 = subzone5.Temperature001.Value; - Subzone5.CoConcentration001 = subzone5.CoConcentration001.Value; - Subzone5.AlarmLevel001 = subzone5.AlarmLevel001.Value; - Subzone5.Smoke001 = subzone5.Smoke001.Value; + Entity.Api.Resp.Subzone5Resp subzone5Resp = new Subzone5Resp(); + subzone5Resp.DetectorID001 = subzone5.DetectorID001.Value; + subzone5Resp.Temperature001 = subzone5.Temperature001.Value; + subzone5Resp.CoConcentration001 = subzone5.CoConcentration001.Value; + subzone5Resp.AlarmLevel001 = subzone5.AlarmLevel001.Value; + subzone5Resp.Smoke001 = subzone5.Smoke001.Value; - return Subzone5; + return subzone5Resp; } - public static Entity.Api.Resp.Subzone7 Subzone7(Service.FireControl.Msg.Subzone7 subzone7) + public static Entity.Api.Resp.Subzone7Resp Subzone7(Service.FireControl.Msg.Subzone7 subzone7) { - Entity.Api.Resp.Subzone7 Subzone7 = new Subzone7(); + Entity.Api.Resp.Subzone7Resp subzone7Resp = new Subzone7Resp(); - return Subzone7; + return subzone7Resp; } } \ No newline at end of file diff --git a/WebStarter/Controllers/FireControlController.cs b/WebStarter/Controllers/FireControlController.cs index 1cc22cb..4634dfc 100644 --- a/WebStarter/Controllers/FireControlController.cs +++ b/WebStarter/Controllers/FireControlController.cs @@ -267,9 +267,9 @@ public class FireControlController public Result FireResp() { FireResp FireResp = new FireResp(); - FireResp.Subzone2 = FireAutoMapper.Subzone2(FireControlMgr.Subzone2); - FireResp.Subzone5 = FireAutoMapper.Subzone5(FireControlMgr.Subzone5); - FireResp.Subzone7 = FireAutoMapper.Subzone7(FireControlMgr.Subzone7); + FireResp.Subzone2Resp = FireAutoMapper.Subzone2(FireControlMgr.Subzone2); + FireResp.Subzone5Resp = FireAutoMapper.Subzone5(FireControlMgr.Subzone5); + FireResp.Subzone7Resp = FireAutoMapper.Subzone7(FireControlMgr.Subzone7); return Result.Success(FireResp); }