Commit ad54abf3 LN

出入库逻辑

1 个父辈 59dbda57
......@@ -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();
......@@ -177,7 +177,7 @@ namespace OnlineStore.Common
}
catch (Exception Ex)
{
LogUtil.error(LOGGER, Ex.ToString());
LogUtil.error( Ex.ToString());
//throw Ex;
}
return ok;
......@@ -268,7 +268,7 @@ namespace OnlineStore.Common
// catch (Exception ex)
// {
// _serialPort.DiscardOutBuffer();
// LogUtil.error(LOGGER, "SendData ERROR:" + ex.ToString(), 21);
// LogUtil.error( "SendData ERROR:" + ex.ToString(), 21);
// }
// }
......@@ -323,7 +323,7 @@ namespace OnlineStore.Common
catch (Exception ex)
{
isOk = false;
LogUtil.error(LOGGER, "SendCommand ERROR:" + ex.ToString(), 20);
LogUtil.error( "SendCommand ERROR:" + ex.ToString(), 20);
}
finally
{
......
......@@ -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);
......@@ -78,7 +78,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
......@@ -93,7 +93,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
......@@ -110,7 +110,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
......@@ -145,7 +145,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);
}
}
......@@ -167,7 +167,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>
......@@ -199,7 +199,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);
}
}
}
......
......@@ -17,7 +17,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);
......@@ -45,7 +45,7 @@ namespace OnlineStore.Common
{//入库或出库
string json = JsonHelper.SerializeObject(operation);
LogUtil.error(LOGGER, "模拟HTTP服务器返回出库入库信息:" + json);
LogUtil.error( "模拟HTTP服务器返回出库入库信息:" + json);
return operation;
}
}
......@@ -58,7 +58,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))
......@@ -69,14 +69,14 @@ 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;
}
......@@ -85,7 +85,7 @@ namespace OnlineStore.Common
{
if (isLog == 1)
{
LOGGER.Info("给服务器发送数据【" + paramData + "】 ");
LogUtil.info("给服务器发送数据【" + paramData + "】 ");
}
if (paramData != "null" && paramData != null)
{
......@@ -111,7 +111,7 @@ namespace OnlineStore.Common
}
catch (Exception e)
{
LogUtil.error(LOGGER, "POST ERROR:" + e.StackTrace, 1);
LogUtil.error( "POST ERROR:" + e.StackTrace, 1);
}
if (!result.Contains("null") && result.Length != 0)
{
......@@ -119,7 +119,7 @@ namespace OnlineStore.Common
}
if (isLog == 1)
{
LOGGER.Info("收到服务器数据【" + result + "】");
LogUtil.info("收到服务器数据【" + result + "】");
}
return result;
}
......@@ -133,19 +133,19 @@ 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;
}
}
catch (Exception e)
{
LogUtil.error(LOGGER, "HTTP GET ERROR:" + e.Message, 2);
LogUtil.error( "HTTP GET ERROR:" + e.Message, 2);
}
return "";
}
......
......@@ -5,174 +5,199 @@ using System.Text;
using log4net;
using System.Reflection;
using System.Drawing;
using System.Runtime.ExceptionServices;
using System.Collections.Concurrent;
namespace OnlineStore.Common
{
public class LogUtil
{
public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOX");
private static LogUtil instance = new LogUtil();
public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
public static ConcurrentDictionary<int, DateTime> lastErrorLogTime = new ConcurrentDictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null;
public static int showCount = 20;
public static int showCount = 15;
public static bool debug_opened = false;
public static void info(ILog log,string msg )
public static void info(ILog log, string msg)
{
if (log == null)
{
return;
}
log.Info(log.Logger.Name + " - " + msg);
if (logBox == null)
{
return;
}
AddToBox(msg, Color.Black);
log.Info(msg);
AddToBox(msg, Color.Black);
//clear();
}
public static void info(ILog log,string msg, Color color)
public static void info(ILog log, string msg, Color color)
{
log.Info(log.Logger.Name + " - " + msg);
if (logBox == null)
{
return;
}
AddToBox(msg, color);
log.Info(msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(log.Logger.Name + " - " + msg);
log.Debug(msg);
if (debug_opened)
{
if (logBox == null)
{
return;
}
AddToBox(msg, color);
}
}
public static void debug(ILog log, string msg)
{
log.Debug(log.Logger.Name + " - " + msg);
log.Debug(msg);
if (debug_opened)
{
if (logBox == null)
{
return;
}
AddToBox(msg, Color.Gray);
AddToBox(msg, Color.Gray);
}
}
private static List<string> lasErrorLogList = new List<string>();
private static int errCount = 5;
public static void error(string errorMsg, int type)
{
error(LOGGER, errorMsg, type);
}
public static void error(ILog log, string errorMsg,int type)
public static void error(string errorMsg, int type, int seconds = 10)
{
if (lastErrorLogTime.ContainsKey(type))
try
{
TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds < 10)
if (lastErrorLogTime.ContainsKey(type))
{
return;
TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds > seconds)
{
lastErrorLogTime[type] = DateTime.Now;
error(LOGGER, errorMsg);
}
}
else
{
lastErrorLogTime.Remove(type);
lastErrorLogTime.Add(type, DateTime.Now);
error(log, errorMsg);
lastErrorLogTime.TryAdd(type, DateTime.Now);
error(LOGGER, errorMsg);
}
}
else
catch (Exception ex)
{
lastErrorLogTime.Add(type, DateTime.Now);
error(log, errorMsg);
LogUtil.error(" 打印日志【" + type + "-" + errorMsg + "】出错:" + ex.ToString());
}
}
public static void error(ILog log, string errorMsg)
public static void error(ILog log, string errorMsg, Exception ex = null)
{
//if (!lasErrorLogList.Contains(errorMsg))
if (errorMsg.Trim().Equals("") && (ex == null))
{
log.Error(log.Logger.Name + " - " + errorMsg);
if (logBox == null)
{
return;
}
AddToBox(errorMsg, Color.Red);
}
//lasErrorLogList.Add(errorMsg);
//if (lasErrorLogList.Count > errCount)
//{
// lasErrorLogList.RemoveAt(0);
//}
return;
}
if (ex == null)
{
log.Error(errorMsg);
}
else
{
log.Error(errorMsg, ex);
}
AddToBox(errorMsg, Color.Red);
}
private static void AddToBox(string msg, Color color)
{
try
{
ShowLogPro(msg, color);
{
ShowLogPro(msg, color);
}
catch (Exception ex)
{
LOGGER.Error("出错:" + ex.StackTrace);
}
LogUtil.error("出错:", ex);
}
}
private static int count = 0;
private static List<string> logList = new List<string>();
public static string LastText = "";
[HandleProcessCorruptedStateExceptions]
private static void ShowLogPro(string msg, Color color)
{
try
{
//clear();
if (count > showCount)
if (logList.Count > 0)
{
// logList.RemoveAt(0);
}
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
}
string text = "";
foreach (string str in logList)
{
count = 0;
logBox.Clear();
text += str;
}
//logBox.SelectionColor = color;
System.DateTime now = System.DateTime.Now;
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine);
count++;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
if (logBox == null)
{
return;
}
LastText = text;
if (logBox.Visible)
{
logBox.Text = text;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
catch (AccessViolationException e)
{
LogUtil.error(" ShowLogPro 出错:" + e.ToString());
}
catch (Exception ex)
{
LOGGER.Error("出错:" + ex.ToString());
LogUtil.error("出错:" + ex.ToString());
}
}
public static void debug(string msg)
{
debug(LOGGER, msg);
}
public static void error(string errorMsg)
private static DateTime lastTime = DateTime.Now;
public static void UpdateLogbox()
{
error( LOGGER,errorMsg);
}
if (logBox != null && logBox.Visible)
{
logBox.Text = LastText;
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
public static void ClearLog()
{
if (logBox != null)
{
LastText = "";
logList.Clear();
logBox.Text = "";
count = 0;
}
}
public static void debug(string msg)
{
debug(LOGGER, msg);
}
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg, ex);
}
public static void info(string msg)
{
info(LOGGER,msg );
}
info(LOGGER, msg);
}
}
}
......@@ -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>
......@@ -50,7 +50,7 @@ namespace OnlineStore.Common
// }
// catch (Exception ex)
// {
// LOGGER.Error(ex);
// LogUtil.error(ex);
// }
//}
return message;
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
public class TcpClient
{
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;
......@@ -91,17 +91,17 @@ namespace OnlineStore.Common
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
onReceived = HandleMessage;
LogUtil.info(LOGGER, "Connect to " + serverIP + ":" + serverPort + " success!");
LogUtil.info( "Connect to " + serverIP + ":" + serverPort + " success!");
return true;
}
else
{
LogUtil.info(LOGGER, "Connect to " + serverIP + ":" + serverPort + " fail!");
LogUtil.info( "Connect to " + serverIP + ":" + serverPort + " fail!");
}
}
catch (Exception ex)
{
LogUtil.error(LOGGER,"Connect to " + serverIP + ":" + serverPort + " fail!" + ex.ToString(),3);
LogUtil.error("Connect to " + serverIP + ":" + serverPort + " fail!" + ex.ToString(),3);
m_clientSocket = null;
}
return false;
......@@ -115,11 +115,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!");
}
}
......@@ -135,7 +135,7 @@ namespace OnlineStore.Common
{
m_clientSocket.Send(sendBuffer);
LogUtil.debug(LOGGER,"Send >> " + strSendData);
LogUtil.debug("Send >> " + strSendData);
}
}
......@@ -153,7 +153,7 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error(LOGGER,"socket received error:" + ex.ToString(),4);
LogUtil.error("socket received error:" + ex.ToString(),4);
}
}
}
......
......@@ -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);
}
}
......@@ -158,11 +158,11 @@ namespace OnlineStore.Common
}
catch (SocketException e)
{
LogUtil.error(LOGGER, e.ToString(), 6);
LogUtil.error( e.ToString(), 6);
}
catch (Exception ex)
{
LogUtil.error(LOGGER, ex.ToString(), 5);
LogUtil.error( ex.ToString(), 5);
}
}
//private void ReceiveMessages(Client client)
......@@ -180,10 +180,10 @@ namespace OnlineStore.Common
// if (!string.IsNullOrEmpty(strReceiveData))
// {
// LogUtil.info(LOGGER, "收到数据:" + strReceiveData);
// LogUtil.info( "收到数据:" + strReceiveData);
// // this.AddRunningInfo(">> Receive data from [" + client.ClientSocket.RemoteEndPoint.ToString()+ "]:" + strReceiveData);
// string strSendData = "OK. The content is:" + strReceiveData;
// //LogUtil.info(LOGGER, "OK. The content is:" + strReceiveData);
// //LogUtil.info( "OK. The content is:" + strReceiveData);
// int sendBufferSize = Encoding.Unicode.GetByteCount(strSendData);
// byte[] sendBuffer = new byte[sendBufferSize];
// sendBuffer = Encoding.Unicode.GetBytes(strSendData);
......@@ -194,11 +194,11 @@ namespace OnlineStore.Common
// }
// catch (SocketException e)
// {
// LogUtil.error(LOGGER, e.ToString());
// LogUtil.error( e.ToString());
// }
// 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 + "]");
}
......
貫零,욋貫잚謹,膽邱섬,죕분욱똑,죕분멕똑,죕꾑ID,좋됐乞多,죕떱旗瘻菉貫零P2
P_1_1,1,1,210,300,1,1,10000
P_1_2,1,2,210,300,1,2,10000
P_1_3,1,3,210,300,1,3,10000
P_1_4,1,4,210,300,1,4,10000
P_1_5,1,5,210,300,1,5,10000
P_1_6,1,6,210,300,1,6,10000
P_1_7,1,7,210,300,1,7,10000
P_1_8,1,8,210,300,1,8,10000
P_1_9,1,9,210,300,1,9,10000
P_1_10,1,10,210,300,1,10,10000
P_2_1,1,11,210,300,1,11,50000
P_2_2,1,12,210,300,1,12,50000
P_2_3,1,13,210,300,1,13,50000
P_2_4,1,14,210,300,1,14,50000
P_2_5,1,15,210,300,1,15,50000
P_2_6,1,16,210,300,1,16,50000
P_2_7,1,17,210,300,1,17,50000
P_2_8,1,18,210,300,1,18,50000
P_2_9,1,19,210,300,1,19,50000
P_2_10,1,20,210,300,1,20,50000
P_3_1,2,21,400,300,1,21;22,90000
P_3_2,2,22,400,300,1,23;24,90000
P_3_3,2,23,400,300,1,25;26,90000
P_3_4,2,24,400,300,1,21;23,90000
P_3_5,2,25,400,300,1,23;25,90000
P_4_1,2,26,400,300,1,25;27,130000
P_4_2,2,27,400,300,1,21;24,130000
P_4_3,2,28,400,300,1,23;26,130000
P_4_4,2,29,400,300,1,25;28,130000
P_4_5,2,30,400,300,1,21;25,130000
位置,库位类型,优先级,料盒宽度,料盒高度,料仓ID,灯区域索引,亮灯索引,料斗旋转轴位置P2
P_1_1,1,1,210,300,1,0,1,10000
P_1_2,1,2,210,300,1,0,2,10000
P_1_3,1,3,210,300,1,0,3,10000
P_1_4,1,4,210,300,1,0,4,10000
P_1_5,1,5,210,300,1,0,5,10000
P_1_6,1,6,210,300,1,0,6,10000
P_1_7,1,7,210,300,1,0,7,10000
P_1_8,1,8,210,300,1,0,8,10000
P_1_9,1,9,210,300,1,0,9,10000
P_1_10,1,10,210,300,1,0,10,10000
P_2_1,1,11,210,300,1,0,11,50000
P_2_2,1,12,210,300,1,0,12,50000
P_2_3,1,13,210,300,1,0,13,50000
P_2_4,1,14,210,300,1,0,14,50000
P_2_5,1,15,210,300,1,0,15,50000
P_2_6,1,16,210,300,1,0,16,50000
P_2_7,1,17,210,300,1,0,17,50000
P_2_8,1,18,210,300,1,0,18,50000
P_2_9,1,19,210,300,1,0,19,50000
P_2_10,1,20,210,300,1,0,20,50000
P_3_1,2,21,400,300,1,0,21;22,90000
P_3_2,2,22,400,300,1,0,23;24,90000
P_3_3,2,23,400,300,1,0,25;26,90000
P_3_4,2,24,400,300,1,0,21;23,90000
P_3_5,2,25,400,300,1,0,23;25,90000
P_4_1,2,26,400,300,1,0,25;27,130000
P_4_2,2,27,400,300,1,0,21;24,130000
P_4_3,2,28,400,300,1,0,23;26,130000
P_4_4,2,29,400,300,1,0,25;28,130000
P_4_5,2,30,400,300,1,0,21;25,130000
......@@ -138,7 +138,9 @@ namespace OnlineStore.DeviceLibrary
}
private void StartReset()
{
{
CanCloseDoor = false;
WaitCanCloseDoor = false;
WarnMsg = "";
isInSuddenDown = false;
CurrInOutCount = 0;
......@@ -416,17 +418,14 @@ namespace OnlineStore.DeviceLibrary
}
else if (runStatus.Equals(StoreRunStatus.Runing))
{
IOTimeOutProcess();
}
IOTimeOutProcess();
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错" + ex.ToString());
}
}
}
private DateTime preIoTimerOutTime = DateTime.Now;
private void IOTimeOutProcess()
......@@ -490,9 +489,7 @@ namespace OnlineStore.DeviceLibrary
}
}
checkAlarmTime = DateTime.Now;
bool isInAlarm = false;
//Task.Factory.StartNew(delegate
// {
bool isInAlarm = false;
foreach (ConfigMoveAxis axisInfo in moveAxisList)
{
short axis = axisInfo.GetAxisValue();
......@@ -517,9 +514,7 @@ namespace OnlineStore.DeviceLibrary
}
}
AxisAlarmCodeMap[deviceName] = info;
}
//});
//判断报警状态
}
return isInAlarm;
}
#endregion
......@@ -600,31 +595,7 @@ namespace OnlineStore.DeviceLibrary
#region 与服务器通信定时器
private float Max_Humidity = 0;
private float Max_Temperature = 0;
public string currTempStr = "";
private void HumidityProcess()
{
try
{
ASTemperateParam param = HumitureController.ColdLastData;
currTempStr = "";
if (param != null)
{
currTempStr = ("冷藏区湿度:" + param.Humidity.ToString() + " 温度:" + param.Temperate.ToString() + " \n ");
}
param = HumitureController.WarmLastData;
if (param != null)
{
currTempStr += ("回温区湿度:" + param.Humidity.ToString() + " 温度:" + param.Temperate.ToString() + "\n ");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private bool isInProcess = false;
public void server_connect_timer_Tick(object sender, EventArgs e)
{
......@@ -643,8 +614,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error("定时给服务器发送消息出错:" + ex.ToString());
}
}
HumidityProcess();
}
LedProcess();
isInProcess = false;
}
......@@ -723,12 +693,12 @@ namespace OnlineStore.DeviceLibrary
DateTime time = DateTime.Now;
//构建发送给服务器的对象
Operation lineOperation = getLineBoxStatus();
//如果还没湿度范围,先获取
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{
lineOperation.op = 5;
LogUtil.info( Name + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
}
////如果还没湿度范围,先获取
//if (Max_Humidity <= 0 || (Max_Temperature <= 0))
//{
// lineOperation.op = 5;
// LogUtil.info( Name + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
//}
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false);
......@@ -763,24 +733,24 @@ namespace OnlineStore.DeviceLibrary
private void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error("转换温湿度失败:" + ex.ToString());
}
}
//Dictionary<string, string> data = resultOperation.data;
//if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
//{
// string maxHumidity = data[ParamDefine.maxHumidity];
// string maxTemp = data[ParamDefine.maxTemperature];
// LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
// try
// {
// this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
// this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
// LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
// }
// catch (Exception ex)
// {
// LogUtil.error("转换温湿度失败:" + ex.ToString());
// }
//}
}
private void ReviceOutStoreProcess(Operation resultOperation)
......@@ -1036,8 +1006,7 @@ namespace OnlineStore.DeviceLibrary
{
string msg = "";
msg += "" + runStatus +" _ "+ storeStatus+ " _ "+ alarmType+"\n";
msg += MoveInfo.MoveType + " _ "+MoveInfo.MoveStep + "\n";
msg += currTempStr;
msg += MoveInfo.MoveType + " _ "+MoveInfo.MoveStep + "\n";
return msg;
}
}
......
......@@ -210,7 +210,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始入库移动移动
/// </summary>
public abstract bool StartInStore(InOutParam param, bool isNeedCheckIO = false);
public abstract bool StartInStore(InOutParam param );
protected abstract void InStoreProcess();
#endregion
......
......@@ -148,9 +148,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SO_02_CloseDoor ,
/// <summary>
/// 出库: 旋转轴到P1
/// 出库:旋转轴到P2
/// </summary>
SO_03_MiddleToP1 ,
SO_03_MiddleToP2 ,
/// <summary>
/// 出库:打开升降门,打开库位灯
/// </summary>
......@@ -175,15 +175,15 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///入库:等待光栅未被遮挡
/// </summary>
SI_01_Wait = 1001,
SI_01_Wait = 2001,
/// <summary>
///入库:关闭升降门
/// </summary>
SI_02_CloseDoor,
/// <summary>
/// 入库: 旋转轴到P1
/// 入库: 旋转轴到P2
/// </summary>
SI_03_MiddleToP1,
SI_03_MiddleToP2,
/// <summary>
/// 入库:打开升降门,打开库位灯
/// </summary>
......
......@@ -228,14 +228,23 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
internal static WaitResultInfo WaitCloseDoor()
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 7;
wait.IsEnd = false;
return wait;
}
public string ToStr()
{
if (WaitType == 1)
{
if (IsHomeMove)
{
return "轴【" + AxisInfo.DisplayStr + "】原点返回";
return "轴【" + AxisInfo.DisplayStr + "】原点返回";
}
else
{
......@@ -260,13 +269,18 @@ namespace OnlineStore.DeviceLibrary
}
else if (WaitType == 6)
{
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}
else
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}
else if (WaitType.Equals(7))
{
return "可以关闭升降门";
}
else
{
return "Wait位置类型:WaitType=【" + WaitType + "】";
}
}
/// <summary>
/// 当未结束时可以重复运动的次数
/// </summary>
......
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>
......@@ -109,12 +110,12 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception e)
{
LOGGER.Error("出错:", e);
LogUtil.error("出错:", e);
}
}
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("未找到必须列:" + str + ",加载数据失败!");
LogUtil.error("未找到必须列:" + str + ",加载数据失败!");
throw new CVSFieldNotMatchingExection("未找到必须列:" + str + ",加载数据失败!");
}
}
......

using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Data;
......@@ -50,7 +51,7 @@ namespace OnlineStore.LoadCSVLibrary
{
if (hasReadFileList.Contains(filePath))
{
LOGGER.Error("文件" + filePath + "已经加载过,直接返回null");
LogUtil.error("文件" + filePath + "已经加载过,直接返回null");
return null;
}
Type type = typeof(T);
......@@ -58,7 +59,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);
......@@ -116,12 +117,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++;
......@@ -156,7 +157,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);
......
......@@ -28,16 +28,21 @@ namespace OnlineStore.LoadCSVLibrary
/// 料斗旋转轴位置P2
/// </summary>
[CSVAttribute("料斗旋转轴位置P2")]
public int MiddleAxis_P2 { get; set; }
public int MiddleAxis_P2 { get; set; }
/// <summary>
/// 亮灯索引
/// </summary>
[CSVAttribute("亮灯索引")]
public string LedIndex { get; set; }
/// <summary>
/// 亮灯索引
/// </summary>
[CSVAttribute("灯区域索引")]
public int LedDmx { get; set; }
private List<int> LedList = null;
public List<int> GetLedList(bool isReload)
public List<int> GetLedList(bool isReload = false )
{
if (LedList == null || isReload)
{
......
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["类型"];
......@@ -117,14 +118,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();
......@@ -143,14 +144,14 @@ namespace OnlineStore.LoadCSVLibrary
}
else
{
LOGGER.Error("配置的料仓类型=" + storeType + "未找到处理方法!");
LogUtil.error("配置的料仓类型=" + storeType + "未找到处理方法!");
}
return LoadConfig(config);
}
public static StoreConfig LoadConfig(StoreConfig config)
{
LOGGER.Info("开始读取文件:" + config.ConfigFilePath);
LogUtil.info("开始读取文件:" + config.ConfigFilePath);
if (config == null || config.ConfigFilePath.Equals(""))
{
return null;
......@@ -205,7 +206,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;
......@@ -13,7 +14,7 @@ namespace OnlineStore.LoadCSVLibrary
public class ConfigBase
{
public string DataStr = "";
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>
......@@ -44,7 +45,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
LogUtil.error("出错:", ex);
}
return value;
}
......@@ -313,7 +314,7 @@ namespace OnlineStore.LoadCSVLibrary
}
catch (Exception ex)
{
LOGGER.Error("出错了:", ex);
LogUtil.error ("出错了:", ex);
return -1;
}
return IoValue;
......
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -9,7 +10,7 @@ namespace OnlineStore.LoadCSVLibrary
{
public class StoreConfig
{
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>
/// ID
/// </summary>
......@@ -117,7 +118,7 @@ namespace OnlineStore.LoadCSVLibrary
else
{
AddProBuffer(con, proBuilder);
LOGGER.Error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
LogUtil.error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
}
}
else if (con.ProType == ConfigItemType.DI)
......@@ -133,9 +134,9 @@ namespace OnlineStore.LoadCSVLibrary
}
else
{
LOGGER.Error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
AddBuffer(con, builder);
LogUtil.error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
}
AddBuffer(con, builder);
}
else if (con.ProType == ConfigItemType.DO)
{
......@@ -150,18 +151,18 @@ namespace OnlineStore.LoadCSVLibrary
}
else
{
LOGGER.Error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
AddBuffer(con, builder);
LogUtil.error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
}
AddBuffer(con, builder);
}
}
if (String.IsNullOrEmpty(proBuilder.ToString()).Equals(false) && proBuilder.ToString().Equals("\r\n").Equals(false))
{
LOGGER.Error(proBuilder.ToString());
LogUtil.error(proBuilder.ToString());
}
if (String.IsNullOrEmpty(builder.ToString()).Equals(false) && builder.ToString().Equals("\r\n").Equals(false))
{
LOGGER.Error(builder.ToString());
LogUtil.error(builder.ToString());
}
if (checkProList.Count >= 0)
{
......
......@@ -6,7 +6,7 @@
<appSettings>
<!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1"/>
<add key="App_Title" value="锡膏料仓"/>
<add key="App_Title" value="垂直货柜"/>
<add key ="ACBaudRate" value ="115200"/>
<!--Server address-->
......@@ -17,7 +17,7 @@
<add key="Store_Position_Config" value="\StoreConfig\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA_Vertical"/>
<add key="Store_CID" value="rc1258ac-1"/>
<add key="Store_CID" value="RC1275"/>
<!--end one store config-->
<!--摄像机名称列表配置,用#分割-->
......@@ -48,6 +48,28 @@
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="logs/aoi/AIOBOX.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<logger name="RollingLogFileAppender">
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="AIOBOX">
<level value="Info" />
<appender-ref ref="AIOBOX" />
</logger>
<root>
<level value="INFO" />
<appender-ref ref="RollingLogFileAppender" />
</root>
<root>
<level value="Info"/>
<appender-ref ref="RollingLogFileAppender"/>
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.TinPasteStore
{
private int StoreId = 1;
private VerticalStoreBean 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;
......@@ -105,7 +105,7 @@ namespace OnlineStore.TinPasteStore
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
LogUtil.error( ex.StackTrace);
}
}
......
......@@ -770,12 +770,14 @@
this.btnCloseDoor.BackColor = System.Drawing.Color.White;
this.btnCloseDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDoor.Location = new System.Drawing.Point(1019, 114);
this.btnCloseDoor.Location = new System.Drawing.Point(957, 114);
this.btnCloseDoor.Name = "btnCloseDoor";
this.btnCloseDoor.Size = new System.Drawing.Size(132, 39);
this.btnCloseDoor.Size = new System.Drawing.Size(194, 39);
this.btnCloseDoor.TabIndex = 275;
this.btnCloseDoor.Text = "关闭升降门";
this.btnCloseDoor.Text = "料盒已放入/拿出,关闭升降门";
this.btnCloseDoor.UseVisualStyleBackColor = false;
this.btnCloseDoor.Visible = false;
this.btnCloseDoor.Click += new System.EventHandler(this.btnCloseDoor_Click);
//
// panel1
//
......@@ -801,7 +803,7 @@
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(13, 114);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(983, 56);
this.lblWarnMsg.Size = new System.Drawing.Size(938, 56);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......
......@@ -25,7 +25,7 @@ namespace OnlineStore.TinPasteStore
{
private VerticalStoreBean store;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmStoreBox()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -41,7 +41,7 @@ namespace OnlineStore.TinPasteStore
this.store = StoreManager.InitStore();
if (store == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
LogUtil.error( "找不到对应的料仓");
return;
}
VerticalPosition ktkPosition = null;
......@@ -86,7 +86,7 @@ namespace OnlineStore.TinPasteStore
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "出错:" + ex.StackTrace);
LogUtil.error( "出错:" + ex.StackTrace);
}
}
private bool preOpen = false;
......@@ -140,7 +140,7 @@ namespace OnlineStore.TinPasteStore
{
return;
}
lblThisSta.Text = store.GetRunStr() + " ";
if (store.MoveInfo.MoveType.Equals(MoveType.None).Equals(false))
{
......@@ -182,7 +182,7 @@ namespace OnlineStore.TinPasteStore
}
}
lblWarnMsg.Text = store.WarnMsg;
if (store.autoNext)
{
string msg = store.autoMsg;
......@@ -211,6 +211,8 @@ namespace OnlineStore.TinPasteStore
btnStartAuTo.Text = "开始自动出入库";
}
}
btnCloseDoor.Visible = (store.WaitCanCloseDoor && (!store.CanCloseDoor));
}
else
{
......@@ -352,7 +354,7 @@ namespace OnlineStore.TinPasteStore
store.AutoStartIndex = currIndex;
string poText = cmbPosition.Text;
store.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, store.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
LogUtil.info( store.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText));
store.StartInStore(new InOutParam(MoveType.InStore, poText));
}
......@@ -496,7 +498,7 @@ namespace OnlineStore.TinPasteStore
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
LogUtil.error( ex.StackTrace);
}
}
......@@ -587,5 +589,12 @@ namespace OnlineStore.TinPasteStore
string ip = txtLedIp.Text;
LEDManager.GetLedModule(ip).AllLightOn(Light.DefaultLight(0, 0));
}
private void btnCloseDoor_Click(object sender, EventArgs e)
{
LogUtil.info("用户点击:" + btnCloseDoor.Text);
store.SureCloseDoor();
}
}
}
......@@ -43,7 +43,7 @@ namespace OnlineStore.TinPasteStore
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
......@@ -113,7 +113,7 @@ namespace OnlineStore.TinPasteStore
static void LogUnhandledException(object exceptionobj)
{
//这里可以进一步地写日志
LOGGER.Error(exceptionobj.ToString());
LogUtil.error(exceptionobj.ToString());
}
}
}
......@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.TinPasteStore.Properties {
namespace OnlineStore.VerticalStore.Properties {
using System;
......@@ -39,7 +39,7 @@ namespace OnlineStore.TinPasteStore.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.TinPasteStore.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.VerticalStore.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
......
......@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.TinPasteStore.Properties {
namespace OnlineStore.VerticalStore.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
......
......@@ -7,8 +7,8 @@
<ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.TinPasteStore</RootNamespace>
<AssemblyName>TinPasteStore</AssemblyName>
<RootNamespace>OnlineStore.VerticalStore</RootNamespace>
<AssemblyName>VerticalStore</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!