1
czw
2 天以前 a036defc13533bd0a5c3364598cc8e2adbc1e28c
1
6个文件已修改
2个文件已添加
171 ■■■■■ 已修改文件
2025年6月12日/AuxAllWCS/Build/Project/代码/界面事件.cs 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Devices/PlcConfig 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Devices/设备通信.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Dlls/Dll.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Dlls/GZ.Device.PLC.dll 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Dlls/McpXLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Net/Conn.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
2025年6月12日/AuxAllWCS/Temp/McpXLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/½çÃæÊ¼þ.cs
@@ -28,10 +28,6 @@
using GZ.DB.Repository.OIDATABASE;
using GZ.DB.IRepository.OIDATABASE;
using GZ.DB.Entity.OIDATABASE;
using static GZ.Projects.AuxAllWCS.ToWMSMES.CreateTask;
using GZ.Device.PLC;
using System.Text.RegularExpressions;
using ServiceStack.Text;
namespace GZ.Projects.AuxAllWCS
{
    /// <summary>
@@ -67,66 +63,37 @@
            }
            View1_Init(sender, e);
            var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs");
            //string text = File.ReadAllText(configPath);
            //PlcConfig plcConfig = JsonConvert.DeserializeObject<PlcConfig>(text);
            //if (plcConfig != null && FactoryMap.ContainsKey((int)plcConfig.Brand) && FactoryMap[(int)plcConfig.Brand].Contains((int)plcConfig.Comm))
            //{
            //foreach (var configPath in Directory.EnumerateFiles(@"G:\1AGIT\HH-0167_WuHuAoKeSi\2025å¹´6月12日\AuxAllWCS\Build\auxwcs\bin\Debug\Configs", "* - å‰¯æœ¬", SearchOption.TopDirectoryOnly))
            //{
            //    string text = File.ReadAllText(configPath);
            //    PlcConfig plcConfig = JsonConvert.DeserializeObject<PlcConfig>(text);
            //    if (plcConfig.Brand == DeviceBrand.Siemens)
            //    {
            //        string pattern = "^(?<ip>((?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))\r\n:(?<port>0|[1-9]\\d{0,4}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])\r\n(?:(?::(?<number>\\d+)|\\[(?<rack>\\d+),(?<slot>\\d+)\\]|\\[v(?<ver>\\d+\\.\\d+)\\])){0,3}$";
            //        Match match = Regex.Match(plcConfig.IP, pattern, RegexOptions.IgnorePatternWhitespace);
            //        if (match.Success)
            //        {
            //            string value = match.Groups["ip"].Value;
            //            int.TryParse(match.Groups["port"].Value, out var result3);
            //            int.TryParse(match.Groups["number"].Value, out var result4);
            //            short.TryParse(match.Groups["rack"].Value, out var result5);
            //            short.TryParse(match.Groups["slot"].Value, out var result6);
            //            string value2 = match.Groups["ver"].Value;
            //            var result = new Comm_S7Net(Comm_S7Net. CpuType., value, result3, result5, result6, result4, value2);
            //        }
            //    }
            //}
            //}
            //Console.Write(path);
            /// <summary>
            /// ç¨‹åºç‰‡æ®µ:初始化配置
            /// æè¿°:
            /// </summary>
            System.Threading.Tasks.Task.Factory.StartNew(() =>
        {
            System.Threading.Thread.CurrentThread.IsBackground = true;
            ExitJudgeStack.Push(0);
            //一直执行,直到满足结束条件
            while (true)
            {
                if (IsExitApp) { break; }
                try
                System.Threading.Thread.CurrentThread.IsBackground = true;
                ExitJudgeStack.Push(0);
                //一直执行,直到满足结束条件
                while (true)
                {
                    #region    [脚本][20250323111613779][业务逻辑.初始化配置]
                    if (IsExitApp) { break; }
                    try
                    {
                        #region    [脚本][20250323111613779][业务逻辑.初始化配置]
                    Action myDelegate = () => SettingInit();
                    AutoThread.InvokeMethod(AutoThread.Instance, "ThreadSettingInit", new object[] { tag, myDelegate });
                    #endregion [脚本][20250323111613779][业务逻辑.初始化配置]
                        Action myDelegate = () => SettingInit();
                        AutoThread.InvokeMethod(AutoThread.Instance, "ThreadSettingInit", new object[] { tag, myDelegate });
                        #endregion [脚本][20250323111613779][业务逻辑.初始化配置]
                    }
                    catch (Exception ex)
                    {
                        Conn.默认日志.Error(ex.ToString());
                    }
                    finally
                    {
                        System.Threading.Thread.Sleep(10000);
                    }
                }
                catch (Exception ex)
                {
                    Conn.默认日志.Error(ex.ToString());
                }
                finally
                {
                    System.Threading.Thread.Sleep(10000);
                }
            }
            ExitJudgeStack.TryPop(out int exitJudgeVal);
        });
                ExitJudgeStack.TryPop(out int exitJudgeVal);
            });
            /// <summary>
            /// ç¨‹åºç‰‡æ®µ:捷瞬抓臂1
            /// æè¿°:
@@ -843,8 +810,16 @@
                    {
                        #region    [脚本][20250323151832119][业务逻辑.Ipping]
                        //var hkr = AutoThread.InvokeMethod(AutoThread.Instance, "IsMachineOnline", new object[] { "192.168.1.103", 1000 });
                        //Console.WriteLine("192.168.1.103 > " + hkr.ToString());
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>");
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<程序·启动>>>>>>>>>>>>>>");
                        //// ä½¿ç”¨æ‹¦æˆªå™¨
                        //var interceptor = new ConsoleInterceptor();
                        //Console.SetOut(interceptor);
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>");
                        //AnsiConsole.Markup("[underline red]Hello[/] World!");
                        // AnsiConsole.Markup("[underline red]Hello[/] World!");
                        #endregion [脚本][20250323151832119][业务逻辑.Ipping]
                    }
                    catch (Exception ex)
@@ -1008,6 +983,9 @@
                    Device.A3005取货交互?.Stop();
                    Device.A3006放货交互?.Stop();
                    Device.A3010取货交互?.Stop();
                    Device.S2008Read?.Stop();
                    Device.Z转子1号机械手?.Stop();
                    Device.Z转子2号机械手?.Stop();
                }
                catch (Exception ex)
                {
@@ -1077,6 +1055,9 @@
                        || (Device.A3005取货交互 == null ? false : Device.A3005取货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.A3006放货交互 == null ? false : Device.A3006放货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.A3010取货交互 == null ? false : Device.A3010取货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.S2008Read == null ? false : Device.S2008Read.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.Z转子1号机械手 == null ? false : Device.Z转子1号机械手.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.Z转子2号机械手 == null ? false : Device.Z转子2号机械手.State != GZ.Device.PLC.PlcRunState.Stoped)
                    )
                    {
                        System.Threading.Thread.Sleep(1000);
@@ -1250,43 +1231,6 @@
                                        var model = JsonConvert.DeserializeObject<ToWMSMES.CreateTask>(requestJson);
                                        var res = ToWMSMES.CreateTask.CreatePointTask(model);
                                        return JsonConvert.SerializeObject(res);
                                    }
                                case "/api/Wcs/initZZCache":
                                    {
                                        statusCode = System.Net.HttpStatusCode.OK;
                                        var rturn = new ReturnMsg
                                        {
                                            resultCode = 0,
                                            resultMsg = ""
                                        };
                                        try
                                        {
                                            LocRepository locRepository = new LocRepository();
                                            foreach (var item in Settings.deviceInfos.FindAll(x => x.deviceType == 2))
                                            {
                                                foreach (var ssloc in item.deviceNo)
                                                {
                                                    var ssl = locRepository.FindEntity(x => x.S_LOC_CODE == ssloc);
                                                    if (ssl != null && (ssl.N_CURRENT_NUM > 0 || ssl.S_LOCK_STATE != "无"))
                                                    {
                                                        ssl.N_CURRENT_NUM = 0;
                                                        ssl.S_LOCK_STATE = "无";
                                                        locRepository.Update(ssl);
                                                    }
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            LogHelper.Error("/api/Wcs/initZZCache" + requestJson + ex.Message, ex);
                                            return JsonConvert.SerializeObject(new ReturnMsg
                                            {
                                                resultCode = -1,
                                                resultMsg = ex.Message
                                            });
                                        }
                                        return JsonConvert.SerializeObject(rturn);
                                    }
                            }
                            break;
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Devices/PlcConfig
@@ -1778,8 +1778,8 @@
      "Desc": "10.221.55.131 - 1号发那科",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "1",
      "Comm": "MC",
      "IP": "10.221.55.131:6000",
      "RedisQueueName": "p发那科1下线Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -6606,8 +6606,8 @@
      "Desc": "10.221.55.141 - 2号发那科",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "2",
      "Comm": "MC",
      "IP": "10.221.55.141:6000",
      "RedisQueueName": "p发那科2下线Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -6929,8 +6929,8 @@
      "Desc": "一线地址:10.221.55.181     ç«¯å£ï¼š6000",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "3",
      "Comm": "MC",
      "IP": "10.221.55.181:6000",
      "RedisQueueName": "D定子1号机械手Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -7252,8 +7252,8 @@
      "Desc": "二线地址:10.221.55.179     ç«¯å£ï¼š6000",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "4",
      "Comm": "MC",
      "IP": "10.221.55.179:6000",
      "RedisQueueName": "D定子2号机械手Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -9895,8 +9895,8 @@
      "Desc": "一线地址:10.221.50.221:3318",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "5",
      "Comm": "MC",
      "IP": "10.221.50.221:3318",
      "RedisQueueName": "Z转子1号机械手Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -10277,8 +10277,8 @@
      "Desc": "一线地址:10.221.50.231:3318",
      "Brand": "Melsec",
      "Model": "Q10UDEH",
      "Comm": "MXComponent",
      "IP": "6",
      "Comm": "MC",
      "IP": "10.221.50.231:3318",
      "RedisQueueName": "Z转子2号机械手Queue",
      "IsSimulate": false,
      "Reserve1": "",
@@ -10287,5 +10287,5 @@
    }
  ],
  "CreationTime": "2025-02-26 15:31:23",
  "LastWriteTime": "2025-07-22 14:41:02"
  "LastWriteTime": "2025-07-23 17:17:02"
}
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Devices/É豸ͨÐÅ.json
@@ -2,5 +2,5 @@
  "ProjectSn": "1",
  "DeviceList": [],
  "CreationTime": "2025-02-26 15:31:23",
  "LastWriteTime": "2025-07-22 14:41:02"
  "LastWriteTime": "2025-07-23 17:17:02"
}
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Dlls/Dll.json
@@ -475,5 +475,14 @@
    "FilePath": "\\Microsoft.Web.WebView2.Wpf.dll",
    "IsRequired": false,
    "Type": "Local"
  },
  {
    "Name": "McpXLib",
    "Version": "",
    "FileName": "McpXLib.dll",
    "FileVersion": "0.5.2.0",
    "FilePath": "\\McpXLib.dll",
    "IsRequired": false,
    "Type": "Local"
  }
]
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Dlls/GZ.Device.PLC.dll
Binary files differ
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Dlls/McpXLib.dll
Binary files differ
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Net/Conn.json
@@ -340,5 +340,5 @@
    }
  ],
  "CreationTime": "2025-02-26 15:31:23",
  "LastWriteTime": "2025-07-21 16:43:27"
  "LastWriteTime": "2025-07-23 17:17:40"
}
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Temp/McpXLib.dll
Binary files differ