Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO853-AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit df76da28
由
刘韬
编写于
2024-09-01 16:14:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
60923ab4
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
57 行增加
和
12 行删除
DeviceLibrary/AutoScan/XRayMachine.Feeding.cs
DeviceLibrary/AutoScan/XRayMachine.cs
DeviceLibrary/AutoScan/common/AxisBean.cs
DeviceLibrary/DeviceLibrary.csproj
SO853-AutoCountMachine/SO1451-AutoCountMachine.csproj
SO853-AutoCountMachine/XrayControl.Designer.cs
SO853-AutoCountMachine/XrayControl.cs
DeviceLibrary/AutoScan/XRayMachine.Feeding.cs
查看文件 @
df76da2
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -19,7 +20,7 @@ namespace DeviceLibrary
if
(
CheckWait
(
FeedingMoveinfo
))
return
;
if
(
IOValue
(
IO_XRay_Type
.
Manual_Confirm_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
IOValue
(
IO_XRay_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"The safety grating is blocked"
,
MsgLevel
.
warning
);
return
;
}
...
...
@@ -198,19 +199,19 @@ namespace DeviceLibrary
var
Tray7
=
Math
.
Max
(
Tray7_L
,
Tray7_R
);
var
Tray13
=
Math
.
Max
(
Tray13_L
,
Tray13_R
);
var
Tray15
=
Math
.
Max
(
Tray15_L
,
Tray15_R
);
//LogUtil.OutputDebugString
($"Tray7:{Tray7},Tray13:{Tray13},Tray15:{Tray15}");
Debug
.
WriteLine
(
$
"Tray7:{Tray7},Tray13:{Tray13},Tray15:{Tray15}"
);
int
v
=
0
;
if
(
Tray15
<
overhight
)
if
(
Tray15
<
overhight
&&
Tray15
>
0
)
{
if
(
SensorDebounce
.
Debounce
(
Tray15
,
out
v
))
TrayWidth
=
15
;
}
else
if
(
Tray13
<
overhight
)
else
if
(
Tray13
<
overhight
&&
Tray13
>
0
)
{
if
(
SensorDebounce
.
Debounce
(
Tray13
,
out
v
))
TrayWidth
=
13
;
}
else
if
(
Tray7
<
overhight
)
else
if
(
Tray7
<
overhight
&&
Tray7
>
0
)
{
if
(
SensorDebounce
.
Debounce
(
Tray7
,
out
v
))
TrayWidth
=
7
;
...
...
DeviceLibrary/AutoScan/XRayMachine.cs
查看文件 @
df76da2
...
...
@@ -33,8 +33,8 @@ namespace DeviceLibrary
public
bool
IgnoreSafecheck
{
get
;
set
;
}
public
bool
IgnoreGratingSignal
{
get
;
set
;
}
AxisBean
Line_Entry_Axis
;
AxisBean
Line_In_Axis
;
public
AxisBean
Line_Entry_Axis
;
public
AxisBean
Line_In_Axis
;
AxisBean
ExitLine_Location_Axis
;
AxisBean
SideMove_X_Axis
;
AxisBean
SideMove_Z_Axis
;
...
...
@@ -221,11 +221,14 @@ namespace DeviceLibrary
CylinderMove
(
ResetMoveInfo
,
IO_XRay_Type
.
Location_Cylinder_Down
,
IO_XRay_Type
.
Location_Cylinder_Up
,
IO_VALUE
.
LOW
);
CylinderMove
(
ResetMoveInfo
,
IO_XRay_Type
.
Entry_Close
,
IO_XRay_Type
.
Entry_Open
);
CylinderMove
(
ResetMoveInfo
,
IO_XRay_Type
.
Exit_Close
,
IO_XRay_Type
.
Exit_Open
);
SideMove_Z_Axis
.
HomeMove
(
ResetMoveInfo
);
ExitLine_Location_Axis
.
HomeMove
(
ResetMoveInfo
);
break
;
case
MoveStep
.
H02_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
Line_Entry_Axis
.
RelMove
(
ResetMoveInfo
,
Config
.
Line_Entry_Relative
*
2
,
Config
.
Line_Entry_Relative_speed
);
Line_In_Axis
.
RelMove
(
ResetMoveInfo
,
Config
.
Line_In_Relative
*
2
,
Config
.
Line_In_Relative_speed
);
SideMove_X_Axis
.
HomeMove
(
ResetMoveInfo
);
ResetMoveInfo
.
log
(
"正在回原"
);
break
;
case
MoveStep
.
H03_HomeReset
:
...
...
DeviceLibrary/AutoScan/common/AxisBean.cs
查看文件 @
df76da2
...
...
@@ -141,6 +141,10 @@ namespace DeviceLibrary
{
AxisManager
.
SpeedMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetSpeed
);
}
public
bool
IsBusy
{
get
=>
AxisManager
.
GetBusyStatus
(
Config
.
DeviceName
,
Config
.
GetAxisValue
())
==
1
;
}
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
df76da2
...
...
@@ -40,8 +40,9 @@
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
<Reference Include="CodeLibrary, Version=1.0.8693.16314, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
...
...
SO853-AutoCountMachine/SO1451-AutoCountMachine.csproj
查看文件 @
df76da2
...
...
@@ -49,9 +49,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.
7777.3993
4, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="CodeLibrary, Version=1.0.
8693.1631
4, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
<HintPath>..\..\
..\
GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
...
...
@@ -85,7 +85,7 @@
<Reference Include="WindowsBase" />
<Reference Include="X-Ray, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\X-Ray\X-Ray\bin\Debug\X-Ray.dll</HintPath>
<HintPath>..\..\
..\
X-Ray\X-Ray\bin\Debug\X-Ray.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
...
...
SO853-AutoCountMachine/XrayControl.Designer.cs
查看文件 @
df76da2
...
...
@@ -55,6 +55,7 @@ namespace AutoCountMachine
this
.
btn_ManualCount
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cylinderButton4
=
new
AutoCountMachine
.
CylinderButton
();
this
.
cylinderButton5
=
new
AutoCountMachine
.
CylinderButton
();
this
.
btn_linesync
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
...
...
@@ -163,6 +164,7 @@ namespace AutoCountMachine
// panel1
//
this
.
panel1
.
AutoScroll
=
true
;
this
.
panel1
.
Controls
.
Add
(
this
.
btn_linesync
);
this
.
panel1
.
Controls
.
Add
(
this
.
axisMoveControl1
);
this
.
panel1
.
Controls
.
Add
(
this
.
configControl1
);
this
.
panel1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
...
...
@@ -363,6 +365,16 @@ namespace AutoCountMachine
this
.
cylinderButton5
.
Text
=
"Entry_Open"
;
this
.
cylinderButton5
.
UseVisualStyleBackColor
=
false
;
//
// btn_linesync
//
this
.
btn_linesync
.
Location
=
new
System
.
Drawing
.
Point
(
57
,
431
);
this
.
btn_linesync
.
Name
=
"btn_linesync"
;
this
.
btn_linesync
.
Size
=
new
System
.
Drawing
.
Size
(
107
,
26
);
this
.
btn_linesync
.
TabIndex
=
2
;
this
.
btn_linesync
.
Text
=
"皮带同步运行"
;
this
.
btn_linesync
.
UseVisualStyleBackColor
=
true
;
this
.
btn_linesync
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_linesync_Click
);
//
// XrayControl
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -412,5 +424,6 @@ namespace AutoCountMachine
private
System
.
Windows
.
Forms
.
Panel
panel1
;
private
System
.
Windows
.
Forms
.
Panel
panel2
;
private
System
.
Windows
.
Forms
.
Button
btn_Calibration
;
private
System
.
Windows
.
Forms
.
Button
btn_linesync
;
}
}
SO853-AutoCountMachine/XrayControl.cs
查看文件 @
df76da2
...
...
@@ -382,5 +382,28 @@ namespace AutoCountMachine
ManualCountRunning
=
false
;
}
private
void
btn_linesync_Click
(
object
sender
,
EventArgs
e
)
{
Task
.
Run
(()
=>
{
var
Line_Entry_Axis
=
RobotManage
.
xrayMachine
.
Line_Entry_Axis
;
var
Line_In_Axis
=
RobotManage
.
xrayMachine
.
Line_In_Axis
;
var
Config
=
RobotManage
.
xrayMachine
.
Config
;
Line_Entry_Axis
.
Open
(
true
,
out
_
);
Line_In_Axis
.
Open
(
true
,
out
_
);
Line_Entry_Axis
.
SpeedMove
(
Config
.
Line_Entry_Relative_speed
);
Line_In_Axis
.
RelMove
(
null
,
Config
.
Line_In_Relative
,
Config
.
Line_In_Relative_speed
);
RobotManage
.
xrayMachine
.
IOMove
(
IO_XRay_Type
.
ExitLine_Reel_Run
,
IO_VALUE
.
HIGH
);
Task
.
Delay
(
200
).
Wait
();
while
(
Line_In_Axis
.
IsBusy
)
{
Task
.
Delay
(
100
).
Wait
();
}
Task
.
Delay
(
500
).
Wait
();
Line_Entry_Axis
.
SuddenStop
();
RobotManage
.
xrayMachine
.
IOMove
(
IO_XRay_Type
.
ExitLine_Reel_Run
,
IO_VALUE
.
LOW
);
});
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论