Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a8d6bd04
由
LN
编写于
2021-06-01 15:37:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
日志打印修改
1 个父辈
7f50a6a4
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
89 行增加
和
73 行删除
source/Common/util/AcSerialBean.cs
source/Common/util/HttpHelper.cs
source/Common/util/LogUtil.cs
source/Common/util/TcpClient.cs
source/Common/util/TcpServer.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/Common/util/AcSerialBean.cs
查看文件 @
a8d6bd0
...
@@ -177,7 +177,7 @@ namespace OnlineStore.Common
...
@@ -177,7 +177,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
Ex
)
catch
(
Exception
Ex
)
{
{
LogUtil
.
error
(
LOGGER
,
Ex
.
ToString
());
LogUtil
.
error
(
Ex
.
ToString
());
//throw Ex;
//throw Ex;
}
}
return
ok
;
return
ok
;
...
@@ -268,7 +268,7 @@ namespace OnlineStore.Common
...
@@ -268,7 +268,7 @@ namespace OnlineStore.Common
// catch (Exception ex)
// catch (Exception ex)
// {
// {
// _serialPort.DiscardOutBuffer();
// _serialPort.DiscardOutBuffer();
// LogUtil.error(
LOGGER,
"SendData ERROR:" + ex.ToString(), 21);
// LogUtil.error(
"SendData ERROR:" + ex.ToString(), 21);
// }
// }
// }
// }
...
@@ -323,7 +323,7 @@ namespace OnlineStore.Common
...
@@ -323,7 +323,7 @@ namespace OnlineStore.Common
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
isOk
=
false
;
isOk
=
false
;
LogUtil
.
error
(
LOGGER
,
"SendCommand ERROR:"
+
ex
.
ToString
(),
20
);
LogUtil
.
error
(
"SendCommand ERROR:"
+
ex
.
ToString
(),
20
);
}
}
finally
finally
{
{
...
...
source/Common/util/HttpHelper.cs
查看文件 @
a8d6bd0
...
@@ -85,11 +85,11 @@ namespace OnlineStore.Common
...
@@ -85,11 +85,11 @@ namespace OnlineStore.Common
catch
(
WebException
ex
)
catch
(
WebException
ex
)
{
{
IsTimeOut
=
true
;
IsTimeOut
=
true
;
LogUtil
.
error
(
LOGGER
,
"POST WebException :"
+
ex
.
ToString
(),
101
);
LogUtil
.
error
(
"POST WebException :"
+
ex
.
ToString
(),
101
);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
LogUtil
.
error
(
LOGGER
,
"POST ERROR:"
+
e
.
ToString
(),
1
);
LogUtil
.
error
(
"POST ERROR:"
+
e
.
ToString
(),
1
);
}
}
if
(
isLog
==
1
)
if
(
isLog
==
1
)
{
{
...
@@ -151,7 +151,7 @@ namespace OnlineStore.Common
...
@@ -151,7 +151,7 @@ namespace OnlineStore.Common
}
}
if
(!
result
.
Contains
(
"null"
)
&&
result
.
Length
!=
0
)
if
(!
result
.
Contains
(
"null"
)
&&
result
.
Length
!=
0
)
{
{
//LogUtil.debug(
LOGGER,
"receive << " + result);
//LogUtil.debug(
"receive << " + result);
}
}
if
(
isLog
==
1
)
if
(
isLog
==
1
)
{
{
...
...
source/Common/util/LogUtil.cs
查看文件 @
a8d6bd0
...
@@ -6,6 +6,7 @@ using log4net;
...
@@ -6,6 +6,7 @@ using log4net;
using
System.Reflection
;
using
System.Reflection
;
using
System.Drawing
;
using
System.Drawing
;
using
System.Runtime.ExceptionServices
;
using
System.Runtime.ExceptionServices
;
using
System.Threading
;
namespace
OnlineStore.Common
namespace
OnlineStore.Common
{
{
...
@@ -14,38 +15,35 @@ namespace OnlineStore.Common
...
@@ -14,38 +15,35 @@ namespace OnlineStore.Common
public
static
readonly
ILog
AIOLog
=
LogManager
.
GetLogger
(
"AIOBOXLog"
);
public
static
readonly
ILog
AIOLog
=
LogManager
.
GetLogger
(
"AIOBOXLog"
);
private
static
LogUtil
instance
=
new
LogUtil
();
private
static
LogUtil
instance
=
new
LogUtil
();
public
delegate
void
ShowLog
(
string
msg
,
Color
color
);
public
delegate
void
ShowLog
(
string
msg
,
Color
color
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"RollingLogFileAppender"
);
public
static
readonly
ILog
rfidLog
=
LogManager
.
GetLogger
(
"RfidLog"
);
public
static
Dictionary
<
int
,
DateTime
>
lastErrorLogTime
=
new
Dictionary
<
int
,
DateTime
>();
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
=
1
0
;
public
static
int
showCount
=
1
5
;
public
static
bool
debug_opened
=
false
;
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
)
if
(
log
==
null
)
{
{
return
;
return
;
}
}
log
.
Info
(
msg
);
log
.
Info
(
msg
);
AddToBox
(
msg
,
Color
.
Black
);
AddToBox
(
msg
,
Color
.
Black
);
//clear();
//clear();
}
}
public
static
void
info
(
ILog
log
,
string
msg
,
Color
color
)
public
static
void
info
(
ILog
log
,
string
msg
,
Color
color
)
{
{
log
.
Info
(
msg
);
log
.
Info
(
msg
);
AddToBox
(
msg
,
color
);
AddToBox
(
msg
,
color
);
}
}
public
static
void
debug
(
ILog
log
,
string
msg
,
Color
color
)
public
static
void
debug
(
ILog
log
,
string
msg
,
Color
color
)
{
{
log
.
Debug
(
msg
);
log
.
Debug
(
msg
);
if
(
debug_opened
)
if
(
debug_opened
)
{
{
AddToBox
(
msg
,
color
);
AddToBox
(
msg
,
color
);
...
@@ -53,72 +51,85 @@ namespace OnlineStore.Common
...
@@ -53,72 +51,85 @@ namespace OnlineStore.Common
}
}
public
static
void
debug
(
ILog
log
,
string
msg
)
public
static
void
debug
(
ILog
log
,
string
msg
)
{
{
log
.
Debug
(
msg
);
log
.
Debug
(
msg
);
if
(
debug_opened
)
if
(
debug_opened
)
{
{
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
(
ILog
log
,
string
errorMsg
,
int
type
,
int
spanSeconds
=
10
)
public
static
void
error
(
string
errorMsg
,
int
type
,
int
seconds
=
10
)
{
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
{
{
try
try
{
{
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
{
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
if
(
span
.
TotalSeconds
<
spanS
econds
)
if
(
span
.
TotalSeconds
>
s
econds
)
{
{
return
;
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
error
(
LOGGER
,
errorMsg
);
}
}
}
else
else
{
{
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
error
(
log
,
errorMsg
);
error
(
LOGGER
,
errorMsg
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LOGGER
.
Error
(
" 打印日志【"
+
type
+
"-"
+
errorMsg
+
"】出错:"
+
ex
.
ToString
());
}
}
}
}
else
public
static
void
error
(
ILog
log
,
string
errorMsg
,
Exception
ex
=
null
)
{
{
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
if
(
errorMsg
.
Trim
().
Equals
(
""
)
&&
(
ex
==
null
))
error
(
log
,
errorMsg
);
{
return
;
}
}
if
(
ex
==
null
)
{
log
.
Error
(
errorMsg
);
}
}
public
static
void
error
(
ILog
log
,
string
errorMsg
)
else
{
{
log
.
Error
(
errorMsg
);
log
.
Error
(
errorMsg
,
ex
);
}
AddToBox
(
errorMsg
,
Color
.
Red
);
AddToBox
(
errorMsg
,
Color
.
Red
);
}
}
private
static
object
lockObj
=
""
;
private
static
void
AddToBox
(
string
msg
,
Color
color
)
private
static
void
AddToBox
(
string
msg
,
Color
color
)
{
{
if
(
Monitor
.
TryEnter
(
lockObj
,
2
))
{
try
try
{
{
ShowLogPro
(
msg
,
color
);
ShowLogPro
(
msg
,
color
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LOGGER
.
Error
(
"出错:"
+
ex
.
StackTrace
);
LOGGER
.
Error
(
"出错:"
,
ex
);
}
finally
{
Monitor
.
Exit
(
lockObj
);
}
}
else
{
LOGGER
.
Debug
(
"ShowLogPro【"
+
msg
+
"】失败,未得到锁"
);
}
}
}
}
private
static
List
<
string
>
logList
=
new
List
<
string
>();
private
static
List
<
string
>
logList
=
new
List
<
string
>();
public
static
string
LastText
=
""
;
public
static
string
LastText
=
""
;
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
private
static
void
ShowLogPro
(
string
msg
,
Color
color
)
private
static
void
ShowLogPro
(
string
msg
,
Color
color
)
{
{
try
try
{
{
if
(
logList
.
Count
>
0
)
{
// logList.RemoveAt(0);
}
if
(
logList
.
Count
>=
showCount
)
if
(
logList
.
Count
>=
showCount
)
{
{
logList
.
RemoveAt
(
0
);
logList
.
RemoveAt
(
0
);
...
@@ -143,7 +154,7 @@ namespace OnlineStore.Common
...
@@ -143,7 +154,7 @@ namespace OnlineStore.Common
logBox
.
AppendText
(
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
//增加文本
logBox
.
AppendText
(
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
//增加文本
TimeSpan
span
=
DateTime
.
Now
-
lastTime
;
TimeSpan
span
=
DateTime
.
Now
-
lastTime
;
if
(
span
.
TotalSeconds
>
1
000
)
if
(
span
.
TotalSeconds
>
3
000
)
{
{
lastTime
=
DateTime
.
Now
;
lastTime
=
DateTime
.
Now
;
logBox
.
Select
(
logBox
.
Text
.
Length
,
0
);
//设置光标的位置到文本尾
logBox
.
Select
(
logBox
.
Text
.
Length
,
0
);
//设置光标的位置到文本尾
...
@@ -153,7 +164,7 @@ namespace OnlineStore.Common
...
@@ -153,7 +164,7 @@ namespace OnlineStore.Common
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
{
{
LOGGER
.
Error
(
" ShowLogPro 出错:"
+
e
.
ToString
());
LOGGER
.
Error
(
" ShowLogPro 出错:"
+
e
.
ToString
());
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -166,6 +177,14 @@ namespace OnlineStore.Common
...
@@ -166,6 +177,14 @@ namespace OnlineStore.Common
if
(
logBox
!=
null
&&
logBox
.
Visible
)
if
(
logBox
!=
null
&&
logBox
.
Visible
)
{
{
logBox
.
Text
=
LastText
;
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
()
public
static
void
ClearLog
()
...
@@ -182,16 +201,13 @@ namespace OnlineStore.Common
...
@@ -182,16 +201,13 @@ namespace OnlineStore.Common
{
{
debug
(
LOGGER
,
msg
);
debug
(
LOGGER
,
msg
);
}
}
public
static
void
error
(
string
errorMsg
)
public
static
void
error
(
string
errorMsg
,
Exception
ex
=
null
)
{
{
error
(
LOGGER
,
errorMsg
);
error
(
LOGGER
,
errorMsg
,
ex
);
}
}
public
static
void
info
(
string
msg
)
public
static
void
info
(
string
msg
)
{
{
info
(
LOGGER
,
msg
);
info
(
LOGGER
,
msg
);
}
}
}
}
...
...
source/Common/util/TcpClient.cs
查看文件 @
a8d6bd0
...
@@ -123,7 +123,7 @@ namespace OnlineStore.Common
...
@@ -123,7 +123,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
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
;
m_clientSocket
=
null
;
}
}
...
@@ -176,7 +176,7 @@ namespace OnlineStore.Common
...
@@ -176,7 +176,7 @@ namespace OnlineStore.Common
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
isInProcess
=
false
;
isInProcess
=
false
;
LogUtil
.
error
(
LOGGER
,
"重连处理出错:"
+
ex
.
ToString
(),
9
,
180
);
LogUtil
.
error
(
"重连处理出错:"
+
ex
.
ToString
(),
9
,
180
);
}
}
}
}
...
@@ -227,7 +227,7 @@ namespace OnlineStore.Common
...
@@ -227,7 +227,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"socket received error:"
+
ex
.
ToString
(),
4
);
LogUtil
.
error
(
"socket received error:"
+
ex
.
ToString
(),
4
);
}
}
}
}
}
}
...
...
source/Common/util/TcpServer.cs
查看文件 @
a8d6bd0
...
@@ -39,7 +39,7 @@ namespace OnlineStore.Common
...
@@ -39,7 +39,7 @@ namespace OnlineStore.Common
}
}
}
}
}
}
LogUtil
.
info
(
LOGGER
,
iplist
+
"]"
);
LogUtil
.
info
(
iplist
+
"]"
);
}
}
/// <summary>
/// <summary>
...
@@ -59,7 +59,7 @@ namespace OnlineStore.Common
...
@@ -59,7 +59,7 @@ namespace OnlineStore.Common
m_serverThread
=
new
Thread
(
new
ThreadStart
(
ReceiveAccept
));
m_serverThread
=
new
Thread
(
new
ThreadStart
(
ReceiveAccept
));
m_serverThread
.
Start
();
m_serverThread
.
Start
();
LogUtil
.
info
(
LOGGER
,
" Server start listen : "
+
m_serverPort
);
LogUtil
.
info
(
" Server start listen : "
+
m_serverPort
);
logLocalIp
();
logLocalIp
();
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
...
@@ -101,14 +101,14 @@ namespace OnlineStore.Common
...
@@ -101,14 +101,14 @@ namespace OnlineStore.Common
client
.
ClientSocket
=
m_serverSocket
.
Accept
();
client
.
ClientSocket
=
m_serverSocket
.
Accept
();
IPEndPoint
clientipe
=
(
IPEndPoint
)
client
.
ClientSocket
.
RemoteEndPoint
;
IPEndPoint
clientipe
=
(
IPEndPoint
)
client
.
ClientSocket
.
RemoteEndPoint
;
client
.
ipAdd
=
clientipe
.
Address
;
client
.
ipAdd
=
clientipe
.
Address
;
LogUtil
.
info
(
LOGGER
,
"有新的客户端链接上:"
+
client
.
ipAdd
.
ToString
());
LogUtil
.
info
(
"有新的客户端链接上:"
+
client
.
ipAdd
.
ToString
());
receiveMessageDelegate
=
new
ReceiveMessageDelegate
(
ReceiveMessages
);
receiveMessageDelegate
=
new
ReceiveMessageDelegate
(
ReceiveMessages
);
receiveMessageDelegate
.
BeginInvoke
(
client
,
ReceiveMessagesCallback
,
""
);
receiveMessageDelegate
.
BeginInvoke
(
client
,
ReceiveMessagesCallback
,
""
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
ex
.
Message
);
LogUtil
.
error
(
ex
.
Message
);
//throw new Exception(ex.Message);
//throw new Exception(ex.Message);
}
}
}
}
...
@@ -158,11 +158,11 @@ namespace OnlineStore.Common
...
@@ -158,11 +158,11 @@ namespace OnlineStore.Common
}
}
catch
(
SocketException
e
)
catch
(
SocketException
e
)
{
{
LogUtil
.
error
(
LOGGER
,
e
.
ToString
(),
6
);
LogUtil
.
error
(
e
.
ToString
(),
6
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
ex
.
ToString
(),
5
);
LogUtil
.
error
(
ex
.
ToString
(),
5
);
}
}
}
}
//private void ReceiveMessages(Client client)
//private void ReceiveMessages(Client client)
...
@@ -180,10 +180,10 @@ namespace OnlineStore.Common
...
@@ -180,10 +180,10 @@ namespace OnlineStore.Common
// if (!string.IsNullOrEmpty(strReceiveData))
// if (!string.IsNullOrEmpty(strReceiveData))
// {
// {
// LogUtil.info(
LOGGER,
"收到数据:" + strReceiveData);
// LogUtil.info(
"收到数据:" + strReceiveData);
// // this.AddRunningInfo(">> Receive data from [" + client.ClientSocket.RemoteEndPoint.ToString()+ "]:" + strReceiveData);
// // this.AddRunningInfo(">> Receive data from [" + client.ClientSocket.RemoteEndPoint.ToString()+ "]:" + strReceiveData);
// string strSendData = "OK. The content is:" + 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);
// int sendBufferSize = Encoding.Unicode.GetByteCount(strSendData);
// byte[] sendBuffer = new byte[sendBufferSize];
// byte[] sendBuffer = new byte[sendBufferSize];
// sendBuffer = Encoding.Unicode.GetBytes(strSendData);
// sendBuffer = Encoding.Unicode.GetBytes(strSendData);
...
@@ -194,7 +194,7 @@ namespace OnlineStore.Common
...
@@ -194,7 +194,7 @@ namespace OnlineStore.Common
// }
// }
// catch (SocketException e)
// catch (SocketException e)
// {
// {
// LogUtil.error(
LOGGER,
e.ToString());
// LogUtil.error(
e.ToString());
// }
// }
// catch (Exception ex)
// catch (Exception ex)
// {
// {
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
a8d6bd0
...
@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
ACStorePosition
position
=
param
.
GetACPosition
();
ACStorePosition
position
=
param
.
GetACPosition
();
if
(
position
==
null
)
if
(
position
==
null
)
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
LogUtil
.
error
(
StoreName
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
return
false
;
return
false
;
}
}
...
@@ -91,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -91,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
ACStorePosition
position
=
param
.
GetACPosition
();
ACStorePosition
position
=
param
.
GetACPosition
();
if
(
position
==
null
)
if
(
position
==
null
)
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
LogUtil
.
error
(
StoreName
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
return
false
;
return
false
;
}
}
if
(
param
.
PosInfo
.
PlateH
<=
0
)
if
(
param
.
PosInfo
.
PlateH
<=
0
)
...
@@ -195,7 +195,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -195,7 +195,7 @@ namespace OnlineStore.DeviceLibrary
}
}
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
LogUtil
.
error
(
StoreName
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
isOk
=
false
;
isOk
=
false
;
break
;
break
;
}
}
...
@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
return
;
return
;
}
}
LogUtil
.
error
(
LOGGER
,
WarnMsg
,
100
);
LogUtil
.
error
(
WarnMsg
,
100
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
}
}
...
@@ -295,12 +295,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -295,12 +295,12 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(!
LoadParamPosition
(
param
))
if
(!
LoadParamPosition
(
param
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
LogUtil
.
error
(
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
return
;
}
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
LogUtil
.
error
(
StoreName
+
" 启动入库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
;
return
;
}
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】"
,
storeMoveColor
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】"
,
storeMoveColor
);
...
@@ -329,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -329,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动【"
+
posId
+
"】入库出错,当前状态,storeStatus="
+
storeRunStatus
);
LogUtil
.
error
(
StoreName
+
" 启动【"
+
posId
+
"】入库出错,当前状态,storeStatus="
+
storeRunStatus
);
}
}
}
}
...
@@ -407,7 +407,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -407,7 +407,7 @@ namespace OnlineStore.DeviceLibrary
}
}
WarnMsg
=
StoreName
+
"入库 等待料仓门口检测到料盘 ["
+
StoreMove
.
MoveParam
.
PosInfo
.
barcode
+
"] ["
+
StoreMove
.
MoveParam
.
PosInfo
.
PosId
+
"] 超时 ["
+
Math
.
Round
(
StoreMove
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒 "
;
WarnMsg
=
StoreName
+
"入库 等待料仓门口检测到料盘 ["
+
StoreMove
.
MoveParam
.
PosInfo
.
barcode
+
"] ["
+
StoreMove
.
MoveParam
.
PosInfo
.
PosId
+
"] 超时 ["
+
Math
.
Round
(
StoreMove
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒 "
;
LogUtil
.
error
(
LOGGER
,
WarnMsg
,
100
);
LogUtil
.
error
(
WarnMsg
,
100
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
}
}
...
@@ -591,12 +591,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -591,12 +591,12 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(!
LoadParamPosition
(
param
))
if
(!
LoadParamPosition
(
param
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,找不到库位信息"
);
LogUtil
.
error
(
StoreName
+
" 启动出库【"
+
posId
+
"】出错,找不到库位信息"
);
return
false
;
return
false
;
}
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
LogUtil
.
error
(
StoreName
+
" 启动出库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
false
;
return
false
;
}
}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
storeStatus
=
StoreStatus
.
OutStoreExecute
;
...
@@ -612,7 +612,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -612,7 +612,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库出错,当前状态,storeStatus="
+
storeRunStatus
);
LogUtil
.
error
(
StoreName
+
" 启动出库出错,当前状态,storeStatus="
+
storeRunStatus
);
}
}
return
false
;
return
false
;
}
}
...
@@ -873,7 +873,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -873,7 +873,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 出库处理,moveStatus="
+
StoreMove
.
MoveStep
+
",没有对应的处理!"
);
LogUtil
.
error
(
StoreName
+
" 出库处理,moveStatus="
+
StoreMove
.
MoveStep
+
",没有对应的处理!"
);
}
}
}
}
...
@@ -1115,7 +1115,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1115,7 +1115,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
ex
.
ToString
());
LogUtil
.
error
(
ex
.
ToString
());
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论