Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20031_TinStorage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 82303d25
由
刘韬
编写于
2022-12-23 10:53:38 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
1fb8f362
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
328 行增加
和
163 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/CameraPointTest.cs
DeviceLibrary/theMachine/JobList.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Labeling.cs
DeviceLibrary/theMachine/MainMachine_StoreDemo.cs
DeviceLibrary/theMachine/RobotManage.cs
DeviceLibrary/userControl/AxisMoveControl.Designer.cs
DeviceLibrary/userControl/AxisMoveControl.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/IOControls.Designer.cs
TheMachine/IOControls.cs
TheMachine/SettingControl.Designer.cs
Common/Setting_Init.cs
查看文件 @
82303d2
...
...
@@ -83,6 +83,8 @@ namespace OnlineStore.Common
public
static
MyConfig
<
Runtime_StepE
>
Runtime_Step
=
Runtime_StepE
.
None
;
public
static
MyConfig
<
string
>
Runtime_Posid
=
""
;
public
static
MyConfig
<
string
>
Runtime_RFID
=
""
;
public
static
MyConfig
<
string
>
Runtime_PN
=
""
;
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
82303d2
...
...
@@ -401,7 +401,7 @@ namespace DeviceLibrary
return
map
;
if
(
IOManager
.
IOValue
(
IO_Type
.
Entry_Drawer
).
Equals
(
IO_VALUE
.
LOW
))
{
map
.
Add
(
ParamDefine
.
inDoorStatus
,
ParamDefine
.
disable
)
;
map
[
ParamDefine
.
inDoorStatus
]=
ParamDefine
.
disable
;
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Entry_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
...
...
@@ -414,7 +414,7 @@ namespace DeviceLibrary
}
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
LOW
))
{
map
.
Add
(
ParamDefine
.
outDoorStatus
,
ParamDefine
.
disable
)
;
map
[
ParamDefine
.
outDoorStatus
]=
ParamDefine
.
disable
;
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
...
...
@@ -443,7 +443,7 @@ namespace DeviceLibrary
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string
posId
=
data
[
ParamDefine
.
posId
].
ToString
();
string
usedCountstr
=
data
[
"usedCount"
].
ToString
();
//int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
ACStorePosition
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
posId
);
...
...
@@ -455,12 +455,14 @@ namespace DeviceLibrary
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
}
int
usedCount
=
0
;
int
.
TryParse
(
usedCountstr
,
out
usedCount
);
WarnMsg
=
""
;
JobInfo
inStoreJob
=
new
JobInfo
(
message
,
posId
);
RobotManage
.
mainMachine
.
LabelingMoveInfo
.
MoveParam
.
PosID
=
inStoreJob
.
PosId
;
RobotManage
.
mainMachine
.
LabelingMoveInfo
.
MoveParam
.
usedCount
=
usedCount
;
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
LogUtil
.
info
(
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"
,usedCount"
+
usedCount
+
"
】二维码【"
+
message
+
"】 开始入库!"
);
}
else
...
...
DeviceLibrary/theMachine/CameraPointTest.cs
查看文件 @
82303d2
...
...
@@ -20,7 +20,7 @@ namespace DeviceLibrary
[
Serializable
]
public
class
tstoredata
{
public
string
name
=
""
;
public
List
<
int
>
V
alue
=
new
List
<
int
>();
public
List
<
int
>
v
alue
=
new
List
<
int
>();
}
public
class
CameraPointTest
{
...
...
@@ -36,14 +36,14 @@ namespace DeviceLibrary
inArea
[
i
].
name
=
"L"
+
((
char
)(
0x41
+
i
)).
ToString
();
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
inArea
[
i
].
V
alue
.
Add
(-
1
);
inArea
[
i
].
v
alue
.
Add
(-
1
);
}
}
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
outArea
.
Add
(
new
tstoredata
());
outArea
[
i
].
name
=
"U"
+
((
char
)(
0x41
+
i
)).
ToString
();
outArea
[
i
].
V
alue
.
Add
(-
1
);
outArea
[
i
].
v
alue
.
Add
(-
1
);
}
}
public
static
event
EventHandler
<
Bitmap
>
TestStorePointEvent
;
...
...
@@ -66,7 +66,7 @@ namespace DeviceLibrary
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
inArea
[
i
].
V
alue
[
j
]=
haslistindex
[
index
];
inArea
[
i
].
v
alue
[
j
]=
haslistindex
[
index
];
index
++;
}
}
...
...
@@ -77,7 +77,7 @@ namespace DeviceLibrary
index
=
0
;
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
outArea
[
i
].
V
alue
[
0
]=
haslistindex
[
index
];
outArea
[
i
].
v
alue
[
0
]=
haslistindex
[
index
];
index
++;
}
break
;
...
...
DeviceLibrary/theMachine/JobList.cs
查看文件 @
82303d2
...
...
@@ -46,8 +46,7 @@ namespace DeviceLibrary
public
int
Count
{
get
=>
jobInfos
.
Count
;
}
public
void
ClearLastPosid
(
string
posid
)
{
if
(
lastoutpos
==
posid
)
public
void
ClearLastPosid
()
{
lastoutpos
=
""
;
}
}
...
...
DeviceLibrary/theMachine/LabelParam.cs
查看文件 @
82303d2
...
...
@@ -30,6 +30,7 @@ namespace DeviceLibrary
/// 库位号
/// </summary>
public
string
PosID
{
get
;
set
;
}
public
string
RFID
{
get
;
set
;
}
public
string
bitmapfilename
=
""
;
public
List
<
CodeInfo
>
codeInfos
{
get
;
set
;
}
/// <summary>
...
...
@@ -40,6 +41,7 @@ namespace DeviceLibrary
/// 料盘宽度
/// </summary>
public
int
PlateW
{
get
;
set
;
}
public
int
usedCount
{
get
;
set
;
}
/// <summary>
/// 是否是入料NG料
/// </summary>
...
...
@@ -72,6 +74,7 @@ namespace DeviceLibrary
/// </summary>
public
string
Batch
{
get
;
set
;
}
public
bool
ReelOnFixture
{
get
;
internal
set
;
}
=
false
;
public
string
OutPosID
{
get
;
internal
set
;
}
public
int
HeightPos
=
0
;
public
ReelParam
clone
()
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
82303d2
...
...
@@ -13,7 +13,7 @@ namespace DeviceLibrary
{
public
partial
class
MainMachine
:
IRobot
{
public
string
Name
{
get
;
set
;
}
=
"
MIMO_PLUS
"
;
public
string
Name
{
get
;
set
;
}
=
"
TinStore
"
;
private
bool
_canRunning
=
true
;
public
bool
canRunning
{
...
...
@@ -118,9 +118,15 @@ namespace DeviceLibrary
AlarmBuzzer
.
SetOnOffAction
(()
=>{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
Reset_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
AutoRun_Single
,
Config
,
IO_VALUE
.
HIGH
,
Run_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
Entry_Drawer
,
Config
,
IO_VALUE
.
LOW
,
Entry_Drawer_Open
,
2500
,
100
);
LedProcessInit
();
}
private
void
Entry_Drawer_Open
()
{
nglist
=
new
List
<
string
>();
}
private
(
bool
,
string
)
Y_Axis_interference
(
int
from
,
int
to
)
{
if
(
Z_Axis
.
IsInPosition
(
Config
.
Z_Axis_P1
))
{
...
...
@@ -468,7 +474,6 @@ namespace DeviceLibrary
+
crc
.
GetString
(
"Res0104"
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
SuddenStop
);
}
LogUtil
.
error
(
configMoveAxis
.
GetAxisValue
()+
","
+
configMoveAxis
.
Explain
+
" errcode "
+
HuichuanLibrary
.
HCBoardManager
.
GetAxErrCode
(
configMoveAxis
.
GetAxisValue
()));
LogUtil
.
error
(
string
.
Join
(
","
,
HuichuanLibrary
.
HCBoardManager
.
GetAxisErrorDetail
(
configMoveAxis
.
GetAxisValue
())));
ok
=
false
;
}
...
...
DeviceLibrary/theMachine/MainMachine_Labeling.cs
查看文件 @
82303d2
...
...
@@ -42,7 +42,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
Labeling03
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling04
);
RotateEquip
.
TurnDegree
(
3
6
);
RotateEquip
.
TurnDegree
(
3
0
);
//LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LabelingMoveInfo
.
log
(
"滚动锡膏"
);
break
;
...
...
@@ -63,9 +63,17 @@ namespace DeviceLibrary
if
(
HasRightCode
(
xx
.
ToArray
(),
LabelingMoveInfo
.
MoveParam
))
{
Setting_Init
.
Runtime_RFID
=
LabelingMoveInfo
.
MoveParam
.
RFID
;
LabelingMoveInfo
.
MoveParam
.
IsNg
=
false
;
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling06
);
//ServerCM.SendInStoreRequest(new string[] { LabelingMoveInfo.MoveParam.SN }, LabelingMoveInfo.MoveParam, true);
LabelingMoveInfo
.
MoveParam
.
PlateH
=
50
;
LabelingMoveInfo
.
MoveParam
.
PlateW
=
7
;
ServerCM
.
SendInStoreRequest
(
new
string
[]
{
LabelingMoveInfo
.
MoveParam
.
WareCode
},
LabelingMoveInfo
.
MoveParam
,
true
);
Setting_Init
.
Runtime_Posid
=
LabelingMoveInfo
.
MoveParam
.
PosID
;
if
(
false
&&
LabelingMoveInfo
.
MoveParam
.
usedCount
>
0
)
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling55
);
}
return
;
}
}
...
...
@@ -74,10 +82,11 @@ namespace DeviceLibrary
LabelingMoveInfo
.
MoveParam
.
IsNg
=
false
;
LabelingMoveInfo
.
MoveParam
.
WareCode
=
"Demo"
;
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling06
);
ScanTimes
=
0
;
return
;
}
ScanTimes
++;
if
(
ScanTimes
>=
1
0
)
if
(
ScanTimes
>=
1
2
)
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling06
);
LabelingMoveInfo
.
log
(
$
"未识别到有效二维码,送到NG口"
);
...
...
@@ -101,6 +110,7 @@ namespace DeviceLibrary
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling06
);
var
hc
=
CameraPointTest
.
ScanRectangle
();
LabelingMoveInfo
.
log
(
"检测到绿色宽度:"
+
hc
);
ScanTimes
++;
if
(
demomode
&&
false
)
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling08
);
...
...
@@ -110,6 +120,11 @@ namespace DeviceLibrary
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling08
);
}
else
if
(
ScanTimes
>
10
)
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling08
);
LabelingMoveInfo
.
MoveParam
.
IsNg
=
true
;
LabelingMoveInfo
.
MoveParam
.
NgMsg
=
"未找到绿色区域"
;
}
}
break
;
case
MoveStep
.
Labeling08
:
...
...
@@ -157,13 +172,13 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
Labeling12
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling13
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Down
,
IO_Type
.
Label_Dock_Up
,
IO_VALUE
.
HIGH
);
LabelingMoveInfo
.
log
(
"接标台
上升"
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
LabelingMoveInfo
.
log
(
"接标台
左移动"
);
break
;
case
MoveStep
.
Labeling13
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling14
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
LabelingMoveInfo
.
log
(
"接标台
左移动
"
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Down
,
IO_Type
.
Label_Dock_Up
,
IO_VALUE
.
HIGH
);
LabelingMoveInfo
.
log
(
"接标台
上升
"
);
break
;
case
MoveStep
.
Labeling14
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling15
);
...
...
@@ -292,7 +307,10 @@ namespace DeviceLibrary
reelParam
.
LOT
=
cs
[
3
].
Substring
(
1
);
reelParam
.
EXP
=
cs
[
4
].
Substring
(
1
);
reelParam
.
SN
=
cs
[
5
].
Substring
(
1
);
reelParam
.
WareCode
=
reelParam
.
SN
;
reelParam
.
WareCode
=
c
.
CodeStr
;
reelParam
.
ReeID
=
reelParam
.
SN
;
reelParam
.
RFID
=
reelParam
.
SN
;
return
true
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine_StoreDemo.cs
查看文件 @
82303d2
...
...
@@ -8,6 +8,7 @@ using System.Drawing;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
...
...
@@ -36,6 +37,7 @@ namespace DeviceLibrary
StoreMoveInfo
.
log
(
$
"开始入库任务"
);
}
}
List
<
string
>
nglist
=
new
List
<
string
>();
bool
demomode
=
true
;
public
void
DemoOut
()
{
...
...
@@ -67,8 +69,10 @@ namespace DeviceLibrary
}
else
if
(
Setting_Init
.
Runtime_Step
==
Runtime_StepE
.
LabelPasteFinish
)
{
StoreMoveInfo
.
log
(
"检测到上次已完成贴标:"
+
Setting_Init
.
Runtime_Step
+
","
+
Setting_Init
.
Runtime_Posid
);
StoreMoveInfo
.
log
(
"检测到上次已完成贴标:"
+
Setting_Init
.
Runtime_Step
+
","
+
Setting_Init
.
Runtime_Posid
+
","
+
Setting_Init
.
Runtime_RFID
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn03
);
StoreMoveInfo
.
MoveParam
.
PosID
=
Setting_Init
.
Runtime_Posid
;
StoreMoveInfo
.
MoveParam
.
RFID
=
Setting_Init
.
Runtime_RFID
;
}
else
if
(
Setting_Init
.
Runtime_Step
>=
Runtime_StepE
.
Printed
&&
Setting_Init
.
Runtime_Step
<
Runtime_StepE
.
LabelPasteFinish
)
...
...
@@ -78,7 +82,17 @@ namespace DeviceLibrary
//StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
Msg
.
add
(
"重置前物料正在贴标,无法继续,请手动处理"
,
MsgLevel
.
warning
,
ErrInfo
.
LabelInPaste
);
RobotManage
.
UserPause
(
"重置前物料正在贴标,无法继续,请手动处理"
);
}
else
}
else
if
(
OutStoreJobList
.
Dequeue
(
out
JobInfo
jobInfo
))
{
StoreMoveInfo
.
NewMove
(
MoveStep
.
StoreOut10
);
StoreMoveInfo
.
MoveParam
.
PosID
=
jobInfo
.
PosId
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
jobInfo
.
WareNum
;
StoreMoveInfo
.
MoveParam
.
PlateH
=
jobInfo
.
plateH
;
StoreMoveInfo
.
MoveParam
.
PlateW
=
jobInfo
.
plateW
;
StoreMoveInfo
.
log
(
$
"开始出库任务:"
+
jobInfo
.
ToStr
());
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
}
if
(
IOValue
(
IO_Type
.
Entry_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
Entry_Drawer
).
Equals
(
IO_VALUE
.
HIGH
))
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn01
);
...
...
@@ -94,7 +108,6 @@ namespace DeviceLibrary
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn02
);
var
acto
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
LabelP
);
StoreMoveInfo
.
MoveParam
.
PosID
=
Setting_Init
.
Runtime_Posid
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
true
;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
acto
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
acto
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运入贴标机构"
);
...
...
@@ -127,10 +140,16 @@ namespace DeviceLibrary
}
}
break
;
case
MoveStep
.
StoreIn01
:
string
inposid
;
var
slist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
入口
);
foreach
(
var
o
in
nglist
.
ToArray
())
{
if
(
slist
.
Contains
(
o
))
slist
.
Remove
(
o
);
}
if
(
slist
.
Count
==
0
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
...
...
@@ -147,10 +166,10 @@ namespace DeviceLibrary
var
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
inposid
);
var
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
LabelP
);
StoreMoveInfo
.
MoveParam
.
PosID
=
inposid
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
//StoreMoveInfo.MoveParam.ReelOnFixture = false;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运入贴标机构"
);
ServerCM
.
storeStatus
=
StoreStatus
.
InStoreExecute
;
break
;
case
MoveStep
.
StoreIn02
:
if
(
boxTransport
.
IsComplateOrFree
)
...
...
@@ -170,7 +189,8 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn03
:
if
(
LabelingMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
if
(
demomode
)
StoreMoveInfo
.
MoveParam
=
LabelingMoveInfo
.
MoveParam
.
clone
();
if
(
demomode
&&
string
.
IsNullOrEmpty
(
LabelingMoveInfo
.
MoveParam
.
PosID
))
{
string
outposid
=
""
;
var
olist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
下层右侧
);
...
...
@@ -186,7 +206,8 @@ namespace DeviceLibrary
outposid
=
olist
[
0
];
StoreMoveInfo
.
log
(
$
"检测到库位有料:{outposid}, 其他有料库位:{string.Join("
,
", olist)}"
);
}
LabelingMoveInfo
.
MoveParam
.
PosID
=
outposid
;
if
(
string
.
IsNullOrEmpty
(
LabelingMoveInfo
.
MoveParam
.
PosID
))
LabelingMoveInfo
.
MoveParam
.
PosID
=
outposid
;
}
if
(
string
.
IsNullOrEmpty
(
LabelingMoveInfo
.
MoveParam
.
PosID
))
...
...
@@ -195,16 +216,17 @@ namespace DeviceLibrary
StoreMoveInfo
.
log
(
$
"等待服务器返回库位"
);
return
;
}
StoreMoveInfo
.
MoveParam
=
LabelingMoveInfo
.
MoveParam
.
clone
();
if
(
StoreMoveInfo
.
MoveParam
.
IsNg
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn0
4
);
StoreMoveInfo
.
log
(
$
"收到完成贴标"
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn0
8
);
StoreMoveInfo
.
log
(
$
"收到完成贴标
NG
"
);
}
else
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn04
);
StoreMoveInfo
.
log
(
$
"收到完成贴标"
);
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreExecute
);
}
}
else
...
...
@@ -215,21 +237,54 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn04
:
if
(
boxTransport
.
IsComplateOrFree
)
{
var
outposid
=
StoreMoveInfo
.
MoveParam
.
PosID
;
//var outposid= StoreMoveInfo.MoveParam.PosID;
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn0
9
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn0
5
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
LabelP
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
outposid
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
StoreMoveInfo
.
MoveParam
.
PosID
=
outposid
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
//StoreMoveInfo.MoveParam.PosID = outposid;
//StoreMoveInfo.MoveParam.ReelOnFixture = false;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运
入库
"
);
StoreMoveInfo
.
log
(
$
"开始转运
到RFID位置
"
);
}
break
;
case
MoveStep
.
StoreIn05
:
if
(
boxTransport
.
IsComplateOrFree
)
{
if
(
StoreMoveInfo
.
MoveParam
.
RFID
.
Length
>
12
)
StoreMoveInfo
.
MoveParam
.
RFID
=
StoreMoveInfo
.
MoveParam
.
RFID
.
Substring
(
0
,
12
);
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
RobotManage
.
RFID
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
StoreMoveInfo
.
MoveParam
.
RFID
));
Thread
.
Sleep
(
500
);
if
(
RobotManage
.
RFID
.
ReadEPC
(
12
,
out
byte
[]
data
))
{
if
(
data
[
0
]
!=
0xFF
)
{
var
ds
=
Encoding
.
ASCII
.
GetString
(
data
).
Trim
();
if
(
ds
==
StoreMoveInfo
.
MoveParam
.
RFID
)
{
StoreMoveInfo
.
log
(
"RFID 写入成功:"
+
ds
);
break
;
}
else
{
StoreMoveInfo
.
log
(
"读取到 RFID:"
+
ds
);
}
}
}
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn09
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
true
;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运到入库位置"
);
}
break
;
case
MoveStep
.
StoreIn08
:
if
(
boxTransport
.
IsComplateOrFree
)
...
...
@@ -237,6 +292,7 @@ namespace DeviceLibrary
var
outposid
=
""
;
var
olist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
入口
);
olist
=
RobotManage
.
PositionNumList
.
ToList
().
Where
(
p
=>
{
return
p
.
StartsWith
(
"L"
)
&&
!
olist
.
Contains
(
p
);
}).
ToList
();
olist
.
Remove
(
LabelP
);
if
(
olist
.
Count
==
0
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
...
...
@@ -245,16 +301,15 @@ namespace DeviceLibrary
}
else
{
outposid
=
olist
[
0
];
outposid
=
olist
[
olist
.
Count
-
1
];
StoreMoveInfo
.
log
(
$
"检测到空库位:{outposid}, 其他空库位:{string.Join("
,
", olist)}"
);
}
nglist
.
Add
(
outposid
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn09
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
LabelP
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
outposid
);
StoreMoveInfo
.
MoveParam
.
PosID
=
outposid
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
//StoreMoveInfo.MoveParam.ReelOnFixture = false;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运"
);
...
...
@@ -263,23 +318,29 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn09
:
if
(
boxTransport
.
IsComplateOrFree
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn01
);
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreEnd
);
StoreMoveInfo
.
NewMove
(
MoveStep
.
StoreIn01
);
StoreMoveInfo
.
log
(
$
"入库完成"
);
}
break
;
case
MoveStep
.
StoreOut10
:
slist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
下层右侧
);
if
(
slist
.
Count
==
0
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
StoreMoveInfo
.
log
(
$
"没有检测到库内有料"
);
return
;
}
else
if
(
string
.
IsNullOrEmpty
(
StoreMoveInfo
.
MoveParam
.
PosID
))
{
inposid
=
slist
[
0
];
StoreMoveInfo
.
log
(
$
"检测到库位有料:{inposid}, 其他有料库位:{string.Join("
,
", slist)}"
);
OutStoreJobList
.
ClearLastPosid
();
slist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
下层右侧
);
if
(
slist
.
Count
==
0
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
StoreMoveInfo
.
log
(
$
"没有检测到库内有料"
);
return
;
}
else
{
inposid
=
slist
[
0
];
StoreMoveInfo
.
log
(
$
"检测到库位有料:{inposid}, 其他有料库位:{string.Join("
,
", slist)}"
);
}
}
inposid
=
StoreMoveInfo
.
MoveParam
.
PosID
;
{
var
outposid
=
""
;
var
olist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
出口
);
...
...
@@ -300,20 +361,44 @@ namespace DeviceLibrary
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
inposid
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
StoreMoveInfo
.
MoveParam
.
PosID
=
outposid
;
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
StoreMoveInfo
.
MoveParam
.
OutPosID
=
outposid
;
//StoreMoveInfo.MoveParam.ReelOnFixture = false;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运出库"
);
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreExecute
);
}
break
;
case
MoveStep
.
StoreOut11
:
if
(
boxTransport
.
IsComplateOrFree
)
{
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreBoxEnd
);
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
if
(
RobotManage
.
RFID
.
ReadEPC
(
12
,
out
byte
[]
data
))
{
if
(
data
[
0
]
!=
0xFF
)
{
var
ds
=
Encoding
.
ASCII
.
GetString
(
data
).
Trim
();
if
(
StoreMoveInfo
.
MoveParam
.
WareCode
.
IndexOf
(
ds
)>-
1
)
{
StoreMoveInfo
.
MoveParam
.
RFID
=
ds
;
StoreMoveInfo
.
log
(
"读取到 RFID:"
+
ds
);
break
;
}
else
{
StoreMoveInfo
.
log
(
"读取到 RFID:"
+
ds
);
Msg
.
add
(
"读取到的RFID与物料信息不符:"
+
ds
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"读取到的RFID与物料信息不符"
);
}
}
}
Thread
.
Sleep
(
200
);
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
StoreMoveInfo
.
MoveParam
.
WareCode
=
""
;
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
OutPosID
);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
true
;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运出库"
);
...
...
@@ -322,13 +407,16 @@ namespace DeviceLibrary
case
MoveStep
.
StoreOut12
:
if
(
boxTransport
.
IsComplateOrFree
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut10
);
slist
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
下层右侧
);
if
(
slist
.
Count
==
0
)
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreEnd
);
StoreMoveInfo
.
log
(
"出库完成"
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
OutStoreJobList
.
ClearLastPosid
();
if
(
OutStoreJobList
.
Count
==
0
)
//slist = CameraPointTest.GetThingStoreName(TestStorePointPort.下层右侧);
//if (slist.Count == 0)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut13
);
StoreMoveInfo
.
log
(
$
"没有检测到库内有料"
);
return
;
StoreMoveInfo
.
log
(
$
"没有出库任务了"
);
}
}
break
;
...
...
@@ -388,9 +476,14 @@ namespace DeviceLibrary
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreIn01
)
{
state
=
crc
.
GetString
(
"Res0114"
,
"入库中"
)
+
","
+
crc
.
GetString
(
"Res0071"
,
"库位号"
)
+
StoreMoveInfo
.
MoveParam
.
PosID
;
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreIn09
)
{
state
+=
"RFID:"
+
StoreMoveInfo
.
MoveParam
.
RFID
;
}
}
return
state
;
return
state
;
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
82303d2
...
...
@@ -78,7 +78,7 @@ namespace DeviceLibrary
///// </summary>
//public static HIKCamera CameraD=new HIKCamera();
public
static
DauxiKS107Controller
dauxiKS107
=
new
DauxiKS107Controller
();
public
static
PuYue
_FR540SP
RFID
=
new
Asa
.
RFID
.
PuYue_FR540SP
();
public
static
PuYue
RFID_FR540SP_C2S
RFID
=
new
PuYueRFID_FR540SP_C2S
();
public
static
PrinterHelper
printerHelper
=
new
PrinterHelper
();
public
static
void
Init
()
{
string
msg
=
""
;
...
...
@@ -164,7 +164,7 @@ namespace DeviceLibrary
LogUtil
.
info
(
"标签打印机打开成功"
);
RFID
.
IP
=
Setting_Init
.
Device_RFID_IP
;
RFID
.
Open
();
RFID
.
Open
(
Setting_Init
.
Device_RFID_IP
);
if
(!
RFID
.
IsConn
)
{
IsLoadOk
=
false
;
...
...
DeviceLibrary/userControl/AxisMoveControl.Designer.cs
查看文件 @
82303d2
...
...
@@ -169,6 +169,7 @@
this
.
lblAlarmcode
.
Tag
=
"not"
;
this
.
lblAlarmcode
.
Text
=
"ErrCode:160"
;
this
.
lblAlarmcode
.
Visible
=
false
;
this
.
lblAlarmcode
.
Click
+=
new
System
.
EventHandler
(
this
.
lblAlarmcode_Click
);
//
// label4
//
...
...
DeviceLibrary/userControl/AxisMoveControl.cs
查看文件 @
82303d2
...
...
@@ -449,5 +449,12 @@ namespace DeviceLibrary
private
void
AxisMoveControl_Load
(
object
sender
,
EventArgs
e
)
{
}
private
void
lblAlarmcode_Click
(
object
sender
,
EventArgs
e
)
{
var
s
=
string
.
Join
(
","
,
HuichuanLibrary
.
HCBoardManager
.
GetAxisErrorDetail
(
SlvAddr
));
MessageBox
.
Show
(
s
);
LogUtil
.
error
(
s
);
}
}
}
\ No newline at end of file
TheMachine/Form1.Designer.cs
查看文件 @
82303d2
...
...
@@ -47,7 +47,7 @@ namespace TheMachine
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
b
utton2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
b
tn_entrylock
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
stateView
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
cb_IgnoreSafecheck
=
new
System
.
Windows
.
Forms
.
CheckBox
();
...
...
@@ -200,7 +200,7 @@ namespace TheMachine
this
.
pnl
.
Controls
.
Add
(
this
.
button3
);
this
.
pnl
.
Controls
.
Add
(
this
.
button4
);
this
.
pnl
.
Controls
.
Add
(
this
.
button1
);
this
.
pnl
.
Controls
.
Add
(
this
.
b
utton2
);
this
.
pnl
.
Controls
.
Add
(
this
.
b
tn_entrylock
);
this
.
pnl
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_IgnoreSafecheck
);
this
.
pnl
.
Controls
.
Add
(
this
.
pictureBox2
);
...
...
@@ -249,19 +249,20 @@ namespace TheMachine
this
.
button1
.
TabIndex
=
272
;
this
.
button1
.
Text
=
"出库"
;
this
.
button1
.
UseVisualStyleBackColor
=
false
;
this
.
button1
.
Visible
=
false
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
// b
utton2
// b
tn_entrylock
//
this
.
b
utton2
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
b
utton2
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
b
utton2
.
Location
=
new
System
.
Drawing
.
Point
(
38
,
271
);
this
.
b
utton2
.
Name
=
"button2
"
;
this
.
b
utton2
.
Size
=
new
System
.
Drawing
.
Size
(
139
,
55
);
this
.
b
utton2
.
TabIndex
=
272
;
this
.
b
utton2
.
Text
=
"入库
"
;
this
.
b
utton2
.
UseVisualStyleBackColor
=
false
;
this
.
b
utton2
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click
);
this
.
b
tn_entrylock
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
b
tn_entrylock
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
b
tn_entrylock
.
Location
=
new
System
.
Drawing
.
Point
(
38
,
271
);
this
.
b
tn_entrylock
.
Name
=
"btn_entrylock
"
;
this
.
b
tn_entrylock
.
Size
=
new
System
.
Drawing
.
Size
(
139
,
55
);
this
.
b
tn_entrylock
.
TabIndex
=
272
;
this
.
b
tn_entrylock
.
Text
=
"入库门上锁
"
;
this
.
b
tn_entrylock
.
UseVisualStyleBackColor
=
false
;
this
.
b
tn_entrylock
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click
);
//
// groupBox1
//
...
...
@@ -471,7 +472,7 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
日本语
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
englishToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
Button
b
utton2
;
private
System
.
Windows
.
Forms
.
Button
b
tn_entrylock
;
private
System
.
Windows
.
Forms
.
Button
button3
;
private
System
.
Windows
.
Forms
.
Button
button4
;
}
...
...
TheMachine/Form1.cs
查看文件 @
82303d2
...
...
@@ -667,7 +667,8 @@ namespace TheMachine
MessageBox
.
Show
(
crc
.
GetString
(
"Res0019"
,
"入料抽屉未关闭"
));
return
;
}
RobotManage
.
mainMachine
.
DemoIn
();
IOManager
.
IOMove
(
IO_Type
.
Entry_Drawer_Lock
,
IO_VALUE
.
HIGH
);
//RobotManage.mainMachine.DemoIn();
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -675,6 +676,7 @@ namespace TheMachine
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
LOW
))
{
MessageBox
.
Show
(
crc
.
GetString
(
"Res0020"
,
"出料抽屉未关闭"
));
return
;
}
RobotManage
.
mainMachine
.
DemoOut
();
...
...
TheMachine/IOControls.Designer.cs
查看文件 @
82303d2
...
...
@@ -31,14 +31,16 @@ namespace TheMachine
{
this
.
btn_FlipEquip
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
button10
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button9
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button8
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button7
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button5
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button5
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button7
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button8
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cylinderButton5
=
new
TheMachine
.
CylinderButton
();
this
.
cylinderButton1
=
new
TheMachine
.
CylinderButton
();
this
.
cylinderButton8
=
new
TheMachine
.
CylinderButton
();
...
...
@@ -55,7 +57,6 @@ namespace TheMachine
this
.
cylinderButton13
=
new
TheMachine
.
CylinderButton
();
this
.
cylinderButton11
=
new
TheMachine
.
CylinderButton
();
this
.
ioControl1
=
new
TheMachine
.
IOControl
();
this
.
button9
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
panel1
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -74,6 +75,7 @@ namespace TheMachine
// panel1
//
this
.
panel1
.
AutoScroll
=
true
;
this
.
panel1
.
Controls
.
Add
(
this
.
button10
);
this
.
panel1
.
Controls
.
Add
(
this
.
button9
);
this
.
panel1
.
Controls
.
Add
(
this
.
button8
);
this
.
panel1
.
Controls
.
Add
(
this
.
button4
);
...
...
@@ -106,41 +108,42 @@ namespace TheMachine
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
975
,
881
);
this
.
panel1
.
TabIndex
=
3
;
//
// button1
// button1
0
//
this
.
button1
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button1
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
474
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button1
.
TabIndex
=
2
;
this
.
button1
.
Text
=
"锡膏翻转机构水平"
;
this
.
button1
.
UseVisualStyleBackColor
=
false
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
this
.
button10
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button10
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button10
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
679
);
this
.
button10
.
Name
=
"button10"
;
this
.
button10
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button10
.
TabIndex
=
6
;
this
.
button10
.
Text
=
"写入RFID EPC"
;
this
.
button10
.
UseVisualStyleBackColor
=
false
;
this
.
button10
.
Visible
=
false
;
this
.
button10
.
Click
+=
new
System
.
EventHandler
(
this
.
button10_Click
);
//
// button
3
// button
9
//
this
.
button
3
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
3
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
3
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
515
);
this
.
button
3
.
Name
=
"button3
"
;
this
.
button
3
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
3
.
TabIndex
=
2
;
this
.
button
3
.
Text
=
"锡膏定位旋转垂直
"
;
this
.
button
3
.
UseVisualStyleBackColor
=
false
;
this
.
button
3
.
Click
+=
new
System
.
EventHandler
(
this
.
button3
_Click
);
this
.
button
9
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
9
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
9
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
679
);
this
.
button
9
.
Name
=
"button9
"
;
this
.
button
9
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
9
.
TabIndex
=
6
;
this
.
button
9
.
Text
=
"读取RFID EPC
"
;
this
.
button
9
.
UseVisualStyleBackColor
=
false
;
this
.
button
9
.
Click
+=
new
System
.
EventHandler
(
this
.
button9
_Click
);
//
// button
2
// button
8
//
this
.
button
2
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
2
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
2
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
515
);
this
.
button
2
.
Name
=
"button2
"
;
this
.
button
2
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
2
.
TabIndex
=
2
;
this
.
button
2
.
Text
=
"锡膏定位旋转水平
"
;
this
.
button
2
.
UseVisualStyleBackColor
=
false
;
this
.
button
2
.
Click
+=
new
System
.
EventHandler
(
this
.
button2
_Click
);
this
.
button
8
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
8
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
8
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
638
);
this
.
button
8
.
Name
=
"button8
"
;
this
.
button
8
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
8
.
TabIndex
=
5
;
this
.
button
8
.
Text
=
"锡膏扭转
"
;
this
.
button
8
.
UseVisualStyleBackColor
=
false
;
this
.
button
8
.
Click
+=
new
System
.
EventHandler
(
this
.
button8
_Click
);
//
// button4
//
...
...
@@ -154,17 +157,17 @@ namespace TheMachine
this
.
button4
.
UseVisualStyleBackColor
=
false
;
this
.
button4
.
Click
+=
new
System
.
EventHandler
(
this
.
button4_Click
);
//
// button
5
// button
7
//
this
.
button
5
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
5
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
5
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
556
);
this
.
button
5
.
Name
=
"button5
"
;
this
.
button
5
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
5
.
TabIndex
=
4
;
this
.
button
5
.
Text
=
"上层托盘左移
"
;
this
.
button
5
.
UseVisualStyleBackColor
=
false
;
this
.
button
5
.
Click
+=
new
System
.
EventHandler
(
this
.
button5
_Click
);
this
.
button
7
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
7
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
7
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
597
);
this
.
button
7
.
Name
=
"button7
"
;
this
.
button
7
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
7
.
TabIndex
=
4
;
this
.
button
7
.
Text
=
"锡膏反转45度
"
;
this
.
button
7
.
UseVisualStyleBackColor
=
false
;
this
.
button
7
.
Click
+=
new
System
.
EventHandler
(
this
.
button7
_Click
);
//
// button6
//
...
...
@@ -178,29 +181,53 @@ namespace TheMachine
this
.
button6
.
UseVisualStyleBackColor
=
false
;
this
.
button6
.
Click
+=
new
System
.
EventHandler
(
this
.
button6_Click
);
//
// button
7
// button
5
//
this
.
button
7
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
7
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
7
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
597
);
this
.
button
7
.
Name
=
"button7
"
;
this
.
button
7
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
7
.
TabIndex
=
4
;
this
.
button
7
.
Text
=
"锡膏反转45度
"
;
this
.
button
7
.
UseVisualStyleBackColor
=
false
;
this
.
button
7
.
Click
+=
new
System
.
EventHandler
(
this
.
button7
_Click
);
this
.
button
5
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button
5
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button
5
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
556
);
this
.
button
5
.
Name
=
"button5
"
;
this
.
button
5
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button
5
.
TabIndex
=
4
;
this
.
button
5
.
Text
=
"上层托盘左移
"
;
this
.
button
5
.
UseVisualStyleBackColor
=
false
;
this
.
button
5
.
Click
+=
new
System
.
EventHandler
(
this
.
button5
_Click
);
//
// button
8
// button
1
//
this
.
button8
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button8
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button8
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
638
);
this
.
button8
.
Name
=
"button8"
;
this
.
button8
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button8
.
TabIndex
=
5
;
this
.
button8
.
Text
=
"锡膏扭转"
;
this
.
button8
.
UseVisualStyleBackColor
=
false
;
this
.
button8
.
Click
+=
new
System
.
EventHandler
(
this
.
button8_Click
);
this
.
button1
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button1
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
474
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button1
.
TabIndex
=
2
;
this
.
button1
.
Text
=
"锡膏翻转机构水平"
;
this
.
button1
.
UseVisualStyleBackColor
=
false
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
// button3
//
this
.
button3
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button3
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button3
.
Location
=
new
System
.
Drawing
.
Point
(
739
,
515
);
this
.
button3
.
Name
=
"button3"
;
this
.
button3
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button3
.
TabIndex
=
2
;
this
.
button3
.
Text
=
"锡膏定位旋转垂直"
;
this
.
button3
.
UseVisualStyleBackColor
=
false
;
this
.
button3
.
Click
+=
new
System
.
EventHandler
(
this
.
button3_Click
);
//
// button2
//
this
.
button2
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button2
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
515
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button2
.
TabIndex
=
2
;
this
.
button2
.
Text
=
"锡膏定位旋转水平"
;
this
.
button2
.
UseVisualStyleBackColor
=
false
;
this
.
button2
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click
);
//
// cylinderButton5
//
...
...
@@ -423,18 +450,6 @@ namespace TheMachine
this
.
ioControl1
.
Tag
=
"not"
;
this
.
ioControl1
.
Load
+=
new
System
.
EventHandler
(
this
.
ioControl1_Load
);
//
// button9
//
this
.
button9
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
button9
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button9
.
Location
=
new
System
.
Drawing
.
Point
(
542
,
679
);
this
.
button9
.
Name
=
"button9"
;
this
.
button9
.
Size
=
new
System
.
Drawing
.
Size
(
191
,
35
);
this
.
button9
.
TabIndex
=
6
;
this
.
button9
.
Text
=
"读取RFID"
;
this
.
button9
.
UseVisualStyleBackColor
=
false
;
this
.
button9
.
Click
+=
new
System
.
EventHandler
(
this
.
button9_Click
);
//
// IOControls
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -476,5 +491,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Button
button7
;
private
System
.
Windows
.
Forms
.
Button
button8
;
private
System
.
Windows
.
Forms
.
Button
button9
;
private
System
.
Windows
.
Forms
.
Button
button10
;
}
}
TheMachine/IOControls.cs
查看文件 @
82303d2
...
...
@@ -88,15 +88,31 @@ namespace TheMachine
private
void
button9_Click
(
object
sender
,
EventArgs
e
)
{
for
(
int
i
=
1
;
i
<
10
;
i
++)
{
Thread
.
Sleep
(
300
);
RobotManage
.
RFID
.
ReadEPC
(
out
byte
[]
data
);
if
(
data
!=
null
)
{
MessageBox
.
Show
(
RobotManage
.
RFID
.
HexBuff
(
data
));
return
;
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
Thread
.
Sleep
(
200
);
if
(
RobotManage
.
RFID
.
ReadEPC
(
12
,
out
byte
[]
data
))
{
if
(
data
[
0
]
!=
0xFF
)
{
MessageBox
.
Show
(
RobotManage
.
RFID
.
HexBuff
(
data
)
+
"\r\n"
+
Encoding
.
ASCII
.
GetString
(
data
).
Trim
());
return
;
}
}
}
MessageBox
.
Show
(
"no data"
);
}
private
void
button10_Click
(
object
sender
,
EventArgs
e
)
{
Thread
.
Sleep
(
300
);
var
epc
=
"20418002Z-203"
;
epc
=
"20418002Z-20"
;
epc
=
epc
.
PadRight
(
12
);
var
result
=
RobotManage
.
RFID
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
if
(
result
)
{
MessageBox
.
Show
(
"写入成功"
);
return
;
}
}
}
}
TheMachine/SettingControl.Designer.cs
查看文件 @
82303d2
...
...
@@ -175,7 +175,7 @@ namespace TheMachine
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn_printertest
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn_labeledit
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_labelselect
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
18
,
244
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
18
,
153
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
340
,
126
);
this
.
groupBox1
.
TabIndex
=
12
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论