From 350507ac0a6ccfa0463612996731f4165fe55601 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 25 九月 2024 09:18:22 +0800
Subject: [PATCH] 工作台增加滚筒反转开关

---
 Web/src/views/device/deviceInfo/index.vue                 |    4 ++++
 Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs |    2 +-
 Admin.NET/WCS.Application/PLC/PLCTaskAction.cs            |    3 +++
 Admin.NET/WCS.Application/Hub/PlcHub.cs                   |    8 ++++++++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs
index ecf48ab..0804cad 100644
--- a/Admin.NET/WCS.Application/Hub/PlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -69,6 +69,12 @@
             PLCTaskAction.boDemo = context.BoDemo.Value;
             await _sysConfigService.UpdateConfigValue("sys_demo", context.BoDemo.Value);
         }
+        //婊氱瓛鍙嶈浆
+        if (context.BoDrumReversal.HasValue)
+        {
+            PLCTaskAction.boDrumReversal = context.BoDrumReversal.Value;
+            await _sysConfigService.UpdateConfigValue("sys_DrumReversal", context.BoDrumReversal.Value);
+        }
         await _plcHubContext.Clients.All.UpdateService(new PLCServiceModel() { BoRunningState = PLCTaskAction.boRunningState, BoRefresh = PLCTaskAction.boRefresh, BoOffline = PLCTaskAction.boOffline, BoDemo = PLCTaskAction.boDemo});
     }
 }
@@ -83,4 +89,6 @@
     public bool? BoRefresh { get; set; }
 
     public bool? BoDemo { get; set; }
+
+    public bool? BoDrumReversal { get; set; }
 }
\ No newline at end of file
diff --git a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
index 8f3727a..59066e6 100644
--- a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
@@ -15,6 +15,8 @@
     public static bool boRefresh = false;
     //婕旂ず妯″紡
     public static bool boDemo = false;
+    //婊氱瓛鍙嶈浆
+    public static bool boDrumReversal = false;
 
     public static List<PlcPositionInfo> listPositionInfo = new List<PlcPositionInfo>();
 
@@ -52,6 +54,7 @@
         boOffline = _sysConfigService.GetConfigValue<bool>("sys_Offline").Result;
         boRefresh = _sysConfigService.GetConfigValue<bool>("sys_Refresh").Result;
         boDemo = _sysConfigService.GetConfigValue<bool>("sys_demo").Result;
+        boDrumReversal = _sysConfigService.GetConfigValue<bool>("sys_DrumReversal").Result;
     }
     /// <summary>
     /// 鍒濆鍖朠LC杩炴帴
diff --git a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
index 362188f..ed6dfd1 100644
--- a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
@@ -136,7 +136,7 @@
             }
         }
         //鏈嶅姟鐘舵��
-        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh, PLCTaskAction.boDemo };
+        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh, PLCTaskAction.boDemo, PLCTaskAction.boDrumReversal };
         return new { listPlc, modService };
     }
     /// <summary>
diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue
index 14fe6f2..4e0cddd 100644
--- a/Web/src/views/device/deviceInfo/index.vue
+++ b/Web/src/views/device/deviceInfo/index.vue
@@ -20,6 +20,10 @@
 							<el-switch v-model="state.boDemo" active-text="" inactive-text="婕旂ず妯″紡"
 								@change="handleSwitchChange('boDemo', $event)"></el-switch>
 						</el-card>
+						<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
+							<el-switch v-model="state.boDrumReversal" active-text="" inactive-text="婊氬姩鍙嶈浆"
+								@change="handleSwitchChange('boDrumReversal', $event)"></el-switch>
+						</el-card>
 					</el-collapse-item>
 
 					<el-collapse-item title="鍫嗗灈鏈�" name="2">

--
Gitblit v1.8.0