DataCapture/iWare_SCADA_DataCapture_Test/DLL/HslCommunication.dllBinary files differ
DataCapture/iWare_SCADA_DataCapture_Test/DLL/Newtonsoft.Json.dllBinary files differ
DataCapture/iWare_SCADA_DataCapture_Test/DLL/Newtonsoft.Json.xml
¶Ô±ÈÐÂÎļþ ÎļþÌ«´ó DataCapture/iWare_SCADA_DataCapture_Test/DLL/log4net.dllBinary files differ
DataCapture/iWare_SCADA_DataCapture_Test/Test_iWare_SCADA_DataCapture_Test.sln
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,42 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iWare_SCADA_Model", "iWare_SCADA_Model\iWare_SCADA_Model.csproj", "{91C185DE-15AB-44AE-B585-53799FC51BE0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iWare_SCADA_BusinessLogical", "iWare_SCADA_BusinessLogical\iWare_SCADA_BusinessLogical.csproj", "{32708F19-FE1A-48F5-B373-8E1C776F216C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{9BB6FA0E-C431-4F4F-8EC7-BC62383F412D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iWare_SCADA_DataCapture_Test", "iWare_SCADA_DataCapture_Test\iWare_SCADA_DataCapture_Test.csproj", "{E07C6E80-A875-482C-9427-BA5703DFF7EB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {91C185DE-15AB-44AE-B585-53799FC51BE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {91C185DE-15AB-44AE-B585-53799FC51BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU {91C185DE-15AB-44AE-B585-53799FC51BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU {91C185DE-15AB-44AE-B585-53799FC51BE0}.Release|Any CPU.Build.0 = Release|Any CPU {32708F19-FE1A-48F5-B373-8E1C776F216C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {32708F19-FE1A-48F5-B373-8E1C776F216C}.Debug|Any CPU.Build.0 = Debug|Any CPU {32708F19-FE1A-48F5-B373-8E1C776F216C}.Release|Any CPU.ActiveCfg = Release|Any CPU {32708F19-FE1A-48F5-B373-8E1C776F216C}.Release|Any CPU.Build.0 = Release|Any CPU {E07C6E80-A875-482C-9427-BA5703DFF7EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E07C6E80-A875-482C-9427-BA5703DFF7EB}.Debug|Any CPU.Build.0 = Debug|Any CPU {E07C6E80-A875-482C-9427-BA5703DFF7EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {E07C6E80-A875-482C-9427-BA5703DFF7EB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {E07C6E80-A875-482C-9427-BA5703DFF7EB} = {9BB6FA0E-C431-4F4F-8EC7-BC62383F412D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {71AEA756-11BA-4085-8E3F-7DAA18D3F7DB} EndGlobalSection EndGlobal DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/App.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/CommonManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,161 @@ using iTextSharp.text.pdf; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using static log4net.Appender.RollingFileAppender; namespace iWare_SCADA_BusinessLogical.BLL { public class CommonManager { public static readonly CommonManager Instance = new CommonManager(); /// <summary> /// è§£æå·¥ä»¶å·äºç»´ç /// </summary> /// <param name="log"></param> /// <returns></returns> public WorkPieceLog GetWorkPieceID(WorkPieceLog log,LogType type) { try { if(log==null|| log.WorkPieceID.Trim().Length!=22) { Log4NetHelper.WriteErrorLog(type, $"è§£æå·¥ä»¶å·{CheckNULLForString(log.WorkPieceID)} {log.Id}äºç»´ç æ¶åºéï¼äºç»´ç æ ¼å¼ä¸å¯¹"); return log; } log.WorkPieceIDTo1 = log.WorkPieceID.Substring(0, 2); log.WorkPieceIDTo2 = log.WorkPieceID.Substring(2, 4); log.WorkPieceIDTo3 = log.WorkPieceID.Substring(6, 6); log.WorkPieceIDTo4 = log.WorkPieceID.Substring(12, 2); log.WorkPieceIDTo5 = log.WorkPieceID.Substring(14, 4); log.WorkPieceIDTo6 = log.WorkPieceID.Substring(18, 2); log.WorkPieceIDTo7 = log.WorkPieceID.Substring(20, 2); } catch(Exception ex) { Log4NetHelper.WriteErrorLog(type, $"è§£æå·¥ä»¶å·{CheckNULLForString(log.WorkPieceID)} {log.Id}äºç»´ç æ¶å¼å¸¸ï¼", ex); } return log; } public string CheckNULLForString(string str) { return string.IsNullOrEmpty(str) ? "" : str; } public string CheackPath(string path, int type, int time) { var directory = Path.GetDirectoryName(path); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } if (!File.Exists(path)) { File.Create(path).Close(); } string content = ""; // åæ¥æ¥æºæ°æ® using (StreamReader reader = new StreamReader(path)) { content = reader.ReadToEnd(); Console.WriteLine("读åçå 容æ¯ï¼" + content); if (content == null || content == "") { switch (type) { case 1: content = DateTimeHelper.GetDateTime().AddYears(time).ToString(); break; case 2: content = DateTimeHelper.GetDateTime().AddMonths(time).ToString(); break; case 3: content = DateTimeHelper.GetDateTime().AddDays(time).ToString(); break; case 4: content = DateTimeHelper.GetDateTime().AddHours(time).ToString(); break; case 5: content = DateTimeHelper.GetDateTime().AddMinutes(time).ToString(); break; case 6: content = DateTimeHelper.GetDateTime().AddSeconds(time).ToString(); break; default: content = DateTimeHelper.GetDateTime().ToString(); break; } //content = DateTimeHelper.GetDateTime().AddMinutes(-10).ToString(); } } return content; } /// <summary> /// è§£æpdfæä»¶ /// </summary> /// <param name="filePath"></param> /// <param name="getPdfValue"></param> /// <returns></returns> public static List<string> ReadPdfConntent(string filePath, string getPdfValue) { List<string> lst = new List<string>(); try { string pdffilename = filePath; PdfReader pdfreader = new PdfReader(pdffilename); int numberOfPages = pdfreader.NumberOfPages; //for (int i = 1; i <= numberOfPages; ++i) //{ // lst.Add(iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader,i)); // text.AppendLine(); //} string text = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader, 1); string[] words = text.Split('\n'); foreach (var item in words) { string value = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(item)); if (value.Contains(getPdfValue)) { string[] splitValue = value.Split(':'); lst.Add(splitValue[1].Trim()); } } pdfreader.Close(); return lst; } catch (Exception ex) { throw ex; } } public static DateTime? GetOP60Time(string datetime) { try { string regex = @"^(\d{1,2})\.(\d{1,2})\.(\d{4})\/(\d{1,2}):(\d{1,2}):(\d{1,2})"; var macth = RegexExtension.Match(datetime, regex, 20000); if (macth.Success) { string date = $"{macth.Groups[3].Value}/{macth.Groups[2].Value}/{macth.Groups[1].Value} {macth.Groups[4].Value}:{macth.Groups[5].Value}:{macth.Groups[6].Value}"; DateTime Time; if (DateTime.TryParseExact(date, "yyyy/MM/dd HH:mm:ss", CultureInfo.CurrentCulture, DateTimeStyles.None, out Time)) { return Time; } } return null; } catch (Exception ex) { return null; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/DataCaptureColumnDictManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,70 @@ using iWare_SCADA_BusinessLogical.DLA.Dao; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { public class DataCaptureColumnDictManager { ///// <summary> ///// è·å è°åº¦ç³»ç»å¯å¨ç¸å ³ ///// </summary> ///// <param name="edm"></param> ///// <returns></returns> //public static IList<DataCaptureColumnDict> GetCCSystem(DbModel edm) //{ // return edm.DataCaptureColumnDictList.Where(x => x.EquipmentID == "1").ToList();//.FirstOrDefault(); //} /// <summary> /// è·å è°åº¦ç³»ç»å¯å¨ç¸å ³ /// </summary> /// <param name="edm"></param> /// <returns></returns> public static List<EquipmentBaseInfo> GetEquipmentBaseInfo() { using (DbModel db = new DbModel()) { // //var a = db.EquipmentBaseInfos.Find(1);//主é®ä¸º1ç var b = db.EquipmentBaseInfo.Where(o=>o.EquipmentId=="1").ToList(); var query = db.EquipmentBaseInfo.Where(s => s.EquipmentId == "1").ToList();//è¿åIQueryable è¯´ææ¯å»¶è¿æ¥è¯¢ //æ¥è¯¢ææ var query2 = db.EquipmentBaseInfo.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ //var query3 = db.DataCaptureConfigs.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ return b; //var ccSystem = DataCaptureColumnDictManager.GetEquipmentBaseInfo(edm); //if (ccSystem == null) //{ // MessageBox.Show("请è系管çåç»´æ¤ç³»ç»è°åº¦ç¸å ³çæ°æ®!"); // return; //}; } //return edm.EquipmentBaseInfos.Find; } /// <summary> /// å页æ¥è¯¢ /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> public static void pageselect(int pageIndex,int pageSize) { using (DbModel db = new DbModel()) { var query3 = db.EquipmentBaseInfo.Skip((pageIndex - 1) * pageSize).Take(pageSize); } //CommonDao<EquipmentBaseInfo, EquipmentBaseInfo> CommonDao=new CommonDao<EquipmentBaseInfo, EquipmentBaseInfo>(); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/DataCaptureConfigManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,107 @@ using iWare_SCADA_Model; using iWare_SCADA_Model.TableModelSC; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.BLL { public class DataCaptureConfigManager { public static List<DataCaptureConfig> GetDataCaptureConfigs() { using (DbModel db = new DbModel()) { //æ¥è¯¢æææªå 餿°æ® var query = db.DataCaptureConfig.Where(o=>o.IsDeleted==false).ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ return query; } } public static List<DataCaptureColumnConfig> GetDataCaptureColumnConfig() { using (DbModel db = new DbModel()) { //æ¥è¯¢ææ var query = db.DataCaptureColumnConfig.Where(o=>1==1).ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ return query; //var ccSystem = DataCaptureColumnDictManager.GetEquipmentBaseInfo(edm); //if (ccSystem == null) //{ // MessageBox.Show("请è系管çåç»´æ¤ç³»ç»è°åº¦ç¸å ³çæ°æ®!"); // return; //}; } } public static List<AlarmLog> getdate() { using (SCModel db = new SCModel()) { List<AlarmLog> query = db.AlarmLog.ToList(); return query; } } public static void InsertDataCaptureConfig(DataCaptureConfig info) { using (DbModel db = new DbModel()) { db.DataCaptureConfig.Add(info); db.SaveChanges(); } } public static void UpdateDataCaptureConfig(DataCaptureConfig info,out string message) { using (DbModel db = new DbModel()) { message = ""; var model = db.DataCaptureConfig.Where(o => o.Id == info.Id).FirstOrDefault(); if(model!=null && model.Id > 0) { var num=db.DataCaptureConfig.Where(o => o.DataCapturePointCode == info.DataCapturePointCode && o.Id != model.Id).Count(); if(num>0) { message = $"æ¶éç¹ä»£ç {info.DataCapturePointCode}å·²åå¨ï¼ä¸è½éå¤ï¼è¯·ç¡®è®¤å忬¡ä¿®æ¹ï¼"; return; } model.EquipmentID = info.EquipmentID; model.WorkingProcedure = info.WorkingProcedure; model.DataCapturePointCode = info.DataCapturePointCode; model.DataCapturePointCname = info.DataCapturePointCname; model.DataCaptureType = info.DataCaptureType; model.DataCapturePLCType = info.DataCapturePLCType; model.PLCIP = info.PLCIP; model.PLCPort = info.PLCPort; model.DbNumber = info.DbNumber; model.Offset = info.Offset; model.DataCaptureColumnType = info.DataCaptureColumnType; db.SaveChanges(); } else { message = "å½åä¿®æ¹é¡¹ä¸åå¨ï¼è¯·å·æ°å忬¡ä¿®æ¹ï¼"; return; } } } public static int DeleteDataCaptureConfig(DataCaptureConfig info) { using (DbModel db = new DbModel()) { var config = db.DataCaptureConfig.FirstOrDefault(m => m.Id == info.Id); if (config != null) { db.DataCaptureConfig.Remove(config); } return db.SaveChanges(); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/SystemValue.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,2466 @@  using iWare_SCADA_Model; using iWare_SCADA_Model.MiddleModel; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// ç³»ç»åé /// </summary> public class SystemValue { /// <summary> /// OP20çå½åæ£æµé¢å¼ /// </summary> public static string OP20_Side_Value = ""; #region PLC龿¥ public static object lockPlcService = new object(); private static Dictionary<string, PLCService> plcServiceList = new Dictionary<string, PLCService>(); public static PLCService GetPLCService(DataCaptureConfig dataCaptureConfig) { PLCService plcService = null; lock (lockPlcService) { if (plcServiceList.ContainsKey(dataCaptureConfig.PLCIP)) { plcService = plcServiceList[dataCaptureConfig.PLCIP]; } else { plcService = PLCManger.GetSinglePLCService(dataCaptureConfig); plcServiceList.Add(dataCaptureConfig.PLCIP, plcService); } } return plcService; } public static void PLCServiceReconnect(PLCService plcService) { if(plcService==null) { return; } plcService.Close(); plcService.OpenService(); } #endregion /// <summary> /// ç³»ç»å¯å¨çGUID /// </summary> public static string SystemStartGuid = string.Empty; /// <summary> /// æ¨¡å¼æ¯å¦å¯å¨ /// </summary> public static bool isStartedModel = false; /// <summary> /// å»¶è¿çº¿ç¨æ§è¡çæ¶é´ï¼æ¯«ç§ï¼ /// </summary> public static int DelayExcuteNumber = 2000; /// <summary> /// PLCå°ååé符 ï¼ç¨äºåé DBå°åååç§»éç /// </summary> public static char PLCDBADDRESS_SEPARATE = '|'; public static List<ThreadStatusMonitor> MainList=new List<ThreadStatusMonitor>(); private static object lockMainList = new object(); public static async void UpdateMainList(ThreadStatusMonitor threadinfo) { await Task.Run(() => { lock (lockMainList) { var info = MainList.Where(o => o.Threadcode == threadinfo.Threadcode).FirstOrDefault(); if(info == null) { MainList.Add(threadinfo); } else { DateTime time = DateTime.Now; info.Remarks = threadinfo.Remarks; info.Threadendtime = time;//æ¯æ¬¡é½æ´æ° info.Threadlastmodifytime = threadinfo.Threadlastmodifytime>DateTime.MinValue? threadinfo.Threadlastmodifytime: info.Threadlastmodifytime;//妿æä¼ ååæ´æ° info.ThreadId = threadinfo.ThreadId; info.ThreadFrequency = threadinfo.ThreadFrequency; info.UpdatedTime = time; info.UpdatedUserName = threadinfo.Threadcode; if (info.Threadstatue == 1) { info.Threadlastmodifytime = time;//ææ°è·å°æ°æ® } } } }); } #region OP05å·¥åº public static object lock5QRcodeList = new object(); private static Dictionary<string, DateTime> _qRcodeList = new Dictionary<string, DateTime>(); /// <summary> /// OP05读åçäºç»´ç å表 //注æï¼ä½¿ç¨ä¸add åèµå¼é½éè¦æ·»å é lock5QRcodeList /// </summary> public static Dictionary<string, DateTime> QRcodeList { get { return _qRcodeList; } set { _qRcodeList = value; } } private static object lockOP0501Runing = new object(); private static object lockOP0502Runing = new object(); private static object lockOP0503Runing = new object(); private static object lockOP0504Runing = new object(); private static object lockOP0506Runing = new object(); private static object lockOP0507Runing = new object(); private static bool _isAllowRuning_OP0501 = false; private static bool _isAllowRuning_OP0502 = false; private static bool _isAllowRuning_OP0503 = false; private static bool _isAllowRuning_OP0504 = false; private static bool _isAllowRuning_OP0506 = false; private static bool _isAllowRuning_OP0507 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP05å·¥åºæç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP0501 { get { return _isAllowRuning_OP0501; } set { lock (lockOP0501Runing) { _isAllowRuning_OP0501 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP05å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP0502 { get { return _isAllowRuning_OP0502; } set { lock (lockOP0502Runing) { _isAllowRuning_OP0502 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP05å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP0503 { get { return _isAllowRuning_OP0503; } set { lock (lockOP0503Runing) { _isAllowRuning_OP0503 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP05å·¥åºå®ææ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP0504 { get { return _isAllowRuning_OP0504; } set { lock (lockOP0504Runing) { _isAllowRuning_OP0504 = value; } } } private static object lockOP0501Alert = new object(); private static object lockOP0502Alert = new object(); private static object lockOP0503Alert = new object(); private static object lockOP0504Alert = new object(); private static object lockOP0506Alert = new object(); private static object lockOP0507Alert = new object(); private static string _lbl_Alert_OP0501 = string.Empty; private static string _lbl_Alert_OP0502 = string.Empty; private static string _lbl_Alert_OP0503 = string.Empty; private static string _lbl_Alert_OP0504 = string.Empty; private static string _lbl_Alert_OP0506 = string.Empty; private static string _lbl_Alert_OP0507 = string.Empty; /// <summary> /// çæ§OP05å·¥åºæç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP0501 { get { return _lbl_Alert_OP0501; } set { lock (lockOP0501Alert) { _lbl_Alert_OP0501 = value; } } } /// <summary> /// çæ§OP05å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP0502 { get { return _lbl_Alert_OP0502; } set { lock (lockOP0502Alert) { _lbl_Alert_OP0502 = value; } } } /// <summary> /// çæ§OP05å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP0503 { get { return _lbl_Alert_OP0503; } set { lock (lockOP0503Alert) { _lbl_Alert_OP0503 = value; } } } /// <summary> /// çæ§OP05å·¥åºå®ææ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP0504 { get { return _lbl_Alert_OP0504; } set { lock (lockOP0504Alert) { _lbl_Alert_OP0504 = value; } } } public static string lbl_Alert_OP0506 { get { return _lbl_Alert_OP0506; } set { lock (lockOP0506Alert) { _lbl_Alert_OP0506 = value; } } } public static string lbl_Alert_OP0507 { get { return _lbl_Alert_OP0507; } set { lock (lockOP0507Alert) { _lbl_Alert_OP0507 = value; } } } private static object lockOP0501Value = new object(); private static object lockOP0502Value = new object(); private static object lockOP0503Value = new object(); private static object lockOP0504Value = new object(); private static object lockOP0506Value = new object(); private static object lockOP0507Value = new object(); private static string _value_OP0501 = string.Empty; private static string _value_OP0502 = string.Empty; private static string _value_OP0503 = string.Empty; private static string _value_OP0504 = string.Empty; private static string _value_OP0506 = string.Empty; private static string _value_OP0507 = string.Empty; /// <summary> /// OP05å·¥åºæç 宿æ è®°å¼ /// </summary> public static string value_OP0501 { get { return _value_OP0501; } set { lock (lockOP0501Value) { _value_OP0501 = value; } } } /// <summary> /// OP05å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP0502 { get { return _value_OP0502; } set { lock (lockOP0502Value) { _value_OP0502 = value; } } } /// <summary> /// OP05å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP0503 { get { return _value_OP0503; } set { lock (lockOP0503Value) { _value_OP0503 = value; } } } /// <summary> /// OP05å·¥åºå®ææ è®°å¼ /// </summary> public static string value_OP0504 { get { return _value_OP0504; } set { lock (lockOP0504Value) { _value_OP0504 = value; } } } public static string value_OP0506 { get { return _value_OP0506; } set { lock (lockOP0506Value) { _value_OP0506 = value; } } } public static string value_OP0507 { get { return _value_OP0507; } set { lock (lockOP0507Value) { _value_OP0507 = value; } } } #endregion #region OP10å·¥åº /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1001 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºæµè¯å®ææ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1002 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1003 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1004 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºå®ææ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1005 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP10å·¥åºåè¦æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP1006 = false; public static bool isAllowRuning_OP1007 = false; /// <summary> /// çæ§OP10å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> private static string _lbl_Alert_OP1001 = string.Empty; /// <summary> /// çæ§OP10å·¥åºæµè¯å®ææ è®°çè¦åæ¶æ¯ /// </summary> private static string _lbl_Alert_OP1002 = string.Empty; /// <summary> /// çæ§OP10å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> private static string _lbl_Alert_OP1003 = string.Empty; /// <summary> /// çæ§OP10å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> private static string _lbl_Alert_OP1004 = string.Empty; /// <summary> /// çæ§OP10å·¥åºå®ææ è®°çè¦åæ¶æ¯ /// </summary> private static string _lbl_Alert_OP1005 = string.Empty; /// <summary> /// çæ§OP10å·¥åºåè¦ä¿¡æ¯ /// </summary> private static string _lbl_Alert_OP1006 = string.Empty; private static string _lbl_Alert_OP1007 = string.Empty; /// <summary> /// OP10å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP1001 = string.Empty; /// <summary> /// OP10å·¥åºæµè¯å®ææ è®°å¼ /// </summary> public static string value_OP1002 = string.Empty; /// <summary> /// OP10å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP1003 = string.Empty; /// <summary> /// OP10å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP1004 = string.Empty; /// <summary> /// OP10å·¥åºå®ææ è®°å¼ /// </summary> public static string value_OP1005 = string.Empty; /// <summary> /// OP10å·¥åºåè¦æ è®°å¼ /// </summary> public static string value_OP1006 = string.Empty; public static string value_OP1007 = string.Empty; private static object lockOP1001Alert = new object(); private static object lockOP1002Alert = new object(); private static object lockOP1003Alert = new object(); private static object lockOP1004Alert = new object(); private static object lockOP1005Alert = new object(); private static object lockOP1006Alert = new object(); private static object lockOP1007Alert = new object(); public static string lbl_Alert_OP1001 { get { return _lbl_Alert_OP1001; } set { lock (lockOP1001Alert) { _lbl_Alert_OP1001 = value; } } } public static string lbl_Alert_OP1002 { get { return _lbl_Alert_OP1002; } set { lock (lockOP1002Alert) { _lbl_Alert_OP1002 = value; } } } public static string lbl_Alert_OP1003 { get { return _lbl_Alert_OP1003; } set { lock (lockOP1003Alert) { _lbl_Alert_OP1003 = value; } } } public static string lbl_Alert_OP1004 { get { return _lbl_Alert_OP1004; } set { lock (lockOP1004Alert) { _lbl_Alert_OP1004 = value; } } } public static string lbl_Alert_OP1005 { get { return _lbl_Alert_OP1005; } set { lock (lockOP1005Alert) { _lbl_Alert_OP1005 = value; } } } public static string lbl_Alert_OP1006 { get { return _lbl_Alert_OP1006; } set { lock (lockOP1006Alert) { _lbl_Alert_OP1006 = value; } } } public static string lbl_Alert_OP1007 { get { return _lbl_Alert_OP1007; } set { lock (lockOP1007Alert) { _lbl_Alert_OP1007 = value; } } } #endregion #region OP20å·¥åº /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2001 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºæµè¯å®ææ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2002 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2003 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2004 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºå®ææ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2005 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP20å·¥åºåè¦æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP2006 = false; /// <summary> /// çæ§OP20å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string _lbl_Alert_OP2001 = string.Empty; /// <summary> /// çæ§OP20å·¥åºæµè¯å®ææ è®°çè¦åæ¶æ¯ /// </summary> public static string _lbl_Alert_OP2002 = string.Empty; /// <summary> /// çæ§OP20å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string _lbl_Alert_OP2003 = string.Empty; /// <summary> /// çæ§OP20å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string _lbl_Alert_OP2004 = string.Empty; /// <summary> /// çæ§OP20å·¥åºå®ææ è®°çè¦åæ¶æ¯ /// </summary> public static string _lbl_Alert_OP2005 = string.Empty; /// <summary> /// çæ§OP20å·¥åºåè¦ä¿¡æ¯ /// </summary> public static string _lbl_Alert_OP2006 = string.Empty; /// <summary> /// OP20å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP2001 = string.Empty; /// <summary> /// OP20å·¥åºæµè¯å®ææ è®°å¼ /// </summary> public static string value_OP2002 = string.Empty; /// <summary> /// OP20å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP2003 = string.Empty; /// <summary> /// OP20å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP2004 = string.Empty; /// <summary> /// OP20å·¥åºå®ææ è®°å¼ /// </summary> public static string value_OP2005 = string.Empty; /// <summary> /// OP20å·¥åºåè¦æ è®°å¼ /// </summary> public static string value_OP2006 = string.Empty; #endregion #region OP30å·¥åº private static object lockOP3001Runing = new object(); private static object lockOP3002Runing = new object(); private static object lockOP3003Runing = new object(); private static object lockOP3004Runing = new object(); private static bool _isAllowRuning_OP3001 = false; private static bool _isAllowRuning_OP3002 = false; private static bool _isAllowRuning_OP3003 = false; private static bool _isAllowRuning_OP3004 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3001 { get { return _isAllowRuning_OP3001; } set { lock (lockOP3001Runing) { _isAllowRuning_OP3001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºæµé宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3002 { get { return _isAllowRuning_OP3002; } set { lock (lockOP3002Runing) { _isAllowRuning_OP3002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3003 { get { return _isAllowRuning_OP3003; } set { lock (lockOP3003Runing) { _isAllowRuning_OP3003 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3004 { get { return _isAllowRuning_OP3004; } set { lock (lockOP3004Runing) { _isAllowRuning_OP3004 = value; } } } private static object lockOP3001Alert = new object(); private static object lockOP3002Alert = new object(); private static object lockOP3003Alert = new object(); private static object lockOP3004Alert = new object(); private static string _lbl_Alert_OP3001 = string.Empty; private static string _lbl_Alert_OP3002 = string.Empty; private static string _lbl_Alert_OP3003 = string.Empty; private static string _lbl_Alert_OP3004 = string.Empty; /// <summary> /// çæ§OP30å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3001 { get { return _lbl_Alert_OP3001; } set { lock (lockOP3001Alert) { _lbl_Alert_OP3001 = value; } } } /// <summary> /// çæ§OP30å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3002 { get { return _lbl_Alert_OP3002; } set { lock (lockOP3002Alert) { _lbl_Alert_OP3002 = value; } } } /// <summary> /// çæ§OP30å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3003 { get { return _lbl_Alert_OP3003; } set { lock (lockOP3003Alert) { _lbl_Alert_OP3003 = value; } } } /// <summary> /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3004 { get { return _lbl_Alert_OP3004; } set { lock (lockOP3004Alert) { _lbl_Alert_OP3004 = value; } } } private static object lockOP3001Value = new object(); private static object lockOP3002Value = new object(); private static object lockOP3003Value = new object(); private static object lockOP3004Value = new object(); private static string _value_OP3001 = string.Empty; private static string _value_OP3002 = string.Empty; private static string _value_OP3003 = string.Empty; private static string _value_OP3004 = string.Empty; /// <summary> /// OP30å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP3001 { get { return _value_OP3001; } set { lock (lockOP3001Value) { _value_OP3001 = value; } } } /// <summary> /// OP30å·¥åºæµé宿æ è®°å¼ /// </summary> public static string value_OP3002 { get { return _value_OP3002; } set { lock (lockOP3002Value) { _value_OP3002 = value; } } } /// <summary> /// OP30å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP3003 { get { return _value_OP3003; } set { lock (lockOP3003Value) { _value_OP3003 = value; } } } /// <summary> /// OP30å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3004 { get { return _value_OP3004; } set { lock (lockOP3004Value) { _value_OP3004 = value; } } } private static object lockOP3005Runing = new object(); private static bool _isAllowRuning_OP3005 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3005 { get { return _isAllowRuning_OP3005; } set { lock (lockOP3005Runing) { _isAllowRuning_OP3005 = value; } } } private static object lockOP3005Alert = new object(); private static string _lbl_Alert_OP3005 = string.Empty; /// <summary> /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3005 { get { return _lbl_Alert_OP3005; } set { lock (lockOP3005Alert) { _lbl_Alert_OP3005 = value; } } } private static string _value_OP3005 = string.Empty; private static object lockOP3005Value = new object(); /// <summary> /// OP30å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3005 { get { return _value_OP3005; } set { lock (lockOP3005Value) { _value_OP3005 = value; } } } private static object lockOP3006Runing = new object(); private static bool _isAllowRuning_OP3006 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3006 { get { return _isAllowRuning_OP3006; } set { lock (lockOP3006Runing) { _isAllowRuning_OP3006 = value; } } } private static object lockOP3006Alert = new object(); private static string _lbl_Alert_OP3006 = string.Empty; /// <summary> /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3006 { get { return _lbl_Alert_OP3006; } set { lock (lockOP3006Alert) { _lbl_Alert_OP3006 = value; } } } private static string _value_OP3006 = string.Empty; private static object lockOP3006Value = new object(); /// <summary> /// OP30å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3006 { get { return _value_OP3006; } set { lock (lockOP3006Value) { _value_OP3006 = value; } } } private static object lockOP3007Runing = new object(); private static bool _isAllowRuning_OP3007 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3007 { get { return _isAllowRuning_OP3007; } set { lock (lockOP3007Runing) { _isAllowRuning_OP3007 = value; } } } private static object lockOP3007Alert = new object(); private static string _lbl_Alert_OP3007 = string.Empty; /// <summary> /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3007 { get { return _lbl_Alert_OP3007; } set { lock (lockOP3007Alert) { _lbl_Alert_OP3007 = value; } } } private static string _value_OP3007 = string.Empty; private static object lockOP3007Value = new object(); /// <summary> /// OP30å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3007 { get { return _value_OP3007; } set { lock (lockOP3007Value) { _value_OP3007 = value; } } } #endregion #region OP35å·¥åº private static object lockOP3501Runing = new object(); private static object lockOP3502Runing = new object(); private static object lockOP3503Runing = new object(); private static object lockOP3504Runing = new object(); private static bool _isAllowRuning_OP3501 = false; private static bool _isAllowRuning_OP3502 = false; private static bool _isAllowRuning_OP3503 = false; private static bool _isAllowRuning_OP3504 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3501 { get { return _isAllowRuning_OP3501; } set { lock (lockOP3501Runing) { _isAllowRuning_OP3501 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºæµé宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3502 { get { return _isAllowRuning_OP3502; } set { lock (lockOP3502Runing) { _isAllowRuning_OP3502 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3503 { get { return _isAllowRuning_OP3503; } set { lock (lockOP3503Runing) { _isAllowRuning_OP3503 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3504 { get { return _isAllowRuning_OP3504; } set { lock (lockOP3504Runing) { _isAllowRuning_OP3504 = value; } } } private static object lockOP3501Alert = new object(); private static object lockOP3502Alert = new object(); private static object lockOP3503Alert = new object(); private static object lockOP3504Alert = new object(); private static string _lbl_Alert_OP3501 = string.Empty; private static string _lbl_Alert_OP3502 = string.Empty; private static string _lbl_Alert_OP3503 = string.Empty; private static string _lbl_Alert_OP3504 = string.Empty; /// <summary> /// çæ§OP35å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3501 { get { return _lbl_Alert_OP3501; } set { lock (lockOP3501Alert) { _lbl_Alert_OP3501 = value; } } } /// <summary> /// çæ§OP35å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3502 { get { return _lbl_Alert_OP3502; } set { lock (lockOP3502Alert) { _lbl_Alert_OP3502 = value; } } } /// <summary> /// çæ§OP35å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3503 { get { return _lbl_Alert_OP3503; } set { lock (lockOP3503Alert) { _lbl_Alert_OP3503 = value; } } } /// <summary> /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3504 { get { return _lbl_Alert_OP3504; } set { lock (lockOP3504Alert) { _lbl_Alert_OP3504 = value; } } } private static object lockOP3501Value = new object(); private static object lockOP3502Value = new object(); private static object lockOP3503Value = new object(); private static object lockOP3504Value = new object(); private static string _value_OP3501 = string.Empty; private static string _value_OP3502 = string.Empty; private static string _value_OP3503 = string.Empty; private static string _value_OP3504 = string.Empty; /// <summary> /// OP35å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP3501 { get { return _value_OP3501; } set { lock (lockOP3501Value) { _value_OP3501 = value; } } } /// <summary> /// OP35å·¥åºæµé宿æ è®°å¼ /// </summary> public static string value_OP3502 { get { return _value_OP3502; } set { lock (lockOP3502Value) { _value_OP3502 = value; } } } /// <summary> /// OP35å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP3503 { get { return _value_OP3503; } set { lock (lockOP3503Value) { _value_OP3503 = value; } } } /// <summary> /// OP35å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3504 { get { return _value_OP3504; } set { lock (lockOP3504Value) { _value_OP3504 = value; } } } private static object lockOP3505Runing = new object(); private static bool _isAllowRuning_OP3505 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3505 { get { return _isAllowRuning_OP3505; } set { lock (lockOP3505Runing) { _isAllowRuning_OP3505 = value; } } } private static object lockOP3505Alert = new object(); private static string _lbl_Alert_OP3505 = string.Empty; /// <summary> /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3505 { get { return _lbl_Alert_OP3505; } set { lock (lockOP3505Alert) { _lbl_Alert_OP3505 = value; } } } private static string _value_OP3505 = string.Empty; private static object lockOP3505Value = new object(); /// <summary> /// OP35å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3505 { get { return _value_OP3505; } set { lock (lockOP3505Value) { _value_OP3505 = value; } } } private static object lockOP3506Runing = new object(); private static bool _isAllowRuning_OP3506 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3506 { get { return _isAllowRuning_OP3506; } set { lock (lockOP3506Runing) { _isAllowRuning_OP3506 = value; } } } private static object lockOP3506Alert = new object(); private static string _lbl_Alert_OP3506 = string.Empty; /// <summary> /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3506 { get { return _lbl_Alert_OP3506; } set { lock (lockOP3506Alert) { _lbl_Alert_OP3506 = value; } } } private static string _value_OP3506 = string.Empty; private static object lockOP3506Value = new object(); /// <summary> /// OP35å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3506 { get { return _value_OP3506; } set { lock (lockOP3506Value) { _value_OP3506 = value; } } } private static object lockOP3507Runing = new object(); private static bool _isAllowRuning_OP3507 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP3507 { get { return _isAllowRuning_OP3507; } set { lock (lockOP3507Runing) { _isAllowRuning_OP3507 = value; } } } private static object lockOP3507Alert = new object(); private static string _lbl_Alert_OP3507 = string.Empty; /// <summary> /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP3507 { get { return _lbl_Alert_OP3507; } set { lock (lockOP3507Alert) { _lbl_Alert_OP3507 = value; } } } private static string _value_OP3507 = string.Empty; private static object lockOP3507Value = new object(); /// <summary> /// OP35å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP3507 { get { return _value_OP3507; } set { lock (lockOP3507Value) { _value_OP3507 = value; } } } #endregion #region OP70å·¥åº private static object lockOP7001Runing = new object(); private static object lockOP7002Runing = new object(); private static object lockOP7003Runing = new object(); private static object lockOP7004Runing = new object(); private static bool _isAllowRuning_OP7001 = false; private static bool _isAllowRuning_OP7002 = false; private static bool _isAllowRuning_OP7003 = false; private static bool _isAllowRuning_OP7004 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7001 { get { return _isAllowRuning_OP7001; } set { lock (lockOP7001Runing) { _isAllowRuning_OP7001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºæµé宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7002 { get { return _isAllowRuning_OP7002; } set { lock (lockOP7002Runing) { _isAllowRuning_OP7002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7003 { get { return _isAllowRuning_OP7003; } set { lock (lockOP7003Runing) { _isAllowRuning_OP7003 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7004 { get { return _isAllowRuning_OP7004; } set { lock (lockOP7004Runing) { _isAllowRuning_OP7004 = value; } } } private static object lockOP7001Alert = new object(); private static object lockOP7002Alert = new object(); private static object lockOP7003Alert = new object(); private static object lockOP7004Alert = new object(); private static string _lbl_Alert_OP7001 = string.Empty; private static string _lbl_Alert_OP7002 = string.Empty; private static string _lbl_Alert_OP7003 = string.Empty; private static string _lbl_Alert_OP7004 = string.Empty; /// <summary> /// çæ§OP70å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7001 { get { return _lbl_Alert_OP7001; } set { lock (lockOP7001Alert) { _lbl_Alert_OP7001 = value; } } } /// <summary> /// çæ§OP70å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7002 { get { return _lbl_Alert_OP7002; } set { lock (lockOP7002Alert) { _lbl_Alert_OP7002 = value; } } } /// <summary> /// çæ§OP70å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7003 { get { return _lbl_Alert_OP7003; } set { lock (lockOP7003Alert) { _lbl_Alert_OP7003 = value; } } } /// <summary> /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7004 { get { return _lbl_Alert_OP7004; } set { lock (lockOP7004Alert) { _lbl_Alert_OP7004 = value; } } } private static object lockOP7001Value = new object(); private static object lockOP7002Value = new object(); private static object lockOP7003Value = new object(); private static object lockOP7004Value = new object(); private static string _value_OP7001 = string.Empty; private static string _value_OP7002 = string.Empty; private static string _value_OP7003 = string.Empty; private static string _value_OP7004 = string.Empty; /// <summary> /// OP70å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP7001 { get { return _value_OP7001; } set { lock (lockOP7001Value) { _value_OP7001 = value; } } } /// <summary> /// OP70å·¥åºæµé宿æ è®°å¼ /// </summary> public static string value_OP7002 { get { return _value_OP7002; } set { lock (lockOP7002Value) { _value_OP7002 = value; } } } /// <summary> /// OP70å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP7003 { get { return _value_OP7003; } set { lock (lockOP7003Value) { _value_OP7003 = value; } } } /// <summary> /// OP70å·¥åºè¯»ç ï¼å°±æ¯OP70å·¥åºæµé宿å伿å°ä¸ä¸ªæ°äºç»´ç ï¼ç»å®å工件å·ï¼ /// </summary> public static string value_OP7004 { get { return _value_OP7004; } set { lock (lockOP7004Value) { _value_OP7004 = value; } } } private static object lockOP7005Runing = new object(); private static bool _isAllowRuning_OP7005 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7005 { get { return _isAllowRuning_OP7005; } set { lock (lockOP7005Runing) { _isAllowRuning_OP7005 = value; } } } private static object lockOP7005Alert = new object(); private static string _lbl_Alert_OP7005 = string.Empty; /// <summary> /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7005 { get { return _lbl_Alert_OP7005; } set { lock (lockOP7005Alert) { _lbl_Alert_OP7005 = value; } } } private static string _value_OP7005 = string.Empty; private static object lockOP7005Value = new object(); /// <summary> /// OP70å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP7005 { get { return _value_OP7005; } set { lock (lockOP7005Value) { _value_OP7005 = value; } } } private static object lockOP7006Runing = new object(); private static bool _isAllowRuning_OP7006 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7006 { get { return _isAllowRuning_OP7006; } set { lock (lockOP7006Runing) { _isAllowRuning_OP7006 = value; } } } private static object lockOP7006Alert = new object(); private static string _lbl_Alert_OP7006 = string.Empty; /// <summary> /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7006 { get { return _lbl_Alert_OP7006; } set { lock (lockOP7006Alert) { _lbl_Alert_OP7006 = value; } } } private static string _value_OP7006 = string.Empty; private static object lockOP7006Value = new object(); /// <summary> /// OP70å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP7006 { get { return _value_OP7006; } set { lock (lockOP7006Value) { _value_OP7006 = value; } } } private static object lockOP7007Runing = new object(); private static bool _isAllowRuning_OP7007 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP7007 { get { return _isAllowRuning_OP7007; } set { lock (lockOP7007Runing) { _isAllowRuning_OP7007 = value; } } } private static object lockOP7007Alert = new object(); private static string _lbl_Alert_OP7007 = string.Empty; /// <summary> /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP7007 { get { return _lbl_Alert_OP7007; } set { lock (lockOP7007Alert) { _lbl_Alert_OP7007 = value; } } } private static string _value_OP7007 = string.Empty; private static object lockOP7007Value = new object(); /// <summary> /// OP70å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP7007 { get { return _value_OP7007; } set { lock (lockOP7007Value) { _value_OP7007 = value; } } } #endregion #region OP80å·¥åº private static object lockOP8001Runing = new object(); private static object lockOP8002Runing = new object(); private static object lockOP8003Runing = new object(); private static object lockOP8004Runing = new object(); private static bool _isAllowRuning_OP8001 = false; private static bool _isAllowRuning_OP8002 = false; private static bool _isAllowRuning_OP8003 = false; private static bool _isAllowRuning_OP8004 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºè¯»ç 宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8001 { get { return _isAllowRuning_OP8001; } set { lock (lockOP8001Runing) { _isAllowRuning_OP8001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºæµé宿æ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8002 { get { return _isAllowRuning_OP8002; } set { lock (lockOP8002Runing) { _isAllowRuning_OP8002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8003 { get { return _isAllowRuning_OP8003; } set { lock (lockOP8003Runing) { _isAllowRuning_OP8003 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8004 { get { return _isAllowRuning_OP8004; } set { lock (lockOP8004Runing) { _isAllowRuning_OP8004 = value; } } } private static object lockOP8001Alert = new object(); private static object lockOP8002Alert = new object(); private static object lockOP8003Alert = new object(); private static object lockOP8004Alert = new object(); private static string _lbl_Alert_OP8001 = string.Empty; private static string _lbl_Alert_OP8002 = string.Empty; private static string _lbl_Alert_OP8003 = string.Empty; private static string _lbl_Alert_OP8004 = string.Empty; /// <summary> /// çæ§OP80å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8001 { get { return _lbl_Alert_OP8001; } set { lock (lockOP8001Alert) { _lbl_Alert_OP8001 = value; } } } /// <summary> /// çæ§OP80å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8002 { get { return _lbl_Alert_OP8002; } set { lock (lockOP8002Alert) { _lbl_Alert_OP8002 = value; } } } /// <summary> /// çæ§OP80å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8003 { get { return _lbl_Alert_OP8003; } set { lock (lockOP8003Alert) { _lbl_Alert_OP8003 = value; } } } /// <summary> /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8004 { get { return _lbl_Alert_OP8004; } set { lock (lockOP8004Alert) { _lbl_Alert_OP8004 = value; } } } private static object lockOP8001Value = new object(); private static object lockOP8002Value = new object(); private static object lockOP8003Value = new object(); private static object lockOP8004Value = new object(); private static string _value_OP8001 = string.Empty; private static string _value_OP8002 = string.Empty; private static string _value_OP8003 = string.Empty; private static string _value_OP8004 = string.Empty; /// <summary> /// OP80å·¥åºè¯»ç 宿æ è®°å¼ /// </summary> public static string value_OP8001 { get { return _value_OP8001; } set { lock (lockOP8001Value) { _value_OP8001 = value; } } } /// <summary> /// OP80å·¥åºæµé宿æ è®°å¼ /// </summary> public static string value_OP8002 { get { return _value_OP8002; } set { lock (lockOP8002Value) { _value_OP8002 = value; } } } /// <summary> /// OP80å·¥åºæ¨åºæ è®°å¼ /// </summary> public static string value_OP8003 { get { return _value_OP8003; } set { lock (lockOP8003Value) { _value_OP8003 = value; } } } /// <summary> /// OP80å·¥åºè¯»ç ï¼å°±æ¯OP80å·¥åºæµé宿å伿å°ä¸ä¸ªæ°äºç»´ç ï¼ç»å®å工件å·ï¼ /// </summary> public static string value_OP8004 { get { return _value_OP8004; } set { lock (lockOP8004Value) { _value_OP8004 = value; } } } private static object lockOP8005Runing = new object(); private static bool _isAllowRuning_OP8005 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8005 { get { return _isAllowRuning_OP8005; } set { lock (lockOP8005Runing) { _isAllowRuning_OP8005 = value; } } } private static object lockOP8005Alert = new object(); private static string _lbl_Alert_OP8005 = string.Empty; /// <summary> /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8005 { get { return _lbl_Alert_OP8005; } set { lock (lockOP8005Alert) { _lbl_Alert_OP8005 = value; } } } private static string _value_OP8005 = string.Empty; private static object lockOP8005Value = new object(); /// <summary> /// OP80å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP8005 { get { return _value_OP8005; } set { lock (lockOP8005Value) { _value_OP8005 = value; } } } private static object lockOP8006Runing = new object(); private static bool _isAllowRuning_OP8006 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8006 { get { return _isAllowRuning_OP8006; } set { lock (lockOP8006Runing) { _isAllowRuning_OP8006 = value; } } } private static object lockOP8006Alert = new object(); private static string _lbl_Alert_OP8006 = string.Empty; /// <summary> /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8006 { get { return _lbl_Alert_OP8006; } set { lock (lockOP8006Alert) { _lbl_Alert_OP8006 = value; } } } private static string _value_OP8006 = string.Empty; private static object lockOP8006Value = new object(); /// <summary> /// OP80å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP8006 { get { return _value_OP8006; } set { lock (lockOP8006Value) { _value_OP8006 = value; } } } private static object lockOP8007Runing = new object(); private static bool _isAllowRuning_OP8007 = false; /// <summary> /// æ¯å¦å 许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ /// </summary> public static bool isAllowRuning_OP8007 { get { return _isAllowRuning_OP8007; } set { lock (lockOP8007Runing) { _isAllowRuning_OP8007 = value; } } } private static object lockOP8007Alert = new object(); private static string _lbl_Alert_OP8007 = string.Empty; /// <summary> /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_OP8007 { get { return _lbl_Alert_OP8007; } set { lock (lockOP8007Alert) { _lbl_Alert_OP8007 = value; } } } private static string _value_OP8007 = string.Empty; private static object lockOP8007Value = new object(); /// <summary> /// OP80å·¥åºSPCæ¨åºæ è®°å¼ /// </summary> public static string value_OP8007 { get { return _value_OP8007; } set { lock (lockOP8007Value) { _value_OP8007 = value; } } } #endregion #region HMI private static object lockHMIBeartBeatMonitorRuning = new object(); private static bool _isAllowRuning_HMIBeartBeatMonitor = false; private static object lockHMIBeartBeatMonitorAlert = new object(); private static string _lbl_Alert_HMIBeartBeatMonitor = string.Empty; /// <summary> /// çæ§HMIå¿è·³ä¿¡æ¯ /// </summary> public static bool isAllowRuning_HMIBeartBeatMonitor { get { return _isAllowRuning_HMIBeartBeatMonitor; } set { lock (lockHMIBeartBeatMonitorRuning) { _isAllowRuning_HMIBeartBeatMonitor = value; } } } /// <summary> /// çæ§HMIå¿è·³ä¿¡æ¯çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIBeartBeatMonitor { get { return _lbl_Alert_HMIBeartBeatMonitor; } set { lock (lockHMIBeartBeatMonitorAlert) { _lbl_Alert_HMIBeartBeatMonitor = value; } } } private static object lockHMIOP104001Runing = new object(); private static object lockHMIOP2001Runing = new object(); private static object lockHMIOP303501Runing = new object(); private static object lockHMIOP5001Runing = new object(); private static object lockHMIOP6001Runing = new object(); private static object lockHMIOP104002Runing = new object(); private static object lockHMIOP2002Runing = new object(); private static object lockHMIOP303502Runing = new object(); private static object lockHMIOP5002Runing = new object(); private static object lockHMIOP6002Runing = new object(); private static bool _isAllowRuning_HMIOP104001 = false; private static bool _isAllowRuning_HMIOP2001 = false; private static bool _isAllowRuning_HMIOP303501 = false; private static bool _isAllowRuning_HMIOP5001 = false; private static bool _isAllowRuning_HMIOP6001 = false; private static bool _isAllowRuning_HMIOP104002 = false; private static bool _isAllowRuning_HMIOP2002 = false; private static bool _isAllowRuning_HMIOP303502 = false; private static bool _isAllowRuning_HMIOP5002 = false; private static bool _isAllowRuning_HMIOP6002 = false; private static object lockHMIOP104001Alert = new object(); private static object lockHMIOP2001Alert = new object(); private static object lockHMIOP303501Alert = new object(); private static object lockHMIOP5001Alert = new object(); private static object lockHMIOP6001Alert = new object(); private static object lockHMIOP104002Alert = new object(); private static object lockHMIOP2002Alert = new object(); private static object lockHMIOP303502Alert = new object(); private static object lockHMIOP5002Alert = new object(); private static object lockHMIOP6002Alert = new object(); private static string _lbl_Alert_HMIOP104001 = string.Empty; private static string _lbl_Alert_HMIOP2001 = string.Empty; private static string _lbl_Alert_HMIOP303501 = string.Empty; private static string _lbl_Alert_HMIOP5001 = string.Empty; private static string _lbl_Alert_HMIOP6001 = string.Empty; private static string _lbl_Alert_HMIOP104002 = string.Empty; private static string _lbl_Alert_HMIOP2002 = string.Empty; private static string _lbl_Alert_HMIOP303502 = string.Empty; private static string _lbl_Alert_HMIOP5002 = string.Empty; private static string _lbl_Alert_HMIOP6002 = string.Empty; #region çæ§è¯»åçº¿ç¨ /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP104001读åäºç»´ç çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP104001 { get { return _isAllowRuning_HMIOP104001; } set { lock (lockHMIOP104001Runing) { _isAllowRuning_HMIOP104001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP2001读åäºç»´ç çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP2001 { get { return _isAllowRuning_HMIOP2001; } set { lock (lockHMIOP2001Runing) { _isAllowRuning_HMIOP2001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP303501读åäºç»´ç çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP303501 { get { return _isAllowRuning_HMIOP303501; } set { lock (lockHMIOP303501Runing) { _isAllowRuning_HMIOP303501 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP5001读åäºç»´ç çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP5001 { get { return _isAllowRuning_HMIOP5001; } set { lock (lockHMIOP5001Runing) { _isAllowRuning_HMIOP5001 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP6001读åäºç»´ç çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP6001 { get { return _isAllowRuning_HMIOP6001; } set { lock (lockHMIOP6001Runing) { _isAllowRuning_HMIOP6001 = value; } } } #endregion #region çæ§åå ¥çº¿ç¨ /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP104002åå ¥è´¨éæ°æ®çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP104002 { get { return _isAllowRuning_HMIOP104002; } set { lock (lockHMIOP104002Runing) { _isAllowRuning_HMIOP104002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP2002åå ¥è´¨éæ°æ®çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP2002 { get { return _isAllowRuning_HMIOP2002; } set { lock (lockHMIOP2002Runing) { _isAllowRuning_HMIOP2002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP303502åå ¥è´¨éæ°æ®çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP303502 { get { return _isAllowRuning_HMIOP303502; } set { lock (lockHMIOP303502Runing) { _isAllowRuning_HMIOP303502 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP5002åå ¥è´¨éæ°æ®çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP5002 { get { return _isAllowRuning_HMIOP5002; } set { lock (lockHMIOP5002Runing) { _isAllowRuning_HMIOP5002 = value; } } } /// <summary> /// æ¯å¦å 许æ§è¡çæ§HMIOP6002æ´æ°è´¨éæ°æ®çº¿ç¨ /// </summary> public static bool isAllowRuning_HMIOP6002 { get { return _isAllowRuning_HMIOP6002; } set { lock (lockHMIOP6002Runing) { _isAllowRuning_HMIOP6002 = value; } } } #endregion #region çæ§è¯»å线ç¨äºç»´ç çè¦åä¿¡æ¯ /// <summary> /// çæ§HMIOP104001读åäºç»´ç çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP104001 { get { return _lbl_Alert_HMIOP104001; } set { lock (lockHMIOP104001Alert) { _lbl_Alert_HMIOP104001 = value; } } } /// <summary> /// çæ§HMIOP2001读åäºç»´ç çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP2001 { get { return _lbl_Alert_HMIOP2001; } set { lock (lockHMIOP2001Alert) { _lbl_Alert_HMIOP2001 = value; } } } /// <summary> /// çæ§HMIOP303501读åäºç»´ç çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP303501 { get { return _lbl_Alert_HMIOP303501; } set { lock (lockHMIOP303501Alert) { _lbl_Alert_HMIOP303501 = value; } } } /// <summary> /// çæ§HMIOP5001读åäºç»´ç çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP5001 { get { return _lbl_Alert_HMIOP5001; } set { lock (lockHMIOP5001Alert) { _lbl_Alert_HMIOP5001 = value; } } } /// <summary> /// çæ§HMIOP6001读åäºç»´ç çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP6001 { get { return _lbl_Alert_HMIOP6001; } set { lock (lockHMIOP6001Alert) { _lbl_Alert_HMIOP6001 = value; } } } #endregion #region çæ§åå ¥çº¿ç¨äºç»´ç çè¦åä¿¡æ¯ /// <summary> /// çæ§HMIOP104002åå ¥è´¨éæ°æ®çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP104002 { get { return _lbl_Alert_HMIOP104002; } set { lock (lockHMIOP104002Alert) { _lbl_Alert_HMIOP104002 = value; } } } /// <summary> /// çæ§HMIOP2002åå ¥è´¨éæ°æ®çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP2002 { get { return _lbl_Alert_HMIOP2002; } set { lock (lockHMIOP2002Alert) { _lbl_Alert_HMIOP2002 = value; } } } /// <summary> /// çæ§HMIOP303502åå ¥è´¨éæ°æ®çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP303502 { get { return _lbl_Alert_HMIOP303502; } set { lock (lockHMIOP303502Alert) { _lbl_Alert_HMIOP303502 = value; } } } /// <summary> /// çæ§HMIOP5002æ´æ°è´¨éæ°æ®çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP5002 { get { return _lbl_Alert_HMIOP5002; } set { lock (lockHMIOP5002Alert) { _lbl_Alert_HMIOP5002 = value; } } } /// <summary> /// çæ§HMIOP6002æ´æ°è´¨éæ°æ®çè¦åæ¶æ¯ /// </summary> public static string lbl_Alert_HMIOP6002 { get { return _lbl_Alert_HMIOP6002; } set { lock (lockHMIOP6002Alert) { _lbl_Alert_HMIOP6002 = value; } } } #endregion #endregion } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/WorkPieceInfoManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,2322 @@ using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using iWare_SCADA_Model.MiddleModel; using iWare_SCADA_Model.TableModel; using log4net; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Diagnostics; //using System.Data.Entity.Infrastructure; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Web.UI.WebControls; using System.Windows.Forms; using static System.Windows.Forms.AxHost; namespace iWare_SCADA_BusinessLogical.BLL { public class WorkPieceInfoManager { public static WorkPieceInfo GetWorkPieceInfo(string WorkPieceID) { using (DbModel db = new DbModel()) { //æ¥è¯¢ææ var query = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID).FirstOrDefault(); return query; } } public static long InsertWorkPieceInfo(WorkPieceInfo workPiece) { using (DbModel db = new DbModel()) { db.WorkPieceInfo.Add(workPiece); db.SaveChanges(); return workPiece.Id; } } public static WorkPieceLogMiddle GetAddWorkPieceLog(WorkPieceLogMiddle loginfo) { loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); return loginfo; } /// <summary> /// ç»WorkPieceLog主é®çå ¬å ±çç屿§èµå¼ /// </summary> /// <param name="loginfo"></param> /// <returns></returns> public static WorkPieceLog GetAddWorkPieceLog(WorkPieceLog loginfo) { loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); return loginfo; } public static WorkPieceLog GetAddWorkPieceLog1(WorkPieceLogMiddle loginfo) { loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); return loginfo; } /// <summary> /// éè¿WorkPieceInfo ç»WorkPieceInfoLog 屿§èµå¼ /// </summary> /// <param name="wpinfo"></param> /// <returns></returns> public static WorkPieceInfoLog GetAddWorkPieceInfoLog(WorkPieceInfo wpinfo) { WorkPieceInfoLog infolog = EntityPropHelper.Mapper<WorkPieceInfoLog, WorkPieceInfo>(wpinfo); infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); infolog.WorkPieceInfoID = wpinfo.Id; infolog.LogAddTime = DateTime.Now; return infolog; } /// <summary> /// ç»QualityDataInfo主é®çå ¬å ±çç屿§èµå¼ /// </summary> /// <param name="loginfo"></param> /// <returns></returns> public static QualityDataInfo GetAddQualityDataInfo(QualityDataInfo qdinfo) { qdinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); return qdinfo; } /// <summary> /// éè¿QualityDataInfo ç»QualityDataInfoLog 屿§èµå¼ /// </summary> /// <param name="wpinfo"></param> /// <returns></returns> public static QualityDataInfoLog GetAddQualityDataInfoLog(QualityDataInfo qdinfo) { QualityDataInfoLog infolog = EntityPropHelper.Mapper<QualityDataInfoLog, QualityDataInfo>(qdinfo); infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); return infolog; } public static void test() { using (DbModel db = new DbModel()) { //WorkPieceLogMiddle a = new WorkPieceLogMiddle(); //a.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //a.WorkPieceID="test01"+ new Random().Next(4).ToString(); //a.QualityType = QualityType.SPC.ToString(); //if(a.QualityType.Equals(QualityType.SPC.ToString())) //{ // a.Remarks = "SPC"; //} //else //{ // a.Remarks = "AUTO"; //} //WorkPieceLog b = new WorkPieceLog(); //b.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //b.WorkPieceID = "testxxx" + new Random().Next(0,1000).ToString(); //b.QualityType = QualityType.SPC.ToString(); //b.Remarks = "SPC insert into"; //b.QualityState = 2; //b.QualityStateUpdateMode = "heheh"; //db.WorkPieceLog.Add(b); //db.SaveChanges(); } } /// <summary> /// æ ¹æ®è®¾å¤idæ´æ°åå ·å¯¿å½ä¿¡æ¯ï¼ç®åè®¾å®æ¯ç产ä¸ä¸ªå·¥ä»¶ï¼ææåå ·å¯¿å½é½ä¼å1ï¼ /// </summary> /// <param name="db"></param> /// <param name="loginfo"></param> public static void UpdateKnifeToolLift(DbModel db, WorkPieceLog loginfo) { try { var info = db.KnifeToolEquipmentInfo.Where(o => o.EquipmentID.Equals(loginfo.EquipmentID)).ToList(); foreach (var item in info) { item.CurrentLife++; item.UpdatedTime = DateTime.Now; } } catch (Exception ex) { loginfo.Remarks = (loginfo.Remarks ?? "") + $"{loginfo.WorkPieceID ?? "空"}åå ·å¯¿å½æ´æ°æ°æ®å¼å¸¸{ex.Message}"; } } /// <summary> /// 读åäºç»´ç æ¶é»è¾ /// æ ¡éªå·¥ä»¶æ¯å¦è·³åºï¼è´¨éæ¯å¦åæ ¼ /// </summary> public static void ReadQRcode(WorkPieceLog loginfo, LogType type, PLCService plcService, int? IsFeedback) {//æ¤å¤åæ¶æå ¥äºWorkPieceLogï¼WorkPieceInfoLog表ï¼å¹¶æ°å¢æä¿®æ¹WorkPieceInfo表 using (DbModel db = new DbModel()) { try { bool isAddWorkPieceInfo = false; if (loginfo.WorkPieceID.Length == 22) { WorkPieceInfo info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); if (info == null || info.WorkPieceID.Length < 1) {//æå ¥WorkPieceInfo表 loginfo = CommonManager.Instance.GetWorkPieceID(loginfo, type); info = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLog>(loginfo); //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); if (!loginfo.WorkingProcedure.Equals("OP05")) {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ info.QualityState = (int)QualityState.Suspected; info.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; info.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.WorkingProcedure}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; } else { info.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ info.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; } info.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime(); info.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; info.CreatedUserName = loginfo.MonitoringPoint; info.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); info = ParseQRCode(info); isAddWorkPieceInfo = true; } else { if (info.WorkingProcedureCurrent.Equals("OP05")) { loginfo.Remarks = (loginfo.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"} OP05å·¥åºéå¤è¯»åäº"; return; } } info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime();// info.WorkingProcedureEndTime = null; info.WorkPieceState = (int)WorkPieceState.WIP; info.EquipmentID = loginfo.EquipmentID; info.QualityStateUpdateUser = loginfo.UpdatedUserName; info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); info.WorkPieceCurrentPosition = loginfo.WorkingProcedure; info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; info.WorkingProcedureCurrent = loginfo.WorkingProcedure; info.Remarks = info.Remarks ?? "" + $"{info.WorkingProcedureCurrent}工件ä¸çº¿"; var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && !o.OperationType.Equals("SPC") && (o.EndTime == null || o.EndTime <= DateTime.MinValue)).OrderByDescending(o => o.StartTime).FirstOrDefault(); if (pro != null && pro.WorkPieceID.Length > 1) { pro.EndTime = DateTimeHelper.GetDateTime(); pro.UpdatedUserName = loginfo.MonitoringPoint; pro.UpdatedTime = DateTimeHelper.GetDateTime(); pro.Remarks = (pro.Remarks ?? "") + "å䏿¬¡ä¸çº¿ï¼æ´æ°ç»ææ¶é´"; } //æ¯æ¬¡æ«æä¸çº¿é½æå ¥è¿½æº¯è¡¨ WorkPieceProcess process = new WorkPieceProcess(); process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); process.StartTime = DateTimeHelper.GetDateTime(); process.QualityState = info.QualityState.HasValue ? info.QualityState.Value : (int)QualityState.OK; process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); process.CreatedUserName = loginfo.MonitoringPoint; process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.UpdatedUserName = loginfo.MonitoringPoint; process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.OperationType = OperationType.ç产.ToString(); process.Remarks = ""; if (loginfo.WorkingProcedure.Equals("OP05")) { process.EndTime = process.StartTime; } db.WorkPieceProcess.Add(process); //db.Database.AutoTransactionsEnabled = false;// åä¸ä¸ªSaveChangesé»è®¤äºå¡ï¼ å ³éé»è®¤äºå¡ï¼... 好åä¸è½ç¨åï¼åé¢åç ç©¶å§ if (isAddWorkPieceInfo) { db.WorkPieceInfo.Add(info); } else {//ä¸ç¡®å®infoæ¯ç´æ¥ä¼ä¿®æ¹è¿æ¯éè¦å次æ¥è¯¢ï¼å¾ æµè¯ //info.Remarks = "ä¿®æ¹ï¼å ·ä½ä¿®æ¹é»è¾å¾ å®"; } #region 夿æ¯å¦è·³åº,æè´¨éä¸ç¬¦å ç¶ååé¦PLC if (IsFeedback.HasValue && IsFeedback.Value == (int)FeedbackMode.FeedbackPLC) { bool checkQualityInfoCompleteFlag = false; bool plcFlag = true;//åé¦ç»PLCçæ è®° string message = ""; checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, loginfo, type); if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) { plcFlag = false; message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; } ////åé¦ç»PLCï¼ï¼åå ¥ç¹å¾ å®ï¼ //MessageModel fr = null; //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); //if (fr.result) //{ // Log4NetHelper.WriteInfoLog(type, $" 工件{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); //} //else //{ // Log4NetHelper.WriteErrorLog(type, $" 工件{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); //} //#region åé¦PLC //bool checkQualityInfoCompleteFlag = false; //bool plcFlag = true;//åé¦ç»PLCçæ è®° //string message = ""; //checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) //{ // plcFlag = false; // message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; //message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; //} ////åé¦ç»PLCï¼ï¼åå ¥ç¹å¾ å®ï¼ //MessageModel fr = null; //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); //if (fr.result) //{ // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); //} //else //{ // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); //} //#endregion } else {//读ç 宿è¥å·¥ä»¶è´¨éä¸ç¬¦åæåçè·³åºï¼ä¸ç¨ç®¡è®¾å¤æ¯å¦æå·¥ä»¶æ¾è¿å»ï¼æ°éç³»ç»é½ä¸åæ´å½åå·¥åºï¼åé¦è®¾å¤PLC工件ä¸ç¬¦åï¼ //è¥å·¥åºåç»æ¶éç¹æ¶å°ç¸å ³å·¥ä»¶ä¿¡æ¯ååæ´å½åå·¥åºï¼ ä½è´¨éä¿¡æ¯ä¸å info.WorkingProcedureCurrent = loginfo.WorkingProcedure; } #endregion #region æ´æ°è®¾å¤å®æ¶è¡¨ bool isAddEquipmentCurrentMonitor = false; EquipmentCurrentMonitor equinfo = new EquipmentCurrentMonitor(); equinfo = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == loginfo.EquipmentID).FirstOrDefault(); if (equinfo == null || equinfo.Id < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); equinfo = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLog>(loginfo); equinfo.OnlineTime = DateTime.Now; isAddEquipmentCurrentMonitor = true; } else {//æ´æ°å·¥ä»¶ equinfo.WorkPieceID = loginfo.WorkPieceID; equinfo.UpdatedUserName = loginfo.MonitoringPoint; equinfo.UpdatedTime = DateTime.Now; equinfo.OnlineTime = DateTime.Now; } if (isAddEquipmentCurrentMonitor) { equinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); db.EquipmentCurrentMonitor.Add(equinfo); } #endregion //db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo)); db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); //UpdateKnifeToolLift(db, loginfo);//æ´æ°åå ·å¯¿å½ä¿¡æ¯ } else { loginfo.Remarks = (loginfo.Remarks ?? "") + $"ä¸çº¿å®æè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}ä¸çº¿çæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } } catch (Exception e) { loginfo.Remarks = (loginfo.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; } finally { loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); db.WorkPieceLog.Add(loginfo); db.SaveChanges(); } } } public static WorkPieceLogMiddle QualityDataHand(WorkPieceLogMiddle loginfo, List<EquipmentQualityConfig> qcofig) { try { switch (loginfo.WorkingProcedure) { case "OP10": var cof = qcofig.Where(o => o.ParamColName.Equals("QualityOP10To1")).FirstOrDefault(); if (cof != null && cof.Id > 0) { double oldvalue = 0; double StandardValue = 0; var flag1 = double.TryParse(loginfo.QualityOP10To1, out oldvalue); var flag2 = double.TryParse(cof.StandardValue, out StandardValue); if (!flag1 || !flag2) { return loginfo; } loginfo.QualityOP10To1 = ((StandardValue + oldvalue * 1.0 / cof.DecimalPlaces).ToString()); //+(string.IsNullOrEmpty(cof.Unit) ? "" : cof.Unit) } break; case "OP40": var cofOP40 = qcofig.Where(o => o.ParamColName.Equals("QualityOP40To1")).FirstOrDefault(); if (cofOP40 != null && cofOP40.Id > 0) { double oldvalue = 0; double StandardValue = 0; var flag1 = double.TryParse(loginfo.QualityOP40To1, out oldvalue); var flag2 = double.TryParse(cofOP40.StandardValue, out StandardValue); if (!flag1 || !flag2) { return loginfo; } loginfo.QualityOP40To1 = ((StandardValue + oldvalue * 1.0 / cofOP40.DecimalPlaces).ToString()); //+(string.IsNullOrEmpty(cofOP40.Unit) ? "" : cofOP40.Unit) } break; case "OP20": var cofOP20 = qcofig.Where(o => o.ParamColName.Equals("QualityOP20To1")).FirstOrDefault(); if (cofOP20 != null && cofOP20.Id > 0) { double oldvalue = 0; double StandardValue = 0; var flag1 = double.TryParse(loginfo.QualityOP20To1, out oldvalue); var flag2 = double.TryParse(cofOP20.StandardValue, out StandardValue); if (!flag1 || !flag2) { return loginfo; } loginfo.QualityOP20To1 = ((StandardValue + oldvalue * 1.0 / cofOP20.DecimalPlaces).ToString()); } break; case "OP60": var cofOP60to1 = qcofig.Where(o => o.ParamColName.Equals("QualityOP60To1")).FirstOrDefault(); if (cofOP60to1 != null && cofOP60to1.Id > 0) { double oldvalue = 0; double StandardValue = 0; var flag1 = double.TryParse(loginfo.QualityOP60To1, out oldvalue); var flag2 = double.TryParse(cofOP60to1.StandardValue, out StandardValue); if (!flag1 || !flag2) { return loginfo; } loginfo.QualityOP60To1 = ((StandardValue + oldvalue * 1.0 / cofOP60to1.DecimalPlaces).ToString()); } var cofOP60to2 = qcofig.Where(o => o.ParamColName.Equals("QualityOP60To2")).FirstOrDefault(); if (cofOP60to2 != null && cofOP60to2.Id > 0) { double oldvalue = 0; double StandardValue = 0; var flag1 = double.TryParse(loginfo.QualityOP60To2, out oldvalue); var flag2 = double.TryParse(cofOP60to2.StandardValue, out StandardValue); if (!flag1 || !flag2) { return loginfo; } loginfo.QualityOP60To2 = ((StandardValue + oldvalue * 1.0 / (10 * cofOP60to2.DecimalPlaces)).ToString() + (string.IsNullOrEmpty(cofOP60to2.Unit) ? "" : cofOP60to2.Unit)); } break; default: break; } } catch (Exception ex) { } return loginfo; } /// <summary> /// è´¨éæ£æµå®æ /// </summary> /// <param name="logMiddle"></param> /// <param name="type"></param> public static void QualityInfoComplete(WorkPieceLogMiddle logMiddle, LogType type) { //æ¤å¤åæ¶æå ¥äºWorkPieceLogï¼WorkPieceInfoLog表ï¼å¹¶æ°å¢æä¿®æ¹WorkPieceInfo表 //æå ¥è´¨éç¸å ³è¡¨QualityDataInfo using (DbModel db = new DbModel()) { bool isAddWorkPieceInfo = false; WorkPieceLog loginfo2 = new WorkPieceLog(); loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(logMiddle); try { if (logMiddle.WorkPieceID.Length == 22) {//è·åå°ç工件å·å¼å¸¸ WorkPieceInfo pieceInfo = new WorkPieceInfo(); pieceInfo = db.WorkPieceInfo.Where(o => o.WorkPieceID == logMiddle.WorkPieceID).FirstOrDefault(); if (pieceInfo == null || pieceInfo.WorkPieceID.Length < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° if (logMiddle.MonitoringPoint.Equals("OP1002") || logMiddle.MonitoringPoint.Equals("OP1003") || logMiddle.MonitoringPoint.Contains("OP2002")) {//OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®° pieceInfo = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLogMiddle>(logMiddle); //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); if (!logMiddle.WorkingProcedure.Equals("OP05")) {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ pieceInfo.QualityState = (int)QualityState.Suspected; pieceInfo.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{logMiddle.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; pieceInfo.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{logMiddle.WorkingProcedure}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; } else { pieceInfo.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ pieceInfo.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; } pieceInfo.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime(); pieceInfo.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; pieceInfo.CreatedUserName = logMiddle.MonitoringPoint; pieceInfo.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); pieceInfo.WorkingProcedureStartTime = DateTimeHelper.GetDateTime();// pieceInfo.WorkingProcedureEndTime = null; pieceInfo = ParseQRCode(pieceInfo); isAddWorkPieceInfo = true; } else { loginfo2.Remarks = loginfo2.Remarks ?? "" + $"|工件{logMiddle.WorkPieceID} è´¨éæ£æµå®æå·¥åº{logMiddle.MonitoringPoint} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"; Log4NetHelper.WriteErrorLog(type, $"工件{logMiddle.WorkPieceID} è´¨éæ£æµå®æå·¥åº{logMiddle.MonitoringPoint} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); return; } } if (logMiddle.MonitoringPoint.Equals("OP1002") || logMiddle.MonitoringPoint.Equals("OP1003") || logMiddle.MonitoringPoint.Contains("OP2002")) {// OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®°ï¼æä»¥ä¸çº¿éè¦ä¿®æ¹çåæ®µæ¾è¿é if (logMiddle.WorkingProcedure.Equals("OP10")) { var WorkingProcedure = (logMiddle.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); loginfo2.WorkingProcedure = WorkingProcedure;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ logMiddle.WorkingProcedure = WorkingProcedure;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ } pieceInfo.WorkPieceCurrentPosition = logMiddle.WorkingProcedure; pieceInfo.WorkPieceCurrentPositionOrder = pieceInfo.WorkingProcedurePlan.IndexOf(logMiddle.WorkingProcedure) / 2; pieceInfo.WorkingProcedureCurrent = logMiddle.WorkingProcedure; pieceInfo.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); #region æ´æ°è®¾å¤å®æ¶è¡¨ bool isAddEquipmentCurrentMonitor = false; EquipmentCurrentMonitor equinfo = new EquipmentCurrentMonitor(); equinfo = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == logMiddle.EquipmentID).FirstOrDefault(); if (equinfo == null || equinfo.Id < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"设å¤{logMiddle.EquipmentID} åè¦çæ§{logMiddle.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); equinfo = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLog>(logMiddle); equinfo.OnlineTime = DateTime.Now; isAddEquipmentCurrentMonitor = true; } else {//æ´æ°å·¥ä»¶ equinfo.WorkPieceID = logMiddle.WorkPieceID; equinfo.UpdatedUserName = logMiddle.MonitoringPoint; equinfo.UpdatedTime = DateTime.Now; equinfo.OnlineTime = DateTime.Now; } if (isAddEquipmentCurrentMonitor) { equinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); db.EquipmentCurrentMonitor.Add(equinfo); } #endregion //UpdateKnifeToolLift(db, loginfo);//æ´æ°åå ·å¯¿å½ä¿¡æ¯ } pieceInfo.WorkPieceState = (int)WorkPieceState.WIP;//æ¨åºååSPCæ½æ£å è´¨éå½å ¥æ¶ç¶æä¿®æ¹åå¨å¶å pieceInfo.EquipmentID = logMiddle.EquipmentID; pieceInfo.QualityStateUpdateUser = logMiddle.UpdatedUserName; pieceInfo.QualityStateUpdateTime = logMiddle.UpdatedTime.Value.LocalDateTime; pieceInfo.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); pieceInfo.Remarks = pieceInfo.Remarks ?? "" + $"{logMiddle.WorkingProcedure}è´¨éæ£æµå®æä¿®æ¹"; pieceInfo.UpdatedUserName = logMiddle.MonitoringPoint; pieceInfo.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); if (!(pieceInfo.WorkingProcedureStartTime.HasValue && pieceInfo.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) {//å·¥åºå¼å§æ¶é´æ²¡æåèµå¼ pieceInfo.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); } pieceInfo.QualityState = (int)((logMiddle.QualityStateStr.Equals("OK") || logMiddle.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceInfo(logMiddle, ref pieceInfo); if (!pieceInfo.QualityState.Equals(((int)QualityState.OK).ToString())) { pieceInfo.QualityErrorInfo = $"{logMiddle.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼{pieceInfo.QualityState}"; } else { pieceInfo.QualityErrorInfo = ""; } logMiddle.QualityState = pieceInfo.QualityState; if (isAddWorkPieceInfo) { db.WorkPieceInfo.Add(pieceInfo); } #region æ ¹æ®æ å弿´æ°ææ°è´¨éæ°æ®ï¼OP10/OP40/OP20/OP60ï¼ var qcofig = db.EquipmentQualityConfig.Where(o => o.WorkingProcedure.Equals(logMiddle.WorkingProcedure) && o.ParamType != 1 && o.IsDeleted == false).ToList(); if (qcofig.Count > 0) { QualityDataHand(logMiddle, qcofig); } #endregion var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == logMiddle.WorkPieceID).FirstOrDefault(); if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) {//æå ¥QualityDataInfo表 qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(logMiddle); db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); } //ä¿®æ¹QualityDataInfo表 //é夿¶å°è´¨éä¿¡æ¯ï¼ä¼è¦çä¹åç EntityPropHelper<WorkPieceLogMiddle, QualityDataInfo>.CopyProp(logMiddle, qualityData, GetQualityDataInfoUpdate(logMiddle, logMiddle.WorkingProcedure, logMiddle.MonitoringPoint));//æå®ä¿®æ¹å段 qualityData.QualityStateUpdateUser = pieceInfo.UpdatedUserName; qualityData.QualityReceiveTime = pieceInfo.UpdatedTime.Value.LocalDateTime; qualityData.QualityStateUpdateMode = pieceInfo.QualityStateUpdateMode; if (logMiddle.WorkingProcedure.Equals("OP10")) { qualityData.OP10QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP10QualityReceiveTime = DateTimeHelper.GetDateTime(); } else if (logMiddle.WorkingProcedure.Equals("OP20")) { //Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}è´¨éä¿¡æ¯ã{loginfo.QualityStateStr ?? "空"}ã" + // $"ã{(loginfo.QualityState.HasValue? loginfo.QualityState.Value:999)}ãã{(info.QualityState.HasValue ? info.QualityState.Value : 888)}ã 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]"); qualityData.OP20QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP20QualityReceiveTime = DateTimeHelper.GetDateTime(); qualityData.OP20QualityFilePath = logMiddle.OP20QualityFilePath; } else if (logMiddle.WorkingProcedure.Equals("OP30")) { switch (logMiddle.MonitoringPoint) { case "OP3002CH3": qualityData.OP30QualityFilePathCH3 = logMiddle.OP30QualityFilePathCH3; qualityData.OP30QualityStateCH3 = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP30QualityReceiveTimeCH3 = DateTimeHelper.GetDateTime(); if (qualityData.OP30QualityStateCH3 == ((int)QualityState.NG).ToString()) { logMiddle.QualityNoOk = (int)QualityNoOkEnum.OP30涨æå·¥ä½åç©å¤§; logMiddle.QualityNoOkReason = QualityNoOkEnum.OP30涨æå·¥ä½åç©å¤§.ToString(); //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceInfo(logMiddle, ref pieceInfo); } break; case "OP3002CH4": qualityData.OP30QualityFilePathCH4 = logMiddle.OP30QualityFilePathCH4; qualityData.OP30QualityStateCH4 = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP30QualityReceiveTimeCH4 = DateTimeHelper.GetDateTime(); if (qualityData.OP30QualityStateCH4 == ((int)QualityState.NG).ToString()) { logMiddle.QualityNoOk = (int)QualityNoOkEnum.OP30颿§ç´§å·¥ä½åç©å¤§; logMiddle.QualityNoOkReason = QualityNoOkEnum.OP30颿§ç´§å·¥ä½åç©å¤§.ToString(); //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceInfo(logMiddle, ref pieceInfo); } break; case "OP3002CH5": qualityData.OP30QualityFilePathCH5 = logMiddle.OP30QualityFilePathCH5; qualityData.OP30QualityStateCH5 = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP30QualityReceiveTimeCH5 = DateTimeHelper.GetDateTime(); if (qualityData.OP30QualityStateCH5 == ((int)QualityState.NG).ToString()) { logMiddle.QualityNoOk = (int)QualityNoOkEnum.OP30ç»æ§ç´§å·¥ä½åç©å¤§; logMiddle.QualityNoOkReason = QualityNoOkEnum.OP30ç»æ§ç´§å·¥ä½åç©å¤§.ToString(); //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceInfo(logMiddle, ref pieceInfo); } break; case "OP3002CH6": qualityData.OP30QualityFilePathCH6 = logMiddle.OP30QualityFilePathCH6; qualityData.OP30QualityStateCH6 = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP30QualityReceiveTimeCH6 = DateTimeHelper.GetDateTime(); if (qualityData.OP30QualityStateCH6 == ((int)QualityState.NG).ToString()) { logMiddle.QualityNoOk = (int)QualityNoOkEnum.OP30å衬å¥å·¥ä½åç©å¤§; logMiddle.QualityNoOkReason = QualityNoOkEnum.OP30å衬å¥å·¥ä½åç©å¤§.ToString(); //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceInfo(logMiddle, ref pieceInfo); } break; default: break; } //qualityData.OP30QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; //qualityData.OP30QualityReceiveTime = DateTimeHelper.GetDateTime(); } else if (logMiddle.WorkingProcedure.Equals("OP35")) { qualityData.OP35QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP35QualityReceiveTime = DateTimeHelper.GetDateTime(); } else if (logMiddle.WorkingProcedure.Equals("OP40")) { qualityData.OP40QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP40QualityReceiveTime = DateTimeHelper.GetDateTime(); } else if (logMiddle.WorkingProcedure.Equals("OP60")) { qualityData.OP60QualityFilePath = logMiddle.OP60QualityFilePath; qualityData.OP60QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP60QualityReceiveTime = DateTimeHelper.GetDateTime(); } else if (logMiddle.WorkingProcedure.Equals("OP80")) { qualityData.OP80QualityFilePath = logMiddle.OP80QualityFilePath; qualityData.OP80QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP80QualityReceiveTime = DateTimeHelper.GetDateTime(); } var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == logMiddle.WorkPieceID && o.WorkingProcedureCurrent == pieceInfo.WorkingProcedureCurrent && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); if (pro == null || pro.WorkPieceID.Length < 1 || logMiddle.MonitoringPoint.Equals("OP1002") || logMiddle.MonitoringPoint.Equals("OP1003") || logMiddle.MonitoringPoint.Contains("OP2002")) {// OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®°ï¼æä»¥ä¸çº¿éè¦ä¿®æ¹çåæ®µæ¾è¿é //ä¸çº¿æ¯æ¯æ¬¡é½æå ¥ WorkPieceProcess process = new WorkPieceProcess(); process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(pieceInfo); process.StartTime = DateTimeHelper.GetDateTime(); process.QualityState = pieceInfo.QualityState.HasValue ? pieceInfo.QualityState.Value : (int)QualityState.OK; //è®°å½è´¨éä¸åæ ¼åå ãEditby shaocx,2024-06-26ã //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceProcess(logMiddle, ref process); process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); process.CreatedUserName = logMiddle.MonitoringPoint; process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.UpdatedUserName = logMiddle.MonitoringPoint; process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.OperationType = OperationType.ç产.ToString(); process.QualityDataInfoID = qualityData.Id; process.Remarks = ""; db.WorkPieceProcess.Add(process); } else {//å ¶ä»çé½åªæ¯ä¿®æ¹ pro.QualityDataInfoID = qualityData.Id; pro.UpdatedUserName = logMiddle.MonitoringPoint; pro.UpdatedTime = DateTimeHelper.GetDateTime(); pro.QualityState = pieceInfo.QualityState.HasValue ? pieceInfo.QualityState.Value : 9; //èµå¼ä¸åæ ¼åå SetQualityNoOk_WorkPieceProcess(logMiddle, ref pro); //TODO:夿妿æ¯60å·¥åºï¼é£ä¹å°±è¦æ´æ°pro表çå建人为loginfo.MonitoringPoint ãEditby shaocx,2024-06-05ã if (logMiddle.WorkingProcedure == "OP60") { pro.CreatedUserName = logMiddle.MonitoringPoint; } } if (logMiddle.QualityType != null && logMiddle.QualityType.Equals(QualityType.SPC.ToString())) {//SPCåé¦ï¼ if (logMiddle.QualityState != (int)QualityState.OK) { //彿å°å·¥åºæ£æµå°ä¸åæ ¼å·¥ä»¶æ¶ï¼ä»è¯¥å·¥ä»¶å 工宿æ¶å»åæå®æ¶é´èµ·è³æ¥æ£ä¸åæ ¼æ¶é´æ¢ï¼ç³»ç»å°è¯¥å·¥ä»¶çæåå 工工åºå¨è¯¥æ¶é´æ®µå å å·¥çææå·¥ä»¶ãæ£å¨å å·¥ç工件ã该工åºå ¥å£å¤ç第ä¸ä¸ªå·¥ä»¶å ¨é¨æ 记为çä¼¼ç¶æï¼ç±äººå·¥å¤æ£å·¥ä»¶å¹¶ä¿®æ¹ç¶æï¼å¹¶æ¯ææ¹éåæ´ã //çå¤ï¼å¨çº¿æµéä¸éè¦èµ°è¿ä¸ªæµç¨ï¼åªæSPCæ½æ£æéè¦ï¼éè¦æè¿æ¶é´æ®µçå·¥ä»¶å ¨é¨ç½®ä¸ºçä¼¼ï¼åªææ¯å·²å®æå·¥ä»¶ //æ¶é´æ®µèµ·å§æ¶é´ï¼æ½æ£å·¥ä»¶ç产æ¶é´åä¸SPCæ½æ£æ¶é´ //æ¶é´æ®µç»ææ¶é´ï¼æ½æ£å·¥ä»¶è´¨éç»æåºç°åçæ¶é´ //æ½æ£å·¥ä»¶å·¥åºæ«ææªå¤å ¥å£å¤ç第ä¸ä¸ªå·¥ä»¶ ä¹æè´¨éç¶æç½®ä¸ºçä¼¼ //ï¼æ¯ä¸å·¥åºSPCæ½æ£æ¯è®¾ç½®çåºå®çï¼æ¯å¦200æ½4ï¼ç¶æç½®ä¸ºçä¼¼æ¶è¥å·¥ä»¶è¿å¨è®¾å¤å ï¼ä¼ç»§ç»çäº§å®æ¯åæåºï¼ //ç®åè¿åé»è¾æ¾å°äº WebAPIä¸äº } } db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(pieceInfo)); db.QualityDataInfoLog.Add(GetAddQualityDataInfoLog(qualityData));//æå ¥æ¥å¿ } else { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éæ£æµå®æè¯»åäºç»´ç {logMiddle.WorkPieceID ?? "空"}å¼å¸¸"; Log4NetHelper.WriteErrorLog(type, $" {logMiddle.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{logMiddle.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } } catch (Exception ex) { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éæ£æµå®æ{logMiddle.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{ex.Message}++{ex.StackTrace}"; Log4NetHelper.WriteErrorLog(type, $" {logMiddle.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{logMiddle.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } finally { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{logMiddle.QualityStateStr ?? "空"}"; db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå ¥å·¥ä»¶é鿥å¿è¡¨ db.SaveChanges(); } } } /// <summary> /// 工件æ¨åºNOOK /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static void WorkPiecePushOff(WorkPieceLogMiddle loginfo, LogType type) { using (DbModel db = new DbModel()) { WorkPieceLog loginfo2 = new WorkPieceLog(); loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); try { if (loginfo.WorkPieceID != null && loginfo.WorkPieceID.Trim('\0').Length == 22) { WorkPieceInfo info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); if (info == null || info.WorkPieceID.Length < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} 工件æ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); return; } else {//æ´æ°è¡¨WorkPieceInfo if (loginfo.WorkingProcedure.Equals("OP10")) { info.WorkPieceCurrentPosition = info.WorkingProcedureCurrent + "NOOK"; //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ loginfo.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ } else { info.WorkingProcedureCurrent = loginfo.WorkingProcedure; info.WorkPieceCurrentPosition = loginfo.WorkingProcedure + "NOOK"; } info.WorkPieceState = (int)WorkPieceState.NOOKPush; info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.Now; info.Remarks = "工件NOOKæ¨åº"; if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) { info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); } info.WorkingProcedureEndTime = DateTimeHelper.GetDateTime(); info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + loginfo.WorkingProcedure;//å·²å®æå·¥åº info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; } if (loginfo.WorkingProcedure.Equals("OP35")) {//为äºè§£å³OP35çééå°çè´¨éä¿¡æ¯æ¯OKè¿NOOKçæ åµï¼OP35 NOOKæ¶æ´æ°è´¨éä¿¡æ¯ loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"OP35NOOKåè´¨éä¿¡æ¯{(info.QualityState.HasValue ? info.QualityState.Value.ToString() : "空")}"; info.QualityState = (int)QualityState.NG; if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) { info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éNOOKééæ°æ®ä¸åæ ¼{info.QualityState}"; } else { info.QualityErrorInfo = ""; } loginfo.QualityState = info.QualityState; var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); if (qualityData != null) { qualityData.OP35QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; qualityData.OP35QualityReceiveTime = DateTimeHelper.GetDateTime(); db.QualityDataInfoLog.Add(GetAddQualityDataInfoLog(qualityData)); } } //æ´æ°ä¸ä¸å·¥åºçç»ææ¶é´ var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == loginfo.WorkingProcedure && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); if (pro != null && pro.WorkPieceID.Length > 0) { pro.EndTime = DateTimeHelper.GetDateTime(); pro.Remarks = (pro.Remarks ?? "") + "NOOKç»æ"; pro.UpdatedUserName = loginfo.MonitoringPoint; pro.UpdatedTime = DateTimeHelper.GetDateTime(); } db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); } else { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"工件NOOKæ¨åºè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}工件NOOKæ¨åºè¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } } catch (Exception e) { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; } db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå ¥å·¥ä»¶é鿥å¿è¡¨ db.SaveChanges(); } } /// <summary> /// 工件SPCæ½æ£æ¨åº /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static void WorkPieceSPCPushOff(WorkPieceLogMiddle loginfo, LogType type) { using (DbModel db = new DbModel()) { WorkPieceLog loginfo2 = new WorkPieceLog(); loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); try { if ((loginfo.WorkPieceID != null && loginfo.WorkPieceID.Trim('\0').Length == 22) //|| !((loginfo.WorkingProcedure.Equals("OP10") || loginfo.WorkingProcedure.Equals("OP40")) && loginfo.Remarks.Length > 0) ) { WorkPieceInfo info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); if (info == null || info.WorkPieceID.Length < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° loginfo2.Remarks = $"工件{loginfo.WorkPieceID} 工件SPCæ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"; Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} 工件SPCæ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); return; } else {//æ´æ°è¡¨WorkPieceInfo if (loginfo.WorkingProcedure.Equals("OP10")) { info.WorkPieceCurrentPosition = info.WorkingProcedureCurrent + "SPC"; //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ loginfo.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ } else { info.WorkingProcedureCurrent = loginfo.WorkingProcedure; info.WorkPieceCurrentPosition = loginfo.WorkingProcedure + "SPC"; } info.WorkPieceState = (int)WorkPieceState.SPCPush; info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.Now; info.WorkingProcedureEndTime = DateTimeHelper.GetDateTime(); if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) { info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); } info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + loginfo.WorkingProcedure;//å·²å®æå·¥åº info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; } info.Remarks = "工件SPCæ½æ£æ¨åº"; //æ´æ°ä¸ä¸å·¥åºçç»ææ¶é´ var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == loginfo.WorkingProcedure && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); if (pro != null && pro.WorkPieceID.Length > 0) { pro.EndTime = DateTimeHelper.GetDateTime(); pro.Remarks = (pro.Remarks ?? "") + "SPCæ½æ£ç»æ"; pro.UpdatedUserName = loginfo.MonitoringPoint; pro.UpdatedTime = DateTimeHelper.GetDateTime(); } //æ¯æ¬¡SPC é½æå ¥è¿½æº¯è¡¨ WorkPieceProcess process = new WorkPieceProcess(); process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); process.StartTime = DateTimeHelper.GetDateTime(); process.OperationType = OperationType.SPC.ToString(); process.QualityState = (int)QualityState.Suspected; process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); process.CreatedUserName = loginfo.MonitoringPoint; process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.UpdatedUserName = loginfo.MonitoringPoint; process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.Remarks = "工件SPCæ½æ£æ¨åº"; db.WorkPieceProcess.Add(process); db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); } else { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"工件SPCæ½æ£æ¨åºè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}工件SPCæ½æ£æ¨åºè¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } } catch (Exception e) { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; } finally { db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå ¥å·¥ä»¶é鿥å¿è¡¨ db.SaveChanges(); } } } /// <summary> /// å·¥åºå®æ /// </summary> /// <param name="logMiddle"></param> /// <param name="type"></param> public static void WorkingProcedureComplete(WorkPieceLogMiddle logMiddle, LogType type) { using (DbModel db = new DbModel()) { if (logMiddle.WorkingProcedure.Equals("OP70")) { logMiddle.QualityState = (int)QualityState.OK; //妿æ¯OP70ï¼åé»è®¤æ¯åæ ¼ ãEditby shaocx,2024-06-25ã } WorkPieceLog loginfo2 = new WorkPieceLog(); loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(logMiddle); try { if (logMiddle.WorkPieceID != null && logMiddle.WorkPieceID.Trim('\0').Length == 22) { bool isAddWorkPieceInfo = false; WorkPieceInfo info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == logMiddle.WorkPieceID).FirstOrDefault(); if (info == null || info.WorkPieceID.Length < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° ï¼ä¸ºäºæµè¯å å æ°å¢ï¼ Log4NetHelper.WriteErrorLog(type, $"工件{logMiddle.WorkPieceID} 工件æ¨åºå·¥åº{logMiddle.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); //db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo));//æå ¥å·¥ä»¶é鿥å¿è¡¨ //db.SaveChanges(); loginfo2 = CommonManager.Instance.GetWorkPieceID(logMiddle, type); info = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLog>(logMiddle); //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); if (!logMiddle.WorkingProcedure.Equals("OP05")) {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ info.QualityState = (int)QualityState.Suspected; info.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{logMiddle.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; info.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{logMiddle.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ åµå¹¶åç¸åºå¤çï¼"; } else { info.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ info.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; } info.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime();//WorkPieceInitOnlineTime info.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; info.CreatedUserName = logMiddle.MonitoringPoint; info.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); info.WorkingProcedureCurrent = logMiddle.WorkingProcedure; info.WorkingProcedureEndTime = null; info = ParseQRCode(info); isAddWorkPieceInfo = true; } if (logMiddle.WorkingProcedure.Equals("OP10")) { //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ logMiddle.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ } info.UpdatedUserName = logMiddle.MonitoringPoint; info.UpdatedTime = DateTimeHelper.GetDateTime(); info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + logMiddle.WorkingProcedure;//å·²å®æå·¥åº if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) {//è¥ä¸ç´æ²¡æå·¥åºå¼å§æ¶é´ï¼åèµå¼å½åæ¶é´ info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); } info.WorkingProcedureEndTime = DateTimeHelper.GetDateTime(); info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(logMiddle.WorkingProcedure) / 2; info.Remarks = $"{logMiddle.WorkingProcedure}å·¥åºå®æ"; long op80id = 0; if (logMiddle.WorkingProcedure.Equals("OP80")) { info.WorkPieceState = (int)WorkPieceState.FinishedProducts; info.WorkPieceLastOfflineTime = DateTimeHelper.GetDateTime(); info.WorkPieceCurrentPosition = "OP80"; info.CompleteTime = DateTimeHelper.GetDateTime(); info.OP80NewCode = logMiddle.OP80NewCode; //è´¨æ£æ°æ®æ¹ä¸º è·åæä»¶åä¿®æ¹ ãEditby shaocx,2024-06-15ã /* info.QualityState = (int)((loginfo.QualityStateStr.Equals("OK") || loginfo.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); loginfo.QualityState = info.QualityState; info.QualityStateUpdateUser = loginfo.UpdatedUserName; info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); //*/ var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == logMiddle.WorkPieceID).FirstOrDefault(); if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) {//æå ¥QualityDataInfo表 qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(logMiddle); db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); } //ä¿®æ¹QualityDataInfo表 //é夿¶å°è´¨éä¿¡æ¯ï¼ä¼è¦çä¹åç EntityPropHelper<WorkPieceLogMiddle, QualityDataInfo>.CopyProp(logMiddle, qualityData, GetQualityDataInfoUpdate(logMiddle, logMiddle.WorkingProcedure, logMiddle.MonitoringPoint));//æå®ä¿®æ¹å段 //è´¨æ£æ°æ®æ¹ä¸º è·åæä»¶åä¿®æ¹ ãEditby shaocx,2024-06-15ã /* qualityData.QualityStateUpdateUser = info.UpdatedUserName; qualityData.QualityReceiveTime = info.UpdatedTime.Value.LocalDateTime; qualityData.QualityStateUpdateMode = info.QualityStateUpdateMode; qualityData.OP80QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; qualityData.OP80QualityReceiveTime = DateTimeHelper.GetDateTime(); qualityData.OP80QualityFilePath = loginfo.OP80QualityFilePath; op80id = qualityData.Id; loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{loginfo.QualityStateStr ?? "空"}"; if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) { info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼"; } else { info.QualityErrorInfo = ""; } //*/ } else if (logMiddle.WorkingProcedure.Equals("OP30")) { info.QualityState = (int)((logMiddle.QualityStateStr.Equals("OK") || logMiddle.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); logMiddle.QualityState = info.QualityState; info.QualityStateUpdateUser = logMiddle.UpdatedUserName; info.QualityStateUpdateTime = logMiddle.UpdatedTime.Value.LocalDateTime; info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == logMiddle.WorkPieceID).FirstOrDefault(); if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) {//æå ¥QualityDataInfo表 qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(logMiddle); db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); } qualityData.QualityStateUpdateUser = info.UpdatedUserName; qualityData.QualityReceiveTime = info.UpdatedTime.Value.LocalDateTime; qualityData.QualityStateUpdateMode = info.QualityStateUpdateMode; qualityData.OP30QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value.ToString() : "3"; qualityData.OP30QualityReceiveTime = DateTimeHelper.GetDateTime(); loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{logMiddle.QualityStateStr ?? "空"}"; if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) { info.QualityErrorInfo = $"{logMiddle.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼"; } else { info.QualityErrorInfo = ""; } } else { info.WorkPieceState = (int)WorkPieceState.WIP; if (info.WorkingProcedurePlan.IndexOf(logMiddle.WorkingProcedure) + 4 <= info.WorkingProcedurePlan.Length) { info.WorkPieceCurrentPosition = info.WorkingProcedurePlan.Substring(info.WorkingProcedurePlan.IndexOf(logMiddle.WorkingProcedure), 8); } } var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == logMiddle.WorkPieceID && o.WorkingProcedureCurrent == info.WorkingProcedureCurrent && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); if (pro == null || pro.WorkPieceID.Length < 1) { WorkPieceProcess process = new WorkPieceProcess(); process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); process.StartTime = DateTimeHelper.GetDateTime(); process.EndTime = DateTimeHelper.GetDateTime(); if (logMiddle.WorkingProcedure.Equals("OP80")) {//OP80çè´¨éæ°æ®æ¯åæ¥è·åæä»¶æç } else { process.QualityState = logMiddle.QualityState.HasValue ? logMiddle.QualityState.Value : (int)QualityState.OK; } process.CreatedUserName = logMiddle.MonitoringPoint; process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.UpdatedUserName = logMiddle.MonitoringPoint; process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); process.OperationType = OperationType.ç产.ToString(); process.Remarks = ""; if (logMiddle.WorkingProcedure.Equals("OP80")) { process.GetQcDataFlag = logMiddle.GetQcDataFlag;//èµå¼æ è®° [Editby shaocx,2024-06-15] } if (op80id > 0) { process.QualityDataInfoID = op80id; } db.WorkPieceProcess.Add(process); } else { if (op80id > 0) { pro.QualityDataInfoID = op80id; } pro.EndTime = DateTimeHelper.GetDateTime(); pro.UpdatedUserName = logMiddle.MonitoringPoint; pro.UpdatedTime = DateTimeHelper.GetDateTime(); if (logMiddle.WorkingProcedure.Equals("OP80")) { if (pro.GetQcDataFlag != 0) { pro.GetQcDataFlag = logMiddle.GetQcDataFlag;//èµå¼æ è®° [Editby shaocx,2024-06-15] } } } if (isAddWorkPieceInfo) { db.WorkPieceInfo.Add(info); } db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); } else { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"ä¸çº¿å®æè¯»åäºç»´ç {logMiddle.WorkPieceID ?? "空"}å¼å¸¸"; Log4NetHelper.WriteErrorLog(type, $" {logMiddle.WorkingProcedure}å·¥åºä¸çº¿ 读åå·¥ä»¶ç æ°æ®[{logMiddle.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); } } catch (Exception e) { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {logMiddle.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; } db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå ¥å·¥ä»¶é鿥å¿è¡¨ db.SaveChanges(); } } public static void AlertMonitor(WorkPieceLog loginfo, LogType type) { } /// <summary> /// 设å¤åè¦çæ§ï¼æ¸ æ´æ¶²ï¼ååæ¶²ï¼åå ·åè¦çï¼ /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static void AlertMonitor(LogType type) { using (DbModel db = new DbModel()) { bool isAddAlert = false; try { var equipmentlist = db.EquipmentBaseInfo.Where(o => o.IsDeleted == false).ToList(); var alertlist = db.v_get_equipment_alert.Where(o => o.IsDeleted == false).ToList(); var knifetoolbase = db.KnifeToolBaseInfo.Where(o => o.IsDeleted == false).ToList(); var knifetoolinfo = db.KnifeToolEquipmentInfo.Where(o => o.IsDeleted == false).ToList(); //var knifelist = db.KnifeToolEquipmentInfo.GroupJoin(db.KnifeToolBaseInfo.Where(o => o.IsDeleted == false).ToList(), a => a.EquipmentID, b => b.EquipmentID, (a, b) => new { a,b}) //.SelectMany(ab => ab.b.DefaultIfEmpty(), (ab, b) => new { ab.a, b.KnifeToolChangeAlertThreshold,b.KnifeToolLife }) //.Where(o => o.a.IsDeleted == false) //.ToList(); foreach (var item in equipmentlist) { try { var alert = alertlist.Where(o => o.EquipmentId.Equals(item.EquipmentId)).FirstOrDefault(); if (alert == null || alert.Id < 1) { alert = EntityPropHelper.Mapper<v_get_equipment_alert, EquipmentBaseInfo>(item); isAddAlert = true; } //if(item.WorkingProcedure.Equals("OP70")) { if (item.Detergentchangetime.HasValue) { if (item.Detergentchangetime.Value.AddDays(item.DetergentChangeAlertThreshold).Date <= DateTime.Now.Date) {//op70æ¸ æ´æ¶²åè¦ alert.IsAlertDetergent = true; alert.Detergentchangetime = item.Detergentchangetime; alert.DetergentChangeAlertThreshold = item.DetergentChangeAlertThreshold; alert.DetergentChangeCycle = item.DetergentChangeCycle; alert.DetergentDesc = $"设å¤ã{item.EquipmentName}ãæ¸ æ´æ¶²ææ°æ´æ¢æ¶é´ä¸ºã{item.Detergentchangetime.Value}ãï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; } else { alert.IsAlertDetergent = false; alert.DetergentDesc = ""; } } else { alert.IsAlertDetergent = false; alert.DetergentDesc = ""; } } //if (!item.WorkingProcedure.Equals("OP05")&& !item.WorkingProcedure.Equals("OP30") && !item.WorkingProcedure.Equals("OP70") && !item.WorkingProcedure.Equals("OP80")) { if (item.CuttingFluidChangeTime.HasValue) { if (item.CuttingFluidChangeTime.Value.AddDays(item.CuttingFluidChangeAlertThreshold).Date <= DateTime.Now.Date) {//ååæ¶²åè¦ alert.IsAlertCuttingFluid = true; alert.CuttingFluidChangeTime = item.CuttingFluidChangeTime; alert.CuttingFluidChangeAlertThreshold = item.CuttingFluidChangeAlertThreshold; alert.CuttingFluidDesc = $"设å¤ã{item.EquipmentName}ãååæ¶²ææ°æ´æ¢æ¶é´ä¸ºã{item.CuttingFluidChangeTime.Value}ãï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; } else { alert.IsAlertCuttingFluid = false; alert.CuttingFluidDesc = ""; } } else { alert.IsAlertCuttingFluid = false; alert.CuttingFluidDesc = ""; } } bool flag = false; string desc = $"设å¤ã{item.EquipmentName}ã"; foreach (var knife in knifetoolinfo.Where(o => o.EquipmentID.Equals(item.EquipmentId))) { var list = knifetoolbase.Where(o => o.KnifeToolID.Equals(knife.KnifeToolID)).FirstOrDefault(); if (list != null) { if ((knife.CurrentLife + list.KnifeToolChangeAlertThreshold) >= list.KnifeToolLife) {//åå ·åè¦ flag = true; alert.IsAlertKnifeTool = true; alert.KnifeToolChangeAlertThreshold = list.KnifeToolChangeAlertThreshold; desc += $"\r\nå·¥ä½ã{knife.Station}ãä¸åå ·ã{knife.KnifeToolID}ã计å寿å½ã{list.KnifeToolLife}ãæ¬¡ï¼å½å已使ç¨å¯¿å½ã{knife.CurrentLife}ãæ¬¡ï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; } } } if (!flag) {//没æåå ·åè¦ alert.IsAlertKnifeTool = false; alert.KnifeToolDesc = ""; } else { alert.IsAlertKnifeTool = true; alert.KnifeToolDesc = desc; } EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); info = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == item.EquipmentId).FirstOrDefault(); if (info == null || info.Id < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"设å¤{item.EquipmentId} 计ç®åè¦{item.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼"); } else { if (string.IsNullOrEmpty(info.Alertmsg)) { alert.IsAlert = false; alert.AlertDesc = ""; } else { alert.IsAlert = true; alert.AlertDesc = info.Alertmsg; } } if (isAddAlert) { db.v_get_equipment_alert.Add(alert); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(type, $" {item.EquipmentName}设å¤è®¡ç®åè¦æ¶å¼å¸¸ï¼"); } } } catch (Exception e) { Log4NetHelper.WriteErrorLog(type, $" 设å¤åè¦çæ§ï¼æ¸ æ´æ¶²ï¼ååæ¶²ï¼åå ·åè¦çï¼ è®¡ç®æ¶å¼å¸¸ï¼{e.Message} {e.StackTrace}"); } //db.WorkPieceLog.Add(loginfo2);//æå ¥è®¾å¤é鿥å¿è¡¨ db.SaveChanges(); } } /// <summary> /// 设å¤çæ§ /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static void EquipmentMonitor(WorkPieceLogMiddle loginfo, LogType type) { using (DbModel db = new DbModel()) { var loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); try { bool isAddEquipmentCurrentMonitor = false; EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); info = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == loginfo.EquipmentID).FirstOrDefault(); if (info == null || info.Id < 1) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.MonitoringPoint} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); info = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLogMiddle>(loginfo); isAddEquipmentCurrentMonitor = true; } //ææ°è®¾å¤ç¶æ string State = ""; //OP20,OP30,OP35,OP50,OP60ççé½ä¸åºååè¦åmessageï¼ä½codeé½ä¸ä¼éå¤ï¼æä»¥æ¬å¤å°±ä¸éè¦å¤æåè¦ç±»åäº var codelist = db.EquipmentFailureCode.Where(o => o.WorkingProcedure.Equals(loginfo.WorkingProcedure)).ToList(); #region æ é代ç å¤ç List<long> Failueslist = new List<long>(); Failueslist.Add(loginfo.FailureType1); Failueslist.Add(loginfo.FailureType2); Failueslist.Add(loginfo.FailureType3); Failueslist.Add(loginfo.FailureType4); Failueslist.Add(loginfo.FailureType5); Failueslist.Add(loginfo.FailureType6); Failueslist.Add(loginfo.FailureType7); Failueslist.Add(loginfo.FailureType8); Failueslist.Add(loginfo.FailureType9); Failueslist.Add(loginfo.FailureType10); Failueslist.Add(loginfo.FailureType11); Failueslist.Add(loginfo.FailureType12); Failueslist.Add(loginfo.FailureType13); Failueslist.Add(loginfo.FailureType14); Failueslist.Add(loginfo.FailureType15); Failueslist.Add(loginfo.FailureType16); Failueslist.Add(loginfo.FailureType17); Failueslist.Add(loginfo.FailureType18); Failueslist.Add(loginfo.FailureType19); Failueslist.Add(loginfo.FailureType20); Failueslist.RemoveAll(o => o == 0); string faultall = ""; string faultmsg = ""; int i = 1; foreach (var failues in Failueslist) { faultall += (failues + "\r\n"); EquipmentFailureCode codeinfo = codelist.Where(o => o.Code == failues.ToString()).FirstOrDefault(); if (codeinfo != null && codeinfo.Code.Length > 0) { faultmsg += (i.ToString() + "." + (codeinfo.CodeDesc ?? codeinfo.Code) + "\r\n"); } else { faultmsg += (i.ToString() + "." + failues.ToString() + "\r\n"); } i++; } //var faultall = string.Join("\r\n", Failueslist.OrderBy(o=>o)); #endregion #region åè¦ä»£ç å¤ç List<long> Alertlist = new List<long>(); Alertlist.Add(loginfo.FailureMessage1); Alertlist.Add(loginfo.FailureMessage2); Alertlist.Add(loginfo.FailureMessage3); Alertlist.Add(loginfo.FailureMessage4); Alertlist.Add(loginfo.FailureMessage5); Alertlist.Add(loginfo.FailureMessage6); Alertlist.Add(loginfo.FailureMessage7); Alertlist.Add(loginfo.FailureMessage8); Alertlist.Add(loginfo.FailureMessage9); Alertlist.Add(loginfo.FailureMessage10); Alertlist.Add(loginfo.FailureMessage11); Alertlist.Add(loginfo.FailureMessage12); Alertlist.Add(loginfo.FailureMessage13); Alertlist.Add(loginfo.FailureMessage14); Alertlist.Add(loginfo.FailureMessage15); Alertlist.Add(loginfo.FailureMessage16); Alertlist.Add(loginfo.FailureMessage17); Alertlist.Add(loginfo.FailureMessage18); Alertlist.Add(loginfo.FailureMessage19); Alertlist.Add(loginfo.FailureMessage20); Alertlist.RemoveAll(o => o == 0); string alertall = ""; string warnmsg = ""; i = 1; foreach (var alert in Alertlist) { alertall += (alert + "\r\n"); var codeinfo = codelist.Where(o => o.Code == alert.ToString()).FirstOrDefault(); if (codeinfo != null && codeinfo.Code.Length > 0) { warnmsg += (i.ToString() + "." + (codeinfo.CodeDesc ?? codeinfo.Code) + "\r\n"); } else { warnmsg += (i.ToString() + "." + alert.ToString() + "\r\n"); } i++; } #endregion //var alertall = string.Join("\r\n", Alertlist.OrderBy(o=>o)); EquipmentWorkingLog infolog = new EquipmentWorkingLog(); infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); infolog.LogAddTime = DateTimeHelper.GetDateTime(); infolog.WorkPieceLogID = loginfo2.Id; infolog.EquipmentID = info.EquipmentID; bool isAddEquipmentWorkingLog = false; bool isStatechange = false; #region 设å¤ç¶æå¤ç //æ éãè¦åãå ¶ä» if (loginfo.IsCloseAlert) {//æ é info.AlertTime = info.AlertTime ?? DateTime.Now; info.FailureType = ""; info.WarnType = ""; info.Alertmsg = faultmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é info.FailureType = faultall; State = ((int)EnumEquipmentCurrentStateDisplay.æ é).ToString(); //infolog.FailureStartTime = DateTimeHelper.GetDateTime(); //infolog.FailureType = faultall; //infolog.FailureMsg = faultmsg; if (loginfo.IsMessage) { info.WarnTime = info.WarnTime ?? DateTime.Now; info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é info.WarnType = alertall; } } //else if (loginfo.IsMessage) //{//è¦å // info.AlertTime = null; // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.FailureType = ""; // info.WarnTime = info.WarnTime ?? DateTime.Now; // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.WarnType = alertall; // //infolog.WarnStartTime = DateTimeHelper.GetDateTime(); // //infolog.WarnType = alertall; // //infolog.Warnmsg = warnmsg; // State = ((int)EnumEquipmentCurrentStateDisplay.è¦å).ToString(); //} else {//åè¦ç»æï¼è·åæåè¦çæ°æ®ï¼ç¶åå ³éä» info.AlertTime = null; info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é info.FailureType = ""; info.WarnType = ""; info.WarnTime = null; info.Warnmsg = ""; if (loginfo.IsMessage) {//è¦åä¼è¦çä¸é¢çç¶æï¼å ä¸ç¨è¦åäº info.WarnTime = info.WarnTime ?? DateTime.Now; info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é info.WarnType = alertall; } if (info.EquipmentCurrentState == null || (!info.EquipmentCurrentState.Equals(((int)EnumEquipmentCurrentStateDisplay.离线).ToString()))) {//å¦æè®¾å¤ç¶æä¸ºç¦»çº¿ï¼åæ¤å¤ä¸éè¦å¤æä»»ä½ä¿¡æ¯ if (loginfo.IsNormalProduction && !loginfo.LackMaterial && !loginfo.FullMaterial) {//èªå¨è¿è¡ç¶æ+ä¸ç¼ºæ+ä¸å µæ State = ((int)EnumEquipmentCurrentStateDisplay.ç产).ToString(); } else if (loginfo.IsNormalProduction && loginfo.FullMaterial) {//èªå¨è¿è¡ç¶æ+䏿鿻¡æ = 宿 ï¼å°±æ¯æçäº§åºæ¥ä½æ²¡æåºè®¾å¤ï¼ State = ((int)EnumEquipmentCurrentStateDisplay.宿).ToString(); } //else if (loginfo.IsNormalProduction && loginfo.LackMaterial) //{//å ¶ä»ç¶æå ¨ç®å¾ æº // State = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); //} else {//å ¶ä»ç¶æå ¨ç®å¾ æº State = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); } } } if (!string.IsNullOrEmpty(State) && State != info.EquipmentCurrentState) {//åªæç¶æåºç°ååæåæ´,ç¶æåæ´ï¼è¯å®ææ°ç䏿¡æ°æ® //ç¶æåæ´ï¼è·åæ§ç¶æçä¿¡æ¯ï¼è¥æåæ´æ°(åç¡®ç说ï¼åªè¦æ²¡æç»ææ¶é´ç设å¤ç¶æé½éè¦æ´æ°ç»ææ¶é´ï¼ä»¥ä¾¿äºæå ¥æ°çæ°æ®) var equlogState = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) //&& o.EquipmentState== info.EquipmentCurrentState ) .OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); if (equlogState != null) { equlogState.MonitoringPoint = loginfo.MonitoringPoint; equlogState.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); } info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.Now; info.EquipmentCurrentState = State; //ç¶æåæ´ï¼éè¦æ´æ°åæ¥çï¼è¯å®ä¼æå ¥æ°ç infolog.EquipmentState = State; infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); infolog.WorkingProcedure = loginfo.WorkingProcedure; infolog.MonitoringPoint = loginfo.MonitoringPoint; infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´3"; infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(State)).ToString()}\r\n"; isAddEquipmentWorkingLog = true; isStatechange = true; } #endregion //1.ææ é忝æ éç¶æï¼ ææ éä¿¡æ¯+åè¦ä¿¡æ¯ //2.æ²¡ææ éæåè¦åæ¯åè¦ç¶æï¼æåè¦ä¿¡æ¯ //3.峿²¡æ éï¼ä¹æ²¡åè¦ï¼åæ¯å ¶ä»ç¶æ //æ¥æ¾æ¯å¦ææªç»æçæ é var equlogFailure = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.FailureStartTime != null && o.FailureStartTime != DateTime.MinValue && (o.FailureEndTime == null || o.FailureEndTime == DateTime.MinValue)) .OrderByDescending(o => o.FailureStartTime).FirstOrDefault(); if (loginfo.IsCloseAlert) {//ææ éæ å¿ä½ï¼è®¾å¤ç¶æè¥æåæ´åè¯å®ææ°å¢ï¼æ¤å¤ç´æ¥æ´æ°å³å¯ //ææ éæ å¿ä½ï¼è®¾å¤ç¶æè¥æ²¡ææ´æ°ï¼ææ éï¼ä¹ä¸ä¼æå ¥æ°çï¼ææ é设å¤ç¶æåæ´è¯å®æ¯åææ éï¼ infolog.FailureStartTime = DateTimeHelper.GetDateTime(); infolog.FailureType = faultall; infolog.FailureMsg = faultmsg; infolog.WorkingProcedure = loginfo.WorkingProcedure; infolog.MonitoringPoint = loginfo.MonitoringPoint; infolog.Remarks = "æ éä¿¡æ¯åºç°åæ´1"; infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "æ éä¿¡æ¯åæ´\r\n"; } else { if (equlogFailure != null) {//æ éå ³éç equlogFailure.MonitoringPoint = loginfo.MonitoringPoint; equlogFailure.FailureEndTime = DateTimeHelper.GetDateTime(); } } //æ¥æ¾æ¯å¦ææªç»æçåè¦ var equlogalert = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.WarnStartTime != null && o.WarnStartTime != DateTime.MinValue && (o.WarnEndTime == null || o.WarnEndTime == DateTime.MinValue)) .OrderByDescending(o => o.WarnStartTime).FirstOrDefault(); if (loginfo.IsMessage) {//è¥æåè¦ï¼å¦ææè®¾å¤ç¶æåæ´ï¼è¯å®æå ¥ï¼æ¤å¤åªä¿®æ¹å³å¯ //è¥æåè¦ï¼å¦æè®¾å¤ç¶ææ²¡æåæ´ï¼æåè¦ï¼ä¹ä¸æå ¥æ°çï¼é®é¢ï¼å½ç¶ææ²¡ææ´æ¹ï¼å¦ä¸ç´æ¯æ éï¼ä½åè¦ä¿¡æ¯æååï¼æä¹å psï¼æ¤å¤å ä¸ç®¡ï¼ infolog.WarnStartTime = DateTimeHelper.GetDateTime(); infolog.WarnType = alertall; infolog.Warnmsg = warnmsg; infolog.WorkingProcedure = loginfo.WorkingProcedure; infolog.MonitoringPoint = loginfo.MonitoringPoint; infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´2"; infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "åè¦ä¿¡æ¯åæ´\r\n"; } else { if (equlogalert != null) {//æ éå ³éç equlogalert.MonitoringPoint = loginfo.MonitoringPoint; equlogalert.WarnEndTime = DateTimeHelper.GetDateTime(); } } #region 忥ç代ç ï¼ä»¥åå æ //EquipmentWorkingLog infolog =new EquipmentWorkingLog(); //infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //infolog.LogAddTime = DateTimeHelper.GetDateTime(); //infolog.WorkPieceLogID = loginfo2.Id; //infolog.EquipmentID = info.EquipmentID; //bool isAddEquipmentWorkingLog = false; //if (loginfo.ischeckAlertStatus) //{//åè¦ç¶æåçåæ´ // //è¯´ææ¯ä¸ä¸ªæ°åè¦ï¼éè¦æ´æ°è®¾å¤çæ§è¡¨ // //æ¥æ¾æªç»æçåè¦ // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID // && o.FailureStartTime != null && o.FailureStartTime != DateTime.MinValue) // .OrderByDescending(o=>o.FailureStartTime).FirstOrDefault(); // if (loginfo.IsCloseAlert) // { // if (equlog == null|| (equlog.FailureEndTime!=null&& equlog.FailureEndTime > DateTime.MinValue)) // { // info.AlertTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); // infolog.FailureStartTime = DateTimeHelper.GetDateTime(); // infolog.FailureType = faultall; // infolog.FailureMsg = faultmsg; // infolog.WorkingProcedure = loginfo.WorkingProcedure; // infolog.MonitoringPoint = loginfo.MonitoringPoint; // infolog.Remarks = "æ éä¿¡æ¯åºç°åæ´1"; // infolog.UpdateDesc = (infolog.UpdateDesc??"")+"æ éä¿¡æ¯åæ´\r\n"; // isAddEquipmentWorkingLog =true; // } // } // else // { // if (equlog != null && (equlog.FailureEndTime == null || equlog.FailureEndTime <= DateTime.MinValue)) // {//åè¦å ³éçï¼è¥æ²¡æåè¦ä¿¡æ¯ï¼ä¸ç¨ç®¡ // equlog.MonitoringPoint = loginfo.MonitoringPoint; // equlog.FailureEndTime = DateTimeHelper.GetDateTime(); // } // } //} //if (loginfo.ischeckMessageStatus) //{//åè¦ç¶æåçåæ´ // //è¯´ææ¯ä¸ä¸ªæ°åè¦ï¼éè¦æ´æ°è®¾å¤çæ§è¡¨ // //æ¥æ¾æªç»æçåè¦ // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID // && o.WarnStartTime != null && o.WarnStartTime != DateTime.MinValue).OrderByDescending(o => o.WarnStartTime).FirstOrDefault(); // if (loginfo.IsMessage) // { // if (equlog == null || (equlog.WarnEndTime != null && equlog.WarnEndTime > DateTime.MinValue)) // { // info.WarnTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); // infolog.WarnStartTime = DateTimeHelper.GetDateTime(); // infolog.WarnType = alertall; // infolog.Warnmsg = warnmsg; // infolog.WorkingProcedure = loginfo.WorkingProcedure; // infolog.MonitoringPoint = loginfo.MonitoringPoint; // infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´2"; // infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "åè¦ä¿¡æ¯åæ´\r\n"; // isAddEquipmentWorkingLog = true; // } // } // else // { // if (equlog != null && (equlog.WarnEndTime == null || equlog.WarnEndTime <= DateTime.MinValue)) // {//åè¦å ³éçï¼è¥æ²¡æåè¦ä¿¡æ¯ï¼ä¸ç¨ç®¡ // equlog.MonitoringPoint = loginfo.MonitoringPoint; // equlog.WarnEndTime = DateTimeHelper.GetDateTime(); // } // } //} ////æ éãè¦åãå ¶ä» //if (loginfo.IsCloseAlert) //{//æ é // info.AlertTime = info.AlertTime??DateTime.Now; // info.FailureType = ""; // info.WarnType = ""; // info.Alertmsg = faultmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.FailureType = faultall; // State = ((int)EnumEquipmentCurrentStateDisplay.æ é).ToString(); // infolog.FailureStartTime = DateTimeHelper.GetDateTime(); // infolog.FailureType = faultall; // infolog.FailureMsg = faultmsg; // if (loginfo.IsMessage) // { // info.WarnTime = info.WarnTime ?? DateTime.Now; // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.WarnType = alertall; // } //} //else if(loginfo.IsMessage) //{//è¦å // info.AlertTime = null; // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.FailureType = ""; // info.WarnTime = info.WarnTime ?? DateTime.Now; // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.WarnType = alertall; // infolog.WarnStartTime = DateTimeHelper.GetDateTime(); // infolog.WarnType = alertall; // infolog.Warnmsg = warnmsg; // State = ((int)EnumEquipmentCurrentStateDisplay.è¦å).ToString(); //} //else //{//åè¦ç»æï¼è·åæåè¦çæ°æ®ï¼ç¶åå ³éä» // info.AlertTime = null; // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå ¸ç»´æ¤ä¿¡æ¯æç¥é // info.FailureType = ""; // info.WarnType = ""; // info.WarnTime = null; // info.Warnmsg = ""; // if (loginfo.IsNormalProduction&& loginfo.LackMaterial) // { // State = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); // } // else if(loginfo.IsNormalProduction && !loginfo.LackMaterial) // { // State = ((int)EnumEquipmentCurrentStateDisplay.ç产).ToString(); // } // else if(loginfo.IsNormalProduction && loginfo.FullMaterial) // {//æ£å¸¸ç产+䏿鿻¡æ = 宿 ï¼å°±æ¯æçäº§åºæ¥ä½æ²¡æåºè®¾å¤ï¼ // State = ((int)EnumEquipmentCurrentStateDisplay.宿).ToString(); // } // else // {//ç论ä¸ä¸å¯è½èµ°å°è¿ï¼åªæ¯é¿å ç©ºå¼ // State = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); // } //} //if (!string.IsNullOrEmpty(State) && State != info.EquipmentCurrentState) //{//åªæç¶æåºç°ååæåæ´ // info.UpdatedUserName = loginfo.MonitoringPoint; // info.UpdatedTime = DateTime.Now; // info.EquipmentCurrentState = State; // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID // && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); // if (equlog != null && (equlog.EquipmentStateEndTime == null || equlog.EquipmentStateEndTime <= DateTime.MinValue)) // { // equlog.MonitoringPoint = loginfo.MonitoringPoint; // equlog.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); // } // //ç¶æåæ´ï¼éè¦æ´æ°åæ¥çï¼å¹¶æå ¥æ°ç // infolog.EquipmentState = State; // infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); // infolog.WorkingProcedure = loginfo.WorkingProcedure; // infolog.MonitoringPoint = loginfo.MonitoringPoint; // infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´3"; // infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(State)).ToString()}\r\n"; // isAddEquipmentWorkingLog = true; //} ////info.Remarks = $"{loginfo.WorkingProcedure}å·¥åºåè¦"; #endregion if (isAddEquipmentCurrentMonitor) { info.Id = Yitter.IdGenerator.YitIdHelper.NextId(); db.EquipmentCurrentMonitor.Add(info); } if (isAddEquipmentWorkingLog) { db.EquipmentWorkingLog.Add(infolog); } } catch (Exception e) { loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"{loginfo2.MonitoringPoint}设å¤çæ§æ´æ°æ°æ®å¼å¸¸{e.Message}.{e.StackTrace}"; Log4NetHelper.WriteErrorLog(type, $"{loginfo2.MonitoringPoint}设å¤çæ§æ´æ°æ°æ®å¼å¸¸{e.Message}.{e.StackTrace}"); } //db.WorkPieceLog.Add(loginfo2);//æå ¥è®¾å¤é鿥å¿è¡¨ db.SaveChanges(); } } /// <summary> /// å¿è·³çæ§ /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static void EquipmentBeartBeatMonitor(WorkPieceLogMiddle loginfo, LogType type) { using (DbModel db = new DbModel()) { bool isAddEquipmentCurrentMonitor = false; EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); info = db.EquipmentCurrentMonitor.Where(o => o.WorkingProcedure == loginfo.WorkingProcedure).FirstOrDefault(); if (info == null) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.MonitoringPoint} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); info = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLogMiddle>(loginfo); isAddEquipmentCurrentMonitor = true; info.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); info.IsDeleted = false; } string state = ""; EquipmentWorkingLog infolog = new EquipmentWorkingLog(); infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); infolog.LogAddTime = DateTimeHelper.GetDateTime(); infolog.WorkPieceLogID = loginfo.Id; infolog.EquipmentID = info.EquipmentID; bool isAddEquipmentWorkingLog = false; if (!loginfo.IsConnect) {//ææ°ç¶æä¸ºç¦»çº¿ state = ((int)EnumEquipmentCurrentStateDisplay.离线).ToString(); info.EquipmentCurrentState = state; info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.Now; info.Alertmsg = "设å¤ç¦»çº¿"; info.AlertTime = DateTimeHelper.GetDateTime(); info.FailureType = ""; //è¥æ²¡æç¦»çº¿çä¿¡æ¯ï¼åæ°å¢ä¸æ¡ var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) && o.EquipmentState.Equals(state) ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); if (equlog == null) { infolog.EquipmentState = state; infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); infolog.WorkingProcedure = loginfo.WorkingProcedure; infolog.MonitoringPoint = loginfo.MonitoringPoint; infolog.Remarks = "离线"; infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(state)).ToString()}\r\n"; isAddEquipmentWorkingLog = true; } //è¥æé离线çç¶ææ°æ®ï¼åæ´æ° var equlog2 = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) && !o.EquipmentState.Equals(state) ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); if (equlog2 != null) { equlog2.MonitoringPoint = loginfo.MonitoringPoint; equlog2.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); } } else {//ææ°ç¶æä¸ºå¼æº if (((int)EnumEquipmentCurrentStateDisplay.离线).ToString() == info.EquipmentCurrentState) {//åªæç¦»çº¿ç¶æï¼æè½åæå¼æº state = ((int)EnumEquipmentCurrentStateDisplay.å¾ æº).ToString(); info.EquipmentCurrentState = state; info.UpdatedUserName = loginfo.MonitoringPoint; info.UpdatedTime = DateTime.Now; info.Alertmsg = ""; info.AlertTime = null; //æç¦»çº¿çæ°æ®ï¼åæ´æ° var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) && o.EquipmentState.Equals(((int)EnumEquipmentCurrentStateDisplay.离线).ToString()) ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); if (equlog != null) { equlog.MonitoringPoint = loginfo.MonitoringPoint; equlog.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); } //离线å弿ºï¼è¯å®ä¼æå ¥ä¸æ¡ infolog.EquipmentState = state; infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); infolog.WorkingProcedure = loginfo.WorkingProcedure; infolog.MonitoringPoint = loginfo.MonitoringPoint; infolog.Remarks = "弿º"; infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(state)).ToString()}\r\n"; isAddEquipmentWorkingLog = true; } } if (isAddEquipmentWorkingLog) { db.EquipmentWorkingLog.Add(infolog); } if (isAddEquipmentCurrentMonitor) { info.Id = Yitter.IdGenerator.YitIdHelper.NextId(); db.EquipmentCurrentMonitor.Add(info); } db.SaveChanges(); } } public static void ThreadMonitor(ThreadStatusMonitorMiddle threadinfo) { ThreadMonitor(EntityPropHelper.Mapper<ThreadStatusMonitor, ThreadStatusMonitorMiddle>(threadinfo)); try { SystemValue.UpdateMainList(threadinfo); } catch (Exception ex) { } } public static void ThreadMonitor(ThreadStatusMonitor threadinfo) { try { using (DbModel db = new DbModel()) { var info = db.ThreadStatusMonitor.Where(o => o.Threadcode == threadinfo.Threadcode).FirstOrDefault(); if (info == null || info.Id == 0) {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° threadinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); threadinfo.CreatedTime = DateTimeHelper.GetDateTime(); threadinfo.CreatedUserName = threadinfo.Threadcode; db.ThreadStatusMonitor.Add(threadinfo); } else {//æ´æ°è¡¨WorkPieceInfo info.Remarks = threadinfo.Remarks; info.ErrorMsg = threadinfo.ErrorMsg; info.Threadendtime = DateTimeHelper.GetDateTime();//æ¯æ¬¡é½æ´æ° info.ThreadId = threadinfo.ThreadId; info.ThreadFrequency = threadinfo.ThreadFrequency; info.UpdatedTime = DateTimeHelper.GetDateTime(); info.UpdatedUserName = threadinfo.Threadcode; info.Threadlastmodifytime = threadinfo.Threadlastmodifytime > DateTime.MinValue ? threadinfo.Threadlastmodifytime : info.Threadlastmodifytime;//妿æä¼ ååæ´æ° //if (info.Threadstatue==1) //{ // info.Threadlastmodifytime = DateTimeHelper.GetDateTime();//ææ°è·å°æ°æ® //} } db.SaveChanges(); } } catch (Exception ex) { } } #region ä¸å¡æ¹æ³ /// <summary> /// ãè´¨éæ°æ®æ´æ°ä¸ç¨ã dictä¸åé¢ä¸ä¸ªæ¯å对象ï¼åé¢ä¸ä¸ªæ¯ç®æ 对象 /// </summary> /// <param name="WorkingProcedure"></param> /// <returns></returns> public static Dictionary<string, string> GetQualityDataInfoUpdate(WorkPieceLogMiddle logMiddle, string WorkingProcedure = "", string MonitoringPoint = "") { Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("QualityState", "QualityState"); dict.Add("EquipmentID", "EquipmentID"); dict.Add("WorkingProcedure", "WorkingProcedure"); dict.Add("QualityStateUpdateMode", "QualityStateUpdateMode"); dict.Add("QualityStateUpdateUser", "QualityStateUpdateUser"); dict.Add("OfflineTime", "OfflineTime"); switch (WorkingProcedure) { case "OP10": dict.Add("QualityOP10To1", "QualityOP10To1"); dict.Add("QualityNoOk", "QualityNoOk_OP10"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP10"); break; case "OP20": dict.Add("QualityOP20To1", "QualityOP20To1"); dict.Add("QualityNoOk", "QualityNoOk_OP20"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP20"); break; case "OP30": dict.Add("QualityNoOk", "QualityNoOk_OP30"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP30"); switch (MonitoringPoint) { case "OP3002CH3": dict.Add("QualityOP30To1", "QualityOP30To1"); break; case "OP3002CH4": dict.Add("QualityOP30To2", "QualityOP30To2"); dict.Add("QualityOP30To8", "QualityOP30To8"); break; case "OP3002CH5": dict.Add("QualityOP30To3", "QualityOP30To3"); dict.Add("QualityOP30To4", "QualityOP30To4"); dict.Add("QualityOP30To5", "QualityOP30To5"); dict.Add("QualityOP30To9", "QualityOP30To9"); dict.Add("QualityOP30To10", "QualityOP30To10"); dict.Add("QualityOP30To11", "QualityOP30To11"); break; case "OP3002CH6": dict.Add("QualityOP30To6", "QualityOP30To6"); dict.Add("QualityOP30To7", "QualityOP30To7"); break; default: break; } break; case "OP35": dict.Add("QualityOP35To1", "QualityOP35To1"); dict.Add("QualityOP35To2", "QualityOP35To2"); dict.Add("QualityNoOk", "QualityNoOk_OP35"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP35"); break; case "OP40": dict.Add("QualityOP40To1", "QualityOP40To1"); dict.Add("QualityNoOk", "QualityNoOk_OP40"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP40"); break; case "OP60": dict.Add("QualityOP60To1", "QualityOP60To1"); dict.Add("QualityOP60To2", "QualityOP60To2"); dict.Add("QualityNoOk", "QualityNoOk_OP60"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP60"); break; case "OP70": dict.Add("QualityOP70To1", "QualityOP70To1"); dict.Add("QualityOP70To2", "QualityOP70To2"); dict.Add("QualityOP70To3", "QualityOP70To3"); break; case "OP80": //dict.Add("OP80NewCode", "OP80NewCode"); dict.Add("QualityOP80To1", "QualityOP80To1"); dict.Add("QualityOP80To2", "QualityOP80To2"); dict.Add("QualityOP80To3", "QualityOP80To3"); dict.Add("QualityOP80To4", "QualityOP80To4"); dict.Add("QualityOP80To5", "QualityOP80To5"); dict.Add("QualityOP80To6", "QualityOP80To6"); dict.Add("QualityOP80To7", "QualityOP80To7"); dict.Add("QualityOP80To8", "QualityOP80To8"); dict.Add("QualityOP80To9", "QualityOP80To9"); dict.Add("QualityOP80To10", "QualityOP80To10"); //æ°å¢ ãEditby shaocx,2024-06-16ã dict.Add("QualityOP80_Houdu", "QualityOP80_Houdu"); dict.Add("QualityOP80_ZXJ", "QualityOP80_ZXJ"); dict.Add("QualityOP80_DTKYZD", "QualityOP80_DTKYZD"); dict.Add("QualityOP80_XTSMYD", "QualityOP80_XTSMYD"); dict.Add("QualityOP80_XTXMYD", "QualityOP80_XTXMYD"); dict.Add("QualityOP80_D_TKZJ", "QualityOP80_D_TKZJ"); dict.Add("QualityOP80_D_S_X", "QualityOP80_D_S_X"); dict.Add("QualityOP80_D_S_Y", "QualityOP80_D_S_Y"); dict.Add("QualityOP80_D_X_X", "QualityOP80_D_X_X"); dict.Add("QualityOP80_D_X_Y", "QualityOP80_D_X_Y"); dict.Add("QualityOP80_X_TKZJ", "QualityOP80_X_TKZJ"); dict.Add("QualityOP80_X_S_X", "QualityOP80_X_S_X"); dict.Add("QualityOP80_X_S_Y", "QualityOP80_X_S_Y"); dict.Add("QualityOP80_X_X_X", "QualityOP80_X_X_X"); dict.Add("QualityOP80_X_X_Y", "QualityOP80_X_X_Y"); dict.Add("QualityNoOk", "QualityNoOk_OP80"); dict.Add("QualityNoOkReason", "QualityNoOkReason_OP80"); break; default: break; } return dict; } /// <summary> /// ã工件æå·¥åºæ°æ®æ°æ®æ´æ°ä¸ç¨ã dictä¸åé¢ä¸ä¸ªæ¯å对象ï¼åé¢ä¸ä¸ªæ¯ç®æ 对象 /// </summary> /// <param name="WorkingProcedure"></param> /// <returns></returns> public static Dictionary<string, string> GetWorkPieceInfoUpdateForQualityNoOk(WorkPieceLogMiddle loginfo) { Dictionary<string, string> dict = new Dictionary<string, string>(); //if (loginfo.QualityState != null) //{ // QualityState qualityState; // bool isRight = Enum.TryParse<QualityState>(loginfo.QualityState.ToString(), out qualityState); // if (isRight && (qualityState == QualityState.NG || qualityState == QualityState.Suspected)) // { // } //} dict.Add("QualityNoOk", "QualityNoOk"); dict.Add("QualityNoOkReason", "QualityNoOkReason"); return dict; } public static void SetQualityNoOk_WorkPieceInfo(WorkPieceLogMiddle logMiddle, ref WorkPieceInfo pieceInfo) { pieceInfo.QualityNoOk = logMiddle.QualityNoOk; pieceInfo.QualityNoOkReason = logMiddle.QualityNoOkReason; } public static void SetQualityNoOk_WorkPieceProcess(WorkPieceLogMiddle logMiddle, ref WorkPieceProcess pieceProcess) { pieceProcess.QualityNoOk = logMiddle.QualityNoOk; pieceProcess.QualityNoOkReason = logMiddle.QualityNoOkReason; } /// <summary> /// 夿æ¯å¦è·³åº /// </summary> /// <param name="loginfo"></param> /// <param name="type"></param> public static bool CheckQualityInfoComplete(WorkPieceInfo info, WorkPieceLog loginfo, LogType type) { //夿æ¯å¦è·³åº if (info == null || info.WorkPieceID.Length < 1) { Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶ä¿¡æ¯{loginfo.WorkPieceID}å·¥åºæ¯å¦è·³åºæ¶ï¼ä¼ å ¥å·¥ä»¶ä¿¡æ¯å¼å¸¸"); return true;//没åå°å·¥ä»¶ä¿¡æ¯ï¼ä¸å夿æ¯å¦è·³åº } else { try { string wproStr = info.WorkingProcedureCurrent + loginfo.WorkingProcedure; if (wproStr.Length != 8) { Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº æ¯å¦è·³åºæ¶ï¼å·¥åºæ¼æ¥æé®é¢é¿åº¦ä¸ä¸º8ä½:{wproStr}"); return true;//å·¥åºæ¼æ¥æé®é¢ } if (!ConfigHelper.GetConfigString("WorkingProcedureAllStr").Contains(wproStr)) { Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº åºç°è·³åºï¼è¯·è®¾å¤æ³¨æ:{wproStr}"); return false; } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº æ¯å¦è·³åºæ¶åºç°å¼å¸¸", ex); } } return true; //using (var trans = db.Database.BeginTransaction()) //{ } //var conStr = @"server=localhost;Database=EFDBO1;User ID=sa;Password=123456;"; //using (var connection = new SqlConnection(conStr)) //{ // connection.Open(); // using (var scope = new Transactionscope()) // { // //AD0.Net // var command = connection.CreateCommand(); // command.CommandText = "DELETE FROM T_RoleInfor"; // command.ExecuteNonQuery(); // //综åæäº¤ // scope.complete(); // } //} } /// <summary> /// è§£æäºç»´ç /// </summary> /// <param name="loginfo"></param> /// <returns></returns> public static WorkPieceInfo ParseQRCode(WorkPieceInfo loginfo) { if (string.IsNullOrEmpty(loginfo.WorkPieceID) || loginfo.WorkPieceID.Length != 22) { return loginfo; } loginfo.WorkPieceIDTo1 = loginfo.WorkPieceID.Substring(0, 2); loginfo.WorkPieceIDTo2 = loginfo.WorkPieceID.Substring(2, 4); loginfo.WorkPieceIDTo3 = loginfo.WorkPieceID.Substring(6, 6); loginfo.WorkPieceIDTo4 = loginfo.WorkPieceID.Substring(12, 2); loginfo.WorkPieceIDTo5 = loginfo.WorkPieceID.Substring(14, 4); loginfo.WorkPieceIDTo6 = loginfo.WorkPieceID.Substring(18, 2); loginfo.WorkPieceIDTo7 = loginfo.WorkPieceID.Substring(20, 2); return loginfo; } /// <summary> /// 计ç®OP è´¨éæ°æ®æ¯å¦åæ ¼ /// </summary> public static QualityState CalcQualityStateForOP(WorkPieceLogMiddle logMiddle, ref QualityNoOkEnum? qualityNoOkEnum) { QualityState qualityState = QualityState.Suspected; if (logMiddle.WorkingProcedure == "OP60") { decimal _QualityOP60To1 = SystemHelper.GetDecimal(logMiddle.QualityOP60To1); decimal _QualityOP60To2 = SystemHelper.GetDecimal(logMiddle.QualityOP60To2); var isPass_QualityOP60To1 = false; var isPass_QualityOP60To2 = false; if (_QualityOP60To1 >= (decimal)53.018 && _QualityOP60To1 <= (decimal)53.030) { isPass_QualityOP60To1 = true; } else { qualityNoOkEnum = QualityNoOkEnum.OP60大头åç´å¾è¶ å·®; } if (_QualityOP60To2 >= (decimal)22.005 && _QualityOP60To2 <= (decimal)22.011) { isPass_QualityOP60To2 = true; } else { qualityNoOkEnum = QualityNoOkEnum.OP60å°å¤´åç´å¾è¶ å·®; } if (isPass_QualityOP60To1 && isPass_QualityOP60To2) { qualityState = QualityState.OK; } else { qualityState = QualityState.NG; } if (_QualityOP60To1 == 0 || _QualityOP60To2 == 0) { qualityState = QualityState.Suspected; return qualityState; } return qualityState; } else if (logMiddle.WorkingProcedure == "OP10") { if (logMiddle.QualityState == (int)QualityState.NG) { qualityNoOkEnum = QualityNoOkEnum.OP10ååº¦è¶ å·®; } return qualityState; } else if (logMiddle.WorkingProcedure == "OP20") { if (logMiddle.QualityState == (int)QualityState.NG) { qualityNoOkEnum = QualityNoOkEnum.OP20å°å¤´åç´å¾è¶ å·®; } return qualityState; } else if (logMiddle.WorkingProcedure == "OP35") { if (logMiddle.QualityState == (int)QualityState.NG) { qualityNoOkEnum = QualityNoOkEnum.OP35æ»ååä¸åæ ¼; } return qualityState; } else if (logMiddle.WorkingProcedure == "OP40") { if (logMiddle.QualityState == (int)QualityState.NG) { qualityNoOkEnum = QualityNoOkEnum.OP40ååº¦è¶ å·®; } return qualityState; } return qualityState; } #endregion } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/BLL/WorkPieceLogManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ using iWare_SCADA_BusinessLogical.DLA.Dao; using iWare_SCADA_Model; using log4net; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.BLL { public class WorkPieceLogManager//: CommonService<WorkPieceLog, WorkPieceLog,DbModel> { public static List<WorkPieceLog> GetWorkPieceLog(string WorkPieceID) { using (DbModel db = new DbModel()) { //æ¥è¯¢ææ var query = db.WorkPieceLog.Where(o=>o.WorkPieceID== WorkPieceID).ToList(); return query; } } public static long InsertWorkPieceLog(WorkPieceLog workPiece) { using (DbModel db = new DbModel()) { db.WorkPieceLog.Add(workPiece); db.SaveChanges(); return workPiece.Id; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/Dao/CommonDao.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,553 @@ using System; using System.Linq; using System.Collections.Generic; using System.Data.SqlClient; using System.Data.Entity; namespace iWare_SCADA_BusinessLogical.DLA.Dao { /// <summary> /// å ¬ç¨æ¹æ³çæ½è±¡ç±» /// å¼ å± /// </summary> /// <typeparam name="T">èªå®ä¹çå®ä½ç±»</typeparam> /// <typeparam name="S">ORMä¸çå®ä½ç±»</typeparam> public abstract class CommonDao<T, S> where T : class, ICommonEntity<S> where S : class { #region éè¦å¨åç±»ä¸å®ç°çæ½è±¡æ¹æ³ /// <summary> /// è¯¥æ¹æ³è·åå¨èªå®ä¹å®ä½åORMèªå¨çæå®ä½ä¹é´å段ç对åºå ³ç³» /// </summary> protected abstract string GetColumnName(string name); /// <summary> /// è·åTä¸å±æ§åå表 /// </summary> /// <returns>Tä¸å±æ§åå表</returns> protected abstract List<string> GetColumnNames(); /// <summary> /// è¯¥æ¹æ³å°OrmçS对象转æ¢ä¸ºèªå®ä¹ç±»åTç对象 /// </summary> /// <param name="s">Ormä¸çSå®ä½çå®ä¾</param> /// <returns>èªå®ä¹çTç±»åå®ä¾</returns> protected abstract T ToEntity(S s); /// <summary> /// è¯¥æ¹æ³å°å®ä¹ç±»åTçS对象转æ¢ä¸ºèªOrmç对象 /// </summary> /// <param name="t">èªå®ä¹Tç±»åç对象</param> /// <returns>Ormä¸Sç对象</returns> protected abstract S ToOrm(T t); /// <summary> /// è¯¥æ¹æ³è·åå¨èªå®ä¹å®ä½åORMèªå¨çæå®ä½ä¹é´å段ç对åºå ³ç³» /// </summary> protected abstract string GetTableName(); #endregion #region æ ¹æ®æ¡ä»¶æ¥è¯¢ /// <summary> /// æ ¹æ®æ¡ä»¶æ¥è¯¢èªå®ä¹å®ä½Tçå表 /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">é误信æ¯</param> /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> public virtual List<T> QueryByParam(QueryParam param, DbContext dbModel) { var res = new List<T>(); var filter = param.Filter == null || param.Filter.Count <= 0 ? new Dictionary<string, object>() : param.Filter; var notfilter = param.NotFilter == null || param.NotFilter.Count <= 0 ? new Dictionary<string, object>() : param.NotFilter; var search = param.Search == null || param.Search.Count <= 0 ? new Dictionary<string, object>() : param.Search; var leqd = param.Leqd == null || param.Leqd.Count <= 0 ? new Dictionary<string, object>() : param.Leqd; var geqd = param.Geqd == null || param.Geqd.Count <= 0 ? new Dictionary<string, object>() : param.Geqd; var ltd = param.Ltd == null || param.Ltd.Count <= 0 ? new Dictionary<string, object>() : param.Ltd; var gtd = param.Gtd == null || param.Gtd.Count <= 0 ? new Dictionary<string, object>() : param.Gtd; var leq = param.Leq == null || param.Leq.Count <= 0 ? new Dictionary<string, object>() : param.Leq; var geq = param.Geq == null || param.Geq.Count <= 0 ? new Dictionary<string, object>() : param.Geq; var lt = param.Lt == null || param.Lt.Count <= 0 ? new Dictionary<string, object>() : param.Lt; var gt = param.Gt == null || param.Gt.Count <= 0 ? new Dictionary<string, object>() : param.Gt; var neq = param.Neq == null || param.Neq.Count <= 0 ? new Dictionary<string, object>() : param.Neq; var order = param.Order == null || param.Order.Count <= 0 ? new Dictionary<string, object>() { { "Id", "DESC" } } : param.Order; var sql = string.Format("SELECT * FROM {0} WHERE 1=1", GetTableName()); var sqlParams = new List<SqlParameter>(); foreach (var key in filter.Keys) { if (filter[key] != null && !string.IsNullOrEmpty(filter[key] + "")) { sqlParams.Add(new SqlParameter(("@F_" + key), filter[key])); sql += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); } } foreach (var key in notfilter.Keys) { if (notfilter[key] != null && !string.IsNullOrEmpty(notfilter[key] + "")) { sqlParams.Add(new SqlParameter(("@F_" + key), notfilter[key])); sql += string.Format(" AND {0} != {1}", GetColumnName(key), "@F_" + key); } } foreach (var key in search.Keys) { if (search[key] != null && !string.IsNullOrEmpty(search[key] + "")) { sqlParams.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); sql += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); } } foreach (var key in leqd.Keys) { if (leqd[key] != null && !string.IsNullOrEmpty(leqd[key] + "")) { sqlParams.Add(new SqlParameter("@LEQD_" + key, leqd[key])); sql += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); } } foreach (var key in geqd.Keys) { if (geqd[key] != null && !string.IsNullOrEmpty(geqd[key] + "")) { sqlParams.Add(new SqlParameter("@GEQD_" + key, geqd[key])); sql += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); } } foreach (var key in ltd.Keys) { if (ltd[key] != null && !string.IsNullOrEmpty(ltd[key] + "")) { sqlParams.Add(new SqlParameter("@LTD_" + key, ltd[key])); sql += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); } } foreach (var key in gtd.Keys) { if (gtd[key] != null && !string.IsNullOrEmpty(gtd[key] + "")) { sqlParams.Add(new SqlParameter("@GTD_" + key, gtd[key])); sql += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); } } foreach (var key in leq.Keys) { if (leq[key] != null && !string.IsNullOrEmpty(leq[key] + "")) { sqlParams.Add(new SqlParameter("@LEQ_" + key, leq[key])); sql += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); } } foreach (var key in geq.Keys) { if (geq[key] != null && !string.IsNullOrEmpty(geq[key] + "")) { sqlParams.Add(new SqlParameter("@GEQ_" + key, geq[key])); sql += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); } } foreach (var key in lt.Keys) { if (lt[key] != null && !string.IsNullOrEmpty(lt[key] + "")) { sqlParams.Add(new SqlParameter("@LT_" + key, lt[key])); sql += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); } } foreach (var key in gt.Keys) { if (gt[key] != null && !string.IsNullOrEmpty(gt[key] + "")) { sqlParams.Add(new SqlParameter("@GT_" + key, gt[key])); sql += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); } } foreach (var key in neq.Keys) { if (neq[key] != null && !string.IsNullOrEmpty(neq[key] + "")) { sqlParams.Add(new SqlParameter("@NEQ_" + key, neq[key])); sql += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); } } sql += " ORDER BY "; foreach (var key in order.Keys) { var value = string.IsNullOrEmpty(order[key].ToString()) ? "DESC" : order[key].ToString().ToUpper(); sqlParams.Add(new SqlParameter("@O_" + key, order[key])); sql += string.Format("{0} {1},", GetColumnName(key), value); } if (sql.EndsWith(",")) { sql = sql.Substring(0, sql.Length - 1); } var datas = dbModel.Database.SqlQuery<S>(sql, sqlParams.ToArray()).ToList(); datas.ForEach(x => res.Add(ToEntity(x))); return res; } #endregion #region æ ¹æ®æ¡ä»¶å页æ¥è¯¢ /// <summary> /// æ ¹æ®æ¡ä»¶å页æ¥è¯¢èªå®ä¹å®ä½Tçå表ï¼åæ¶è¿åè®°å½çæ»æ¡æ°åå½åæå¨çé¡µæ° /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <param name="totalNum">è®°å½çæ»æ¡æ°</param> /// <param name="currentPage">å½å页颿°</param> /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> public virtual List<T> QueryByParam(QueryParam param, DbContext dbModel, out int totalNum, out int currentPage) { totalNum = 0; currentPage = 1; var res = new List<T>(); var filter = param.Filter == null || param.Filter.Count <= 0 ? new Dictionary<string, object>() : param.Filter; var search = param.Search == null || param.Search.Count <= 0 ? new Dictionary<string, object>() : param.Search; var leqd = param.Leqd == null || param.Leqd.Count <= 0 ? new Dictionary<string, object>() : param.Leqd; var geqd = param.Geqd == null || param.Geqd.Count <= 0 ? new Dictionary<string, object>() : param.Geqd; var ltd = param.Ltd == null || param.Ltd.Count <= 0 ? new Dictionary<string, object>() : param.Ltd; var gtd = param.Gtd == null || param.Gtd.Count <= 0 ? new Dictionary<string, object>() : param.Gtd; var leq = param.Leq == null || param.Leq.Count <= 0 ? new Dictionary<string, object>() : param.Leq; var geq = param.Geq == null || param.Geq.Count <= 0 ? new Dictionary<string, object>() : param.Geq; var lt = param.Lt == null || param.Lt.Count <= 0 ? new Dictionary<string, object>() : param.Lt; var gt = param.Gt == null || param.Gt.Count <= 0 ? new Dictionary<string, object>() : param.Gt; var neq = param.Neq == null || param.Neq.Count <= 0 ? new Dictionary<string, object>() : param.Neq; var pageIndex = param.PageIndex < 1 ? 1 : param.PageIndex; var pageSize = param.PageSize < 1 ? 5 : param.PageSize; var order = param.Order == null || param.Order.Count <= 0 ? new Dictionary<string, object>() { { "Id", "DESC" } } : param.Order; //æ¥è¯¢æ°éçsqlè¯å¥ var sqlCount = string.Format("SELECT COUNT(*) FROM {0} WHERE 1=1", GetTableName()); //æ¥è¯¢æ°é使ç¨çsqlåæ°å表 var sqlParamsCount = new List<SqlParameter>(); var orderStr = ""; foreach (var key in order.Keys) { var value = string.IsNullOrEmpty(order[key].ToString()) ? "DESC" : order[key].ToString().ToUpper(); sqlParamsCount.Add(new SqlParameter("@O_" + key, order[key])); orderStr += string.Format("{0} {1},", GetColumnName(key), value); } if (orderStr.EndsWith(",")) { orderStr = orderStr.Substring(0, orderStr.Length - 1); } //æ¥è¯¢è®°å½å表çsqlè¯å¥ var sqlData = string.Format("SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY {0} ) AS ROWNUM from {1} where 1=1", orderStr, GetTableName()); //æ¥è¯¢è®°å½å表使ç¨çsqlåæ°å表 var sqlParamsData = new List<SqlParameter>(); foreach (var key in filter.Keys) { if (filter[key] != null && !string.IsNullOrEmpty(filter[key] + "")) { sqlParamsCount.Add(new SqlParameter("@F_" + key, filter[key])); sqlParamsData.Add(new SqlParameter("@F_" + key, filter[key])); sqlCount += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); sqlData += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); } } foreach (var key in search.Keys) { if (search[key] != null && !string.IsNullOrEmpty(search[key] + "")) { sqlParamsCount.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); sqlParamsData.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); sqlCount += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); sqlData += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); } } foreach (var key in leqd.Keys) { if (leqd[key] != null && !string.IsNullOrEmpty(leqd[key] + "")) { sqlParamsCount.Add(new SqlParameter("@LEQD_" + key, leqd[key])); sqlParamsData.Add(new SqlParameter("@LEQD_" + key, leqd[key])); sqlCount += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); sqlData += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); } } foreach (var key in geqd.Keys) { if (geqd[key] != null && !string.IsNullOrEmpty(geqd[key] + "")) { sqlParamsCount.Add(new SqlParameter("@GEQD_" + key, geqd[key])); sqlParamsData.Add(new SqlParameter("@GEQD_" + key, geqd[key])); sqlCount += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); sqlData += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); } } foreach (var key in ltd.Keys) { if (ltd[key] != null && !string.IsNullOrEmpty(ltd[key] + "")) { sqlParamsCount.Add(new SqlParameter("@LTD_" + key, ltd[key])); sqlParamsData.Add(new SqlParameter("@LTD_" + key, ltd[key])); sqlCount += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); sqlData += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); } } foreach (var key in gtd.Keys) { if (gtd[key] != null && !string.IsNullOrEmpty(gtd[key] + "")) { sqlParamsCount.Add(new SqlParameter("@GTD_" + key, gtd[key])); sqlParamsData.Add(new SqlParameter("@GTD_" + key, gtd[key])); sqlCount += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); sqlData += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); } } foreach (var key in leq.Keys) { if (leq[key] != null && !string.IsNullOrEmpty(leq[key] + "")) { sqlParamsCount.Add(new SqlParameter("@LEQ_" + key, leq[key])); sqlParamsData.Add(new SqlParameter("@LEQ_" + key, leq[key])); sqlCount += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); sqlData += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); } } foreach (var key in geq.Keys) { if (geq[key] != null && !string.IsNullOrEmpty(geq[key] + "")) { sqlParamsCount.Add(new SqlParameter("@GEQ_" + key, geq[key])); sqlParamsData.Add(new SqlParameter("@GEQ_" + key, geq[key])); sqlCount += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); sqlData += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); } } foreach (var key in lt.Keys) { if (lt[key] != null && !string.IsNullOrEmpty(lt[key] + "")) { sqlParamsCount.Add(new SqlParameter("@LT_" + key, lt[key])); sqlParamsData.Add(new SqlParameter("@LT_" + key, lt[key])); sqlCount += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); sqlData += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); } } foreach (var key in gt.Keys) { if (gt[key] != null && !string.IsNullOrEmpty(gt[key] + "")) { sqlParamsCount.Add(new SqlParameter("@GT_" + key, gt[key])); sqlParamsData.Add(new SqlParameter("@GT_" + key, gt[key])); sqlCount += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); sqlData += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); } } foreach (var key in neq.Keys) { if (neq[key] != null && !string.IsNullOrEmpty(neq[key] + "")) { sqlParamsCount.Add(new SqlParameter("@NEQ_" + key, neq[key])); sqlParamsData.Add(new SqlParameter("@NEQ_" + key, neq[key])); sqlCount += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); sqlData += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); } } totalNum = dbModel.Database.SqlQuery<int>(sqlCount, sqlParamsCount.ToArray()).ToList()[0]; int totalPage = Convert.ToInt32(totalNum / pageSize); if ((totalNum % pageSize) > 0) { totalPage += 1; } currentPage = pageIndex > totalPage ? totalPage : pageIndex; currentPage = Math.Max(currentPage,1); sqlParamsData.Add(new SqlParameter("@PI_Start", (currentPage - 1) * pageSize + 1)); sqlParamsData.Add(new SqlParameter("@PI_End", currentPage * pageSize)); sqlData += string.Format(") t Where t.ROWNUM between {0} and {1} ", "@PI_Start", "@PI_End"); var datas = dbModel.Database.SqlQuery<S>(sqlData, sqlParamsData.ToArray()).ToList(); datas.ForEach(x => res.Add(ToEntity(x))); return res; } #endregion #region æå ¥æ°ç对象 /// <summary> /// å°èªå®ä¹çå®ä½Tçå®ä¾å表æ¹éä¿åå°æ°æ®åº /// </summary> /// <param name="ts">èªå®ä¹ç±»åTçå®ä¾å表</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>ä¿åçæ°é</returns> public virtual int Save(List<T> ts, DbContext dbModel) { if (ts == null) { return 0; } ts.ForEach(x => dbModel.Set<S>().Add(ToOrm(x))); dbModel.SaveChanges(); return ts.Count; } /// <summary> /// å°èªå®ä¹çå®ä½Tçå®ä¾ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>æ°æ·»å T对象çid</returns> public virtual int Save(T t, DbContext dbModel) { var s = ToOrm(t); dbModel.Set<S>().Add(s); dbModel.SaveChanges(); return ToEntity(s).Id; } #endregion #region ä¿®æ¹å¯¹è±¡ /// <summary> /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>éæ¹å®ä½çid</returns> public virtual int Update(T t, DbContext dbModel) { var entry = dbModel.Entry<S>(ToOrm(t)); entry.State = System.Data.Entity.EntityState.Unchanged; var propStrs = GetColumnNames(); propStrs.ForEach(x => entry.Property(GetColumnName(x)).IsModified = true); dbModel.SaveChanges(); return t.Id; } /// <summary> /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>éæ¹å®ä½çid</returns> /// public virtual int Update(List<T> ts, DbContext dbModel) { foreach (var t in ts) { var entry = dbModel.Entry<S>(ToOrm(t)); entry.State = System.Data.Entity.EntityState.Unchanged; var propStrs = GetColumnNames(); propStrs.ForEach(x => entry.Property(GetColumnName(x)).IsModified = true); } dbModel.SaveChanges(); return ts.Count; } #endregion #region å é¤å¯¹è±¡ /// <summary> /// 仿°æ®åºä¸å é¤ä¸»é®ä¸ºidçè®°å½ /// </summary> /// <param name="id">éè¦å é¤å¯¹è±¡çid</param> /// <param name="msg">å¼å¸¸é误信æ¯</param> /// <returns>被å é¤å¯¹è±¡ç主é®</returns> public virtual int Delete(int id, DbContext dbModel) { var count = Delete(new List<int> { id }, dbModel); return id; } /// <summary> /// 仿°æ®åºä¸æ¹éå é¤ä¸»é®å表为idsçè®°å½ /// </summary> /// <param name="id">éè¦å é¤å¯¹è±¡çidå表</param> /// <param name="msg">å¼å¸¸é误信æ¯</param> /// <returns>被å é¤å¯¹è±¡çæ°é</returns> public virtual int Delete(List<int> ids, DbContext dbModel) { foreach (var id in ids) { var t = Activator.CreateInstance(typeof(T)); ((T)t).Id = id; var s = ToOrm((T)t); dbModel.Set<S>().Attach(s); dbModel.Set<S>().Remove(s); } dbModel.SaveChanges(); return ids.Count; } #endregion #region æ¼è£ åå ¸ /// <summary> /// å°æ»¡è¶³æ¡ä»¶çTç±»åæ¼è£ æä»¥id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå ¸ /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>以id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå ¸</returns> public virtual Dictionary<int, T> ToDictionary(QueryParam param, DbContext dbModel) { var res = new Dictionary<int, T>(); var datas = QueryByParam(param, dbModel); datas.ForEach(x => res.Add(x.Id,x)); return res; } #endregion } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/Dao/CommonService.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,404 @@ using iWare_SCADA_BusinessLogical.Properties; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Validation; using System.Linq; namespace iWare_SCADA_BusinessLogical.DLA.Dao { /// <summary> /// å ¬ç¨æ¹æ³çæ½è±¡ç±» /// å¼ å± /// </summary> /// <typeparam name="T">èªå®ä¹çå®ä½ç±»</typeparam> /// <typeparam name="S">ORMä¸çå®ä½ç±»</typeparam> public abstract class CommonService<T, S, D>:IService<T> where T : class, ICommonEntity<S> where S : class where D: DbContext,IDisposable { #region éè¦å¨åç±»ä¸å®ç°çæ½è±¡æ¹æ³ private CommonDao<T, S> CommonDao; public CommonService(CommonDao<T, S> commonDao) { this.CommonDao = commonDao; } #endregion #region æ ¹æ®æ¡ä»¶æ¥è¯¢ /// <summary> /// æ ¹æ®æ¡ä»¶æ¥è¯¢èªå®ä¹å®ä½Tçå表 /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">é误信æ¯</param> /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> public virtual List<T> QueryByParam(QueryParam param, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.QueryByParam(param, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", msg); return new List<T>(); } catch (Exception ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", ex.Message); return new List<T>(); } } } #endregion #region æ ¹æ®æ¡ä»¶å页æ¥è¯¢ /// <summary> /// æ ¹æ®æ¡ä»¶å页æ¥è¯¢èªå®ä¹å®ä½Tçå表ï¼åæ¶è¿åè®°å½çæ»æ¡æ°åå½åæå¨çé¡µæ° /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <param name="totalNum">è®°å½çæ»æ¡æ°</param> /// <param name="currentPage">å½å页颿°</param> /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> public virtual List<T> QueryByParam(QueryParam param, out string msg, out int totalNum, out int currentPage) { msg = ""; totalNum = 0; currentPage = 1; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.QueryByParam(param, dbModel, out totalNum, out currentPage); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", msg); return new List<T>(); } catch (Exception ex) { msg = ex.Message; totalNum = 0; currentPage = 1; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", ex.Message); return new List<T>(); } } } #endregion #region æå ¥æ°ç对象 /// <summary> /// å°èªå®ä¹çå®ä½Tçå®ä¾å表æ¹éä¿åå°æ°æ®åº /// </summary> /// <param name="ts">èªå®ä¹ç±»åTçå®ä¾å表</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>ä¿åçæ°é</returns> public virtual int Save(List<T> ts, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.Save(ts, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); return 0; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", ex.Message); return 0; } catch (Exception ex) { msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); return 0; } } } /// <summary> /// å°èªå®ä¹çå®ä½Tçå®ä¾ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>æ°æ·»å T对象çid</returns> public virtual int Save(T t, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.Save(t, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); return -1; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", ex.Message); return -1; } catch (Exception ex) { msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); return -1; } } } #endregion #region ä¿®æ¹å¯¹è±¡ /// <summary> /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>éæ¹å®ä½çid</returns> public virtual int Update(T t, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.Update(t, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); return -1; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "SaveUpdate", ex.Message); return -1; } catch (Exception ex) { msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); return -1; } } } /// <summary> /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº /// </summary> /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>éæ¹å®ä½çid</returns> public virtual int Update(List<T> ts, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { CommonDao.Update(ts, dbModel); return ts.Count; } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); return -1; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "SaveUpdate", ex.Message); return -1; } catch (Exception ex) { msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); return -1; } } } #endregion #region å é¤å¯¹è±¡ /// <summary> /// 仿°æ®åºä¸å é¤ä¸»é®ä¸ºidçè®°å½ /// </summary> /// <param name="id">éè¦å é¤å¯¹è±¡çid</param> /// <param name="msg">å¼å¸¸é误信æ¯</param> /// <returns>被å é¤å¯¹è±¡ç主é®</returns> public virtual int Delete(int id, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.Delete(id, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", msg); return -1; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); return -1; } catch (Exception ex) { msg = "è®°å½å·²è¢«å ¶ä»å¯¹è±¡å¼ç¨ï¼ä¸è½å é¤"; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); return -1; } } } /// <summary> /// 仿°æ®åºä¸æ¹éå é¤ä¸»é®å表为idsçè®°å½ /// </summary> /// <param name="id">éè¦å é¤å¯¹è±¡çidå表</param> /// <param name="msg">å¼å¸¸é误信æ¯</param> /// <returns>被å é¤å¯¹è±¡çæ°é</returns> public virtual int Delete(List<int> ids, out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.Delete(ids, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", msg); return 0; } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); return 0; } catch (Exception ex) { msg = "è®°å½å·²è¢«å ¶ä»å¯¹è±¡å¼ç¨ï¼ä¸è½å é¤"; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); return 0; } } } #endregion #region æ¼è£ åå ¸ /// <summary> /// å°æ»¡è¶³æ¡ä»¶çTç±»åæ¼è£ æä»¥id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå ¸ /// </summary> /// <param name="param">æ¥è¯¢æ¡ä»¶</param> /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> /// <returns>以id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå ¸</returns> public virtual Dictionary<int, T> ToDictionary(QueryParam param,out string msg) { msg = ""; var type = typeof(D); using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) { try { return CommonDao.ToDictionary(param, dbModel); } catch (DbEntityValidationException ex) { var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); msg = string.Join(", ", errs); LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "ToDictionary", msg); return new Dictionary<int, T>(); } catch (Exception ex) { msg = ex.Message; LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "ToDictionary", ex.Message); return new Dictionary<int, T>(); } } } #endregion } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/Dao/_system~.ini
DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/EFHelp.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.SqlClient; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.DLA { internal class EFHelp { } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/ICommonEntity.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ namespace iWare_SCADA_BusinessLogical { /// <summary> /// å ¬ç¨çå®ä½ç±»æ¥å£ /// å¼ å± /// </summary> /// <typeparam name="T">èªå®ä¹çå®ä½ç±»å</typeparam> /// <typeparam name="S">ORMä¸çå®ä½ç±»å</typeparam> public interface ICommonEntity<S> { int Id { get; set; } /// <summary> /// å°Tç±»åçå®ä½è½¬æ¢æOrmä¸ç对象 /// </summary> /// <returns>Ormä¸ç对象</returns> S ToOrm(); } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/IService.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@  using System.Collections.Generic; namespace iWare_SCADA_BusinessLogical { public interface IService<T> { List<T> QueryByParam(QueryParam param, out string msg); int Save(T t, out string msg); int Update(T t, out string msg); int Delete(int id, out string msg); int Delete(List<int> ids, out string msg); } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DLA/QueryParam.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,102 @@ using iWare_SCADA_BusinessLogical.Utils; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Globalization; using System.Windows.Forms; namespace iWare_SCADA_BusinessLogical { /// <summary> /// ç¨äºæ¥è¯¢çåæ° /// </summary> public class QueryParam { /// <summary> /// ç¨äºç²¾ç¡®æ¥è¯¢çåæ®µ /// </summary> public Dictionary<string, object> Filter { get; set; } /// <summary> /// ç¨äºç²¾ç¡®æ¥è¯¢ä¸çå¾çåæ®µ /// </summary> public Dictionary<string, object> NotFilter { get; set; } /// <summary> /// ç¨äºæ¨¡ç³æ¥è¯¢çåæ®µ /// </summary> public Dictionary<string, object> Search { get; set; } /// <summary> /// ç¨äºæåºæ¥è¯¢çåæ®µ /// </summary> public Dictionary<string, object> Order { get; set; } /// <summary> /// ç¨äºæ¥è¯¢æ¶é´å°äºçäºçåæ®µ /// </summary> public Dictionary<string, object> Leqd { get; set; } /// <summary> /// ç¨äºæ¥è¯¢æ¶é´å¤§äºçäºçåæ®µ /// </summary> public Dictionary<string, object> Geqd { get; set; } /// <summary> /// ç¨äºæ¥è¯¢æ¶é´å°äºçåæ®µ /// </summary> public Dictionary<string, object> Ltd { get; set; } /// <summary> /// ç¨äºæ¥è¯¢æ¶é´å¤§äºçåæ®µ /// </summary> public Dictionary<string, object> Gtd { get; set; } /// <summary> /// ç¨äºæ¥è¯¢å°äºçäºçåæ®µ /// </summary> public Dictionary<string, object> Leq { get; set; } /// <summary> /// ç¨äºæ¥è¯¢å¤§äºçäºçåæ®µ /// </summary> public Dictionary<string, object> Geq { get; set; } /// <summary> /// ç¨äºæ¥è¯¢å°äºçåæ®µ /// </summary> public Dictionary<string, object> Lt { get; set; } /// <summary> /// ç¨äºæ¥è¯¢å¤§äºçåæ®µ /// </summary> public Dictionary<string, object> Gt { get; set; } /// <summary> /// ç¨äºæ¥è¯¢å¤§äºçåæ®µ /// </summary> public Dictionary<string, object> Neq { get; set; } /// <summary> /// ç¨äºå页ï¼ç¬¬å 页 /// </summary> public int PageIndex { get; set; } /// <summary> /// ç¨äºåé¡µï¼æ¯ä¸ªé¡µé¢çæ°æ®æ°é /// </summary> public int PageSize { get; set; } } public class OP60Info { public string datetime { get; set; } public string col2 { get; set; } public string value { get; set; } public DateTime? datetimeHandle{get;set;} } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DBDataCapture/AlarmLogManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ using iWare_SCADA_Model.TableModelSC; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { public class AlarmLogManager { public static List<AlarmLog> GetAlarmLogs() { using (SCModel db = new SCModel()) { //æ¥è¯¢ææ var query = db.AlarmLog.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ return query; } } public static void UpdateAlarmLogs(AlarmLog log) { using (SCModel db = new SCModel()) { //æ¥è¯¢ææ var query = db.AlarmLog.Where(o => o.id == 1).FirstOrDefault();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ query.alarmMsg = $"æµè¯åï¼{DateTime.Now.ToString()}"; db.SaveChanges(); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP05.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,112 @@ using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP05å·¥åºçæ§æç æ è®° /// </summary> public class DataCaptureHandler_OP05 : DataCaptureHandler { public static readonly DataCaptureHandler_OP05 Instance = new DataCaptureHandler_OP05(); public List<DataCaptureConfig> _dataCaptureConfig = new List<DataCaptureConfig>(); public DataCaptureHandler_OP05() { } public override string WorkingProcedure { get { return _dataCaptureConfig.FirstOrDefault().WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.FirstOrDefault().DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.FirstOrDefault().DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { //try //{ // foreach (var dataCaptureColumnDict in dataCaptureConfig) // { // switch (dataCaptureColumnDict.DataCapturePointCode) // { // case "OP0501": // //_dataCaptureConfig = dataCaptureColumnDict; // IsCaptureflag = true; // return; // } // } //} //catch (Exception ex) //{ // SystemValue._lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); //} } public override void DataCaptureStart() { if(IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig.FirstOrDefault()); if (plcService == null) { SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°PLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.FirstOrDefault().WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { //ä¸å¡ä»£ç plcService.ReadValuePoint("", "", PLCManger.GetTypeForString(_dataCaptureConfig.FirstOrDefault().DataCaptureColumnType)); } SystemValue.lbl_Alert_OP0501 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; } catch (Exception ex) { SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); } } } else { SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP0501.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,472 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Data; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web.UI.WebControls; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP05 ææ å®ææ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ /// </summary> public class DataCaptureHandler_OP0501 : DataCaptureHandler { public static readonly DataCaptureHandler_OP0501 Instance = new DataCaptureHandler_OP0501(); public DataCaptureHandler_OP0501() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } private string CheackPath(string path,int type,int time) { var directory = Path.GetDirectoryName(path); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } if (!File.Exists(path)) { File.Create(path).Close(); } string content = ""; // åæ¥æ¥æºæ°æ® using (StreamReader reader = new StreamReader(path)) { content = reader.ReadToEnd(); Console.WriteLine("读åçå 容æ¯ï¼" + content); if (content == null || content == "") { switch (type) { case 1: content = DateTimeHelper.GetDateTime().AddYears(time).ToString();break; case 2: content = DateTimeHelper.GetDateTime().AddMonths(time).ToString();break; case 3: content = DateTimeHelper.GetDateTime().AddDays(time).ToString();break; case 4: content = DateTimeHelper.GetDateTime().AddHours(time).ToString();break; case 5: content = DateTimeHelper.GetDateTime().AddMinutes(time).ToString();break; case 6: content = DateTimeHelper.GetDateTime().AddSeconds(time).ToString();break; default: content = DateTimeHelper.GetDateTime().ToString(); break; } //content = DateTimeHelper.GetDateTime().AddMinutes(-10).ToString(); } } return content; } public override void DataCaptureStart() { if (IsCaptureflag) { //// plcè¿æ¥ //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); //if (plcService == null) //{ // SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; // return; //} //if (plcService != null && !plcService.IsConnected) //{ // plcService.Close(); // plcService.OpenService(); //} while (true) { ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); threadStatusMonitor.Threadcode = DataCapturePointCode; threadStatusMonitor.Threadcname = DataCapturePointCname; threadStatusMonitor.Threadendtime = DateTime.Now; threadStatusMonitor.Threadlastmodifytime = DateTime.Now; threadStatusMonitor.Threadstatue = 0; threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); try { ////_dataCaptureConfig //if (plcService == null || !plcService.IsConnected) //{ // SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // plcService.Close(); // plcService.OpenService(); // Thread.Sleep(100); // continue; //} //else { //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); //if (SystemValue.value_OP0501.Equals("0") && value.ToString().Equals("1")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç //读ç å®ææ²¡å¥ä¸å¡æä½ï¼è·åäºç»´ç ï¼ç¶åæ¾å°éåä¸ #region ä»å·¥æ§æºè·åç¸å ³äºç»´ç var path = ConfigHelper.GetConfigString("WorkPeiceIDPath");//æç æºæç äºç»´ç è·¯å¾ //æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ var dataTime = CheackPath(Environment.CurrentDirectory + "\\OP05-LastScapTime.txt",4,-10); var scapEndTime = DateTimeHelper.GetDateTime(); var newFiles = FileHelper.DetectNewFilesCSV(path, 60, Convert.ToDateTime(dataTime), scapEndTime); Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯å¼å§:{dataTime}"); foreach (System.IO.FileInfo file in newFiles) { Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,æä»¶å:{file.FullName}"); DataTable dt = null; dt = CSVHelper.ReadCSV(file.FullName); if (dt == null) { continue; } lock (SystemValue.lock5QRcodeList) { #region æ¸ è¿æç¼å try { //æ¸ è¿æç¼å var lstRemoveKey = SystemValue.QRcodeList .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) .Select(p => p.Key).ToList(); if (lstRemoveKey.Count > 0) { foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸ é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸ é¤åè¦æ¥æIDç¼åé误ï¼", ex); } #endregion ////çééè¦å¤ççäºç»´ç ä¿¡æ¯ //DataRow[] drArr = dt.Select(" æ«ç ç»æ='æå'"); //æ¥è¯¢ //DataTable dtNew = dt.Clone(); //for (int i = 0; i < drArr.Length; i++) //{ // var now = DateTime.Now; // var list = drArr[i]["æ¶é´"].ToString().Split(':'); // var d = new DateTime(now.Year, now.Month, now.Day, Convert.ToInt32(list[0]), Convert.ToInt32(list[1]), Convert.ToInt32(list[2]), DateTimeKind.Local); // //and æ¶é´> '19:19:34:547' // if (Convert.ToDateTime(DateTime.Now.ToShortDateString() + " " +drArr[i]["æ¶é´"]).TimeOfDay> Convert.ToDateTime(DateTime.Now.ToShortDateString() + " 19:19:34:547").TimeOfDay) // dtNew.ImportRow(drArr[i]); // //è·åå°ç工件å·å¼å¸¸ // SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); //} DataTable newDt = new DataTable(); var dates = file.Name.Split('-', '.'); var date = string.Format("{0:D4}-{1:D2}-{2:D2}", int.Parse(dates[0]), int.Parse(dates[1]), int.Parse(dates[2])); if (DateTimeHelper.GetDateTime().Date != Convert.ToDateTime(date) && DateTimeHelper.GetDateTime().AddDays(-1).Date != Convert.ToDateTime(date)) { continue; } DataRow[] filteredRows = new DataRow[dt.Rows.Count]; if (dt.Rows.Count > 0) { int j = 0; var cache = DataCache.GetCache("OP501-LastTime"); DateTime? lasttime = null; if (cache != null) { lasttime = Convert.ToDateTime(cache); } Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,å·¥ä»¶ææ°æ¶é´:{(cache==null?"æ ç¼å":cache.ToString())}"); for (int i = dt.Rows.Count - 1; i >= 0; i--) { try { string timeValue = dt.Rows[i]["æ¶é´"].ToString(); string[] timeComponents = timeValue.Split(':'); string correctedTime = string.Format("{0:D2}:{1:D2}:{2:D2}", int.Parse(timeComponents[0]), int.Parse(timeComponents[1]), int.Parse(timeComponents[2])); var newTime = date + " " + correctedTime; dt.Rows[i]["æ¶é´"] = newTime; var currrentTime = Convert.ToDateTime(dt.Rows[i]["æ¶é´"]); if (cache == null) { if (j == 0) { lasttime = currrentTime; } var oldTime = DateTime.Now.AddMinutes(-10); if (currrentTime <= oldTime) { break; } filteredRows[j] = dt.Rows[i]; } else { var cacheTime = Convert.ToDateTime(cache); if (currrentTime <= cacheTime) { break; } filteredRows[j] = dt.Rows[i]; } if (lasttime != null && lasttime < currrentTime) { lasttime = currrentTime; } j++; } catch (Exception ex) { SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´,åºç°å¼å¸¸ï¼", ex); } } filteredRows = filteredRows.Where(item=>item!=null).ToArray(); // 设置ç¼åå¼ DateTime absoluteExpiration = DateTime.Now.AddDays(30); TimeSpan slidingExpiration = TimeSpan.FromMinutes(20); if (slidingExpiration == TimeSpan.Zero) { absoluteExpiration = DateTime.Now.AddDays(30); } else { absoluteExpiration = DateTime.MaxValue; } DataCache.SetCache("OP501-LastTime", lasttime, absoluteExpiration, slidingExpiration); if (filteredRows.Count() <= 0) { return; } if (file.LastAccessTime < Convert.ToDateTime(dataTime)) continue; using (StreamWriter writer = new StreamWriter(Environment.CurrentDirectory + "\\OP05-LastScapTime.txt", false)) { dataTime = file.LastAccessTime.ToString(); writer.Write(dataTime); } Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"读åå°{filteredRows.Count()}è¡æ°æ®ï¼æ¶é´èå´æ¯{filteredRows[j-1]["æ¶é´"]}-{filteredRows[0]["æ¶é´"]}"); } //// 工件å·ï¼äºç»´ç å¼ï¼ //string WorkPieceID = dt.Rows[0][""].ToString(); //if (WorkPieceID.Length != 22) //{ // //è·åå°ç工件å·å¼å¸¸ // SystemValue.lbl_Alert_HMI01 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); //} //SystemValue.QRcodeList.Add("", DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ WorkPieceLog wplog = new WorkPieceLog(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = "OP05"; //wplog.EquipmentID = WorkingProcedure; wplog.Remarks = "cs"; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = CultureInfo.CurrentUICulture.Name; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.UpdatedUserName = "æµè¯"; wplog.IsDeleted = false; wplog.EquipmentID = "123"; wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ wplog.QualityState = 1; wplog.ProcessingDuration = 1; wplog.MachineToolState = 1; wplog.AlertType = 1; wplog.WorkPieceNumber = 1; wplog.WorkPieceOnlineTime = Convert.ToDateTime(dataTime); wplog.WorkPieceOfflineTime = Convert.ToDateTime(dataTime).AddHours(1); wplog.WorkPieceStartMachiningTime = Convert.ToDateTime(dataTime); wplog.WorkPieceEndMachiningTime = DateTime.Now.AddDays(7); wplog.KnifeEdgeNumber = 10; wplog.KnifeToolLife = 10; wplog.KnifeToolEarlyWarningLife = 3; wplog.KnifeToolSurplusLife = 10; foreach (var item in filteredRows) { Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,读å工件äºç»´ç :{item["ææ å 容"].ToString()}"); if (item == null) break; wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkPieceID = item["ææ å 容"].ToString(); wplog.OfflineTime = Convert.ToDateTime(dataTime); wplog.Remarks = item["æ¶é´"].ToString() + "|" + item["ææ å 容"].ToString() + "|" + item["ææ å 容"].ToString() + "|" + item["æ«ç ç级"].ToString() + "|" + item["æ«ç ç»æ"].ToString(); WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), null, _dataCaptureConfig.IsFeedback); threadStatusMonitor.Threadstatue = 1; } } } #endregion var fileCount = newFiles.Cast<string>().ToList(); Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ«æå®æï¼å ±æ«æå°ï¼ï¼{fileCount.Count()}ï¼ä¸ªæä»¶"); } //SystemValue.value_OP0501 = value.ToString(); } } catch (Exception ex) { SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼", ex); } finally { WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); } //线ç¨å¤ä¹ æ§è¡ä¸æ¬¡ï¼ä¸å å«ä¸å¡å¤çæ¶é´ï¼ if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(3000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } } else { SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é ç½®å¼å¸¸"); } //if (SystemValue.isStartedModel) //{ // #region ä»å·¥æ§æºè·åç¸å ³äºç»´ç // //æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å // var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime()); // foreach (System.IO.FileInfo file in newFiles) // { // var datatable = CSVHelper.ReadCSV(file.FullName); // } // lock (SystemValue.lock5QRcodeList) // { // try // { // var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); // //æ¸ è¿æç¼å // var lstRemoveKey = SystemValue.QRcodeList // .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) // .Select(p => p.Key).ToList(); // if (lstRemoveKey.Count > 0) // { // foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); // Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸ é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); // } // WorkPieceLog wplog = new WorkPieceLog(); // wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); // wplog.WorkingProcedure = WorkingProcedure; // //wplog.EquipmentID = WorkingProcedure; // wplog.Remarks = WorkingProcedure; // wplog.MonitoringPoint = DataCapturePointCode; // wplog.CreatedTime = DateTimeHelper.GetDateTime(); // wplog.CreatedUserName = DataCapturePointCode; // wplog.UpdatedTime = DateTimeHelper.GetDateTime(); // wplog.UpdatedUserName = DataCapturePointCode; // wplog.IsDeleted = false; // wplog.EquipmentID= _dataCaptureConfig.EquipmentID; // wplog.QualityState = (int)QualityState.OK; // wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ // wplog.WorkPieceID = WorkPieceID; // if (wplog.WorkPieceID.Length != 22) // {//è·åå°ç工件å·å¼å¸¸ // } // else // {//è·åå ¶ä»é ç½®çå¾ éé项 // //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) // //{ // // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); // // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ // //} // } // //读åäºç»´ç åæ´æ°æ°æ®åº // var info = WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); // } // catch (Exception ex) // { // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸ é¤åè¦æ¥æIDç¼åé误ï¼", ex); // } // if (SystemValue.QRcodeList.ContainsKey(WorkPieceID)) // { // SystemValue.QRcodeList[WorkPieceID] = DateTimeHelper.GetDateTime(); // } // else // { // SystemValue.QRcodeList.Add(WorkPieceID, DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ // } // } // #endregion //} //else //{ //} } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP0502.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,191 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// 读ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ /// </summary> public class DataCaptureHandler_OP0502 : DataCaptureHandler { public static readonly DataCaptureHandler_OP0502 Instance = new DataCaptureHandler_OP0502(); public DataCaptureHandler_OP0502() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { // plcè¿æ¥ var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP0502 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP0502.Equals("0") && value.ToString().Equals("1")) { #region ä»å·¥æ§æºè·åç¸å ³äºç»´ç //æç æºæç äºç»´ç è·¯å¾ var path = ConfigHelper.GetConfigString("WorkPeiceIDPath"); //æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ var newFiles = FileHelper.DetectNewFilesCSV(path, 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); foreach (System.IO.FileInfo file in newFiles) { DataTable dt = null; dt = CSVHelper.ReadCSV(file.FullName); if (dt == null) { continue; } lock (SystemValue.lock5QRcodeList) { #region æ¸ è¿æç¼å try { //æ¸ è¿æç¼å var lstRemoveKey = SystemValue.QRcodeList .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) .Select(p => p.Key).ToList(); if (lstRemoveKey.Count > 0) { foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸ é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸ é¤åè¦æ¥æIDç¼åé误ï¼", ex); } #endregion // 工件å·ï¼äºç»´ç å¼ï¼ string WorkPieceID = dt.Rows[0][""].ToString(); if (WorkPieceID.Length != 22) { //è·åå°ç工件å·å¼å¸¸ SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); } if (SystemValue.QRcodeList.ContainsKey(WorkPieceID)) { // å卿¸ çç¼å SystemValue.QRcodeList.Remove(WorkPieceID); } else { // ä¸åå¨åé¦PLC var col = colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode).ToList(); if (col.Count == 0) { SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ä¸åå¨,请å é ç½®æ°æ®æ¶éç¹å¯¹äºå段表信æ¯ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ä¸åå¨,请å é ç½®æ°æ®æ¶éç¹å¯¹äºå段表信æ¯ï¼"); } plcService.WriteValuePoint(col[0].DbNumber, col[0].Offset, col[0].DataCaptureColumnTabelName); } SystemValue.QRcodeList.Add("", DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ //WorkPieceLog wplog = new WorkPieceLog(); //wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //wplog.WorkingProcedure = WorkingProcedure; ////wplog.EquipmentID = WorkingProcedure; //wplog.Remarks = WorkingProcedure; //wplog.MonitoringPoint = DataCapturePointCode; //wplog.CreatedTime = DateTimeHelper.GetDateTime(); //wplog.CreatedUserName = DataCapturePointCode; //wplog.UpdatedTime = DateTimeHelper.GetDateTime(); //wplog.UpdatedUserName = DataCapturePointCode; //wplog.IsDeleted = false; //wplog.EquipmentID = _dataCaptureConfig.EquipmentID; //wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ //wplog.WorkPieceID = dt.Rows[0][""].ToString(); // 读åäºç»´ç åæ´æ°æ°æ®åº // var info = WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); } } #endregion } SystemValue.value_OP0502 = value.ToString(); } } catch (Exception ex) { SystemValue.lbl_Alert_OP0502 = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼", ex); } //线ç¨å¤ä¹ æ§è¡ä¸æ¬¡ï¼ä¸å å«ä¸å¡å¤çæ¶é´ï¼ if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } } else { SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP0503.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,151 @@ using System; using System.Collections.Generic; using iWare_SCADA_Model; using System.Linq; using System.Text; using System.Threading.Tasks; using iWare_SCADA_BusinessLogical.Utils; using System.Threading; using iWare_SCADA_BusinessLogical.BLL; namespace iWare_SCADA_BusinessLogical { /// <summary> /// 工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºï¼ä¸åæ ¼ï¼ /// </summary> public class DataCaptureHandler_OP0503 : DataCaptureHandler { public static readonly DataCaptureHandler_OP0503 Instance = new DataCaptureHandler_OP0503(); public DataCaptureHandler_OP0503() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP0503 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP0503 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP0503.Equals("0") && value.ToString().Equals("1")) { string WorkPieceID = ""; string HowToExit = ""; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "WorkPieceID": WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); break; case "HowToExit": HowToExit = plcService.WriteValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); break; default: break; } } if (WorkPieceID.Length != 22) { SystemValue.lbl_Alert_OP0503 = $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); } else { WorkPieceLog wplog = new WorkPieceLog(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkPieceID = WorkPieceID; wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.IsDeleted = false; if ("NOOK".Equals(HowToExit)) { // NOOKéåº //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); } else if("SPC".Equals(HowToExit)) { //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); } } } SystemValue.value_OP0503 = value.ToString(); } } catch (Exception ex) { SystemValue.lbl_Alert_OP0503 = $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); } //线ç¨å¤ä¹ æ§è¡ä¸æ¬¡ï¼ä¸å å«ä¸å¡å¤çæ¶é´ï¼ if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } } else { SystemValue.lbl_Alert_OP0503 = $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP0504.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,139 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// 䏿æ è®°ï¼ç¡®è®¤å·¥ä»¶OP05å·¥åºå·²å®æ /// </summary> public class DataCaptureHandler_OP0504 : DataCaptureHandler { public static readonly DataCaptureHandler_OP0504 Instance = new DataCaptureHandler_OP0504(); public DataCaptureHandler_OP0504() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP0504 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP0504 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP0504.Equals("0") && value.ToString().Equals("1")) { string WorkPieceID = ""; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "WorkPieceID": WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); break; default: break; } } if (WorkPieceID.Length != 22) { SystemValue.lbl_Alert_OP0504 = $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); } else { // OP05å·¥åºå®æ WorkPieceLog wplog = new WorkPieceLog(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkPieceID = WorkPieceID; wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.IsDeleted = false; //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); } } SystemValue.value_OP0503 = value.ToString(); } } catch (Exception ex) { SystemValue.lbl_Alert_OP0504 = $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); } if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } } else { SystemValue.lbl_Alert_OP0504 = $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP1001.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,154 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP10读ç 宿æ è®° /// </summary> public class DataCaptureHandler_OP1001: DataCaptureHandler { public static readonly DataCaptureHandler_OP1001 Instance = new DataCaptureHandler_OP1001(); public DataCaptureHandler_OP1001() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { //try //{ // foreach (var dataCaptureColumnDict in dataCaptureConfig) // { // switch (dataCaptureColumnDict.DataCapturePointCode) // { // case "OP1001": // //_dataCaptureConfig = dataCaptureColumnDict; // IsCaptureflag = true; // return; // } // } //} //catch (Exception ex) //{ // SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); //} } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP1001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP1001.Equals("0") && value.ToString().Equals("1")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç WorkPieceLog wplog = new WorkPieceLog(); wplog.WorkingProcedure = "OP10"; wplog.EquipmentID = "OP10"; wplog.Remarks = "OP10"; wplog.MonitoringPoint = "OP1001"; foreach (var col in colConfig) { switch(col.DbNumber+ col.Offset) { case "": var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); wplog.WorkPieceID = valuecol.ToString(); break; } } //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP10, plcService, _dataCaptureConfig.IsFeedback); //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ //åé¦ç»PLCï¼åå ¥ } SystemValue.value_OP1001 = value.ToString(); } SystemValue.lbl_Alert_OP1001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $"读å {DataCapturePointCode}å·¥åºä¸çº¿æ°æ®æ¶å¼å¸¸ï¼", ex); } } } else { SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(LogType.PLCOP10, $"{DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP1002.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,171 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web.UI.WebControls; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP10æµè¯å®ææ è®° ï¼OP10ï¼ /// </summary> public class DataCaptureHandler_OP1002: DataCaptureHandler { public static readonly DataCaptureHandler_OP1002 Instance = new DataCaptureHandler_OP1002(); public DataCaptureHandler_OP1002() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP1002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); threadStatusMonitor.Threadcode = DataCapturePointCode; threadStatusMonitor.Threadcname = DataCapturePointCname; threadStatusMonitor.Threadendtime = DateTime.Now; threadStatusMonitor.Threadlastmodifytime = DateTime.Now; threadStatusMonitor.Threadstatue = 0; threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP1002.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.UpdatedUserName = "èªå¨"; wplog.OnlineTime = DateTimeHelper.GetDateTime(); wplog.IsDeleted = false; wplog.QualityType = QualityType.Online.ToString(); foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { try { var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); if (set == null) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); } set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ } catch (Exception setex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); } } //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ ////æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); //foreach (System.IO.FileInfo file in newFiles) //{ // var datatable = CSVHelper.ReadCSV(file.FullName); //} //#endregion //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); threadStatusMonitor.Threadstatue = 1; } SystemValue.value_OP1002 = value.ToString(); } SystemValue.lbl_Alert_OP1002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); } finally { WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); } } } else { SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP1003.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,172 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP10æµè¯å®ææ è®° ï¼OP40ï¼ /// </summary> public class DataCaptureHandler_OP1003 : DataCaptureHandler { public static readonly DataCaptureHandler_OP1003 Instance = new DataCaptureHandler_OP1003(); public DataCaptureHandler_OP1003() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP1003 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); threadStatusMonitor.Threadcode = DataCapturePointCode; threadStatusMonitor.Threadcname = DataCapturePointCname; threadStatusMonitor.Threadendtime = DateTime.Now; threadStatusMonitor.Threadlastmodifytime = DateTime.Now; threadStatusMonitor.Threadstatue = 0; threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP1003.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.UpdatedUserName = "èªå¨"; wplog.OnlineTime = DateTimeHelper.GetDateTime(); wplog.IsDeleted = false; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { try { var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); if (set == null) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); } set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ } catch (Exception setex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); } } if (wplog.WorkPieceID.Length != 22) {//è·åå°ç工件å·å¼å¸¸ Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼"); continue; } //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ ////æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); //foreach (System.IO.FileInfo file in newFiles) //{ // var datatable = CSVHelper.ReadCSV(file.FullName); //} //#endregion //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); threadStatusMonitor.Threadstatue = 1; } SystemValue.value_OP1003 = value.ToString(); } SystemValue.lbl_Alert_OP1003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); } finally { WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); } } } else { SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP1004.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,171 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP10/OP40æ¨åºæ è®° /// </summary> public class DataCaptureHandler_OP1004: DataCaptureHandler { public static readonly DataCaptureHandler_OP1004 Instance = new DataCaptureHandler_OP1004(); public DataCaptureHandler_OP1004() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP1004 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); threadStatusMonitor.Threadcode = DataCapturePointCode; threadStatusMonitor.Threadcname = DataCapturePointCname; threadStatusMonitor.Threadendtime = DateTime.Now; threadStatusMonitor.Threadlastmodifytime = DateTime.Now; threadStatusMonitor.Threadstatue = 0; threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP1004.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç 1.åæ¨åºæ è®°ï¼2忍åºåå ï¼1ï¼nokï¼2å3ï¼spcï¼4ï¼ç¶æä¸æ ï¼ï¼3 忍åºäºç»´ç WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.UpdatedUserName = "èªå¨"; wplog.OnlineTime = DateTimeHelper.GetDateTime(); wplog.IsDeleted = false; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { try { var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); if (set == null) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); } set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ } catch (Exception setex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); } } if (wplog.OP10Flag != 1 && wplog.OP10Flag != 2 && wplog.OP10Flag != 3) {//è·åå°ç工件å·å¼å¸¸ Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®{wplog.WorkPieceID}æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"); wplog.Remarks = $"æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"; } if (wplog.OP10Flag == 1) { WorkPieceInfoManager.WorkPiecePushOff(wplog, LogType.PLCOP10); threadStatusMonitor.Threadstatue = 1; } //else if (wplog.OP10Flag == 2 || wplog.OP10Flag == 3) else { WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, LogType.PLCOP10); threadStatusMonitor.Threadstatue = 1; } } SystemValue.value_OP1004 = value.ToString(); } SystemValue.lbl_Alert_OP1004 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ æ°æ®æ¶å¼å¸¸ï¼", ex); } finally { WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); } } } else { SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/DataCaptureHandler_OP3002.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,194 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web.UI.WebControls; namespace iWare_SCADA_BusinessLogical { /// <summary> /// OP30æµé宿æ è®° /// </summary> public class DataCaptureHandler_OP3002: DataCaptureHandler { public static readonly DataCaptureHandler_OP3002 Instance = new DataCaptureHandler_OP3002(); public DataCaptureHandler_OP3002() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { //try //{ // foreach (var dataCaptureColumnDict in dataCaptureConfig) // { // switch (dataCaptureColumnDict.DataCapturePointCode) // { // case "OP3002": // //_dataCaptureConfig = dataCaptureColumnDict; // IsCaptureflag = true; // return; // } // } //} //catch (Exception ex) //{ // SystemValue._lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); //} } public override void DataCaptureStart() { if (SystemValue.isStartedModel) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.WorkPieceID = "123456"; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.IsDeleted = false; wplog.QualityType = QualityType.Online.ToString(); wplog.WorkPieceID = WorkPieceID; wplog.EquipmentID = _dataCaptureConfig.EquipmentID; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.UpdatedUserName = DataCapturePointCode; wplog.QualityState = (int)QualityState.NG; wplog.QualityStateUpdateUser = WorkingProcedure; wplog.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); wplog.QualityOP30To1 = "QualityOP30To1"; wplog.QualityOP30To2 = "QualityOP30To2"; wplog.QualityOP30To3 = "QualityOP30To3"; wplog.QualityOP30To4 = "QualityOP30To4"; wplog.QualityOP30To5 = "QualityOP30To5"; wplog.QualityOP30To6 = "QualityOP30To6"; wplog.QualityOP30To7 = "QualityOP30To7"; //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); return; } if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_OP3002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (SystemValue.value_OP3002.Equals("0") && value.ToString().Equals("1")) {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 //ä¸å¡ä»£ç WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.WorkPieceID = "123456"; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.IsDeleted = false; wplog.QualityType = QualityType.Online.ToString(); //foreach (var col in colConfig) //{ // switch(col.DbNumber+ col.Offset) // { // case "": var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); wplog.WorkPieceID = valuecol.ToString(); // break; // } //} //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); } SystemValue.value_OP3002 = value.ToString(); } SystemValue.lbl_Alert_OP3002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); } } } else { SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/HMIBeartBeatMonitor.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,189 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Data.Entity.Core.Common.CommandTrees; using System.Data.Entity.Validation; using System.Data.SqlTypes; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// HMIå¿è·³çæ§ /// </summary> public class HMIBeartBeatMonitor: DataCaptureHandler { public static readonly HMIBeartBeatMonitor Instance = new HMIBeartBeatMonitor(); public HMIBeartBeatMonitor() { } public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } Dictionary<bool, DateTime> beartBeatDic = new Dictionary<bool, DateTime>(); bool BeartBeatMonitorflag = true; while (true) { ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); threadStatusMonitor.Threadcode = DataCapturePointCode; threadStatusMonitor.Threadcname = DataCapturePointCname; threadStatusMonitor.Threadendtime = DateTime.Now; threadStatusMonitor.Threadlastmodifytime = DateTime.Now; threadStatusMonitor.Threadstatue = 0; threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); try { if(DataCapturePointCode.Equals("OP1008")) { } //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { try {//è·å设å¤plcçå¿è·³ var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (BeartBeatMonitorflag != (bool)value) {//PLCå¿è·³åå if(beartBeatDic.ContainsKey((bool)value)) { beartBeatDic[(bool)value]=DateTime.Now; } else { beartBeatDic.Add((bool)value, DateTime.Now); } } WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = _dataCaptureConfig.EquipmentID; wplog.Remarks = "HMI"; wplog.MonitoringPoint = DataCapturePointCode; var max = beartBeatDic.Max(kvp => kvp.Value); if(max==null||(DateTime.Now-max).TotalSeconds>10) {//å¿è·³10ç§æ²¡ææ´æ°è®¤ä¸ºè®¾å¤æçº¿äº wplog.IsConnect = false; } else { wplog.IsConnect = true; } //æ´æ°è®¾å¤å½åè¿æ¥æ åµ WorkPieceInfoManager.EquipmentBeartBeatMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); BeartBeatMonitorflag = (bool)value; threadStatusMonitor.Threadstatue = 1; } catch (DbEntityValidationException ex1) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}å¿è·³è¯»åå¼å¸¸1ï¼", ex1); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}å¿è·³è¯»åå¼å¸¸ï¼", ex); } try {//ååå¿è·³ foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode && o.IsFeedback == 1)) {//è·åé 置详æ 表ä¸éåå ¥å¿è·³ä¿¡æ¯ pc bool flag = true; var colflag = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if ((bool)colflag) { flag = false; } else { flag = true; } var write= plcService.WriteValuePointNew(col.DbNumber, col.Offset, flag); if(!write.result) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}æ°éå¿è·³åå ¥å¼å¸¸ï¼{write.resMsg}"); } } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}æ°éå¿è·³åå ¥å¼å¸¸ï¼", ex); } } SystemValue.lbl_Alert_HMIBeartBeatMonitor = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; } catch (Exception ex) { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºå¿è·³ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºå¿è·³å¼å¸¸ï¼", ex); } finally { WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); } } } else { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºå¿è·³ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºå¿è·³ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/HMI_WorkpieceReading.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,358 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// HML读å /// </summary> public class HMI_WorkpieceReading : DataCaptureHandler { public static readonly HMI_WorkpieceReading Instance = new HMI_WorkpieceReading(); /// <summary> /// /// </summary> public HMI_WorkpieceReading() { } /// <summary> /// /// </summary> public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } /// <summary> /// /// </summary> public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } /// <summary> /// /// </summary> public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } /// <summary> /// å·æ°æ°æ®å表 /// </summary> /// <param name="dataCaptureConfig"></param> public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } /// <summary> /// æ°æ®ééå¼å§ /// </summary> public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { switch (_dataCaptureConfig.DataCapturePointCode) { case "RHMIOP104001": SystemValue.lbl_Alert_HMIOP104001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "RHMIOP2001": SystemValue.lbl_Alert_HMIOP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "RHMIOP303501": SystemValue.lbl_Alert_HMIOP303501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "RHMIOP5001": SystemValue.lbl_Alert_HMIOP5001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "RHMIOP6001": SystemValue.lbl_Alert_HMIOP6001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; default: break; } return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; //switch (_dataCaptureConfig.DataCapturePointCode) //{ // case "RHMIOP104001": // SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // break; // case "RHMIOP2001": // SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // break; // case "RHMIOP303501": // SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // break; // case "RHMIOP5001": // SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // break; // case "RHMIOP6001": // SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; // break; // default: // break; //} plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)}"; SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)}"; SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)}"; SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)}"; SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)}"; object value1 = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, "88", 2, PLCManger.GetTypeForString("int")); string value2 = value1 == null ? "" : value1.ToString(); if ("21" .Equals(value2)) { //10ï¼æ°é读å失败 //11 :æ°é读åæå //21ï¼æ«ç æåæ è®° plcService.WriteValuePointNew(_dataCaptureConfig.DbNumber, "88", 11); object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); if (value != null) { string WorkPieceID = value.ToString().Trim(); if (WorkPieceID.Length == 22) { // æ ¹æ®å·¥ä»¶å·è·åå·¥ä»¶ä¿¡æ¯ WorkPieceInfo info = null; using (DbModel db = new DbModel()) { info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID&&o.IsDeleted==false).FirstOrDefault(); } if (info != null && info.Id > 0) { // æå¯¹åºç工件信æ¯åå ¥PLC对åºå°å foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "WorkPieceID": //plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkPieceID); break; case "WorkingProcedureCurrent": plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkingProcedureCurrent); break; case "WorkPieceState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkPieceState); break; case "QualityState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.QualityState); break; case "ReaderEndState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, 11); break; default: break; } } } else { foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "ReaderEndState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); break; default: break; } } switch (_dataCaptureConfig.DataCapturePointCode) { case "RHMIOP104001": SystemValue.lbl_Alert_HMIOP104001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; break; case "RHMIOP2001": SystemValue.lbl_Alert_HMIOP2001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; break; case "RHMIOP303501": SystemValue.lbl_Alert_HMIOP303501 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; break; case "RHMIOP5001": SystemValue.lbl_Alert_HMIOP5001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; break; case "RHMIOP6001": SystemValue.lbl_Alert_HMIOP6001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; break; default: break; } Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"); } } else { foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "ReaderEndState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); break; default: break; } } switch (_dataCaptureConfig.DataCapturePointCode) { case "RHMIOP104001": SystemValue.lbl_Alert_HMIOP104001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; break; case "RHMIOP2001": SystemValue.lbl_Alert_HMIOP2001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; break; case "RHMIOP303501": SystemValue.lbl_Alert_HMIOP303501 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; break; case "RHMIOP5001": SystemValue.lbl_Alert_HMIOP5001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; break; case "RHMIOP6001": SystemValue.lbl_Alert_HMIOP6001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; break; default: break; } Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); } } else { foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "ReaderEndState": plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); break; default: break; } } } } } if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(1000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { switch (_dataCaptureConfig.DataCapturePointCode) { case "RHMIOP104001": SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "RHMIOP2001": SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "RHMIOP303501": SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "RHMIOP5001": SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "RHMIOP6001": SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; default: break; } Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); } } } else { switch (_dataCaptureConfig.DataCapturePointCode) { case "RHMIOP104001": SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "RHMIOP2001": SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "RHMIOP303501": SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "RHMIOP5001": SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "RHMIOP6001": SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; default: break; } Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/HMI_WorkpieceWrite.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,409 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Data.Entity.Migrations; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web.UI.WebControls; namespace iWare_SCADA_BusinessLogical { /// <summary> /// HMIåå ¥ /// </summary> public class HMI_WorkpieceWrite : DataCaptureHandler { public static readonly HMI_WorkpieceWrite Instance = new HMI_WorkpieceWrite(); /// <summary> /// /// </summary> public HMI_WorkpieceWrite() { } /// <summary> /// /// </summary> public override string WorkingProcedure { get { return _dataCaptureConfig.WorkingProcedure; } } /// <summary> /// /// </summary> public override string DataCapturePointCode { get { return _dataCaptureConfig.DataCapturePointCode; } } /// <summary> /// /// </summary> public override string DataCapturePointCname { get { return _dataCaptureConfig.DataCapturePointCname; } } /// <summary> /// å·æ°æ°æ®å表 /// </summary> /// <param name="dataCaptureConfig"></param> public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) { } /// <summary> /// æ°æ®ééå¼å§ /// </summary> public override void DataCaptureStart() { if (IsCaptureflag) { var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; break; default: break; } return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } while (true) { try { if (plcService == null && !plcService.IsConnected) { switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; break; default: break; } plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { Object WorkPieceID = null; Object QualityState = null; Object CheckUpdate = null; Object QualityErrorInfo = null; int UpdateIsOK = 0; // æå¯¹åºç工件信æ¯åå ¥PLC对åºå°å foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "WorkPieceID": WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); break; case "QualityState": QualityState = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); break; case "CheckUpdate": CheckUpdate = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); //plcService.WriteValuePoint(col.DbNumber, col.Offset, 0, PLCManger.GetTypeForString(col.DataCaptureColumnType)); break; case "QualityErrorInfo": QualityErrorInfo = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); break; case "UpdateIsOK": UpdateIsOK = col.IsFeedback; break; default: break; } } if ((bool)CheckUpdate) { // 读åå å®¹æ£æ¥ StringBuilder builder = new StringBuilder(); if (WorkPieceID != null) { if (WorkPieceID.ToString().Length != 22) { builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½!"); } if (QualityState == null) { builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éç¶æä¸è½ä¸ºç©º"); } else { if ((int)QualityState != 1 && (int)QualityState != 2 && (int)QualityState != 3) { builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éç¶æã" + QualityState + "ãé误ï¼åªè½ä¸º1ï¼åæ ¼ 2ï¼ä¸åæ ¼ 3ï¼çä¼¼"); } else if ((int)QualityState == 2 || (int)QualityState == 3) { if (QualityErrorInfo == null|| string.IsNullOrEmpty(QualityErrorInfo.ToString())) { builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éä¸åæ ¼åå ä¸è½ä¸ºç©º"); } } } } if (!string.IsNullOrEmpty(builder.ToString())) { switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $"{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $"{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $"{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $"{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $"{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); break; default: break; } // æå¯¹åºç工件信æ¯åå ¥PLC对åºå°å foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "UpdateIsOK": var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, false); break; default: //plcService.WriteValuePoint(col.DbNumber, col.Offset, "", PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); break; } } Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString()); continue; } // å·¥ä»¶ä¿¡æ¯ WorkPieceInfo info = null; // å·¥ä»¶æ¥æ¶ä¿¡æ¯å±¥å WorkPieceLog wplog = new WorkPieceLog(); using (DbModel db = new DbModel()) { info = new WorkPieceInfo(); info = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID.ToString()&&o.IsDeleted==false).FirstOrDefault(); if (info == null) { switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå ¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå ¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå ¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå ¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå ¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; break; default: break; } Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥åºHMLåå ¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString()); continue; } info.QualityState = Convert.ToInt32(QualityState); info.QualityStateUpdateUser = "HMI"; info.QualityStateUpdateTime = DateTime.Now; info.QualityStateUpdateMode = "èªå¨"; info.QualityErrorInfo = QualityErrorInfo.ToString(); // åå ¥å·¥ä»¶æ¥æ¶ä¿¡æ¯å±¥å //wplog = CommonManager.Instance.GetWorkPieceID(wplog, LogType.PLCHMI04); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkPieceID = info.WorkPieceID; wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = WorkingProcedure; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.QualityState = Convert.ToInt32(QualityState); wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.IsDeleted = false; db.WorkPieceLog.Add(wplog); db.SaveChanges(); } if (UpdateIsOK == 1) { // æå¯¹åºç工件信æ¯åå ¥PLC对åºå°å foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "UpdateIsOK": var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, true); break; //case "WorkPieceID": // plcService.WriteValuePointNew(col.DbNumber, col.Offset, ""); // break; default: //plcService.WriteValuePoint(col.DbNumber, col.Offset, "", PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); break; } } } } } if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) { Thread.Sleep(5000); } else { Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); } } catch (Exception ex) { foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { switch (col.DataCaptureColumnTabelName) { case "UpdateIsOK": var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, true); break; default: break; } } switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; break; default: break; } Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); } } } else { switch (_dataCaptureConfig.DataCapturePointCode) { case "WHMIOP104002": SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "WHMIOP2002": SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "WHMIOP303502": SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "WHMIOP5002": SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; case "WHMIOP6002": SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é 置信æ¯ï¼"; break; default: break; } Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºHMLåå ¥çæ§ï¼ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é ç½®å¼å¸¸"); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/PLCDataCapture/PLCFactory.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@  using iWare_SCADA_Model; namespace iWare_SCADA_BusinessLogical { public class PLCFactory { public static PLCService GetOPCService(PLCServiceTypeEnum _OPCServiceTypeEnum, HslCommunicationParam hslcpParam) { PLCService plcService = null; switch (_OPCServiceTypeEnum) { case PLCServiceTypeEnum.Siemens_HslCommunicationService: plcService = new Siemens_HslCommunicationService(hslcpParam); break; } return plcService; } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/PLCDataCapture/PLCManger.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,132 @@ using HslCommunication.Profinet.Siemens; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using log4net; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { public class PLCManger { /// <summary> /// å®ä¾åå个PLCService /// </summary> /// <param name="_ip"></param> /// <param name="device"></param> /// <returns></returns> public static PLCService GetSinglePLCService(DataCaptureConfig dataCaptureConfig) { HslCommunicationParam hslCommunicationParam = new HslCommunicationParam() { cpu = (SiemensPLCS)dataCaptureConfig.DataCapturePLCType, ip = dataCaptureConfig.PLCIP, //rack = WareSdaStruct.Srm_Rack, //slot = WareSdaStruct.Srm_Slot, port = dataCaptureConfig.PLCPort.Value }; PLCService PLCService = PLCFactory.GetOPCService(PLCServiceTypeEnum.Siemens_HslCommunicationService, hslCommunicationParam); return PLCService; } public static Type GetTypeForString(string datatype) { switch (datatype.ToLower()) { case "int": return typeof(Int16); case "dint": return typeof(Int32); case "char": return typeof(Char); case "real": return typeof(double); //return typeof(Single); case "bool": return typeof(bool); case "string": return typeof(string); case "byte": return typeof(Byte); case "other": return typeof(string); default: return typeof(string); } } public static object GetVauleForObjectType(object vaule,TypeCode type) { switch (type) { case TypeCode.Int16: return Convert.ToInt16(vaule); case TypeCode.Int32: return Convert.ToInt32(vaule); case TypeCode.Char: return Convert.ToChar(vaule); case TypeCode.Single: return Convert.ToSingle(vaule); case TypeCode.Boolean: return Convert.ToBoolean(vaule); case TypeCode.String: return Convert.ToString(vaule); case TypeCode.Byte: return Convert.ToByte(vaule); default: return Convert.ToString(vaule); } } public static LogType GetLogTypeForWorkingProcedure(string wp) { switch(wp) { case "OP05": return LogType.PLCOP05; case "OP10": return LogType.PLCOP10; case "OP20": return LogType.PLCOP20; case "OP30": return LogType.PLCOP30; case "OP35": return LogType.PLCOP35; case "OP40": return LogType.PLCOP40; case "OP50": return LogType.PLCOP50; case "OP60": return LogType.PLCOP60; case "OP70": return LogType.PLCOP70; case "OP80": return LogType.PLCOP80; case "HMI": return LogType.PLCHMI; default: return LogType.PLCService; } } public static string GetWorkPieceIDForPLC(DataCaptureConfig _dataCaptureConfig,PLCService plcService) { try { var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); return valueid.ToString().Trim(); } catch(Exception ex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {_dataCaptureConfig.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼", ex); throw; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/PLCDataCapture/PLCService.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,140 @@  using iWare_SCADA_Model; using System; namespace iWare_SCADA_BusinessLogical { public class PLCService { public LogType _LogType; public bool IsConnected { get; set; } /// <summary> /// æå¼æå¡ /// </summary> /// <returns></returns> public virtual MessageModel OpenService() { this.IsConnected = false; return new MessageModel() { result = true }; } ///// <summary> ///// åå ¥ ///// </summary> ///// <param name="address">å°å</param> ///// <param name="value">å¼</param> ///// <returns></returns> //public virtual MessageModel WriteValuePoint(string dbNumber, string offset, object value) //{ // return new MessageModel() // { // result = true // }; //} /// <summary> /// åå ¥ /// </summary> /// <param name="fullAddress">å°å</param> /// <param name="value">å¼</param> /// <param name="proObj">屿§å¯¹è±¡</param> /// <returns></returns> public virtual MessageModel WriteValuePointNew(string dbNumber, string offset, object value) { return new MessageModel() { result = true }; } /// <summary> /// åå ¥ /// </summary> /// <param name="address">å°å</param> /// <param name="value">å¼</param> /// <param name="proObj">屿§å¯¹è±¡</param> /// <returns></returns> public virtual MessageModel WriteValuePoint(string dbNumber, string offset, object value, Object proObj) { return new MessageModel() { result = true }; } /// <summary> /// åå ¥ /// </summary> /// <param name="fullAddress">å°å</param> /// <param name="value">å¼</param> /// <param name="proObj">屿§å¯¹è±¡</param> /// <returns></returns> public virtual MessageModel WriteValuePoint(string fullAddress, object value, Object proObj) { return new MessageModel() { result = true }; } /// <summary> /// 读å /// </summary> /// <param name="dbNumber">DBåå</param> /// <param name="offset">åç§»é</param> /// <param name="type"></param> /// <returns></returns> public virtual object ReadValuePoint(string dbNumber, string offset,int stringlen, Type type = default(Type)) { return null; } /// <summary> /// 读å /// </summary> /// <param name="dbNumber">DBåå</param> /// <param name="offset">åç§»é</param> /// <param name="type"></param> /// <returns></returns> public virtual object ReadValuePoint(string dbNumber, string offset, Type type = default(Type)) { return null; } public virtual object ReadValuePointV2(string fullAddress, Type type = default(Type), int stringlen = 0) { return null; } /// <summary> /// 读å /// </summary> /// <param name="fullAddress">å°å</param> /// <param name="type"></param> /// <returns></returns> public virtual object ReadValuePoint(string fullAddress, Type type = default(Type)) { return null; } /// <summary> /// è·åæç»çDBåå°å /// </summary> /// <param name="dbNumber"></param> /// <param name="offset"></param> /// <param name="type"></param> /// <returns></returns> public virtual string GetAddress(string dbNumber, string offset, Type type = default(Type)) { return null; } /// <summary> /// å ³éè¿æ¥ /// </summary> public virtual void Close() { } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/DataCaptureHandler/PLCDataCapture/Siemens_HslCommunicationService.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,433 @@ using System; using System.Net; using System.Security.Cryptography; using HslCommunication; using HslCommunication.Profinet.Siemens; using iTextSharp.text.pdf; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; namespace iWare_SCADA_BusinessLogical { /// <summary> /// 西ä¹åPLC /// </summary> public class Siemens_HslCommunicationService : PLCService { private SiemensS7Net siemensTcpNet = null; private readonly SiemensPLCS _cpu; private readonly string _ip; private readonly int _port; public Siemens_HslCommunicationService(HslCommunicationParam hslcpParam) { _cpu = hslcpParam.cpu; _ip = hslcpParam.ip; _port = hslcpParam.port; _LogType = LogType.HslCommunicationService; } /// <summary> /// æå¼è¿æ¥ /// </summary> /// <returns></returns> public override MessageModel OpenService() { MessageModel fre = new MessageModel(); try { //åå»ºè¿æ¥å¯¹è±¡ siemensTcpNet = new SiemensS7Net(_cpu, _ip); siemensTcpNet.IpAddress = _ip; siemensTcpNet.Port = Convert.ToInt16(_port); //siemensTcpNet.Rack = Convert.ToInt16(tb_Rack.Text); //siemensTcpNet //ä¸è®°å½æ¥å¿ï¼ï¼ï¼ï¼å¦åæä»¶å¤ªå¤§å¯¼è´é®é¢ï¼ //siemensTcpNet.LogNet = new HslCommunication.LogNet.LogNetSingle("Siemens_HslCommunicationService_logs.txt"); OperateResult operateResult = siemensTcpNet.ConnectServer(); if (operateResult.IsSuccess) { base.IsConnected = true; fre.result = true; return fre; } base.IsConnected = false; fre.result = false; fre.resMsg = "æå¼å¤±è´¥," + operateResult.Message; return fre; } catch (Exception ex) { base.IsConnected = false; Log4NetHelper.WriteErrorLog(_LogType, "åå§å西é¨åPLCåºç°å¼å¸¸", ex); throw ex; } } public override MessageModel WriteValuePointNew(string dbNumber, string offset, object value) {//æ¤æ¹æ³ä¸å使ç¨è¥¿é¨åPLC if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) { throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); } MessageModel fre = new MessageModel(); OperateResult operateResult = null; //Type proObjType = proObj.GetType(); var address = GetAddress(dbNumber, offset, value.GetType()); try { if (value is bool) { bool myData = Convert.ToBoolean(value); operateResult = siemensTcpNet.Write(address, myData); } else if (value is int) { operateResult = siemensTcpNet.Write(address, Int16.Parse(value.ToString())); } else if (value is short) { operateResult = siemensTcpNet.Write(address, (short)value); } else if (value is string) { operateResult = siemensTcpNet.Write(address, (string)value); } else if (value is char) { operateResult = siemensTcpNet.Write(address, (char)value); } else if (value is double|| value is float) { operateResult = siemensTcpNet.Write(address, (double)value); } else { operateResult = siemensTcpNet.Write(address, value.ToString()); } if (!operateResult.IsSuccess) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå ¥åºç°å¼å¸¸:" + operateResult.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), null); fre.result = false; fre.resMsg = "åå ¥å¤±è´¥:" + operateResult.Message; } else { fre.result = true; //Log4NetHelper.WriteInfoLog(_LogType, String.Format("åå ¥æåï¼åå ¥å°å:{0},å¼:{1}", address, value.ToString())); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå ¥åºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), ex); fre.result = false; fre.resMsg = "åå ¥å¤±è´¥:" + ex.Message; } return fre; } /// <summary> /// åå ¥ /// </summary> /// <param name="address">å°å</param> /// <param name="value">å¼</param> /// <returns></returns> public override MessageModel WriteValuePoint(string dbNumber, string offset, object value, Object proObj) {//æ¤æ¹æ³ä¸å使ç¨è¥¿é¨åPLC if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) { throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); } MessageModel fre = new MessageModel(); OperateResult operateResult = null; Type proObjType = proObj.GetType(); var address = GetAddress(dbNumber, offset, value.GetType()); try { if (proObjType == typeof(Boolean)) {//å¸å°ç±»å bool myData = Convert.ToBoolean(value); operateResult = siemensTcpNet.Write(address, myData); } //æµ®ç¹ else if (proObjType == typeof(double) || proObjType == typeof(float)) { double MyData = Convert.ToDouble(value); operateResult = siemensTcpNet.Write(address, MyData); } //æ´æ° else if (proObjType == typeof(Int16) || proObjType == typeof(short)) { short MyData = Convert.ToInt16(value); operateResult = siemensTcpNet.Write(address, MyData);//æ¤å¤éè¦æ³¨æï¼çæ´åçæ¤å¤ä¸ç¡®å®æ¯å¦ä¼æ¥éï¼éè¦æµè¯ //operateResult = siemensTcpNet.Write(address, MyData.ConvertToUshort()); } //åæ´æ° else if (proObjType == typeof(Int32)) { int myData = Convert.ToInt32(value); operateResult = siemensTcpNet.Write(address, myData); } //Char else if (proObjType == typeof(Char)) {//charè¦è½¬æ¢æintç±»åï¼åç»PLC int myData = Convert.ToInt32(value); byte b = (byte)myData; operateResult = siemensTcpNet.Write(address, b); } //String else if (proObjType == typeof(String)) { operateResult = siemensTcpNet.Write(address, value.ToString()); } else { operateResult = siemensTcpNet.Write(address, value.ToString()); } if (!operateResult.IsSuccess) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå ¥åºç°å¼å¸¸:" + operateResult.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), null); fre.result = false; fre.resMsg = "åå ¥å¤±è´¥:" + operateResult.Message; } else { fre.result = true; //Log4NetHelper.WriteInfoLog(_LogType, String.Format("åå ¥æåï¼åå ¥å°å:{0},å¼:{1}", address, value.ToString())); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå ¥åºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), ex); fre.result = false; fre.resMsg = "åå ¥å¤±è´¥:" + ex.Message; } return fre; } public override MessageModel WriteValuePoint(string fullAddress, object value, object proObj) { var arr = fullAddress.Split(SystemValue.PLCDBADDRESS_SEPARATE); string dbNumber = arr[0]; string offset = arr[1]; return WriteValuePoint(dbNumber, offset, value, proObj); } /// <summary> /// 读å /// </summary> /// <param name="dbNumber">DBåå</param> /// <param name="offset">åç§»é</param> /// <param name="type"></param> /// <returns></returns> public override object ReadValuePoint(string dbNumber, string offset, int stringlen, Type type = default(Type)) { if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) { throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); } var address = GetAddress(dbNumber, offset, type); try { if (type == typeof(bool)) {//å¸å°è¦è½¬æ¢æ1å0åå ¥ bool MyPlcData = siemensTcpNet.ReadBool(address).Content; return MyPlcData; } //æµ®ç¹ else if (type == typeof(double) || type == typeof(float)) { var MyPlcData = siemensTcpNet.ReadFloat(address).Content; return MyPlcData; } //æ´æ° else if (type == typeof(short)) { int MyPlcData = siemensTcpNet.ReadInt16(address).Content; return MyPlcData; } //åæ´æ° else if (type == typeof(Int32)) { long MyPlcData = siemensTcpNet.ReadInt32(address).Content; return MyPlcData; } //Char else if (type == typeof(Char)) {//charè¦è½¬æ¢æintç±»åï¼åç»PLC char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); return MyPlcData.ToString(); } //String else if (type == typeof(String)) { var data = siemensTcpNet.ReadString(address, (ushort)stringlen); var MyPlcData = siemensTcpNet.ReadString(address, (ushort)stringlen).Content; //write.Message = siemensTcpNet.ReadString(write.Name).Message; //string MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } else { var MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); throw; } } /// <summary> /// 读å /// </summary> /// <param name="dbNumber">DBåå</param> /// <param name="offset">åç§»é</param> /// <param name="type"></param> /// <returns></returns> public override object ReadValuePoint(string dbNumber, string offset, Type type = default(Type)) { if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) { throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); } var address = GetAddress(dbNumber, offset, type); try { if (type == typeof(bool)) {//å¸å°è¦è½¬æ¢æ1å0åå ¥ var MyPlcData11 = siemensTcpNet.ReadBool(address); bool MyPlcData = siemensTcpNet.ReadBool(address).Content; return MyPlcData; } //æµ®ç¹ else if (type == typeof(double) || type == typeof(float)) { var MyPlcData = siemensTcpNet.ReadFloat(address).Content; return MyPlcData; } //æ´æ° else if (type == typeof(short)) { int MyPlcData = siemensTcpNet.ReadInt16(address).Content; return MyPlcData; } //åæ´æ° else if (type == typeof(Int32)) { long MyPlcData = siemensTcpNet.ReadInt32(address).Content; return MyPlcData; } //Char else if (type == typeof(Char)) {//charè¦è½¬æ¢æintç±»åï¼åç»PLC char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); return MyPlcData.ToString(); } //String else if (type == typeof(String)) { string MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } else { var MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); throw; } } public override object ReadValuePointV2(string fullAddress, Type type = default(Type), int stringlen=0) { if (fullAddress.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) { throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); } var address = fullAddress; try { if (type == typeof(bool)) {//å¸å°è¦è½¬æ¢æ1å0åå ¥ bool MyPlcData = siemensTcpNet.ReadBool(address).Content; return MyPlcData; } //æµ®ç¹ else if (type == typeof(double) || type == typeof(float)) { var MyPlcData = siemensTcpNet.ReadFloat(address).Content; return MyPlcData; } //æ´æ° else if (type == typeof(short)) { int MyPlcData = siemensTcpNet.ReadInt16(address).Content; return MyPlcData; } //åæ´æ° else if (type == typeof(Int32)) { long MyPlcData = siemensTcpNet.ReadInt32(address).Content; return MyPlcData; } //Char else if (type == typeof(Char)) {//charè¦è½¬æ¢æintç±»åï¼åç»PLC char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); return MyPlcData.ToString(); } //String else if (type == typeof(String)) { var data = siemensTcpNet.ReadString(address, (ushort)stringlen); var MyPlcData = siemensTcpNet.ReadString(address, (ushort)stringlen).Content; //write.Message = siemensTcpNet.ReadString(write.Name).Message; //string MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } else { var MyPlcData = siemensTcpNet.ReadString(address).Content; return MyPlcData == null ? "" : MyPlcData.ToString(); } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); throw; } } public override object ReadValuePoint(string fullAddress, Type type = default(Type)) { var arr = fullAddress.Split(SystemValue.PLCDBADDRESS_SEPARATE); string dbNumber = arr[0]; string offset = arr[1]; return ReadValuePoint(dbNumber, offset, type); } public override string GetAddress(string dbNumber, string offset, Type type = default(Type)) { return "DB" + dbNumber + "." + offset; } public override void Close() { if (siemensTcpNet != null) siemensTcpNet.ConnectClose(); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Properties/AssemblyInfo.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // æå ³ç¨åºéçä¸è¬ä¿¡æ¯ç±ä»¥ä¸ // æ§å¶ãæ´æ¹è¿äºç¹æ§å¼å¯ä¿®æ¹ // ä¸ç¨åºéå ³èçä¿¡æ¯ã [assembly: AssemblyTitle("iWare_SCADA_BusinessLogical")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("iWare_SCADA_BusinessLogical")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // å° ComVisible 设置为 false ä¼ä½¿æ¤ç¨åºéä¸çç±»å //对 COM ç»ä»¶ä¸å¯è§ã妿éè¦ä» COM è®¿é®æ¤ç¨åºéä¸çç±»å //è¯·å°æ¤ç±»åç ComVisible ç¹æ§è®¾ç½®ä¸º trueã [assembly: ComVisible(false)] // 妿æ¤é¡¹ç®å COM å ¬å¼ï¼åä¸å GUID ç¨äºç±»ååºç ID [assembly: Guid("32708f19-fe1a-48f5-b373-8e1c776f216c")] // ç¨åºéççæ¬ä¿¡æ¯ç±ä¸åå个å¼ç»æ: // // ä¸»çæ¬ // æ¬¡çæ¬ // çæå· // ä¿®è®¢å· // //å¯ä»¥æå®ææè¿äºå¼ï¼ä¹å¯ä»¥ä½¿ç¨âçæå·âåâ修订å·âçé»è®¤å¼ //éè¿ä½¿ç¨ "*"ï¼å¦ä¸æç¤º: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Properties/Resources.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,72 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </auto-generated> //------------------------------------------------------------------------------ namespace iWare_SCADA_BusinessLogical.Properties { using System; /// <summary> /// ä¸ä¸ªå¼ºç±»åçèµæºç±»ï¼ç¨äºæ¥æ¾æ¬å°åçå符串çã /// </summary> // æ¤ç±»æ¯ç± StronglyTypedResourceBuilder // ç±»éè¿ç±»ä¼¼äº ResGen æ Visual Studio çå·¥å ·èªå¨çæçã // è¥è¦æ·»å æç§»é¤æåï¼è¯·ç¼è¾ .ResX æä»¶ï¼ç¶åéæ°è¿è¡ ResGen // (以 /str ä½ä¸ºå½ä»¤é项)ï¼æéæ°çæ VS 项ç®ã [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// è¿åæ¤ç±»ä½¿ç¨çç¼åç ResourceManager å®ä¾ã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iWare_SCADA_BusinessLogical.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// éåå½å线ç¨ç CurrentUICulture 屿§ï¼å¯¹ /// ä½¿ç¨æ¤å¼ºç±»åèµæºç±»çææèµæºæ¥æ¾æ§è¡éåã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// æ¥æ¾ç±»ä¼¼ C:\LOG_BusinessLogical çæ¬å°åå符串ã /// </summary> internal static string LogDir { get { return ResourceManager.GetString("LogDir", resourceCulture); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Properties/Resources.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,123 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="LogDir" xml:space="preserve"> <value>C:\LOG_BusinessLogical</value> </data> </root> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Test/MyTest.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,134 @@ using HslCommunication.Profinet.Siemens; using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using Newtonsoft.Json.Linq; using Spire.Pdf.HtmlConverter; using System; using System.Collections.Generic; using System.Data.Entity.Core.Common.CommandTrees; using System.Data.Entity.Validation; using System.Data.SqlTypes; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical { /// <summary> /// æµè¯å 容 /// </summary> public class MyTest { public static readonly MyTest Instance = new MyTest(); string WorkingProcedure = ""; public MyTest() { } public void DataCaptureStart() { DataCaptureConfig _dataCaptureConfig = new DataCaptureConfig() { DataCapturePLCType = (int)SiemensPLCS.S1200, PLCIP = "192.168.216.5", PLCPort = 102, DbNumber = "1141", Offset = "746.0", DataCaptureColumnType = "string" }; var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); if (plcService == null) { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; return; } if (plcService != null && !plcService.IsConnected) { plcService.Close(); plcService.OpenService(); } var str = $"读åOP35ä¸çº¿äºç»´ç "; var str2 = $"读åOP35ä¸çº¿äºç»´ç "; Dictionary<bool, DateTime> beartBeatDic = new Dictionary<bool, DateTime>(); beartBeatDic.Add(false, DateTime.Now); bool BeartBeatMonitorflag = true; while (true) { try { //_dataCaptureConfig if (plcService == null || !plcService.IsConnected) { SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; plcService.Close(); plcService.OpenService(); Thread.Sleep(100); continue; } else { try {//è·å设å¤plcçå¿è·³ var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); Log4NetHelper.WriteInfoLog(LogType.FormMain, str + $",å¼ï¼{value}"); var value2 = plcService.ReadValuePoint("4", "920.0", PLCManger.GetTypeForString("string")); Log4NetHelper.WriteInfoLog(LogType.FormMain, str2 + $",å¼ï¼{value2}"); var str3 = $"读åOP35 SPCäºç»´ç "; var value3 = plcService.ReadValuePoint("4", "716.0", PLCManger.GetTypeForString("string")); Log4NetHelper.WriteInfoLog(LogType.FormMain, str3 + $",å¼ï¼{value3}"); var str4 = $"读åOP35 OP3502Aæµéäºç»´ç "; var value4 = plcService.ReadValuePoint("2901", "514.0", PLCManger.GetTypeForString("string")); Log4NetHelper.WriteInfoLog(LogType.FormMain, str4 + $",å¼ï¼{value4}"); var str5 = $"读åOP35 NOOKæ¨åºäºç»´ç "; var value5 = plcService.ReadValuePoint("4", "818", PLCManger.GetTypeForString("string")); Log4NetHelper.WriteInfoLog(LogType.FormMain, str5 + $",å¼ï¼{value5}"); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, str + $",读åå¼å¸¸1ï¼", ex); } } } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, str + $",å¼å¸¸ï¼", ex); } finally { Thread.Sleep(1000); } } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/CSVHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,144 @@ using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.Utils { public class CSVHelper { /// <summary> /// åå ¥CSV /// </summary> /// <param name="fileName">æä»¶å</param> /// <param name="dt">è¦åå ¥çdatatable</param> public static void WriteCSV(string fileName, DataTable dt) { FileStream fs; StreamWriter sw; string data = null; //夿æä»¶æ¯å¦åå¨,åå¨å°±ä¸å次åå ¥åå if (!File.Exists(fileName)) { fs = new FileStream(fileName, FileMode.Create, FileAccess.Write); sw = new StreamWriter(fs, Encoding.UTF8); //ååºååç§° for (int i = 0; i < dt.Columns.Count; i++) { data += dt.Columns[i].ColumnName.ToString(); if (i < dt.Columns.Count - 1) { data += ",";//ä¸é´ç¨ï¼éå¼ } } sw.WriteLine(data); } else { fs = new FileStream(fileName, FileMode.Append, FileAccess.Write); sw = new StreamWriter(fs, Encoding.UTF8); } //ååºåè¡æ°æ® for (int i = 0; i < dt.Rows.Count; i++) { data = null; for (int j = 0; j < dt.Columns.Count; j++) { data += dt.Rows[i][j].ToString(); if (j < dt.Columns.Count - 1) { data += ",";//ä¸é´ç¨ï¼éå¼ } } sw.WriteLine(data); } sw.Close(); fs.Close(); } public static List<string> ReadCSVList(string fileName) { List<string> dt = new List<string>(); FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs, Encoding.UTF8); //è®°å½æ¯æ¬¡è¯»åçä¸è¡è®°å½ string strLine = null; //éè¡è¯»åCSVæä»¶ while ((strLine = sr.ReadLine()) != null) { strLine = strLine.Trim();//å»é¤å¤´å°¾ç©ºæ ¼ dt.Add(strLine); } sr.Close(); fs.Close(); return dt; } /// <summary> /// 读åCSVæä»¶ /// </summary> /// <param name="fileName">æä»¶è·¯å¾</param> public static DataTable ReadCSV(string fileName) { DataTable dt = new DataTable(); FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs, Encoding.Default); //è®°å½æ¯æ¬¡è¯»åçä¸è¡è®°å½ string strLine = null; //è®°å½æ¯è¡è®°å½ä¸çååæ®µå 容 string[] arrayLine = null; //åé符 string[] separators = { "," }; char[] separators2 = { ',' }; //夿ï¼è¥æ¯ç¬¬ä¸æ¬¡ï¼å»ºç«è¡¨å¤´ bool isFirst = true; //éè¡è¯»åCSVæä»¶ while ((strLine = sr.ReadLine()) != null) { strLine = strLine.Trim();//å»é¤å¤´å°¾ç©ºæ ¼ //arrayLine = strLine.Split(separators, StringSplitOptions.RemoveEmptyEntries);//åéå符串ï¼è¿åæ°ç» arrayLine = strLine.Split(separators2);//åéå符串ï¼è¿åæ°ç» int dtColumns = arrayLine.Length;//åçä¸ªæ° if (isFirst) //建ç«è¡¨å¤´ { for (int i = 0; i < dtColumns; i++) { dt.Columns.Add(arrayLine[i]);//æ¯ä¸ååç§° } isFirst = false; } else //表å 容 { DataRow dataRow = dt.NewRow();//æ°å»ºä¸è¡ for (int j = 0; j < dtColumns; j++) { if(j+1> dataRow.ItemArray.Count()) { break; } dataRow[j] = arrayLine[j]; } dt.Rows.Add(dataRow);//æ·»å ä¸è¡ } } sr.Close(); fs.Close(); return dt; } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/ComboBoxHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@  using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// ComboBox帮å©ç±» /// </summary> public class ComboBoxHelper { /// <summary> /// è·å䏿æ¡çéæ©çæ°æ® /// </summary> /// <param name="cmb"></param> /// <returns></returns> public static string GetComboxSelectValue(System.Windows.Forms.ComboBox cmb, ref ListItem selProFlag) { selProFlag = (ListItem)cmb.SelectedItem; var sselProFlagValue = selProFlag.Value; return sselProFlagValue; } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/ConfigHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,106 @@ using System; using System.Configuration; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// web.configæä½ç±» /// Copyright (C) TBEA.WMS /// </summary> public sealed class ConfigHelper { /// <summary> /// å¾å°AppSettingsä¸çé ç½®åç¬¦ä¸²ä¿¡æ¯ /// </summary> /// <param name="key"></param> /// <returns></returns> public static string GetConfigString(string key) { string CacheKey = "AppSettings-" + key; object objModel = DataCache.GetCache(CacheKey); if (objModel == null) { try { objModel = ConfigurationManager.AppSettings[key]; if (objModel != null) { DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(180), TimeSpan.Zero); } } catch { } } return objModel.ToString(); } /// <summary> /// å¾å°AppSettingsä¸çé ç½®Boolä¿¡æ¯ /// </summary> /// <param name="key"></param> /// <returns></returns> public static bool GetConfigBool(string key) { bool result = false; string cfgVal = GetConfigString(key); if(null != cfgVal && string.Empty != cfgVal) { try { result = bool.Parse(cfgVal); } catch(FormatException) { // Ignore format exceptions. } } return result; } /// <summary> /// å¾å°AppSettingsä¸çé ç½®Decimalä¿¡æ¯ /// </summary> /// <param name="key"></param> /// <returns></returns> public static decimal GetConfigDecimal(string key) { decimal result = 0; string cfgVal = GetConfigString(key); if(null != cfgVal && string.Empty != cfgVal) { try { result = decimal.Parse(cfgVal); } catch(FormatException) { // Ignore format exceptions. } } return result; } /// <summary> /// å¾å°AppSettingsä¸çé ç½®intä¿¡æ¯ /// </summary> /// <param name="key"></param> /// <returns></returns> public static int GetConfigInt(string key) { int result = 0; string cfgVal = GetConfigString(key); if(null != cfgVal && string.Empty != cfgVal) { try { result = int.Parse(cfgVal); } catch(FormatException) { // Ignore format exceptions. } } return result; } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/DataCache.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,45 @@ using System; using System.Web; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// ç¼åç¸å ³çæä½ç±» /// Copyright (C) TBEA.WMS /// </summary> public class DataCache { /// <summary> /// è·åå½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ /// </summary> /// <param name="CacheKey"></param> /// <returns></returns> public static object GetCache(string CacheKey) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; return objCache[CacheKey]; } /// <summary> /// 设置å½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ /// </summary> /// <param name="CacheKey"></param> /// <param name="objObject"></param> public static void SetCache(string CacheKey, object objObject) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; objCache.Insert(CacheKey, objObject); } /// <summary> /// 设置å½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ /// </summary> /// <param name="CacheKey"></param> /// <param name="objObject"></param> public static void SetCache(string CacheKey, object objObject, DateTime absoluteExpiration,TimeSpan slidingExpiration ) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; objCache.Insert(CacheKey, objObject,null,absoluteExpiration,slidingExpiration); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/DateTimeHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,83 @@  using System; using System.Collections.Generic; using System.ComponentModel; using System.Reflection; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// æ¥æå¤çç±» /// </summary> public class DateTimeHelper { /// <summary> /// ç»ä¸æ¶é´ /// </summary> /// <returns></returns> public static DateTime GetDateTime() { return DateTime.Now; } /// <summary> /// 计ç®ä¸¤ä¸ªæ¶é´çæ¶é´å·®ï¼è¿åç§æ° /// </summary> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <param name="msg"></param> /// <returns></returns> public static int GetTimeDiffer(DateTime? startTime, DateTime? endTime, ref string msg) { if (startTime == null || endTime == null) { return 0; } TimeSpan ts = ((DateTime)endTime - (DateTime)startTime); msg = ""; if (ts.Days != 0) { msg += ts.Days + "天"; } if (ts.Hours != 0) { msg += ts.Hours + "å°æ¶"; } if (ts.Minutes != 0) { msg += ts.Minutes + "åé"; } if (ts.Seconds != 0) { msg += ts.Seconds + "ç§"; } return (int)ts.TotalSeconds; } /// <summary> /// è½¬æ¢æ¥ææ ¼å¼ä¸ºå符串 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static string ConvertToString(DateTime? dt) { if (dt == null) { return string.Empty; } return Convert.ToDateTime(dt).ToString("yyyy-MM-dd HH:mm:ss"); } /// <summary> /// è½¬æ¢æ¥ææ ¼å¼ä¸ºå符串 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static string ConvertToStringForOnlyShowTime(DateTime? dt) { if (dt == null) { return string.Empty; } return Convert.ToDateTime(dt).ToString("HH:mm:ss"); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/EntityPropHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,155 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace iWare_SCADA_BusinessLogical.Utils { public class EntityPropHelper { /// <summary> /// åå°å®ç°ä¸¤ä¸ªç±»ç对象ä¹é´ç¸å屿§çå¼çå¤å¶ /// éç¨äºåå§åæ°å®ä½ /// </summary> /// <typeparam name="D">è¿åçå®ä½</typeparam> /// <typeparam name="S">æ°æ®æºå®ä½</typeparam> /// <param name="s">æ°æ®æºå®ä½</param> /// <returns>è¿åçæ°å®ä½</returns> public static D Mapper<D, S>(S s) { D d = Activator.CreateInstance<D>(); //æé æ°å®ä¾ try { var Types = s.GetType();//è·å¾ç±»å var Typed = typeof(D); foreach (PropertyInfo sp in Types.GetProperties())//è·å¾ç±»åç屿§å段 { foreach (PropertyInfo dp in Typed.GetProperties()) { if (dp.Name == sp.Name && dp.PropertyType == sp.PropertyType && dp.Name != "Error" && dp.Name != "Item")//夿屿§åæ¯å¦ç¸å { dp.SetValue(d, sp.GetValue(s, null), null);//è·å¾så¯¹è±¡å±æ§çå¼å¤å¶ç»d对象ç屿§ } } } } catch (Exception ex) { throw ex; } return d; } } /// <summary> /// ç¨äºå±æ§å±æ§èµå¼æä½ç帮å©ç±» /// </summary> /// <typeparam name="T">å对象类</typeparam> /// <typeparam name="S">ç®æ 对象类</typeparam> public class EntityPropHelper<T,S> where T:class where S:class { /// <summary> /// å°tä¸çå个对äºç屿§å¼èµå¼å°sä¸ç¸åºç屿§ /// </summary> /// <param name="t">å对象</param> /// <param name="s">ç®æ 对象</param> /// <param name="columnMap">以Tä¸ç屿§å为é®ï¼Sä¸ç屿§å为å¼çåå ¸</param> public static void CopyProp(T t, S s, Dictionary<string,string> columnMap) { Type typeT = typeof(T); Type typeS = typeof(S); var sProps = typeS.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); var sPropDic = new Dictionary<string, PropertyInfo>(); var keys = columnMap.Keys; var values = columnMap.Values; //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ sProps.ForEach(p => { if (values.Contains(p.Name)) { sPropDic.Add(p.Name, p); } }); var tProps = typeT.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); var tPropDic = new Dictionary<string, PropertyInfo>(); //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ tProps.ForEach(p => { if (keys.Contains(p.Name)) { tPropDic.Add(p.Name, p); } }); foreach(var key in keys) { var propValue = tPropDic[key].GetValue(t, null); sPropDic[columnMap[key]].SetValue(s, propValue, null); } } ///// <summary> ///// å°sä¸çå个对äºç屿§å¼èµå¼å°tä¸ç¸åºç屿§ ///// </summary> ///// <param name="t">ç®æ 对象</param> ///// <param name="s">å对象</param> ///// <param name="columnMap">以Tä¸ç屿§å为é®ï¼Sä¸ç屿§å为å¼çåå ¸</param> //public static void CopyProp(S s,T t , Dictionary<string, string> columnMap) //{ // Type typeT = typeof(T); // Type typeS = typeof(S); // var sProps = typeS.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); // var sPropDic = new Dictionary<string, PropertyInfo>(); // var keys = columnMap.Keys; // var values = columnMap.Values; // //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ // sProps.ForEach(p => { if (values.Contains(p.Name)) { sPropDic.Add(p.Name, p); } }); // var tProps = typeT.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); // var tPropDic = new Dictionary<string, PropertyInfo>(); // //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ // tProps.ForEach(p => { if (keys.Contains(p.Name)) { tPropDic.Add(p.Name, p); } }); // foreach (var key in keys) // { // var propValue = sPropDic[columnMap[key]].GetValue(s, null); // tPropDic[key].SetValue(t, propValue, null); // } //} /// <summary> /// å°tä¸çå个对äºç屿§å¼èµå¼å°sä¸ç¸åºç屿§ /// </summary> /// <param name="t">å对象</param> /// <param name="s">ç®æ 对象</param> /// <param name="columnMap">以Tä¸ç屿§å为é®ï¼Sä¸ç屿§å为å¼çåå ¸</param> public static void CopyProp(T t, S s,List<string> propNames) { Type typeT = typeof(T); Type typeS = typeof(S); var sProps = typeS.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); var sPropDic = new Dictionary<string, PropertyInfo>(); //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ sProps.ForEach(p => { if (propNames.Contains(p.Name)) { sPropDic.Add(p.Name, p); } }); var tProps = typeT.GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); var tPropDic = new Dictionary<string, PropertyInfo>(); //éåSçææå±æ§,å°ç¬¦åä¿®æ¹çåå ¥åå ¸ä¸ tProps.ForEach(p => { if (propNames.Contains(p.Name)) { tPropDic.Add(p.Name, p); } }); foreach (var propName in propNames) { var propValue = tPropDic[propName].GetValue(t, null); sPropDic[propName].SetValue(s, propValue, null); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/EnumberHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,126 @@  using iTextSharp.text.pdf.qrcode; using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.ComponentModel; using System.Reflection; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// æä¸¾ç±» /// </summary> public class EnumberHelper { /// <summary> /// è·åè½¬æ¢æä¸¾å¼çå符串 /// </summary> /// <param name="mode"></param> /// <returns></returns> public static string GetEnumName<T>(int mode) where T : struct { T t = default(T); bool isRight = EnumberHelper.GetEnumObject<T>(mode.ToString(), out t); if (isRight) { return t.ToString(); } return ""; } ///// <summary> ///// è·åè½¬æ¢æä¸¾å¼çå符串 ///// </summary> ///// <param name="mode"></param> ///// <returns></returns> //public static T GetEnum<T>(int mode) where T : struct //{ // T t = default(T); // bool isRight = EnumberHelper.GetEnumObject<T>(mode.ToString(), out t); // if (isRight) // { // return t; // } // throw new Exception("转æ¢å¤±è´¥"); //} /// <summary> /// æ ¹æ®æä¸¾å¼è½¬æ¢æä¸¾ /// </summary> /// <typeparam name="T"></typeparam> /// <param name="enumValue"></param> /// <returns></returns> public static bool GetEnumObject<T>(string enumValue, out T t) where T : struct { bool right = Enum.TryParse(enumValue.ToString(), out t); if (right) { // éè¦éè¿æ¤æ¹æ³åæ¬¡ç¡®å®æ¯å¦æ¯æä¸¾å®é å®ä¹çå 容 if (!Enum.IsDefined(typeof(T), t)) { return false; } return true; } else { return false; } } public static T GetEnumForString<T>(string enumValue) where T : struct { T t = default(T); bool isRight = EnumberHelper.GetEnumObject<T>(enumValue, out t); return t; } /// <summary> /// æä¸¾è½¬éå /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static List<EnumberEntity> EnumToList<T>() { List<EnumberEntity> list = new List<EnumberEntity>(); foreach (var e in Enum.GetValues(typeof(T))) { EnumberEntity m = new EnumberEntity(); object[] objArr = e.GetType().GetField(e.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), true); if (objArr != null && objArr.Length > 0) { DescriptionAttribute da = objArr[0] as DescriptionAttribute; m.Desction = da.Description; } m.EnumValue = Convert.ToInt32(e); m.EnumName = e.ToString(); list.Add(m); } return list; } /// <summary> /// è·åæä¸¾çæè¿°å±æ§ /// </summary> /// <param name="enumValue">æä¸¾å¼</param> /// <returns>æä¸¾çæè¿°å±æ§</returns> public static string GetEnumDescription(Enum en) { Type type = en.GetType(); //è·åç±»å MemberInfo[] memberInfos = type.GetMember(en.ToString()); //è·åæå if (memberInfos != null && memberInfos.Length > 0) { DescriptionAttribute[] attrs = memberInfos[0].GetCustomAttributes(typeof(DescriptionAttribute), false) as DescriptionAttribute[]; //è·åæè¿°ç¹æ§ if (attrs != null && attrs.Length > 0) { return attrs[0].Description; //è¿åå½åæè¿° } } return en.ToString(); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/FileDirectoryEnumerator.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,569 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// /// </summary> /// <remarks> /// è°ç¨Win32APIæ¹æ³ FindFirstFile , FindNextFileï¼ FindClose /// </remarks> public class FileDirectoryEnumerator : System.Collections.IEnumerator { #region 屿§ /// <summary> /// å½å对象æä»¶ /// </summary> private object objCurrentObject = null; private bool bolIsEmpty = false; /// <summary> /// æ¯å¦æ¾ä¸å°æä»¶ /// </summary> public bool IsEmpty { get { return bolIsEmpty; } } private int intSearchedCount = 0; /// <summary> /// æ¾å°çæä»¶æ° /// </summary> public int SearchedCount { get { return intSearchedCount; } } private bool bolIsFile = true; /// <summary> /// æ¯å¦ä¸ºæä»¶ /// </summary> public bool IsFile { get { return bolIsFile; } } private int intLastErrorCode = 0; /// <summary> /// é误代ç Win32 /// </summary> public int LastErrorCode { get { return intLastErrorCode; } } /// <summary> /// æä»¶åç§° /// </summary> public string Name { get { if (this.objCurrentObject != null) { if (objCurrentObject is string) return (string)this.objCurrentObject; else return ((System.IO.FileSystemInfo)this.objCurrentObject).Name; } return null; } } /// <summary> /// æä»¶å±æ§ /// </summary> public System.IO.FileAttributes Attributes { get { return (System.IO.FileAttributes)myData.dwFileAttributes; } } /// <summary> /// æä»¶å建æ¶é´ /// </summary> public System.DateTime CreationTime { get { //long time = ToLong(myData.ftCreationTime_dwHighDateTime, // myData.ftCreationTime_dwLowDateTime); //System.DateTime dtm = System.DateTime.FromFileTimeUtc(time); //return dtm.ToLocalTime(); return ToDateTime(myData.ftCreationTime); } } /// <summary> /// æä»¶æåè®¿é®æ¶é´ /// </summary> public System.DateTime LastAccessTime { get { //long time = ToLong(myData.ftLastAccessTime_dwHighDateTime, // myData.ftLastAccessTime_dwLowDateTime); //System.DateTime dtm = System.DateTime.FromFileTimeUtc(time); //return dtm.ToLocalTime(); return ToDateTime(myData.ftLastAccessTime); } } /// <summary> /// æä»¶æååå ¥æ¶é´ /// </summary> public System.DateTime LastWriteTime { get { //long time = ToLong(myData.ftLastWriteTime_dwHighDateTime, // myData.ftLastWriteTime_dwLowDateTime); //System.DateTime dtm = System.DateTime.FromFileTimeUtc(time); //return dtm.ToLocalTime(); return ToDateTime(myData.ftLastWriteTime); } } /// <summary> /// æä»¶å¤§å° /// </summary> public long FileLength { get { if (this.bolIsFile) return ToLong(myData.nFileSizeHigh, myData.nFileSizeLow); else return 0; } } #endregion #region æ¥è¯¢å±æ§ private bool bolThrowIOException = true; /// <summary> /// æ¯å¦æåºå¼å¸¸ /// </summary> public bool ThrowIOException { get { return this.bolThrowIOException; } set { this.bolThrowIOException = value; } } private bool bolReturnStringType = true; /// <summary> /// è¿åç±»å /// </summary> public bool ReturnStringType { get { return bolReturnStringType; } set { bolReturnStringType = value; } } private string strSearchPattern = "*"; /// <summary> /// æ¥è¯¢æä»¶å /// </summary> public string SearchPattern { get { return strSearchPattern; } set { strSearchPattern = value; } } private string strSearchPath = null; /// <summary> /// æ¥è¯¢è·¯å¾ /// </summary> public string SearchPath { get { return strSearchPath; } set { strSearchPath = value; } } private bool bolSearchForFile = true; /// <summary> /// æ¥è¯¢æä»¶ /// </summary> public bool SearchForFile { get { return bolSearchForFile; } set { bolSearchForFile = value; } } private bool bolSearchForDirectory = true; /// <summary> /// æ¥è¯¢æä»¶å¤¹ /// </summary> public bool SearchForDirectory { get { return bolSearchForDirectory; } set { bolSearchForDirectory = value; } } //private int? searchCreationTime_High; //private int? searchCreationTime_Low; private DateTime? searchCreationTime; /// <summary> /// æ¥è¯¢æä»¶å建æ¶é´å¨è®¾ç½®æ¶é´ä¹åçæä»¶ /// </summary> public DateTime? SearchCreationTime { get { return searchCreationTime; } set { searchCreationTime = value; } } private DateTime? searchCreationEndTime; /// <summary> /// æ¥è¯¢æä»¶å建æ¶é´å¨è®¾ç½®æ¶é´ä¹åçæä»¶ /// </summary> public DateTime? SearchCreationEndTime { get { return searchCreationEndTime; } set { searchCreationEndTime = value; } } private DateTime? searchModifyTime; /// <summary> /// æ¥è¯¢æä»¶ä¿®æ¹æ¶é´å¨è®¾ç½®æ¶é´ä¹åçæä»¶ /// </summary> public DateTime? SearchModifyTime { get { return searchModifyTime; } set { searchModifyTime = value; } } private DateTime? searchModifyEndTime; /// <summary> /// æ¥è¯¢æä»¶ä¿®æ¹æ¶é´å¨è®¾ç½®æ¶é´ä¹åçæä»¶ /// </summary> public DateTime? SearchModifyEndTime { get { return searchModifyEndTime; } set { searchModifyEndTime = value; } } #endregion /// <summary> /// å ³éæä»¶ /// </summary> public void Close() { this.CloseHandler(); } #region IEnumerator /// <summary> /// å½åæä»¶ /// </summary> public object Current { get { return objCurrentObject; } } /// <summary> /// æ¥è¯¢ä¸ä¸æä»¶ /// </summary> /// <returns>æ¯å¦æå</returns> public bool MoveNext() { bool success = false; while (true) { if (this.bolStartSearchFlag) success = this.SearchNext(); else success = this.StartSearch(); if (success) { var time = ToDateTime(myData.ftCreationTime); if (searchCreationTime.HasValue) if (time <= searchCreationTime.Value) continue; if (searchCreationEndTime.HasValue) if (time > searchCreationEndTime.Value) continue; time = ToDateTime(myData.ftLastWriteTime); if (searchModifyTime.HasValue) if (time <= searchModifyTime.Value) continue; if (searchModifyEndTime.HasValue) if (time > searchModifyEndTime.Value) continue; if (this.UpdateCurrentObject()) return true; } else { this.objCurrentObject = null; return false; } } } /// <summary> /// é设 /// </summary> public void Reset() { if (this.strSearchPath == null) throw new System.ArgumentNullException("SearchPath can not null"); if (this.strSearchPattern == null || this.strSearchPattern.Length == 0) this.strSearchPattern = "*"; this.intSearchedCount = 0; this.objCurrentObject = null; this.CloseHandler(); this.bolStartSearchFlag = false; this.bolIsEmpty = false; this.intLastErrorCode = 0; } #endregion #region WIN32API //[Serializable, System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto), System.Runtime.InteropServices.BestFitMapping(false)] //private struct WIN32_FIND_DATA //{ // public int dwFileAttributes; // public int ftCreationTime_dwLowDateTime; // public int ftCreationTime_dwHighDateTime; // public int ftLastAccessTime_dwLowDateTime; // public int ftLastAccessTime_dwHighDateTime; // public int ftLastWriteTime_dwLowDateTime; // public int ftLastWriteTime_dwHighDateTime; // public int nFileSizeHigh; // public int nFileSizeLow; // public int dwReserved0; // public int dwReserved1; // [System.Runtime.InteropServices.MarshalAs // (System.Runtime.InteropServices.UnmanagedType.ByValTStr, // SizeConst = 260)] // public string cFileName; // [System.Runtime.InteropServices.MarshalAs // (System.Runtime.InteropServices.UnmanagedType.ByValTStr, // SizeConst = 14)] // public string cAlternateFileName; //} [Serializable, System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto), System.Runtime.InteropServices.BestFitMapping(false)] public struct FILETIME { public int dwLowDateTime; public int dwHighDateTime; } //[Serializable, System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto), System.Runtime.InteropServices.BestFitMapping(false)] //public struct WIN32_FIND_DATA //{ // public int dwFileAttributes; // public FILETIME ftCreationTime; // public FILETIME ftLastAccessTime; // public FILETIME ftLastWriteTime; // public int nFileSizeHigh; // public int nFileSizeLow; // public int dwOID; // [System.Runtime.InteropServices.MarshalAs // (System.Runtime.InteropServices.UnmanagedType.ByValTStr, // SizeConst = 260)] // public string cFileName; // [System.Runtime.InteropServices.MarshalAs // (System.Runtime.InteropServices.UnmanagedType.ByValTStr, // SizeConst = 14)] // public string cAlternateFileName; //} [Serializable, System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto), System.Runtime.InteropServices.BestFitMapping(false)] public struct WIN32_FIND_DATA { public int dwFileAttributes; public FILETIME ftCreationTime; public FILETIME ftLastAccessTime; public FILETIME ftLastWriteTime; public int nFileSizeHigh; public int nFileSizeLow; public int dwReserved0; public int dwReserved1; [System.Runtime.InteropServices.MarshalAs (System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)] public string cFileName; [System.Runtime.InteropServices.MarshalAs (System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 14)] public string cAlternateFileName; } [System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] private static extern IntPtr FindFirstFile(IntPtr pFileName, ref WIN32_FIND_DATA pFindFileData); [System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] private static extern bool FindNextFile(IntPtr hndFindFile, ref WIN32_FIND_DATA lpFindFileData); [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)] private static extern bool FindClose(IntPtr hndFindFile); private static long ToLong(int height, int low) { long v = (uint)height; v = v << 0x20; v = v | ((uint)low); return v; } public static DateTime ToDateTime(FILETIME time) { return DateTime.FromFileTime(ToLong(time.dwHighDateTime, time.dwLowDateTime)); } private static void WinIOError(int errorCode, string str) { switch (errorCode) { case 80: throw new System.IO.IOException("IO_FileExists :" + str); case 0x57: throw new System.IO.IOException("IOError:" + MakeHRFromErrorCode(errorCode)); case 0xce: throw new System.IO.PathTooLongException("PathTooLong:" + str); case 2: throw new System.IO.FileNotFoundException("FileNotFound:" + str); case 3: throw new System.IO.DirectoryNotFoundException("PathNotFound:" + str); case 5: throw new UnauthorizedAccessException("UnauthorizedAccess:" + str); case 0x20: throw new System.IO.IOException("IO_SharingViolation:" + str); } throw new System.IO.IOException("IOError:" + MakeHRFromErrorCode(errorCode)); } private static int MakeHRFromErrorCode(int errorCode) { return (-2147024896 | errorCode); } private static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); /// <summary> /// æ æå¥æ /// </summary> private System.IntPtr intSearchHandler = INVALID_HANDLE_VALUE; private WIN32_FIND_DATA myData = new WIN32_FIND_DATA(); /// <summary> /// æ¯å¦å·²ç»å¼å§æ¥è¯¢ /// </summary> private bool bolStartSearchFlag = false; /// <summary> /// å ³é /// </summary> private void CloseHandler() { if (this.intSearchHandler != INVALID_HANDLE_VALUE) { FindClose(this.intSearchHandler); this.intSearchHandler = INVALID_HANDLE_VALUE; } } /// <summary> /// å¼å§æ¥è¯¢ /// </summary> /// <returns></returns> private bool StartSearch() { bolStartSearchFlag = true; bolIsEmpty = false; objCurrentObject = null; intLastErrorCode = 0; string strPath = System.IO.Path.Combine(strSearchPath, this.strSearchPattern); this.CloseHandler(); intSearchHandler = FindFirstFile(System.Runtime.InteropServices.Marshal.StringToHGlobalAuto(strPath), ref myData); if (intSearchHandler == INVALID_HANDLE_VALUE) { intLastErrorCode = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); if (intLastErrorCode == 2) { bolIsEmpty = true; return false; } if (this.bolThrowIOException) WinIOError(intLastErrorCode, strSearchPath); else return false; } return true; } /// <summary> /// æ¥è¯¢ä¸ä¸æä»¶ /// </summary> /// <returns></returns> private bool SearchNext() { if (bolStartSearchFlag == false) return false; if (bolIsEmpty) return false; if (intSearchHandler == INVALID_HANDLE_VALUE) return false; intLastErrorCode = 0; if (FindNextFile(intSearchHandler, ref myData) == false) { intLastErrorCode = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); this.CloseHandler(); if (intLastErrorCode != 0 && intLastErrorCode != 0x12) { if (this.bolThrowIOException) WinIOError(intLastErrorCode, strSearchPath); else return false; } return false; } return true; } /// <summary> /// æ´æ°å½åæä»¶ä¿¡æ¯ /// </summary> /// <returns></returns> private bool UpdateCurrentObject() { if (intSearchHandler == INVALID_HANDLE_VALUE) return false; bool Result = false; this.objCurrentObject = null; if ((myData.dwFileAttributes & 0x10) == 0) { // this.bolIsFile = true; if (this.bolSearchForFile) Result = true; } else { // this.bolIsFile = false; if (this.bolSearchForDirectory) { if (myData.cFileName == "." || myData.cFileName == "..") Result = false; else Result = true; } } if (Result) { if (this.bolReturnStringType) this.objCurrentObject = myData.cFileName; else { string p = System.IO.Path.Combine(this.strSearchPath, myData.cFileName); if (this.bolIsFile) { this.objCurrentObject = new System.IO.FileInfo(p); } else { this.objCurrentObject = new System.IO.DirectoryInfo(p); } } this.intSearchedCount++; } return Result; } #endregion } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/FileHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,399 @@  using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.pdf.parser; using iWare_SCADA_BusinessLogical.Properties; using Newtonsoft.Json.Linq; using Spire.Additions.Xps.Schema; using Spire.Pdf; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; using System.Runtime; using System.Text; using Resources = iWare_SCADA_BusinessLogical.Properties.Resources; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// æä»¶å¸®å© /// </summary> public class FileHelper { private static char[] base64CodeArray = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '=' }; /// <summary> /// 夿ä¸ä¸ªæä»¶æ¯å¦æ¯å¾ç /// </summary> /// <param name="name"></param> /// <returns></returns> public static bool IsImage(string name) { var extension = System.IO.Path.GetExtension(name).ToLower(); var imageExtensions = new List<string> { ".jpg", ".png", ".ico", ".tif", ".bmp", ".gif" }; return imageExtensions.Contains(extension); } /// <summary> /// 夿ä¸ä¸ªæä»¶æ¯å¦ä¸ºpdfæä»¶ /// </summary> /// <param name="name"></param> /// <returns></returns> public static bool IsPdf(string name) { var extension = System.IO.Path.GetExtension(name).ToLower(); var pdfExtensions = new List<string> { ".pdf" }; return pdfExtensions.Contains(extension); } /// <summary> /// å°æå®è·¯å¾ä¸çæä»¶è½¬ä¸ºbyteæ°ç» /// </summary> /// <param name="path">æå®è·¯å¾</param> /// <returns></returns> public static byte[] GetBytesByFile(string path) { try { if (!File.Exists(path)) { return new byte[0]; } var fileInfo = new FileInfo(path); byte[] buff = new byte[fileInfo.Length]; var fileStream = fileInfo.OpenRead(); fileStream.Read(buff, 0, int.Parse(fileStream.Length.ToString())); fileStream.Close(); return buff; } catch (Exception ex) { LogTextHelper.WriteLog(Resources.LogDir, "FileHelper", "GetBytesByFile", ex.Message); return new byte[0]; } } /// <summary> /// å°æå®è·¯å¾ä¸çå¾ç转æbase64å符串 /// </summary> /// <param name="path"></param> /// <returns></returns> public static string GetBase64Str(string path) { try { using (MemoryStream ms1 = new MemoryStream()) { var bmp1 = new Bitmap(path); bmp1.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] arr1 = new byte[ms1.Length]; ms1.Position = 0; ms1.Read(arr1, 0, (int)ms1.Length); ms1.Close(); bmp1.Dispose(); return Convert.ToBase64String(arr1); } } catch (Exception ex) { LogTextHelper.WriteLog(Resources.LogDir, "FileHelper", "GetBytesByFile", ex.Message); return null; } } public static string GetBase64Str(Bitmap bitMap) { try { using (MemoryStream ms1 = new MemoryStream()) { bitMap.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] arr1 = new byte[ms1.Length]; ms1.Position = 0; ms1.Read(arr1, 0, (int)ms1.Length); ms1.Close(); return Convert.ToBase64String(arr1); } } catch (Exception ex) { LogTextHelper.WriteLog(Resources.LogDir, "FileHelper", "GetBytesByFile", ex.Message); return null; } } /// <summary> /// æ¯å¦base64å符串 /// </summary> /// <param name="base64Str">è¦å¤æçå符串</param> /// <param name="bytes">åç¬¦ä¸²è½¬æ¢æçåèæ°ç»</param> /// <returns></returns> public static bool IsBase64(string base64Str, out byte[] bytes) { //string strRegex = "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$"; bytes = null; if (string.IsNullOrEmpty(base64Str)) return false; else { if (base64Str.Contains(",")) base64Str = base64Str.Split(',')[1]; if (base64Str.Length % 4 != 0) return false; if (base64Str.Any(c => !base64CodeArray.Contains(c))) return false; } try { bytes = Convert.FromBase64String(base64Str); return true; } catch (FormatException) { return false; } } /// <summary> /// æbase64åç¬¦ä¸²è½¬æ¢æBitmap /// </summary> /// <param name="base64Str">è¦è½¬æ¢çbase64å符串</param> /// <returns></returns> public static Bitmap Base64ToBitmap(string base64Str) { Bitmap bitmap = null; byte[] bytes = null; try { if (IsBase64(base64Str, out bytes)) { using (MemoryStream stream = new MemoryStream(bytes)) { stream.Seek(0, SeekOrigin.Begin);//为äºé¿å ææ¶åæµæéå®ä½éè¯¯ï¼æ¾å¼å®ä¹ä¸ä¸æéä½ç½® bitmap = new Bitmap(stream); } } } catch (Exception) { bitmap = null; } return bitmap; } /// <summary> /// å 餿件夹strDirä¸nDays天以åçæä»¶ /// </summary> /// <param name="dir"></param> /// <param name="days"></param> public static void DeleteOldFiles(string dir, int days) { try { if (!Directory.Exists(dir) || days < 1) return; var now = DateTime.Now; foreach (var f in Directory.GetFileSystemEntries(dir).Where(f => File.Exists(f))) { var t = File.GetCreationTime(f); var elapsedTicks = now.Ticks - t.Ticks; var elapsedSpan = new TimeSpan(elapsedTicks); if (elapsedSpan.TotalDays > days) File.Delete(f); } } catch (Exception) { // ignored } } /// <summary> /// serch new file /// </summary> /// <returns></returns> public static System.Collections.IEnumerable DetectNewFilesCSV(string MonitorDicPath,int seconds,DateTime startTime,DateTime endTime) { FindFiles findFiles; string localpath = MonitorDicPath; findFiles = new FindFiles(); findFiles.SearchPath = localpath; findFiles.ReturnStringType = false; // findFiles.SearchPattern = "*.XML-1"; findFiles.SearchPattern = "*.csv"; findFiles.SearchForDirectory = false; findFiles.SearchForFile = true; //findFiles.SearchCreationTime = LastTime;//ä¸çäºæ¶é´ //findFiles.SearchCreationEndTime = DateTime.Now.AddMinutes(-5); //findFiles.SearchModifyTime = DateTimeHelper.GetDateTime().AddSeconds(-seconds);//ä¸çäºæ¶é´ findFiles.SearchModifyTime = startTime.AddSeconds(-seconds);//ä¸çäºæ¶é´ findFiles.SearchModifyEndTime = endTime; return findFiles; } /// <summary> /// serch new file /// </summary> /// <param name="MonitorDicPath"></param> /// <param name="seconds"></param> /// <param name="SearchPattern">*.csv</param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <returns></returns> public static System.Collections.IEnumerable DetectNewFiles(string MonitorDicPath, string SearchPattern, int seconds, DateTime startTime, DateTime endTime) { FindFiles findFiles; string localpath = MonitorDicPath; findFiles = new FindFiles(); findFiles.SearchPath = localpath; findFiles.ReturnStringType = false; // findFiles.SearchPattern = "*.XML-1"; findFiles.SearchPattern =string.IsNullOrEmpty(SearchPattern)?"*.csv": SearchPattern; findFiles.SearchForDirectory = false; findFiles.SearchForFile = true; //findFiles.SearchCreationTime = LastTime;//ä¸çäºæ¶é´ //findFiles.SearchCreationEndTime = DateTime.Now.AddMinutes(-5); //findFiles.SearchModifyTime = DateTimeHelper.GetDateTime().AddSeconds(-seconds);//ä¸çäºæ¶é´ findFiles.SearchModifyTime = startTime.AddSeconds(-seconds);//ä¸çäºæ¶é´ findFiles.SearchModifyEndTime = endTime; return findFiles; } //public static string[] ReadPdf(string path) //{ // PdfReader pdfreader = new PdfReader(path); // string text = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader, 1); // string[] words = text.Split('\n'); // pdfreader.Close(); // return words; //} public static string ReadPdfFileForSpire(string fileName, string getPdfValue) { try { //FreeSpire读åPDF PdfReader reader = new PdfReader(fileName); int iPageNum = reader.NumberOfPages; //if (iPageNum <= 10)//Spireè¶ è¿10页çä¼åºé®é¢ //{ //å®ä¾åpdfdocment对象 Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument(); //å è½½pdfæä»¶ doc.LoadFromFile(fileName); //å®ä¾åä¸ä¸ªStringBuilder 对象 StringBuilder content = new StringBuilder(); //æåPDFææé¡µé¢çææ¬ foreach (PdfPageBase page in doc.Pages) { content.Append(page.ExtractText()); } var text = content.ToString(); string[] words = text.Split('\n'); if (getPdfValue.Equals("Result")) { var list = words[0].Split(' '); //å第ä¸è¡æåä¸ä¸ªå¼å°±æ¯è´¨éç»æ var Result = list[list.Length - 1].Replace("\r", ""); return Result; } //} foreach (var item in words) { if (item.Contains(getPdfValue)) { string[] splitValue = item.Split(':'); if (splitValue.Count() > 1) { var spectlist= splitValue[1].Trim().Split(' '); return spectlist[0].Trim(); } } } } catch(Exception ex) { } return ""; } public static string ReadPdfConntent(string filePath, string getPdfValue) { List<string> lst = new List<string>(); try { string pdffilename = filePath; PdfReader pdfreader = new PdfReader(pdffilename); PdfReader.unethicalreading = true; int numberOfPages = pdfreader.NumberOfPages; //for (int i = 1; i <= numberOfPages; ++i) //{ // lst.Add(iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader,i)); // text.AppendLine(); //} var pdfReader = new PdfReader(pdffilename); StreamWriter output = new StreamWriter(new FileStream("å¤çç»æ.txt", FileMode.Create)); int pageCount = pdfReader.NumberOfPages; for (int pg = 1; pg <= pageCount; pg++) { ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy(); var value = PdfTextExtractor.GetTextFromPage(pdfReader, pg, strategy); value = value.Replace(" ", ""); Console.WriteLine(value); output.Write(value); } output.Flush(); output.Close(); string text = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader, 1); string[] words = text.Split('\n'); foreach (var item in words) { string value = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(item)); if (value.Contains(getPdfValue)) { string[] splitValue = value.Split(':'); lst.Add(splitValue[1].Trim()); } } pdfreader.Close(); return lst.First(); } catch (Exception ex) { throw ex; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/FileOperationHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,470 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Runtime.InteropServices; namespace iWare_SCADA_BusinessLogical.Utils { public static class FileOperationHelper { public static string read(string path) { FileStream fin; if (!File.Exists(path)) fin = File.Create(path); else fin = new FileStream(path, FileMode.Open, FileAccess.Read); StreamReader brin = new StreamReader(fin, Encoding.UTF8); string s = brin.ReadToEnd(); brin.Close(); return s; } //public static string oprater(string s) { return s = s + "\r\n" + textBox1.Text + "\r\n" + DateTime.Now.ToString(); } public static void save(string s, string path) { FileStream fout = new FileStream(path, FileMode.Create, FileAccess.Write); StreamWriter brout = new StreamWriter(fout, Encoding.Default); try { brout.Write(s); } catch (Exception ex) { throw new Exception(ex.Message); } finally { brout.Close(); } } public static string ReadFileToString(FileInfo file) { StreamReader sr = null; string fileContent = string.Empty; try { sr = File.OpenText(file.FullName); fileContent = sr.ReadToEnd(); } catch { } finally { if (sr != null) sr.Close(); sr = null; } return fileContent; } #region ãå é¨ç±»åå®ä¹ã private struct SHFILEOPSTRUCT { public IntPtr hwnd; //ç¶çªå£å¥æ public wFunc wFunc; //è¦æ§è¡çå¨ä½ public string pFrom; //æºæä»¶è·¯å¾ï¼å¯ä»¥æ¯å¤ä¸ªæä»¶ï¼ä»¥ç»å°¾ç¬¦å·"\0"ç»æ public string pTo; //ç®æ è·¯å¾ï¼å¯ä»¥æ¯è·¯å¾ææä»¶å public FILEOP_FLAGS fFlags; //æ å¿ï¼éå é项 public bool fAnyOperationsAborted; //æ¯å¦å¯è¢«ä¸æ public IntPtr hNameMappings; //æä»¶æ å°ååï¼å¯å¨å ¶å® Shell 彿°ä¸ä½¿ç¨ public string lpszProgressTitle; // åªå¨ FOF_SIMPLEPROGRESS æ¶ï¼æå®å¯¹è¯æ¡çæ é¢ã } private enum wFunc { FO_MOVE = 0x0001, //ç§»å¨æä»¶ FO_COPY = 0x0002, //å¤å¶æä»¶ FO_DELETE = 0x0003, //å 餿件ï¼åªæ¯ç¨pFrom FO_RENAME = 0x0004 //æä»¶éå½å } private enum FILEOP_FLAGS { FOF_MULTIDESTFILES = 0x0001, //pTo æå®äºå¤ä¸ªç®æ æä»¶ï¼è䏿¯å个ç®å½ FOF_CONFIRMMOUSE = 0x0002, FOF_SILENT = 0x0044, // 䏿¾ç¤ºä¸ä¸ªè¿åº¦å¯¹è¯æ¡ FOF_RENAMEONCOLLISION = 0x0008, // ç¢°å°ææµè§¦çååæ¶ï¼èªå¨åé åç¼ FOF_NOCONFIRMATION = 0x10, // ä¸å¯¹ç¨æ·æ¾ç¤ºæç¤º FOF_WANTMAPPINGHANDLE = 0x0020, // å¡«å hNameMappings åæ®µï¼å¿ é¡»ä½¿ç¨ SHFreeNameMappings éæ¾ FOF_ALLOWUNDO = 0x40, // å 许æ¤é FOF_FILESONLY = 0x0080, // ä½¿ç¨ *.* æ¶, åªå¯¹æä»¶æä½ FOF_SIMPLEPROGRESS = 0x0100, // ç®åè¿åº¦æ¡ï¼æå³è 䏿¾ç¤ºæä»¶åã FOF_NOCONFIRMMKDIR = 0x0200, // 建æ°ç®å½æ¶ä¸éè¦ç¨æ·ç¡®å® FOF_NOERRORUI = 0x0400, // 䏿¾ç¤ºåºéç¨æ·çé¢ FOF_NOCOPYSECURITYATTRIBS = 0x0800, // ä¸å¤å¶ NT æä»¶çå®å ¨å±æ§ FOF_NORECURSION = 0x1000 // ä¸éå½ç®å½ } #endregion ãå é¨ç±»åå®ä¹ã #region ãDllImportã [DllImport("shell32.dll")] private static extern int SHFileOperation(ref SHFILEOPSTRUCT lpFileOp); #endregion ãDllImportã #region ãå 餿件æä½ã /// <summary> /// å é¤å个æä»¶ã /// </summary> /// <param name="fileName">å é¤çæä»¶å</param> /// <param name="toRecycle">æç¤ºæ¯å°æä»¶æ¾å ¥åæ¶ç«è¿æ¯æ°¸ä¹ å é¤ï¼true-æ¾å ¥åæ¶ç«ï¼false-æ°¸ä¹ å é¤</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡ï¼true-æ¾ç¤ºï¼false-䏿¾ç¤ºãè¯¥åæ°å½æå®æ°¸ä¹ å é¤æä»¶æ¶ææ</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>æä½æ§è¡ç»ææ è¯ï¼å 餿件æåè¿å0ï¼å¦åï¼è¿åé误代ç </returns> public static int DeleteFile(string fileName, bool toRecycle, bool showDialog, bool showProgress, ref string errorMsg) { try { string fName = GetFullName(fileName); return ToDelete(fName, toRecycle, showDialog, showProgress, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } /// <summary> /// å é¤ä¸ç»æä»¶ã /// </summary> /// <param name="fileNames">å符串æ°ç»ï¼è¡¨ç¤ºä¸ç»æä»¶å</param> /// <param name="toRecycle">æç¤ºæ¯å°æä»¶æ¾å ¥åæ¶ç«è¿æ¯æ°¸ä¹ å é¤ï¼true-æ¾å ¥åæ¶ç«ï¼false-æ°¸ä¹ å é¤</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡ï¼true-æ¾ç¤ºï¼false-䏿¾ç¤ºãè¯¥åæ°å½æå®æ°¸ä¹ å é¤æä»¶æ¶ææ</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>æä½æ§è¡ç»ææ è¯ï¼å 餿件æåè¿å0ï¼å¦åï¼è¿åé误代ç </returns> public static int DeleteFiles(string[] fileNames, bool toRecycle, bool showDialog, bool showProgress, ref string errorMsg) { try { string fName = ""; foreach (string str in fileNames) { fName += GetFullName(str) + "\0"; //ç»ä»¶æä»¶ç»å符串 } return ToDelete(fName, toRecycle, showDialog, showProgress, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } #endregion ãå 餿件æä½ã #region ãç§»å¨æä»¶æä½ã /// <summary> /// ç§»å¨ä¸ä¸ªæä»¶å°æå®è·¯å¾ä¸ /// </summary> /// <param name="sourceFileName">è¦ç§»å¨çæä»¶å</param> /// <param name="destinationPath">ç§»å¨å°çç®çè·¯å¾</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡</param> /// <param name="autoRename">æç¤ºå½æä»¶åé夿¶ï¼æ¯å¦èªå¨ä¸ºæ°æä»¶å ä¸åç¼å</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç </returns> public static int MoveFile(string sourceFileName, string destinationPath, bool showDialog, bool showProgress, bool autoRename, ref string errorMsg) { try { string sfName = GetFullName(sourceFileName); string dfName = GetFullName(destinationPath); return ToMoveOrCopy(wFunc.FO_MOVE, sfName, dfName, showDialog, showProgress, autoRename, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } /// <summary> /// ç§»å¨ä¸ç»æä»¶å°æå®çè·¯å¾ä¸ /// </summary> /// <param name="sourceFileNames">è¦ç§»å¨çæä»¶åæ°ç»</param> /// <param name="destinationPath">ç§»å¨å°çç®çè·¯å¾</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡</param> /// <param name="autoRename">æç¤ºå½æä»¶åé夿¶ï¼æ¯å¦èªå¨ä¸ºæ°æä»¶å ä¸åç¼å</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç ,-200:è¡¨ç¤ºå ¶ä»å¼å¸¸</returns> public static int MoveFiles(string[] sourceFileNames, string destinationPath, bool showDialog, bool showProgress, bool autoRename, ref string errorMsg) { try { string sfName = ""; foreach (string str in sourceFileNames) { sfName += GetFullName(str) + "\0"; //ç»ä»¶æä»¶ç»å符串 } string dfName = GetFullName(destinationPath); return ToMoveOrCopy(wFunc.FO_MOVE, sfName, dfName, showDialog, showProgress, autoRename, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } #endregion ãç§»å¨æä»¶æä½ã #region ãå¤å¶æä»¶æä½ã /// <summary> /// å¤å¶ä¸ä¸ªæä»¶å°æå®çæä»¶åæè·¯å¾ /// </summary> /// <param name="sourceFileName">è¦å¤å¶çæä»¶å</param> /// <param name="destinationFileName">å¤å¶å°çç®çæä»¶åæè·¯å¾</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡</param> /// <param name="autoRename">æç¤ºå½æä»¶åé夿¶ï¼æ¯å¦èªå¨ä¸ºæ°æä»¶å ä¸åç¼å</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç ,-200:è¡¨ç¤ºå ¶ä»å¼å¸¸</returns> public static int CopyFile(string sourceFileName, string destinationFileName, bool showDialog, bool showProgress, bool autoRename, ref string errorMsg) { try { string sfName = GetFullName(sourceFileName); string dfName = GetFullName(destinationFileName); return ToMoveOrCopy(wFunc.FO_COPY, sfName, dfName, showDialog, showProgress, autoRename, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } /// <summary> /// å¤å¶ä¸ç»æä»¶å°æå®çè·¯å¾ /// </summary> /// <param name="sourceFileNames">è¦å¤å¶çæä»¶åæ°ç»</param> /// <param name="destinationPath">å¤å¶å°çç®çè·¯å¾</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡</param> /// <param name="autoRename">æç¤ºå½æä»¶åé夿¶ï¼æ¯å¦èªå¨ä¸ºæ°æä»¶å ä¸åç¼å</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç ,-200:è¡¨ç¤ºå ¶ä»å¼å¸¸</returns> public static int CopyFiles(string[] sourceFileNames, string destinationPath, bool showDialog, bool showProgress, bool autoRename, ref string errorMsg) { try { string sfName = ""; foreach (string str in sourceFileNames) { sfName += GetFullName(str) + "\0"; //ç»ä»¶æä»¶ç»å符串 } string dfName = GetFullName(destinationPath); return ToMoveOrCopy(wFunc.FO_COPY, sfName, dfName, showDialog, showProgress, autoRename, ref errorMsg); } catch (Exception ex) { errorMsg = ex.Message; return -200; } } #endregion ãå¤å¶æä»¶æä½ã #region ãéå½åæä»¶ã /// <summary> /// éå½åä¸ä¸ªæä»¶ä¸ºæ°åç§°ï¼å»ºè®®æ¨ä½¿ç¨æ´æ¹ä¾¿çMicrosoft.VisualBasic.FileSystem.ReName();æ¿æ¢è¯¥æ¹æ³ /// </summary> /// <param name="sourceFileName">è¦å¤å¶çæä»¶å</param> /// <param name="destinationFileName">å¤å¶å°çç®çæä»¶åæè·¯å¾</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç ,-200:è¡¨ç¤ºå ¶ä»å¼å¸¸</returns> [Obsolete("å»ºè®®ä½¿ç¨ Microsoft.VisualBasic.FileSystem.ReName()æ¹æ³")] public static int ReNameFile(string sourceFileName, string destinationFileName, bool showDialog, ref string errorMsg) { try { SHFILEOPSTRUCT lpFileOp = new SHFILEOPSTRUCT(); lpFileOp.wFunc = wFunc.FO_RENAME; lpFileOp.pFrom = GetFullName(sourceFileName) + "\0\0"; //å°æä»¶å以ç»å°¾å符"\0\0"ç»æ lpFileOp.pTo = GetFullName(destinationFileName) + "\0\0"; lpFileOp.fFlags = FILEOP_FLAGS.FOF_NOERRORUI; if (!showDialog) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_NOCONFIRMATION; //设å®ä¸æ¾ç¤ºæç¤ºå¯¹è¯æ¡ lpFileOp.fAnyOperationsAborted = true; int n = SHFileOperation(ref lpFileOp); if (n == 0) return 0; string tmp = GetErrorString(n); errorMsg = string.Format("{0}({1})", tmp, sourceFileName); return n; } catch (Exception ex) { errorMsg = ex.Message; return -200; } } /// <summary> /// å©ç¨Microsoft.VisualBasic.FileSystem.ReName()æ¹æ³å®ç° /// </summary> /// <param name="filePath"></param> /// <param name="newFileName"></param> public static void ReNameFile(string filePath, string newFileName) { try { string extensName = Path.GetExtension(filePath); string newName = newFileName + extensName; Microsoft.VisualBasic.FileIO.FileSystem.RenameFile(filePath, newName); } catch (Exception ex) { throw ex; } } #endregion ãéå½åæä»¶ã /// <summary> /// å é¤å个æå¤ä¸ªæä»¶ /// </summary> /// <param name="fileName">å é¤çæä»¶åï¼å¦ææ¯å¤ä¸ªæä»¶ï¼æä»¶åä¹é´ä»¥å符串ç»å°¾ç¬¦'\0'éå¼</param> /// <param name="toRecycle">æç¤ºæ¯å°æä»¶æ¾å ¥åæ¶ç«è¿æ¯æ°¸ä¹ å é¤ï¼true-æ¾å ¥åæ¶ç«ï¼false-æ°¸ä¹ å é¤</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å é¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡ï¼true-æ¾ç¤ºï¼false-䏿¾ç¤ºãè¯¥åæ°å½æå®æ°¸ä¹ å é¤æä»¶æ¶ææ</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>æä½æ§è¡ç»ææ è¯ï¼å 餿件æåè¿å0ï¼å¦åï¼è¿åé误代ç </returns> private static int ToDelete(string fileName, bool toRecycle, bool showDialog, bool showProgress, ref string errorMsg) { SHFILEOPSTRUCT lpFileOp = new SHFILEOPSTRUCT(); lpFileOp.wFunc = wFunc.FO_DELETE; lpFileOp.pFrom = fileName + "\0"; //å°æä»¶å以ç»å°¾å符"\0"ç»æ lpFileOp.fFlags = FILEOP_FLAGS.FOF_NOERRORUI; if (toRecycle) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_ALLOWUNDO; //设å®å é¤å°åæ¶ç« if (!showDialog) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_NOCONFIRMATION; //设å®ä¸æ¾ç¤ºæç¤ºå¯¹è¯æ¡ if (!showProgress) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_SILENT; //设å®ä¸æ¾ç¤ºè¿åº¦å¯¹è¯æ¡ lpFileOp.fAnyOperationsAborted = true; int n = SHFileOperation(ref lpFileOp); if (n == 0) return 0; string tmp = GetErrorString(n); //.av æä»¶æ£å¸¸å é¤äºä½ä¹æç¤º 402 é误ï¼ä¸ç¥é为ä»ä¹ãå±è½ä¹ã if ((fileName.ToLower().EndsWith(".av") && n.ToString("X") == "402")) return 0; errorMsg = string.Format("{0}({1})", tmp, fileName); return n; } /// <summary> /// ç§»å¨æå¤å¶ä¸ä¸ªæå¤ä¸ªæä»¶å°æå®è·¯å¾ä¸ /// </summary> /// <param name="flag">æä½ç±»åï¼æ¯ç§»å¨æä½è¿æ¯å¤å¶æä½</param> /// <param name="sourceFileName">è¦ç§»å¨æå¤å¶çæä»¶åï¼å¦ææ¯å¤ä¸ªæä»¶ï¼æä»¶åä¹é´ä»¥å符串ç»å°¾ç¬¦'\0'éå¼</param> /// <param name="destinationFileName">ç§»å¨å°çç®çä½ç½®</param> /// <param name="showDialog">æç¤ºæ¯å¦æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼true-æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼false-䏿¾ç¤ºç¡®è®¤å¯¹è¯æ¡</param> /// <param name="showProgress">æç¤ºæ¯å¦æ¾ç¤ºè¿åº¦å¯¹è¯æ¡</param> /// <param name="autoRename">æç¤ºå½æä»¶åé夿¶ï¼æ¯å¦èªå¨ä¸ºæ°æä»¶å ä¸åç¼å</param> /// <param name="errorMsg">åé¦éè¯¯æ¶æ¯çå符串</param> /// <returns>è¿åç§»å¨æä½æ¯å¦æåçæ è¯ï¼æåè¿å0ï¼å¤±è´¥è¿åé误代ç </returns> private static int ToMoveOrCopy(wFunc flag, string sourceFileName, string destinationFileName, bool showDialog, bool showProgress, bool autoRename, ref string errorMsg) { SHFILEOPSTRUCT lpFileOp = new SHFILEOPSTRUCT(); lpFileOp.wFunc = flag; lpFileOp.pFrom = sourceFileName + "\0"; //å°æä»¶å以ç»å°¾å符"\0\0"ç»æ lpFileOp.pTo = destinationFileName + "\0\0"; lpFileOp.fFlags = FILEOP_FLAGS.FOF_NOERRORUI; lpFileOp.fFlags |= FILEOP_FLAGS.FOF_NOCONFIRMMKDIR; //æå®å¨éè¦æ¶å¯ä»¥ç´æ¥åå»ºè·¯å¾ if (!showDialog) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_NOCONFIRMATION; //设å®ä¸æ¾ç¤ºæç¤ºå¯¹è¯æ¡ if (!showProgress) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_SILENT; //设å®ä¸æ¾ç¤ºè¿åº¦å¯¹è¯æ¡ if (autoRename) lpFileOp.fFlags |= FILEOP_FLAGS.FOF_RENAMEONCOLLISION; //èªå¨ä¸ºéåæä»¶æ·»å åç§°åç¼ lpFileOp.fAnyOperationsAborted = true; int n = SHFileOperation(ref lpFileOp); if (n == 0) return 0; string tmp = GetErrorString(n); errorMsg = string.Format("{0}({1})", tmp, sourceFileName); return n; } /// <summary> /// è·åä¸ä¸ªæä»¶çå ¨å /// </summary> /// <param name="fileName">æä»¶å</param> /// <returns>è¿åçææä»¶ç宿´è·¯å¾å</returns> private static string GetFullName(string fileName) { System.IO.FileInfo fi = new System.IO.FileInfo(fileName); return fi.FullName; } /// <summary> /// è§£éé误代ç /// </summary> /// <param name="n">代ç å·</param> /// <returns>è¿åå ³äºé误代ç çæåæè¿°</returns> private static string GetErrorString(int n) { if (n == 0) return string.Empty; switch (n) { case 2: return "ç³»ç»æ¾ä¸å°æå®çæä»¶ã"; case 7: return "å卿§å¶åè¢«éæ¯ãæ¨æ¯å¦éæ©çâåæ¶âæä½ï¼"; case 113: return "æä»¶å·²åå¨ï¼"; case 115: return "éå½åæä»¶æä½,åå§æä»¶åç®æ æä»¶å¿ é¡»å ·æç¸åçè·¯å¾åãä¸è½ä½¿ç¨ç¸å¯¹è·¯å¾ã"; case 117: return "I/Oæ§å¶é误"; case 123: return "æå®äºéå¤çæä»¶å"; case 116: return "The source is a root directory, which cannot be moved or renamed."; case 118: return "Security settings denied access to the source."; case 124: return "The path in the source or destination or both was invalid."; case 65536: return "An unspecified error occurred on the destination."; case 1026: return "å¨è¯å¾ç§»å¨ææ·è´ä¸ä¸ªä¸åå¨çæä»¶."; case 1223: return "æä½è¢«åæ¶ï¼"; default: return "æªè¯å«çé误代ç ï¼" + n; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/FindFiles.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,133 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// FindFiles 宿¶æ¥æ¾æä»¶ /// </summary> /// <remarks> /// FindFiles e = new FindFiles(); /// e.SearchPath = @"c:\"; /// e.ReturnStringType = true ; /// e.SearchPattern = "*.exe"; /// e.SearchForDirectory = false ; /// e.SearchForFile = true; /// e.SearchCreationTime = DateTime.Now.AddDays(-1); /// foreach (object name in e) /// { /// System.Console.WriteLine(name); /// } /// System.Console.ReadLine(); /// ///</remarks> public class FindFiles : System.Collections.IEnumerable { private bool bolReturnStringType = true; /// <summary> /// å¦æä¸ºTrueè¿åæä»¶å,å¦åè¿å System.IO.FileInfo æ System.IO.DirectoryInfo /// </summary> public bool ReturnStringType { get { return bolReturnStringType; } set { bolReturnStringType = value; } } /// <summary> /// æ¥è¯¢æä»¶å建å¼å§æ¶é´ /// </summary> public DateTime? SearchCreationTime { get; set; } /// <summary> /// æ¥è¯¢æä»¶åå»ºç»ææ¶é´ /// </summary> public DateTime? SearchCreationEndTime { get; set; } /// <summary> /// æ¥è¯¢æä»¶ä¿®æ¹å¼å§æ¶é´ /// </summary> public DateTime? SearchModifyTime { get; set; } /// <summary> /// æ¥è¯¢æä»¶ä¿®æ¹ç»ææ¶é´ /// </summary> public DateTime? SearchModifyEndTime { get; set; } private string strSearchPattern = "*"; /// <summary> /// æ¥è¯¢æ¡ä»¶ /// </summary> public string SearchPattern { get { return strSearchPattern; } set { strSearchPattern = value; } } private string strSearchPath = null; /// <summary> /// æ¥è¯¢è·¯å¾ /// </summary> public string SearchPath { get { return strSearchPath; } set { strSearchPath = value; } } private bool bolSearchForFile = true; /// <summary> /// æ¥è¯¢æä»¶ /// </summary> public bool SearchForFile { get { return bolSearchForFile; } set { bolSearchForFile = value; } } private bool bolSearchForDirectory = true; /// <summary> /// æ¥è¯¢æä»¶å¤¹ /// </summary> public bool SearchForDirectory { get { return bolSearchForDirectory; } set { bolSearchForDirectory = value; } } private bool bolThrowIOException = true; /// <summary> /// æ¯å¦æåºå¼å¸¸ /// </summary> public bool ThrowIOException { get { return this.bolThrowIOException; } set { this.bolThrowIOException = value; } } /// <summary> /// IEnumeratoræ¥å£ /// </summary> /// <returns></returns> public System.Collections.IEnumerator GetEnumerator() { FileDirectoryEnumerator e = new FileDirectoryEnumerator(); e.ReturnStringType = this.bolReturnStringType; e.SearchForDirectory = this.bolSearchForDirectory; e.SearchForFile = this.bolSearchForFile; e.SearchPath = this.strSearchPath; e.SearchPattern = this.strSearchPattern; e.ThrowIOException = this.bolThrowIOException; e.SearchCreationTime = this.SearchCreationTime; e.SearchCreationEndTime = this.SearchCreationEndTime; e.SearchModifyTime = this.SearchModifyTime; e.SearchModifyEndTime = this.SearchModifyEndTime; myList.Add(e); return e; } /// <summary> /// å ³é对象 /// </summary> public void Close() { foreach (FileDirectoryEnumerator e in myList) { e.Close(); } myList.Clear(); } private System.Collections.ArrayList myList = new System.Collections.ArrayList(); } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/FolderHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,51 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// æä»¶å¤¹å¸®å© /// </summary> public class FolderHelper { /// <summary> /// è·åææä»¶å¤¹çææåç®å½ /// </summary> /// <param name="folderPath"></param> /// <returns></returns> public static DirectoryInfo[] GetDirectories(string folderPath) { DirectoryInfo mainFolder = new DirectoryInfo(folderPath); //æ¾å°è¯¥æä»¶å¤¹ä¸çåç®å½ return mainFolder.GetDirectories(); } /// <summary> /// ååºpathè·¯å¾å¯¹åºçæä»¶å¤¹ä¸çåæä»¶å¤¹åæä»¶ /// ç¶ååéå½ååºåæä»¶å¤¹å çæä»¶å¤¹ /// </summary> /// <param name="path">éè¦ååºå 容çæä»¶å¤¹çè·¯å¾</param> /// <param name="leval">å½åéå½å±çº§ï¼ç¨äºæ§å¶è¾åºåå¯¼ç©ºæ ¼çæ°é,ä»0å¼å§</param> public static void ListDirectory(string path, int leval, ref List<string> findFolderList) { DirectoryInfo theFolder = new DirectoryInfo(@path); findFolderList.Add(theFolder.FullName); leval++; //éåæä»¶ foreach (FileInfo NextFile in theFolder.GetFiles()) { } //éåæä»¶å¤¹ foreach (DirectoryInfo NextFolder in theFolder.GetDirectories()) { findFolderList.Add(NextFolder.FullName); ListDirectory(NextFolder.FullName, leval, ref findFolderList); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/Log4Net/C_LogWriter.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,111 @@ using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; //é ç½®configæä»¶å [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net_iWare.config", Watch = true)] namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// æ¥å¿ç级 /// </summary> enum LogLevel { Error, Debug, Warning, Info } /// <summary> /// æ¥å¿è®°å½æå¡ /// </summary> class C_LogWriter { /// <summary> /// æ¥å¿æ¥å£ /// </summary> private log4net.ILog m_Log; /// <summary> /// åå§ålog4net对象 /// </summary> /// <param name="_LogType">æ¥å¿ç±»å</param> /// <param name="suffix">åç¼</param> public void Init(LogType _LogType, string suffix) { string s = _LogType.ToString() + suffix; m_Log = log4net.LogManager.GetLogger(s); } /// <summary> /// è¾åºéè¯¯çº§å«æ¥å¿ /// </summary> /// <param name="message">è¾åºçæ¶æ¯</param> public void Error(string message, Exception ex) { //è®°å½æ¥å¿ WriteLog(LogLevel.Error, message, ex); } /// <summary> /// è¾åºè¦åçº§å«æ¥å¿ /// </summary> /// <param name="message">è¾åºçæ¶æ¯</param> public void Warning(string message) { //è®°å½æ¥å¿ WriteLog(LogLevel.Warning, message); } /// <summary> /// è¾åºä¿¡æ¯çº§å«æ¥å¿ /// </summary> /// <param name="message">è¾åºçæ¶æ¯</param> public void Info(string message) { //è®°å½æ¥å¿ WriteLog(LogLevel.Info, message); } /// <summary> /// è¾åºè°è¯çº§å«æ¥å¿ /// </summary> /// <param name="message">è¾åºçæ¶æ¯</param> public void Debug(string message) { //è®°å½æ¥å¿ WriteLog(LogLevel.Debug, message); } /// <summary> /// è®°å½ç³»ç»æ¥å¿ /// </summary> /// <param name="logLevel">æ¥å¿çº§å«</param> /// <param name="message">è¾åºçæ¶æ¯</param> private void WriteLog(LogLevel logLevel, string message, Exception ex = null) { switch (logLevel) { case LogLevel.Debug: m_Log.Debug(message); break; case LogLevel.Error: m_Log.Error(message, ex); break; case LogLevel.Info: m_Log.Info(message); break; case LogLevel.Warning: m_Log.Warn(message); break; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/Log4Net/Log4netHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,37 @@ using iWare_SCADA_Model; using System; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// Log4Netæ¥å¿å¸®å© /// </summary> public class Log4NetHelper { /// <summary> /// è¾åºå¼å¸¸æ¥å¿å°Log4Net /// </summary> /// <param name="_LogType">æ¥å¿ç±»å</param> /// <param name="msg">æ¶æ¯å 容</param> /// <param name="ex">å¼å¸¸å¯¹è±¡</param> public static void WriteErrorLog(LogType _LogType, string msg, Exception ex = null) { C_LogWriter log = new C_LogWriter(); log.Init(_LogType, "_Error"); log.Error(msg, ex); } /// <summary> /// è¾åºinfoæ¥å¿å°Log4Net /// </summary> /// <param name="_LogType">æ¥å¿ç±»å</param> /// <param name="msg">æ¶æ¯å 容</param> public static void WriteInfoLog(LogType _LogType, string msg) { C_LogWriter log = new C_LogWriter(); log.Init(_LogType, "_Info"); log.Info(msg); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/LogTextHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,99 @@ using Newtonsoft.Json; using System; using System.IO; using System.Collections; using System.Collections.Generic; namespace iWare_SCADA_BusinessLogical.Utils { public class LogTextHelper { /// <summary> /// æ¹æ¬¡å 餿¥å¿æä»¶ /// </summary> public static void BatchDeleteLog() { List<string> deleteFolder = new System.Collections.Generic.List<string>(); string folderPath = @"d:\\Log"; FolderHelper.ListDirectory(folderPath, 0, ref deleteFolder); foreach (var item in deleteFolder) { FileHelper.DeleteOldFiles(item, 30);//å é¤ä¸ä¸ªæçæ°æ® } } /// <summary> /// 徿¥å¿é追å å 容 /// </summary> /// <param name="folder">æ¥å¿ç®å½</param> /// <param name="logContent">å 容</param> private static void DoWriteLogContent(string folder, string logContent, Exception ex) { try { if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } string message = string.Format("ã{0}ã{1}\r\n", DateTime.Now.ToString("HH:mm:ss"), logContent); if (ex != null) { message += ",å¼å¸¸å æ :" + JsonConvert.SerializeObject(ex); } File.AppendAllText(Path.Combine(folder, DateTime.Now.ToString("yyyyMMdd") + ".txt"), message); } catch (Exception) { } } /// <summary> /// 徿¥å¿é追å å 容 /// </summary> /// <param name="folder">æ¥å¿ç®å½</param> /// <param name="format">å å®¹æ ¼å¼</param> /// <param name="args">å 容忰</param> public static void WriteLine(string folder, string format, params object[] args) { try { if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } string message = string.Format("ã{0}ã{1}\r\n", DateTime.Now.ToString("HH:mm:ss"), string.Format(format, args)); File.AppendAllText(Path.Combine(folder, DateTime.Now.ToString("yyyyMMdd") + ".txt"), message); } catch (Exception) { } } /// <summary> /// æ·»å æ¥å¿ /// </summary> /// <param name="folder">æ¥å¿ç®å½</param> /// <param name="className">ç±»å</param> /// <param name="methodName">æ¹æ³å</param> /// <param name="format">å å®¹æ ¼å¼</param> /// <param name="args">å 容忰</param> public static void WriteLog(string folder, string className, string methodName, string format, params object[] args) { WriteLine(folder, "å¨ç±»{0}ç{1}æ¹æ³ä¸ï¼{2}", className, methodName, string.Format(format, args)); } /// <summary> /// åå ¥æ¥å¿ /// </summary> /// <param name="folder">æ¥å¿ç®å½</param> /// <param name="className">ç±»å</param> /// <param name="methodName">æ¹æ³å</param> /// <param name="format">å å®¹æ ¼å¼</param> /// <param name="args">å 容忰</param> public static void WriteLogContent(string folder, string className, string methodName, string logContent, Exception ex) { DoWriteLogContent(folder, string.Format("å¨ç±»{0}ç{1}æ¹æ³ä¸ï¼{2}", className, methodName, logContent), ex); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/RandomHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.Utils { public class RandomHelper { /// <summary> ///çæå¶å®ä½æ°çéæºç ï¼æ°åï¼ /// </summary> /// <param name="length"></param> /// <returns></returns> public static string GenerateRandomCode(int length) { var result = new StringBuilder(); for (var i = 0; i < length; i++) { var r = new Random(Guid.NewGuid().GetHashCode()); result.Append(r.Next(0, 10)); } return result.ToString(); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/RegexExtension.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,213 @@ using System; using System.Text.RegularExpressions; using System.Threading; namespace iWare_SCADA_BusinessLogical { public static class RegexExtension { /// <summary> /// å¯å¨ä¸ä¸ªçº¿ç¨æ§è¡æä½ï¼åæ¶è®¾ç½®è¶ æ¶æ¶é´ã /// var r = WithTimeout(() => regex.Match(foo), 1000); /// </summary> /// <typeparam name="TR"></typeparam> /// <param name="proc"></param> /// <param name="duration"></param> /// <returns></returns> private static TR WithTimeout<TR>(Func<TR> proc, int duration) { var reset = new AutoResetEvent(false); var r = default(TR); Exception ex = null; var t = new Thread(() => { try { r = proc(); } catch (Exception e) { ex = e; } reset.Set(); }); t.Start(); if (!reset.WaitOne(duration)) { t.Abort(); throw new TimeoutException(); } if (ex != null) { throw ex; } return r; } /// <summary> /// 夿æ£åæ¯å¦å¹é , duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="startat"></param> /// <param name="duration"></param> /// <returns></returns> public static bool IsMatchWithTimeout(this Regex regex, string input, int startat, int duration) { return regex.IsMatchWithTimeout(input, 0, duration); } /// <summary> /// 夿æ£åæ¯å¦å¹é , duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="duration"></param> /// <returns></returns> public static bool IsMatchWithTimeout(this Regex regex, string input, int duration) { if (regex == null) throw new NullReferenceException(); return WithTimeout(() => regex.IsMatch(input), duration); } /// <summary> /// å¹é æ£å, duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="startat"></param> /// <param name="duration"></param> /// <returns></returns> public static Match MatchWithTimeout(this Regex regex, string input, int startat, int duration) { if (regex == null) throw new NullReferenceException(); return WithTimeout(() => regex.Match(input, startat), duration); } /// <summary> /// å¹é æ£å, duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="duration"></param> /// <returns></returns> public static Match MatchWithTimeout(this Regex regex, string input, int duration) { return regex.MatchWithTimeout(input, 0, duration); } /// <summary> /// å¹é æ£å, duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="startat"></param> /// <param name="duration"></param> /// <returns></returns> public static MatchCollection MatchesWithTimeout(this Regex regex, string input, int startat, int duration) { if (regex == null) throw new NullReferenceException(); return WithTimeout(() => regex.Matches(input, startat), duration); } /// <summary> /// å¹é æ£å, duration毫ç§åæ¥è¶ æ¶å¼å¸¸ /// </summary> /// <param name="regex"></param> /// <param name="input"></param> /// <param name="duration"></param> /// <returns></returns> public static MatchCollection MatchesWithTimeout(this Regex regex, string input, int duration) { return regex.MatchesWithTimeout(input, 0, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="options"></param> /// <param name="duration"></param> /// <returns></returns> public static bool IsMatch(string input, string pattern, RegexOptions options, int duration) { var regex = new Regex(pattern, options); return regex.IsMatchWithTimeout(input, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="duration"></param> /// <returns></returns> public static bool IsMatch(string input, string pattern, int duration) { return IsMatch(input, pattern, RegexOptions.None, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="options"></param> /// <param name="duration"></param> /// <returns></returns> public static Match Match(string input, string pattern, RegexOptions options, int duration) { var regex = new Regex(pattern, options); return regex.MatchWithTimeout(input, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="duration"></param> /// <returns></returns> public static Match Match(string input, string pattern, int duration) { return Match(input, pattern, RegexOptions.None, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="options"></param> /// <param name="duration"></param> /// <returns></returns> public static MatchCollection Matches(string input, string pattern, RegexOptions options, int duration) { var regex = new Regex(pattern, options); return regex.MatchesWithTimeout(input, duration); } /// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pattern"></param> /// <param name="duration"></param> /// <returns></returns> public static MatchCollection Matches(string input, string pattern, int duration) { return Matches(input, pattern, RegexOptions.None, duration); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/Utils/SystemHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,51 @@  using iWare_SCADA_Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_BusinessLogical.Utils { /// <summary> /// ç³»ç»å¸®å©ç±» /// </summary> public class SystemHelper { /// <summary> /// å符串转æ¢decimalç±»å /// </summary> /// <param name="value"></param> /// <returns></returns> public static decimal GetDecimal(string value) { if (string.IsNullOrEmpty(value)) { return 0; } decimal decimalValue = 0; var isRight = decimal.TryParse(value, out decimalValue); if (isRight) { return decimalValue; } return 0; } /// <summary> /// decimaléå计ç®å¹³åå¼ /// </summary> /// <param name="valueList">éå</param> /// <param name="digits">精度</param> /// <returns></returns> public static string CalcDecimalAvg(List<decimal> valueList, int digits) { var sum = valueList.Sum(); var count = valueList.Count; var bb = Convert.ToDecimal((sum / (decimal)count).ToString("f" + digits.ToString())); return bb.ToString(); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/iWare_SCADA_BusinessLogical.csproj
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,159 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{32708F19-FE1A-48F5-B373-8E1C776F216C}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>iWare_SCADA_BusinessLogical</RootNamespace> <AssemblyName>iWare_SCADA_BusinessLogical</AssemblyName> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <Deterministic>true</Deterministic> <NuGetPackageImportStamp> </NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942"> <HintPath>..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll</HintPath> </Reference> <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath> </Reference> <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath> </Reference> <Reference Include="HslCommunication"> <HintPath>..\DLL\HslCommunication.dll</HintPath> </Reference> <Reference Include="itextsharp, Version=5.5.13.3, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL"> <HintPath>..\packages\iTextSharp.5.5.13.3\lib\itextsharp.dll</HintPath> </Reference> <Reference Include="log4net"> <HintPath>..\DLL\log4net.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\DLL\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="Spire.Pdf, Version=9.11.4.0, Culture=neutral, PublicKeyToken=663f351905198cb3, processorArchitecture=MSIL"> <HintPath>..\packages\Spire.PDF.9.11.4\lib\net40\Spire.Pdf.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Net.Http" /> <Reference Include="System.Xml" /> <Reference Include="Yitter.IdGenerator.Net45, Version=1.0.0.4, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\packages\Yitter.IdGenerator.Net45.1.0.0\lib\net452\Yitter.IdGenerator.Net45.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Compile Include="BLL\CommonManager.cs" /> <Compile Include="BLL\DataCaptureColumnDictManager.cs" /> <Compile Include="BLL\DataCaptureConfigManager.cs" /> <Compile Include="BLL\SystemValue.cs" /> <Compile Include="BLL\WorkPieceInfoManager.cs" /> <Compile Include="BLL\WorkPieceLogManager.cs" /> <Compile Include="DataCaptureHandler\DBDataCapture\AlarmLogManager.cs" /> <Compile Include="DLA\Dao\CommonDao.cs" /> <Compile Include="DLA\Dao\CommonService.cs" /> <Compile Include="DLA\EFHelp.cs" /> <Compile Include="DLA\ICommonEntity.cs" /> <Compile Include="DLA\IService.cs" /> <Compile Include="DLA\QueryParam.cs" /> <Compile Include="DataCaptureHandler\PLCDataCapture\PLCService.cs" /> <Compile Include="DataCaptureHandler\PLCDataCapture\Siemens_HslCommunicationService.cs" /> <Compile Include="DataCaptureHandler\PLCDataCapture\PLCFactory.cs" /> <Compile Include="DataCaptureHandler\PLCDataCapture\PLCManger.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="Test\MyTest.cs" /> <Compile Include="Utils\SystemHelper.cs" /> <Compile Include="Utils\ComboBoxHelper.cs" /> <Compile Include="Utils\ConfigHelper.cs" /> <Compile Include="Utils\CSVHelper.cs" /> <Compile Include="Utils\DataCache.cs" /> <Compile Include="Utils\DateTimeHelper.cs" /> <Compile Include="Utils\EntityPropHelper.cs" /> <Compile Include="Utils\EnumberHelper.cs" /> <Compile Include="Utils\FileDirectoryEnumerator.cs" /> <Compile Include="Utils\FileHelper.cs" /> <Compile Include="Utils\FindFiles.cs" /> <Compile Include="Utils\FolderHelper.cs" /> <Compile Include="Utils\Log4Net\C_LogWriter.cs" /> <Compile Include="Utils\Log4Net\Log4netHelper.cs" /> <Compile Include="Utils\LogTextHelper.cs" /> <Compile Include="Utils\RandomHelper.cs" /> <Compile Include="Utils\RegexExtension.cs" /> </ItemGroup> <ItemGroup> <Folder Include="DataCaptureHandlerV2\" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\iWare_SCADA_Model\iWare_SCADA_Model.csproj"> <Project>{91c185de-15ab-44ae-b585-53799fc51be0}</Project> <Name>iWare_SCADA_Model</Name> </ProjectReference> </ItemGroup> <ItemGroup> <None Include="App.config" /> <None Include="DLA\Dao\_system~.ini" /> <None Include="log4net_iWare - å¤å¶ç¨.config"> <SubType>Designer</SubType> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Include="log4net_iWare.config"> <SubType>Designer</SubType> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Include="packages.config" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>è¿å°è®¡ç®æºä¸ç¼ºå°æ¤é¡¹ç®å¼ç¨ç NuGet ç¨åºå ã使ç¨âNuGet ç¨åºå è¿åâå¯ä¸è½½è¿äºç¨åºå ãæå ³æ´å¤ä¿¡æ¯ï¼è¯·åè§ http://go.microsoft.com/fwlink/?LinkID=322105ã缺å°çæä»¶æ¯ {0}ã</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" /> <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" /> </Target> <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" /> </Project> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/log4net_iWare - ¸´ÖÆÓÃ.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,46 @@ <configuration> <configSections> <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/> </configSections> <appSettings> </appSettings> <log4net> <!-- OP80è´¨ééé线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP80_QC_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log\\SCADALog\\PLCOP80_QC_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_QC_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--OP80è´¨ééé线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP80_QC_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log\\SCADALog\\PLCOP80_QC_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_QC_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <root> <level value="ALL"/> <appender-ref ref="PLCOP80_QC_Info"/> <appender-ref ref="PLCOP80_QC_Error"/> </root> </log4net> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/log4net_iWare.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,528 @@ <configuration> <configSections> <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/> </configSections> <appSettings> </appSettings> <log4net> <!-- OP80è´¨ééé线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP80_QC_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP80_QC_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_QC_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--OP80è´¨ééé线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP80_QC_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP80_QC_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_QC_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- èæåºååºåºçº¿ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="FormMain_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\FormMain_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="FormMain_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--èæåºååºåºçº¿ç¨ãéè¯¯ãæ¥å¿--> <appender name="FormMain_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\FormMain_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="FormMain_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP05线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP05_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP05_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP05_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP05线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP05_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP05_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP05_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP10线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP10_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP10_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP10_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP10线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP10_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP10_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP10_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP20线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP20_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP20_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP20_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP20线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP20_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP20_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP20_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP30线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP30_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP30_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP30_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP30线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP30_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP30_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP30_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP35线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP35_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP35_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP35_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP35线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP35_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP35_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP35_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP40线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP40_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP40_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP40_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP40线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP40_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP40_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP40_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP50线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP50_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP50_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP50_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP50线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP50_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP50_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP50_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP60线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP60_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP60_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP60_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP60线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP60_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP60_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP60_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP70线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP70_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP70_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP70_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP70线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP70_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP70_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP70_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCOP80线ç¨ãä¿¡æ¯ãæ¥å¿--> <appender name="PLCOP80_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP80_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCOP80线ç¨ãéè¯¯ãæ¥å¿--> <appender name="PLCOP80_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCOP80_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCOP80_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- HslCommunicationServiceãä¿¡æ¯ãæ¥å¿--> <appender name="HslCommunicationService_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\HslCommunicationService_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="HslCommunicationService_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--HslCommunicationServiceãéè¯¯ãæ¥å¿--> <appender name="HslCommunicationService_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\HslCommunicationService_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="HslCommunicationService_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- PLCServiceãä¿¡æ¯ãæ¥å¿--> <appender name="PLCService_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCService_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCService_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--PLCServiceãéè¯¯ãæ¥å¿--> <appender name="PLCService_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\PLCService_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="PLCService_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!-- DBDataCaptureãä¿¡æ¯ãæ¥å¿--> <appender name="DBDataCapture_Info" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\DBDataCapture_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%næ¶æ¯æ¶é´ï¼%d [%t] %næ¶æ¯çº§å«ï¼%-5p %næ¶ æ¯ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="DBDataCapture_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--DBDataCaptureãéè¯¯ãæ¥å¿--> <appender name="DBDataCapture_Error" type="log4net.Appender.RollingFileAppender"> <file value="D:\\Log_Test\\SCADALog\\DBDataCapture_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <datePattern value="yyyy-MM-dd.LOG" /> <layout type="log4net.Layout.PatternLayout"> <!--è¾åºæ ¼å¼--> <param name="ConversionPattern" value="%nå¼å¸¸æ¶é´ï¼%d [%t] %nå¼å¸¸çº§å«ï¼%-5p %nå¼ å¸¸ ç±»ï¼%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="DBDataCapture_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <root> <level value="ALL"/> <appender-ref ref="PLCOP80_QC_Info"/> <appender-ref ref="PLCOP80_QC_Error"/> <appender-ref ref="FormMain_Info"/> <appender-ref ref="FormMain_Error"/> <appender-ref ref="PLCOP05_Info"/> <appender-ref ref="PLCOP05_Error"/> <appender-ref ref="PLCOP10_Info"/> <appender-ref ref="PLCOP10_Error"/> <appender-ref ref="PLCOP20_Info"/> <appender-ref ref="PLCOP20_Error"/> <appender-ref ref="PLCOP30_Info"/> <appender-ref ref="PLCOP30_Error"/> <appender-ref ref="PLCOP35_Info"/> <appender-ref ref="PLCOP35_Error"/> <appender-ref ref="PLCOP40_Info"/> <appender-ref ref="PLCOP40_Error"/> <appender-ref ref="PLCOP50_Info"/> <appender-ref ref="PLCOP50_Error"/> <appender-ref ref="PLCOP60_Info"/> <appender-ref ref="PLCOP60_Error"/> <appender-ref ref="PLCOP70_Info"/> <appender-ref ref="PLCOP70_Error"/> <appender-ref ref="PLCOP80_Info"/> <appender-ref ref="PLCOP80_Error"/> <appender-ref ref="HslCommunicationService_Info"/> <appender-ref ref="HslCommunicationService_Error"/> <appender-ref ref="PLCService_Info"/> <appender-ref ref="PLCService_Error"/> <appender-ref ref="DBDataCapture_Info"/> <appender-ref ref="DBDataCapture_Error"/> </root> </log4net> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_BusinessLogical/packages.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="BouncyCastle" version="1.8.9" targetFramework="net472" /> <package id="EntityFramework" version="6.4.4" targetFramework="net472" /> <package id="iTextSharp" version="5.5.13.3" targetFramework="net472" /> <package id="Spire.PDF" version="9.11.4" targetFramework="net472" /> <package id="Yitter.IdGenerator.Net45" version="1.0.0" targetFramework="net472" /> </packages> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/App - ±¾»ú»·¾³.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <appSettings> <!--net use x: \\192.168.216.133\Destination /savecred /persistent:yes net use z: \\192.168.216.130\kistler /savecred /persistent:yes net use y: \\192.168.216.6\data /savecred /persistent:yes net use u: \\192.168.216.130\NutrunnerData /savecred /persistent:yes--> <!-- å¤æå·¥åºæ¯å¦è·³åºçåºåé ç½® --> <add key="WorkingProcedureAllStr" value="OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80" /> <add key="WorkPeiceIDPath" value="Y:\qualified" /> <!-- op30å·¥åºçå·¥ä½è´¨éä¿¡æ¯ --> <add key="OP30QualityDataFor36Station" value="Z:\" /> <add key="OP30QualityDataFor45Station" value="U:\" /> <add key="OP60QualityData" value="V:\" /> <add key="OP20QualityData" value="W:\" /> <add key="OP80QualityData" value="X:\CA4GC20TD\" /> <!--<add key="WorkPeiceIDPath" value="C:\Users\13650\Desktop\yiqi" />--> <add key="HeartBeatAlertInterval" value="2000" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> </startup> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <connectionStrings> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=.;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=10.10.40.166;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <add name="SCADA_DF22001_CORE" connectionString="Server=.;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" /> <add name="SCModel" connectionString="data source=.;initial catalog=SCTest_new;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/App - Éú²ú»·¾³.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <appSettings> <!--net use x: \\192.168.216.133\Destination /savecred /persistent:yes net use z: \\192.168.216.130\kistler /savecred /persistent:yes net use y: \\192.168.216.6\data /savecred /persistent:yes net use u: \\192.168.216.130\NutrunnerData /savecred /persistent:yes--> <!-- å¤æå·¥åºæ¯å¦è·³åºçåºåé ç½® --> <add key="WorkingProcedureAllStr" value="OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80" /> <add key="WorkPeiceIDPath" value="Y:\qualified" /> <!-- op30å·¥åºçå·¥ä½è´¨éä¿¡æ¯ --> <add key="OP30QualityDataFor36Station" value="Z:\" /> <add key="OP30QualityDataFor45Station" value="U:\" /> <add key="OP60QualityData" value="V:\" /> <add key="OP20QualityData" value="W:\" /> <add key="OP80QualityData" value="X:\CA4GC20TD\" /> <!--<add key="WorkPeiceIDPath" value="C:\Users\13650\Desktop\yiqi" />--> <add key="HeartBeatAlertInterval" value="2000" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> </startup> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <connectionStrings> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=.;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=10.10.40.166;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <add name="SCADA_DF22001_CORE" connectionString="Server=192.168.216.203;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" /> <add name="SCModel" connectionString="data source=192.168.216.203;initial catalog=SCTest_new;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/App.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <appSettings> <!--net use x: \\192.168.216.133\Destination /savecred /persistent:yes net use z: \\192.168.216.130\kistler /savecred /persistent:yes net use y: \\192.168.216.6\data /savecred /persistent:yes net use u: \\192.168.216.130\NutrunnerData /savecred /persistent:yes--> <!-- å¤æå·¥åºæ¯å¦è·³åºçåºåé ç½® --> <add key="WorkingProcedureAllStr" value="OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80" /> <add key="WorkPeiceIDPath" value="Y:\qualified" /> <!-- op30å·¥åºçå·¥ä½è´¨éä¿¡æ¯ --> <add key="OP30QualityDataFor36Station" value="Z:\" /> <add key="OP30QualityDataFor45Station" value="U:\" /> <add key="OP60QualityData" value="V:\" /> <add key="OP20QualityData" value="W:\" /> <add key="OP80QualityData" value="X:\CA4GC20TD\" /> <!--<add key="WorkPeiceIDPath" value="C:\Users\13650\Desktop\yiqi" />--> <add key="HeartBeatAlertInterval" value="2000" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> </startup> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <connectionStrings> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=.;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <!--<add name="SCADA_DF22001_CORE" connectionString="Server=10.10.40.166;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />--> <add name="SCADA_DF22001_CORE" connectionString="Server=.;Database=iWare.SCADA;User=sa;Password=123abc.com;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" /> <add name="SCModel" connectionString="data source=.;initial catalog=SCTest_new;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormMain.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,2941 @@  namespace iWare_SCADA_DataCaptureV3 { partial class FormMain { /// <summary> /// å¿ éç设计å¨åéã /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// æ¸ çæææ£å¨ä½¿ç¨çèµæºã /// </summary> /// <param name="disposing">妿åºéæ¾æç®¡èµæºï¼ä¸º trueï¼å¦å为 falseã</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows çªä½è®¾è®¡å¨çæç代ç /// <summary> /// è®¾è®¡å¨æ¯ææéçæ¹æ³ - ä¸è¦ä¿®æ¹ /// 使ç¨ä»£ç ç¼è¾å¨ä¿®æ¹æ¤æ¹æ³çå 容ã /// </summary> private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.groupBox11 = new System.Windows.Forms.GroupBox(); this.dataGridView2 = new System.Windows.Forms.DataGridView(); this.Threadcode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Threadcname = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.button23 = new System.Windows.Forms.Button(); this.button24 = new System.Windows.Forms.Button(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.button27 = new System.Windows.Forms.Button(); this.textBox12 = new System.Windows.Forms.TextBox(); this.btnHMIWrite = new System.Windows.Forms.Button(); this.button17 = new System.Windows.Forms.Button(); this.button18 = new System.Windows.Forms.Button(); this.button19 = new System.Windows.Forms.Button(); this.button20 = new System.Windows.Forms.Button(); this.button21 = new System.Windows.Forms.Button(); this.button22 = new System.Windows.Forms.Button(); this.btnHMI04Reading = new System.Windows.Forms.Button(); this.button15 = new System.Windows.Forms.Button(); this.button14 = new System.Windows.Forms.Button(); this.button13 = new System.Windows.Forms.Button(); this.button12 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.label34 = new System.Windows.Forms.Label(); this.textBox10 = new System.Windows.Forms.TextBox(); this.button8 = new System.Windows.Forms.Button(); this.button25 = new System.Windows.Forms.Button(); this.button16 = new System.Windows.Forms.Button(); this.button26 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.groupBox10 = new System.Windows.Forms.GroupBox(); this.panel4 = new System.Windows.Forms.Panel(); this.HMIOP60Write = new System.Windows.Forms.CheckBox(); this.HMIOP50Write = new System.Windows.Forms.CheckBox(); this.HMIOP3035Write = new System.Windows.Forms.CheckBox(); this.HMIOP20Write = new System.Windows.Forms.CheckBox(); this.HMIOP1040Write = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP6001 = new System.Windows.Forms.Label(); this.ckHMIOP60Reading = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP5001 = new System.Windows.Forms.Label(); this.ckHMIOP50Reading = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP303501 = new System.Windows.Forms.Label(); this.ckHMIOP3035Reading = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP6002 = new System.Windows.Forms.Label(); this.lbl_Alert_HMIOP2001 = new System.Windows.Forms.Label(); this.lbl_Alert_HMIOP5002 = new System.Windows.Forms.Label(); this.ckHMIOP20Reading = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP303502 = new System.Windows.Forms.Label(); this.lbl_Alert_HMIOP104001 = new System.Windows.Forms.Label(); this.lbl_Alert_HMIOP2002 = new System.Windows.Forms.Label(); this.ckHMIOP1040Reading = new System.Windows.Forms.CheckBox(); this.lbl_Alert_HMIOP104002 = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.panel3 = new System.Windows.Forms.Panel(); this.label35 = new System.Windows.Forms.Label(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.label36 = new System.Windows.Forms.Label(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.checkBox10 = new System.Windows.Forms.CheckBox(); this.label6 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.checkBox6 = new System.Windows.Forms.CheckBox(); this.checkBox9 = new System.Windows.Forms.CheckBox(); this.label7 = new System.Windows.Forms.Label(); this.checkBox8 = new System.Windows.Forms.CheckBox(); this.label8 = new System.Windows.Forms.Label(); this.checkBox7 = new System.Windows.Forms.CheckBox(); this.label9 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.panel2 = new System.Windows.Forms.Panel(); this.lbl_Alter_OP2007 = new System.Windows.Forms.Label(); this.ckBOP2007 = new System.Windows.Forms.CheckBox(); this.ckBOP2001 = new System.Windows.Forms.CheckBox(); this.lbl_Alter_OP2006 = new System.Windows.Forms.Label(); this.lbl_Alter_OP2001 = new System.Windows.Forms.Label(); this.ckBOP2006 = new System.Windows.Forms.CheckBox(); this.ckBOP2002 = new System.Windows.Forms.CheckBox(); this.lbl_Alter_OP2005 = new System.Windows.Forms.Label(); this.ckBOP2003 = new System.Windows.Forms.CheckBox(); this.ckBOP2005 = new System.Windows.Forms.CheckBox(); this.ckBOP2004 = new System.Windows.Forms.CheckBox(); this.lbl_Alter_OP2004 = new System.Windows.Forms.Label(); this.lbl_Alter_OP2002 = new System.Windows.Forms.Label(); this.lbl_Alter_OP2003 = new System.Windows.Forms.Label(); this.btn_StopAllThread = new System.Windows.Forms.Button(); this.btn_StartUpAllThread = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.panel1 = new System.Windows.Forms.Panel(); this.ckBOP0501 = new System.Windows.Forms.CheckBox(); this.lbl_Alter_OP0504 = new System.Windows.Forms.Label(); this.lbl_Alter_OP0501 = new System.Windows.Forms.Label(); this.lbl_Alter_OP0503 = new System.Windows.Forms.Label(); this.ckBOP0502 = new System.Windows.Forms.CheckBox(); this.lbl_Alter_OP0502 = new System.Windows.Forms.Label(); this.ckBOP0503 = new System.Windows.Forms.CheckBox(); this.ckBOP0504 = new System.Windows.Forms.CheckBox(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.txt_ID = new System.Windows.Forms.TextBox(); this.label19 = new System.Windows.Forms.Label(); this.cbox_DataCapturePLCType = new System.Windows.Forms.ComboBox(); this.txt_PLCPort = new System.Windows.Forms.TextBox(); this.label18 = new System.Windows.Forms.Label(); this.cbox_DataCaptureColumnType = new System.Windows.Forms.ComboBox(); this.cbox_DataCaptureType = new System.Windows.Forms.ComboBox(); this.cbox_WorkingProcedure = new System.Windows.Forms.ComboBox(); this.txt_DbNumber = new System.Windows.Forms.TextBox(); this.btn_Cancel = new System.Windows.Forms.Button(); this.btn_Save = new System.Windows.Forms.Button(); this.label15 = new System.Windows.Forms.Label(); this.txt_Offset = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.txt_DataCapturePointCode = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.txt_DataCapturePointCname = new System.Windows.Forms.TextBox(); this.label11 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.txt_PLCIP = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.txt_EquipmentID = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.btn_Delete = new System.Windows.Forms.Button(); this.dgv_DataCaptureConfig = new System.Windows.Forms.DataGridView(); this.EquipmentID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WorkingProcedure = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCapturePointCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCapturePointCname = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCaptureType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCapturePLCType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PLCIP = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PLCPort = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCaptureColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DataCaptureColumnType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.btn_Update = new System.Windows.Forms.Button(); this.btn_Insert = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.cbox_WorkingProcedure_Query = new System.Windows.Forms.ComboBox(); this.label17 = new System.Windows.Forms.Label(); this.textBox11 = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); this.btn_Query = new System.Windows.Forms.Button(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.comboBox5 = new System.Windows.Forms.ComboBox(); this.label32 = new System.Windows.Forms.Label(); this.textBox9 = new System.Windows.Forms.TextBox(); this.label33 = new System.Windows.Forms.Label(); this.button7 = new System.Windows.Forms.Button(); this.groupBox8 = new System.Windows.Forms.GroupBox(); this.button4 = new System.Windows.Forms.Button(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.button5 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.groupBox6 = new System.Windows.Forms.GroupBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label20 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.label21 = new System.Windows.Forms.Label(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.comboBox3 = new System.Windows.Forms.ComboBox(); this.comboBox4 = new System.Windows.Forms.ComboBox(); this.textBox3 = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.label22 = new System.Windows.Forms.Label(); this.textBox4 = new System.Windows.Forms.TextBox(); this.label23 = new System.Windows.Forms.Label(); this.label24 = new System.Windows.Forms.Label(); this.textBox5 = new System.Windows.Forms.TextBox(); this.label25 = new System.Windows.Forms.Label(); this.textBox6 = new System.Windows.Forms.TextBox(); this.label26 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label(); this.textBox7 = new System.Windows.Forms.TextBox(); this.label29 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label(); this.textBox8 = new System.Windows.Forms.TextBox(); this.label31 = new System.Windows.Forms.Label(); this.tabControl1.SuspendLayout(); this.tabPage5.SuspendLayout(); this.groupBox11.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.groupBox10.SuspendLayout(); this.panel4.SuspendLayout(); this.groupBox3.SuspendLayout(); this.panel3.SuspendLayout(); this.groupBox2.SuspendLayout(); this.panel2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); this.tabPage3.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgv_DataCaptureConfig)).BeginInit(); this.groupBox4.SuspendLayout(); this.tabPage4.SuspendLayout(); this.groupBox9.SuspendLayout(); this.groupBox8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.groupBox6.SuspendLayout(); this.SuspendLayout(); // // tabControl1 // this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Location = new System.Drawing.Point(13, 12); this.tabControl1.Margin = new System.Windows.Forms.Padding(4); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(1451, 729); this.tabControl1.TabIndex = 0; // // tabPage5 // this.tabPage5.Controls.Add(this.groupBox11); this.tabPage5.Controls.Add(this.button23); this.tabPage5.Controls.Add(this.button24); this.tabPage5.Location = new System.Drawing.Point(4, 25); this.tabPage5.Margin = new System.Windows.Forms.Padding(4); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(4); this.tabPage5.Size = new System.Drawing.Size(1443, 700); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "线ç¨çæ§"; this.tabPage5.UseVisualStyleBackColor = true; // // groupBox11 // this.groupBox11.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox11.Controls.Add(this.dataGridView2); this.groupBox11.Location = new System.Drawing.Point(4, 71); this.groupBox11.Margin = new System.Windows.Forms.Padding(4); this.groupBox11.Name = "groupBox11"; this.groupBox11.Padding = new System.Windows.Forms.Padding(4); this.groupBox11.Size = new System.Drawing.Size(1428, 598); this.groupBox11.TabIndex = 5; this.groupBox11.TabStop = false; this.groupBox11.Text = "线ç¨ä¿¡æ¯"; // // dataGridView2 // this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Threadcode, this.Threadcname, this.Column1, this.Column2, this.Column3, this.Column4, this.Column5, this.Column6}); this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView2.Location = new System.Drawing.Point(4, 22); this.dataGridView2.Margin = new System.Windows.Forms.Padding(4); this.dataGridView2.Name = "dataGridView2"; this.dataGridView2.RowHeadersWidth = 51; this.dataGridView2.RowTemplate.Height = 23; this.dataGridView2.Size = new System.Drawing.Size(1420, 572); this.dataGridView2.TabIndex = 0; // // Threadcode // this.Threadcode.DataPropertyName = "Threadcode"; this.Threadcode.HeaderText = "ééç¼å·"; this.Threadcode.MinimumWidth = 6; this.Threadcode.Name = "Threadcode"; this.Threadcode.Width = 125; // // Threadcname // this.Threadcname.DataPropertyName = "Threadcname"; this.Threadcname.HeaderText = "ééç¹æè¿°"; this.Threadcname.MinimumWidth = 6; this.Threadcname.Name = "Threadcname"; this.Threadcname.Width = 125; // // Column1 // this.Column1.DataPropertyName = "Threadendtime"; dataGridViewCellStyle1.Format = "yyyy/MM/dd hh:mm:ss"; this.Column1.DefaultCellStyle = dataGridViewCellStyle1; this.Column1.HeaderText = "ææ°æ§è¡æ¶é´"; this.Column1.MinimumWidth = 6; this.Column1.Name = "Column1"; this.Column1.Width = 125; // // Column2 // this.Column2.DataPropertyName = "Threadlastmodifytime"; dataGridViewCellStyle2.Format = "yyyy/MM/dd hh:mm:ss"; this.Column2.DefaultCellStyle = dataGridViewCellStyle2; this.Column2.HeaderText = "ææ°è·é»è¾æ¶é´"; this.Column2.MinimumWidth = 6; this.Column2.Name = "Column2"; this.Column2.Width = 125; // // Column3 // this.Column3.DataPropertyName = "ThreadId"; this.Column3.HeaderText = "线ç¨ID"; this.Column3.MinimumWidth = 6; this.Column3.Name = "Column3"; this.Column3.Width = 125; // // Column4 // this.Column4.DataPropertyName = "ThreadFrequency"; this.Column4.HeaderText = "线ç¨é¢ç"; this.Column4.MinimumWidth = 6; this.Column4.Name = "Column4"; this.Column4.Width = 125; // // Column5 // this.Column5.DataPropertyName = "Remarks"; this.Column5.HeaderText = "夿³¨"; this.Column5.MinimumWidth = 6; this.Column5.Name = "Column5"; this.Column5.Width = 150; // // Column6 // this.Column6.DataPropertyName = "ErrorMsg"; this.Column6.HeaderText = "å¼å¸¸ä¿¡æ¯"; this.Column6.MinimumWidth = 6; this.Column6.Name = "Column6"; this.Column6.Width = 200; // // button23 // this.button23.Location = new System.Drawing.Point(380, 22); this.button23.Margin = new System.Windows.Forms.Padding(4); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(195, 41); this.button23.TabIndex = 4; this.button23.Text = "忢ææéä¸çº¿ç¨"; this.button23.UseVisualStyleBackColor = true; this.button23.Click += new System.EventHandler(this.button23_Click); // // button24 // this.button24.Location = new System.Drawing.Point(69, 22); this.button24.Margin = new System.Windows.Forms.Padding(4); this.button24.Name = "button24"; this.button24.Size = new System.Drawing.Size(195, 41); this.button24.TabIndex = 3; this.button24.Text = "å¯å¨ææéä¸çº¿ç¨"; this.button24.UseVisualStyleBackColor = true; this.button24.Click += new System.EventHandler(this.button24_Click); // // tabPage1 // this.tabPage1.Controls.Add(this.button27); this.tabPage1.Controls.Add(this.textBox12); this.tabPage1.Controls.Add(this.btnHMIWrite); this.tabPage1.Controls.Add(this.button17); this.tabPage1.Controls.Add(this.button18); this.tabPage1.Controls.Add(this.button19); this.tabPage1.Controls.Add(this.button20); this.tabPage1.Controls.Add(this.button21); this.tabPage1.Controls.Add(this.button22); this.tabPage1.Controls.Add(this.btnHMI04Reading); this.tabPage1.Controls.Add(this.button15); this.tabPage1.Controls.Add(this.button14); this.tabPage1.Controls.Add(this.button13); this.tabPage1.Controls.Add(this.button12); this.tabPage1.Controls.Add(this.button11); this.tabPage1.Controls.Add(this.button10); this.tabPage1.Controls.Add(this.button9); this.tabPage1.Controls.Add(this.label34); this.tabPage1.Controls.Add(this.textBox10); this.tabPage1.Controls.Add(this.button8); this.tabPage1.Controls.Add(this.button25); this.tabPage1.Controls.Add(this.button16); this.tabPage1.Controls.Add(this.button26); this.tabPage1.Controls.Add(this.button1); this.tabPage1.Location = new System.Drawing.Point(4, 25); this.tabPage1.Margin = new System.Windows.Forms.Padding(4); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(4); this.tabPage1.Size = new System.Drawing.Size(1443, 700); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "é¦é¡µ"; this.tabPage1.UseVisualStyleBackColor = true; // // button27 // this.button27.Location = new System.Drawing.Point(669, 432); this.button27.Margin = new System.Windows.Forms.Padding(4); this.button27.Name = "button27"; this.button27.Size = new System.Drawing.Size(100, 29); this.button27.TabIndex = 18; this.button27.Text = "æä»¶æ«æ"; this.button27.UseVisualStyleBackColor = true; this.button27.Click += new System.EventHandler(this.button27_Click); // // textBox12 // this.textBox12.Location = new System.Drawing.Point(643, 55); this.textBox12.Margin = new System.Windows.Forms.Padding(4); this.textBox12.Name = "textBox12"; this.textBox12.Size = new System.Drawing.Size(236, 25); this.textBox12.TabIndex = 17; this.textBox12.Text = "DZ045L2104250100001A1A\n"; // // btnHMIWrite // this.btnHMIWrite.Location = new System.Drawing.Point(356, 420); this.btnHMIWrite.Margin = new System.Windows.Forms.Padding(4); this.btnHMIWrite.Name = "btnHMIWrite"; this.btnHMIWrite.Size = new System.Drawing.Size(139, 29); this.btnHMIWrite.TabIndex = 16; this.btnHMIWrite.Text = "HMI04åå ¥"; this.btnHMIWrite.UseVisualStyleBackColor = true; this.btnHMIWrite.Click += new System.EventHandler(this.btnHMIWrite_Click); // // button17 // this.button17.Location = new System.Drawing.Point(403, 340); this.button17.Margin = new System.Windows.Forms.Padding(4); this.button17.Name = "button17"; this.button17.Size = new System.Drawing.Size(139, 29); this.button17.TabIndex = 16; this.button17.Text = "OP8007åè¦çæ§"; this.button17.UseVisualStyleBackColor = true; this.button17.Click += new System.EventHandler(this.button17_Click); // // button18 // this.button18.Location = new System.Drawing.Point(403, 282); this.button18.Margin = new System.Windows.Forms.Padding(4); this.button18.Name = "button18"; this.button18.Size = new System.Drawing.Size(139, 29); this.button18.TabIndex = 15; this.button18.Text = "OP8005å·¥åºå®æ"; this.button18.UseVisualStyleBackColor = true; this.button18.Click += new System.EventHandler(this.button18_Click); // // button19 // this.button19.Location = new System.Drawing.Point(403, 246); this.button19.Margin = new System.Windows.Forms.Padding(4); this.button19.Name = "button19"; this.button19.Size = new System.Drawing.Size(139, 29); this.button19.TabIndex = 14; this.button19.Text = "OP8004 buyong"; this.button19.UseVisualStyleBackColor = true; this.button19.Click += new System.EventHandler(this.button19_Click); // // button20 // this.button20.Location = new System.Drawing.Point(403, 210); this.button20.Margin = new System.Windows.Forms.Padding(4); this.button20.Name = "button20"; this.button20.Size = new System.Drawing.Size(139, 29); this.button20.TabIndex = 13; this.button20.Text = "OP3003æ¨åº"; this.button20.UseVisualStyleBackColor = true; this.button20.Click += new System.EventHandler(this.button20_Click); // // button21 // this.button21.Location = new System.Drawing.Point(403, 174); this.button21.Margin = new System.Windows.Forms.Padding(4); this.button21.Name = "button21"; this.button21.Size = new System.Drawing.Size(139, 29); this.button21.TabIndex = 12; this.button21.Text = "OP3002æ£æµå®æ"; this.button21.UseVisualStyleBackColor = true; this.button21.Click += new System.EventHandler(this.button21_Click); // // button22 // this.button22.Location = new System.Drawing.Point(403, 138); this.button22.Margin = new System.Windows.Forms.Padding(4); this.button22.Name = "button22"; this.button22.Size = new System.Drawing.Size(124, 29); this.button22.TabIndex = 11; this.button22.Text = "OP8001读ç "; this.button22.UseVisualStyleBackColor = true; this.button22.Click += new System.EventHandler(this.button22_Click); // // btnHMI04Reading // this.btnHMI04Reading.Location = new System.Drawing.Point(192, 420); this.btnHMI04Reading.Margin = new System.Windows.Forms.Padding(4); this.btnHMI04Reading.Name = "btnHMI04Reading"; this.btnHMI04Reading.Size = new System.Drawing.Size(139, 29); this.btnHMI04Reading.TabIndex = 10; this.btnHMI04Reading.Text = "HMI04读å"; this.btnHMI04Reading.UseVisualStyleBackColor = true; this.btnHMI04Reading.Click += new System.EventHandler(this.btnHMI04Reading_Click); // // button15 // this.button15.Location = new System.Drawing.Point(192, 340); this.button15.Margin = new System.Windows.Forms.Padding(4); this.button15.Name = "button15"; this.button15.Size = new System.Drawing.Size(139, 29); this.button15.TabIndex = 10; this.button15.Text = "OP3007åè¦çæ§"; this.button15.UseVisualStyleBackColor = true; this.button15.Click += new System.EventHandler(this.button15_Click); // // button14 // this.button14.Location = new System.Drawing.Point(192, 282); this.button14.Margin = new System.Windows.Forms.Padding(4); this.button14.Name = "button14"; this.button14.Size = new System.Drawing.Size(139, 29); this.button14.TabIndex = 9; this.button14.Text = "OP3005å·¥åºå®æ"; this.button14.UseVisualStyleBackColor = true; this.button14.Click += new System.EventHandler(this.button14_Click); // // button13 // this.button13.Location = new System.Drawing.Point(192, 246); this.button13.Margin = new System.Windows.Forms.Padding(4); this.button13.Name = "button13"; this.button13.Size = new System.Drawing.Size(139, 29); this.button13.TabIndex = 8; this.button13.Text = "OP3004SPCæ¨åº"; this.button13.UseVisualStyleBackColor = true; this.button13.Click += new System.EventHandler(this.button13_Click); // // button12 // this.button12.Location = new System.Drawing.Point(192, 210); this.button12.Margin = new System.Windows.Forms.Padding(4); this.button12.Name = "button12"; this.button12.Size = new System.Drawing.Size(139, 29); this.button12.TabIndex = 7; this.button12.Text = "OP3003æ¨åº"; this.button12.UseVisualStyleBackColor = true; this.button12.Click += new System.EventHandler(this.button12_Click); // // button11 // this.button11.Location = new System.Drawing.Point(192, 174); this.button11.Margin = new System.Windows.Forms.Padding(4); this.button11.Name = "button11"; this.button11.Size = new System.Drawing.Size(139, 29); this.button11.TabIndex = 6; this.button11.Text = "OP3002æ£æµå®æ"; this.button11.UseVisualStyleBackColor = true; this.button11.Click += new System.EventHandler(this.button11_Click); // // button10 // this.button10.Location = new System.Drawing.Point(192, 101); this.button10.Margin = new System.Windows.Forms.Padding(4); this.button10.Name = "button10"; this.button10.Size = new System.Drawing.Size(124, 29); this.button10.TabIndex = 5; this.button10.Text = "OP0501 读ç "; this.button10.UseVisualStyleBackColor = true; this.button10.Click += new System.EventHandler(this.button10_Click); // // button9 // this.button9.Location = new System.Drawing.Point(192, 138); this.button9.Margin = new System.Windows.Forms.Padding(4); this.button9.Name = "button9"; this.button9.Size = new System.Drawing.Size(124, 29); this.button9.TabIndex = 4; this.button9.Text = "OP3001读ç "; this.button9.UseVisualStyleBackColor = true; this.button9.Click += new System.EventHandler(this.button9_Click); // // label34 // this.label34.AutoSize = true; this.label34.Location = new System.Drawing.Point(16, 55); this.label34.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(52, 15); this.label34.TabIndex = 3; this.label34.Text = "工件å·"; // // textBox10 // this.textBox10.Location = new System.Drawing.Point(79, 24); this.textBox10.Margin = new System.Windows.Forms.Padding(4); this.textBox10.Multiline = true; this.textBox10.Name = "textBox10"; this.textBox10.Size = new System.Drawing.Size(473, 53); this.textBox10.TabIndex = 2; this.textBox10.Text = "DZ045L2104250100001A1A\n"; // // button8 // this.button8.BackColor = System.Drawing.Color.OrangeRed; this.button8.Location = new System.Drawing.Point(37, 101); this.button8.Margin = new System.Windows.Forms.Padding(4); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(100, 54); this.button8.TabIndex = 1; this.button8.Text = "å¯å¨æ¨¡æ"; this.button8.UseVisualStyleBackColor = false; this.button8.Click += new System.EventHandler(this.button8_Click); // // button25 // this.button25.Location = new System.Drawing.Point(669, 329); this.button25.Margin = new System.Windows.Forms.Padding(4); this.button25.Name = "button25"; this.button25.Size = new System.Drawing.Size(153, 29); this.button25.TabIndex = 0; this.button25.Text = "å线ç¨åç¬æµè¯"; this.button25.UseVisualStyleBackColor = true; this.button25.Click += new System.EventHandler(this.button25_Click); // // button16 // this.button16.Location = new System.Drawing.Point(669, 246); this.button16.Margin = new System.Windows.Forms.Padding(4); this.button16.Name = "button16"; this.button16.Size = new System.Drawing.Size(100, 29); this.button16.TabIndex = 0; this.button16.Text = "button1"; this.button16.UseVisualStyleBackColor = true; this.button16.Click += new System.EventHandler(this.button16_Click); // // button26 // this.button26.Location = new System.Drawing.Point(900, 329); this.button26.Margin = new System.Windows.Forms.Padding(4); this.button26.Name = "button26"; this.button26.Size = new System.Drawing.Size(100, 29); this.button26.TabIndex = 0; this.button26.Text = "个å«çº¿ç¨è°è¯"; this.button26.UseVisualStyleBackColor = true; this.button26.Click += new System.EventHandler(this.button26_Click); // // button1 // this.button1.Location = new System.Drawing.Point(643, 151); this.button1.Margin = new System.Windows.Forms.Padding(4); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(100, 29); this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // tabPage2 // this.tabPage2.Controls.Add(this.groupBox10); this.tabPage2.Controls.Add(this.groupBox3); this.tabPage2.Controls.Add(this.groupBox2); this.tabPage2.Controls.Add(this.btn_StopAllThread); this.tabPage2.Controls.Add(this.btn_StartUpAllThread); this.tabPage2.Controls.Add(this.groupBox1); this.tabPage2.Location = new System.Drawing.Point(4, 25); this.tabPage2.Margin = new System.Windows.Forms.Padding(4); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(4); this.tabPage2.Size = new System.Drawing.Size(1443, 700); this.tabPage2.TabIndex = 1; this.tabPage2.Text = " çº¿ç¨æ§å¶"; this.tabPage2.UseVisualStyleBackColor = true; // // groupBox10 // this.groupBox10.Controls.Add(this.panel4); this.groupBox10.Location = new System.Drawing.Point(513, 119); this.groupBox10.Margin = new System.Windows.Forms.Padding(4); this.groupBox10.Name = "groupBox10"; this.groupBox10.Padding = new System.Windows.Forms.Padding(4); this.groupBox10.Size = new System.Drawing.Size(900, 286); this.groupBox10.TabIndex = 5; this.groupBox10.TabStop = false; this.groupBox10.Text = "HMI"; // // panel4 // this.panel4.AutoScroll = true; this.panel4.Controls.Add(this.HMIOP60Write); this.panel4.Controls.Add(this.HMIOP50Write); this.panel4.Controls.Add(this.HMIOP3035Write); this.panel4.Controls.Add(this.HMIOP20Write); this.panel4.Controls.Add(this.HMIOP1040Write); this.panel4.Controls.Add(this.lbl_Alert_HMIOP6001); this.panel4.Controls.Add(this.ckHMIOP60Reading); this.panel4.Controls.Add(this.lbl_Alert_HMIOP5001); this.panel4.Controls.Add(this.ckHMIOP50Reading); this.panel4.Controls.Add(this.lbl_Alert_HMIOP303501); this.panel4.Controls.Add(this.ckHMIOP3035Reading); this.panel4.Controls.Add(this.lbl_Alert_HMIOP6002); this.panel4.Controls.Add(this.lbl_Alert_HMIOP2001); this.panel4.Controls.Add(this.lbl_Alert_HMIOP5002); this.panel4.Controls.Add(this.ckHMIOP20Reading); this.panel4.Controls.Add(this.lbl_Alert_HMIOP303502); this.panel4.Controls.Add(this.lbl_Alert_HMIOP104001); this.panel4.Controls.Add(this.lbl_Alert_HMIOP2002); this.panel4.Controls.Add(this.ckHMIOP1040Reading); this.panel4.Controls.Add(this.lbl_Alert_HMIOP104002); this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; this.panel4.Location = new System.Drawing.Point(4, 22); this.panel4.Margin = new System.Windows.Forms.Padding(0); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(892, 260); this.panel4.TabIndex = 21; // // HMIOP60Write // this.HMIOP60Write.AutoSize = true; this.HMIOP60Write.Checked = true; this.HMIOP60Write.CheckState = System.Windows.Forms.CheckState.Checked; this.HMIOP60Write.Location = new System.Drawing.Point(16, 239); this.HMIOP60Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.HMIOP60Write.Name = "HMIOP60Write"; this.HMIOP60Write.Size = new System.Drawing.Size(145, 19); this.HMIOP60Write.TabIndex = 13; this.HMIOP60Write.Text = "HMIOP60åå ¥çæ§"; this.HMIOP60Write.UseVisualStyleBackColor = true; // // HMIOP50Write // this.HMIOP50Write.AutoSize = true; this.HMIOP50Write.Checked = true; this.HMIOP50Write.CheckState = System.Windows.Forms.CheckState.Checked; this.HMIOP50Write.Location = new System.Drawing.Point(16, 212); this.HMIOP50Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.HMIOP50Write.Name = "HMIOP50Write"; this.HMIOP50Write.Size = new System.Drawing.Size(145, 19); this.HMIOP50Write.TabIndex = 13; this.HMIOP50Write.Text = "HMIOP50åå ¥çæ§"; this.HMIOP50Write.UseVisualStyleBackColor = true; // // HMIOP3035Write // this.HMIOP3035Write.AutoSize = true; this.HMIOP3035Write.Checked = true; this.HMIOP3035Write.CheckState = System.Windows.Forms.CheckState.Checked; this.HMIOP3035Write.Location = new System.Drawing.Point(16, 186); this.HMIOP3035Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.HMIOP3035Write.Name = "HMIOP3035Write"; this.HMIOP3035Write.Size = new System.Drawing.Size(161, 19); this.HMIOP3035Write.TabIndex = 13; this.HMIOP3035Write.Text = "HMIOP3035åå ¥çæ§"; this.HMIOP3035Write.UseVisualStyleBackColor = true; // // HMIOP20Write // this.HMIOP20Write.AutoSize = true; this.HMIOP20Write.Checked = true; this.HMIOP20Write.CheckState = System.Windows.Forms.CheckState.Checked; this.HMIOP20Write.Location = new System.Drawing.Point(16, 160); this.HMIOP20Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.HMIOP20Write.Name = "HMIOP20Write"; this.HMIOP20Write.Size = new System.Drawing.Size(145, 19); this.HMIOP20Write.TabIndex = 13; this.HMIOP20Write.Text = "HMIOP20åå ¥çæ§"; this.HMIOP20Write.UseVisualStyleBackColor = true; // // HMIOP1040Write // this.HMIOP1040Write.AutoSize = true; this.HMIOP1040Write.Checked = true; this.HMIOP1040Write.CheckState = System.Windows.Forms.CheckState.Checked; this.HMIOP1040Write.Location = new System.Drawing.Point(16, 134); this.HMIOP1040Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.HMIOP1040Write.Name = "HMIOP1040Write"; this.HMIOP1040Write.Size = new System.Drawing.Size(161, 19); this.HMIOP1040Write.TabIndex = 13; this.HMIOP1040Write.Text = "HMIOP1040åå ¥çæ§"; this.HMIOP1040Write.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP6001 // this.lbl_Alert_HMIOP6001.AutoSize = true; this.lbl_Alert_HMIOP6001.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP6001.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP6001.Location = new System.Drawing.Point(367, 109); this.lbl_Alert_HMIOP6001.Name = "lbl_Alert_HMIOP6001"; this.lbl_Alert_HMIOP6001.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP6001.TabIndex = 14; this.lbl_Alert_HMIOP6001.Text = "æªè¿æ¥"; // // ckHMIOP60Reading // this.ckHMIOP60Reading.AutoSize = true; this.ckHMIOP60Reading.Checked = true; this.ckHMIOP60Reading.CheckState = System.Windows.Forms.CheckState.Checked; this.ckHMIOP60Reading.Location = new System.Drawing.Point(16, 108); this.ckHMIOP60Reading.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckHMIOP60Reading.Name = "ckHMIOP60Reading"; this.ckHMIOP60Reading.Size = new System.Drawing.Size(145, 19); this.ckHMIOP60Reading.TabIndex = 15; this.ckHMIOP60Reading.Text = "HMIOP60读åçæ§"; this.ckHMIOP60Reading.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP5001 // this.lbl_Alert_HMIOP5001.AutoSize = true; this.lbl_Alert_HMIOP5001.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP5001.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP5001.Location = new System.Drawing.Point(367, 84); this.lbl_Alert_HMIOP5001.Name = "lbl_Alert_HMIOP5001"; this.lbl_Alert_HMIOP5001.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP5001.TabIndex = 14; this.lbl_Alert_HMIOP5001.Text = "æªè¿æ¥"; // // ckHMIOP50Reading // this.ckHMIOP50Reading.AutoSize = true; this.ckHMIOP50Reading.Checked = true; this.ckHMIOP50Reading.CheckState = System.Windows.Forms.CheckState.Checked; this.ckHMIOP50Reading.Location = new System.Drawing.Point(16, 81); this.ckHMIOP50Reading.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckHMIOP50Reading.Name = "ckHMIOP50Reading"; this.ckHMIOP50Reading.Size = new System.Drawing.Size(145, 19); this.ckHMIOP50Reading.TabIndex = 15; this.ckHMIOP50Reading.Text = "HMIOP50读åçæ§"; this.ckHMIOP50Reading.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP303501 // this.lbl_Alert_HMIOP303501.AutoSize = true; this.lbl_Alert_HMIOP303501.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP303501.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP303501.Location = new System.Drawing.Point(367, 56); this.lbl_Alert_HMIOP303501.Name = "lbl_Alert_HMIOP303501"; this.lbl_Alert_HMIOP303501.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP303501.TabIndex = 14; this.lbl_Alert_HMIOP303501.Text = "æªè¿æ¥"; // // ckHMIOP3035Reading // this.ckHMIOP3035Reading.AutoSize = true; this.ckHMIOP3035Reading.Checked = true; this.ckHMIOP3035Reading.CheckState = System.Windows.Forms.CheckState.Checked; this.ckHMIOP3035Reading.Location = new System.Drawing.Point(16, 55); this.ckHMIOP3035Reading.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckHMIOP3035Reading.Name = "ckHMIOP3035Reading"; this.ckHMIOP3035Reading.Size = new System.Drawing.Size(161, 19); this.ckHMIOP3035Reading.TabIndex = 15; this.ckHMIOP3035Reading.Text = "HMIOP3035读åçæ§"; this.ckHMIOP3035Reading.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP6002 // this.lbl_Alert_HMIOP6002.AutoSize = true; this.lbl_Alert_HMIOP6002.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP6002.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP6002.Location = new System.Drawing.Point(367, 241); this.lbl_Alert_HMIOP6002.Name = "lbl_Alert_HMIOP6002"; this.lbl_Alert_HMIOP6002.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP6002.TabIndex = 18; this.lbl_Alert_HMIOP6002.Text = "æªè¿æ¥"; // // lbl_Alert_HMIOP2001 // this.lbl_Alert_HMIOP2001.AutoSize = true; this.lbl_Alert_HMIOP2001.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP2001.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP2001.Location = new System.Drawing.Point(367, 30); this.lbl_Alert_HMIOP2001.Name = "lbl_Alert_HMIOP2001"; this.lbl_Alert_HMIOP2001.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP2001.TabIndex = 14; this.lbl_Alert_HMIOP2001.Text = "æªè¿æ¥"; // // lbl_Alert_HMIOP5002 // this.lbl_Alert_HMIOP5002.AutoSize = true; this.lbl_Alert_HMIOP5002.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP5002.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP5002.Location = new System.Drawing.Point(367, 215); this.lbl_Alert_HMIOP5002.Name = "lbl_Alert_HMIOP5002"; this.lbl_Alert_HMIOP5002.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP5002.TabIndex = 18; this.lbl_Alert_HMIOP5002.Text = "æªè¿æ¥"; // // ckHMIOP20Reading // this.ckHMIOP20Reading.AutoSize = true; this.ckHMIOP20Reading.Checked = true; this.ckHMIOP20Reading.CheckState = System.Windows.Forms.CheckState.Checked; this.ckHMIOP20Reading.Location = new System.Drawing.Point(16, 29); this.ckHMIOP20Reading.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckHMIOP20Reading.Name = "ckHMIOP20Reading"; this.ckHMIOP20Reading.Size = new System.Drawing.Size(145, 19); this.ckHMIOP20Reading.TabIndex = 15; this.ckHMIOP20Reading.Text = "HMIOP20读åçæ§"; this.ckHMIOP20Reading.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP303502 // this.lbl_Alert_HMIOP303502.AutoSize = true; this.lbl_Alert_HMIOP303502.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP303502.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP303502.Location = new System.Drawing.Point(367, 189); this.lbl_Alert_HMIOP303502.Name = "lbl_Alert_HMIOP303502"; this.lbl_Alert_HMIOP303502.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP303502.TabIndex = 18; this.lbl_Alert_HMIOP303502.Text = "æªè¿æ¥"; // // lbl_Alert_HMIOP104001 // this.lbl_Alert_HMIOP104001.AutoSize = true; this.lbl_Alert_HMIOP104001.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP104001.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP104001.Location = new System.Drawing.Point(367, 4); this.lbl_Alert_HMIOP104001.Name = "lbl_Alert_HMIOP104001"; this.lbl_Alert_HMIOP104001.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP104001.TabIndex = 14; this.lbl_Alert_HMIOP104001.Text = "æªè¿æ¥"; // // lbl_Alert_HMIOP2002 // this.lbl_Alert_HMIOP2002.AutoSize = true; this.lbl_Alert_HMIOP2002.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP2002.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP2002.Location = new System.Drawing.Point(367, 162); this.lbl_Alert_HMIOP2002.Name = "lbl_Alert_HMIOP2002"; this.lbl_Alert_HMIOP2002.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP2002.TabIndex = 18; this.lbl_Alert_HMIOP2002.Text = "æªè¿æ¥"; // // ckHMIOP1040Reading // this.ckHMIOP1040Reading.AutoSize = true; this.ckHMIOP1040Reading.Checked = true; this.ckHMIOP1040Reading.CheckState = System.Windows.Forms.CheckState.Checked; this.ckHMIOP1040Reading.Location = new System.Drawing.Point(16, 2); this.ckHMIOP1040Reading.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckHMIOP1040Reading.Name = "ckHMIOP1040Reading"; this.ckHMIOP1040Reading.Size = new System.Drawing.Size(161, 19); this.ckHMIOP1040Reading.TabIndex = 15; this.ckHMIOP1040Reading.Text = "HMIOP1040读åçæ§"; this.ckHMIOP1040Reading.UseVisualStyleBackColor = true; // // lbl_Alert_HMIOP104002 // this.lbl_Alert_HMIOP104002.AutoSize = true; this.lbl_Alert_HMIOP104002.BackColor = System.Drawing.Color.White; this.lbl_Alert_HMIOP104002.ForeColor = System.Drawing.Color.Red; this.lbl_Alert_HMIOP104002.Location = new System.Drawing.Point(367, 136); this.lbl_Alert_HMIOP104002.Name = "lbl_Alert_HMIOP104002"; this.lbl_Alert_HMIOP104002.Size = new System.Drawing.Size(52, 15); this.lbl_Alert_HMIOP104002.TabIndex = 18; this.lbl_Alert_HMIOP104002.Text = "æªè¿æ¥"; // // groupBox3 // this.groupBox3.Controls.Add(this.panel3); this.groupBox3.Location = new System.Drawing.Point(8, 442); this.groupBox3.Margin = new System.Windows.Forms.Padding(4); this.groupBox3.Name = "groupBox3"; this.groupBox3.Padding = new System.Windows.Forms.Padding(4); this.groupBox3.Size = new System.Drawing.Size(447, 211); this.groupBox3.TabIndex = 4; this.groupBox3.TabStop = false; this.groupBox3.Text = "OP30"; // // panel3 // this.panel3.AutoScroll = true; this.panel3.Controls.Add(this.label35); this.panel3.Controls.Add(this.checkBox1); this.panel3.Controls.Add(this.label36); this.panel3.Controls.Add(this.checkBox2); this.panel3.Controls.Add(this.checkBox10); this.panel3.Controls.Add(this.label6); this.panel3.Controls.Add(this.label10); this.panel3.Controls.Add(this.checkBox6); this.panel3.Controls.Add(this.checkBox9); this.panel3.Controls.Add(this.label7); this.panel3.Controls.Add(this.checkBox8); this.panel3.Controls.Add(this.label8); this.panel3.Controls.Add(this.checkBox7); this.panel3.Controls.Add(this.label9); this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(4, 22); this.panel3.Margin = new System.Windows.Forms.Padding(4); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(439, 185); this.panel3.TabIndex = 23; // // label35 // this.label35.AutoSize = true; this.label35.BackColor = System.Drawing.Color.White; this.label35.ForeColor = System.Drawing.Color.Red; this.label35.Location = new System.Drawing.Point(224, 158); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(52, 15); this.label35.TabIndex = 30; this.label35.Text = "æªè¿æ¥"; // // checkBox1 // this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox1.Location = new System.Drawing.Point(16, 156); this.checkBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(89, 19); this.checkBox1.TabIndex = 29; this.checkBox1.Text = "å¿è·³çæ§"; this.checkBox1.UseVisualStyleBackColor = true; // // label36 // this.label36.AutoSize = true; this.label36.BackColor = System.Drawing.Color.White; this.label36.ForeColor = System.Drawing.Color.Red; this.label36.Location = new System.Drawing.Point(224, 132); this.label36.Name = "label36"; this.label36.Size = new System.Drawing.Size(52, 15); this.label36.TabIndex = 28; this.label36.Text = "æªè¿æ¥"; // // checkBox2 // this.checkBox2.AutoSize = true; this.checkBox2.Checked = true; this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox2.Location = new System.Drawing.Point(16, 131); this.checkBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(119, 19); this.checkBox2.TabIndex = 27; this.checkBox2.Text = "æ¥è¦ä¿¡æ¯çæ§"; this.checkBox2.UseVisualStyleBackColor = true; // // checkBox10 // this.checkBox10.AutoSize = true; this.checkBox10.Checked = true; this.checkBox10.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox10.Location = new System.Drawing.Point(17, 5); this.checkBox10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox10.Name = "checkBox10"; this.checkBox10.Size = new System.Drawing.Size(119, 19); this.checkBox10.TabIndex = 13; this.checkBox10.Text = "读ç å®æçæ§"; this.checkBox10.UseVisualStyleBackColor = true; // // label6 // this.label6.AutoSize = true; this.label6.BackColor = System.Drawing.Color.White; this.label6.ForeColor = System.Drawing.Color.Red; this.label6.Location = new System.Drawing.Point(225, 106); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(52, 15); this.label6.TabIndex = 22; this.label6.Text = "æªè¿æ¥"; // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.White; this.label10.ForeColor = System.Drawing.Color.Red; this.label10.Location = new System.Drawing.Point(225, 5); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(52, 15); this.label10.TabIndex = 14; this.label10.Text = "æªè¿æ¥"; // // checkBox6 // this.checkBox6.AutoSize = true; this.checkBox6.Checked = true; this.checkBox6.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox6.Location = new System.Drawing.Point(17, 105); this.checkBox6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox6.Name = "checkBox6"; this.checkBox6.Size = new System.Drawing.Size(119, 19); this.checkBox6.TabIndex = 21; this.checkBox6.Text = "å·¥åºå®æçæ§"; this.checkBox6.UseVisualStyleBackColor = true; // // checkBox9 // this.checkBox9.AutoSize = true; this.checkBox9.Checked = true; this.checkBox9.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox9.Location = new System.Drawing.Point(17, 30); this.checkBox9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox9.Name = "checkBox9"; this.checkBox9.Size = new System.Drawing.Size(119, 19); this.checkBox9.TabIndex = 15; this.checkBox9.Text = "æµéå®æçæ§"; this.checkBox9.UseVisualStyleBackColor = true; // // label7 // this.label7.AutoSize = true; this.label7.BackColor = System.Drawing.Color.White; this.label7.ForeColor = System.Drawing.Color.Red; this.label7.Location = new System.Drawing.Point(225, 81); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(52, 15); this.label7.TabIndex = 20; this.label7.Text = "æªè¿æ¥"; // // checkBox8 // this.checkBox8.AutoSize = true; this.checkBox8.Checked = true; this.checkBox8.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox8.Location = new System.Drawing.Point(17, 55); this.checkBox8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox8.Name = "checkBox8"; this.checkBox8.Size = new System.Drawing.Size(119, 19); this.checkBox8.TabIndex = 16; this.checkBox8.Text = "工件æ¨åºçæ§"; this.checkBox8.UseVisualStyleBackColor = true; // // label8 // this.label8.AutoSize = true; this.label8.BackColor = System.Drawing.Color.White; this.label8.ForeColor = System.Drawing.Color.Red; this.label8.Location = new System.Drawing.Point(225, 55); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(52, 15); this.label8.TabIndex = 19; this.label8.Text = "æªè¿æ¥"; // // checkBox7 // this.checkBox7.AutoSize = true; this.checkBox7.Checked = true; this.checkBox7.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox7.Location = new System.Drawing.Point(17, 80); this.checkBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBox7.Name = "checkBox7"; this.checkBox7.Size = new System.Drawing.Size(143, 19); this.checkBox7.TabIndex = 17; this.checkBox7.Text = "工件SPCæ¨åºçæ§"; this.checkBox7.UseVisualStyleBackColor = true; // // label9 // this.label9.AutoSize = true; this.label9.BackColor = System.Drawing.Color.White; this.label9.ForeColor = System.Drawing.Color.Red; this.label9.Location = new System.Drawing.Point(225, 31); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(52, 15); this.label9.TabIndex = 18; this.label9.Text = "æªè¿æ¥"; // // groupBox2 // this.groupBox2.Controls.Add(this.panel2); this.groupBox2.Location = new System.Drawing.Point(8, 235); this.groupBox2.Margin = new System.Windows.Forms.Padding(4); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(4); this.groupBox2.Size = new System.Drawing.Size(447, 204); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "OP20"; // // panel2 // this.panel2.AutoScroll = true; this.panel2.Controls.Add(this.lbl_Alter_OP2007); this.panel2.Controls.Add(this.ckBOP2007); this.panel2.Controls.Add(this.ckBOP2001); this.panel2.Controls.Add(this.lbl_Alter_OP2006); this.panel2.Controls.Add(this.lbl_Alter_OP2001); this.panel2.Controls.Add(this.ckBOP2006); this.panel2.Controls.Add(this.ckBOP2002); this.panel2.Controls.Add(this.lbl_Alter_OP2005); this.panel2.Controls.Add(this.ckBOP2003); this.panel2.Controls.Add(this.ckBOP2005); this.panel2.Controls.Add(this.ckBOP2004); this.panel2.Controls.Add(this.lbl_Alter_OP2004); this.panel2.Controls.Add(this.lbl_Alter_OP2002); this.panel2.Controls.Add(this.lbl_Alter_OP2003); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(4, 22); this.panel2.Margin = new System.Windows.Forms.Padding(4); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(439, 178); this.panel2.TabIndex = 25; // // lbl_Alter_OP2007 // this.lbl_Alter_OP2007.AutoSize = true; this.lbl_Alter_OP2007.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2007.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2007.Location = new System.Drawing.Point(227, 154); this.lbl_Alter_OP2007.Name = "lbl_Alter_OP2007"; this.lbl_Alter_OP2007.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2007.TabIndex = 26; this.lbl_Alter_OP2007.Text = "æªè¿æ¥"; // // ckBOP2007 // this.ckBOP2007.AutoSize = true; this.ckBOP2007.Checked = true; this.ckBOP2007.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2007.Location = new System.Drawing.Point(19, 152); this.ckBOP2007.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2007.Name = "ckBOP2007"; this.ckBOP2007.Size = new System.Drawing.Size(89, 19); this.ckBOP2007.TabIndex = 25; this.ckBOP2007.Text = "å¿è·³çæ§"; this.ckBOP2007.UseVisualStyleBackColor = true; // // ckBOP2001 // this.ckBOP2001.AutoSize = true; this.ckBOP2001.Checked = true; this.ckBOP2001.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2001.Location = new System.Drawing.Point(19, 2); this.ckBOP2001.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2001.Name = "ckBOP2001"; this.ckBOP2001.Size = new System.Drawing.Size(119, 19); this.ckBOP2001.TabIndex = 13; this.ckBOP2001.Text = "读ç å®æçæ§"; this.ckBOP2001.UseVisualStyleBackColor = true; // // lbl_Alter_OP2006 // this.lbl_Alter_OP2006.AutoSize = true; this.lbl_Alter_OP2006.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2006.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2006.Location = new System.Drawing.Point(227, 129); this.lbl_Alter_OP2006.Name = "lbl_Alter_OP2006"; this.lbl_Alter_OP2006.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2006.TabIndex = 24; this.lbl_Alter_OP2006.Text = "æªè¿æ¥"; // // lbl_Alter_OP2001 // this.lbl_Alter_OP2001.AutoSize = true; this.lbl_Alter_OP2001.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2001.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2001.Location = new System.Drawing.Point(227, 2); this.lbl_Alter_OP2001.Name = "lbl_Alter_OP2001"; this.lbl_Alter_OP2001.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2001.TabIndex = 14; this.lbl_Alter_OP2001.Text = "æªè¿æ¥"; // // ckBOP2006 // this.ckBOP2006.AutoSize = true; this.ckBOP2006.Checked = true; this.ckBOP2006.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2006.Location = new System.Drawing.Point(19, 128); this.ckBOP2006.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2006.Name = "ckBOP2006"; this.ckBOP2006.Size = new System.Drawing.Size(119, 19); this.ckBOP2006.TabIndex = 23; this.ckBOP2006.Text = "æ¥è¦ä¿¡æ¯çæ§"; this.ckBOP2006.UseVisualStyleBackColor = true; // // ckBOP2002 // this.ckBOP2002.AutoSize = true; this.ckBOP2002.Checked = true; this.ckBOP2002.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2002.Location = new System.Drawing.Point(19, 28); this.ckBOP2002.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2002.Name = "ckBOP2002"; this.ckBOP2002.Size = new System.Drawing.Size(119, 19); this.ckBOP2002.TabIndex = 15; this.ckBOP2002.Text = "æµéå®æçæ§"; this.ckBOP2002.UseVisualStyleBackColor = true; // // lbl_Alter_OP2005 // this.lbl_Alter_OP2005.AutoSize = true; this.lbl_Alter_OP2005.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2005.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2005.Location = new System.Drawing.Point(227, 104); this.lbl_Alter_OP2005.Name = "lbl_Alter_OP2005"; this.lbl_Alter_OP2005.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2005.TabIndex = 22; this.lbl_Alter_OP2005.Text = "æªè¿æ¥"; // // ckBOP2003 // this.ckBOP2003.AutoSize = true; this.ckBOP2003.Checked = true; this.ckBOP2003.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2003.Location = new System.Drawing.Point(19, 52); this.ckBOP2003.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2003.Name = "ckBOP2003"; this.ckBOP2003.Size = new System.Drawing.Size(119, 19); this.ckBOP2003.TabIndex = 16; this.ckBOP2003.Text = "工件æ¨åºçæ§"; this.ckBOP2003.UseVisualStyleBackColor = true; // // ckBOP2005 // this.ckBOP2005.AutoSize = true; this.ckBOP2005.Checked = true; this.ckBOP2005.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2005.Location = new System.Drawing.Point(19, 102); this.ckBOP2005.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2005.Name = "ckBOP2005"; this.ckBOP2005.Size = new System.Drawing.Size(119, 19); this.ckBOP2005.TabIndex = 21; this.ckBOP2005.Text = "å·¥åºå®æçæ§"; this.ckBOP2005.UseVisualStyleBackColor = true; // // ckBOP2004 // this.ckBOP2004.AutoSize = true; this.ckBOP2004.Checked = true; this.ckBOP2004.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP2004.Location = new System.Drawing.Point(19, 78); this.ckBOP2004.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP2004.Name = "ckBOP2004"; this.ckBOP2004.Size = new System.Drawing.Size(143, 19); this.ckBOP2004.TabIndex = 17; this.ckBOP2004.Text = "工件SPCæ¨åºçæ§"; this.ckBOP2004.UseVisualStyleBackColor = true; // // lbl_Alter_OP2004 // this.lbl_Alter_OP2004.AutoSize = true; this.lbl_Alter_OP2004.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2004.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2004.Location = new System.Drawing.Point(227, 79); this.lbl_Alter_OP2004.Name = "lbl_Alter_OP2004"; this.lbl_Alter_OP2004.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2004.TabIndex = 20; this.lbl_Alter_OP2004.Text = "æªè¿æ¥"; // // lbl_Alter_OP2002 // this.lbl_Alter_OP2002.AutoSize = true; this.lbl_Alter_OP2002.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2002.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2002.Location = new System.Drawing.Point(227, 29); this.lbl_Alter_OP2002.Name = "lbl_Alter_OP2002"; this.lbl_Alter_OP2002.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2002.TabIndex = 18; this.lbl_Alter_OP2002.Text = "æªè¿æ¥"; // // lbl_Alter_OP2003 // this.lbl_Alter_OP2003.AutoSize = true; this.lbl_Alter_OP2003.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP2003.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP2003.Location = new System.Drawing.Point(227, 52); this.lbl_Alter_OP2003.Name = "lbl_Alter_OP2003"; this.lbl_Alter_OP2003.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP2003.TabIndex = 19; this.lbl_Alter_OP2003.Text = "æªè¿æ¥"; // // btn_StopAllThread // this.btn_StopAllThread.Location = new System.Drawing.Point(375, 32); this.btn_StopAllThread.Margin = new System.Windows.Forms.Padding(4); this.btn_StopAllThread.Name = "btn_StopAllThread"; this.btn_StopAllThread.Size = new System.Drawing.Size(195, 41); this.btn_StopAllThread.TabIndex = 2; this.btn_StopAllThread.Text = "忢ææéä¸çº¿ç¨"; this.btn_StopAllThread.UseVisualStyleBackColor = true; // // btn_StartUpAllThread // this.btn_StartUpAllThread.Location = new System.Drawing.Point(64, 32); this.btn_StartUpAllThread.Margin = new System.Windows.Forms.Padding(4); this.btn_StartUpAllThread.Name = "btn_StartUpAllThread"; this.btn_StartUpAllThread.Size = new System.Drawing.Size(195, 41); this.btn_StartUpAllThread.TabIndex = 1; this.btn_StartUpAllThread.Text = "å¯å¨ææéä¸çº¿ç¨"; this.btn_StartUpAllThread.UseVisualStyleBackColor = true; this.btn_StartUpAllThread.Click += new System.EventHandler(this.btn_StartUpAllThread_Click); // // groupBox1 // this.groupBox1.Controls.Add(this.panel1); this.groupBox1.Location = new System.Drawing.Point(8, 110); this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(4); this.groupBox1.Size = new System.Drawing.Size(447, 125); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "OP05"; // // panel1 // this.panel1.AutoScroll = true; this.panel1.Controls.Add(this.ckBOP0501); this.panel1.Controls.Add(this.lbl_Alter_OP0504); this.panel1.Controls.Add(this.lbl_Alter_OP0501); this.panel1.Controls.Add(this.lbl_Alter_OP0503); this.panel1.Controls.Add(this.ckBOP0502); this.panel1.Controls.Add(this.lbl_Alter_OP0502); this.panel1.Controls.Add(this.ckBOP0503); this.panel1.Controls.Add(this.ckBOP0504); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(4, 22); this.panel1.Margin = new System.Windows.Forms.Padding(0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(439, 99); this.panel1.TabIndex = 21; // // ckBOP0501 // this.ckBOP0501.AutoSize = true; this.ckBOP0501.Checked = true; this.ckBOP0501.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP0501.Location = new System.Drawing.Point(16, 2); this.ckBOP0501.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP0501.Name = "ckBOP0501"; this.ckBOP0501.Size = new System.Drawing.Size(119, 19); this.ckBOP0501.TabIndex = 13; this.ckBOP0501.Text = "æç å®æçæ§"; this.ckBOP0501.UseVisualStyleBackColor = true; this.ckBOP0501.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // // lbl_Alter_OP0504 // this.lbl_Alter_OP0504.AutoSize = true; this.lbl_Alter_OP0504.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP0504.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP0504.Location = new System.Drawing.Point(224, 79); this.lbl_Alter_OP0504.Name = "lbl_Alter_OP0504"; this.lbl_Alter_OP0504.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP0504.TabIndex = 20; this.lbl_Alter_OP0504.Text = "æªè¿æ¥"; // // lbl_Alter_OP0501 // this.lbl_Alter_OP0501.AutoSize = true; this.lbl_Alter_OP0501.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP0501.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP0501.Location = new System.Drawing.Point(224, 2); this.lbl_Alter_OP0501.Name = "lbl_Alter_OP0501"; this.lbl_Alter_OP0501.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP0501.TabIndex = 14; this.lbl_Alter_OP0501.Text = "æªè¿æ¥"; // // lbl_Alter_OP0503 // this.lbl_Alter_OP0503.AutoSize = true; this.lbl_Alter_OP0503.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP0503.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP0503.Location = new System.Drawing.Point(224, 52); this.lbl_Alter_OP0503.Name = "lbl_Alter_OP0503"; this.lbl_Alter_OP0503.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP0503.TabIndex = 19; this.lbl_Alter_OP0503.Text = "æªè¿æ¥"; // // ckBOP0502 // this.ckBOP0502.AutoSize = true; this.ckBOP0502.Checked = true; this.ckBOP0502.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP0502.Location = new System.Drawing.Point(16, 28); this.ckBOP0502.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP0502.Name = "ckBOP0502"; this.ckBOP0502.Size = new System.Drawing.Size(119, 19); this.ckBOP0502.TabIndex = 15; this.ckBOP0502.Text = "读ç å®æçæ§"; this.ckBOP0502.UseVisualStyleBackColor = true; this.ckBOP0502.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // // lbl_Alter_OP0502 // this.lbl_Alter_OP0502.AutoSize = true; this.lbl_Alter_OP0502.BackColor = System.Drawing.Color.White; this.lbl_Alter_OP0502.ForeColor = System.Drawing.Color.Red; this.lbl_Alter_OP0502.Location = new System.Drawing.Point(224, 29); this.lbl_Alter_OP0502.Name = "lbl_Alter_OP0502"; this.lbl_Alter_OP0502.Size = new System.Drawing.Size(52, 15); this.lbl_Alter_OP0502.TabIndex = 18; this.lbl_Alter_OP0502.Text = "æªè¿æ¥"; // // ckBOP0503 // this.ckBOP0503.AutoSize = true; this.ckBOP0503.Checked = true; this.ckBOP0503.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP0503.Location = new System.Drawing.Point(16, 52); this.ckBOP0503.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP0503.Name = "ckBOP0503"; this.ckBOP0503.Size = new System.Drawing.Size(119, 19); this.ckBOP0503.TabIndex = 16; this.ckBOP0503.Text = "工件æ¨åºçæ§"; this.ckBOP0503.UseVisualStyleBackColor = true; this.ckBOP0503.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // // ckBOP0504 // this.ckBOP0504.AutoSize = true; this.ckBOP0504.Checked = true; this.ckBOP0504.CheckState = System.Windows.Forms.CheckState.Checked; this.ckBOP0504.Location = new System.Drawing.Point(16, 78); this.ckBOP0504.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ckBOP0504.Name = "ckBOP0504"; this.ckBOP0504.Size = new System.Drawing.Size(119, 19); this.ckBOP0504.TabIndex = 17; this.ckBOP0504.Text = "å·¥åºå®æçæ§"; this.ckBOP0504.UseVisualStyleBackColor = true; this.ckBOP0504.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // // tabPage3 // this.tabPage3.Controls.Add(this.groupBox7); this.tabPage3.Controls.Add(this.groupBox5); this.tabPage3.Controls.Add(this.groupBox4); this.tabPage3.Location = new System.Drawing.Point(4, 25); this.tabPage3.Margin = new System.Windows.Forms.Padding(4); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(4); this.tabPage3.Size = new System.Drawing.Size(1443, 700); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "æ°æ®æ¶éç¹é ç½®"; this.tabPage3.UseVisualStyleBackColor = true; // // groupBox7 // this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox7.Controls.Add(this.txt_ID); this.groupBox7.Controls.Add(this.label19); this.groupBox7.Controls.Add(this.cbox_DataCapturePLCType); this.groupBox7.Controls.Add(this.txt_PLCPort); this.groupBox7.Controls.Add(this.label18); this.groupBox7.Controls.Add(this.cbox_DataCaptureColumnType); this.groupBox7.Controls.Add(this.cbox_DataCaptureType); this.groupBox7.Controls.Add(this.cbox_WorkingProcedure); this.groupBox7.Controls.Add(this.txt_DbNumber); this.groupBox7.Controls.Add(this.btn_Cancel); this.groupBox7.Controls.Add(this.btn_Save); this.groupBox7.Controls.Add(this.label15); this.groupBox7.Controls.Add(this.txt_Offset); this.groupBox7.Controls.Add(this.label14); this.groupBox7.Controls.Add(this.label13); this.groupBox7.Controls.Add(this.txt_DataCapturePointCode); this.groupBox7.Controls.Add(this.label12); this.groupBox7.Controls.Add(this.txt_DataCapturePointCname); this.groupBox7.Controls.Add(this.label11); this.groupBox7.Controls.Add(this.label5); this.groupBox7.Controls.Add(this.label4); this.groupBox7.Controls.Add(this.txt_PLCIP); this.groupBox7.Controls.Add(this.label3); this.groupBox7.Controls.Add(this.label2); this.groupBox7.Controls.Add(this.txt_EquipmentID); this.groupBox7.Controls.Add(this.label1); this.groupBox7.Location = new System.Drawing.Point(4, 515); this.groupBox7.Margin = new System.Windows.Forms.Padding(4); this.groupBox7.Name = "groupBox7"; this.groupBox7.Padding = new System.Windows.Forms.Padding(4); this.groupBox7.Size = new System.Drawing.Size(1420, 168); this.groupBox7.TabIndex = 4; this.groupBox7.TabStop = false; this.groupBox7.Text = "ç¼è¾æ¶éç¹ä¿¡æ¯"; this.groupBox7.Visible = false; // // txt_ID // this.txt_ID.Location = new System.Drawing.Point(124, 101); this.txt_ID.Margin = new System.Windows.Forms.Padding(4); this.txt_ID.Name = "txt_ID"; this.txt_ID.Size = new System.Drawing.Size(132, 25); this.txt_ID.TabIndex = 27; this.txt_ID.Visible = false; // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(29, 105); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(68, 15); this.label19.TabIndex = 26; this.label19.Text = "主é®IDï¼"; this.label19.Visible = false; // // cbox_DataCapturePLCType // this.cbox_DataCapturePLCType.FormattingEnabled = true; this.cbox_DataCapturePLCType.Location = new System.Drawing.Point(439, 26); this.cbox_DataCapturePLCType.Margin = new System.Windows.Forms.Padding(4); this.cbox_DataCapturePLCType.Name = "cbox_DataCapturePLCType"; this.cbox_DataCapturePLCType.Size = new System.Drawing.Size(132, 23); this.cbox_DataCapturePLCType.TabIndex = 25; // // txt_PLCPort // this.txt_PLCPort.Location = new System.Drawing.Point(439, 94); this.txt_PLCPort.Margin = new System.Windows.Forms.Padding(4); this.txt_PLCPort.Name = "txt_PLCPort"; this.txt_PLCPort.Size = new System.Drawing.Size(132, 25); this.txt_PLCPort.TabIndex = 24; this.txt_PLCPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_PLCPort_KeyPress); // // label18 // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(352, 98); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(76, 15); this.label18.TabIndex = 23; this.label18.Text = "PLC端å£ï¼"; // // cbox_DataCaptureColumnType // this.cbox_DataCaptureColumnType.FormattingEnabled = true; this.cbox_DataCaptureColumnType.Items.AddRange(new object[] { "Int", "DInt", "Char", "Real", "Bool", "String"}); this.cbox_DataCaptureColumnType.Location = new System.Drawing.Point(1029, 98); this.cbox_DataCaptureColumnType.Margin = new System.Windows.Forms.Padding(4); this.cbox_DataCaptureColumnType.Name = "cbox_DataCaptureColumnType"; this.cbox_DataCaptureColumnType.Size = new System.Drawing.Size(132, 23); this.cbox_DataCaptureColumnType.TabIndex = 22; // // cbox_DataCaptureType // this.cbox_DataCaptureType.FormattingEnabled = true; this.cbox_DataCaptureType.Location = new System.Drawing.Point(720, 90); this.cbox_DataCaptureType.Margin = new System.Windows.Forms.Padding(4); this.cbox_DataCaptureType.Name = "cbox_DataCaptureType"; this.cbox_DataCaptureType.Size = new System.Drawing.Size(132, 23); this.cbox_DataCaptureType.TabIndex = 21; // // cbox_WorkingProcedure // this.cbox_WorkingProcedure.FormattingEnabled = true; this.cbox_WorkingProcedure.Items.AddRange(new object[] { "OP05", "OP10", "OP20", "OP30", "OP35", "OP40", "OP50", "OP60", "OP70", "OP80"}); this.cbox_WorkingProcedure.Location = new System.Drawing.Point(124, 61); this.cbox_WorkingProcedure.Margin = new System.Windows.Forms.Padding(4); this.cbox_WorkingProcedure.Name = "cbox_WorkingProcedure"; this.cbox_WorkingProcedure.Size = new System.Drawing.Size(132, 23); this.cbox_WorkingProcedure.TabIndex = 20; // // txt_DbNumber // this.txt_DbNumber.Location = new System.Drawing.Point(1029, 26); this.txt_DbNumber.Margin = new System.Windows.Forms.Padding(4); this.txt_DbNumber.Name = "txt_DbNumber"; this.txt_DbNumber.Size = new System.Drawing.Size(132, 25); this.txt_DbNumber.TabIndex = 19; // // btn_Cancel // this.btn_Cancel.Location = new System.Drawing.Point(660, 126); this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4); this.btn_Cancel.Name = "btn_Cancel"; this.btn_Cancel.Size = new System.Drawing.Size(100, 29); this.btn_Cancel.TabIndex = 3; this.btn_Cancel.Text = "åæ¶"; this.btn_Cancel.UseVisualStyleBackColor = true; this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click); // // btn_Save // this.btn_Save.Location = new System.Drawing.Point(552, 126); this.btn_Save.Margin = new System.Windows.Forms.Padding(4); this.btn_Save.Name = "btn_Save"; this.btn_Save.Size = new System.Drawing.Size(100, 29); this.btn_Save.TabIndex = 2; this.btn_Save.Text = "ä¿å"; this.btn_Save.UseVisualStyleBackColor = true; this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click); // // label15 // this.label15.AutoSize = true; this.label15.Location = new System.Drawing.Point(903, 30); this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(113, 15); this.label15.TabIndex = 18; this.label15.Text = "èç¹DBåå°åï¼"; // // txt_Offset // this.txt_Offset.Location = new System.Drawing.Point(1029, 60); this.txt_Offset.Margin = new System.Windows.Forms.Padding(4); this.txt_Offset.Name = "txt_Offset"; this.txt_Offset.Size = new System.Drawing.Size(132, 25); this.txt_Offset.TabIndex = 17; // // label14 // this.label14.AutoSize = true; this.label14.Location = new System.Drawing.Point(919, 64); this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(97, 15); this.label14.TabIndex = 16; this.label14.Text = "èç¹åç§»éï¼"; // // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(903, 101); this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(112, 15); this.label13.TabIndex = 14; this.label13.Text = "èç¹æ°æ®ç±»åï¼"; // // txt_DataCapturePointCode // this.txt_DataCapturePointCode.Location = new System.Drawing.Point(720, 26); this.txt_DataCapturePointCode.Margin = new System.Windows.Forms.Padding(4); this.txt_DataCapturePointCode.Name = "txt_DataCapturePointCode"; this.txt_DataCapturePointCode.Size = new System.Drawing.Size(132, 25); this.txt_DataCapturePointCode.TabIndex = 13; // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(609, 30); this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(97, 15); this.label12.TabIndex = 12; this.label12.Text = "æ¶éç¹ä»£ç ï¼"; // // txt_DataCapturePointCname // this.txt_DataCapturePointCname.Location = new System.Drawing.Point(720, 60); this.txt_DataCapturePointCname.Margin = new System.Windows.Forms.Padding(4); this.txt_DataCapturePointCname.Name = "txt_DataCapturePointCname"; this.txt_DataCapturePointCname.Size = new System.Drawing.Size(132, 25); this.txt_DataCapturePointCname.TabIndex = 11; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(609, 64); this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(97, 15); this.label11.TabIndex = 10; this.label11.Text = "æ¶éç¹æè¿°ï¼"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(625, 98); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(82, 15); this.label5.TabIndex = 8; this.label5.Text = "æ¶éæ¹å¼ï¼"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(352, 30); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(76, 15); this.label4.TabIndex = 6; this.label4.Text = "PLCåå·ï¼"; // // txt_PLCIP // this.txt_PLCIP.Location = new System.Drawing.Point(439, 60); this.txt_PLCIP.Margin = new System.Windows.Forms.Padding(4); this.txt_PLCIP.Name = "txt_PLCIP"; this.txt_PLCIP.Size = new System.Drawing.Size(132, 25); this.txt_PLCIP.TabIndex = 5; this.txt_PLCIP.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_PLCIP_KeyPress); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(328, 64); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 15); this.label3.TabIndex = 4; this.label3.Text = "PLC IPå°åï¼"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(45, 64); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(67, 15); this.label2.TabIndex = 2; this.label2.Text = "å·¥åºå·ï¼"; // // txt_EquipmentID // this.txt_EquipmentID.Location = new System.Drawing.Point(124, 26); this.txt_EquipmentID.Margin = new System.Windows.Forms.Padding(4); this.txt_EquipmentID.Name = "txt_EquipmentID"; this.txt_EquipmentID.Size = new System.Drawing.Size(132, 25); this.txt_EquipmentID.TabIndex = 1; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(29, 30); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(82, 15); this.label1.TabIndex = 0; this.label1.Text = "设å¤ç¼å·ï¼"; // // groupBox5 // this.groupBox5.Controls.Add(this.btn_Delete); this.groupBox5.Controls.Add(this.dgv_DataCaptureConfig); this.groupBox5.Controls.Add(this.btn_Update); this.groupBox5.Controls.Add(this.btn_Insert); this.groupBox5.Location = new System.Drawing.Point(4, 89); this.groupBox5.Margin = new System.Windows.Forms.Padding(4); this.groupBox5.Name = "groupBox5"; this.groupBox5.Padding = new System.Windows.Forms.Padding(4); this.groupBox5.Size = new System.Drawing.Size(1428, 419); this.groupBox5.TabIndex = 1; this.groupBox5.TabStop = false; this.groupBox5.Text = "æ¶éç¹ä¿¡æ¯"; // // btn_Delete // this.btn_Delete.Location = new System.Drawing.Point(720, 382); this.btn_Delete.Margin = new System.Windows.Forms.Padding(4); this.btn_Delete.Name = "btn_Delete"; this.btn_Delete.Size = new System.Drawing.Size(100, 29); this.btn_Delete.TabIndex = 7; this.btn_Delete.Text = "å é¤"; this.btn_Delete.UseVisualStyleBackColor = true; this.btn_Delete.Click += new System.EventHandler(this.btn_Delete_Click); // // dgv_DataCaptureConfig // this.dgv_DataCaptureConfig.AllowUserToAddRows = false; this.dgv_DataCaptureConfig.AllowUserToDeleteRows = false; this.dgv_DataCaptureConfig.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgv_DataCaptureConfig.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.EquipmentID, this.WorkingProcedure, this.DataCapturePointCode, this.DataCapturePointCname, this.DataCaptureType, this.DataCapturePLCType, this.PLCIP, this.PLCPort, this.DataCaptureColumn, this.DataCaptureColumnType}); this.dgv_DataCaptureConfig.Location = new System.Drawing.Point(4, 21); this.dgv_DataCaptureConfig.Margin = new System.Windows.Forms.Padding(4); this.dgv_DataCaptureConfig.MultiSelect = false; this.dgv_DataCaptureConfig.Name = "dgv_DataCaptureConfig"; this.dgv_DataCaptureConfig.ReadOnly = true; this.dgv_DataCaptureConfig.RowHeadersWidth = 51; this.dgv_DataCaptureConfig.RowTemplate.Height = 23; this.dgv_DataCaptureConfig.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgv_DataCaptureConfig.Size = new System.Drawing.Size(1420, 354); this.dgv_DataCaptureConfig.TabIndex = 3; // // EquipmentID // this.EquipmentID.DataPropertyName = "EquipmentID"; this.EquipmentID.HeaderText = "设å¤ç¼å·"; this.EquipmentID.MinimumWidth = 6; this.EquipmentID.Name = "EquipmentID"; this.EquipmentID.ReadOnly = true; this.EquipmentID.Width = 125; // // WorkingProcedure // this.WorkingProcedure.DataPropertyName = "WorkingProcedure"; this.WorkingProcedure.HeaderText = "å·¥åºå·"; this.WorkingProcedure.MinimumWidth = 6; this.WorkingProcedure.Name = "WorkingProcedure"; this.WorkingProcedure.ReadOnly = true; this.WorkingProcedure.Width = 125; // // DataCapturePointCode // this.DataCapturePointCode.DataPropertyName = "DataCapturePointCode"; this.DataCapturePointCode.HeaderText = "æ°æ®æ¶éç¹ä»£ç "; this.DataCapturePointCode.MinimumWidth = 6; this.DataCapturePointCode.Name = "DataCapturePointCode"; this.DataCapturePointCode.ReadOnly = true; this.DataCapturePointCode.Width = 125; // // DataCapturePointCname // this.DataCapturePointCname.DataPropertyName = "DataCapturePointCname"; this.DataCapturePointCname.HeaderText = "æ¶éæ¶éç¹æè¿°"; this.DataCapturePointCname.MinimumWidth = 6; this.DataCapturePointCname.Name = "DataCapturePointCname"; this.DataCapturePointCname.ReadOnly = true; this.DataCapturePointCname.Width = 125; // // DataCaptureType // this.DataCaptureType.DataPropertyName = "DataCaptureType"; this.DataCaptureType.HeaderText = "æ¶éæ¹å¼"; this.DataCaptureType.MinimumWidth = 6; this.DataCaptureType.Name = "DataCaptureType"; this.DataCaptureType.ReadOnly = true; this.DataCaptureType.Width = 125; // // DataCapturePLCType // this.DataCapturePLCType.DataPropertyName = "DataCapturePLCType"; this.DataCapturePLCType.HeaderText = "æ¶éPLCåå·"; this.DataCapturePLCType.MinimumWidth = 6; this.DataCapturePLCType.Name = "DataCapturePLCType"; this.DataCapturePLCType.ReadOnly = true; this.DataCapturePLCType.Width = 125; // // PLCIP // this.PLCIP.DataPropertyName = "PLCIP"; this.PLCIP.HeaderText = "PLCçIPå°å"; this.PLCIP.MinimumWidth = 6; this.PLCIP.Name = "PLCIP"; this.PLCIP.ReadOnly = true; this.PLCIP.Width = 125; // // PLCPort // this.PLCPort.DataPropertyName = "PLCPort"; this.PLCPort.HeaderText = "PLC端å£"; this.PLCPort.MinimumWidth = 6; this.PLCPort.Name = "PLCPort"; this.PLCPort.ReadOnly = true; this.PLCPort.Width = 125; // // DataCaptureColumn // this.DataCaptureColumn.DataPropertyName = "DataCaptureColumn"; this.DataCaptureColumn.HeaderText = "æ¶éåæ®µå"; this.DataCaptureColumn.MinimumWidth = 6; this.DataCaptureColumn.Name = "DataCaptureColumn"; this.DataCaptureColumn.ReadOnly = true; this.DataCaptureColumn.Width = 125; // // DataCaptureColumnType // this.DataCaptureColumnType.DataPropertyName = "DataCaptureColumnType"; this.DataCaptureColumnType.HeaderText = "æ¶éåæ®µç±»å"; this.DataCaptureColumnType.MinimumWidth = 6; this.DataCaptureColumnType.Name = "DataCaptureColumnType"; this.DataCaptureColumnType.ReadOnly = true; this.DataCaptureColumnType.Width = 125; // // btn_Update // this.btn_Update.Location = new System.Drawing.Point(569, 382); this.btn_Update.Margin = new System.Windows.Forms.Padding(4); this.btn_Update.Name = "btn_Update"; this.btn_Update.Size = new System.Drawing.Size(100, 29); this.btn_Update.TabIndex = 6; this.btn_Update.Text = "ä¿®æ¹"; this.btn_Update.UseVisualStyleBackColor = true; this.btn_Update.Click += new System.EventHandler(this.btn_Update_Click); // // btn_Insert // this.btn_Insert.Location = new System.Drawing.Point(423, 382); this.btn_Insert.Margin = new System.Windows.Forms.Padding(4); this.btn_Insert.Name = "btn_Insert"; this.btn_Insert.Size = new System.Drawing.Size(100, 29); this.btn_Insert.TabIndex = 5; this.btn_Insert.Text = "æ°å¢"; this.btn_Insert.UseVisualStyleBackColor = true; this.btn_Insert.Click += new System.EventHandler(this.btn_Insert_Click); // // groupBox4 // this.groupBox4.Controls.Add(this.cbox_WorkingProcedure_Query); this.groupBox4.Controls.Add(this.label17); this.groupBox4.Controls.Add(this.textBox11); this.groupBox4.Controls.Add(this.label16); this.groupBox4.Controls.Add(this.btn_Query); this.groupBox4.Location = new System.Drawing.Point(4, 9); this.groupBox4.Margin = new System.Windows.Forms.Padding(4); this.groupBox4.Name = "groupBox4"; this.groupBox4.Padding = new System.Windows.Forms.Padding(4); this.groupBox4.Size = new System.Drawing.Size(1427, 72); this.groupBox4.TabIndex = 0; this.groupBox4.TabStop = false; this.groupBox4.Text = "æ¥è¯¢æ¡ä»¶"; // // cbox_WorkingProcedure_Query // this.cbox_WorkingProcedure_Query.FormattingEnabled = true; this.cbox_WorkingProcedure_Query.Items.AddRange(new object[] { "OP05", "OP10", "OP20", "OP30", "OP35", "OP40", "OP50", "OP60", "OP70", "OP80"}); this.cbox_WorkingProcedure_Query.Location = new System.Drawing.Point(396, 31); this.cbox_WorkingProcedure_Query.Margin = new System.Windows.Forms.Padding(4); this.cbox_WorkingProcedure_Query.Name = "cbox_WorkingProcedure_Query"; this.cbox_WorkingProcedure_Query.Size = new System.Drawing.Size(132, 23); this.cbox_WorkingProcedure_Query.TabIndex = 22; // // label17 // this.label17.AutoSize = true; this.label17.Location = new System.Drawing.Point(317, 34); this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(67, 15); this.label17.TabIndex = 21; this.label17.Text = "å·¥åºå·ï¼"; // // textBox11 // this.textBox11.Location = new System.Drawing.Point(143, 28); this.textBox11.Margin = new System.Windows.Forms.Padding(4); this.textBox11.Name = "textBox11"; this.textBox11.Size = new System.Drawing.Size(132, 25); this.textBox11.TabIndex = 15; // // label16 // this.label16.AutoSize = true; this.label16.Location = new System.Drawing.Point(32, 31); this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(97, 15); this.label16.TabIndex = 14; this.label16.Text = "æ¶éç¹ä»£ç ï¼"; // // btn_Query // this.btn_Query.Location = new System.Drawing.Point(1207, 25); this.btn_Query.Margin = new System.Windows.Forms.Padding(4); this.btn_Query.Name = "btn_Query"; this.btn_Query.Size = new System.Drawing.Size(100, 29); this.btn_Query.TabIndex = 1; this.btn_Query.Text = "æ¥è¯¢"; this.btn_Query.UseVisualStyleBackColor = true; this.btn_Query.Click += new System.EventHandler(this.button5_Click); // // tabPage4 // this.tabPage4.Controls.Add(this.groupBox9); this.tabPage4.Controls.Add(this.groupBox8); this.tabPage4.Controls.Add(this.groupBox6); this.tabPage4.Location = new System.Drawing.Point(4, 25); this.tabPage4.Margin = new System.Windows.Forms.Padding(4); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(4); this.tabPage4.Size = new System.Drawing.Size(1443, 700); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "æ°æ®æ¶éåæ®µé ç½®"; this.tabPage4.UseVisualStyleBackColor = true; // // groupBox9 // this.groupBox9.Controls.Add(this.comboBox5); this.groupBox9.Controls.Add(this.label32); this.groupBox9.Controls.Add(this.textBox9); this.groupBox9.Controls.Add(this.label33); this.groupBox9.Controls.Add(this.button7); this.groupBox9.Location = new System.Drawing.Point(9, 9); this.groupBox9.Margin = new System.Windows.Forms.Padding(4); this.groupBox9.Name = "groupBox9"; this.groupBox9.Padding = new System.Windows.Forms.Padding(4); this.groupBox9.Size = new System.Drawing.Size(1427, 72); this.groupBox9.TabIndex = 7; this.groupBox9.TabStop = false; this.groupBox9.Text = "æ¥è¯¢æ¡ä»¶"; // // comboBox5 // this.comboBox5.FormattingEnabled = true; this.comboBox5.Items.AddRange(new object[] { "OP05", "OP10", "OP20", "OP30", "OP35", "OP40", "OP50", "OP60", "OP70", "OP80"}); this.comboBox5.Location = new System.Drawing.Point(396, 31); this.comboBox5.Margin = new System.Windows.Forms.Padding(4); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(132, 23); this.comboBox5.TabIndex = 22; // // label32 // this.label32.AutoSize = true; this.label32.Location = new System.Drawing.Point(317, 34); this.label32.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label32.Name = "label32"; this.label32.Size = new System.Drawing.Size(67, 15); this.label32.TabIndex = 21; this.label32.Text = "å·¥åºå·ï¼"; // // textBox9 // this.textBox9.Location = new System.Drawing.Point(143, 28); this.textBox9.Margin = new System.Windows.Forms.Padding(4); this.textBox9.Name = "textBox9"; this.textBox9.Size = new System.Drawing.Size(132, 25); this.textBox9.TabIndex = 15; // // label33 // this.label33.AutoSize = true; this.label33.Location = new System.Drawing.Point(32, 31); this.label33.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(97, 15); this.label33.TabIndex = 14; this.label33.Text = "æ¶éç¹ä»£ç ï¼"; // // button7 // this.button7.Location = new System.Drawing.Point(1207, 25); this.button7.Margin = new System.Windows.Forms.Padding(4); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(100, 29); this.button7.TabIndex = 1; this.button7.Text = "æ¥è¯¢"; this.button7.UseVisualStyleBackColor = true; // // groupBox8 // this.groupBox8.Controls.Add(this.button4); this.groupBox8.Controls.Add(this.dataGridView1); this.groupBox8.Controls.Add(this.button5); this.groupBox8.Controls.Add(this.button6); this.groupBox8.Location = new System.Drawing.Point(8, 89); this.groupBox8.Margin = new System.Windows.Forms.Padding(4); this.groupBox8.Name = "groupBox8"; this.groupBox8.Padding = new System.Windows.Forms.Padding(4); this.groupBox8.Size = new System.Drawing.Size(1428, 419); this.groupBox8.TabIndex = 6; this.groupBox8.TabStop = false; this.groupBox8.Text = "æ¶éç¹ä¿¡æ¯"; // // button4 // this.button4.Location = new System.Drawing.Point(720, 382); this.button4.Margin = new System.Windows.Forms.Padding(4); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(100, 29); this.button4.TabIndex = 7; this.button4.Text = "å é¤"; this.button4.UseVisualStyleBackColor = true; // // dataGridView1 // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn2, this.dataGridViewTextBoxColumn3, this.dataGridViewTextBoxColumn4, this.dataGridViewTextBoxColumn5, this.dataGridViewTextBoxColumn6, this.dataGridViewTextBoxColumn7, this.dataGridViewTextBoxColumn8, this.dataGridViewTextBoxColumn9, this.dataGridViewTextBoxColumn10}); this.dataGridView1.Location = new System.Drawing.Point(4, 21); this.dataGridView1.Margin = new System.Windows.Forms.Padding(4); this.dataGridView1.MultiSelect = false; this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; this.dataGridView1.RowHeadersWidth = 51; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView1.Size = new System.Drawing.Size(1420, 354); this.dataGridView1.TabIndex = 3; // // dataGridViewTextBoxColumn1 // this.dataGridViewTextBoxColumn1.DataPropertyName = "EquipmentID"; this.dataGridViewTextBoxColumn1.HeaderText = "设å¤ç¼å·"; this.dataGridViewTextBoxColumn1.MinimumWidth = 6; this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; this.dataGridViewTextBoxColumn1.ReadOnly = true; this.dataGridViewTextBoxColumn1.Width = 125; // // dataGridViewTextBoxColumn2 // this.dataGridViewTextBoxColumn2.DataPropertyName = "WorkingProcedure"; this.dataGridViewTextBoxColumn2.HeaderText = "å·¥åºå·"; this.dataGridViewTextBoxColumn2.MinimumWidth = 6; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; this.dataGridViewTextBoxColumn2.Width = 125; // // dataGridViewTextBoxColumn3 // this.dataGridViewTextBoxColumn3.DataPropertyName = "DataCapturePointCode"; this.dataGridViewTextBoxColumn3.HeaderText = "æ°æ®æ¶éç¹ä»£ç "; this.dataGridViewTextBoxColumn3.MinimumWidth = 6; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; this.dataGridViewTextBoxColumn3.ReadOnly = true; this.dataGridViewTextBoxColumn3.Width = 125; // // dataGridViewTextBoxColumn4 // this.dataGridViewTextBoxColumn4.DataPropertyName = "DataCapturePointCname"; this.dataGridViewTextBoxColumn4.HeaderText = "æ¶éæ¶éç¹æè¿°"; this.dataGridViewTextBoxColumn4.MinimumWidth = 6; this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; this.dataGridViewTextBoxColumn4.ReadOnly = true; this.dataGridViewTextBoxColumn4.Width = 125; // // dataGridViewTextBoxColumn5 // this.dataGridViewTextBoxColumn5.DataPropertyName = "DataCaptureType"; this.dataGridViewTextBoxColumn5.HeaderText = "æ¶éæ¹å¼"; this.dataGridViewTextBoxColumn5.MinimumWidth = 6; this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; this.dataGridViewTextBoxColumn5.ReadOnly = true; this.dataGridViewTextBoxColumn5.Width = 125; // // dataGridViewTextBoxColumn6 // this.dataGridViewTextBoxColumn6.DataPropertyName = "DataCapturePLCType"; this.dataGridViewTextBoxColumn6.HeaderText = "æ¶éPLCåå·"; this.dataGridViewTextBoxColumn6.MinimumWidth = 6; this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; this.dataGridViewTextBoxColumn6.ReadOnly = true; this.dataGridViewTextBoxColumn6.Width = 125; // // dataGridViewTextBoxColumn7 // this.dataGridViewTextBoxColumn7.DataPropertyName = "PLCIP"; this.dataGridViewTextBoxColumn7.HeaderText = "PLCçIPå°å"; this.dataGridViewTextBoxColumn7.MinimumWidth = 6; this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; this.dataGridViewTextBoxColumn7.ReadOnly = true; this.dataGridViewTextBoxColumn7.Width = 125; // // dataGridViewTextBoxColumn8 // this.dataGridViewTextBoxColumn8.DataPropertyName = "PLCPort"; this.dataGridViewTextBoxColumn8.HeaderText = "PLC端å£"; this.dataGridViewTextBoxColumn8.MinimumWidth = 6; this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; this.dataGridViewTextBoxColumn8.ReadOnly = true; this.dataGridViewTextBoxColumn8.Width = 125; // // dataGridViewTextBoxColumn9 // this.dataGridViewTextBoxColumn9.DataPropertyName = "DataCaptureColumn"; this.dataGridViewTextBoxColumn9.HeaderText = "æ¶éåæ®µå"; this.dataGridViewTextBoxColumn9.MinimumWidth = 6; this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; this.dataGridViewTextBoxColumn9.ReadOnly = true; this.dataGridViewTextBoxColumn9.Width = 125; // // dataGridViewTextBoxColumn10 // this.dataGridViewTextBoxColumn10.DataPropertyName = "DataCaptureColumnType"; this.dataGridViewTextBoxColumn10.HeaderText = "æ¶éåæ®µç±»å"; this.dataGridViewTextBoxColumn10.MinimumWidth = 6; this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; this.dataGridViewTextBoxColumn10.ReadOnly = true; this.dataGridViewTextBoxColumn10.Width = 125; // // button5 // this.button5.Location = new System.Drawing.Point(569, 382); this.button5.Margin = new System.Windows.Forms.Padding(4); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(100, 29); this.button5.TabIndex = 6; this.button5.Text = "ä¿®æ¹"; this.button5.UseVisualStyleBackColor = true; // // button6 // this.button6.Location = new System.Drawing.Point(423, 382); this.button6.Margin = new System.Windows.Forms.Padding(4); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(100, 29); this.button6.TabIndex = 5; this.button6.Text = "æ°å¢"; this.button6.UseVisualStyleBackColor = true; // // groupBox6 // this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox6.Controls.Add(this.textBox1); this.groupBox6.Controls.Add(this.label20); this.groupBox6.Controls.Add(this.comboBox1); this.groupBox6.Controls.Add(this.textBox2); this.groupBox6.Controls.Add(this.label21); this.groupBox6.Controls.Add(this.comboBox2); this.groupBox6.Controls.Add(this.comboBox3); this.groupBox6.Controls.Add(this.comboBox4); this.groupBox6.Controls.Add(this.textBox3); this.groupBox6.Controls.Add(this.button2); this.groupBox6.Controls.Add(this.button3); this.groupBox6.Controls.Add(this.label22); this.groupBox6.Controls.Add(this.textBox4); this.groupBox6.Controls.Add(this.label23); this.groupBox6.Controls.Add(this.label24); this.groupBox6.Controls.Add(this.textBox5); this.groupBox6.Controls.Add(this.label25); this.groupBox6.Controls.Add(this.textBox6); this.groupBox6.Controls.Add(this.label26); this.groupBox6.Controls.Add(this.label27); this.groupBox6.Controls.Add(this.label28); this.groupBox6.Controls.Add(this.textBox7); this.groupBox6.Controls.Add(this.label29); this.groupBox6.Controls.Add(this.label30); this.groupBox6.Controls.Add(this.textBox8); this.groupBox6.Controls.Add(this.label31); this.groupBox6.Location = new System.Drawing.Point(8, 515); this.groupBox6.Margin = new System.Windows.Forms.Padding(4); this.groupBox6.Name = "groupBox6"; this.groupBox6.Padding = new System.Windows.Forms.Padding(4); this.groupBox6.Size = new System.Drawing.Size(1420, 168); this.groupBox6.TabIndex = 5; this.groupBox6.TabStop = false; this.groupBox6.Text = "ç¼è¾æ¶éç¹ä¿¡æ¯"; this.groupBox6.Visible = false; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(124, 101); this.textBox1.Margin = new System.Windows.Forms.Padding(4); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(132, 25); this.textBox1.TabIndex = 27; this.textBox1.Visible = false; // // label20 // this.label20.AutoSize = true; this.label20.Location = new System.Drawing.Point(29, 105); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(68, 15); this.label20.TabIndex = 26; this.label20.Text = "主é®IDï¼"; this.label20.Visible = false; // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(439, 26); this.comboBox1.Margin = new System.Windows.Forms.Padding(4); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(132, 23); this.comboBox1.TabIndex = 25; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(439, 94); this.textBox2.Margin = new System.Windows.Forms.Padding(4); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(132, 25); this.textBox2.TabIndex = 24; // // label21 // this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(352, 98); this.label21.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(76, 15); this.label21.TabIndex = 23; this.label21.Text = "PLC端å£ï¼"; // // comboBox2 // this.comboBox2.FormattingEnabled = true; this.comboBox2.Items.AddRange(new object[] { "Int", "DInt", "Char", "Real", "Bool", "String", ""}); this.comboBox2.Location = new System.Drawing.Point(1029, 98); this.comboBox2.Margin = new System.Windows.Forms.Padding(4); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(132, 23); this.comboBox2.TabIndex = 22; // // comboBox3 // this.comboBox3.FormattingEnabled = true; this.comboBox3.Location = new System.Drawing.Point(720, 90); this.comboBox3.Margin = new System.Windows.Forms.Padding(4); this.comboBox3.Name = "comboBox3"; this.comboBox3.Size = new System.Drawing.Size(132, 23); this.comboBox3.TabIndex = 21; // // comboBox4 // this.comboBox4.FormattingEnabled = true; this.comboBox4.Items.AddRange(new object[] { "OP05", "OP10", "OP20", "OP30", "OP35", "OP40", "OP50", "OP60", "OP70", "OP80"}); this.comboBox4.Location = new System.Drawing.Point(124, 61); this.comboBox4.Margin = new System.Windows.Forms.Padding(4); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(132, 23); this.comboBox4.TabIndex = 20; // // textBox3 // this.textBox3.Location = new System.Drawing.Point(1029, 26); this.textBox3.Margin = new System.Windows.Forms.Padding(4); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(132, 25); this.textBox3.TabIndex = 19; // // button2 // this.button2.Location = new System.Drawing.Point(660, 126); this.button2.Margin = new System.Windows.Forms.Padding(4); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(100, 29); this.button2.TabIndex = 3; this.button2.Text = "åæ¶"; this.button2.UseVisualStyleBackColor = true; // // button3 // this.button3.Location = new System.Drawing.Point(552, 126); this.button3.Margin = new System.Windows.Forms.Padding(4); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(100, 29); this.button3.TabIndex = 2; this.button3.Text = "ä¿å"; this.button3.UseVisualStyleBackColor = true; // // label22 // this.label22.AutoSize = true; this.label22.Location = new System.Drawing.Point(903, 30); this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(113, 15); this.label22.TabIndex = 18; this.label22.Text = "èç¹DBåå°åï¼"; // // textBox4 // this.textBox4.Location = new System.Drawing.Point(1029, 60); this.textBox4.Margin = new System.Windows.Forms.Padding(4); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(132, 25); this.textBox4.TabIndex = 17; // // label23 // this.label23.AutoSize = true; this.label23.Location = new System.Drawing.Point(919, 64); this.label23.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(97, 15); this.label23.TabIndex = 16; this.label23.Text = "èç¹åç§»éï¼"; // // label24 // this.label24.AutoSize = true; this.label24.Location = new System.Drawing.Point(903, 101); this.label24.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(112, 15); this.label24.TabIndex = 14; this.label24.Text = "èç¹æ°æ®ç±»åï¼"; // // textBox5 // this.textBox5.Location = new System.Drawing.Point(720, 26); this.textBox5.Margin = new System.Windows.Forms.Padding(4); this.textBox5.Name = "textBox5"; this.textBox5.Size = new System.Drawing.Size(132, 25); this.textBox5.TabIndex = 13; // // label25 // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(609, 30); this.label25.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(97, 15); this.label25.TabIndex = 12; this.label25.Text = "æ¶éç¹ä»£ç ï¼"; // // textBox6 // this.textBox6.Location = new System.Drawing.Point(720, 60); this.textBox6.Margin = new System.Windows.Forms.Padding(4); this.textBox6.Name = "textBox6"; this.textBox6.Size = new System.Drawing.Size(132, 25); this.textBox6.TabIndex = 11; // // label26 // this.label26.AutoSize = true; this.label26.Location = new System.Drawing.Point(609, 64); this.label26.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(97, 15); this.label26.TabIndex = 10; this.label26.Text = "æ¶éç¹æè¿°ï¼"; // // label27 // this.label27.AutoSize = true; this.label27.Location = new System.Drawing.Point(625, 98); this.label27.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(82, 15); this.label27.TabIndex = 8; this.label27.Text = "æ¶éæ¹å¼ï¼"; // // label28 // this.label28.AutoSize = true; this.label28.Location = new System.Drawing.Point(352, 30); this.label28.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(76, 15); this.label28.TabIndex = 6; this.label28.Text = "PLCåå·ï¼"; // // textBox7 // this.textBox7.Location = new System.Drawing.Point(439, 60); this.textBox7.Margin = new System.Windows.Forms.Padding(4); this.textBox7.Name = "textBox7"; this.textBox7.Size = new System.Drawing.Size(132, 25); this.textBox7.TabIndex = 5; // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(328, 64); this.label29.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(100, 15); this.label29.TabIndex = 4; this.label29.Text = "PLC IPå°åï¼"; // // label30 // this.label30.AutoSize = true; this.label30.Location = new System.Drawing.Point(45, 64); this.label30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(67, 15); this.label30.TabIndex = 2; this.label30.Text = "å·¥åºå·ï¼"; // // textBox8 // this.textBox8.Location = new System.Drawing.Point(124, 26); this.textBox8.Margin = new System.Windows.Forms.Padding(4); this.textBox8.Name = "textBox8"; this.textBox8.Size = new System.Drawing.Size(132, 25); this.textBox8.TabIndex = 1; // // label31 // this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(29, 30); this.label31.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(82, 15); this.label31.TabIndex = 0; this.label31.Text = "设å¤ç¼å·ï¼"; // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1448, 724); this.Controls.Add(this.tabControl1); this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FormMain"; this.Text = "æµè¯ç¨-䏿±½è¿ææ°æ®ééç³»ç»ééåå°"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed); this.Load += new System.EventHandler(this.FormMain_Load); this.Scroll += new System.Windows.Forms.ScrollEventHandler(this.FormMain_Scroll); this.tabControl1.ResumeLayout(false); this.tabPage5.ResumeLayout(false); this.groupBox11.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); this.tabPage2.ResumeLayout(false); this.groupBox10.ResumeLayout(false); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.groupBox3.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.groupBox2.ResumeLayout(false); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.groupBox1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.tabPage3.ResumeLayout(false); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); this.groupBox5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dgv_DataCaptureConfig)).EndInit(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.tabPage4.ResumeLayout(false); this.groupBox9.ResumeLayout(false); this.groupBox9.PerformLayout(); this.groupBox8.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.groupBox6.ResumeLayout(false); this.groupBox6.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.CheckBox ckBOP0504; private System.Windows.Forms.CheckBox ckBOP0503; private System.Windows.Forms.CheckBox ckBOP0502; private System.Windows.Forms.Label lbl_Alter_OP0501; private System.Windows.Forms.CheckBox ckBOP0501; private System.Windows.Forms.Label lbl_Alter_OP0504; private System.Windows.Forms.Label lbl_Alter_OP0503; private System.Windows.Forms.Label lbl_Alter_OP0502; private System.Windows.Forms.Button btn_StartUpAllThread; private System.Windows.Forms.Button btn_StopAllThread; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Label lbl_Alter_OP2004; private System.Windows.Forms.Label lbl_Alter_OP2003; private System.Windows.Forms.Label lbl_Alter_OP2002; private System.Windows.Forms.CheckBox ckBOP2004; private System.Windows.Forms.CheckBox ckBOP2003; private System.Windows.Forms.CheckBox ckBOP2002; private System.Windows.Forms.Label lbl_Alter_OP2001; private System.Windows.Forms.CheckBox ckBOP2001; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.Label label6; private System.Windows.Forms.CheckBox checkBox6; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.CheckBox checkBox7; private System.Windows.Forms.CheckBox checkBox8; private System.Windows.Forms.CheckBox checkBox9; private System.Windows.Forms.Label label10; private System.Windows.Forms.CheckBox checkBox10; private System.Windows.Forms.Label lbl_Alter_OP2005; private System.Windows.Forms.CheckBox ckBOP2005; private System.Windows.Forms.Label lbl_Alter_OP2006; private System.Windows.Forms.CheckBox ckBOP2006; private System.Windows.Forms.Button button1; private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.Button btn_Cancel; private System.Windows.Forms.Button btn_Save; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.DataGridView dgv_DataCaptureConfig; private System.Windows.Forms.DataGridViewTextBoxColumn EquipmentID; private System.Windows.Forms.DataGridViewTextBoxColumn WorkingProcedure; private System.Windows.Forms.DataGridViewTextBoxColumn DataCapturePointCode; private System.Windows.Forms.DataGridViewTextBoxColumn DataCapturePointCname; private System.Windows.Forms.DataGridViewTextBoxColumn DataCaptureType; private System.Windows.Forms.DataGridViewTextBoxColumn DataCapturePLCType; private System.Windows.Forms.DataGridViewTextBoxColumn PLCIP; private System.Windows.Forms.DataGridViewTextBoxColumn PLCPort; private System.Windows.Forms.DataGridViewTextBoxColumn DataCaptureColumn; private System.Windows.Forms.DataGridViewTextBoxColumn DataCaptureColumnType; private System.Windows.Forms.TabPage tabPage4; private System.Windows.Forms.GroupBox groupBox7; private System.Windows.Forms.ComboBox cbox_DataCaptureType; private System.Windows.Forms.ComboBox cbox_WorkingProcedure; private System.Windows.Forms.TextBox txt_DbNumber; private System.Windows.Forms.Label label15; private System.Windows.Forms.TextBox txt_Offset; private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label13; private System.Windows.Forms.TextBox txt_DataCapturePointCode; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox txt_DataCapturePointCname; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txt_PLCIP; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox txt_EquipmentID; private System.Windows.Forms.Label label1; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.TextBox textBox11; private System.Windows.Forms.Label label16; private System.Windows.Forms.Button btn_Query; private System.Windows.Forms.ComboBox cbox_WorkingProcedure_Query; private System.Windows.Forms.Label label17; private System.Windows.Forms.ComboBox cbox_DataCaptureColumnType; private System.Windows.Forms.TextBox txt_PLCPort; private System.Windows.Forms.Label label18; private System.Windows.Forms.ComboBox cbox_DataCapturePLCType; private System.Windows.Forms.Button btn_Delete; private System.Windows.Forms.Button btn_Update; private System.Windows.Forms.Button btn_Insert; private System.Windows.Forms.TextBox txt_ID; private System.Windows.Forms.Label label19; private System.Windows.Forms.GroupBox groupBox9; private System.Windows.Forms.ComboBox comboBox5; private System.Windows.Forms.Label label32; private System.Windows.Forms.TextBox textBox9; private System.Windows.Forms.Label label33; private System.Windows.Forms.Button button7; private System.Windows.Forms.GroupBox groupBox8; private System.Windows.Forms.Button button4; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label20; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Label label21; private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.ComboBox comboBox3; private System.Windows.Forms.ComboBox comboBox4; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Label label22; private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label24; private System.Windows.Forms.TextBox textBox5; private System.Windows.Forms.Label label25; private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label27; private System.Windows.Forms.Label label28; private System.Windows.Forms.TextBox textBox7; private System.Windows.Forms.Label label29; private System.Windows.Forms.Label label30; private System.Windows.Forms.TextBox textBox8; private System.Windows.Forms.Label label31; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Label lbl_Alter_OP2007; private System.Windows.Forms.CheckBox ckBOP2007; private System.Windows.Forms.Button button9; private System.Windows.Forms.Label label34; private System.Windows.Forms.TextBox textBox10; private System.Windows.Forms.Button button8; private System.Windows.Forms.Label label35; private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.Label label36; private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button14; private System.Windows.Forms.Button button13; private System.Windows.Forms.Button button12; private System.Windows.Forms.Button button15; private System.Windows.Forms.Button button16; private System.Windows.Forms.Button button17; private System.Windows.Forms.Button button18; private System.Windows.Forms.Button button19; private System.Windows.Forms.Button button20; private System.Windows.Forms.Button button21; private System.Windows.Forms.Button button22; private System.Windows.Forms.GroupBox groupBox10; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.CheckBox HMIOP1040Write; private System.Windows.Forms.Label lbl_Alert_HMIOP104001; private System.Windows.Forms.CheckBox ckHMIOP1040Reading; private System.Windows.Forms.Label lbl_Alert_HMIOP104002; private System.Windows.Forms.Button btnHMIWrite; private System.Windows.Forms.Button btnHMI04Reading; private System.Windows.Forms.CheckBox HMIOP60Write; private System.Windows.Forms.CheckBox HMIOP50Write; private System.Windows.Forms.CheckBox HMIOP3035Write; private System.Windows.Forms.CheckBox HMIOP20Write; private System.Windows.Forms.Label lbl_Alert_HMIOP6001; private System.Windows.Forms.CheckBox ckHMIOP60Reading; private System.Windows.Forms.Label lbl_Alert_HMIOP5001; private System.Windows.Forms.CheckBox ckHMIOP50Reading; private System.Windows.Forms.Label lbl_Alert_HMIOP303501; private System.Windows.Forms.CheckBox ckHMIOP3035Reading; private System.Windows.Forms.Label lbl_Alert_HMIOP6002; private System.Windows.Forms.Label lbl_Alert_HMIOP2001; private System.Windows.Forms.Label lbl_Alert_HMIOP5002; private System.Windows.Forms.CheckBox ckHMIOP20Reading; private System.Windows.Forms.Label lbl_Alert_HMIOP303502; private System.Windows.Forms.Label lbl_Alert_HMIOP2002; private System.Windows.Forms.TabPage tabPage5; private System.Windows.Forms.Button button23; private System.Windows.Forms.Button button24; private System.Windows.Forms.GroupBox groupBox11; private System.Windows.Forms.DataGridView dataGridView2; private System.Windows.Forms.DataGridViewTextBoxColumn Threadcode; private System.Windows.Forms.DataGridViewTextBoxColumn Threadcname; private System.Windows.Forms.DataGridViewTextBoxColumn Column1; private System.Windows.Forms.DataGridViewTextBoxColumn Column2; private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridViewTextBoxColumn Column4; private System.Windows.Forms.DataGridViewTextBoxColumn Column5; private System.Windows.Forms.DataGridViewTextBoxColumn Column6; private System.Windows.Forms.TextBox textBox12; private System.Windows.Forms.Button button25; private System.Windows.Forms.Button button26; private System.Windows.Forms.Button button27; } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormMain.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,1929 @@ using iTextSharp.text.pdf; using iTextSharp.text.pdf.parser; using iTextSharp.text.pdf.qrcode; using iWare_SCADA_BusinessLogical; using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical.Utils; using iWare_SCADA_Model; using iWare_SCADA_Model.TableModelSC; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using static System.Net.WebRequestMethods; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; using File = System.IO.File; namespace iWare_SCADA_DataCaptureV3 { public partial class FormMain : Form { #region ä¿¡æ¯è·åçº¿ç¨ Thread tskSetLableText;//åç§lable卿æ¾ç¤º Thread tskSetGridSource;//åç§lable卿æ¾ç¤º #endregion public FormMain() { InitializeComponent(); } private void btn_StartUpAllThread_Click(object sender, EventArgs e) { try { #region æ°æ®ééé¡¹ç¡®å® var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); var columnList = DataCaptureConfigManager.GetDataCaptureColumnConfig(); //var keyvalue = dataCaptureConfigslist.GroupBy(o => o.WorkingProcedure).Select(g => new //{ // keyword = g.Key, // RecordIDs = g.Where(c =>c.WorkingProcedure.Equals(g.Key)).ToList() //}); foreach (var config in dataCaptureConfigslist) { switch (config.DataCapturePointCode) { } } #endregion try { } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "å¯å¨çº¿ç¨æ¶----btn_StartUpAllThread_Clickæ¥éï¼", ex); } #region 设置æ¾ç¤ºUI tskSetLableText = new Thread(DataRead_Label); tskSetLableText.Start(); #endregion } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "å¯å¨çº¿ç¨æ¶----btn_StartUpAllThread_Click allæ¥éï¼", ex); } } private void FormMain_Load(object sender, EventArgs e) { try {//å è½½éè¦çæ°æ® } catch (Exception ex) { } } private void LoadItemType() { List<ListItem> itemList = new List<ListItem>(); itemList.Add(new ListItem() { Value = "-1", Text = "è¯·éæ©" }); itemList.Add(new ListItem() { Text = "PLC", Value = "1" }); itemList.Add(new ListItem() { Text = "æ°æ®ç½å ³", Value = "2" }); itemList.Add(new ListItem() { Text = "å·¥æ§æº", Value = "3" }); cbox_DataCaptureType.ValueMember = "Value"; cbox_DataCaptureType.DisplayMember = "Text"; cbox_DataCaptureType.DataSource = itemList; cbox_DataCaptureType.SelectedIndex = 0; List<ListItem> itemList2 = new List<ListItem>(); itemList2.Add(new ListItem() { Value = "-1", Text = "è¯·éæ©" }); itemList2.Add(new ListItem() { Text = "西é¨åS7", Value = "1" }); itemList2.Add(new ListItem() { Text = "西é¨å300", Value = "2" }); cbox_DataCapturePLCType.ValueMember = "Value"; cbox_DataCapturePLCType.DisplayMember = "Text"; cbox_DataCapturePLCType.DataSource = itemList2; cbox_DataCapturePLCType.SelectedIndex = 0; } List<ThreadStatusMonitor> sourcelist = new List<ThreadStatusMonitor>(); /// <summary> /// 设置ç°åºåè¦ä¿¡æ¯å端æ¾ç¤º /// </summary> private void GridRefresh() { //while (true) //{ try { Action action = () => { using (DbModel db = new DbModel()) { sourcelist = db.ThreadStatusMonitor.Where(o => o.IsDeleted == false).ToList(); dataGridView2.DataSource = sourcelist.OrderBy(o => o.Threadcode); dataGridView2.Refresh(); } //dataGridView2.DataSource = null; //dataGridView2.DataSource = SystemValue.MainList; }; Invoke(action); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "æ¹æ³GridRefreshåºç°å¼å¸¸ï¼" + ex.Message, ex); //continue; } //Thread.Sleep(10000); //} } /// <summary> /// 设置ç°åºåè¦ä¿¡æ¯å端æ¾ç¤º /// </summary> private void DataRead_Label() { while (true) { Thread.Sleep(1000); try { var showNowTime = "(" + DateTimeHelper.ConvertToStringForOnlyShowTime(DateTime.Now) + ")"; Action action = () => { //TimeBox.Text = TimeString; ResultBox.Text = hv_Resultstr; //DisplayImageHalconwindow(AcqImage, GrayImage); //DisplayImageHalconwindow(ThresholdImageï¼MeanImage); //设置å åæºä»»å¡ä¸ååä»»å¡ç¡®è®¤çº¿ç¨æ¶æ¯ this.lbl_Alter_OP0501.Text = showNowTime + SystemValue.lbl_Alert_OP0501; this.lbl_Alter_OP0502.Text = showNowTime + SystemValue.lbl_Alert_OP0502; this.lbl_Alter_OP0503.Text = showNowTime + SystemValue.lbl_Alert_OP0503; this.lbl_Alter_OP0504.Text = showNowTime + SystemValue.lbl_Alert_OP0504; this.lbl_Alter_OP2001.Text = showNowTime + SystemValue._lbl_Alert_OP2001; this.lbl_Alter_OP2002.Text = showNowTime + SystemValue._lbl_Alert_OP2002; this.lbl_Alter_OP2003.Text = showNowTime + SystemValue._lbl_Alert_OP2003; this.lbl_Alter_OP2004.Text = showNowTime + SystemValue._lbl_Alert_OP2004; this.lbl_Alter_OP2005.Text = showNowTime + SystemValue._lbl_Alert_OP2005; this.lbl_Alter_OP2006.Text = showNowTime + SystemValue._lbl_Alert_OP2006; this.lbl_Alert_HMIOP104001.Text = showNowTime + SystemValue.lbl_Alert_HMIOP104001; this.lbl_Alert_HMIOP104002.Text = showNowTime + SystemValue.lbl_Alert_HMIOP104002; this.lbl_Alert_HMIOP2001.Text = showNowTime + SystemValue.lbl_Alert_HMIOP2001; this.lbl_Alert_HMIOP2002.Text = showNowTime + SystemValue.lbl_Alert_HMIOP2002; this.lbl_Alert_HMIOP303501.Text = showNowTime + SystemValue.lbl_Alert_HMIOP303501; this.lbl_Alert_HMIOP303502.Text = showNowTime + SystemValue.lbl_Alert_HMIOP303502; this.lbl_Alert_HMIOP5001.Text = showNowTime + SystemValue.lbl_Alert_HMIOP5001; this.lbl_Alert_HMIOP5002.Text = showNowTime + SystemValue.lbl_Alert_HMIOP5002; this.lbl_Alert_HMIOP6001.Text = showNowTime + SystemValue.lbl_Alert_HMIOP6001; this.lbl_Alert_HMIOP6002.Text = showNowTime + SystemValue.lbl_Alert_HMIOP6002; }; Invoke(action); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "æ¹æ³DataRead_Labelåºç°å¼å¸¸ï¼" + ex.Message, ex); continue; } } } /// <summary> /// éç¨çcheckboxæ¹åäºä»¶ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommonCheckedChanged(object sender, EventArgs e) { // HMI SystemValue.isAllowRuning_HMIOP104001 = DoCommonCheckedChanged(ckHMIOP1040Reading); SystemValue.isAllowRuning_HMIOP104002 = DoCommonCheckedChanged(HMIOP1040Write); SystemValue.isAllowRuning_HMIOP2001 = DoCommonCheckedChanged(ckHMIOP20Reading); SystemValue.isAllowRuning_HMIOP2002 = DoCommonCheckedChanged(HMIOP20Write); SystemValue.isAllowRuning_HMIOP303501 = DoCommonCheckedChanged(ckHMIOP3035Reading); SystemValue.isAllowRuning_HMIOP303502 = DoCommonCheckedChanged(HMIOP3035Write); SystemValue.isAllowRuning_HMIOP5001 = DoCommonCheckedChanged(ckHMIOP50Reading); SystemValue.isAllowRuning_HMIOP5002 = DoCommonCheckedChanged(HMIOP50Write); SystemValue.isAllowRuning_HMIOP6001 = DoCommonCheckedChanged(ckHMIOP60Reading); SystemValue.isAllowRuning_HMIOP6002 = DoCommonCheckedChanged(HMIOP60Write); //OP05å·¥åºçæ§ä»»å¡ SystemValue.isAllowRuning_OP0501 = DoCommonCheckedChanged(ckBOP0501); SystemValue.isAllowRuning_OP0502 = DoCommonCheckedChanged(ckBOP0502); SystemValue.isAllowRuning_OP0503 = DoCommonCheckedChanged(ckBOP0503); SystemValue.isAllowRuning_OP0504 = DoCommonCheckedChanged(ckBOP0504); SystemValue.isAllowRuning_OP2001 = DoCommonCheckedChanged(ckBOP2001); SystemValue.isAllowRuning_OP2002 = DoCommonCheckedChanged(ckBOP2002); SystemValue.isAllowRuning_OP2003 = DoCommonCheckedChanged(ckBOP2003); SystemValue.isAllowRuning_OP2004 = DoCommonCheckedChanged(ckBOP2004); } private bool DoCommonCheckedChanged(CheckBox cb) { return cb.Checked ? true : false; } private void button1_Click(object sender, EventArgs e) { try { string Station = "03"; string value_02 = ""; string path = ConfigHelper.GetConfigString("OP30QualityDataForStation");//æç æºæç äºç»´ç è·¯å¾ if (string.IsNullOrEmpty(path)) { path = @"Z:\"; } if (Station.Equals("03")) {//å·¥ä½3 涨æåç© path = path + "kistler_crack"; } else if (Station.Equals("04")) {//å·¥ä½4 颿§ç´§åç© path = path + "Bosch_Rexroth"; } else if (Station.Equals("05")) {//å·¥ä½5 æ§ç´§åç© path = path + "Bosch_Rexroth"; } else if (Station.Equals("06")) {//å·¥ä½6 衬å¥åè£ åç© path = path + "kistler_bush"; } //æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ var startTime = CommonManager.Instance.CheackPath(Environment.CurrentDirectory + $"\\LastModifyTime\\OP30Station{Station}-LastScapTime.txt", 6, -10); var endTime = DateTimeHelper.GetDateTime(); var newFiles = FileHelper.DetectNewFilesCSV(textBox10.Text, 100000000, Convert.ToDateTime(startTime), endTime); var list = newFiles.GetEnumerator(); foreach (System.IO.FileInfo file in newFiles) { } var a = ReadPdfConntent(textBox10.Text, textBox12.Text); //var ccSystem = DataCaptureColumnDictManager.GetEquipmentBaseInfo(); //if (ccSystem == null) //{ // MessageBox.Show("请è系管çåç»´æ¤ç³»ç»è°åº¦ç¸å ³çæ°æ®!"); // return; //}; //WorkPieceInfoManager.test(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button5_Click(object sender, EventArgs e) { try { var list = DataCaptureConfigManager.GetDataCaptureConfigs(); if (list == null) { MessageBox.Show("请è系管çåç»´æ¤æ°æ®æ¶éç¹ç¸å ³çæ°æ®!"); return; }; dgv_DataCaptureConfig.DataSource = list; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void txt_PLCPort_KeyPress(object sender, KeyPressEventArgs e) { if (((int)e.KeyChar < 48 || (int)e.KeyChar > 57) && (int)e.KeyChar != 8) { e.Handled = true; } ///*åªè½æ°åé®ãéæ ¼é®ãè´å·ãå°æ°ç¹*/ //if (((int)e.KeyChar < 48 || (int)e.KeyChar > 57) && (int)e.KeyChar != 8 && // (int)e.KeyChar != 45 && (int)e.KeyChar != 46) e.Handled = true; ///*è¾å ¥ä¸ºè´å·åå°æ°ç¹æ¶ï¼ä¸åªè½è¾å ¥ä¸æ¬¡(è´å·åªè½æåé¢è¾å ¥ï¼å°æ°ç¹ä¸å¯æåé¢è¾å ¥)*/ //if (e.KeyChar == 45 && (((TextBox)sender).SelectionStart != 0 || // ((TextBox)sender).Text.IndexOf("-") >= 0)) e.Handled = true; //if (e.KeyChar == 46 && (((TextBox)sender).SelectionStart == 0 || // ((TextBox)sender).Text.IndexOf(".") >= 0)) e.Handled = true; } private void txt_PLCIP_KeyPress(object sender, KeyPressEventArgs e) { if (((int)e.KeyChar < 48 || (int)e.KeyChar > 57) && (int)e.KeyChar != 8 && (int)e.KeyChar != 46) { e.Handled = true; } } private void btn_Insert_Click(object sender, EventArgs e) { btn_Save.Tag = "create"; setControlsVisible(true); setControlsEmpty(); btn_Update.Enabled = false; btn_Delete.Enabled = false; btn_Insert.Enabled = false; } private void setControlsVisible(bool flag) { groupBox7.Visible = flag; } private void setControlsEmpty() { txt_EquipmentID.Text = ""; txt_EquipmentID.Focus(); cbox_WorkingProcedure.SelectedIndex = -1; cbox_DataCaptureColumnType.SelectedIndex = -1; cbox_DataCapturePLCType.SelectedIndex = 0; cbox_DataCaptureType.SelectedIndex = 0; } private void btn_Cancel_Click(object sender, EventArgs e) { setControlsVisible(false); btn_Update.Enabled = true; btn_Delete.Enabled = true; btn_Insert.Enabled = true; } private void btn_Update_Click(object sender, EventArgs e) { try { if (dgv_DataCaptureConfig.CurrentRow == null || dgv_DataCaptureConfig.CurrentRow.Index < 0) { MessageBox.Show("è¯·éæ©ä¸æ¡éä¿®æ¹çæ°æ®ï¼"); return; } btn_Save.Tag = "update"; setControlsVisible(true); btn_Update.Enabled = false; btn_Delete.Enabled = false; btn_Insert.Enabled = false; var model = dgv_DataCaptureConfig.SelectedRows[0].DataBoundItem as DataCaptureConfig; txt_ID.Text = model.Id.ToString(); txt_EquipmentID.Text = model.EquipmentID; cbox_WorkingProcedure.Text = model.WorkingProcedure; txt_DataCapturePointCode.Text = model.DataCapturePointCode; txt_DataCapturePointCname.Text = model.DataCapturePointCname; cbox_DataCaptureType.SelectedValue = model.DataCaptureType.ToString(); cbox_DataCapturePLCType.SelectedValue = model.DataCapturePLCType.ToString(); txt_PLCIP.Text = model.PLCIP; txt_PLCPort.Text = model.PLCPort.ToString(); txt_DbNumber.Text = model.DbNumber; txt_Offset.Text = model.Offset; cbox_DataCaptureColumnType.Text = model.DataCaptureColumnType; } catch (Exception ex) { MessageBox.Show($"ä¿®æ¹æ¶éç¹ä¿¡æ¯å¤±è´¥ï¼ {ex.Message}"); btn_Update.Enabled = true; btn_Delete.Enabled = true; btn_Insert.Enabled = true; } } private void btn_Delete_Click(object sender, EventArgs e) { try { if (dgv_DataCaptureConfig.CurrentRow.Index < 0) { MessageBox.Show("è¯·éæ©ä¸æ¡æ¶éç¹ï¼"); return; } if (MessageBox.Show("确认å 餿¤è®°å½ï¼", "å é¤ç¡®è®¤", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } var model = dgv_DataCaptureConfig.SelectedRows[0].DataBoundItem as DataCaptureConfig; var num = DataCaptureConfigManager.DeleteDataCaptureConfig(model); if (num > 0) { MessageBox.Show($"å 餿å{num}æ¡"); } else { MessageBox.Show("å é¤å¼å¸¸ï¼è¯·å·æ°åéè¯"); } button5_Click(null, null); //if (service.DeleteAlertRule(ID)) //{ // ShowStatusMsg("å 餿å"); // BindDataGrid(); // dgAlertRuleList.Rows[0].Selected = true; // dgAlertRuleList.CurrentCell = dgAlertRuleList.Rows[0].Cells[1]; // dgAlertRuleList_SelectionChanged(null, null); //} //else //{ // ShowErrMsg("å é¤å¤±è´¥"); //} } catch (Exception ex) { MessageBox.Show($"å 餿¶éç¹ä¿¡æ¯å¼å¸¸ï¼{ex.Message}"); } } private DataCaptureConfig GetFormDataCaptureConfigInfo() { ListItem DataCaptureTypeFlag = null; var itemType = ComboBoxHelper.GetComboxSelectValue(cbox_DataCaptureType, ref DataCaptureTypeFlag); ListItem DataCapturePLCTypeFlag = null; var itemType2 = ComboBoxHelper.GetComboxSelectValue(cbox_DataCapturePLCType, ref DataCapturePLCTypeFlag); DataCaptureConfig model = new DataCaptureConfig(); model.Id = string.IsNullOrEmpty(txt_ID.Text.Trim()) ? 0 : Convert.ToInt32(txt_ID.Text.Trim()); model.EquipmentID = txt_EquipmentID.Text.Trim(); model.WorkingProcedure = cbox_WorkingProcedure.Text.Trim(); model.DataCapturePointCode = txt_DataCapturePointCode.Text.Trim(); model.DataCapturePointCname = txt_DataCapturePointCname.Text.Trim(); model.DataCaptureType = Convert.ToInt32(DataCaptureTypeFlag.Value); model.DataCapturePLCType = Convert.ToInt32(DataCapturePLCTypeFlag.Value); model.PLCIP = txt_PLCIP.Text; model.PLCPort = Convert.ToInt32(txt_PLCPort.Text.Trim()); model.DbNumber = txt_DbNumber.Text; model.Offset = txt_Offset.Text; model.DataCaptureColumnType = cbox_DataCaptureColumnType.Text; return model; } private void btn_Save_Click(object sender, EventArgs e) { try { #region æ ¡éªæ ¼å¼ if (cbox_WorkingProcedure.SelectedIndex < 0) { MessageBox.Show($"è¯·éæ©å·¥åº"); return; } if (cbox_DataCapturePLCType.SelectedIndex < 0) { MessageBox.Show($"è¾å ¥PLCåå·å¼å¸¸ï¼è¯·éä¸PLCåå·"); return; } if (string.IsNullOrEmpty(txt_PLCIP.Text.Trim())) { MessageBox.Show($"PLC IPä¸è½ä¸ºç©º"); return; } if (string.IsNullOrEmpty(txt_PLCPort.Text.Trim())) { MessageBox.Show($"PLC端å£ä¸è½ä¸ºç©º"); return; } if (string.IsNullOrEmpty(txt_DataCapturePointCode.Text.Trim())) { MessageBox.Show($"æ¶éç¹ä»£ç ä¸è½ä¸ºç©º"); return; } if (string.IsNullOrEmpty(txt_DbNumber.Text.Trim())) { MessageBox.Show($"èç¹DBåå°åä¸è½ä¸ºç©º"); return; } if (string.IsNullOrEmpty(txt_Offset.Text.Trim())) { MessageBox.Show($"èç¹åç§»éä¸è½ä¸ºç©º"); return; } if (cbox_DataCaptureColumnType.SelectedIndex < 0) { MessageBox.Show($"è¯·éæ©èç¹æ°æ®ç±»å"); return; } if (cbox_DataCaptureType.SelectedIndex < 1) { MessageBox.Show($"è¯·éæ©æ¶éæ¹å¼"); return; } #endregion var data = GetFormDataCaptureConfigInfo(); //data.ID = Convert.ToInt32(dgv_DataCaptureConfig.CurrentRow.Cells["ID"].Value); if (btn_Save.Tag.Equals("update")) {//ä¿®æ¹ string message = ""; DataCaptureConfigManager.UpdateDataCaptureConfig(data, out message); if (message.Length == 0) { setControlsVisible(false); btn_Update.Enabled = true; btn_Delete.Enabled = true; btn_Insert.Enabled = true; MessageBox.Show("ä¿®æ¹æåï¼"); button5_Click(null, null); } else { MessageBox.Show($"ä¿®æ¹å¤±è´¥ï¼{message}"); } } else if (btn_Save.Tag.Equals("create")) {//æ°å¢ DataCaptureConfigManager.InsertDataCaptureConfig(data); setControlsVisible(false); btn_Update.Enabled = true; btn_Delete.Enabled = true; btn_Insert.Enabled = true; MessageBox.Show("æ°å¢æå"); button5_Click(null, null); } } catch (Exception ex) { MessageBox.Show($"ä¿åæ¶éç¹ä¿¡æ¯å¼å¸¸ï¼{ex.Message}"); } finally { } } private void button8_Click(object sender, EventArgs e) { } private void button10_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button9_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button11_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button12_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button15_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button13_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button14_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button16_Click(object sender, EventArgs e) { try { textBox10.Text = EnumberHelper.GetEnumName<WorkingProcedureForHMI>(int.Parse(textBox12.Text)).ToString(); var bb = EnumberHelper.GetEnumForString<WorkingProcedureForHMI>(textBox12.Text); var A = EnumberHelper.GetEnumName<WorkingProcedureForHMI>(1); WorkingProcedureForHMI t = default(WorkingProcedureForHMI); bool isRight = EnumberHelper.GetEnumObject<WorkingProcedureForHMI>("OP10", out t); //int workProcedure = 0; //workProcedure = (int)((WorkingProcedureForHMI)"OP10"); //using (DbModel db = new DbModel()) //{ // var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == "DZ045L2309210100201A1A").FirstOrDefault(); //} // WorkPieceLog wplog = new WorkPieceLog(); //wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //wplog.WorkingProcedure = "OP999"; //wplog.EquipmentID = "AA"; //wplog.Remarks = "CES"; //wplog.MonitoringPoint = "AAA"; //wplog.CreatedTime = DateTimeHelper.GetDateTime(); //wplog.CreatedUserName = "BAO"; //wplog.IsDeleted = false; //wplog.GetType().GetProperty("workpieceid").SetValue(wplog, "WorkPieceIDGONGJIANMA");//ç»å¨æå段èµå¼ } catch (Exception ex) { } } /// <summary> /// è§£æpdfæä»¶ /// </summary> /// <param name="filePath"></param> /// <param name="getPdfValue"></param> /// <returns></returns> public static List<string> ReadPdfConntent(string filePath, string getPdfValue) { List<string> lst = new List<string>(); try { string pdffilename = filePath; PdfReader pdfreader = new PdfReader(pdffilename); int numberOfPages = pdfreader.NumberOfPages; //for (int i = 1; i <= numberOfPages; ++i) //{ // lst.Add(iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader,i)); // text.AppendLine(); //} string text = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader, 1); string[] words = text.Split('\n'); foreach (var item in words) { string value = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(item)); if (value.Contains(getPdfValue)) { string[] splitValue = value.Split(':'); lst.Add(splitValue[1].Trim()); } } pdfreader.Close(); return lst; } catch (Exception ex) { throw ex; } } private void button22_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button21_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button20_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button19_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button18_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void button17_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } /// <summary> /// HMI04读å /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnHMI04Reading_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); foreach (var config in dataCaptureConfigslist) { switch (config.DataCapturePointCode) { } } } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } /// <summary> /// HMI04åå ¥ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnHMIWrite_Click(object sender, EventArgs e) { try { if (!SystemValue.isStartedModel) { MessageBox.Show("请ç¹å»è°è¯æ¨¡å¼æé®"); return; } var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); foreach (var config in dataCaptureConfigslist) { switch (config.DataCapturePointCode) { } } // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); } catch (Exception ex) { MessageBox.Show($"模æå¼å¸¸ï¼{ex.Message}"); Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click allæ¥éï¼", ex); } } private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { Application.Exit(); //强å¶ç»æè¿ç¨å¹¶éåº //System.Diagnostics.Process.GetCurrentProcess().Kill(); System.Environment.Exit(0); } private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { //if (MessageBox.Show("å°è¦å ³éééç¨åºï¼æ¯å¦ç»§ç»ï¼", "询é®", MessageBoxButtons.YesNo) == DialogResult.Yes) //{ // e.Cancel = false; //} //else //{ // e.Cancel = true; //} e.Cancel = false; } private void button24_Click(object sender, EventArgs e) { try { #region æ°æ®ééé¡¹ç¡®å® var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); var columnList = DataCaptureConfigManager.GetDataCaptureColumnConfig(); //var keyvalue = dataCaptureConfigslist.GroupBy(o => o.WorkingProcedure).Select(g => new //{ // keyword = g.Key, // RecordIDs = g.Where(c =>c.WorkingProcedure.Equals(g.Key)).ToList() //}); foreach (var config in dataCaptureConfigslist) { switch (config.DataCapturePointCode) { } } #endregion try { } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "å¯å¨çº¿ç¨æ¶----btn_StartUpAllThread_Clickæ¥éï¼", ex); } #region 设置æ¾ç¤ºUI tskSetGridSource = new Thread(GridRefresh); tskSetGridSource.Start(); dataGridView2.DataSource = sourcelist; #endregion } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "å¯å¨çº¿ç¨æ¶----btn_StartUpAllThread_Click allæ¥éï¼", ex); } } private void FormMain_Scroll(object sender, ScrollEventArgs e) { Rectangle rect; DataGridView ctrl = (DataGridView)sender; Point pt = PointToScreen(ctrl.Location); if (pt.X < 0) { int left = -pt.X; int top = ctrl.ColumnHeadersHeight; int width = e.OldValue - e.NewValue; int height = ctrl.ClientSize.Height; ctrl.Invalidate(new Rectangle(new Point(left, top), new Size(width, height))); } pt.X += ctrl.Width; rect = Screen.GetBounds(pt); if (pt.X > rect.Right) { int left = ctrl.ClientSize.Width - (pt.X - rect.Right) - (e.NewValue - e.OldValue); int top = ctrl.ColumnHeadersHeight; int width = e.NewValue - e.OldValue; int height = ctrl.ClientSize.Height; ctrl.Invalidate(new Rectangle(new Point(left, top), new Size(width, height))); } pt.Y += ctrl.Height; if (pt.Y > rect.Bottom) { int left = 0; int top = ctrl.ColumnHeadersHeight; int width = ctrl.ClientSize.Width; int height = ctrl.ClientSize.Height - (pt.Y - rect.Bottom) - (e.NewValue - e.OldValue); ctrl.Invalidate(new Rectangle(new Point(left, top), new Size(width, height))); } } private void button23_Click(object sender, EventArgs e) { GridRefresh(); } private void button25_Click(object sender, EventArgs e) { try { var WorkingProcedure = "OP35"; var EquipmentID = "EOP35"; var DataCapturePointCode = "OP3502A"; //var DataCapturePointCode = "OP3002CH3"; WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); wplog.WorkingProcedure = WorkingProcedure; wplog.EquipmentID = EquipmentID; ; wplog.Remarks = WorkingProcedure; wplog.MonitoringPoint = DataCapturePointCode; wplog.WorkPieceID = "DZ045L2309080100181A1A"; wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedUserName = Environment.MachineName + "èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); wplog.UpdatedTime = DateTimeHelper.GetDateTime(); wplog.IsDeleted = false; wplog.QualityOP10To1 = "-500"; WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //string path = ConfigHelper.GetConfigString("OP30QualityDataForStation");//æç æºæç äºç»´ç è·¯å¾ //if (string.IsNullOrEmpty(path)) //{ // path = @"C:\work\003-䏿±½è¿ææ°æ®éé\æ´çææ¡£\è®¾å¤æ¥å£ææ¡£\"; //} //path = @"C:\work\003-䏿±½è¿ææ°æ®éé\æ´çææ¡£\è®¾å¤æ¥å£ææ¡£\"; //if (DataCapturePointCode.Contains("CH3")) //{//å·¥ä½3 涨æåç© // path = path + "kistler_crack"; //} //else if (DataCapturePointCode.Contains("CH4")) //{//å·¥ä½4 颿§ç´§åç© // path = path + "Bosch_Rexroth"; //} //else if (DataCapturePointCode.Contains("CH5")) //{//å·¥ä½5 æ§ç´§åç© // path = path + "Bosch_Rexroth"; //} //else if (DataCapturePointCode.Contains("CH6")) //{//å·¥ä½6 衬å¥åè£ åç© // path = path + "kistler_bush"; //} //wplog.WorkPieceID = "DZ045L2309270100371A1A"; //try //{ // var get = wplog.GetType().GetProperty("WorkPieceID"); // if (get == null) // { // //Log4NetHelper.WriteErrorLog(LogType.DBDataCapture, $" {group.EquipmentNo}设å¤ç±äºæºå¤´å段å{item.DataCaptureColumnTabelColName}没æ¾å°ï¼èµå¼å¤±è´¥{currentlog.Id}"); // //continue; // } // var valuecol = get.GetValue(wplog); //} //catch (Exception setex) //{ // } ////wplog.QualityStateStr = "OK"; ////wplog.QualityOP30To1 = "test0122"; ////wplog.QualityOP30To2 = "test0122"; ////wplog.QualityOP80To1 = "test990222"; //try //{ // if (WorkingProcedure.Equals("OP30")) // { // var time = DateTimeHelper.GetDateTime(); // //è·åæä»¶å¤¹åç§° // List<string> directorylist = new List<string>(); // string directory = time.ToString("yyyy-MM-dd_HH"); // string directoryOther = time.AddSeconds(-30).ToString("yyyy-MM-dd_HH"); // directorylist.Add(directory); // if (!directory.Equals(directoryOther)) // {//妿30ç§åæ¯å¦ä¸ä¸ªæä»¶å¤¹ // directorylist.Add(directoryOther); // } // List<FileInfo> files = new List<FileInfo>(); // foreach (var dir in directorylist) // { // try // { // //æ«æå½åæ¶é´ä¸30ç§ååºç°çæä»¶,ä¸è¬èæå¨15ç§å·¦å³ï¼ä¸¤ä¸ªæå¡å¨æ¶é´ä¸ä¸æ ·ä¼å¯¼è´åä¸å°æä»¶ï¼ // var newFiles = FileHelper.DetectNewFiles(path + @"\" + dir, "*.pdf", 1000000000, time, time); // foreach (var file in newFiles) // { // files.Add((FileInfo)file); // } // } // catch (Exception ex) // { // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}ä¸çº¿å®æè¯»åæä»¶{dir}æ°æ®æ¶å¼å¸¸,é¿å å·¥åºå®æå¼å¸¸1ï¼", ex); // } // } // files = files.OrderByDescending(o => o.LastWriteTime).ToList(); // if (files.Count > 0) // { // switch (DataCapturePointCode) // { // case "OP3002CH3": // wplog.QualityStateStr = FileHelper.ReadPdfConntent(files[0].FullName, "Result"); // wplog.QualityStateStr = FileHelper.ReadPdfConntent(files[1].FullName, "Result"); // wplog.QualityOP30To1 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//涨æåç© // break; // case "OP3002CH4": // wplog.QualityStateStr = FileHelper.ReadPdfConntent(files[0].FullName, "Result"); // wplog.QualityOP30To2 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//颿§ç´§åç© // wplog.QualityOP30To3 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//颿§ç´§è§åº¦ // break; // case "OP3002CH5": // wplog.QualityStateStr = FileHelper.ReadPdfConntent(files[0].FullName, "Result"); // wplog.QualityOP30To4 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//ç»æ§ç´§åç© // wplog.QualityOP30To5 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//ç»æ§ç´§è§åº¦ // break; // case "OP3002CH6": // wplog.QualityStateStr = FileHelper.ReadPdfConntent(files[0].FullName, "Result"); // wplog.QualityOP30To6 = FileHelper.ReadPdfConntent(files[0].FullName, "Y-Maximum");//衬å¥åè£ åç© // wplog.QualityOP30To7 = FileHelper.ReadPdfConntent(files[0].FullName, "Block X");//衬å¥åè£ ä½ç§» // break; // default: // break; // } // } // } //} //catch (Exception ex) //{ // //threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åæä»¶æ°æ®æ¶å¼å¸¸,é¿å å·¥åºå®æå¼å¸¸ï¼", ex); //} ////æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 //WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //threadStatusMonitor.Threadstatue = 1; //WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, LogType.PLCOP10); //WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), new PLCService(), 1); //if (WorkingProcedure.Equals("OP20") // //|| _dataCaptureConfig.WorkingProcedure.Equals("OP50")|| _dataCaptureConfig.WorkingProcedure.Equals("OP60") // ) //{//op20,op50,op60 ä¼åæ¶æ¨åºå¤ä»¶ï¼æä»¥ç¹æ®å¤ç // wplog.WorkPieceID = wplog.WorkPieceIDA; // wplog.Remarks = "NOOKæ¨åºå·¥ä»¶A"; // WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); // wplog.WorkPieceID = wplog.WorkPieceIDB; // wplog.Remarks = "NOOKæ¨åºå·¥ä»¶B"; // WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); // wplog.WorkPieceID = wplog.WorkPieceIDC; // wplog.Remarks = "NOOKæ¨åºå·¥ä»¶C"; // WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); // wplog.WorkPieceID = wplog.WorkPieceIDD; // wplog.Remarks = "NOOKæ¨åºå·¥ä»¶D"; // WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //} //else //{ // //æ´æ°WorkPieceInfo表以åæå ¥WorkPieceLog表åWorkPieceInfoLog表 // WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); //} } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button26_Click(object sender, EventArgs e) { try { MyTest myTest = new MyTest(); Thread tskdataCapture = new Thread(myTest.DataCaptureStart); tskdataCapture.Start(); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(LogType.FormMain, "å¯å¨çº¿ç¨æ¶----btn_StartUpAllThread_Click allæ¥éï¼", ex); } } public WorkPieceLogMiddle GetCH4Info(string FullName, WorkPieceLogMiddle wplog) { try { string fileContent = File.ReadAllText(FullName); string[] lines2 = fileContent.Split('\n'); bool IDCodeIndex = false; int Mcount = 0; int i = 0; int count = 0; foreach (string line in lines2) { count++; if (count == 4) {//è·åè´¨éç»æ var list = line.Split(' '); if (list.Count() > 0) { var str = list[list.Count() - 1].ToString().Trim(); wplog.QualityStateStr = str.Equals("OK") ? "OK" : "NG"; } } // å¤çæ¯ä¸è¡çé»è¾ if (line.Contains("ID-Code"))//两个æ§ç´§ï¼æ¯ä¸ªåé¢é½æID-Code { i++; IDCodeIndex = true; Mcount = 0; } if (IDCodeIndex) { if (line.Contains(" M "))//第ä¸ä¸ªMè¡æ¯æ§ç´§æ°æ® {//颿§ç´§åç© Mcount++; if (Mcount == 3) { i++; var str = line.Replace("+", "").Replace("-", ""); var list = str.Split('M'); if (list.Count() == 4) { if (i <= 2) {//CH1 wplog.QualityOP30To2 = list[2].ToString().Trim(); } else {//CH2 wplog.QualityOP30To8 = list[2].ToString().Trim(); } } IDCodeIndex = false; } } } } } catch (Exception ex) { //Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}CH4å·¥ä½è´¨éæ°æ®å¼å¸¸å·¥ä»¶å·ï¼{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} æä»¶åï¼{FullName}ï¼", ex); } return wplog; } public WorkPieceLogMiddle GetCH5Info(string FullName, WorkPieceLogMiddle wplog) { try { string fileContent = File.ReadAllText(FullName); string[] lines2 = fileContent.Split('\n'); bool IDCodeIndex = false; int Mcount = 0; int i = 0; int count = 0; foreach (string line in lines2) { count++; if (count == 4) {//è·åè´¨éç»æ var list = line.Split(' '); if (list.Count() > 0) { var str = list[list.Count() - 1].ToString().Trim(); wplog.QualityStateStr = str.Equals("OK") ? "OK" : "NG"; } } // å¤çæ¯ä¸è¡çé»è¾ if (line.Contains("ID-Code"))//两个æ§ç´§ï¼æ¯ä¸ªåé¢é½æID-Code { i++; IDCodeIndex = true; Mcount = 0; } if (IDCodeIndex) { if (line.Contains(" M "))//第ä¸ä¸ªMè¡æ¯æ§ç´§æ°æ® {//æç»åç© Mcount++; if (Mcount == 3) { var str = line.Replace("+", "").Replace("-", ""); var list = str.Split('M'); if (list.Count() == 4) { if (i == 1) {//CH3 wplog.QualityOP30To3 = list[2].ToString().Trim(); } else {//CH4 wplog.QualityOP30To9 = list[2].ToString().Trim(); } } IDCodeIndex = false; } } } if (line.Contains(" MWSP ")) {//ç»æ§ç´§åç© ç»æ§ç´§è§åº¦ var list = line.Split(new String[] { " MWS " }, StringSplitOptions.None); if (list.Count() == 2) { if (i == 1) {//CH3 wplog.QualityOP30To4 = list[1].ToString().Trim(); } else {//CH4 wplog.QualityOP30To10 = list[1].ToString().Trim(); } var list2 = list[0].Split(new String[] { " W " }, StringSplitOptions.None); if (list2.Count() == 2) { var str = list2[1].ToString(); if (i == 1) {//CH3 wplog.QualityOP30To5 = str.Substring(0, str.IndexOf("MWSP")).Trim(); } else {//CH4 wplog.QualityOP30To11 = str.Substring(0, str.IndexOf("MWSP")).Trim(); } } } } } } catch (Exception ex) { //Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}CH5å·¥ä½è´¨éæ°æ®å¼å¸¸å·¥ä»¶å·ï¼{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} æä»¶åï¼{FullName}ï¼", ex); } return wplog; } private void button27_Click(object sender, EventArgs e) { try { #region OP80 ////string str = "#123"; ////str=str?.Replace("#", ""); //WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); //string path = "C:\\Users\\SY-PC\\Desktop\\FO";//OP80çå°å //var time = DateTimeHelper.GetDateTime(); //DateTime? fileFindTime = null; //if (fileFindTime == null) //{ // fileFindTime = time.AddMinutes(-10); //} ////OP80 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ ////æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å30ç§å°å½åæ¶é´çä¹é´çæä»¶ //List<FileInfo> files = new List<FileInfo>(); //var newFiles = FileHelper.DetectNewFilesCSV(path, 3000000, fileFindTime.Value, time.AddHours(2)); //foreach (var file in newFiles) //{ // files.Add((FileInfo)file); //} //files = files.OrderByDescending(o => o.LastWriteTime).ToList(); //foreach (var file in files) //{//åååºå¹é çæä»¶å为工件å·çæä»¶ // var datatable = CSVHelper.ReadCSVList(file.FullName); // List<string> rowFirst = new List<string>(); // List<string> rowSecond = new List<string>(); // if (datatable.Count == 2) // { // rowFirst = datatable[0].Split(',').ToList(); // rowSecond = datatable[1].Split(',').ToList(); // if (rowSecond.Count < 11) // { // continue; // } // //æ¥æåæ¶é´ æ¹å·/æ è¯å· åµå¥å·/ä¸»è½´å· æä½ç¬¦ ææ¬ æµéæº è¿ç¨åæ° æµéç³»ç» è¿ç¨åæ°å¼ åºåå· é¶ä»¶è¯å«å· 1 // OP80Info oP80Info = new OP80Info(); // oP80Info.æ¥æåæ¶é´ = rowSecond[0]; // oP80Info.æ¹å· = rowSecond[1]; // oP80Info.åµå¥å· = rowSecond[2]; // oP80Info.æä½ç¬¦ = rowSecond[3]; // oP80Info.ææ¬ = rowSecond[4]; // oP80Info.æµéæº = rowSecond[5]; // oP80Info.è¿ç¨åæ° = rowSecond[6]; // oP80Info.æµéç³»ç» = rowSecond[7]; // oP80Info.è¿ç¨åæ°å¼ = rowSecond[8]; // oP80Info.åºåå· = rowSecond[9]; // oP80Info.é¶ä»¶è¯å«å· = rowSecond[10]; // for (int i = 1; i <= (rowSecond.Count - 11) / 10; i++) // { // if (rowSecond.Count < (11 + i * 10)) // { // break; // } // //åç§° ç¸å¯¹å¼ ç¸å¯¹å¼åä½ ç»å¯¹å¼ ç»å¯¹å¼åä½ åä¹å¼ ä¸é ä¸é ç¶æ/ç级 åé符 // OP80ItemInfo item = new OP80ItemInfo(); // item.åé符 = rowSecond[1 + i * 10]; // item.åç§° = rowSecond[2 + i * 10]; // item.ç¸å¯¹å¼ = rowSecond[3 + i * 10]; // item.ç¸å¯¹å¼åä½ = rowSecond[4 + i * 10]; // item.ç»å¯¹å¼ = rowSecond[5 + i * 10]; // item.ç»å¯¹å¼åä½ = rowSecond[6 + i * 10]; // item.åä¹å¼ = rowSecond[7 + i * 10]; // item.ä¸é = rowSecond[8 + i * 10]; // item.ä¸é = rowSecond[9 + i * 10]; // item.ç¶æ = rowSecond[10 + i * 10]; // oP80Info.OP80ItemInfolist.Add(item); // if (item.åç§°.Equals("Weight Class") || item.åç§°.Equals("Weight Small End") // || item.åç§°.Equals("Weight Big End") || item.åç§°.Equals("Dime Small_End Class") // || item.åç§°.Equals("Dime Big_End Class")) // { // } // else // { // if (!string.IsNullOrEmpty(item.ç¶æ)) // { // oP80Info.OP80ItemStatusInfolist.Add(item); // } // } // } // if (oP80Info.OP80ItemStatusInfolist.Count > 0) // { // if (oP80Info.OP80ItemStatusInfolist.Any(o => !o.ç¶æ.Equals("OK"))) // { // wplog.QualityStateStr = "NG"; // } // else // { // wplog.QualityStateStr = "OK"; // } // } // else // { // wplog.QualityStateStr = "OK"; // } // wplog.OP80NewCode = oP80Info.æ¹å·?.Replace("#", ""); // //大头éé // wplog.QualityOP80To1 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Big End")).FirstOrDefault()?.ç»å¯¹å¼; // //å°å¤´éé // wplog.QualityOP80To2 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Small End")).FirstOrDefault()?.ç»å¯¹å¼; // //æ»é // wplog.QualityOP80To3 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Total Weight")).FirstOrDefault()?.ç»å¯¹å¼; // //å¼¯æ² // wplog.QualityOP80To4 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Bend to A")).FirstOrDefault()?.ç»å¯¹å¼; // //æåº¦ // wplog.QualityOP80To5 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Twist to A")).FirstOrDefault()?.ç»å¯¹å¼; // //大头åç´åº¦ // wplog.QualityOP80To6 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Big_End_C_Squareness")).FirstOrDefault()?.ç»å¯¹å¼; // //å°å¤´åç´åº¦ // wplog.QualityOP80To10 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Sma_End_C_Squareness")).FirstOrDefault()?.ç»å¯¹å¼; // //大头ååç»çº§å« // wplog.QualityOP80To7 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Dime Big_End Class")).FirstOrDefault()?.ç¶æ; // //å°å¤´ååç»çº§å« // wplog.QualityOP80To8 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Dime Small_End Class")).FirstOrDefault()?.ç¶æ; // //ééç»å« // wplog.QualityOP80To9 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Class")).FirstOrDefault()?.ç¶æ; // } // else // { // wplog.Remarks = (wplog.Remarks ?? "") + $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName}å¼å¸¸ï¼è¡æ°ä¸æ¯2è¡"; // } // fileFindTime = files[0].LastWriteTime; // break; //} #endregion #region OP30 //////var QualityStateStr = FileHelper.ReadPdfFileForSpire(textBox10.Text, "Result"); //////var QualityOP30To6 = FileHelper.ReadPdfFileForSpire(textBox10.Text, "Y-Maximum");//衬å¥åè£ åç© //////var QualityOP30To7 = FileHelper.ReadPdfFileForSpire(textBox10.Text, "Block X");//衬å¥åè£ ä½ç§» ////var dt = CSVHelper.ReadCSV(textBox10.Text); //////var datatable = CSVHelper.ReadCSVList(textBox10.Text); //////List<string> rowFirst = new List<string>(); //////List<string> rowSecond = new List<string>(); //////if(datatable.Count==2) //////{ ////// rowFirst = datatable[0].Split(',').ToList(); ////// rowSecond = datatable[1].Split(',').ToList(); //////} //string d = DateTime.Now.AddHours(-10).ToString("yyyy-MM-dd_HH"); ////æ«æå ±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ ////æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ //var startTime = DateTimeHelper.GetDateTime().AddYears(-1); //var endTime = DateTimeHelper.GetDateTime(); ////var newFiles = FileHelper.DetectNewFilesCSV(textBox10.Text+@"\"+d, 10, Convert.ToDateTime(startTime), endTime); ////List<FileInfo> files = new List<FileInfo>(); ////foreach (var file in newFiles) ////{ //// files.Add((FileInfo)file); ////} ////files = files.OrderByDescending(o => o.LastAccessTime).ToList(); ////foreach (var file in files) ////{ //// //var datatable = CSVHelper.ReadCSV(file.FullName); ////} //var newFiles = FileHelper.DetectNewFiles(textBox10.Text, "*.txt", 10, Convert.ToDateTime(startTime), endTime); //List<FileInfo> files = new List<FileInfo>(); //foreach (var file in newFiles) //{ // files.Add((FileInfo)file); //} //files = files.OrderByDescending(o => o.LastAccessTime).ToList(); //foreach (var file in files) //{ // //string[] lines = File.ReadAllLines(file.FullName); // //foreach (string line in lines) // //{ // // // å¤çæ¯ä¸è¡çé»è¾ // //} // ////var datatable = CSVHelper.ReadCSV(file.FullName); // //using (StreamReader reader = new StreamReader(file.FullName)) // //{ // // string line; // // while ((line = reader.ReadLine()) != null) // // { // // // å¤çæ¯ä¸è¡çé»è¾ // // } // //} // string fileContent = File.ReadAllText(file.FullName); // string[] lines2 = fileContent.Split('\n'); // bool IDCodeIndex = false; // int Mcount = 0; // foreach (string line in lines2) // { // // å¤çæ¯ä¸è¡çé»è¾ // if (line.Contains("ID-Code"))//两个æ§ç´§ï¼æ¯ä¸ªåé¢é½æID-Code // { // IDCodeIndex = true; // Mcount = 0; // } // if(IDCodeIndex) // { // if (line.Contains(" M "))//第ä¸ä¸ªMè¡æ¯æ§ç´§æ°æ® // { // Mcount++; // if(Mcount==3) // { // var str=line.Replace("+", "").Replace("-", ""); // var list = str.Split('M'); // if(list.Count()==4) // { // } // IDCodeIndex = false; // } // } // } // } //} #endregion #region OP60 WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); string path = "C:\\Users\\SY-PC\\Desktop\\FO";//OP80çå°å var time = DateTimeHelper.GetDateTime(); DateTime? fileFindTime = null; if (fileFindTime == null) { fileFindTime = time.AddMinutes(-100); } //OP60 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å30ç§å°å½åæ¶é´çä¹é´çæä»¶ List<FileInfo> files = new List<FileInfo>(); var newFiles = FileHelper.DetectNewFiles(path, "*.dfq", 300000, fileFindTime.Value, time.AddHours(2)); foreach (var file in newFiles) { files.Add((FileInfo)file); } files = files.OrderByDescending(o => o.LastWriteTime).ToList(); List<OP60Info> op60Infos = new List<OP60Info>(); foreach (var file in files) {//åååºå¹é çæä»¶å为工件å·çæä»¶ string DataCapturePointCode = "OP6002A"; if (file.Name.Contains("SP-" + DataCapturePointCode.Substring(DataCapturePointCode.Length - 1, 1))) { } var datatable = CSVHelper.ReadCSVList(file.FullName); if (datatable.Count < 106) {//è´¨éæ°æ®ä»106è¡å¼å§ } datatable.Reverse(); System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); byte[] byteArray = new byte[] { (byte)15 }; string strCharacter = asciiEncoding.GetString(byteArray); var list = datatable[0].Split(new String[] { strCharacter }, StringSplitOptions.None); byte[] byteArray2 = new byte[] { (byte)20 }; string strCharacter2 = asciiEncoding.GetString(byteArray2); foreach (var item in list) { var listitem = item.Split(new String[] { strCharacter2 }, StringSplitOptions.None); if (listitem.Count() == 3) { OP60Info info = new OP60Info(); info.datetime = listitem[2]; info.col2 = listitem[1]; info.value = listitem[0]; info.datetimeHandle = CommonManager.GetOP60Time(info.datetime); op60Infos.Add(info); } } if (op60Infos.Count() >= 2) { //if (op60QualityTime.HasValue) { //if (op60Infos[0].datetimeHandle > op60QualityTime.Value) { wplog.QualityOP60To1 = op60Infos[0].value; wplog.QualityOP60To2 = op60Infos[1].value; } } //op60QualityTime = op60Infos[0].datetimeHandle; break; } } #endregion #region QITA //var WorkingProcedure = "OP20"; //var EquipmentID = "EOP20"; //var DataCapturePointCode = "OP2002A"; ////var DataCapturePointCode = "OP3002CH3"; //WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); //wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); //wplog.WorkingProcedure = WorkingProcedure; //wplog.EquipmentID = EquipmentID; //wplog.Remarks = WorkingProcedure; //wplog.MonitoringPoint = DataCapturePointCode; //wplog.WorkPieceID = "DZ045L2312150101041CAO"; //wplog.CreatedTime = DateTimeHelper.GetDateTime(); //wplog.CreatedUserName = DataCapturePointCode; //wplog.UpdatedUserName = Environment.MachineName + "èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); //wplog.UpdatedTime = DateTimeHelper.GetDateTime(); //wplog.IsDeleted = false; //wplog.QualityStateStr = "OK"; ////try ////{ //// using (DbModel db = new DbModel()) //// { //// var info = db.KnifeToolEquipmentInfo.Where(o => o.EquipmentID.Equals(wplog.EquipmentID)).ToList(); //// foreach (var item in info) //// { //// item.CurrentLife++; //// item.UpdatedTime = DateTime.Now; //// } //// //db.SaveChanges(); //// } ////} ////catch (Exception ex) ////{ ////} ////wplog.Remarks = ""; ////wplog.Remarks = (wplog.Remarks ?? "") + $"è´¨éï¼{wplog.Remarks ?? "空"}"; ////wplog.Remarks = null; ////wplog.Remarks = (wplog.Remarks ?? "") + $"è´¨éï¼{wplog.Remarks ?? "空"}"; ////wplog.Remarks = "111"; ////wplog.Remarks = (wplog.Remarks ?? "") + $"è´¨éï¼{wplog.Remarks ?? "空"}"; ////wplog = GetCH4Info(textBox10.Text, wplog); //WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); ////WorkPieceLogMiddle log = new WorkPieceLogMiddle(); ////log = GetCH5Info(textBox10.Text, log); #endregion } catch (Exception ex) { MessageBox.Show(ex.Message); } } } public enum test { test1, test2 = 3, test3 = 4 } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormMain.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,204 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <metadata name="Threadcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Threadcname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="EquipmentID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="WorkingProcedure.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCapturePointCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCapturePointCname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCaptureType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCapturePLCType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="PLCIP.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="PLCPort.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCaptureColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="DataCaptureColumnType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="dataGridViewTextBoxColumn10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> </root> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormTest.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,94 @@  namespace iWare_SCADA_DataCaptureV3 { partial class FormTest { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.button1 = new System.Windows.Forms.Button(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.button2 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; // // button1 // this.button1.Location = new System.Drawing.Point(126, 30); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // dataGridView1 // this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Location = new System.Drawing.Point(59, 128); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.Size = new System.Drawing.Size(707, 150); this.dataGridView1.TabIndex = 1; // // button2 // this.button2.Location = new System.Drawing.Point(282, 30); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 0; this.button2.Text = "button1"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // FormTest // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.dataGridView1); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Name = "FormTest"; this.Text = "FormTest"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.Button button1; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.Button button2; } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormTest.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,63 @@ using iWare_SCADA_BusinessLogical.BLL; using iWare_SCADA_BusinessLogical; using iWare_SCADA_BusinessLogical.Utils; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using iWare_SCADA_Model.TableModelSC; namespace iWare_SCADA_DataCaptureV3 { public partial class FormTest : Form { public FormTest() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { AlarmLogManager.UpdateAlarmLogs(new AlarmLog()); //openFileDialog1.Filter = "Excel2003(*.xls)|*.csv|Excel2007(*.xlsx)|*.xlsx"; //if (openFileDialog1.ShowDialog() != DialogResult.OK) // return; //string FileNameWrite = openFileDialog1.FileName; //var datatable = CSVHelper.ReadCSV(FileNameWrite); //this.dataGridView1.DataSource = datatable; } catch(Exception ex) { MessageBox.Show(ex.Message); } } private void button2_Click(object sender, EventArgs e) { try { var log2=AlarmLogManager.GetAlarmLogs(); //var log = WorkPieceLogManager.GetAlarmLog(); this.dataGridView1.DataSource = log2; } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/FormTest.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,123 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> </root> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Program.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace iWare_SCADA_DataCaptureV3 { static class Program { /// <summary> /// åºç¨ç¨åºçä¸»å ¥å£ç¹ã /// </summary> [STAThread] static void Main() { Yitter.IdGenerator.IdGeneratorOptions options = new Yitter.IdGenerator.IdGeneratorOptions(1); Yitter.IdGenerator.YitIdHelper.SetIdGenerator(options); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormMain()); //Application.Run(new FormTest()); } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Properties/AssemblyInfo.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // æå ³ç¨åºéçä¸è¬ä¿¡æ¯ç±ä»¥ä¸ // æ§å¶ãæ´æ¹è¿äºç¹æ§å¼å¯ä¿®æ¹ // ä¸ç¨åºéå ³èçä¿¡æ¯ã [assembly: AssemblyTitle("iWare_SCADA_DataCaptureV3")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("iWare_SCADA_DataCaptureV3")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // å° ComVisible 设置为 false ä¼ä½¿æ¤ç¨åºéä¸çç±»å //对 COM ç»ä»¶ä¸å¯è§ã妿éè¦ä» COM è®¿é®æ¤ç¨åºéä¸çç±»å //è¯·å°æ¤ç±»åç ComVisible ç¹æ§è®¾ç½®ä¸º trueã [assembly: ComVisible(false)] // 妿æ¤é¡¹ç®å COM å ¬å¼ï¼åä¸å GUID ç¨äºç±»ååºç ID [assembly: Guid("29ff4f3c-b142-4ba4-85e8-83241232f709")] // ç¨åºéççæ¬ä¿¡æ¯ç±ä¸åå个å¼ç»æ: // // ä¸»çæ¬ // æ¬¡çæ¬ // çæå· // ä¿®è®¢å· // //å¯ä»¥æå®ææè¿äºå¼ï¼ä¹å¯ä»¥ä½¿ç¨âçæå·âåâ修订å·âçé»è®¤å¼ //éè¿ä½¿ç¨ "*"ï¼å¦ä¸æç¤º: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Properties/Resources.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,63 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </auto-generated> //------------------------------------------------------------------------------ namespace iWare_SCADA_DataCapture_Test.Properties { using System; /// <summary> /// ä¸ä¸ªå¼ºç±»åçèµæºç±»ï¼ç¨äºæ¥æ¾æ¬å°åçå符串çã /// </summary> // æ¤ç±»æ¯ç± StronglyTypedResourceBuilder // ç±»éè¿ç±»ä¼¼äº ResGen æ Visual Studio çå·¥å ·èªå¨çæçã // è¥è¦æ·»å æç§»é¤æåï¼è¯·ç¼è¾ .ResX æä»¶ï¼ç¶åéæ°è¿è¡ ResGen // (以 /str ä½ä¸ºå½ä»¤é项)ï¼æéæ°çæ VS 项ç®ã [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// è¿åæ¤ç±»ä½¿ç¨çç¼åç ResourceManager å®ä¾ã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iWare_SCADA_DataCapture_Test.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// éåå½å线ç¨ç CurrentUICulture 屿§ï¼å¯¹ /// ä½¿ç¨æ¤å¼ºç±»åèµæºç±»çææèµæºæ¥æ¾æ§è¡éåã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Properties/Resources.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,117 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Properties/Settings.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </auto-generated> //------------------------------------------------------------------------------ namespace iWare_SCADA_DataCapture_Test.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } } DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/Properties/Settings.settings
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,7 @@ <?xml version='1.0' encoding='utf-8'?> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <Profiles> <Profile Name="(Default)" /> </Profiles> <Settings /> </SettingsFile> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test.csproj
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,182 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{E07C6E80-A875-482C-9427-BA5703DFF7EB}</ProjectGuid> <OutputType>WinExe</OutputType> <RootNamespace>iWare_SCADA_DataCapture_Test</RootNamespace> <AssemblyName>iWare_SCADA_DataCapture_Test</AssemblyName> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <Deterministic>true</Deterministic> <NuGetPackageImportStamp> </NuGetPackageImportStamp> <IsWebBootstrapper>false</IsWebBootstrapper> <PublishUrl>C:\2.ProjectFolder\å®è£ æä»¶\</PublishUrl> <Install>true</Install> <InstallFrom>Disk</InstallFrom> <UpdateEnabled>false</UpdateEnabled> <UpdateMode>Foreground</UpdateMode> <UpdateInterval>7</UpdateInterval> <UpdateIntervalUnits>Days</UpdateIntervalUnits> <UpdatePeriodically>false</UpdatePeriodically> <UpdateRequired>false</UpdateRequired> <MapFileExtensions>true</MapFileExtensions> <ApplicationRevision>3</ApplicationRevision> <ApplicationVersion>1.0.0.%2a</ApplicationVersion> <UseApplicationTrust>false</UseApplicationTrust> <PublishWizardCompleted>true</PublishWizardCompleted> <BootstrapperEnabled>true</BootstrapperEnabled> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup> <ManifestCertificateThumbprint>FD4004E500823F6C9EAF9596D7157A90E034751E</ManifestCertificateThumbprint> </PropertyGroup> <PropertyGroup> <ManifestKeyFile>iWare_SCADA_DataCaptureV3_TemporaryKey.pfx</ManifestKeyFile> </PropertyGroup> <PropertyGroup> <GenerateManifests>true</GenerateManifests> </PropertyGroup> <PropertyGroup> <SignManifests>false</SignManifests> </PropertyGroup> <ItemGroup> <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942"> <HintPath>..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll</HintPath> </Reference> <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath> </Reference> <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath> </Reference> <Reference Include="itextsharp, Version=5.5.13.3, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL"> <HintPath>..\packages\iTextSharp.5.5.13.3\lib\itextsharp.dll</HintPath> </Reference> <Reference Include="System"> <HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll</HintPath> </Reference> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> <Reference Include="System.Net.Http" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="Yitter.IdGenerator.Net45, Version=1.0.0.4, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\packages\Yitter.IdGenerator.Net45.1.0.0\lib\net452\Yitter.IdGenerator.Net45.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Compile Include="FormMain.cs"> <SubType>Form</SubType> </Compile> <Compile Include="FormMain.Designer.cs"> <DependentUpon>FormMain.cs</DependentUpon> </Compile> <Compile Include="FormTest.cs"> <SubType>Form</SubType> </Compile> <Compile Include="FormTest.Designer.cs"> <DependentUpon>FormTest.cs</DependentUpon> </Compile> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <EmbeddedResource Include="FormMain.resx"> <DependentUpon>FormMain.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="FormTest.resx"> <DependentUpon>FormTest.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> <SubType>Designer</SubType> </EmbeddedResource> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> <None Include="App - ç产ç¯å¢.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="App - æ¬æºç¯å¢.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="iWare_SCADA_DataCaptureV3_TemporaryKey.pfx" /> <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> </ItemGroup> <ItemGroup> <None Include="App.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> <ItemGroup> <ProjectReference Include="..\iWare_SCADA_BusinessLogical\iWare_SCADA_BusinessLogical.csproj"> <Project>{32708f19-fe1a-48f5-b373-8e1c776f216c}</Project> <Name>iWare_SCADA_BusinessLogical</Name> </ProjectReference> <ProjectReference Include="..\iWare_SCADA_Model\iWare_SCADA_Model.csproj"> <Project>{91c185de-15ab-44ae-b585-53799fc51be0}</Project> <Name>iWare_SCADA_Model</Name> </ProjectReference> </ItemGroup> <ItemGroup> <BootstrapperPackage Include=".NETFramework,Version=v4.7.2"> <Visible>False</Visible> <ProductName>Microsoft .NET Framework 4.7.2 %28x86 å x64%29</ProductName> <Install>true</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> <Visible>False</Visible> <ProductName>.NET Framework 3.5 SP1</ProductName> <Install>false</Install> </BootstrapperPackage> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>è¿å°è®¡ç®æºä¸ç¼ºå°æ¤é¡¹ç®å¼ç¨ç NuGet ç¨åºå ã使ç¨âNuGet ç¨åºå è¿åâå¯ä¸è½½è¿äºç¨åºå ãæå ³æ´å¤ä¿¡æ¯ï¼è¯·åè§ http://go.microsoft.com/fwlink/?LinkID=322105ã缺å°çæä»¶æ¯ {0}ã</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" /> <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" /> </Target> <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" /> </Project> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_DataCapture_Test/packages.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="BouncyCastle" version="1.8.9" targetFramework="net472" /> <package id="EntityFramework" version="6.4.4" targetFramework="net472" /> <package id="iTextSharp" version="5.5.13.3" targetFramework="net472" /> <package id="Yitter.IdGenerator.Net45" version="1.0.0" targetFramework="net472" /> </packages> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/App.Config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <connectionStrings> <add name="SCTest" connectionString="data source=.;initial catalog=SCTest_new;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> <add name="Model1" connectionString="data source=.;initial catalog=SCADA_DF22001_CORE;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> <add name="Model2" connectionString="data source=.;initial catalog=SCADA_DF22001_CORE;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> <add name="Model3" connectionString="data source=82.156.32.44;initial catalog=iWare.SCADA;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> <add name="Entities" connectionString="metadata=res://*/test.Model1.csdl|res://*/test.Model1.ssdl|res://*/test.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=82.156.32.44;initial catalog=iWare.SCADA;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> <add name="Model11" connectionString="data source=82.156.32.44;initial catalog=iWare.SCADA;persist security info=True;user id=sa;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> <add name="Model12" connectionString="data source=10.10.40.166;initial catalog=iWare.SCADA;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="mssqllocaldb" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> </configuration> DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/EnumberEntity.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWare_SCADA_Model { /// <summary> /// æä¸¾å®ä½ç±» /// </summary> public class EnumberEntity { /// <summary> /// æä¸¾çæè¿° /// </summary> public string Desction { set; get; } /// <summary> /// æä¸¾åç§° /// </summary> public string EnumName { set; get; } /// <summary> /// æä¸¾å¯¹è±¡çå¼ /// </summary> public int EnumValue { set; get; } } } 在上述文件截断后对比
DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/Enums.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/ListItem.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/MessageModel.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/MiddleModel/ThreadStatusMonitorMiddle.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/MiddleModel/WorkPieceLogMiddle.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/PLCDataCapture/BasePlcParam.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/PLCDataCapture/HslCommunicationParam.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/Properties/AssemblyInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/SystemValue.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/DataCaptureColumnConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/DataCaptureConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/DbModel.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/EquipmentBaseInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/EquipmentCurrentMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/EquipmentWorkingLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/KnifeToolBaseInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/KnifeToolDataMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/QualityDataInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/SystemLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/WorkPieceInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/WorkPieceInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel - 副本/WorkPieceLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/DataCaptureColumnConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/DataCaptureConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/DbModel.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/EquipmentBaseInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/EquipmentCurrentMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/EquipmentFailureCode.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/EquipmentWorkingLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolBaseInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolDataMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolEquipmentInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolEquipmentInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolEquipmentMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/KnifeToolEquipmentUpdateLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/Model1.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/QualityDataInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/QualityDataInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/SystemLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/ThreadStatusMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/WorkPieceInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/WorkPieceInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/WorkPieceLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/WorkPieceProcess.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModel/v_get_equipment_alert.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/AlarmLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/CNCStatus.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/Count.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/CumulativeTime.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/CurrentToolNumber.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/FeedAndSpindle.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/Load.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/OEE.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/Postion.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/ProgramBlock.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/ProgramInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/SCModel.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/TableModelSC/TimeData.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/iWare_SCADA_Model.csproj DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/packages.config DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/DataCaptureColumnConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/DataCaptureConfig.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/EquipmentBaseInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/EquipmentCurrentMonitor.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/EquipmentWorkingLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/Model1.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/Model2.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/Model3.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/QualityDataInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/QualityDataInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/WorkPieceInfo.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/WorkPieceInfoLog.cs DataCapture/iWare_SCADA_DataCapture_Test/iWare_SCADA_Model/test/WorkPieceLog.cs