Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20031_TinStorage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 79e944f8
由
刘韬
编写于
2023-01-09 20:10:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
82303d25
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
475 行增加
和
142 行删除
CT时间.xlsx
Common/CodeResourceControl.cs
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/CylinderManger.cs
DeviceLibrary/DeviceLibrary/LimitedRotary.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/CameraPointTest.cs
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Labeling.cs
DeviceLibrary/theMachine/MainMachine_RFIDSelftest.cs
DeviceLibrary/theMachine/MainMachine_StoreDemo.cs
DeviceLibrary/theMachine/MoveStep.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/Program.cs
TheMachine/SettingControl.cs
CT时间.xlsx
0 → 100644
查看文件 @
79e944f
此文件类型无法预览
Common/CodeResourceControl.cs
查看文件 @
79e944f
...
...
@@ -283,14 +283,16 @@ namespace OnlineStore
}
private
static
void
PreControlLanaguage
(
Control
partentControl
,
string
class
Name
)
{
string
newStr
=
""
;
//Con_GetTxt(partentControl, out string title);
//string newStr = GetString(GetTextIdStr(className, partentControl.Name), title);
//if (!newStr.Equals(""))
//{
//Con_SetTxt(partentControl, newStr.Replace("\\n", "\n"));
//}
{
if
(
class
Name
.
IndexOf
(
'_'
)
<
0
)
{
Con_GetTxt
(
partentControl
,
out
string
title
);
string
newStr
=
GetString
(
GetTextIdStr
(
class
Name
,
partentControl
.
Name
),
title
);
if
(!
newStr
.
Equals
(
""
))
{
Con_SetTxt
(
partentControl
,
newStr
.
Replace
(
"\\n"
,
"\n"
));
}
}
foreach
(
Control
con
in
partentControl
.
Controls
)
{
string
txt
=
""
;
...
...
@@ -303,7 +305,7 @@ namespace OnlineStore
if
(
Con_GetTxt
(
con
,
out
txt
))
{
newStr
=
GetString
(
GetTextIdStr
(
class
Name
,
con
.
Name
),
txt
);
var
newStr
=
GetString
(
GetTextIdStr
(
class
Name
,
con
.
Name
),
txt
);
if
(!
newStr
.
Equals
(
""
))
{
Con_SetTxt
(
con
,
newStr
.
Replace
(
"\\n"
,
"\n"
));
...
...
Common/Setting_Init.cs
查看文件 @
79e944f
...
...
@@ -85,7 +85,7 @@ namespace OnlineStore.Common
public
static
MyConfig
<
string
>
Runtime_Posid
=
""
;
public
static
MyConfig
<
string
>
Runtime_RFID
=
""
;
public
static
MyConfig
<
string
>
Runtime_PN
=
""
;
public
static
MyConfig
<
string
>
Runtime_WareCode
=
""
;
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
79e944f
...
...
@@ -106,6 +106,7 @@
<Compile Include="theMachine\MainMachine _Common.cs" />
<Compile Include="theMachine\MainMachine _AutoInOutTest.cs" />
<Compile Include="theMachine\MainMachine_Labeling.cs" />
<Compile Include="theMachine\MainMachine_RFIDSelftest.cs" />
<Compile Include="theMachine\MainMachine_StoreDemo.cs" />
<Compile Include="theMachine\MainMachine _IOMonitor.cs" />
<Compile Include="theMachine\MainMachine _LedProcess.cs" />
...
...
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
79e944f
...
...
@@ -189,7 +189,8 @@ namespace DeviceLibrary
string
bitmapfilename
=
""
;
if
(
cameraNameList
==
null
||
cameraNameList
.
Count
<=
0
)
{
throw
new
Exception
(
"CameraScan方法没有传入相机名称."
);
return
new
List
<
CodeInfo
>();
//throw new Exception("CameraScan方法没有传入相机名称.");
}
try
...
...
@@ -385,5 +386,122 @@ namespace DeviceLibrary
return
""
;
}
}
static
Bitmap
bufferBmp
=
null
;
[
HandleProcessCorruptedStateExceptions
]
public
static
bool
TakePicture
(
List
<
string
>
cameraNameList
)
{
if
(
cameraNameList
==
null
||
cameraNameList
.
Count
<=
0
)
{
return
false
;
}
try
{
var
cameraName
=
cameraNameList
[
0
];
int
retrytime
=
0
;
retry
:
LogUtil
.
info
(
$
"【"
+
cameraName
+
"】开始取图片"
);
if
(
cameraName
.
Trim
().
Equals
(
""
))
{
return
false
;
}
DateTime
startTime
=
DateTime
.
Now
;
try
{
_
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
bufferBmp
,
true
);
if
(
bufferBmp
==
null
)
{
if
(
retrytime
>
2
)
return
false
;
retrytime
++;
LoadCamera
(
true
);
LogUtil
.
info
(
$
"bitmap为空重试第{retrytime}次"
);
Task
.
Delay
(
1500
).
Wait
();
goto
retry
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成:"
+(
DateTime
.
Now
-
startTime
).
TotalSeconds
.
ToString
());
return
true
;
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
" 扫码出现AccessViolationException异常,关闭相机【"
+
cameraName
+
"】:"
+
e
.
ToString
());
Camera
.
_cam
.
Close
(
cameraName
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" 扫码出错:"
+
ex
.
ToString
());
}
finally
{
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
" 扫码出现AccessViolationException异常:"
+
e
.
ToString
());
//throw new Exception("扫码出现AccessViolationException异常");
// GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" 扫码出错:"
+
ex
.
ToString
());
//throw new Exception("扫码出错");
}
return
false
;
}
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
CodeInfo
>
ScanCode
()
{
HashSet
<
string
>
codestr
=
new
HashSet
<
string
>();
List
<
CodeInfo
>
codeList
=
new
List
<
CodeInfo
>();
string
bitmapfilename
=
""
;
DateTime
startTime
=
DateTime
.
Now
;
try
{
if
(
bufferBmp
==
null
)
{
LogUtil
.
error
(
"没有缓存的图像"
);
return
new
List
<
CodeInfo
>();
}
string
r
=
""
;
RemoteDecodeHelper
.
RemoteDecodeParam
remoteDecodeParam
=
new
RemoteDecodeHelper
.
RemoteDecodeParam
{
codeTypeList
=
codeTypeList
.
ToArray
(),
codeCount
=
QRCodeCount
,
timeout
=
CodeTimeOut
};
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
cc
=
RemoteDecodeHelper
.
DecodeRequest
(
bufferBmp
,
remoteDecodeParam
);
if
(
cc
!=
null
)
{
lock
(
codeList
)
{
cc
.
ForEach
((
c
)
=>
{
c
.
CodeStr
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
if
(!
codestr
.
Contains
(
c
.
CodeStr
))
{
codeList
.
Add
(
c
);
codestr
.
Add
(
c
.
CodeStr
);
r
+=
"##"
+
c
.
CodeStr
;
}
});
}
}
else
{
bitmapfilename
=
SaveImageToFile
(
"mimo"
,
""
,
bufferBmp
);
}
LogUtil
.
info
(
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" 扫码出错:"
+
ex
.
ToString
());
}
return
codeList
;
}
}
}
DeviceLibrary/DeviceLibrary/CylinderManger.cs
查看文件 @
79e944f
...
...
@@ -41,7 +41,13 @@ namespace DeviceLibrary
Resume
();
LogUtil
.
info
(
$
"{Name},设置{High}=Low"
);
}
public
bool
IsHigh
{
get
=>
IOManager
.
IOValue
(
High
).
Equals
(
IO_VALUE
.
HIGH
);
}
public
bool
IsLow
{
get
=>
IOManager
.
IOValue
(
Low
).
Equals
(
IO_VALUE
.
HIGH
);
}
public
void
Pause
()
{
LogUtil
.
info
(
$
"{Name},停止运行"
);
...
...
DeviceLibrary/DeviceLibrary/LimitedRotary.cs
查看文件 @
79e944f
...
...
@@ -82,7 +82,7 @@ namespace DeviceLibrary
if
(!
axisBean
.
IsServeoOn
)
axisBean
.
Open
(
true
,
out
string
msg
);
axisBean
.
RelMove
(
len
,
(
double
)
upspeed
);
moveInfo
.
log
(
$
"{checkio}"
);
//
moveInfo.log($"{checkio}");
while
(!
IOManager
.
IOValue
(
checkio
).
Equals
(
IO_VALUE
.
HIGH
))
{
Task
.
Delay
(
30
).
Wait
();
...
...
@@ -101,6 +101,7 @@ namespace DeviceLibrary
Task
.
Delay
(
100
).
Wait
();
axisBean
.
SuddenStop
();
moveInfo
.
log
(
$
"{axisBean.AxisName},转到位"
);
degreeAdd
=
0
;
return
true
;
}
finally
...
...
@@ -114,8 +115,8 @@ namespace DeviceLibrary
});
}
public
Task
TurnWork
;
public
void
TurnDegree
(
int
degree
)
{
TurnWork
=
Task
.
Run
(()=>
public
Task
TurnDegree
(
int
degree
)
{
return
TurnWork
=
Task
.
Run
(()=>
{
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -135,7 +136,7 @@ namespace DeviceLibrary
{
TurnToEnd
(
true
).
Wait
();
}
moveInfo
.
log
(
$
"len:{len}"
);
//
moveInfo.log($"len:{len}");
axisBean
.
RelMove
(
len
*-
1
,
(
double
)
upspeed
);
Task
.
Delay
(
50
).
Wait
();
while
(
axisBean
.
IsBusy
)
{
...
...
@@ -216,6 +217,8 @@ namespace DeviceLibrary
TurnToEnd
(
true
,
true
).
Wait
();
TurnToEnd
(
false
,
false
).
Wait
();
TurnToEnd
(
true
,
true
).
Wait
();
//TurnToEnd(false, false).Wait();
//TurnDegree(-20).Wait();
RobotManage
.
mainMachine
.
CylinderMove
(
null
,
IO_Type
.
Tin_Dock_Rotate_Release
,
IO_Type
.
Tin_Dock_Rotate_Clamp
,
IO_VALUE
.
LOW
);
while
(!
IOManager
.
IOValue
(
IO_Type
.
Tin_Dock_Rotate_Release
).
Equals
(
IO_VALUE
.
HIGH
))
{
...
...
@@ -225,9 +228,11 @@ namespace DeviceLibrary
TurnToEnd
(
false
).
Wait
();
});
}
public
void
TurnRound2
()
int
degreeAdd
=
0
;
public
Task
LockAndTurnDegree
(
int
degree
)
{
TurnWork
=
Task
.
Run
(()
=>
return
TurnWork
=
Task
.
Run
(()
=>
{
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -238,53 +243,51 @@ namespace DeviceLibrary
if
(!
axisBean
.
IsServeoOn
)
axisBean
.
Open
(
true
,
out
string
msg
);
var
len
=
(
int
)(
StrokeLength
/
90
*
45
);
if
(
len
>
0
)
{
TurnToEnd
(
false
).
Wait
();
}
moveInfo
.
log
(
$
"len:{len}"
);
axisBean
.
RelMove
(
len
*
-
1
,
(
double
)
upspeed
);
Task
.
Delay
(
50
).
Wait
();
while
(
axisBean
.
IsBusy
)
var
len
=
(
int
)(
StrokeLength
/
90
*
degree
);
if
(
Math
.
Abs
(
degreeAdd
+
degree
)
>
90
)
{
Task
.
Delay
(
50
).
Wait
();
if
(
len
>
0
)
{
TurnToEnd
(
true
).
Wait
();
}
else
if
(
len
<
0
)
{
TurnToEnd
(
false
).
Wait
();
}
}
RobotManage
.
mainMachine
.
CylinderMove
(
null
,
IO_Type
.
Tin_Dock_Rotate_Release
,
IO_Type
.
Tin_Dock_Rotate_Clamp
,
IO_VALUE
.
HIGH
);
while
(!
IOManager
.
IOValue
(
IO_Type
.
Tin_Dock_Rotate_Clamp
).
Equals
(
IO_VALUE
.
HIGH
))
{
Task
.
Delay
(
100
).
Wait
();
}
axisBean
.
RelMove
(
len
*
-
1
,
(
double
)
upspeed
);
Task
.
Delay
(
50
).
Wait
();
while
(
axisBean
.
IsBusy
)
{
Task
.
Delay
(
50
).
Wait
();
}
axisBean
.
RelMove
(
len
*
2
,
(
double
)
upspeed
);
Task
.
Delay
(
50
).
Wait
();
while
(
axisBean
.
IsBusy
)
{
Task
.
Delay
(
50
).
Wait
();
Task
.
Delay
(
30
).
Wait
();
}
//moveInfo.log($"len:{len}");
axisBean
.
RelMove
(
len
*
-
1
,
(
double
)
upspeed
);
Task
.
Delay
(
50
).
Wait
();
while
(
axisBean
.
IsBusy
)
{
Task
.
Delay
(
50
).
Wait
();
}
RobotManage
.
mainMachine
.
CylinderMove
(
null
,
IO_Type
.
Tin_Dock_Rotate_Release
,
IO_Type
.
Tin_Dock_Rotate_Clamp
,
IO_VALUE
.
LOW
);
while
(!
IOManager
.
IOValue
(
IO_Type
.
Tin_Dock_Rotate_Release
).
Equals
(
IO_VALUE
.
HIGH
))
degreeAdd
+=
degree
;
});
}
public
Task
UnLock
()
{
return
TurnWork
=
Task
.
Run
(()
=>
{
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
Task
.
Delay
(
100
).
Wait
();
moveInfo
.
log
(
$
"急停未解除"
);
return
;
}
if
(!
axisBean
.
IsServeoOn
)
axisBean
.
Open
(
true
,
out
string
msg
);
TurnToEnd
(
false
).
Wait
();
});
}
public
void
SetWaitResultInfo
(
MoveInfo
moveInfo
)
public
void
SetWaitResultInfo
(
MoveInfo
moveInfo
)
{
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitStatus
),
$
"等待[{axisBean.Config.Explain}]机构完成"
));
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
79e944f
...
...
@@ -351,26 +351,26 @@ namespace DeviceLibrary
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
openInLock
)
&&
dataMap
[
ParamDefine
.
openInLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:openInLock=doit"
);
IOManager
.
IOMove
(
IO_Type
.
Entry_Drawer_Lock
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Entry_Drawer_Lock
,
IO_VALUE
.
LOW
);
result
=
""
;
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
closeInLock
)
&&
dataMap
[
ParamDefine
.
closeInLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:closeInLock=doit"
);
IOManager
.
IOMove
(
IO_Type
.
Entry_Drawer_Lock
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Entry_Drawer_Lock
,
IO_VALUE
.
HIGH
);
result
=
""
;
}
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
openOutLock
)
&&
dataMap
[
ParamDefine
.
openOutLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:openOutLock=doit"
);
IOManager
.
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
LOW
);
result
=
""
;
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
closeOutLock
)
&&
dataMap
[
ParamDefine
.
closeOutLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:closeOutLock=doit"
);
IOManager
.
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
HIGH
);
result
=
""
;
}
if
(!
result
.
Equals
(
""
))
...
...
@@ -406,11 +406,11 @@ namespace DeviceLibrary
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Entry_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
map
[
ParamDefine
.
inDoorStatus
]
=
ParamDefine
.
open
;
map
[
ParamDefine
.
inDoorStatus
]
=
ParamDefine
.
close
;
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Entry_Drawer_Lock
).
Equals
(
IO_VALUE
.
LOW
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
map
[
ParamDefine
.
inDoorStatus
]
=
ParamDefine
.
close
;
map
[
ParamDefine
.
inDoorStatus
]
=
ParamDefine
.
open
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -419,12 +419,12 @@ namespace DeviceLibrary
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
map
[
ParamDefine
.
outDoorStatus
]
=
ParamDefine
.
open
;
map
[
ParamDefine
.
outDoorStatus
]
=
ParamDefine
.
close
;
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
Out_Drawer_Lock
).
Equals
(
IO_VALUE
.
LOW
)
&&
RobotManage
.
mainMachine
.
StoreMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
map
[
ParamDefine
.
outDoorStatus
]
=
ParamDefine
.
close
;
map
[
ParamDefine
.
outDoorStatus
]
=
ParamDefine
.
open
;
}
...
...
@@ -652,7 +652,7 @@ namespace DeviceLibrary
public
string
msg
{
get
;
set
;
}
public
Dictionary
<
string
,
string
>
data
{
get
;
set
;
}
public
Dictionary
<
string
,
object
>
data
{
get
;
set
;
}
}
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
79e944f
...
...
@@ -72,7 +72,7 @@ namespace DeviceLibrary
WareCode
=
"NG"
;
To
=
to
.
clone
();
MoveInfo
.
NewMove
(
MoveStep
.
StoreTS20
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输
料盘
,直接到:{to.posid}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输
物料
,直接到:{to.posid}"
);
MoveInfo
.
MoveParam
.
PosID
=
$
"NA=>{To.posid}"
;
}
else
...
...
@@ -82,7 +82,7 @@ namespace DeviceLibrary
To
=
to
.
clone
();
ignoreFixtureCheck
=
Common
.
IsNeedIgnoreFixtureCheck
(
WareCode
);
MoveInfo
.
NewMove
(
MoveStep
.
StoreTS01
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输
料盘
,从:{from.posid},到:{to.posid},WareCode:{WareCode},ignoreFixtureCheck:{ignoreFixtureCheck}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输
物料
,从:{from.posid},到:{to.posid},WareCode:{WareCode},ignoreFixtureCheck:{ignoreFixtureCheck}"
);
MoveInfo
.
MoveParam
.
PosID
=
$
"{From.posid}=>{To.posid}"
;
MoveInfo
.
MoveParam
.
ReelOnFixture
=
From
.
Reel
.
ReelOnFixture
;
...
...
@@ -91,7 +91,7 @@ namespace DeviceLibrary
FromCheckOffset
=
CalcOffset
(
From
.
posid
);
ToCheckOffset
=
CalcOffset
(
To
.
posid
);
MoveInfo
.
MoveParam
.
WareCode
=
WareCode
;
MoveInfo
.
log
(
$
"确认检查偏移: FromCheckOffset={FromCheckOffset},ToCheckOffset={ToCheckOffset}"
);
//
MoveInfo.log($"确认检查偏移: FromCheckOffset={FromCheckOffset},ToCheckOffset={ToCheckOffset}");
ErrMsgTxt
=
""
;
return
true
;
//thread = new Thread(new ThreadStart(Run));
...
...
@@ -112,27 +112,26 @@ namespace DeviceLibrary
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS02
);
MoveInfo
.
log
(
$
"{storeMoveType}:
检查安全状态
"
);
MoveInfo
.
log
(
$
"{storeMoveType}:
开始
"
);
break
;
case
MoveStep
.
StoreTS02
:
if
(
MoveInfo
.
MoveParam
.
ReelOnFixture
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
MoveInfo
.
log
(
$
"{storeMoveType}:料盘已在料叉上"
);
}
else
{
case
MoveStep
.
StoreTS02
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS03
);
if
(
From
.
posid
!=
MainMachine
.
LabelP
)
Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Z_Axis_P1
,
Config
.
Z_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:Z轴返回待机点P1"
);
}
//
MoveInfo.log($"{storeMoveType}:Z轴返回待机点P1");
break
;
case
MoveStep
.
StoreTS03
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS04
);
if
(
MoveInfo
.
MoveParam
.
ReelOnFixture
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
MoveInfo
.
log
(
$
"{storeMoveType}:物料已在夹爪上"
);
}
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS04
);
Y_Axis
.
AbsMove
(
MoveInfo
,
From
.
Y_Axis_P2
+
FromCheckOffset
,
Config
.
Y_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:Y轴到达取料点偏移点{From.Y_Axis_P2}+{FromCheckOffset}
"
);
//MoveInfo.log($"{storeMoveType}:Y轴到达取料点偏移点
");
X_Axis
.
AbsMove
(
MoveInfo
,
From
.
X_Axis_P2
,
Config
.
X_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
轴到达取料检测{From.X_Axis_P2
}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
Y轴到达取料检测,X:{From.X_Axis_P2},Y:{From.Y_Axis_P2}+{FromCheckOffset
}"
);
break
;
case
MoveStep
.
StoreTS04
:
if
(
CheckPosStatus
(
MoveInfo
,
From
.
posid
))
...
...
@@ -142,7 +141,7 @@ namespace DeviceLibrary
if
(
zp2
<
0
)
zp2
=
0
;
Z_Axis
.
AbsMove
(
MoveInfo
,
zp2
,
Config
.
Z_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:Z轴到达取料前点{From.Z_Axis_P2}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:Z轴到达取料前点
,
{From.Z_Axis_P2}"
);
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Taking_Release
,
IO_Type
.
Taking_Clamp
,
IO_VALUE
.
LOW
);
MoveInfo
.
log
(
$
"{storeMoveType}:松开夹爪"
);
IgnoreX09
=
false
;
...
...
@@ -160,7 +159,7 @@ namespace DeviceLibrary
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS06
);
MoveInfo
.
log
(
$
"{storeMoveType}:检测有料"
);
MoveInfo
.
log
(
$
"{storeMoveType}:检测有
物
料"
);
}
break
;
case
MoveStep
.
StoreTS06
:
...
...
@@ -177,7 +176,7 @@ namespace DeviceLibrary
case
MoveStep
.
StoreTS08
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS09
);
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Taking_Release
,
IO_Type
.
Taking_Clamp
,
IO_VALUE
.
HIGH
);
Setting_Init
.
Runtime_Posid
=
To
.
posid
;
//
Setting_Init.Runtime_Posid = To.posid;
if
(
storeMoveType
==
StoreMoveType
.
InStore
&&
To
.
posid
==
MainMachine
.
LabelP
)
Setting_Init
.
Runtime_Step
=
Runtime_StepE
.
InToLabel
;
if
(
storeMoveType
==
StoreMoveType
.
InStore
&&
To
.
posid
!=
MainMachine
.
LabelP
)
...
...
@@ -189,7 +188,10 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
StoreTS09
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
);
Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Z_Axis_P1
,
Config
.
Z_Axis_P1_speed
);
if
(
From
.
posid
==
MainMachine
.
LabelP
&&
To
.
posid
==
MainMachine
.
RFIDP
)
Z_Axis
.
AbsMove
(
MoveInfo
,
To
.
Z_Axis_P3
,
Config
.
Z_Axis_P1_speed
);
else
Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Z_Axis_P1
,
Config
.
Z_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:Z轴到达待机点"
);
break
;
case
MoveStep
.
StoreTS10
:
...
...
@@ -201,9 +203,8 @@ namespace DeviceLibrary
case
MoveStep
.
StoreTS20
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS21
);
Y_Axis
.
AbsMove
(
MoveInfo
,
To
.
Y_Axis_P2
+
ToCheckOffset
,
Config
.
Y_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:Y轴到达目的地偏移点:{To.Y_Axis_P2}+{ToCheckOffset}"
);
X_Axis
.
AbsMove
(
MoveInfo
,
To
.
X_Axis_P2
,
Config
.
X_Axis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
轴到达目的地检测:{To.X_Axis_P2
}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
Y轴到达目的地检测,X:{To.X_Axis_P2},Y:{To.Y_Axis_P2}+{ToCheckOffset
}"
);
break
;
case
MoveStep
.
StoreTS21
:
if
(
CheckPosStatus
(
MoveInfo
,
To
.
posid
))
{
...
...
@@ -213,6 +214,12 @@ namespace DeviceLibrary
case
MoveStep
.
StoreTS22
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS23
);
MoveInfo
.
log
(
$
"{storeMoveType}:Z轴到达入库前点"
);
if
(
From
.
posid
==
MainMachine
.
LabelP
&&
To
.
posid
==
MainMachine
.
RFIDP
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS29
);
MoveInfo
.
log
(
"LabelP=>RFIDP 直接结束"
);
}
else
{
var
zp2
=
To
.
Z_Axis_P3
-
205000
;
if
(
zp2
<
0
)
...
...
@@ -288,7 +295,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
StoreTS29
:
MoveInfo
.
log
(
$
"{storeMoveType}:转移
料盘
完成"
);
MoveInfo
.
log
(
$
"{storeMoveType}:转移
物料
完成"
);
MoveInfo
.
EndMove
();
ErrMsgTxt
=
""
;
To
.
posid
=
""
;
...
...
@@ -351,21 +358,36 @@ namespace DeviceLibrary
}
else
if
(
Regex
.
IsMatch
(
posid
,
"^S[A-G]"
))
{
RobotManage
.
mainMachine
.
TPMove
.
ToLow
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至左侧"
);
return
true
;
if
(
RobotManage
.
mainMachine
.
TPMove
.
IsLow
)
return
true
;
else
{
RobotManage
.
mainMachine
.
TPMove
.
ToLow
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至左侧"
);
return
false
;
}
}
else
if
(
Regex
.
IsMatch
(
posid
,
"^S[H-N][1-6]$"
))
{
RobotManage
.
mainMachine
.
TPMove
.
ToHigh
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至右侧"
);
return
true
;
if
(
RobotManage
.
mainMachine
.
TPMove
.
IsHigh
)
return
true
;
else
{
RobotManage
.
mainMachine
.
TPMove
.
ToHigh
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至右侧"
);
return
false
;
}
}
else
if
(
Regex
.
IsMatch
(
posid
,
"^S[H-N]([7-9]|\\d{2})$"
))
{
RobotManage
.
mainMachine
.
TPMove
.
ToLow
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至左侧"
);
return
true
;
if
(
RobotManage
.
mainMachine
.
TPMove
.
IsLow
)
return
true
;
else
{
RobotManage
.
mainMachine
.
TPMove
.
ToLow
(
moveInfo
);
moveInfo
.
log
(
$
"{posid},上层库位移至左侧"
);
return
false
;
}
}
else
{
//moveInfo.log($"{posid},未知库位");
...
...
DeviceLibrary/theMachine/CameraPointTest.cs
查看文件 @
79e944f
...
...
@@ -123,10 +123,8 @@ namespace DeviceLibrary
}
}
static
List
<
int
>
TestStorePoint
(
Bitmap
bmp
,
TestStorePointPort
tp
)
public
static
List
<
int
>
TestStorePoint
(
Bitmap
bmp
,
TestStorePointPort
tp
)
{
if
(
bmp
==
null
)
return
new
List
<
int
>();
//TestStorePointEvent?.Invoke(tp, bmp);
...
...
@@ -137,7 +135,9 @@ namespace DeviceLibrary
}
List
<
Point
>
points
=
CameraData
[
Name
].
ObjectPoint
;
if
(
bmp
==
null
)
return
new
List
<
int
>(
points
.
Count
);
List
<
int
>
haslist
=
new
List
<
int
>();
var
bd
=
bmp
.
LockBits
(
new
Rectangle
(
0
,
0
,
bmp
.
Width
,
bmp
.
Height
),
ImageLockMode
.
ReadOnly
,
bmp
.
PixelFormat
);
try
...
...
@@ -148,9 +148,9 @@ namespace DeviceLibrary
p
.
X
=
p
.
X
-
8
;
p
.
Y
=
p
.
Y
-
8
;
var
cl
=
new
List
<
ColorHSV
>();
for
(
int
j
=
0
;
j
<
16
;
j
++)
for
(
int
j
=
0
;
j
<
32
;
j
++)
{
for
(
int
k
=
0
;
k
<
16
;
k
++)
for
(
int
k
=
0
;
k
<
32
;
k
++)
{
var
x
=
p
.
X
+
j
;
var
y
=
p
.
Y
+
k
;
...
...
@@ -257,11 +257,11 @@ namespace DeviceLibrary
int
errlinecount
=
0
;
try
{
for
(
int
i
=
0
;
i
<
height
;
i
++
)
for
(
int
i
=
0
;
i
<
height
;
i
=
i
+
2
)
{
int
linecount
=
0
;
for
(
int
j
=
0
;
j
<
width
;
j
++
)
for
(
int
j
=
0
;
j
<
width
;
j
=
j
+
3
)
{
var
x
=
Start
.
X
+
j
;
var
y
=
Start
.
Y
+
height
-
i
;
...
...
@@ -281,7 +281,7 @@ namespace DeviceLibrary
Marshal
.
WriteByte
(
bd
.
Scan0
,
addr
,
0
);
}
}
if
(
linecount
<
width
*
0.6
)
if
(
linecount
*
3
<
width
*
0.6
)
{
errlinecount
++;
HeightCount
=
0
;
...
...
@@ -293,7 +293,7 @@ namespace DeviceLibrary
}
else
{
HeightCount
++;
if
(
HeightCount
>
50
)
{
if
(
HeightCount
*
2
>
50
)
{
return
true
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
查看文件 @
79e944f
...
...
@@ -14,9 +14,34 @@ namespace DeviceLibrary
{
partial
class
MainMachine
{
bool
MaterialDoorOpen
=
false
;
public
bool
LeftDoorOpen
=
false
;
public
bool
RightDoorOpen
=
false
;
public
bool
PrintDoorOpen
=
false
;
void
ioMonitor
()
{
//if (!PrintDoorOpen && IOValue(IO_Type.PrinterDoor_Check).Equals(IO_VALUE.HIGH))
//{
// IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.HIGH);
//}
//else
//{
// PrintDoorOpen = false;
//}
//if (!LeftDoorOpen && IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.LOW))
//{
// IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.HIGH);
//}
//else {
// LeftDoorOpen = false;
//}
//if (!RightDoorOpen && IOValue(IO_Type.RightDoor_Check).Equals(IO_VALUE.LOW))
//{
// IOMove(IO_Type.RightDoor_Lock, IO_VALUE.HIGH);
//}
//else
//{
// RightDoorOpen = false;
//}
if
(
IOValue
(
IO_Type
.
Airpressure_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
crc
.
GetString
(
"Res0079"
,
"未检测到气压信号."
),
MsgLevel
.
warning
);
}
...
...
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
79e944f
...
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
{
Led
AlarmLed
;
Led
StandbyLed
;
Led
RunningLed
;
public
Dictionary
<
MachineLedStateE
,
Dictionary
<
LedColor
,
LedState
>>
MachineLedState
=
new
Dictionary
<
MachineLedStateE
,
Dictionary
<
LedColor
,
LedState
>>();
public
Dictionary
<
MachineLedStateE
,
string
>
MachineLedStateName
=
new
Dictionary
<
MachineLedStateE
,
string
>();
...
...
@@ -82,11 +83,11 @@ namespace DeviceLibrary
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
crc
.
GetString
(
"Res0084"
,
"暂停"
);
MachineLedState
.
Add
(
MachineLedStateE
.
SystemPause
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
blink
));
//温湿度超限30分钟. 红闪,黄闪
MachineLedStateName
[
MachineLedStateE
.
THoutRangeOver30m
]
=
crc
.
GetString
(
"Res0085"
,
"温湿度超限30分钟"
);
MachineLedState
.
Add
(
MachineLedStateE
.
THoutRangeOver30m
,
nls
(
LedState
.
blink
,
LedState
.
blink
,
LedState
.
none
));
//
MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = crc.GetString("Res0085","温湿度超限30分钟");
//
MachineLedState.Add(MachineLedStateE.THoutRangeOver30m, nls(LedState.blink, LedState.blink, LedState.none));
//温湿度超限 绿闪黄闪
MachineLedStateName
[
MachineLedStateE
.
THoutRange
]
=
crc
.
GetString
(
"Res0086"
,
"温湿度超限"
);
MachineLedState
.
Add
(
MachineLedStateE
.
THoutRange
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
blink
));
//
MachineLedStateName[MachineLedStateE.THoutRange] = crc.GetString("Res0086","温湿度超限");
//
MachineLedState.Add(MachineLedStateE.THoutRange, nls(LedState.none, LedState.blink, LedState.blink));
//进出库, 绿亮,黄闪
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
crc
.
GetString
(
"Res0087"
,
"出入库中"
);
MachineLedState
.
Add
(
MachineLedStateE
.
InOut
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
on
));
...
...
@@ -111,7 +112,7 @@ namespace DeviceLibrary
foreach
(
var
ledcolor
in
ledcfg
.
Keys
)
{
if
(!
Led
.
LedColors
.
ContainsKey
(
ledcolor
)
||
ledcfg
[
ledcolor
]
==
LedState
.
none
)
return
;
continue
;
Led
.
LedColors
[
ledcolor
].
LedState
=
ledcfg
[
ledcolor
];
}
}
...
...
@@ -137,22 +138,6 @@ namespace DeviceLibrary
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
InOut
);
}
//温度超限 绿亮 黄闪
if
(
IsTHoutRange
())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
THoutRange
);
}
//温度超限30分钟 绿亮 黄闪 红闪
if
(
IsTHoutRangeOver30m
())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
THoutRangeOver30m
);
}
//系统暂停,说明书未定义, 绿闪, 红闪
if
(!
canRunning
||
UserPause
)
{
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
79e944f
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/MainMachine_Labeling.cs
查看文件 @
79e944f
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/MainMachine_RFIDSelftest.cs
0 → 100644
查看文件 @
79e944f
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
{
partial
class
MainMachine
{
List
<
string
>
DemoTestList
;
int
DemoTestIndex
=
0
;
int
DemoTestCount
=
0
;
void
TFIDSelfTestProcess
()
{
if
(
CheckWait
(
StoreMoveInfo
))
return
;
//常规上料扫码流程
switch
(
StoreMoveInfo
.
MoveStep
)
{
case
MoveStep
.
Wait
:
break
;
case
MoveStep
.
StoreIn01
:
DemoTestList
=
CameraPointTest
.
GetThingStoreName
(
TestStorePointPort
.
上层左侧
);
if
(
DemoTestList
.
Count
==
0
)
return
;
DemoTestIndex
=
0
;
break
;
case
MoveStep
.
StoreOut10
:
if
(
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
Out_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
))
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
}
else
if
(
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
Out_Drawer_Lock
).
Equals
(
IO_VALUE
.
HIGH
))
{
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
LOW
);
}
else
if
(
IOValue
(
IO_Type
.
Out_Drawer
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"出库任务正在执行,请关好抽屉"
,
MsgLevel
.
warning
);
}
else
{
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
HIGH
);
}
break
;
case
MoveStep
.
StoreOut11
:
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
var
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
DemoTestList
[
DemoTestIndex
]);
var
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
OutStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运出库"
);
break
;
case
MoveStep
.
StoreOut12
:
if
(
boxTransport
.
IsComplateOrFree
)
{
bool
issame
=
false
;
string
ds
=
""
;
for
(
int
i
=
0
;
i
<
15
;
i
++)
{
if
(
RobotManage
.
RFID
.
ReadEPC
(
12
,
out
byte
[]
data
))
{
if
(
data
[
0
]
!=
0xFF
)
{
ds
=
Encoding
.
ASCII
.
GetString
(
data
).
Trim
();
if
(
StoreMoveInfo
.
MoveParam
.
WareCode
.
IndexOf
(
ds
)>-
1
)
{
StoreMoveInfo
.
MoveParam
.
RFID
=
ds
;
StoreMoveInfo
.
log
(
"读取到 RFID:"
+
ds
+
" , "
+
RobotManage
.
RFID
.
HexBuff
(
data
));
issame
=
true
;
break
;
}
}
}
Thread
.
Sleep
(
200
);
}
if
(!
issame
)
{
//StoreMoveInfo.log("读取到 RFID:" + ds);
//Msg.add("读取到的RFID与物料信息不符:" + ds, MsgLevel.alarm);
//RobotManage.UserPause("读取到的RFID与物料信息不符");
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut13
);
from
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
RFIDP
);
to
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
DemoTestList
[
DemoTestIndex
]);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
true
;
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
from
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
to
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
OutStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运出库"
);
}
break
;
case
MoveStep
.
StoreOut13
:
if
(
boxTransport
.
IsComplateOrFree
)
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
DemoTestIndex
++;
if
(
DemoTestIndex
>=
DemoTestList
.
Count
)
DemoTestIndex
=
0
;
DemoTestCount
++;
}
break
;
default
:
StoreMoveInfo
.
log
(
$
"未找到对应步骤:{StoreMoveInfo.MoveStep}"
);
break
;
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine_StoreDemo.cs
查看文件 @
79e944f
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
79e944f
...
...
@@ -61,6 +61,7 @@ namespace DeviceLibrary
StoreIn08
,
StoreIn09
,
StoreOut10
,
//出库
StoreOut10_1
,
StoreOut_NGPre
,
StoreOut11
,
StoreOut12
,
...
...
@@ -114,6 +115,7 @@ namespace DeviceLibrary
Labeling02
,
Labeling03
,
Labeling04
,
Labeling04a
,
Labeling05
,
Labeling06
,
Labeling07
,
...
...
TheMachine/Form1.Designer.cs
查看文件 @
79e944f
...
...
@@ -44,6 +44,8 @@ namespace TheMachine
this
.
tabc
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabP1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
pnl
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
btn_rightsafedoorunlock
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_leftsafedoorunlock
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -52,7 +54,6 @@ namespace TheMachine
this
.
stateView
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
cb_IgnoreSafecheck
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
pictureBox2
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
cb_IgnoreGratingSignal
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
pictureBox1
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
cb_EnableBuzzer
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btn_IgnoreX09
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -60,6 +61,7 @@ namespace TheMachine
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
btn_stop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_run
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_printsafedoorunlock
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
tabc
.
SuspendLayout
();
this
.
tabP1
.
SuspendLayout
();
...
...
@@ -197,6 +199,9 @@ namespace TheMachine
//
// pnl
//
this
.
pnl
.
Controls
.
Add
(
this
.
btn_printsafedoorunlock
);
this
.
pnl
.
Controls
.
Add
(
this
.
btn_rightsafedoorunlock
);
this
.
pnl
.
Controls
.
Add
(
this
.
btn_leftsafedoorunlock
);
this
.
pnl
.
Controls
.
Add
(
this
.
button3
);
this
.
pnl
.
Controls
.
Add
(
this
.
button4
);
this
.
pnl
.
Controls
.
Add
(
this
.
button1
);
...
...
@@ -204,7 +209,6 @@ namespace TheMachine
this
.
pnl
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_IgnoreSafecheck
);
this
.
pnl
.
Controls
.
Add
(
this
.
pictureBox2
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_IgnoreGratingSignal
);
this
.
pnl
.
Controls
.
Add
(
this
.
pictureBox1
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_EnableBuzzer
);
this
.
pnl
.
Controls
.
Add
(
this
.
btn_IgnoreX09
);
...
...
@@ -215,6 +219,30 @@ namespace TheMachine
this
.
pnl
.
Size
=
new
System
.
Drawing
.
Size
(
1000
,
576
);
this
.
pnl
.
TabIndex
=
273
;
//
// btn_rightsafedoorunlock
//
this
.
btn_rightsafedoorunlock
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btn_rightsafedoorunlock
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn_rightsafedoorunlock
.
Location
=
new
System
.
Drawing
.
Point
(
808
,
332
);
this
.
btn_rightsafedoorunlock
.
Name
=
"btn_rightsafedoorunlock"
;
this
.
btn_rightsafedoorunlock
.
Size
=
new
System
.
Drawing
.
Size
(
139
,
56
);
this
.
btn_rightsafedoorunlock
.
TabIndex
=
275
;
this
.
btn_rightsafedoorunlock
.
Text
=
"右侧防护门解锁"
;
this
.
btn_rightsafedoorunlock
.
UseVisualStyleBackColor
=
false
;
this
.
btn_rightsafedoorunlock
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click_1
);
//
// btn_leftsafedoorunlock
//
this
.
btn_leftsafedoorunlock
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btn_leftsafedoorunlock
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn_leftsafedoorunlock
.
Location
=
new
System
.
Drawing
.
Point
(
808
,
271
);
this
.
btn_leftsafedoorunlock
.
Name
=
"btn_leftsafedoorunlock"
;
this
.
btn_leftsafedoorunlock
.
Size
=
new
System
.
Drawing
.
Size
(
139
,
55
);
this
.
btn_leftsafedoorunlock
.
TabIndex
=
276
;
this
.
btn_leftsafedoorunlock
.
Text
=
"左侧防护门解锁"
;
this
.
btn_leftsafedoorunlock
.
UseVisualStyleBackColor
=
false
;
this
.
btn_leftsafedoorunlock
.
Click
+=
new
System
.
EventHandler
(
this
.
button5_Click_1
);
//
// button3
//
this
.
button3
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
...
...
@@ -312,18 +340,6 @@ namespace TheMachine
this
.
pictureBox2
.
DoubleClick
+=
new
System
.
EventHandler
(
this
.
pictureBox1_DoubleClick
);
this
.
pictureBox2
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
pictureBox1_MouseDown
);
//
// cb_IgnoreGratingSignal
//
this
.
cb_IgnoreGratingSignal
.
AutoSize
=
true
;
this
.
cb_IgnoreGratingSignal
.
Location
=
new
System
.
Drawing
.
Point
(
607
,
78
);
this
.
cb_IgnoreGratingSignal
.
Name
=
"cb_IgnoreGratingSignal"
;
this
.
cb_IgnoreGratingSignal
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
25
);
this
.
cb_IgnoreGratingSignal
.
TabIndex
=
2
;
this
.
cb_IgnoreGratingSignal
.
Text
=
"忽略安全光栅"
;
this
.
cb_IgnoreGratingSignal
.
UseVisualStyleBackColor
=
true
;
this
.
cb_IgnoreGratingSignal
.
Visible
=
false
;
this
.
cb_IgnoreGratingSignal
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_IgnoreGratingSignal_CheckedChanged
);
//
// pictureBox1
//
this
.
pictureBox1
.
BackColor
=
System
.
Drawing
.
Color
.
Gainsboro
;
...
...
@@ -411,6 +427,18 @@ namespace TheMachine
this
.
btn_run
.
UseVisualStyleBackColor
=
true
;
this
.
btn_run
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_run_Click
);
//
// btn_printsafedoorunlock
//
this
.
btn_printsafedoorunlock
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btn_printsafedoorunlock
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn_printsafedoorunlock
.
Location
=
new
System
.
Drawing
.
Point
(
808
,
394
);
this
.
btn_printsafedoorunlock
.
Name
=
"btn_printsafedoorunlock"
;
this
.
btn_printsafedoorunlock
.
Size
=
new
System
.
Drawing
.
Size
(
139
,
56
);
this
.
btn_printsafedoorunlock
.
TabIndex
=
277
;
this
.
btn_printsafedoorunlock
.
Text
=
"打印维护门解锁"
;
this
.
btn_printsafedoorunlock
.
UseVisualStyleBackColor
=
false
;
this
.
btn_printsafedoorunlock
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click_2
);
//
// Form1
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -457,7 +485,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
ListView
stateView
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_IgnoreSafecheck
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_IgnoreGratingSignal
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
二维码识别调试
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
关于
ToolStripMenuItem
;
...
...
@@ -475,6 +502,9 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Button
btn_entrylock
;
private
System
.
Windows
.
Forms
.
Button
button3
;
private
System
.
Windows
.
Forms
.
Button
button4
;
private
System
.
Windows
.
Forms
.
Button
btn_rightsafedoorunlock
;
private
System
.
Windows
.
Forms
.
Button
btn_leftsafedoorunlock
;
private
System
.
Windows
.
Forms
.
Button
btn_printsafedoorunlock
;
}
}
TheMachine/Form1.cs
查看文件 @
79e944f
...
...
@@ -265,13 +265,13 @@ namespace TheMachine
//RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
addTablePage
();
RobotManage
.
LoadDebug
();
cb_IgnoreGratingSignal
.
Visible
=
true
;
//
cb_IgnoreGratingSignal.Visible = true;
cb_IgnoreSafecheck
.
Visible
=
true
;
}
else
{
cb_IgnoreGratingSignal
.
Checked
=
false
;
cb_IgnoreGratingSignal
.
Visible
=
false
;
//
cb_IgnoreGratingSignal.Checked = false;
//
cb_IgnoreGratingSignal.Visible = false;
cb_IgnoreSafecheck
.
Checked
=
false
;
cb_IgnoreSafecheck
.
Visible
=
false
;
var
tc
=
tabc
.
TabPages
.
Count
;
...
...
@@ -701,5 +701,23 @@ namespace TheMachine
{
IOManager
.
IOMove
(
IO_Type
.
Out_Drawer_Lock
,
IO_VALUE
.
LOW
);
}
private
void
button5_Click_1
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
LeftDoor_Lock
,
IO_VALUE
.
LOW
);
RobotManage
.
mainMachine
.
LeftDoorOpen
=
true
;
}
private
void
button2_Click_1
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
RightDoor_Lock
,
IO_VALUE
.
LOW
);
RobotManage
.
mainMachine
.
RightDoorOpen
=
true
;
}
private
void
button2_Click_2
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
PrinterDoor_Lock
,
IO_VALUE
.
LOW
);
RobotManage
.
mainMachine
.
PrintDoorOpen
=
true
;
}
}
}
\ No newline at end of file
TheMachine/Program.cs
查看文件 @
79e944f
...
...
@@ -25,11 +25,12 @@ namespace TheMachine
static
void
Main
()
{
CameraPointTest
.
Init
();
//CameraPointTest.ScanRectangle();
//var bmpfile = @"D:\rick\vs\SO20031_TinStorage\
料架照片\106_监控点1_106_20221125194616_31932401
.bmp";
//var bmpfile = @"D:\rick\vs\SO20031_TinStorage\
TheMachine\bin\Debug\test
.bmp";
//var bmp = new Bitmap(bmpfile);
//var r = C
ommon.CalcStoreBMP(bmp,4, 5
);
//var l= Common.TestStorePoint(bmp, r);
//var r = C
ameraPointTest.TestStorePoint(bmp, TestStorePointPort.入口
);
_
=
new
Mutex
(
true
,
Application
.
ProductName
,
out
bool
ret
);
if
(!
ret
)
{
...
...
TheMachine/SettingControl.cs
查看文件 @
79e944f
...
...
@@ -137,7 +137,9 @@ namespace TheMachine
private
void
btn_labeledit_Click
(
object
sender
,
EventArgs
e
)
{
RobotManage
.
printerHelper
.
EditLabel
();
PrintLabel
.
FrmLabel
frmLabel
=
new
PrintLabel
.
FrmLabel
();
crc
.
LanguageProcess
(
frmLabel
,
"FrmLabel"
);
frmLabel
.
ShowDialog
();
loadlabellist
();
}
void
loadlabellist
()
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论