Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
RC1271-DUOStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit aece1f17
由
LN
编写于
2020-07-15 14:59:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
9af14a7c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
339 行增加
和
285 行删除
doc/马来西亚DUO料仓电器BOM.xlsx
source/Common/util/HttpHelper.cs
source/DUOStore/FrmAxisMove.Designer.cs
source/DUOStore/FrmBox.cs
source/DUOStore/FrmStore.cs
source/DeviceLibrary/StoreConfig/StoreConfig.csv
source/DeviceLibrary/device/halcon/CodeManager.cs
source/DeviceLibrary/duoStore/AxisBean.cs
source/DeviceLibrary/duoStore/BoxBean.cs
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
source/DeviceLibrary/duoStore/BoxBean_Shelf.cs
source/DeviceLibrary/duoStore/DUOStoreBean.cs
source/DeviceLibrary/duoStore/DUOStoreBean_Partial.cs
source/DeviceLibrary/duoStore/EquipBase.cs
source/DeviceLibrary/duoStore/HoisterCylinder.cs
source/DeviceLibrary/duoStore/StoreManager.cs
source/DeviceLibrary/store/InOutParam.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/StoreStep.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/storeConfig/config/Store_Config.cs
doc/马来西亚DUO料仓电器BOM.xlsx
查看文件 @
aece1f1
此文件类型无法预览
source/Common/util/HttpHelper.cs
查看文件 @
aece1f1
...
...
@@ -18,54 +18,39 @@ namespace OnlineStore.Common
{
public
class
HttpHelper
{
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType
);
public
static
string
Post
(
string
url
,
string
paramData
)
private
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
public
static
bool
PingURLIP
(
string
url
,
int
ms
=
100
)
{
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
);
}
//public static bool PingURLIP(string url, int ms=100)
//{
// string[] urlArray = url.Split('/');
// if (urlArray.Length > 3)
// {
// string ip = urlArray[2];
// Ping pingSender = new Ping();
// PingReply reply = pingSender.Send(ip, ms);//第一个参数为ip地址,第二个参数为ping的时间
// if (reply.Status == IPStatus.Success)
// {
// //通
// return true;
// }
// else
// {
// //不通
// return false;
// }
// }
// return true;
//}
string
[]
urlArray
=
url
.
Split
(
'/'
);
if
(
urlArray
.
Length
>
3
)
{
string
ip
=
urlArray
[
2
];
/// <summary>
///
/// </summary>
/// <param name="url"></param>
/// <param name="operation"></param>
/// <param name="simulate">是否模拟服务器返回结果</param>
/// <returns></returns>
public
static
Operation
Post
(
string
url
,
Operation
operation
,
bool
simulate
)
Ping
pingSender
=
new
Ping
();
PingReply
reply
=
pingSender
.
Send
(
ip
,
ms
);
//第一个参数为ip地址,第二个参数为ping的时间
if
(
reply
.
Status
==
IPStatus
.
Success
)
{
//通
return
true
;
}
else
{
LogUtil
.
error
(
"Ping IP "
+
ip
+
" : false"
);
//不通
return
false
;
}
}
return
true
;
}
public
static
string
Post
(
string
url
,
string
paramData
,
int
timeOut
=
5000
)
{
bool
IsTimeOut
=
false
;
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
,
timeOut
,
out
IsTimeOut
);
}
public
static
Operation
PostOperation
(
string
url
,
Operation
operation
,
bool
simulate
=
false
)
{
try
{
////如果Op=0或者Op=5,先拼Ip,不通不发送
//if (operation.op < 0 || operation.op.Equals(5))
//{
// if (PingURLIP(url, 100).Equals(false))
// {
// return null;
// }
//}
{
if
(
simulate
)
{
//模拟服务器返回
operation
.
status
=
200
;
...
...
@@ -112,23 +97,13 @@ namespace OnlineStore.Common
}
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
)
public
static
string
Post
(
string
url
,
string
paramData
,
Encoding
encoding
,
int
timeOut
,
out
bool
IsTimeOut
)
{
//if (PingURLIP(url, 100).Equals(false))
//{
// return null;
//}
IsTimeOut
=
false
;
if
(
isLog
==
1
)
{
LogUtil
.
info
(
"给服务器发送数据【"
+
paramData
+
"】 "
);
}
if
(
paramData
!=
"null"
&&
paramData
!=
null
)
{
// LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData);
}
}
string
result
=
""
;
if
(
url
.
ToLower
().
IndexOf
(
"https"
,
System
.
StringComparison
.
Ordinal
)
>
-
1
)
...
...
@@ -139,7 +114,7 @@ namespace OnlineStore.Common
try
{
var
wc
=
new
MyWebClient
(
5000
);
var
wc
=
new
MyWebClient
(
timeOut
);
if
(
string
.
IsNullOrEmpty
(
wc
.
Headers
[
"Content-Type"
]))
wc
.
Headers
.
Add
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
wc
.
Encoding
=
encoding
;
...
...
@@ -147,23 +122,23 @@ namespace OnlineStore.Common
result
=
wc
.
UploadString
(
url
,
"POST"
,
paramData
);
//LogUtil.info(result);
}
catch
(
WebException
ex
)
{
IsTimeOut
=
true
;
LogUtil
.
error
(
"POST ["
+
url
+
"] WebException :"
+
ex
.
ToString
(),
101
);
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"POST
ERROR:"
+
e
.
ToString
(),
1
);
LogUtil
.
error
(
"POST
["
+
url
+
"] ERROR:"
+
e
.
ToString
(),
10
1
);
}
if
(!
result
.
Contains
(
"null"
)
&&
result
.
Length
!=
0
)
{
//LogUtil.debug(
LOGGER,
"receive << " + result);
//LogUtil.debug(
"receive << " + result);
}
if
(
isLog
==
1
)
{
LogUtil
.
info
(
"收到服务器数据【"
+
result
+
"】"
);
}
LastServerMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" URL:"
+
url
+
"\r\n"
+
"发送:"
+
paramData
+
"\r\n"
+
"接收:"
+
result
+
"\r\n"
;
return
result
;
}
...
...
@@ -176,19 +151,19 @@ namespace OnlineStore.Common
{
try
{
LogUtil
.
info
(
"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
(
"receive << "
+
result
);
LogUtil
.
info
(
"receive << "
+
result
);
return
result
;
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"HTTP GET ERROR:"
+
e
.
Message
,
2
);
LogUtil
.
error
(
"HTTP GET ERROR:"
+
e
.
Message
,
10
2
);
}
return
""
;
}
...
...
source/DUOStore/FrmAxisMove.Designer.cs
查看文件 @
aece1f1
...
...
@@ -54,6 +54,8 @@ namespace OnlineStore.DUOStore
this
.
btnAxisOff
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnAxisOn
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
axisMoveControl1
=
new
OnlineStore
.
DUOStore
.
AxisMoveControl
();
this
.
textBox1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupInout
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -64,7 +66,8 @@ namespace OnlineStore.DUOStore
//
// groupInout
//
this
.
groupInout
.
Controls
.
Add
(
this
.
btnSaveP
);
this
.
groupInout
.
Controls
.
Add
(
this
.
textBox1
);
this
.
groupInout
.
Controls
.
Add
(
this
.
button1
);
this
.
groupInout
.
Controls
.
Add
(
this
.
txtUpdownP6
);
this
.
groupInout
.
Controls
.
Add
(
this
.
btnUpdownP6
);
this
.
groupInout
.
Controls
.
Add
(
this
.
txtUpdownP5
);
...
...
@@ -98,7 +101,7 @@ namespace OnlineStore.DUOStore
// btnSaveP
//
this
.
btnSaveP
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnSaveP
.
Location
=
new
System
.
Drawing
.
Point
(
21
,
229
);
this
.
btnSaveP
.
Location
=
new
System
.
Drawing
.
Point
(
752
,
530
);
this
.
btnSaveP
.
Name
=
"btnSaveP"
;
this
.
btnSaveP
.
Size
=
new
System
.
Drawing
.
Size
(
128
,
39
);
this
.
btnSaveP
.
TabIndex
=
313
;
...
...
@@ -350,7 +353,7 @@ namespace OnlineStore.DUOStore
this
.
btnMiddleP1
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnMiddleP1
.
Size
=
new
System
.
Drawing
.
Size
(
193
,
33
);
this
.
btnMiddleP1
.
TabIndex
=
301
;
this
.
btnMiddleP1
.
Text
=
"T2_旋转轴
待机点/取放料
点P1:"
;
this
.
btnMiddleP1
.
Text
=
"T2_旋转轴
_待机
点P1:"
;
this
.
btnMiddleP1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnMiddleP1
.
UseVisualStyleBackColor
=
false
;
this
.
btnMiddleP1
.
Click
+=
new
System
.
EventHandler
(
this
.
btnMiddleP1_Click
);
...
...
@@ -509,11 +512,45 @@ namespace OnlineStore.DUOStore
this
.
axisMoveControl1
.
Size
=
new
System
.
Drawing
.
Size
(
735
,
312
);
this
.
axisMoveControl1
.
TabIndex
=
274
;
//
// textBox1
//
this
.
textBox1
.
AcceptsReturn
=
true
;
this
.
textBox1
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
textBox1
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
IBeam
;
this
.
textBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
textBox1
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
WindowText
;
this
.
textBox1
.
Location
=
new
System
.
Drawing
.
Point
(
228
,
234
);
this
.
textBox1
.
MaxLength
=
20
;
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
23
);
this
.
textBox1
.
TabIndex
=
314
;
this
.
textBox1
.
Text
=
"999999"
;
//
// button1
//
this
.
button1
.
AutoSize
=
true
;
this
.
button1
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
button1
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
button1
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
button1
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
192
)))));
this
.
button1
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
21
,
228
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
193
,
33
);
this
.
button1
.
TabIndex
=
313
;
this
.
button1
.
Text
=
"T2_旋转轴_料串取放料点P4:"
;
this
.
button1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
button1
.
UseVisualStyleBackColor
=
false
;
//
// FrmAxisMove
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
964
,
630
);
this
.
Controls
.
Add
(
this
.
btnSaveP
);
this
.
Controls
.
Add
(
this
.
groupInout
);
this
.
Controls
.
Add
(
this
.
axisMoveControl1
);
this
.
Controls
.
Add
(
this
.
btnAxisOff
);
...
...
@@ -561,6 +598,8 @@ namespace OnlineStore.DUOStore
public
System
.
Windows
.
Forms
.
Button
btnUpdownP4
;
public
System
.
Windows
.
Forms
.
Button
btnUpdownP2
;
private
System
.
Windows
.
Forms
.
Button
btnSaveP
;
public
System
.
Windows
.
Forms
.
TextBox
textBox1
;
public
System
.
Windows
.
Forms
.
Button
button1
;
}
}
source/DUOStore/FrmBox.cs
查看文件 @
aece1f1
...
...
@@ -133,7 +133,7 @@ namespace OnlineStore.DUOStore
// lblMoveEquipInfo.Text = "";
}
//ReadPosistion();
if
(
BoxBean
.
storeR
unStatus
>
StoreRunStatus
.
Wait
)
if
(
BoxBean
.
r
unStatus
>
StoreRunStatus
.
Wait
)
{
if
(
btnStoreStart
.
Enabled
.
Equals
(
true
))
{
...
...
@@ -145,7 +145,7 @@ namespace OnlineStore.DUOStore
//复位按钮状态显示
if
(
btnSotreReset
.
Enabled
==
false
)
{
if
((
BoxBean
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
BoxBean
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Reset
))
if
((
BoxBean
.
runStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
BoxBean
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
BoxBean
.
alarmType
.
Equals
(
AlarmType
.
None
))
{
}
...
...
@@ -159,7 +159,7 @@ namespace OnlineStore.DUOStore
}
else
{
if
((
BoxBean
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
BoxBean
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Reset
))
if
((
BoxBean
.
runStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
BoxBean
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
BoxBean
.
alarmType
.
Equals
(
AlarmType
.
None
))
{
if
(
btnStoreStart
.
Enabled
)
...
...
@@ -209,7 +209,7 @@ namespace OnlineStore.DUOStore
private
void
btnOutStore_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
string
selectPositionNum
=
cmbPosition
.
Text
;
LineMoveP
ktk
=
LoadPostion
();
...
...
@@ -224,7 +224,7 @@ namespace OnlineStore.DUOStore
private
void
btnInStore_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
string
selectPositionNum
=
cmbPosition
.
Text
;
LineMoveP
ktk
=
LoadPostion
();
...
...
@@ -522,7 +522,7 @@ namespace OnlineStore.DUOStore
private
void
btnStartAuTo_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
if
(
BoxBean
.
AutoInout
.
autoNext
)
{
...
...
@@ -575,7 +575,7 @@ namespace OnlineStore.DUOStore
{
try
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
BoxBean
.
StopRun
();
StoreOpenStatus
(
false
);
...
...
@@ -593,7 +593,7 @@ namespace OnlineStore.DUOStore
private
void
btnSotreReset_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
this
.
BoxBean
.
Reset
();
btnSotreReset
.
Enabled
=
false
;
...
...
@@ -802,7 +802,7 @@ namespace OnlineStore.DUOStore
private
void
btnNgPro_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
string
selectPositionNum
=
cmbPosition
.
Text
;
LineMoveP
ktk
=
LoadPostion
();
...
...
@@ -816,7 +816,7 @@ namespace OnlineStore.DUOStore
private
void
btnSingleOut_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
BoxBean
.
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
string
selectPositionNum
=
cmbPosition
.
Text
;
LineMoveP
ktk
=
LoadPostion
();
...
...
source/DUOStore/FrmStore.cs
查看文件 @
aece1f1
...
...
@@ -132,7 +132,7 @@ namespace OnlineStore.DUOStore
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
//如果料仓还在运行状态,先关闭料仓
if
(!
store
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(!
store
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
LogUtil
.
info
(
"ExitApp 停止"
+
store
.
Name
+
"运行 "
);
store
.
StopRun
();
...
...
@@ -141,7 +141,7 @@ namespace OnlineStore.DUOStore
{
foreach
(
BoxBean
bean
in
store
.
BoxMap
.
Values
)
{
if
(
bean
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Wait
).
Equals
(
false
))
if
(
bean
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Wait
).
Equals
(
false
))
{
LogUtil
.
info
(
"ExitApp 停止"
+
bean
.
Name
+
"运行 "
);
bean
.
StopRun
();
...
...
@@ -187,9 +187,9 @@ namespace OnlineStore.DUOStore
private
void
启动所有料仓
AToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(
store
.
storeR
unStatus
!=
StoreRunStatus
.
Wait
)
if
(
store
.
r
unStatus
!=
StoreRunStatus
.
Wait
)
{
MessageBox
.
Show
(
store
.
Name
+
"当前状态:"
+
store
.
storeR
unStatus
+
",不能启动!"
);
MessageBox
.
Show
(
store
.
Name
+
"当前状态:"
+
store
.
r
unStatus
+
",不能启动!"
);
return
;
}
LogUtil
.
info
(
"开始启动"
);
...
...
@@ -203,7 +203,7 @@ namespace OnlineStore.DUOStore
void
timer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
startTimer
.
Enabled
=
false
;
if
(
store
.
storeR
unStatus
>
StoreRunStatus
.
Wait
)
if
(
store
.
r
unStatus
>
StoreRunStatus
.
Wait
)
{
return
;
}
...
...
@@ -253,7 +253,7 @@ namespace OnlineStore.DUOStore
{
if
(
store
!=
null
)
{
if
(
store
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
store
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
MessageBox
.
Show
(
store
.
Name
+
"DUO料仓未启动,不需要停止"
);
return
;
...
...
@@ -268,7 +268,7 @@ namespace OnlineStore.DUOStore
private
void
复位
RToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(
store
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
store
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
MessageBox
.
Show
(
store
.
Name
+
"DUO料仓未启动,无法复位"
);
return
;
...
...
source/DeviceLibrary/StoreConfig/StoreConfig.csv
查看文件 @
aece1f1
...
...
@@ -102,13 +102,15 @@ PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,4000,,,,, ,,,,,,,
PRO,0,T1_提升轴P1速度,BatchAxis_P1Speed,4000,,,,,,,,,,,,
PRO,0,T1_提升轴P2速度,BatchAxis_P2Speed,500,,,,, ,,,,,,,
PRO,0,T1_提升轴高度转换系数(1mm对应的脉冲),BatchAxis_ChangeValue,11000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
T2_旋转轴_料串取放料点P4:
PRO,0,T2_旋转轴待机点/取放料点 P1,MiddleAxis_P1,5000,,,,,,,,,,,,
PRO,0,T2_旋转轴左侧料仓取放料点_P2,MiddleAxis_P2,59000,,,,,,,,,,,,
PRO,0,T2_旋转轴右侧料仓取放料点_P3,MiddleAxis_P3,59000,,,,,,,,,,,,
PRO,0,T2_旋转轴左侧料仓取放料点_P2,MiddleAxis_P2,59002,,,,,,,,,,,,
PRO,0,T2_旋转轴右侧料仓取放料点_P3,MiddleAxis_P3,59003,,,,,,,,,,,,
PRO,0,T2_旋转轴_料串取放料点_P4,MiddleAxis_P4,59004,,,,,,,,,,,,
PRO,0,T2_旋转轴P1速度,MiddleAxis_P1Speed,500,,,,,,,,,,,,
PRO,0,T2_旋转轴P2速度,MiddleAxis_P2Speed,500,,,,,,,,,,,,
PRO,0,T2_旋转轴P3速度,MiddleAxis_P3Speed,500,,,,,,,,,,,,
PRO,0,T2_旋转轴P4速度,MiddleAxis_P4Speed,500,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料低点 P1,UpdownAxis_P1,5000,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料高点 P2,UpdownAxis_P2,5001,,,,,,,,,,,,
...
...
source/DeviceLibrary/device/halcon/CodeManager.cs
查看文件 @
aece1f1
...
...
@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
,
bool
isSaveImg
=
false
)
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
,
int
timeOut
=
1500
)
{
if
(
codeCount
<
1
)
{
...
...
@@ -142,7 +142,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
code
Count
,
GetCodeParamFilePath
(
codeType
),
codeType
);
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
code
Type
,
GetCodeParamFilePath
(
codeType
),
codeCount
,
timeOut
);
}
foreach
(
CodeInfo
c
in
cc
)
{
...
...
source/DeviceLibrary/duoStore/AxisBean.cs
查看文件 @
aece1f1
...
...
@@ -135,11 +135,30 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
string
clearMsg
=
""
;
//判断轴是否报警
if
(
MoveInfo
.
CanWhileCount
<=
3
)
{
int
isAlarm
=
ACServerManager
.
GetAlarmStatus
(
deviceName
,
axisNo
);
if
(
isAlarm
.
Equals
(
1
))
{
clearMsg
=
"清理报警,"
;
ACServerManager
.
AlarmClear
(
deviceName
,
axisNo
);
Thread
.
Sleep
(
200
);
ACServerManager
.
ServoOn
(
deviceName
,
axisNo
);
Thread
.
Sleep
(
500
);
}
}
if
(
String
.
IsNullOrEmpty
(
clearMsg
))
{
ACServerManager
.
SuddenStop
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
Thread
.
Sleep
(
100
);
}
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
"],误差过大,"
+
clearMsg
+
"重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
ACServerManager
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
MoveInfo
.
CanWhileCount
--;
Thread
.
Sleep
(
200
);
}
else
{
...
...
@@ -253,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
return
true
;
}
public
bool
AxisStop
CheckMove
()
public
bool
StopAxis
CheckMove
()
{
if
(!(
axisCheckTimer
==
null
))
{
...
...
@@ -274,7 +293,7 @@ namespace OnlineStore.DeviceLibrary
lastOkTime
=
DateTime
.
Now
;
if
(
IOManager
.
IOValue
(
TargetIoType
,
0
).
Equals
(
TargetIoValue
))
{
AxisStop
CheckMove
();
StopAxis
CheckMove
();
LogUtil
.
info
(
AxisName
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",停止运动"
);
SuddenStop
();
}
...
...
source/DeviceLibrary/duoStore/BoxBean.cs
查看文件 @
aece1f1
...
...
@@ -81,7 +81,7 @@ namespace OnlineStore.DeviceLibrary
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
//判断急停
if
(
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -133,7 +133,7 @@ namespace OnlineStore.DeviceLibrary
}
//TODO 启动时先所有轴远点返回,测试暂时关闭
storeR
unStatus
=
StoreRunStatus
.
HomeMoving
;
r
unStatus
=
StoreRunStatus
.
HomeMoving
;
storeStatus
=
StoreStatus
.
ResetMove
;
//启动温湿度服务器
HumitureController
.
Init
(
Config
.
Humiture_Port
);
...
...
@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
lastPosId
=
""
;
lastPosIdStatus
=
StoreStatus
.
ResetMove
;
AutoInout
.
ClearCount
();
storeR
unStatus
=
StoreRunStatus
.
HomeMoving
;
r
unStatus
=
StoreRunStatus
.
HomeMoving
;
MoveInfo
.
NewMove
(
MoveType
.
ReturnHome
);
InoutStartReset
();
}
...
...
@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
{
AutoInout
.
StopAuto
();
}
storeR
unStatus
=
StoreRunStatus
.
Reset
;
r
unStatus
=
StoreRunStatus
.
Reset
;
storeStatus
=
StoreStatus
.
ResetMove
;
MoveInfo
.
NewMove
(
MoveType
.
Reset
);
...
...
@@ -279,7 +279,7 @@ namespace OnlineStore.DeviceLibrary
serverConTimer
.
Enabled
=
false
;
StopMove
();
storeR
unStatus
=
StoreRunStatus
.
Wait
;
r
unStatus
=
StoreRunStatus
.
Wait
;
mainTimer
.
Enabled
=
false
;
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
LogInfo
(
",停止运行,总运行时间:"
+
span
.
ToString
());
...
...
@@ -301,7 +301,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess
();
ShowTimeLog
(
"BusyMoveProcess"
);
}
else
if
(
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
else
if
(
r
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
ShowTimeLog
(
"判断是否需要出入库"
);
AutoResetProcess
();
...
...
@@ -310,7 +310,7 @@ namespace OnlineStore.DeviceLibrary
ShowTimeLog
(
"IOTimeOutProcess"
);
}
//检查运动轴报警
if
(
storeR
unStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
if
(
r
unStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
{
ShowTimeLog
(
"开始检测轴报警"
);
CheckAxisAlarm
(
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
...
...
@@ -331,7 +331,7 @@ namespace OnlineStore.DeviceLibrary
bool
noInStore
=
true
;
if
(
AutoInout
.
CurrInOutACount
>=
StoreManager
.
Config
.
Box_ResetACount
&&
noInStore
)
{
if
(
storeR
unStatus
<
StoreRunStatus
.
Runing
||
MoveInfo
.
MoveType
==
MoveType
.
InStore
||
MoveInfo
.
MoveType
==
MoveType
.
OutStore
)
if
(
r
unStatus
<
StoreRunStatus
.
Runing
||
MoveInfo
.
MoveType
==
MoveType
.
InStore
||
MoveInfo
.
MoveType
==
MoveType
.
OutStore
)
{
// LogInfo("已经累计出入库" + AutoInout.CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
}
...
...
@@ -389,7 +389,7 @@ namespace OnlineStore.DeviceLibrary
public
string
GetMoveStr
()
{
string
msg
=
""
;
msg
+=
"状态: "
+
storeR
unStatus
+
" "
+
storeStatus
+
"\n"
;
msg
+=
"状态: "
+
r
unStatus
+
" "
+
storeStatus
+
"\n"
;
// msg += "lineS: " + storeStatus + "\n";
msg
+=
"报警: "
+
alarmType
+
"\n"
;
msg
+=
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
SLog
+
"\n"
;
...
...
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
查看文件 @
aece1f1
...
...
@@ -16,121 +16,9 @@ namespace OnlineStore.DeviceLibrary
{
public
ConcurrentQueue
<
InOutParam
>
waitOutStoreList
=
new
ConcurrentQueue
<
InOutParam
>();
// public InOutParam waitOutStoreList = null;
#
region
出入库结果验证
private
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
MoveInfo
.
WaitList
;
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
MoveInfo
.
LastSetpTime
;
string
NotOkMsg
=
""
;
if
(
list
.
Count
<=
0
)
{
MoveInfo
.
EndStepWait
();
return
;
}
bool
isOk
=
true
;
if
(
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
}
foreach
(
WaitResultInfo
wait
in
list
)
{
if
(
wait
.
IsEnd
)
{
continue
;
}
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
{
string
msg
=
""
;
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
AxisBean
.
HomeMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
out
msg
);
}
else
{
wait
.
IsEnd
=
AxisBean
.
ACAxisMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
}
if
(!
msg
.
Equals
(
""
))
{
isOk
=
false
;
WarnMsg
=
msg
;
Alarm
(
AlarmType
.
AxisMoveError
,
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
MoveInfo
.
MoveType
);
break
;
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_08_WaitLineIn
)
||
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_04_WaitTakeSingle
))
{
timeOutMs
=
30000
;
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_03_LineRun
))
{
timeOutMs
=
40000
;
}
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
;
Alarm
(
AlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
logType
+
14
);
if
(!
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
if
(
wait
.
IsEnd
)
{
if
(
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
if
(
isOk
)
{
MoveInfo
.
EndStepWait
();
}
else
if
(
span
.
TotalSeconds
>
MoveInfo
.
TimeOutSeconds
)
{
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
int
second
=
10
;
second
=
(
int
)(
MoveInfo
.
TimeOutSeconds
/
span
.
TotalSeconds
)
*
10
;
if
(
second
>
120
)
{
second
=
120
;
}
else
if
(
second
<
10
)
{
second
=
10
;
}
LogUtil
.
error
(
WarnMsg
,
logType
+
100
,
second
);
Alarm
(
AlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
MoveInfo
.
MoveType
);
}
}
#
region
出入库结果验证
private
bool
AcInPosition
(
ConfigMoveAxis
axis
,
int
p
)
{
return
ACServerManager
.
isInPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
p
,
axis
.
CanErrorCountMax
);
...
...
@@ -149,10 +37,44 @@ namespace OnlineStore.DeviceLibrary
InoutAxis
.
AbsMove
(
MoveInfo
,
InOut_P1
,
Config
.
InOutAxis_P1_Speed
);
}
}
#
endregion
/// <summary>
///是否已经接收到过出库信息
///</summary>
public
bool
IsReviceInPosId
(
string
posId
)
{
bool
isReviceInfo
=
false
;
try
{
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
)
&&
MoveInfo
.
MoveParam
!=
null
&&
MoveInfo
.
MoveParam
.
PosID
.
Equals
(
posId
))
{
LogInfo
(
" IsReviceInPosId 正在入库中:"
+
MoveInfo
.
MoveParam
.
ToStr
());
isReviceInfo
=
true
;
}
if
(!
isReviceInfo
&&.
Count
>
0
)
{
//foreach (InOutParam inout in waitOutStoreList)
//{
// if (inout.PosID.Equals(posId) && (!inout.WareCode.Equals("")))
// {
// LogInfo(" IsReviceInPosId 已存在入库任务:" + inout.ToStr());
// isReviceInfo = true;
// break;
// }
//}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"IsReviceInPosId【"
+
posId
+
"】出错:"
+
ex
.
ToString
());
}
return
isReviceInfo
;
}
#
endregion
#
region
入库
private
DateTime
startInStoreTime
=
DateTime
.
Now
;
public
override
void
StartInStoreMove
(
InOutParam
param
)
...
...
@@ -160,10 +82,10 @@ namespace OnlineStore.DeviceLibrary
startInStoreTime
=
DateTime
.
Now
;
string
posId
=
param
!=
null
?
param
.
PosID
:
""
;
if
(
isInSuddenDown
||
isNoAirCheck
||
(!
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
(!
r
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
||
(!
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
)))
{
LogUtil
.
error
(
Name
+
" 启动出库出错,忙碌或报警中 ,storeStatus="
+
storeR
unStatus
+
",MoveType="
+
MoveInfo
.
MoveType
+
",isInSuddenDown="
+
isInSuddenDown
+
",isNoAirCheck"
+
isNoAirCheck
);
LogUtil
.
error
(
Name
+
" 启动出库出错,忙碌或报警中 ,storeStatus="
+
r
unStatus
+
",MoveType="
+
MoveInfo
.
MoveType
+
",isInSuddenDown="
+
isInSuddenDown
+
",isNoAirCheck"
+
isNoAirCheck
);
return
;
}
...
...
@@ -173,7 +95,7 @@ namespace OnlineStore.DeviceLibrary
return
;
}
LogInfo
(
" 启动入库【"
+
param
.
ToStr
()
+
"】 "
);
storeR
unStatus
=
StoreRunStatus
.
Busy
;
r
unStatus
=
StoreRunStatus
.
Busy
;
if
(
param
.
TargetPosition
.
Equals
(
0
))
{
storeStatus
=
StoreStatus
.
InStoreExecute
;
...
...
@@ -370,10 +292,10 @@ namespace OnlineStore.DeviceLibrary
string
posId
=
param
!=
null
?
param
.
PosID
:
""
;
if
(
isInSuddenDown
||
isNoAirCheck
||
(!
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
(!
r
unStatus
.
Equals
(
StoreRunStatus
.
Runing
))
||
(!
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
)))
{
LogUtil
.
error
(
Name
+
" 启动出库【"
+
param
.
ToStr
()
+
"】失败,忙碌或报警中 ,storeStatus:"
+
storeR
unStatus
+
",MoveType:"
+
MoveInfo
.
MoveType
+
",isInSuddenDown:"
+
isInSuddenDown
+
",isNoAirCheck:"
+
isNoAirCheck
);
LogUtil
.
error
(
Name
+
" 启动出库【"
+
param
.
ToStr
()
+
"】失败,忙碌或报警中 ,storeStatus:"
+
r
unStatus
+
",MoveType:"
+
MoveInfo
.
MoveType
+
",isInSuddenDown:"
+
isInSuddenDown
+
",isNoAirCheck:"
+
isNoAirCheck
);
return
false
;
}
...
...
@@ -384,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
storeR
unStatus
=
StoreRunStatus
.
Busy
;
r
unStatus
=
StoreRunStatus
.
Busy
;
MoveInfo
.
NewMove
(
MoveType
.
OutStore
,
param
);
LogInfo
(
"启动出库【"
+
param
.
ToStr
()
+
"】 "
);
//出库前shelfPosID需要固定,出库时根据rfid判断是否需要出入料架
...
...
source/DeviceLibrary/duoStore/BoxBean_Shelf.cs
查看文件 @
aece1f1
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/duoStore/DUOStoreBean.cs
查看文件 @
aece1f1
...
...
@@ -20,8 +20,10 @@ namespace OnlineStore.DeviceLibrary
public
Dictionary
<
int
,
BoxBean
>
BoxMap
=
new
Dictionary
<
int
,
BoxBean
>();
public
Store_Config
Config
{
get
;
set
;
}
public
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
public
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
/// <summary>
/// 取料提升机构
/// </summary>
public
HoisterCylinder
hoisterCylinder
=
new
HoisterCylinder
(
0
);
public
AxisBean
T1_BatchAxis
=
null
;
public
AxisBean
T2_MiddleAxis
=
null
;
...
...
@@ -123,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil
.
info
(
Name
+
"开始启动 ,启动时间:"
+
StartTime
.
ToString
());
storeR
unStatus
=
StoreRunStatus
.
HomeMoving
;
r
unStatus
=
StoreRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
StartResetMove
();
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
...
...
@@ -144,7 +146,7 @@ namespace OnlineStore.DeviceLibrary
//停止运动
MoveInfo
.
EndMove
();
storeR
unStatus
=
StoreRunStatus
.
Reset
;
r
unStatus
=
StoreRunStatus
.
Reset
;
StartResetMove
();
...
...
@@ -249,7 +251,7 @@ namespace OnlineStore.DeviceLibrary
string
msg
=
"等待BOX复位完成超时"
;
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
{
if
((
box
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
box
.
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Reset
)))
if
((
box
.
runStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
box
.
r
unStatus
.
Equals
(
StoreRunStatus
.
Reset
)))
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{
if
(
box
.
alarmType
.
Equals
(
AlarmType
.
None
))
...
...
@@ -301,7 +303,7 @@ namespace OnlineStore.DeviceLibrary
{
equip
.
StopRun
();
}
storeR
unStatus
=
StoreRunStatus
.
Wait
;
r
unStatus
=
StoreRunStatus
.
Wait
;
// RFIDManager.Close();
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
LogUtil
.
info
(
Name
+
",停止运行,关闭rfid,总运行时间:"
+
span
.
ToString
());
...
...
@@ -328,9 +330,9 @@ namespace OnlineStore.DeviceLibrary
{
isInOut
=
true
;
}
if
(
box
.
storeR
unStatus
>
runs
)
if
(
box
.
r
unStatus
>
runs
)
{
runs
=
box
.
storeR
unStatus
;
runs
=
box
.
r
unStatus
;
}
}
...
...
@@ -454,7 +456,7 @@ namespace OnlineStore.DeviceLibrary
try
{
DateTime
time
=
DateTime
.
Now
;
if
(
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
r
unStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
//取新的Io状态
IO_VALUE
autoSingle
=
IOValue
(
IO_Type
.
Reset_BTN
);
...
...
@@ -477,7 +479,7 @@ namespace OnlineStore.DeviceLibrary
lastAutoRun
=
autoSingle
;
}
//判断急停
else
if
(
storeR
unStatus
>=
StoreRunStatus
.
HomeMoving
)
else
if
(
r
unStatus
>=
StoreRunStatus
.
HomeMoving
)
{
//急停按钮
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -526,14 +528,19 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess
();
ShowTimeLog
(
"BusyMoveProcess"
);
}
else
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
ShowTimeLog
(
"AutoResetProcess"
);
else
if
(
runStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
IOTimeOutProcess
();
ShowTimeLog
(
"IOTimeOutProcess"
);
}
//检查运动轴报警
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
//判断是否需要处理料架入库
StartInStoreP
();
}
//检查运动轴报警
if
(
runStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
{
ShowTimeLog
(
"开始检测轴报警"
);
CheckAxisAlarm
(
new
AxisBean
[]
{
T1_BatchAxis
,
T2_MiddleAxis
,
T3_UpdownAxis
});
...
...
@@ -559,7 +566,7 @@ namespace OnlineStore.DeviceLibrary
return
num
;
}
public
void
LineRun
(
StoreMoveInfo
move
)
public
void
LineRun
(
StoreMoveInfo
move
=
null
)
{
if
(
move
!=
null
)
{
...
...
@@ -570,7 +577,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
HIGH
);
}
public
void
LineStop
(
StoreMoveInfo
move
)
public
void
LineStop
(
StoreMoveInfo
move
=
null
)
{
if
(
move
!=
null
)
{
...
...
source/DeviceLibrary/duoStore/DUOStoreBean_Partial.cs
查看文件 @
aece1f1
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/duoStore/EquipBase.cs
查看文件 @
aece1f1
...
...
@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
{
return
;
}
if
(
storeR
unStatus
<
StoreRunStatus
.
Runing
||
isInSuddenDown
||
isNoAirCheck
)
if
(
r
unStatus
<
StoreRunStatus
.
Runing
||
isInSuddenDown
||
isNoAirCheck
)
{
return
;
}
...
...
@@ -136,7 +136,7 @@ namespace OnlineStore.DeviceLibrary
}
TimeSpan
span
=
DateTime
.
Now
-
checkAlarmTime
;
//在回原点,复位,出入库时,检测报警间隔减小
if
((
storeR
unStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
span
.
TotalSeconds
<
3
)
||
span
.
TotalSeconds
<
1
)
if
((
r
unStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
span
.
TotalSeconds
<
3
)
||
span
.
TotalSeconds
<
1
)
{
return
false
;
}
...
...
@@ -165,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
internal
void
MoveEndP
()
{
MoveInfo
.
EndMove
();
storeR
unStatus
=
StoreRunStatus
.
Runing
;
r
unStatus
=
StoreRunStatus
.
Runing
;
storeStatus
=
StoreStatus
.
StoreOnline
;
if
(
alarmType
.
Equals
(
AlarmType
.
None
))
{
...
...
@@ -194,7 +194,10 @@ namespace OnlineStore.DeviceLibrary
{
if
(
wait
.
IsEnd
)
{
continue
;
if
(!
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
continue
;
}
}
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
...
...
@@ -220,18 +223,23 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
if
(!
wait
.
IsEnd
)
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
;
Alarm
(
AlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
logType
+
14
);
if
(!
MoveInfo
.
OneWaitCanEndStep
)
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
Line_BackRun
)
||
wait
.
IoType
.
Equals
(
IO_Type
.
Line_Run
))
{
isOk
=
false
;
break
;
IOMove
(
wait
.
IoType
,
wait
.
IoValue
);
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
;
Alarm
(
AlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
logType
+
14
);
if
(!
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
}
...
...
@@ -239,6 +247,10 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
{
wait
.
IsEnd
=
CheckWaitResult
(
MoveInfo
,
wait
);
}
if
(
wait
.
IsEnd
)
{
if
(
MoveInfo
.
OneWaitCanEndStep
)
...
...
@@ -279,6 +291,10 @@ namespace OnlineStore.DeviceLibrary
Alarm
(
AlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
MoveInfo
.
MoveType
);
}
}
protected
virtual
bool
CheckWaitResult
(
StoreMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
return
false
;
}
#
endregion
}
...
...
source/DeviceLibrary/duoStore/HoisterCylinder.cs
查看文件 @
aece1f1
...
...
@@ -135,5 +135,15 @@ namespace OnlineStore.DeviceLibrary
}
return
Start
(
IO_Type
.
Hoister_Forward
,
IO_Type
.
Hoister_Forward
);
}
public
bool
IsBack
()
{
if
(
IOManager
.
IOValue
(
IO_Type
.
Hoister_Back
,
subType
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Hoister_Forward
,
subType
).
Equals
(
IO_VALUE
.
LOW
))
{
return
true
;
}
return
false
;
}
}
}
source/DeviceLibrary/duoStore/StoreManager.cs
查看文件 @
aece1f1
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/InOutParam.cs
查看文件 @
aece1f1
...
...
@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary
{
public
class
InOutParam
{
public
InOutParam
(
string
wareNo
=
""
,
string
posId
=
""
,
string
platew
=
""
,
string
plateh
=
""
,
int
targetP
=
0
)
public
InOutParam
(
string
wareNo
=
""
,
string
posId
=
""
,
int
platew
=
0
,
int
plateh
=
0
,
int
targetP
=
0
,
int
shefNum
,
bool
IsNg
=
false
,
string
ngMsg
=
""
)
{
WareCode
=
wareNo
;
PosID
=
posId
;
...
...
@@ -20,6 +20,9 @@ namespace OnlineStore.DeviceLibrary
this
.
PlateW
=
platew
;
this
.
PlateH
=
plateh
;
this
.
TargetPosition
=
targetP
;
this
.
shelfNum
=
shefNum
;
this
.
InStoreNg
=
IsNg
;
this
.
NgMsg
=
ngMsg
;
}
public
InOutParam
(
string
wareNo
,
string
posId
,
LineMoveP
linePosition
,
int
targetP
=
0
)
{
...
...
@@ -47,11 +50,25 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料盘高度
/// </summary>
public
string
PlateH
{
get
;
set
;
}
public
int
PlateH
{
get
;
set
;
}
/// <summary>
/// 料盘宽度
/// </summary>
public
string
PlateW
{
get
;
set
;
}
public
int
PlateW
{
get
;
set
;
}
/// <summary>
/// 是否是入料NG料
/// </summary>
public
bool
InStoreNg
=
false
;
/// <summary>
/// 入料NG消息
/// </summary>
public
string
NgMsg
=
""
;
/// <summary>
/// 料架编号
/// </summary>
public
int
shelfNum
=
0
;
/// <summary>
/// 出入库目标位置,
/// 0=出库表示批量出料,入库表示目标库位
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
aece1f1
...
...
@@ -8,7 +8,7 @@ using System.Drawing;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
...
...
@@ -223,7 +223,7 @@ namespace OnlineStore.DeviceLibrary
isInit
=
true
;
}
}
public
StoreRunStatus
storeR
unStatus
public
StoreRunStatus
r
unStatus
{
get
{
...
...
@@ -261,7 +261,7 @@ namespace OnlineStore.DeviceLibrary
{
string
sta
=
"运行中"
;
string
aa
=
""
;
switch
(
storeR
unStatus
)
switch
(
r
unStatus
)
{
case
StoreRunStatus
.
Busy
:
sta
=
"忙碌"
;
...
...
@@ -279,7 +279,7 @@ namespace OnlineStore.DeviceLibrary
sta
=
"等待启动"
;
break
;
}
if
(
storeR
unStatus
>
StoreRunStatus
.
Wait
)
if
(
r
unStatus
>
StoreRunStatus
.
Wait
)
{
//"0":"急停中", "1":"设备联机", "2":"故障中", "3":"入库执行中", "4":"出库执行中", 5":"料盘入仓位完成", "6":"料盘出仓位完成", 7":"设备调试中",
switch
(
storeStatus
)
...
...
@@ -344,14 +344,38 @@ namespace OnlineStore.DeviceLibrary
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoHighType
,
IO_VALUE
.
HIGH
));
}
}
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
,
bool
isCheck
=
false
)
//public void IOMove(string IoType, IO_VALUE value, bool isCheck = false)
//{
// if (isCheck && (IOValue(IoType).Equals(value)))
// {
// return;
// }
// IOManager.IOMove(IoType, value, baseConfig.Id);
//}
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
,
bool
isCheck
=
false
,
int
msTime
=
0
)
{
if
(
isCheck
&&
(
IOValue
(
IoType
).
Equals
(
value
))
)
if
(
msTime
<=
0
)
{
return
;
if
(
isCheck
&&
(
IOValue
(
IoType
).
Equals
(
value
)))
{
return
;
}
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
Id
);
}
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
Id
);
}
else
{
Task
.
Factory
.
StartNew
(
delegate
{
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
Id
);
Thread
.
Sleep
(
msTime
);
IO_VALUE
tValue
=
value
.
Equals
(
IO_VALUE
.
HIGH
)
?
IO_VALUE
.
LOW
:
IO_VALUE
.
HIGH
;
LogUtil
.
info
(
Name
+
"定时回写IO: ["
+
IoType
+
"]=["
+
value
+
"],["
+
baseConfig
.
Id
+
"],msTime="
+
msTime
);
IOManager
.
IOMove
(
IoType
,
tValue
,
baseConfig
.
Id
);
});
}
}
public
IO_VALUE
IOValue
(
string
IoType
)
{
return
IOManager
.
IOValue
(
IoType
,
baseConfig
.
Id
);
...
...
@@ -369,13 +393,27 @@ namespace OnlineStore.DeviceLibrary
protected
void
InOutStoreLog
(
string
msg
)
{
string
type
=
""
;
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
)
)
if
(
ID
>
0
)
{
type
=
"出库"
;
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
{
type
=
"出库"
;
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
{
type
=
"入库"
;
}
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
else
{
type
=
"入库"
;
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
{
type
=
"出料"
;
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
{
type
=
"入料"
;
}
}
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
"["
+
MoveInfo
.
MoveParam
.
PosID
+
"]"
:
""
;
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
aece1f1
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
aece1f1
...
...
@@ -183,10 +183,10 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
public
static
WaitResultInfo
Wait
ComAxis
(
ConfigMoveAxis
axis
,
int
targetPosition
,
int
targetSpeed
)
public
static
WaitResultInfo
Wait
BatchAxisMove
(
ConfigMoveAxis
axis
,
int
targetPosition
,
int
targetSpeed
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W008_
Compres
s
;
wait
.
WaitType
=
WaitEnum
.
W008_
BatchAxi
s
;
wait
.
AxisInfo
=
axis
;
wait
.
IsHomeMove
=
false
;
wait
.
TargetPosition
=
targetPosition
;
...
...
@@ -194,7 +194,7 @@ namespace OnlineStore.DeviceLibrary
return
wait
;
}
internal
static
WaitResultInfo
WaitCode
()
internal
static
WaitResultInfo
Wait
Scan
Code
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W009_ScanCode
;
...
...
@@ -251,9 +251,9 @@ namespace OnlineStore.DeviceLibrary
{
return
"料盘高度【"
+
TargetPosition
+
"】 "
;
}
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W008_
Compres
s
))
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W008_
BatchAxi
s
))
{
return
"
压紧轴压紧到位
"
;
return
"
批量轴上升到上料点
"
;
}
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W009_ScanCode
))
{
...
...
@@ -319,8 +319,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
IsEnd
{
get
;
set
;
}
public
int
AgvAction
=
0
;
}
internal
class
WaitEnum
{
...
...
@@ -353,9 +352,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
internal
static
int
W007_ReelHeight
=
7
;
/// <summary>
///
压紧轴压紧到位
///
批量轴上升到上料点
/// </summary>
internal
static
int
W008_
Compres
s
=
8
;
internal
static
int
W008_
BatchAxi
s
=
8
;
/// <summary>
/// 扫码完成
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/Store_Config.cs
查看文件 @
aece1f1
...
...
@@ -167,6 +167,11 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"MiddleAxis_P3"
)]
public
int
MiddleAxis_P3
{
get
;
set
;
}
/// <summary>
/// PRO,0,T2_旋转轴_料串取放料点_P4,MiddleAxis_P4,59004
/// </summary>
[
ConfigProAttribute
(
"MiddleAxis_P4"
)]
public
int
MiddleAxis_P4
{
get
;
set
;
}
/// <summary>
/// PRO,0,T2_旋转轴P1速度,MiddleAxis_P1Speed,500
/// </summary>
[
ConfigProAttribute
(
"MiddleAxis_P1Speed"
)]
...
...
@@ -180,7 +185,12 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO,0,T2_旋转轴P3速度,MiddleAxis_P3Speed,500
/// </summary>
[
ConfigProAttribute
(
"MiddleAxis_P3Speed"
)]
public
int
MiddleAxis_P3Speed
{
get
;
set
;
}
public
int
MiddleAxis_P3Speed
{
get
;
set
;
}
/// <summary>
/// PRO,0,T2_旋转轴P4速度,MiddleAxis_P4Speed,500
/// </summary>
[
ConfigProAttribute
(
"MiddleAxis_P4Speed"
)]
public
int
MiddleAxis_P4Speed
{
get
;
set
;
}
/// <summary>
/// PRO,0,T3_升降轴料串取放料低点 P1,UpdownAxis_P1,5000
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论