From 4db56b86d54f4f8d5a01ecb7365a30673f5d8fd4 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期四, 12 九月 2024 14:00:39 +0800
Subject: [PATCH] Merge branch 'master' into csc

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

diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs
index c8108e7..ecf48ab 100644
--- a/Admin.NET/WCS.Application/Hub/PlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -63,6 +63,12 @@
             PLCTaskAction.boRefresh = context.BoRefresh.Value;
             await _sysConfigService.UpdateConfigValue("sys_Refresh", context.BoRefresh.Value);
         }
+        //婕旂ず妯″紡
+        if (context.BoDemo.HasValue)
+        {
+            PLCTaskAction.boDemo = context.BoDemo.Value;
+            await _sysConfigService.UpdateConfigValue("sys_demo", context.BoDemo.Value);
+        }
         await _plcHubContext.Clients.All.UpdateService(new PLCServiceModel() { BoRunningState = PLCTaskAction.boRunningState, BoRefresh = PLCTaskAction.boRefresh, BoOffline = PLCTaskAction.boOffline, BoDemo = PLCTaskAction.boDemo});
     }
 }
diff --git a/Admin.NET/WCS.Application/PLC/PLCService.cs b/Admin.NET/WCS.Application/PLC/PLCService.cs
index 17059d0..4856b54 100644
--- a/Admin.NET/WCS.Application/PLC/PLCService.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCService.cs
@@ -42,6 +42,9 @@
                 case PLCTypeEnum.PalletMachine:
                     PalletMachine(mod);
                     break;
+                case PLCTypeEnum.StackingRobot:
+                    PalletMachine(mod);
+                    break;
                 default:
                     break;
             }
@@ -1123,6 +1126,25 @@
 
     }
 
+    /// <summary>
+    /// 鎷嗗灈鏈哄櫒浜轰笟鍔″鐞�
+    /// </summary>
+    /// <param name="modDevice"></param>
+    private static void StackingRobot(WcsDeviceDto modDevice) 
+    {
+        var plcConn = modDevice.PLCUtil;
+        switch (modDevice.Value.ToString())
+        {
+            case "0":
+                {
+                    // 鑻ユ媶鍨涘伐浣嶄负绌洪棽锛屾煡璇换鍔¤〃鏄惁鏈夋湭缁戝畾鐨勫嚭搴撲换鍔★紝鍋氱粦瀹氭搷浣�
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
     private static void Test(WcsDeviceDto modDevice)
     {
         //鍐欐娴嬭瘯璇籹tring
diff --git a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
index e4fce43..0d77413 100644
--- a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
@@ -135,7 +135,7 @@
             }
         }
         //鏈嶅姟鐘舵��
-        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh };
+        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh, PLCTaskAction.boDemo };
         return new { listPlc, modService };
     }
     /// <summary>
diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue
index 9d46727..dc5861a 100644
--- a/Web/src/views/device/deviceInfo/index.vue
+++ b/Web/src/views/device/deviceInfo/index.vue
@@ -16,6 +16,10 @@
 							<el-switch v-model="state.boRefresh" active-text="" inactive-text="鑷埛鏂�"
 								@change="handleSwitchChange('boRefresh', $event)"></el-switch>
 						</el-card>
+						<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
+							<el-switch v-model="state.boDemo" active-text="" inactive-text="婕旂ず妯″紡"
+								@change="handleSwitchChange('boDemo', $event)"></el-switch>
+						</el-card>
 					</el-collapse-item>
 
 					<el-collapse-item title="鍫嗗灈鏈�" name="2">

--
Gitblit v1.8.0