Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 73248902
由
LN
编写于
2020-01-02 15:24:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改:启动方法执行2次
1 个父辈
3c91b77f
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
36 行增加
和
21 行删除
dll/RFID/Asa.RFID.dll
source/AssemblyLineClient/App.config
source/AssemblyLineClient/FrmLineStore.cs
source/Common/util/LogUtil.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/LoadCVSLibrary/CSVReaderBase.cs
dll/RFID/Asa.RFID.dll
查看文件 @
7324890
此文件类型无法预览
source/AssemblyLineClient/App.config
查看文件 @
7324890
...
...
@@ -67,14 +67,14 @@
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"
RfidLog
"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/RFID.log"
/>
<
appender
name
=
"
TheRFID
"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/
The
RFID.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
=
"
%m%n"
/>
<
conversionPattern
value
=
"
[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
...
...
@@ -82,9 +82,9 @@
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
logger
>
<
logger
name
=
"
RfidLog
"
>
<
logger
name
=
"
TheRFID
"
>
<
level
value
=
"Debug"
/>
<
appender
-
ref
ref
=
"
RfidLog
"
/>
<
appender
-
ref
ref
=
"
TheRFID
"
/>
</
logger
>
<!--<
root
>
<
level
value
=
"Info"
/>
...
...
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
7324890
...
...
@@ -321,13 +321,18 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
info
(
LOGGER
,
"开始启动"
);
startTimer
.
Interval
=
300
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
startTimer
.
AutoReset
=
false
;
startTimer
.
Enabled
=
true
;
this
.
timer1
.
Start
();
}
private
delegate
void
ShowFormDelegate
();
void
timer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
startTimer
.
Enabled
=
false
;
startTimer
.
Stop
();
if
(
lineBean
.
runStatus
>
LineRunStatus
.
Wait
)
{
return
;
}
if
(
lineBean
.
StartRun
())
{
BeginInvoke
(
new
ShowFormDelegate
(
ShowStatus
));
...
...
source/Common/util/LogUtil.cs
查看文件 @
7324890
...
...
@@ -14,7 +14,7 @@ namespace OnlineStore.Common
public
static
readonly
ILog
AIOLog
=
LogManager
.
GetLogger
(
"AIOBOXLog"
);
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
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"RollingLogFileAppender"
);
public
static
readonly
ILog
rfidLog
=
LogManager
.
GetLogger
(
"RfidLog"
);
public
static
Dictionary
<
int
,
DateTime
>
lastErrorLogTime
=
new
Dictionary
<
int
,
DateTime
>();
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
7324890
...
...
@@ -15,15 +15,17 @@ namespace OnlineStore.DeviceLibrary
{
public
static
Asa
.
RFID
.
ReaderAll
RfidReader
=
new
ReaderAll
();
private
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
static
RFIDManager
()
{
RfidReader
.
GetValue
+=
RfidReader_GetValue
;
}
public
static
void
Open
(
string
[]
iparray
)
{
{
string
path
=
Application
.
StartupPath
+
@"\logs\rfid\"
;
RFIDManager
.
RfidReader
.
LogPath
=
path
;
// string[] rfidArray = rfidList.ToArray();
// string[] rfidArray = rfidList.ToArray();
//连接rfip
RFIDManager
.
RfidReader
.
Open
(
iparray
);
RfidReader
.
GetValue
+=
RfidReader_GetValue
;
}
private
static
void
RfidReader_GetValue
(
string
s
)
...
...
@@ -93,7 +95,12 @@ namespace OnlineStore.DeviceLibrary
{
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)
&&
LineManager
.
Line
.
rfidList
.
Contains
(
ip
))
{
RFIDData
data
=
new
RFIDData
(
RfidReader
.
Read
(
ip
));
byte
[]
bdata
=
RfidReader
.
Read
(
ip
);
if
(
bdata
==
null
)
{
LogUtil
.
error
(
"RFID [ "
+
ip
+
" ] 读到数据=null"
);
}
RFIDData
data
=
new
RFIDData
(
bdata
);
if
(
isClear
)
{
RfidReader
.
Clear
(
ip
);
...
...
@@ -126,7 +133,7 @@ namespace OnlineStore.DeviceLibrary
public
static
void
Close
()
{
try
{
{
RfidReader
.
Close
();
}
catch
(
Exception
ex
)
{
...
...
source/LoadCVSLibrary/CSVReaderBase.cs
查看文件 @
7324890
...
...
@@ -82,13 +82,7 @@ namespace OnlineStore.LoadCSVLibrary
protected
static
bool
WriteCSVFile
(
string
filePath
,
string
[]
lines
)
{
try
{
if
(
File
.
Exists
(
filePath
))
{
File
.
Delete
(
filePath
);
}
File
.
WriteAllLines
(
filePath
,
lines
,
Encoding
.
GetEncoding
(
"gbk"
));
{
//备份保存
try
{
...
...
@@ -105,12 +99,21 @@ namespace OnlineStore.LoadCSVLibrary
{
File
.
Delete
(
backFile
);
}
File
.
WriteAllLines
(
backFile
,
lines
,
Encoding
.
GetEncoding
(
"gbk"
));
File
.
Copy
(
filePath
,
backFile
,
true
);
// File.WriteAllLines(backFile, lines, Encoding.GetEncoding("gbk"));
}
catch
(
Exception
e
)
{
LOGGER
.
Error
(
"出错:"
,
e
);
}
if
(
File
.
Exists
(
filePath
))
{
File
.
Delete
(
filePath
);
}
File
.
WriteAllLines
(
filePath
,
lines
,
Encoding
.
GetEncoding
(
"gbk"
));
}
catch
(
Exception
ex
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论