diff --git a/.gitignore b/.gitignore index 5730b32..3d71229 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,12 @@ /LargeSquareOne/bin/Debug /LargeSquareOne/obj/Debug /packages -/.vs +.vs/ [Dd]ebug/ +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-shm +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-wal +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-wal +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-shm +/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db deleted file mode 100644 index a4c9113..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db and /dev/null differ diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-shm b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-shm deleted file mode 100644 index 9495530..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-shm and /dev/null differ diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-wal b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-wal deleted file mode 100644 index 0feccb1..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-wal and /dev/null differ diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db deleted file mode 100644 index 61a487e..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db and /dev/null differ diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-shm b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-shm deleted file mode 100644 index 8cc6216..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-shm and /dev/null differ diff --git a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-wal b/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-wal deleted file mode 100644 index 18f50e8..0000000 Binary files a/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-wal and /dev/null differ diff --git a/JinYuan.ControlCenter/ControlCenter_Plc.cs b/JinYuan.ControlCenter/ControlCenter_Plc.cs index e66345c..6029abd 100644 --- a/JinYuan.ControlCenter/ControlCenter_Plc.cs +++ b/JinYuan.ControlCenter/ControlCenter_Plc.cs @@ -2005,7 +2005,9 @@ namespace JinYuan.ControlCenters #endregion // MES分档查询 - var channel = channels.FirstOrDefault(it => it.Gears.Contains(mesResType[0])); + + string[] mesChannels = mesResType[0].Split(','); + var channel = channels.FirstOrDefault(it => StrUtil.IsExist(it.Gears, mesChannels)); if (channel != null) { diff --git a/JinYuan.Helper/JinYuan.Helper.csproj b/JinYuan.Helper/JinYuan.Helper.csproj index f327042..d12a77a 100644 --- a/JinYuan.Helper/JinYuan.Helper.csproj +++ b/JinYuan.Helper/JinYuan.Helper.csproj @@ -158,6 +158,7 @@ + diff --git a/JinYuan.Helper/JinYuan.Helper.csproj.user b/JinYuan.Helper/JinYuan.Helper.csproj.user index a607660..0b24643 100644 --- a/JinYuan.Helper/JinYuan.Helper.csproj.user +++ b/JinYuan.Helper/JinYuan.Helper.csproj.user @@ -1,6 +1,6 @@ - ShowAllFiles + ProjectFiles \ No newline at end of file diff --git a/JinYuan.Helper/StrUtil.cs b/JinYuan.Helper/StrUtil.cs new file mode 100644 index 0000000..417309b --- /dev/null +++ b/JinYuan.Helper/StrUtil.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JinYuan.Helper +{ + public class StrUtil + { + public static bool IsExist(List searchList, string[] desArr) + { + bool result = false; + + foreach (string str in searchList) + { + if (desArr.Contains(str)) + { + result = true; + break; + } + } + + return result; + } + } +} diff --git a/JinYuan.Models/JinYuan.Models.csproj b/JinYuan.Models/JinYuan.Models.csproj index 044f08f..0da76b9 100644 --- a/JinYuan.Models/JinYuan.Models.csproj +++ b/JinYuan.Models/JinYuan.Models.csproj @@ -93,22 +93,22 @@ - - - + + + - - + + - - - - - - - - + + + + + + + + diff --git a/JinYuan.Models/SysConfig/ChallengeCode.cs b/JinYuan.Models/SysCfg/ChallengeCode.cs similarity index 100% rename from JinYuan.Models/SysConfig/ChallengeCode.cs rename to JinYuan.Models/SysCfg/ChallengeCode.cs diff --git a/JinYuan.Models/SysConfig/ChannelConfig.cs b/JinYuan.Models/SysCfg/ChannelConfig.cs similarity index 92% rename from JinYuan.Models/SysConfig/ChannelConfig.cs rename to JinYuan.Models/SysCfg/ChannelConfig.cs index 7a46ddc..f974b4c 100644 --- a/JinYuan.Models/SysConfig/ChannelConfig.cs +++ b/JinYuan.Models/SysCfg/ChannelConfig.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace JinYuan.Models.SysConfig +namespace JinYuan.Models.SysCfg { public class ChannelConfig { diff --git a/JinYuan.Models/SysConfig/Device.cs b/JinYuan.Models/SysCfg/Device.cs similarity index 100% rename from JinYuan.Models/SysConfig/Device.cs rename to JinYuan.Models/SysCfg/Device.cs diff --git a/JinYuan.Models/SysConfig/Enum.cs b/JinYuan.Models/SysCfg/Enum.cs similarity index 100% rename from JinYuan.Models/SysConfig/Enum.cs rename to JinYuan.Models/SysCfg/Enum.cs diff --git a/JinYuan.Models/SysConfig/Group.cs b/JinYuan.Models/SysCfg/Group.cs similarity index 100% rename from JinYuan.Models/SysConfig/Group.cs rename to JinYuan.Models/SysCfg/Group.cs diff --git a/JinYuan.Models/SysConfig/ParamBase.cs b/JinYuan.Models/SysCfg/ParamBase.cs similarity index 100% rename from JinYuan.Models/SysConfig/ParamBase.cs rename to JinYuan.Models/SysCfg/ParamBase.cs diff --git a/JinYuan.Models/SysConfig/ParamList.cs b/JinYuan.Models/SysCfg/ParamList.cs similarity index 100% rename from JinYuan.Models/SysConfig/ParamList.cs rename to JinYuan.Models/SysCfg/ParamList.cs diff --git a/JinYuan.Models/SysConfig/ProductModel.cs b/JinYuan.Models/SysCfg/ProductModel.cs similarity index 100% rename from JinYuan.Models/SysConfig/ProductModel.cs rename to JinYuan.Models/SysCfg/ProductModel.cs diff --git a/JinYuan.Models/SysConfig/ProductModelParam.cs b/JinYuan.Models/SysCfg/ProductModelParam.cs similarity index 100% rename from JinYuan.Models/SysConfig/ProductModelParam.cs rename to JinYuan.Models/SysCfg/ProductModelParam.cs diff --git a/JinYuan.Models/SysConfig/SysAdmin.cs b/JinYuan.Models/SysCfg/SysAdmin.cs similarity index 100% rename from JinYuan.Models/SysConfig/SysAdmin.cs rename to JinYuan.Models/SysCfg/SysAdmin.cs diff --git a/JinYuan.Models/SysConfig/SysConfig.cs b/JinYuan.Models/SysCfg/SysConfig.cs similarity index 97% rename from JinYuan.Models/SysConfig/SysConfig.cs rename to JinYuan.Models/SysCfg/SysConfig.cs index fa68ba4..d2c9288 100644 --- a/JinYuan.Models/SysConfig/SysConfig.cs +++ b/JinYuan.Models/SysCfg/SysConfig.cs @@ -1,4 +1,4 @@ -namespace JinYuan.Models.SysConfig +namespace JinYuan.Models.SysCfg { public class SysConfig { diff --git a/JinYuan.Models/SysConfig/SysLog.cs b/JinYuan.Models/SysCfg/SysLog.cs similarity index 100% rename from JinYuan.Models/SysConfig/SysLog.cs rename to JinYuan.Models/SysCfg/SysLog.cs diff --git a/JinYuan.Models/SysConfig/Variable.cs b/JinYuan.Models/SysCfg/Variable.cs similarity index 100% rename from JinYuan.Models/SysConfig/Variable.cs rename to JinYuan.Models/SysCfg/Variable.cs diff --git a/JinYuan.VirtualDataLibrary/CommonMethods.cs b/JinYuan.VirtualDataLibrary/CommonMethods.cs index 18c4abe..2e4686f 100644 --- a/JinYuan.VirtualDataLibrary/CommonMethods.cs +++ b/JinYuan.VirtualDataLibrary/CommonMethods.cs @@ -5,7 +5,7 @@ using JinYuan.DAL; using JinYuan.Helper; using JinYuan.MES; using JinYuan.Models; -using JinYuan.Models.SysConfig; +using JinYuan.Models.SysCfg; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -403,6 +403,11 @@ namespace JinYuan.VirtualDataLibrary MESGradingSet[i] = (short)channels[i].DefaultValue; } + // For Test + //string testStr = "E63y,F63y"; + //string[] mesChannels = testStr.Split(','); + //var channel = channels.FirstOrDefault(it => StrUtil.IsExist(it.Gears, mesChannels)); + var isWrite1 = PlcLink.WriteValue("D2600", MESGradingSet[0], Data_Type.Short); var isWrite2 = PlcLink.WriteValue("D2601", MESGradingSet[1], Data_Type.Short); var isWrite3 = PlcLink.WriteValue("D2602", MESGradingSet[2], Data_Type.Short); @@ -534,10 +539,10 @@ namespace JinYuan.VirtualDataLibrary public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini"); - public static string ChannelPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\settings.json"); + public static string ChannelPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\Channel.json"); #region 读å�–jsoné…�ç½® - public static Models.SysConfig.ChannelConfig LoadFromJson(string filePath) + public static Models.SysCfg.ChannelConfig LoadFromJson(string filePath) { var json = File.ReadAllText(filePath); return JsonConvert.DeserializeObject(json); diff --git a/JinYuan.VirtualDataLibrary/MesConfig.cs b/JinYuan.VirtualDataLibrary/MesConfig.cs index 4c8cec0..4d65cef 100644 --- a/JinYuan.VirtualDataLibrary/MesConfig.cs +++ b/JinYuan.VirtualDataLibrary/MesConfig.cs @@ -1,4 +1,4 @@ -using JinYuan.Models.SysConfig; +using JinYuan.Models.SysCfg; using System.Collections.Generic; namespace JinYuan.VirtualDataLibrary @@ -143,7 +143,7 @@ namespace JinYuan.VirtualDataLibrary /// /// 通é�“æ¡£ä½�设置 /// - public Models.SysConfig.ChannelConfig ChannelConfig = new ChannelConfig(); + public Models.SysCfg.ChannelConfig ChannelConfig = new ChannelConfig(); /// /// 设备状æ€� diff --git a/LargeSquareOne/Config/Channel.json b/LargeSquareOne/Config/Channel.json index 7c11277..c71e9ba 100644 --- a/LargeSquareOne/Config/Channel.json +++ b/LargeSquareOne/Config/Channel.json @@ -2,32 +2,32 @@ "channels": [ { "channelId": 1, - "default": 21, + "defaultValue": 21, "gears": [ "E63y", "F63y" ] }, { "channelId": 2, - "default": 31, + "defaultValue": 31, "gears": [ "E63yG", "F63yG" ] }, { "channelId": 3, - "default": 98, + "defaultValue": 98, "gears": [ "NG" ] }, { "channelId": 4, - "default": 97, + "defaultValue": 97, "gears": [ "拦截" ] }, { "channelId": 5, - "default": 97, + "defaultValue": 97, "gears": [ "拦截" ] }, { "channelId": 6, - "default": 97, + "defaultValue": 97, "gears": [ "拦截" ] } ] diff --git a/LargeSquareOne/bin/Debug/Config/Configure.ini b/LargeSquareOne/bin/Debug/Config/Configure.ini index 103039d..cc8d321 100644 --- a/LargeSquareOne/bin/Debug/Config/Configure.ini +++ b/LargeSquareOne/bin/Debug/Config/Configure.ini @@ -43,9 +43,9 @@ Grading6= ·çËÙÒÇ=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data ·Öµµ²ÎÊý=http://10.22.160.2/core/api/public/eve/pm/eqm/auto/grading °²È«É豸״̬=http://10.22.161.62:804/device-status -guid=181b2396-2ddb-49c5-9a88-74da4875e094 -DeviceState=3 -run_AlarmMark=1 +guid=8bd808da-0398-4a7d-ac92-bcea41869c03 +DeviceState=1 +run_AlarmMark=0 run_IdleMark=0 [ͳ¼Æ¼ÆÊý]