Commit eddd82d2 LN

日志修改

1 个父辈 13d111d8
......@@ -26,7 +26,7 @@ namespace OnlineStore.ACPackingStore
private ConfigMoveAxis comp = null;
//private int compress_Slv = 0;
private AC_BOX_Bean boxBean = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(AC_BOX_Bean boxBean)
{
middle = boxBean.Config.Middle_Axis;
......@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
private void AxisMove(ConfigMoveAxis axis, int speed)
{
LogUtil.debug(LOGGER, "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
LogUtil.debug( "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
ACServerManager.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
}
......
......@@ -365,7 +365,7 @@
this.panel1.Controls.Add(this.btnSotreReset);
this.panel1.Location = new System.Drawing.Point(3, 2);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1308, 47);
this.panel1.Size = new System.Drawing.Size(1318, 47);
this.panel1.TabIndex = 273;
//
// btnUpdown
......@@ -488,7 +488,7 @@
this.tabControl1.Location = new System.Drawing.Point(6, 52);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1309, 521);
this.tabControl1.Size = new System.Drawing.Size(1319, 571);
this.tabControl1.TabIndex = 272;
//
// tabPage4
......@@ -497,7 +497,7 @@
this.tabPage4.Controls.Add(this.groupBox3);
this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1301, 488);
this.tabPage4.Size = new System.Drawing.Size(1311, 538);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = " 状态信息 ";
this.tabPage4.UseVisualStyleBackColor = true;
......@@ -552,9 +552,9 @@
this.groupInout.Controls.Add(this.btnUpDownP3);
this.groupInout.Controls.Add(this.btnUpDownP4);
this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(3, 127);
this.groupInout.Location = new System.Drawing.Point(3, 164);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(1291, 353);
this.groupInout.Size = new System.Drawing.Size(1304, 362);
this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
......@@ -1540,7 +1540,7 @@
this.groupBox3.Controls.Add(this.chbDebug);
this.groupBox3.Location = new System.Drawing.Point(3, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(1291, 121);
this.groupBox3.Size = new System.Drawing.Size(1304, 154);
this.groupBox3.TabIndex = 268;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "设备状态";
......@@ -1549,7 +1549,7 @@
//
this.lblMoveInfo.AutoSize = true;
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveInfo.Location = new System.Drawing.Point(965, 13);
this.lblMoveInfo.Location = new System.Drawing.Point(992, 60);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(56, 17);
this.lblMoveInfo.TabIndex = 269;
......@@ -1559,11 +1559,11 @@
//
this.lblTemp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblTemp.AutoSize = true;
this.lblTemp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTemp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTemp.ForeColor = System.Drawing.Color.Black;
this.lblTemp.Location = new System.Drawing.Point(639, 14);
this.lblTemp.Location = new System.Drawing.Point(375, 16);
this.lblTemp.Name = "lblTemp";
this.lblTemp.Size = new System.Drawing.Size(159, 20);
this.lblTemp.Size = new System.Drawing.Size(136, 17);
this.lblTemp.TabIndex = 270;
this.lblTemp.Text = "当前温度--,当前湿度--";
//
......@@ -1572,7 +1572,7 @@
this.lblMoveEquipInfo.AutoSize = true;
this.lblMoveEquipInfo.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveEquipInfo.ForeColor = System.Drawing.Color.Blue;
this.lblMoveEquipInfo.Location = new System.Drawing.Point(221, 14);
this.lblMoveEquipInfo.Location = new System.Drawing.Point(13, 39);
this.lblMoveEquipInfo.Name = "lblMoveEquipInfo";
this.lblMoveEquipInfo.Size = new System.Drawing.Size(65, 19);
this.lblMoveEquipInfo.TabIndex = 272;
......@@ -1584,9 +1584,9 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(5, 38);
this.lblWarnMsg.Location = new System.Drawing.Point(5, 75);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(939, 77);
this.lblWarnMsg.Size = new System.Drawing.Size(952, 74);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -1595,7 +1595,7 @@
this.lblThisSta.AutoSize = true;
this.lblThisSta.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblThisSta.ForeColor = System.Drawing.Color.Green;
this.lblThisSta.Location = new System.Drawing.Point(14, 14);
this.lblThisSta.Location = new System.Drawing.Point(13, 15);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(65, 19);
this.lblThisSta.TabIndex = 216;
......@@ -1606,7 +1606,7 @@
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(855, 12);
this.chbDebug.Location = new System.Drawing.Point(1168, 16);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(93, 25);
this.chbDebug.TabIndex = 271;
......@@ -1622,7 +1622,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1301, 488);
this.tabPage1.Size = new System.Drawing.Size(1311, 538);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服/温湿度 ";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -1844,7 +1844,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1314, 576);
this.ClientSize = new System.Drawing.Size(1324, 626);
this.Controls.Add(this.panel1);
this.Controls.Add(this.tabControl1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
{
public AC_BOX_Bean BoxBean = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmBox()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -49,7 +49,7 @@ namespace OnlineStore.ACPackingStore
{
if (BoxBean == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
LogUtil.error( "找不到对应的料仓");
this.Close();
return;
}
......@@ -611,7 +611,7 @@ namespace OnlineStore.ACPackingStore
string poText = cmbPosition.Text;
BoxBean.AutoInout.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
LogUtil.info( BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText, cmbShelfPosition.Text));
......@@ -658,7 +658,7 @@ namespace OnlineStore.ACPackingStore
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "出错:" + ex.StackTrace);
LogUtil.error( "出错:" + ex.StackTrace);
}
}
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
{
private int StoreId = 1;
private AC_BOX_Bean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmIOStatus()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -100,7 +100,7 @@ namespace OnlineStore.ACPackingStore
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
LogUtil.error( ex.StackTrace);
}
}
......
......@@ -32,6 +32,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.lblServerMsg = new System.Windows.Forms.Label();
this.chbAGV = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
......@@ -70,7 +72,6 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chbAGV = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox4.SuspendLayout();
......@@ -98,6 +99,7 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.lblServerMsg);
this.tabPage1.Controls.Add(this.chbAGV);
this.tabPage1.Controls.Add(this.groupBox4);
this.tabPage1.Controls.Add(this.groupBox3);
......@@ -116,6 +118,29 @@
this.tabPage1.Text = " 日志信息 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// lblServerMsg
//
this.lblServerMsg.AutoSize = true;
this.lblServerMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblServerMsg.Location = new System.Drawing.Point(261, 20);
this.lblServerMsg.Name = "lblServerMsg";
this.lblServerMsg.Size = new System.Drawing.Size(0, 17);
this.lblServerMsg.TabIndex = 201;
//
// chbAGV
//
this.chbAGV.AutoSize = true;
this.chbAGV.Checked = true;
this.chbAGV.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAGV.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAGV.Location = new System.Drawing.Point(36, 470);
this.chbAGV.Name = "chbAGV";
this.chbAGV.Size = new System.Drawing.Size(138, 24);
this.chbAGV.TabIndex = 200;
this.chbAGV.Text = "AGV cancelState";
this.chbAGV.UseVisualStyleBackColor = true;
this.chbAGV.CheckedChanged += new System.EventHandler(this.chbAGV_CheckedChanged);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
......@@ -258,9 +283,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(241, 3);
this.logBox.Location = new System.Drawing.Point(241, 88);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(1085, 633);
this.logBox.Size = new System.Drawing.Size(1085, 531);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
......@@ -462,20 +487,6 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// chbAGV
//
this.chbAGV.AutoSize = true;
this.chbAGV.Checked = true;
this.chbAGV.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAGV.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAGV.Location = new System.Drawing.Point(36, 470);
this.chbAGV.Name = "chbAGV";
this.chbAGV.Size = new System.Drawing.Size(138, 24);
this.chbAGV.TabIndex = 200;
this.chbAGV.Text = "AGV cancelState";
this.chbAGV.UseVisualStyleBackColor = true;
this.chbAGV.CheckedChanged += new System.EventHandler(this.chbAGV_CheckedChanged);
//
// FrmStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -551,6 +562,7 @@
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.CheckBox chbAGV;
private System.Windows.Forms.Label lblServerMsg;
}
}
......@@ -21,7 +21,7 @@ namespace OnlineStore.ACPackingStore
internal partial class FrmStore : Form
{
internal static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// internal static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static PackingStoreBean store = null;
private List<TabPage> tabPageList = new List<TabPage>();
private bool LoadOk = false;
......@@ -182,7 +182,7 @@ namespace OnlineStore.ACPackingStore
//如果料仓还在运行状态,先关闭料仓
if (!store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(LOGGER, "ExitApp 停止"+store.Name+"运行 ");
LogUtil.info( "ExitApp 停止"+store.Name+"运行 ");
store.StopRun();
}
else
......@@ -191,7 +191,7 @@ namespace OnlineStore.ACPackingStore
{
if (bean.storeRunStatus.Equals(StoreRunStatus.Wait).Equals(false))
{
LogUtil.info(LOGGER, "ExitApp 停止" + bean.Name + "运行 ");
LogUtil.info( "ExitApp 停止" + bean.Name + "运行 ");
bean.StopRun();
}
}
......@@ -240,7 +240,7 @@ namespace OnlineStore.ACPackingStore
MessageBox.Show(store.Name + "当前状态:" + store.storeRunStatus + ",不能启动!");
return;
}
LogUtil.info(LOGGER, "开始启动");
LogUtil.info( "开始启动");
startTimer.Interval = 300;
startTimer.Elapsed += timer_Elapsed;
startTimer.AutoReset = false;
......@@ -388,6 +388,7 @@ namespace OnlineStore.ACPackingStore
{
return;
}
lblServerMsg.Text = HttpHelper.LastServerMsg;
ReadIOList();
string msg = "";
foreach(AC_BOX_Bean box in StoreManager.Store.BoxMap.Values)
......
......@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
public const int SW_RESTORE = 9;
public static IntPtr formhwnd;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
......@@ -112,7 +112,7 @@ namespace OnlineStore.ACPackingStore
static void LogUnhandledException(object exceptionobj)
{
//这里可以进一步地写日志
LOGGER.Error("LogUnhandledException:"+exceptionobj.ToString());
LogUtil.error("LogUnhandledException:"+exceptionobj.ToString());
}
}
}
......@@ -65,9 +65,6 @@
<Compile Include="util\MyWebClient.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="util\NetTCPServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="util\ScanCodeManager.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
public class AcSerialBean
{
#region 全部变量
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private SerialPort _serialPort = null;
private object lockObj = new object();
......@@ -149,7 +149,7 @@ namespace OnlineStore.Common
}
catch (Exception Ex)
{
LogUtil.error(LOGGER, Ex.ToString());
LogUtil.error( Ex.ToString());
//throw Ex;
}
return ok;
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
public class ConfigAppSettings
{
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static int seq = 1;
......@@ -20,7 +20,7 @@ namespace OnlineStore.Common
{
if (seq.Equals(Int32.MaxValue))
{
LOGGER.Info("seq当前值:" + seq + ",重置seq=0");
LogUtil.info("seq当前值:" + seq + ",重置seq=0");
seq = 0;
}
Interlocked.Increment(ref seq);
......@@ -31,7 +31,7 @@ namespace OnlineStore.Common
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LOGGER.Error("未找到配置:" + key + ",请检查配置是否完整!");
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return "";
}
else
......@@ -46,7 +46,7 @@ namespace OnlineStore.Common
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LOGGER.Error("未找到配置:" + key + ",请检查配置是否完整!");
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
......@@ -63,7 +63,7 @@ namespace OnlineStore.Common
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LOGGER.Error("未找到配置:" + key + ",请检查配置是否完整!");
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
......@@ -98,7 +98,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace);
LogUtil.error( "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace);
}
}
......@@ -120,7 +120,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace);
LogUtil.error( "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace);
}
}
///<summary>
......@@ -152,7 +152,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
LogUtil.error( "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
}
}
}
......
......@@ -18,7 +18,7 @@ namespace OnlineStore.Common
{
public class HttpHelper
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static string Post(string url, string paramData)
{
return Post(url, paramData, Encoding.UTF8);
......@@ -76,7 +76,7 @@ namespace OnlineStore.Common
{//入库或出库
string json = JsonHelper.SerializeObject(operation);
LogUtil.error(LOGGER, "模拟HTTP服务器返回出库入库信息:" + json);
LogUtil.error( "模拟HTTP服务器返回出库入库信息:" + json);
return operation;
}
}
......@@ -89,7 +89,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Error("JsonHelper.SerializeObject(operation) 出错【operation.op=" + operation.op + "】" + ex);
LogUtil.error("JsonHelper.SerializeObject(operation) 出错【operation.op=" + operation.op + "】" + ex);
}
string result = Post(url, json);
if (!string.IsNullOrEmpty(result))
......@@ -100,18 +100,19 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Error("JsonHelper.DeserializeJsonToObject 出错【result=" + result + "】" + ex);
LogUtil.error("JsonHelper.DeserializeJsonToObject 出错【result=" + result + "】" + ex);
}
}
}
}
catch (Exception ex)
{
LOGGER.Error("Post 出错【operation.op=" + operation.op + "】:" + ex);
LogUtil.error("Post 出错【operation.op=" + operation.op + "】:" + ex);
}
return null;
}
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string LastServerMsg = "";
public static string Post(string url, string paramData, Encoding encoding)
{
if (PingURLIP(url, 100).Equals(false))
......@@ -121,7 +122,7 @@ namespace OnlineStore.Common
if (isLog == 1)
{
LOGGER.Info("给服务器发送数据【" + paramData + "】 ");
LogUtil.info("给服务器发送数据【" + paramData + "】 ");
}
if (paramData != "null" && paramData != null)
{
......@@ -155,8 +156,13 @@ namespace OnlineStore.Common
}
if (isLog == 1)
{
LOGGER.Info("收到服务器数据【" + result + "】");
LogUtil.info("收到服务器数据【" + result + "】");
}
LastServerMsg =DateTime.Now.ToLongTimeString()+ " URL:"+url+"\r\n"
+ "发送:" + paramData + "\r\n"
+"接收:" + result + "\r\n"
;
return result;
}
......@@ -169,13 +175,13 @@ namespace OnlineStore.Common
{
try
{
LogUtil.info(LOGGER, "HTTP GET FROM: " + url);
LogUtil.info( "HTTP GET FROM: " + url);
var wc = new WebClient { Encoding = encoding };
var readStream = wc.OpenRead(url);
using (var sr = new StreamReader(readStream, encoding))
{
var result = sr.ReadToEnd();
LogUtil.info(LOGGER, "receive << " + result);
LogUtil.info( "receive << " + result);
return result;
}
}
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.Common
/// </summary>
public class HumitureController
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static int bautRate = 4800;//波特率
......@@ -48,7 +48,7 @@ namespace OnlineStore.Common
}
else
{
LogUtil.error(LOGGER, LogName + "串口" + port + "打开失败!");
LogUtil.error( LogName + "串口" + port + "打开失败!");
return false;
}
}
......@@ -257,7 +257,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Info(LogName + "转换出错:" + ex.ToString());
LogUtil.info(LogName + "转换出错:" + ex.ToString());
}
return list;
}
......@@ -301,7 +301,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Info(LogName + "转换出错:" + ex.ToString());
LogUtil.info(LogName + "转换出错:" + ex.ToString());
}
return -1;
}
......@@ -328,7 +328,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Info(LogName + "转换出错:" + ex.ToString());
LogUtil.info(LogName + "转换出错:" + ex.ToString());
}
return list;
}
......
......@@ -15,7 +15,7 @@ namespace OnlineStore.Common
/// </summary>
public class HumitureServer
{
private static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
......@@ -92,7 +92,7 @@ namespace OnlineStore.Common
}
TemperateIsStart = true;
temperateTcpServer.Start(port);
LogUtil.info(LOGGER, "温湿度已开始在端口[" + port + "]监听!");
LogUtil.info( "温湿度已开始在端口[" + port + "]监听!");
temperateTcpServer.ReviceMsgEvent += tcp_ReviceMsgEvent;
}
}
......@@ -111,7 +111,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "关闭温湿度监听出错:" + ex.ToString());
LogUtil.error( "关闭温湿度监听出错:" + ex.ToString());
}
}
......@@ -132,11 +132,11 @@ namespace OnlineStore.Common
string deviceId = strList[10];
string pwd = strList[11];
LogUtil.debug(LOGGER, "address=" + add + ",收到:温度=" + wendu + ",湿度=" + shidu + ",设备ID=" + deviceId + ",密码:" + pwd);
LogUtil.debug( "address=" + add + ",收到:温度=" + wendu + ",湿度=" + shidu + ",设备ID=" + deviceId + ",密码:" + pwd);
if (shidu <= 0)
{
//湿度小于0不处理
LogUtil.info(LOGGER, "address=" + add + ",收到:温度=" + wendu + ",湿度=" + shidu + ",设备ID=" + deviceId + ",密码:" + pwd + ",湿度小于0不处理");
LogUtil.info( "address=" + add + ",收到:温度=" + wendu + ",湿度=" + shidu + ",设备ID=" + deviceId + ",密码:" + pwd + ",湿度小于0不处理");
}
else
{
......@@ -152,7 +152,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER, ex.ToString());
LogUtil.error( ex.ToString());
}
}
private static double PreShiDu = 7;
......@@ -171,7 +171,7 @@ namespace OnlineStore.Common
TemperateParamMap.Remove(IP);
}
TemperateParamMap.Add(IP, ast);
//LogUtil.info(LOGGER, "address=" + IP + ",收到:温度=" + newWenDu + ",湿度=" + newShiDu + " ");
//LogUtil.info( "address=" + IP + ",收到:温度=" + newWenDu + ",湿度=" + newShiDu + " ");
}
}catch(Exception ex)
{
......
......@@ -18,16 +18,16 @@ namespace OnlineStore.Common
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null;
public static System.Windows.Forms.RichTextBox logBox = null;
public static int showCount = 20;
public static bool debug_opened = false;
public static void info(ILog log, string msg)
{
{
log.Info(" - " + msg);
AddToBox(msg, Color.Black);
AddToBox(msg, Color.Black);
}
public static void info(ILog log, string msg, Color color)
{
......@@ -38,7 +38,7 @@ namespace OnlineStore.Common
{
log.Debug(" - " + msg);
if (debug_opened)
{
{
AddToBox(msg, color);
}
}
......@@ -181,10 +181,17 @@ namespace OnlineStore.Common
{
debug(LOGGER, msg);
}
public static void error(string errorMsg)
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg);
}
if (ex == null)
{
error(LOGGER, errorMsg);
}
else
{
error(LOGGER, errorMsg + ex.ToString());
}
}
public static void info(string msg)
{
info(LOGGER, msg);
......
......@@ -6,12 +6,13 @@ using System.Net;
using System.IO;
using log4net;
using System.Text;
using OnlineStore.Common;
namespace OnlineStore
{
public class NetTCPServer
{
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// TCP服务端监听
......@@ -118,13 +119,13 @@ namespace OnlineStore
NetworkStream ns = client.tcpClient.GetStream();
StreamReader sr = new StreamReader(ns);
string str = sr.ReadLine();
LOGGER.Info("读取到数据:"+str);
LogUtil.info("读取到数据:"+str);
byte[] recdata = new byte[ns.EndRead(ar)];
if (recdata.Length > 0)
{
//Array.Copy(client.Buffer, recdata, recdata.Length);
LOGGER.Info("读取到数据1111:" + Encoding.ASCII.GetString(recdata));
LogUtil.info("读取到数据1111:" + Encoding.ASCII.GetString(recdata));
//ns.BeginRead(client.Buffer, 0, client.Buffer.Length, new AsyncCallback(TCPCallBack), client);
}
else
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.Common
/// </summary>
public class ScanCodeManager
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// 处理接收后的二维码
/// </summary>
......
......@@ -16,7 +16,7 @@ namespace OnlineStore.Common
private static int ServerPort = 0;
private System.Timers.Timer ReConnectTimer = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public delegate void HandleMessage(string message);
private Socket m_clientSocket;
......@@ -154,7 +154,7 @@ namespace OnlineStore.Common
if (m_clientSocket != null)
{
m_clientSocket.Close();
LogUtil.debug(LOGGER, "Socket closed!");
LogUtil.debug( "Socket closed!");
}
}catch(Exception ex)
{
......@@ -168,7 +168,7 @@ namespace OnlineStore.Common
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
LogUtil.info(LOGGER, "Connect to " + ServerIp + ":" + ServerPort + " success!");
LogUtil.info( "Connect to " + ServerIp + ":" + ServerPort + " success!");
}
isInProcess = false;
......@@ -189,11 +189,11 @@ namespace OnlineStore.Common
if (m_clientSocket != null)
{
m_clientSocket.Close();
LogUtil.info(LOGGER,"Socket closed!");
LogUtil.info("Socket closed!");
}
else
{
LogUtil.error(LOGGER,"No socket is running!");
LogUtil.error("No socket is running!");
}
}
......@@ -209,7 +209,7 @@ namespace OnlineStore.Common
{
m_clientSocket.Send(sendBuffer);
LogUtil.debug(LOGGER,"Send >> " + strSendData);
LogUtil.debug("Send >> " + strSendData);
}
}
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
public class TcpServer
{
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Thread m_serverThread;
private Socket m_serverSocket;
......@@ -39,7 +39,7 @@ namespace OnlineStore.Common
}
}
}
LogUtil.info(LOGGER, iplist + "]");
LogUtil.info( iplist + "]");
}
/// <summary>
......@@ -59,7 +59,7 @@ namespace OnlineStore.Common
m_serverThread = new Thread(new ThreadStart(ReceiveAccept));
m_serverThread.Start();
LogUtil.info(LOGGER, " Server start listen : " + m_serverPort);
LogUtil.info( " Server start listen : " + m_serverPort);
logLocalIp();
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
......@@ -101,14 +101,14 @@ namespace OnlineStore.Common
client.ClientSocket = m_serverSocket.Accept();
IPEndPoint clientipe = (IPEndPoint)client.ClientSocket.RemoteEndPoint;
client.ipAdd = clientipe.Address;
LogUtil.info(LOGGER, "有新的客户端链接上:" + client.ipAdd.ToString());
LogUtil.info( "有新的客户端链接上:" + client.ipAdd.ToString());
receiveMessageDelegate = new ReceiveMessageDelegate(ReceiveMessages);
receiveMessageDelegate.BeginInvoke(client, ReceiveMessagesCallback, "");
}
catch (Exception ex)
{
LogUtil.error(LOGGER, ex.Message);
LogUtil.error( ex.Message);
//throw new Exception(ex.Message);
}
}
......@@ -198,7 +198,7 @@ namespace OnlineStore.Common
// }
// catch (Exception ex)
// {
// LOGGER.Error(ex.ToString());
// LogUtil.error(ex.ToString());
// }
//}
......@@ -210,7 +210,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LOGGER.Error(ex.ToString());
LogUtil.error(ex.ToString());
}
}
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
public class UdpServer
{
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Thread m_serverThread;
private Socket udpServer;
......@@ -37,7 +37,7 @@ namespace OnlineStore.Common
}
}
}
LogUtil.info(LOGGER, iplist + "]");
LogUtil.info( iplist + "]");
}
......
......@@ -849,9 +849,9 @@ namespace OnlineStore.DeviceLibrary
//重新记录
LogInfo(" 执行出库【" + MoveInfo.MoveParam.ToStr() + "】失败,料架号不一致,加入等待队列");
waitOutStoreList.Enqueue(MoveInfo.MoveParam);
LogUtil.error(Name+ "出库 【" + LastRfidID + "】 【" + MoveInfo.MoveParam.rfid + "," + MoveInfo.MoveParam.realRfid + "】不同料架,送出当前料架,稍后重新出库");
LogUtil.error(Name + "出库 【" + LastRfidID + "】 【" + MoveInfo.MoveParam.rfid + "," + MoveInfo.MoveParam.realRfid + "】不同料架,送出当前料架,稍后重新出库");
// MoveInfo.MoveParam.rfid = LastRfidID;
// MoveInfo.MoveParam.rfid = LastRfidID;
MoveInfo.NewMove(StoreMoveType.OutStore, LastOutParam);
//送出料架,并且记录出库信息,等会重新出库
StartShelfOut();
......@@ -1068,36 +1068,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private bool IsRightShelfId(string currShelfID, string realRfid)
{
if (String.IsNullOrEmpty(currShelfID) )
{
return false ;
}
if ( String.IsNullOrEmpty(realRfid))
{
return true ;
}
if (currShelfID.Equals(realRfid))
{
return true;
}
//string theTarget = realRfid.Trim().PadLeft(3, '0');
//string num = theTarget.Substring(0, 2);
//string type = theTarget.Substring(2, 1);
//if (currShelfID.Equals(type + num))
//{
// return true;
//}
//else if (num.Equals("00"))
//{
// return true;
//}
return false;
}
#endregion
......
......@@ -608,34 +608,6 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(Name + "验证出库【" + inoutParam.ToStr() + "】是否重复出错:" + ex.ToString());
}
//判断出库指定的料架是否是当前料架,如果不是当前料架,需要将当前料架送出,然后进入新料架
//TODO
// string shelfPosID = "";
//if (inoutParam.rfidLoc > 0 && ShelfPosList.Count >= inoutParam.rfidLoc)
//{
// shelfPosID = ShelfPosList[inoutParam.rfidLoc - 1];
//inoutParam.NeedEnterShelf = false;
//inoutParam.NeedOutShelf = false;
//}
//else
//{
// bool hasShelf = EmprtShelfList.TryDequeue(out shelfPosID);
// if (hasShelf)
// {
// inoutParam.NeedEnterShelf = false;
// inoutParam.NeedOutShelf = false;
// inoutParam.ShelfPosID = shelfPosID;
// }
// else
// {
// inoutParam.NeedEnterShelf = true;
// inoutParam.NeedOutShelf = false;
// LogInfo(Name + "执行出库【" + inoutParam.ToStr() + "】,没有空料架,需要使用新料架");
// }
//}
StartExecuctOut(inoutParam);
}
......
......@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static int CurrInOutType = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static PackingStoreBean Store = null;
public static Store_Config Config = null;
public static Dictionary<int, BaseConfig> AllConfigMap = null;
......@@ -71,7 +71,7 @@ namespace OnlineStore.DeviceLibrary
isInit = true;
string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type);
int count = ConfigAppSettings.GetIntValue(Setting_Init.store_count);
LogUtil.info(LOGGER, "配置的料仓 类型=" + storeType + ",开始加载料仓配置");
LogUtil.info( "配置的料仓 类型=" + storeType + ",开始加载料仓配置");
string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
Dictionary<int, AC_BOX_Config> storeConfig = new Dictionary<int, AC_BOX_Config>();
......@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
{
CSVPositionReader<ACBoxPosition>.AddCSVFile(positionConfigFile);
}
LogUtil.info(LOGGER, "加载料仓完成!");
LogUtil.info( "加载料仓完成!");
}
......@@ -134,7 +134,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
LogUtil.error("出错:"+ ex.ToString());
MessageBox.Show(ex.ToString(), "加载配置错误(请检查配置)");
Application.Exit();
}
......@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
if (!result)
{
LOGGER.Error("保存配置文件失败:" + configFile);
LogUtil.error("保存配置文件失败:" + configFile);
}
AllConfigMap[storeConfig.DeviceID] = storeConfig;
Store.BoxConfigMap[storeConfig.DeviceID] = storeConfig;
......@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
LogUtil.error("出错:"+ ex.ToString());
}
return false;
}
......@@ -430,23 +430,7 @@ namespace OnlineStore.DeviceLibrary
}
internal static string GetShelfIDByLoc(int rfidLoc, List<string> shelfPosList)
{
string shelfId = "";
//try
//{
// foreach (string id in shelfPosList)
// {
// if (id.Length == 3 && id.Substring(2, 1).Equals(rfidLoc.ToString()))
// {
// shelfId = id;
// break;
// }
// }
//}
//catch (Exception ex)
//{
//}
string shelfId = "";
if (rfidLoc.Equals(-1))
{
shelfId = shelfPosList[0];
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
public class AgvClient
{
public static bool CurrCancelState = true;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp);
private static Asa.AgvClient agvClient;
private static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>();
......@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
bool isLog = ConfigAppSettings.GetIntValue(Setting_Init.Agv_Log_Open).Equals(1);
if (isLog)
{
LOGGER.Info(" AGV " + ServerIp + " Log : " + s);
LogUtil. debug(" AGV " + ServerIp + " Log : " + s);
}
}
catch (Exception ex)
......
......@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
//public static uint DefaultDICount = 16;
//public static uint DefaultDOCount = 16;
public readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public Dictionary<string, AIOBOX> AIOMap = new Dictionary<string, AIOBOX>();
public Dictionary<string, List<Box_Sta>> DIValueMap = new Dictionary<string, List<Box_Sta>>();
......@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception error)
{
LogUtil.error(LOGGER, "连接IO模块 " + logName + " 出错:" + error.ToString());
LogUtil.error( "连接IO模块 " + logName + " 出错:" + error.ToString());
}
}
......@@ -398,12 +398,12 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(LOGGER, "WriteSingleDO出错 没有连接IO模块:" + ioIp);
LogUtil.error( "WriteSingleDO出错 没有连接IO模块:" + ioIp);
}
}
catch (Exception ex)
{
LOGGER.Error("AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错啦:" + ex.ToString());
LogUtil.error("AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错啦:" + ex.ToString());
}
}
public override void WriteSingleDO(string ioIp, byte slaveId, ushort StartAddress, IO_VALUE onOff, int mSeconds)
......@@ -423,11 +423,11 @@ namespace OnlineStore.DeviceLibrary
try
{
aioBox.WriteDO(StartAddress, aioBox.ReverseStatus(currBox_Sta));
LogUtil.debug(LOGGER, "**********定时回写入 IO [" + ioIp + "] [" + StartAddress + "]值" + aioBox.ReverseStatus(currBox_Sta) + "】:");
LogUtil.debug( "**********定时回写入 IO [" + ioIp + "] [" + StartAddress + "]值" + aioBox.ReverseStatus(currBox_Sta) + "】:");
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "**********定时回写入 出错:" + ex.StackTrace);
LogUtil.error( "**********定时回写入 出错:" + ex.StackTrace);
}
};
mytimer.AutoReset = false;//设置是否自动重启,即自动执行多次;
......@@ -436,7 +436,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(LOGGER, "AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错 没有连接IO模块:" + ioIp);
LogUtil.error( "AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错 没有连接IO模块:" + ioIp);
}
}
catch (Exception ex)
......@@ -552,7 +552,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(LOGGER, " GetIOValue [" + configIO.IO_IP + "] [" + configIO.GetIOAddr() + "] 获取数据出错:" + ex.ToString());
LogUtil.error( " GetIOValue [" + configIO.IO_IP + "] [" + configIO.GetIOAddr() + "] 获取数据出错:" + ex.ToString());
}
return value;
}
......
......@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public class InOutParam
{
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public InOutParam()
//{
// this.WareCode = "";
......@@ -161,7 +161,7 @@ namespace OnlineStore.DeviceLibrary
}
public string ToShortStr()
{
return " [" + PosID + "] [" + ShelfPosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "]";
return " [" + PosID + "][" + ShelfPosID + "][" + PlateW + "x" + PlateH + "][" + WareCode + "]";
}
internal void UpdateShelfPosId(string pId)
......
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.IO;
......@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
public class CSVReaderBase
{
public static char Spilt_Char = ',';
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// 获取一个类所有的《字段,AttributeName列名》集合
/// </summary>
......@@ -104,7 +105,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception e)
{
LOGGER.Error("出错:", e);
LogUtil.error ("出错:", e);
}
if (File.Exists(filePath))
{
......@@ -114,7 +115,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error(ex.ToString());
LogUtil.error(ex.ToString());
return false;
}
return true;
......@@ -151,7 +152,7 @@ namespace OnlineStore.LoadCSVLibrary
{
if (!titleIndex.ContainsKey(str))
{
LOGGER.Error(filename+":未找到必须列:" + str + ",加载数据失败!");
LogUtil.error(filename+":未找到必须列:" + str + ",加载数据失败!");
throw new CVSFieldNotMatchingExection(filename + ":未找到必须列:" + str + ",加载数据失败!");
}
}
......
......@@ -59,7 +59,7 @@ namespace OnlineStore.LoadCSVLibrary
{
if (hasReadFileList.Contains(filePath))
{
LOGGER.Error("文件" + filePath + "已经加载过,直接返回null");
LogUtil.error("文件" + filePath + "已经加载过,直接返回null");
return null;
}
Type type = typeof(T);
......@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary<string, string> proTitleMap = getProAttributeMap(typeof(T));
if (proTitleMap.Count <= 4)
{
LOGGER.Error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
LogUtil.error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
}
List<string> cvsTitleList = new List<string>(proTitleMap.Values);
List<string> propertyList = new List<string>(proTitleMap.Keys);
......@@ -134,12 +134,12 @@ namespace OnlineStore.LoadCSVLibrary
}
else
{
LOGGER.Error("读取csv,index=" + index + ",数据格式不匹配!,line=" + line);
LogUtil.error("读取csv,index=" + index + ",数据格式不匹配!,line=" + line);
}
}
catch (Exception ex)
{
LOGGER.Debug( "CSV 读取行【" + line + "】行转换失败");
LogUtil.debug ( "CSV 读取行【" + line + "】行转换失败");
}
}
index++;
......@@ -177,7 +177,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary<string, string> proTitleMap = getProAttributeMap(typeof(T));
if (proTitleMap.Count <= 4)
{
LOGGER.Error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
LogUtil.error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
}
List<string> cvsTitleList = new List<string>(proTitleMap.Values);
List<string> propertyList = new List<string>(proTitleMap.Keys);
......@@ -262,7 +262,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary<string, string> proTitleMap = getProAttributeMap(typeof(T));
if (proTitleMap.Count <= 4)
{
LOGGER.Error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
LogUtil.error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
}
List<string> cvsTitleList = new List<string>(proTitleMap.Values);
List<string> propertyList = new List<string>(proTitleMap.Keys);
......
using System;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
......@@ -45,7 +46,7 @@ namespace OnlineStore.LoadCSVLibrary
//必须有列【类型】
if (allTitleIndex.Count < 0 || !allTitleIndex.ContainsKey("类型"))
{
LOGGER.Error("未找到必须列:类型,加载数据失败!");
LogUtil.error("未找到必须列:类型,加载数据失败!");
throw new CVSFieldNotMatchingExection("未找到必须列:类型,加载数据失败!");
}
typeIndex = allTitleIndex["类型"];
......@@ -116,14 +117,14 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error("filepath=" + filePath + ",index=" + index + ",key=" + key + "出错:" + ex.ToString());
LogUtil.error("filepath=" + filePath + ",index=" + index + ",key=" + key + "出错:" + ex.ToString());
}
listIndex++;
}
}
catch (Exception ex)
{
LOGGER.Error("filepath=" + filePath + ",index=" + index + ",key=" + key + "出错:" + ex.ToString());
LogUtil.error("filepath=" + filePath + ",index=" + index + ",key=" + key + "出错:" + ex.ToString());
}
}
bllIns.CheckField();
......@@ -157,14 +158,14 @@ namespace OnlineStore.LoadCSVLibrary
}
else
{
LOGGER.Error("配置的料仓类型=" + storeType + "未找到处理方法!");
LogUtil.error("配置的料仓类型=" + storeType + "未找到处理方法!");
}
return LoadConfig(config);
}
public static BaseConfig LoadConfig(BaseConfig config)
{
LOGGER.Info("开始读取文件:" + config.ConfigFilePath);
LogUtil.info("开始读取文件:" + config.ConfigFilePath);
if (config == null || config.ConfigFilePath.Equals(""))
{
return null;
......@@ -219,7 +220,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch (Exception e) {
LOGGER.Error("出错:" + e.ToString());
LogUtil.error("出错:" + e.ToString());
}
string newLine = "";
foreach (string s in newArray)
......
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public class ConfigBase
{
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// DI=输入IO,DO=输出IO,PRO=属性,AXIS=轴
/// </summary>
......@@ -43,7 +44,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
LogUtil.error ("出错:", ex);
}
return value;
}
......@@ -295,7 +296,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error(ToString()+"出错了:", ex);
LogUtil.error(ToString()+"出错了:", ex);
return -1;
}
return IoValue;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!