Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b3c81d79
由
LN
编写于
2019-12-28 19:30:05 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
3800bd60
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
50 行增加
和
33 行删除
dll/RFID/Asa.RFID.dll
source/AssemblyLineClient/App.config
source/Common/util/LogUtil.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
dll/RFID/Asa.RFID.dll
查看文件 @
b3c81d7
此文件类型无法预览
source/AssemblyLineClient/App.config
查看文件 @
b3c81d7
...
@@ -67,10 +67,29 @@
...
@@ -67,10 +67,29 @@
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
layout
>
</
appender
>
</
appender
>
<
root
>
<
appender
name
=
"RfidLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/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"
/>
</
layout
>
</
appender
>
<
logger
name
=
"RollingLogFileAppender"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
logger
>
<
logger
name
=
"RfidLog"
>
<
level
value
=
"Debug"
/>
<
appender
-
ref
ref
=
"RfidLog"
/>
</
logger
>
<!--<
root
>
<
level
value
=
"Info"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
root
>
</
root
>
-->
</
log4net
>
</
log4net
>
<
startup
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
...
...
source/Common/util/LogUtil.cs
查看文件 @
b3c81d7
...
@@ -15,7 +15,7 @@ namespace OnlineStore.Common
...
@@ -15,7 +15,7 @@ namespace OnlineStore.Common
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
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
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
;
...
@@ -74,13 +74,16 @@ namespace OnlineStore.Common
...
@@ -74,13 +74,16 @@ namespace OnlineStore.Common
}
}
}
}
public
static
void
RfidLog
(
string
msg
)
{
rfidLog
.
Debug
(
msg
);
}
public
static
void
error
(
string
errorMsg
,
int
type
)
public
static
void
error
(
string
errorMsg
,
int
type
)
{
{
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
{
{
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
if
(
span
.
TotalSeconds
>
5
)
if
(
span
.
TotalSeconds
>
10
)
{
{
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
b3c81d7
...
@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
DateTime
lastProTimer
=
DateTime
.
Now
;
private
DateTime
lastProTimer
=
DateTime
.
Now
;
protected
int
TimerMaxSeconds
=
1
;
protected
int
TimerMaxSeconds
=
3
;
public
void
TimerProcess
()
public
void
TimerProcess
()
{
{
...
@@ -306,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -306,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
#
region
CheckWait
处理
#
region
CheckWait
处理
private
DateTime
preCheckAxisTime
=
DateTime
.
Now
;
protected
DateTime
preRWTime
=
DateTime
.
Now
;
protected
DateTime
preRWTime
=
DateTime
.
Now
;
internal
void
CheckWait
(
LineMoveInfo
moveInfo
)
internal
void
CheckWait
(
LineMoveInfo
moveInfo
)
{
{
...
@@ -334,6 +334,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -334,6 +334,10 @@ namespace OnlineStore.DeviceLibrary
NotOkMsg
=
wait
.
ToStr
();
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
{
{
TimeSpan
axisSpan
=
DateTime
.
Now
-
preCheckAxisTime
;
if
(
axisSpan
.
TotalSeconds
>
1
)
{
preCheckAxisTime
=
DateTime
.
Now
;
string
msg
=
""
;
string
msg
=
""
;
if
(
wait
.
IsHomeMove
)
if
(
wait
.
IsHomeMove
)
{
{
...
@@ -353,6 +357,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -353,6 +357,7 @@ namespace OnlineStore.DeviceLibrary
break
;
break
;
}
}
}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
{
NotOkMsg
=
" ("
+
baseConfig
.
GetDisplayName
(
wait
.
IoType
)
+
"="
+
wait
.
IoValue
+
") "
;
NotOkMsg
=
" ("
+
baseConfig
.
GetDisplayName
(
wait
.
IoType
)
+
"="
+
wait
.
IoValue
+
") "
;
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
b3c81d7
...
@@ -299,10 +299,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -299,10 +299,10 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
Task
.
Factory
.
StartNew
(
delegate
//
Task.Factory.StartNew(delegate
{
//
{
bool
result
=
moveEquip
.
StartRun
();
bool
result
=
moveEquip
.
StartRun
();
});
//
});
Thread
.
Sleep
(
60
);
Thread
.
Sleep
(
60
);
}
}
...
@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
return
true
;
return
true
;
}
}
private
void
EquipReset
(
EquipBase
equip
,
bool
isNeedAllReset
)
private
void
EquipReset
(
EquipBase
equip
,
bool
isNeedAllReset
)
{
{
//调试状态不再重置
//调试状态不再重置
if
(!
equip
.
IsDebug
)
if
(!
equip
.
IsDebug
)
...
@@ -401,9 +401,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -401,9 +401,9 @@ namespace OnlineStore.DeviceLibrary
if
(
isNeedAllReset
||
TrayManager
.
ErrorDeviceId
.
Equals
(
equip
.
DeviceID
)
||
(!
NoAlarm
()))
if
(
isNeedAllReset
||
TrayManager
.
ErrorDeviceId
.
Equals
(
equip
.
DeviceID
)
||
(!
NoAlarm
()))
{
{
LogUtil
.
info
(
Name
+
"收到复位信号,"
+
equip
.
Name
+
" 需要复位"
);
LogUtil
.
info
(
Name
+
"收到复位信号,"
+
equip
.
Name
+
" 需要复位"
);
Task
.
Factory
.
StartNew
(
delegate
{
//
Task.Factory.StartNew(delegate {
equip
.
Reset
();
equip
.
Reset
();
});
//
});
Thread
.
Sleep
(
60
);
Thread
.
Sleep
(
60
);
}
}
else
else
...
@@ -425,6 +425,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -425,6 +425,7 @@ namespace OnlineStore.DeviceLibrary
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
false
;
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
//停止运行时,把阻挡气缸上升
//停止运行时,把阻挡气缸上升
StopMove
();
StopMove
();
runStatus
=
LineRunStatus
.
Wait
;
runStatus
=
LineRunStatus
.
Wait
;
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
b3c81d7
...
@@ -68,24 +68,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -68,24 +68,7 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
//internal bool DLineStopOut(int dlineId, int LineNum)
//{
// foreach (DischargeLine line in DisLineMap.Values)
// {
// if ((line.DeviceID % 100).Equals(dlineId))
// {
// if (LineNum.Equals(1) && line.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
// {
// line.MoveInfo.EndMove();
// }
// else if (LineNum.Equals(2) && line.SecondMoveInfo.MoveType.Equals(LineMoveType.OutStore))
// {
// line.SecondMoveInfo.EndMove();
// }
// }
// }
// return false;
//}
private
bool
isInprocess
=
false
;
private
bool
isInprocess
=
false
;
private
DateTime
lastProTime
=
DateTime
.
Now
;
private
DateTime
lastProTime
=
DateTime
.
Now
;
private
void
InOutTimerProcess
()
private
void
InOutTimerProcess
()
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
b3c81d7
...
@@ -125,7 +125,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -125,7 +125,13 @@ namespace OnlineStore.DeviceLibrary
public
static
void
Close
()
public
static
void
Close
()
{
{
try
{
RfidReader
.
Close
();
RfidReader
.
Close
();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"关闭RFID出错:"
+
ex
.
ToString
());
}
}
}
}
}
public
class
RFIDData
public
class
RFIDData
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
b3c81d7
...
@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
GetActualtPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
return
GetActualtPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
}
}
public
static
int
GetActualtPosition
(
string
portName
,
int
slvAddr
)
public
static
int
GetActualtPosition
(
string
portName
,
int
slvAddr
,
int
rGetCount
=
2
)
{
{
PreReadAddr
=
ACCMDManager
.
ActualPosition
;
PreReadAddr
=
ACCMDManager
.
ActualPosition
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadRegisters
,
ACCMDManager
.
ActualPosition
,
"0000"
,
2
);
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadRegisters
,
ACCMDManager
.
ActualPosition
,
"0000"
,
2
);
...
@@ -401,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -401,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
ReviceOutTimeMS
,
9
);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
ReviceOutTimeMS
,
9
);
int
result
=
-
1
;
int
result
=
-
1
;
for
(
int
i
=
1
;
i
<=
3
;
i
++)
for
(
int
i
=
1
;
i
<=
rGetCount
;
i
++)
{
{
result
=
GetRegisterData
(
portName
,
reviceData
,
ACCMDManager
.
ActualPosition
);
result
=
GetRegisterData
(
portName
,
reviceData
,
ACCMDManager
.
ActualPosition
);
if
(!
result
.
Equals
(-
1
))
if
(!
result
.
Equals
(-
1
))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论