Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO827-AutoScanAndLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1c2795a4
由
刘韬
编写于
2022-09-05 17:14:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
d0bf436c
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
126 行增加
和
16 行删除
AutoScanAndLabel/AutoScanAndLabel.csproj
AutoScanAndLabel/IOControl.Designer.cs
AutoScanAndLabel/IOControl.cs
AutoScanAndLabel/app.manifest
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/AxisManager.cs
DeviceLibrary/DeviceLibrary/ElectricGripper.cs
AutoScanAndLabel/AutoScanAndLabel.csproj
查看文件 @
1c2795a
...
...
@@ -15,7 +15,7 @@
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>
AnyCPU
</PlatformTarget>
<PlatformTarget>
x64
</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
...
...
@@ -37,6 +37,9 @@
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.PrintLabel">
<HintPath>..\dll\Asa.PrintLabel.dll</HintPath>
...
...
@@ -51,8 +54,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis">
<HintPath>..\dll\Neotel.Rmaxis.dll</HintPath>
<Reference Include="RmaxisV2, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\RmaxisV2\bin\Debug\RmaxisV2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
...
...
@@ -164,6 +168,7 @@
<EmbeddedResource Include="UC\ListEditControl.resx">
<DependentUpon>ListEditControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
...
...
AutoScanAndLabel/IOControl.Designer.cs
查看文件 @
1c2795a
...
...
@@ -58,6 +58,7 @@ namespace AutoScanAndLabel
this
.
tableLayoutPanel2
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
btn
夹爪回原
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -68,6 +69,7 @@ namespace AutoScanAndLabel
this
.
groupBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnCloseAll
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn
夹爪回原
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn
夹爪夹紧
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn
夹爪放松
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btn
右侧电滚筒停止
);
...
...
@@ -103,7 +105,7 @@ namespace AutoScanAndLabel
//
this
.
btnCloseAll
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnCloseAll
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCloseAll
.
Location
=
new
System
.
Drawing
.
Point
(
16
7
,
515
);
this
.
btnCloseAll
.
Location
=
new
System
.
Drawing
.
Point
(
16
6
,
562
);
this
.
btnCloseAll
.
Name
=
"btnCloseAll"
;
this
.
btnCloseAll
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btnCloseAll
.
TabIndex
=
302
;
...
...
@@ -187,7 +189,7 @@ namespace AutoScanAndLabel
//
this
.
btn
关闭设备光源
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn
关闭设备光源
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn
关闭设备光源
.
Location
=
new
System
.
Drawing
.
Point
(
16
7
,
461
);
this
.
btn
关闭设备光源
.
Location
=
new
System
.
Drawing
.
Point
(
16
6
,
508
);
this
.
btn
关闭设备光源
.
Name
=
"btn关闭设备光源"
;
this
.
btn
关闭设备光源
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btn
关闭设备光源
.
TabIndex
=
293
;
...
...
@@ -199,7 +201,7 @@ namespace AutoScanAndLabel
//
this
.
btn
关闭相机光源
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn
关闭相机光源
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn
关闭相机光源
.
Location
=
new
System
.
Drawing
.
Point
(
3
1
,
461
);
this
.
btn
关闭相机光源
.
Location
=
new
System
.
Drawing
.
Point
(
3
0
,
508
);
this
.
btn
关闭相机光源
.
Name
=
"btn关闭相机光源"
;
this
.
btn
关闭相机光源
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btn
关闭相机光源
.
TabIndex
=
290
;
...
...
@@ -211,7 +213,7 @@ namespace AutoScanAndLabel
//
this
.
btn
打开设备光源
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn
打开设备光源
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn
打开设备光源
.
Location
=
new
System
.
Drawing
.
Point
(
16
7
,
421
);
this
.
btn
打开设备光源
.
Location
=
new
System
.
Drawing
.
Point
(
16
6
,
468
);
this
.
btn
打开设备光源
.
Name
=
"btn打开设备光源"
;
this
.
btn
打开设备光源
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btn
打开设备光源
.
TabIndex
=
293
;
...
...
@@ -223,7 +225,7 @@ namespace AutoScanAndLabel
//
this
.
btn
打开相机光源
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn
打开相机光源
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn
打开相机光源
.
Location
=
new
System
.
Drawing
.
Point
(
3
1
,
421
);
this
.
btn
打开相机光源
.
Location
=
new
System
.
Drawing
.
Point
(
3
0
,
468
);
this
.
btn
打开相机光源
.
Name
=
"btn打开相机光源"
;
this
.
btn
打开相机光源
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btn
打开相机光源
.
TabIndex
=
290
;
...
...
@@ -444,6 +446,18 @@ namespace AutoScanAndLabel
this
.
tableLayoutPanel1
.
Size
=
new
System
.
Drawing
.
Size
(
244
,
718
);
this
.
tableLayoutPanel1
.
TabIndex
=
102
;
//
// btn夹爪回原
//
this
.
btn
夹爪回原
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btn
夹爪回原
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn
夹爪回原
.
Location
=
new
System
.
Drawing
.
Point
(
30
,
412
);
this
.
btn
夹爪回原
.
Name
=
"btn夹爪回原"
;
this
.
btn
夹爪回原
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
34
);
this
.
btn
夹爪回原
.
TabIndex
=
297
;
this
.
btn
夹爪回原
.
Text
=
"夹爪回原"
;
this
.
btn
夹爪回原
.
UseVisualStyleBackColor
=
false
;
this
.
btn
夹爪回原
.
Click
+=
new
System
.
EventHandler
(
this
.
btn
夹爪回原
_Click
);
//
// IOControl
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -494,5 +508,6 @@ namespace AutoScanAndLabel
private
System
.
Windows
.
Forms
.
Button
btn
关闭相机光源
;
private
System
.
Windows
.
Forms
.
Button
btn
右侧电滚筒停止
;
private
System
.
Windows
.
Forms
.
Button
btn
左侧电滚筒停止
;
private
System
.
Windows
.
Forms
.
Button
btn
夹爪回原
;
}
}
AutoScanAndLabel/IOControl.cs
查看文件 @
1c2795a
...
...
@@ -292,5 +292,10 @@ namespace AutoScanAndLabel
{
IOManager
.
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
LOW
);
}
private
void
btn
夹爪回原
_Click
(
object
sender
,
EventArgs
e
)
{
RobotManage
.
electricGripper
.
HomeReset
();
}
}
}
AutoScanAndLabel/app.manifest
0 → 100644
查看文件 @
1c2795a
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
1c2795a
...
...
@@ -50,8 +50,9 @@
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis">
<HintPath>..\dll\Neotel.Rmaxis.dll</HintPath>
<Reference Include="RmaxisV2, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\RmaxisV2\bin\Debug\RmaxisV2.dll</HintPath>
</Reference>
<Reference Include="SdkApi.Core">
<HintPath>..\dll\SdkApi.Core.dll</HintPath>
...
...
DeviceLibrary/DeviceLibrary/AxisManager.cs
查看文件 @
1c2795a
...
...
@@ -56,7 +56,7 @@ namespace DeviceLibrary
public
static
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
,
int
acc
,
int
dec
)
{
instance
.
SpeedMove
(
portName
,
slvAddr
,
speed
,
acc
,
dec
);
instance
.
SpeedMove
(
portName
,
slvAddr
,
speed
,
0
,
0
);
}
public
static
void
SuddenStop
(
string
portName
,
short
slvAddr
)
{
...
...
DeviceLibrary/DeviceLibrary/ElectricGripper.cs
查看文件 @
1c2795a
...
...
@@ -36,7 +36,8 @@ namespace DeviceLibrary
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitAction
),
crc
.
GetString
(
"Res0192"
,
"夹爪夹紧"
)));
if
(!
IsBusy
)
{
axis
.
Push
(
ConfigHelper
.
Config
.
Get
(
"ElectricGripperPushForce"
,
40
),
4.5f
,
15
);
axis
.
ResetError
();
axis
.
Push
(
ConfigHelper
.
Config
.
Get
(
"ElectricGripperPushForce"
,
40
),
6f
,
20
);
clampTimes
++;
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
...
...
@@ -54,9 +55,13 @@ namespace DeviceLibrary
public
bool
Release
(
MoveInfo
moveInfo
=
null
)
{
GripperType
=
GripperTypeE
.
Release
;
HomeReset
();
return
true
;
if
(!
IsBusy
)
{
axis
.
MoveAbsolute
(
0
,
30
,
500
,
500
,
0.1f
);
axis
.
StopAxis
();
axis
.
ResetError
();
axis
.
MoveAbsolute
(
0
,
50
,
100
,
100
,
0.5f
);
clampTimes
=
0
;
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
...
...
@@ -72,8 +77,9 @@ namespace DeviceLibrary
public
void
HomeReset
(
MoveInfo
moveInfo
=
null
)
{
GripperType
=
GripperTypeE
.
Reset
;
ClosePort
();
OpenPort
(
ConfigHelper
.
Config
.
Get
(
"ElectricGripperPort"
));
//ClosePort();
//OpenPort(ConfigHelper.Config.Get("ElectricGripperPort"));
axis
.
StopAxis
();
axis
.
ResetError
();
axis
.
GoHome
();
clampTimes
=
0
;
...
...
@@ -87,7 +93,7 @@ namespace DeviceLibrary
{
LogUtil
.
info
(
$
"ElectricGripper IsReached:{axis.IsReached},IsMoving:{axis.IsMoving}"
);
//return false;
return
!
axis
.
IsReached
;
return
axis
.
IsMoving
;
}
}
public
bool
IsClamp
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论