|
|
@@ -0,0 +1,457 @@
|
|
|
+
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.ComponentModel;
|
|
|
+using System.Data;
|
|
|
+
|
|
|
+using Curtain.DataAccess;
|
|
|
+using Curtain.Extension.ExObjectConvert;
|
|
|
+using Curtain.Extension.ExSystemData;
|
|
|
+using Curtain.Framework.Json;
|
|
|
+using Curtain.Helpers;
|
|
|
+using Curtain.Log;
|
|
|
+using Curtain.Net.Sockets.PLC;
|
|
|
+using Curtain.Net.Sockets.PLC.Model;
|
|
|
+using Curtain.Net.Sockets.PLC.Model.Melsec;
|
|
|
+
|
|
|
+using PLC_S_1.Proxy;
|
|
|
+
|
|
|
+namespace PLC_S_1.ServerModel
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 返回产品型号,计件(1-7改洗交接) 0:复位 1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置
|
|
|
+ /// </summary>
|
|
|
+ public class GoodsCode_DM2201 : SocketServer<SimpleSocketServerModel>, IShowFormLog, IWindowsServer
|
|
|
+ {
|
|
|
+ public Dictionary<string, PLC_S_GC_DM1> PLC_FLAGS = new Dictionary<string, PLC_S_GC_DM1>();
|
|
|
+ public const string M_NAME = "GC_DM1_";
|
|
|
+ private MES_S _mes_s = null;
|
|
|
+
|
|
|
+ private readonly Logger logger = Logger.CreateLogger(M_NAME);
|
|
|
+ private readonly LogInfo logger_t = new LogInfo();
|
|
|
+ private readonly LogInfo logger_e = new LogInfo();
|
|
|
+
|
|
|
+ //private bool
|
|
|
+
|
|
|
+ public int Interval
|
|
|
+ {
|
|
|
+ get;
|
|
|
+ set;
|
|
|
+ }
|
|
|
+ public string EPTS_CODE
|
|
|
+ {
|
|
|
+ get;
|
|
|
+ set;
|
|
|
+ }
|
|
|
+ public GoodsCode_DM2201()
|
|
|
+ {
|
|
|
+ logger.FileExistDays = 30;
|
|
|
+ logger.FilePrefix = "";
|
|
|
+ logger.FileSuffix = M_NAME;
|
|
|
+ logger.LevelOneFile = true;
|
|
|
+ logger.FileNameWithoutDate = true;
|
|
|
+
|
|
|
+ logger_t.SubFolderFormat = "<name>";
|
|
|
+ logger_t.FileExistDays = 30;
|
|
|
+ logger_t.LevelOneFile = true;
|
|
|
+
|
|
|
+ logger_e.FileExistDays = 10;
|
|
|
+
|
|
|
+ this.Model.FormatType = CommandFormatType.StartStopChar;
|
|
|
+
|
|
|
+ this.ServerStarting += ServerSocket_ServerStarting;
|
|
|
+ this.ServerStarted += ServerSocket_ServerStarted;
|
|
|
+ this.ServerStoping += ServerSocket_ServerStoping;
|
|
|
+ this.ServerStoped += ServerSocket_ServerStoped;
|
|
|
+
|
|
|
+ this.ServerMessage += ServerSocket_ServerMessage;
|
|
|
+ this.Received += ServerSocket_Received;
|
|
|
+
|
|
|
+ _mes_s = MES_S.Get();
|
|
|
+ }
|
|
|
+
|
|
|
+ #region Server
|
|
|
+ public IFormLogShow FormLogShow
|
|
|
+ {
|
|
|
+ get;
|
|
|
+ set;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ServerSocket_ServerStarting(object sender, CancelEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ logger.OutputTrace($"{M_NAME}_ServerStarting");
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ private void ServerSocket_ServerStarted(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ logger.OutputTrace($"{M_NAME}_ServerStarted");
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ private void ServerSocket_ServerStoping(object sender, CancelEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ logger.OutputTrace($"{M_NAME}_ServerStoping");
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ private void ServerSocket_ServerStoped(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ logger.OutputTrace($"{M_NAME}_ServerStoped");
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ private void ServerSocket_ServerMessage(object sender, ServerMessageEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ string message = e.ToString();
|
|
|
+ string cip = e?.Client?.IP;
|
|
|
+ if (e.Type == ServerMessageType.Debug)
|
|
|
+ {
|
|
|
+ Logger.Debug(message, $"{M_NAME}-T[{cip}]", logger_t);
|
|
|
+ }
|
|
|
+ if (e.Type == ServerMessageType.Error)
|
|
|
+ {
|
|
|
+ Logger.Error(e.Exception, message, $"{M_NAME}-E[{cip}]", logger_e);
|
|
|
+ }
|
|
|
+ if (e.Type == ServerMessageType.Trace)
|
|
|
+ {
|
|
|
+ Logger.Trace(message, $"{M_NAME}-T[{cip}]", logger_t);
|
|
|
+ }
|
|
|
+ if (e.Type == ServerMessageType.Warning)
|
|
|
+ {
|
|
|
+ Logger.Warn(message, $"{M_NAME}-E[{cip}]", logger_e);
|
|
|
+ }
|
|
|
+ FormLogShow?.ShowLog("ServerMessage=" + message);
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 返回产品型号
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private void ServerSocket_Received(object sender, ReceiveSession e)
|
|
|
+ {
|
|
|
+ PLC_S_GC_DM1 plc_s = null;
|
|
|
+ string cIP = e?.Client?.IP;
|
|
|
+ string logKeyT = $"{M_NAME}-T[{cIP}]";
|
|
|
+ string logKeyE = $"{M_NAME}-E[{cIP}]";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ SocketClient<MelsecA1EAsciiModel> plc = null;
|
|
|
+ Logger LoggerT = Logger.CreateLogger(logKeyT, logger_t);
|
|
|
+ lock (LoggerT)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ LoggerT.BeginTracking();
|
|
|
+
|
|
|
+ string outputMessage = e.ToString();
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ if (string.IsNullOrWhiteSpace(e.Content))
|
|
|
+ {
|
|
|
+ outputMessage = "接收数据为空";
|
|
|
+ Logger.Warn(outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Warn(outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ outputMessage = e.Content;
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ string[] c = e.Content.Split('#');
|
|
|
+ string flag = null;
|
|
|
+ if (c.Length > 0)
|
|
|
+ {
|
|
|
+ flag = c[0];
|
|
|
+ }
|
|
|
+ string barcode = null;
|
|
|
+ if (c.Length > 1)
|
|
|
+ {
|
|
|
+ barcode = c[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (string.IsNullOrWhiteSpace(flag))
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]接收设备代码为空";
|
|
|
+ Logger.Warn(outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Warn(outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ plc_s = GetPLC_S_DM(flag, e, logKeyE);
|
|
|
+ if (plc_s == null)
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]设备代码[{flag}]未找到ini配置或有错误";
|
|
|
+ Logger.Error(null, outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Error(null, outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ outputMessage = $"[{e.Content}]PLC_Connect={JsonHelper.FromObject(plc_s)}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ plc = new SocketClient<MelsecA1EAsciiModel>();
|
|
|
+ plc.Connect(plc_s.IP, plc_s.Port);
|
|
|
+ //outputMessage = $"[{e.Content}]PLC_Connect=[{plc_s.IP}:{plc_s.Port}]";
|
|
|
+ //Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ //FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ plc.Write<int>(plc_s.Add_GoodsCode, plc_s.Add_GoodsCodeNum, 0);
|
|
|
+ plc.Write<int>(plc_s.Add_FlagCode, plc_s.Add_FlagCodeNum, 0);
|
|
|
+
|
|
|
+ if (string.IsNullOrWhiteSpace(barcode) ||
|
|
|
+ barcode == "0" ||
|
|
|
+ barcode.Length != 11 ||
|
|
|
+ barcode.StartsWith("0"))
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]接收条码格式错误";
|
|
|
+ Logger.Warn(outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Warn(outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ // 0:复位 1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, 2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ DataRow codeRow = GetGoodsCode(barcode, e, logKeyE, plc_s);
|
|
|
+ if (codeRow == null)
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]此条码[{barcode}]不存在";
|
|
|
+ Logger.Warn(outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Warn(outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ // 0:复位 1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, 2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ string code = codeRow["goodscode"].ToString();
|
|
|
+ string plc_code = codeRow["plc_code"].ToString();
|
|
|
+ string p_id = codeRow["p_id"].ToString();
|
|
|
+
|
|
|
+ outputMessage = $"[{e.Content}]产品型号={code}[{plc_code}]";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ if (string.IsNullOrWhiteSpace(plc_code))
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]此条码[{barcode}]未设置型号代码";
|
|
|
+ Logger.Error(null, outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Error(null, outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ // 0:复位 1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, 5);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //outputMessage = $"[{e.Content}]SET_GoodsCode=[{plc_code}]{plc_s.Add_GoodsCode + plc_s.Add_GoodsCodeNum}";
|
|
|
+ //Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ //FormLogShow?.ShowLog(outputMessage);
|
|
|
+ plc.Write<int>(plc_s.Add_GoodsCode, plc_s.Add_GoodsCodeNum, (plc_code.ToInt32()));
|
|
|
+ outputMessage = $"[{e.Content}]END_GoodsCode=[{plc_code}]{plc_s.Add_GoodsCode + plc_s.Add_GoodsCodeNum}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ if (p_id != plc_s.P_ID + "")
|
|
|
+ {
|
|
|
+ string result = SmartDeviceProxy.Instance.Invoke<string>(
|
|
|
+ p => p.AddWorkPieceByStatus3(_mes_s.AccountCode,
|
|
|
+ plc_s.WS_USER, null, plc_s.P_ID, barcode, plc_s.WS_NAME));
|
|
|
+
|
|
|
+ outputMessage = $"[{e.Content}]MES_Result=[{result}]";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ // 返回状态(成功、失败)
|
|
|
+ if (result != "OK")
|
|
|
+ {
|
|
|
+ int plc_flag = 3;
|
|
|
+ if (result == "EE")
|
|
|
+ {
|
|
|
+ plc_flag = 4;
|
|
|
+ outputMessage = $"[{EPTS_CODE}]result=[{result}]MES服务端异常(详情参见MES端日志)";
|
|
|
+ }
|
|
|
+ else if (result == "EU-01")
|
|
|
+ {
|
|
|
+ outputMessage = $"[{EPTS_CODE}]result=[{result}]无效的帐套或工号(详情参见MES端日志)";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outputMessage = $"[{EPTS_CODE}]result=[{result}]其他错误(详情参见MES端日志)";
|
|
|
+ }
|
|
|
+ Logger.Error(null, outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Error(null, outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, plc_flag);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, 1);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ FormLogShow?.ShowLog($"[{e.Content}]ERROR={ex.Message}");
|
|
|
+ if (plc_s != null)
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR", logKeyT, logger_t);
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR", logKeyE, logger_e);
|
|
|
+ // 1.条码格式错误,2.条码不存在,3.产品型号没有设置标识码,4.MES系统异常
|
|
|
+ SendFlag(plc_s, e, logKeyT, logKeyE, plc, 4);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-NOFLAG", logKeyT, logger_t);
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-NOFLAG", logKeyE, logger_e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ LoggerT?.EndTracking();
|
|
|
+
|
|
|
+ plc?.Disconnect();
|
|
|
+ plc?.Close();
|
|
|
+ //e.ReturnMessage("0000");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SendFlag(PLC_S_GC_DM1 plc_s, ReceiveSession e, string loggerNameT,
|
|
|
+ string loggerNameE, SocketClient<MelsecA1EAsciiModel> plc, int errorcode)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //using (SocketClient<SiemensS7_1200Model> plc = new SocketClient<SiemensS7_1200Model>())
|
|
|
+ {
|
|
|
+ //0:复位 1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置
|
|
|
+ string outputMessage = $"[{e.Content}]SET_F_CODE=[{errorcode}]{plc_s.Add_FlagCode}{plc_s.Add_FlagCodeNum}[1:成功 2:条码格式错误或不存在 3:产品不可到达 4:MES系统异常 5:产品型号识别码未设置]";
|
|
|
+ Logger.Trace(outputMessage, loggerNameT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ PLCResult result = plc?.Write<int>(plc_s.Add_FlagCode, plc_s.Add_FlagCodeNum, errorcode);
|
|
|
+ outputMessage = $"[{e.Content}]END_F_CODE=[{result}]";
|
|
|
+ Logger.Trace(outputMessage, loggerNameT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-SendFlag", loggerNameT, logger_t);
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-SendFlag", loggerNameE, logger_e);
|
|
|
+ FormLogShow?.ShowLog($"[{e.Content}]ERROR-SendFlag={ex.Message}");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private DataRow GetGoodsCode(string barcode, ReceiveSession e, string loggerName, PLC_S_GC_DM1 plc_s)
|
|
|
+ {
|
|
|
+ IDataAccess dataAccess = null;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ dataAccess = PLC_S_DataAccess.GetDataAccess(e);
|
|
|
+
|
|
|
+ string sql = "select t.usercode,t.procedureid,t.workstationname from tp_mst_workstation t where t.workstationid=:ws_id";
|
|
|
+ DataTable dataTable = dataAccess.ExecuteDatatable(sql, new CDAParameter(":ws_id", plc_s.WS_ID));
|
|
|
+ if (dataTable.HasData() && dataTable.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ plc_s.WS_USER = dataTable.Rows[0]["usercode"] + "";
|
|
|
+ }
|
|
|
+
|
|
|
+ string sqlString = "select gdd.goodscode \n" +
|
|
|
+ ",(select t.PLC_CODE from T_PLC_SET_2201DM t where t.WS_ID = :WS_ID and t.LINE_NO = :LINE_NO and t.GOODSID=gdd.GOODSID) plc_code\n" +
|
|
|
+ ",(select p.flowprocedureid from tp_pm_inproduction p where p.barcode=:barcode) p_id\n" +
|
|
|
+ " from tp_pm_groutingdailydetail gdd\n" +
|
|
|
+ //" inner join tp_mst_goods g\n" +
|
|
|
+ //" on g.goodsid = gdd.goodsid\n" +
|
|
|
+ " where gdd.barcode = :barcode";
|
|
|
+ CDAParameter[] ps = new CDAParameter[]
|
|
|
+ {
|
|
|
+ new CDAParameter(":barcode", barcode),
|
|
|
+ new CDAParameter(":WS_ID", plc_s.WS_ID),
|
|
|
+ new CDAParameter(":LINE_NO", plc_s.LINE_NO),
|
|
|
+ };
|
|
|
+ dataTable = dataAccess.ExecuteDatatable(sqlString, ps);
|
|
|
+ if (dataTable.HasData() && dataTable.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ return dataTable.Rows[0];
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-GetGoodsCode", loggerName, logger_e);
|
|
|
+ FormLogShow?.ShowLog($"[{e.Content}]ERROR-GetGoodsCode={ex.Message}");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ dataAccess?.Close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private PLC_S_GC_DM1 GetPLC_S_DM(string flag, ReceiveSession e, string loggerName)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ flag = M_NAME + flag;
|
|
|
+ if (PLC_FLAGS.ContainsKey(flag))
|
|
|
+ {
|
|
|
+ return PLC_FLAGS[flag];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PLC_S_GC_DM1 plc_s = new PLC_S_GC_DM1();
|
|
|
+ INIHelper ini = INIHelper.Create($@"PLC_S_INI\PLC_S_{M_NAME}.ini");
|
|
|
+
|
|
|
+ plc_s.IP = ini.Read(flag, "IP");
|
|
|
+ plc_s.Port = ini.Read(flag, "Port").ToInt32();
|
|
|
+ plc_s.LINE_NO = ini.Read(flag, "LINE_NO").ToInt32();
|
|
|
+ plc_s.WS_ID = ini.Read(flag, "WS_ID").ToInt32();
|
|
|
+
|
|
|
+ plc_s.WS_NAME = ini.Read(flag, "WS_NAME");
|
|
|
+ plc_s.WS_USER = ini.Read(flag, "WS_USER");
|
|
|
+ plc_s.P_ID = ini.Read(flag, "P_ID").ToInt32();
|
|
|
+
|
|
|
+ plc_s.Add_GoodsCode = ini.Read(flag, "Add_GoodsCode")[0];
|
|
|
+ plc_s.Add_FlagCode = ini.Read(flag, "Add_FlagCode")[0];
|
|
|
+ plc_s.Add_GoodsCodeNum = ini.Read(flag, "Add_GoodsCodeNum").ToInt32();
|
|
|
+ plc_s.Add_FlagCodeNum = ini.Read(flag, "Add_FlagCodeNum").ToInt32();
|
|
|
+
|
|
|
+ PLC_FLAGS.Add(flag, plc_s);
|
|
|
+ return plc_s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-GetPLC_S_DM", loggerName, logger_e);
|
|
|
+ FormLogShow?.ShowLog($"[{e.Content}]ERROR-GetPLC_S_DM={ex.Message}");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|