Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO775-DUOStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit dfbc8272
由
刘韬
编写于
2021-08-04 11:30:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
稳定版
1 个父辈
d4b24431
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
471 行增加
和
129 行删除
source/Common/Common.csproj
source/Common/Setting_Init.cs
source/Common/util/HumitureController.cs
source/DUOStore/App.config
source/DUOStore/DUOStore.csproj
source/DUOStore/FrmAxisMove.Designer.cs
source/DUOStore/FrmAxisMove.cs
source/DUOStore/FrmBox.cs
source/DUOStore/FrmStore.cs
source/DUOStore/Properties/Settings.Designer.cs
source/DUOStore/Properties/Settings.settings
source/DUOStore/Settings1.Designer.cs
source/DUOStore/Settings1.settings
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/Properties/Settings1.Designer.cs
source/DeviceLibrary/Properties/Settings1.settings
source/DeviceLibrary/StoreConfig/StoreConfig.csv
source/DeviceLibrary/app.config
source/DeviceLibrary/device/halcon/CodeManager.cs
source/DeviceLibrary/duoStore/BoxBean.cs
source/DeviceLibrary/duoStore/BoxBean_Camera.cs
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
source/DeviceLibrary/duoStore/DUOStoreBean.cs
source/DeviceLibrary/duoStore/DUOStoreBean_Partial.cs
source/DeviceLibrary/duoStore/ElectricGripper.cs
source/DeviceLibrary/duoStore/EquipBase.cs
source/DeviceLibrary/duoStore/HumitureBean.cs
source/DeviceLibrary/duoStore/StoreManager.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/StoreStep.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/Common/Common.csproj
查看文件 @
dfbc827
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.
5
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
source/Common/Setting_Init.cs
查看文件 @
dfbc827
...
...
@@ -99,8 +99,8 @@ namespace OnlineStore.Common
public
static
string
CodeCount
=
"CodeCount"
;
public
static
string
CurrShelfNum
=
"CurrShelfNum"
;
public
static
string
CurrShelfType
=
"CurrShelfType"
;
//
public static string CurrShelfNum = "CurrShelfNum";
//
public static string CurrShelfType = "CurrShelfType";
//是否有T4进出轴
public
static
string
HasT4Axis
=
"HasT4Axis"
;
...
...
@@ -110,6 +110,7 @@ namespace OnlineStore.Common
public
static
string
code_block_size_list
=
"code_block_size_list"
;
public
static
string
InstoreEndSendShelf
=
"InstoreEndSendShelf"
;
public
static
string
OutstoreEndSendShelf
=
"OutstoreEndSendShelf"
;
public
static
string
LastOutShelfType
=
"LastOutShelfType"
;
public
static
string
ElectricGripperForce
=
"ElectricGripperForce"
;
//public static string LastOutShelfType= "LastOutShelfType";
}
}
source/Common/util/HumitureController.cs
查看文件 @
dfbc827
...
...
@@ -27,36 +27,39 @@ namespace OnlineStore.Common
public
static
int
HumitureControllerType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
HumitureControllerType
);
public
static
bool
Init
(
string
port
)
{
if
(
serialBeanMap
.
ContainsKey
(
port
)
)
lock
(
serialBeanMap
)
{
return
true
;
}
LogName
=
"温湿度传感器["
+
port
+
"]"
;
AcSerialBean
sb
=
null
;
if
(
HumitureControllerType
.
Equals
(
1
))
{
bautRate
=
9600
;
//波特率
}
sb
=
new
AcSerialBean
(
port
,
bautRate
,
parity
,
dataBits
,
stopBits
);
try
{
if
(
sb
.
openPort
())
if
(
serialBeanMap
.
ContainsKey
(
port
))
{
serialBeanMap
.
Add
(
port
,
sb
);
return
true
;
}
else
LogName
=
"温湿度传感器["
+
port
+
"]"
;
AcSerialBean
sb
=
null
;
if
(
HumitureControllerType
.
Equals
(
1
))
{
LogUtil
.
error
(
LogName
+
"串口"
+
port
+
"打开失败!"
);
return
false
;
bautRate
=
9600
;
//波特率
}
sb
=
new
AcSerialBean
(
port
,
bautRate
,
parity
,
dataBits
,
stopBits
);
try
{
if
(
sb
.
openPort
())
{
serialBeanMap
.
Add
(
port
,
sb
);
return
true
;
}
else
{
LogUtil
.
error
(
LogName
+
"串口"
+
port
+
"打开失败!"
);
return
false
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"串口"
+
port
+
"打开失败:"
+
ex
.
ToString
());
}
return
true
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"串口"
+
port
+
"打开失败:"
+
ex
.
ToString
());
}
return
true
;
}
/// <summary>
/// 释放资源
...
...
source/DUOStore/App.config
查看文件 @
dfbc827
...
...
@@ -2,6 +2,9 @@
<
configuration
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
<
sectionGroup
name
=
"userSettings"
type
=
"System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<
section
name
=
"OnlineStore.DUOStore.Properties.Settings"
type
=
"System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition
=
"MachineToLocalUser"
requirePermission
=
"false"
/>
</
sectionGroup
>
</
configSections
>
<
appSettings
>
<!--是否开机自动启动料仓-->
...
...
@@ -60,8 +63,9 @@
<
add
key
=
"HasT4Axis"
value
=
"true"
/>
<
add
key
=
"AgvServerIp"
value
=
"192.168.11.11"
/>
<
add
key
=
"Code_Block_Size_List"
value
=
"17,19"
/>
<
add
key
=
"InstoreEndSendShelf"
value
=
"1"
/>
<
add
key
=
"OutstoreEndSendShelf"
value
=
"1"
/>
<
add
key
=
"InstoreEndSendShelf"
value
=
"1"
/>
<
add
key
=
"OutstoreEndSendShelf"
value
=
"1"
/>
<
add
key
=
"ElectricGripperForce"
value
=
"50"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
@@ -128,4 +132,17 @@
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.7.2"
/>
</
startup
>
<
userSettings
>
<
OnlineStore
.
DUOStore
.
Properties
.
Settings
>
<
setting
name
=
"CurrShelfNum"
serializeAs
=
"String"
>
<
value
/>
</
setting
>
<
setting
name
=
"CurrShelfType"
serializeAs
=
"String"
>
<
value
>
0
</
value
>
</
setting
>
<
setting
name
=
"LastOutShelfType"
serializeAs
=
"String"
>
<
value
>
0
</
value
>
</
setting
>
</
OnlineStore
.
DUOStore
.
Properties
.
Settings
>
</
userSettings
>
</
configuration
>
source/DUOStore/DUOStore.csproj
查看文件 @
dfbc827
...
...
@@ -38,7 +38,10 @@
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Agv, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="Agv, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\775-agv-net4.6.1\Agv.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.7380.18241, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
...
...
@@ -127,6 +130,11 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
<Compile Include="useControl\AxisMoveControl.cs">
<SubType>UserControl</SubType>
</Compile>
...
...
@@ -193,6 +201,10 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
...
...
source/DUOStore/FrmAxisMove.Designer.cs
查看文件 @
dfbc827
...
...
@@ -28,6 +28,8 @@ namespace OnlineStore.DUOStore
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
FrmAxisMove
));
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
groupInout
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
txtInOutP6
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnInOutP6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSaveP
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
txtT2P4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnT2P4
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -65,8 +67,7 @@ namespace OnlineStore.DUOStore
this
.
btnMiddleP3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
axisMoveControl1
=
new
OnlineStore
.
DUOStore
.
AxisMoveControl
();
this
.
btnSotreReset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
txtInOutP6
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnInOutP6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupInout
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -122,6 +123,40 @@ namespace OnlineStore.DUOStore
this
.
groupInout
.
TabStop
=
false
;
this
.
groupInout
.
Text
=
"提升机构位置信息"
;
//
// txtInOutP6
//
this
.
txtInOutP6
.
AcceptsReturn
=
true
;
this
.
txtInOutP6
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
txtInOutP6
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
IBeam
;
this
.
txtInOutP6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtInOutP6
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
WindowText
;
this
.
txtInOutP6
.
Location
=
new
System
.
Drawing
.
Point
(
583
,
185
);
this
.
txtInOutP6
.
MaxLength
=
0
;
this
.
txtInOutP6
.
Name
=
"txtInOutP6"
;
this
.
txtInOutP6
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
txtInOutP6
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
23
);
this
.
txtInOutP6
.
TabIndex
=
316
;
this
.
txtInOutP6
.
Text
=
"999999"
;
//
// btnInOutP6
//
this
.
btnInOutP6
.
AutoSize
=
true
;
this
.
btnInOutP6
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnInOutP6
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
btnInOutP6
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnInOutP6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnInOutP6
.
ForeColor
=
System
.
Drawing
.
Color
.
DarkGoldenrod
;
this
.
btnInOutP6
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP6
.
Location
=
new
System
.
Drawing
.
Point
(
372
,
180
);
this
.
btnInOutP6
.
Name
=
"btnInOutP6"
;
this
.
btnInOutP6
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP6
.
Size
=
new
System
.
Drawing
.
Size
(
205
,
33
);
this
.
btnInOutP6
.
TabIndex
=
315
;
this
.
btnInOutP6
.
Text
=
"T4_进出轴13寸取料点进入前点P6"
;
this
.
btnInOutP6
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP6
.
UseVisualStyleBackColor
=
false
;
this
.
btnInOutP6
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInOutP6_Click
);
//
// btnSaveP
//
this
.
btnSaveP
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
...
...
@@ -717,45 +752,23 @@ namespace OnlineStore.DUOStore
this
.
btnSotreReset
.
UseVisualStyleBackColor
=
true
;
this
.
btnSotreReset
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSotreReset_Click
);
//
// txtInOutP6
//
this
.
txtInOutP6
.
AcceptsReturn
=
true
;
this
.
txtInOutP6
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
txtInOutP6
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
IBeam
;
this
.
txtInOutP6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtInOutP6
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
WindowText
;
this
.
txtInOutP6
.
Location
=
new
System
.
Drawing
.
Point
(
583
,
185
);
this
.
txtInOutP6
.
MaxLength
=
0
;
this
.
txtInOutP6
.
Name
=
"txtInOutP6"
;
this
.
txtInOutP6
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
txtInOutP6
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
23
);
this
.
txtInOutP6
.
TabIndex
=
316
;
this
.
txtInOutP6
.
Text
=
"999999"
;
// button1
//
// btnInOutP6
//
this
.
btnInOutP6
.
AutoSize
=
true
;
this
.
btnInOutP6
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnInOutP6
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
btnInOutP6
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnInOutP6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnInOutP6
.
ForeColor
=
System
.
Drawing
.
Color
.
DarkGoldenrod
;
this
.
btnInOutP6
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP6
.
Location
=
new
System
.
Drawing
.
Point
(
372
,
180
);
this
.
btnInOutP6
.
Name
=
"btnInOutP6"
;
this
.
btnInOutP6
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP6
.
Size
=
new
System
.
Drawing
.
Size
(
205
,
33
);
this
.
btnInOutP6
.
TabIndex
=
315
;
this
.
btnInOutP6
.
Text
=
"T4_进出轴13寸取料点进入前点P6"
;
this
.
btnInOutP6
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP6
.
UseVisualStyleBackColor
=
false
;
this
.
btnInOutP6
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInOutP6_Click
);
this
.
button1
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
182
,
414
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
128
,
39
);
this
.
button1
.
TabIndex
=
276
;
this
.
button1
.
Text
=
"夹爪测试"
;
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
// FrmAxisMove
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1323
,
559
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Controls
.
Add
(
this
.
btnSotreReset
);
this
.
Controls
.
Add
(
this
.
groupInout
);
this
.
Controls
.
Add
(
this
.
axisMoveControl1
);
...
...
@@ -815,6 +828,7 @@ namespace OnlineStore.DUOStore
private
System
.
Windows
.
Forms
.
Button
btnSotreReset
;
public
System
.
Windows
.
Forms
.
TextBox
txtInOutP6
;
public
System
.
Windows
.
Forms
.
Button
btnInOutP6
;
private
System
.
Windows
.
Forms
.
Button
button1
;
}
}
source/DUOStore/FrmAxisMove.cs
查看文件 @
dfbc827
...
...
@@ -18,6 +18,7 @@ using System.IO.Ports;
using
OnlineStore.LoadCSVLibrary
;
using
CodeLibrary
;
using
UserFromControl
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DUOStore
{
...
...
@@ -233,6 +234,29 @@ namespace OnlineStore.DUOStore
}
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
Task
.
Run
(()=>
{
bool
isclamp
=
false
;
int
i
=
0
;
var
ec
=
StoreManager
.
Store
.
electricClamp
;
ec
.
OpenPort
(
StoreManager
.
Config
.
Clamp1Port
);
while
(
i
<
50
)
{
i
++;
LogUtil
.
info
(
$
"electricClamp [{i}] isclamp:{isclamp},Action:{(isclamp?"
Release
":"
Clamp
")}, IsMoving:{ec.IsMoving}, IsPushEmpty:{ec.IsPushEmpty}, IsReached:{ec.IsReached}, ErrorCode:{ec.ErrorCode}"
);
if
(
isclamp
)
{
if
(
ec
.
Release
())
{
isclamp
=
false
;
}
}
else
if
(
ec
.
Clamp
())
{
isclamp
=
true
;
}
Task
.
Delay
(
100
).
Wait
();
}
});
}
}
}
source/DUOStore/FrmBox.cs
查看文件 @
dfbc827
...
...
@@ -842,7 +842,10 @@ namespace OnlineStore.DUOStore
private
void
btn_clearTimeout_Click
(
object
sender
,
EventArgs
e
)
{
if
(
BoxBean
.
alarmType
==
AlarmType
.
IoSingleTimeOut
)
{
LogUtil
.
info
(
"用户点击清除IO等待 "
);
BoxBean
.
MoveInfo
.
EndStepWait
();
}
}
}
}
source/DUOStore/FrmStore.cs
查看文件 @
dfbc827
...
...
@@ -522,11 +522,16 @@ namespace OnlineStore.DUOStore
UpdateListBox
();
lblWarnMsg
.
Text
=
msg
;
//if (StoreManager.FrontDoorOpen) {
// lblWarnMsg.Text += "\r\n前门打开, 系统暂停运行,关门后请按复位按钮继续.";
//}
lblAgv
.
Text
=
"AGV状态:\n"
;
lblAgv
.
Text
+=
$
" 入口{StoreManager.Store.Config.AgvInName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvInName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvInName)}\n"
;
lblAgv
.
Text
+=
$
" 出口{StoreManager.Store.Config.AgvOutName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvOutName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvOutName)}\n"
;
//StoreManager.Store.electricClamp.IsBusy
LogM
();
}
...
...
source/DUOStore/Properties/Settings.Designer.cs
查看文件 @
dfbc827
...
...
@@ -22,5 +22,41 @@ namespace OnlineStore.DUOStore.Properties {
return
defaultInstance
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
""
)]
public
string
CurrShelfNum
{
get
{
return
((
string
)(
this
[
"CurrShelfNum"
]));
}
set
{
this
[
"CurrShelfNum"
]
=
value
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
"0"
)]
public
int
CurrShelfType
{
get
{
return
((
int
)(
this
[
"CurrShelfType"
]));
}
set
{
this
[
"CurrShelfType"
]
=
value
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
"0"
)]
public
int
LastOutShelfType
{
get
{
return
((
int
)(
this
[
"LastOutShelfType"
]));
}
set
{
this
[
"LastOutShelfType"
]
=
value
;
}
}
}
}
source/DUOStore/Properties/Settings.settings
查看文件 @
dfbc827
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OnlineStore.DUOStore.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="CurrShelfNum" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="CurrShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="LastOutShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
source/DUOStore/Settings1.Designer.cs
0 → 100644
查看文件 @
dfbc827
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace
OnlineStore.DUOStore
{
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"16.8.1.0"
)]
internal
sealed
partial
class
Settings1
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings1
defaultInstance
=
((
Settings1
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings1
())));
public
static
Settings1
Default
{
get
{
return
defaultInstance
;
}
}
}
}
source/DUOStore/Settings1.settings
0 → 100644
查看文件 @
dfbc827
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
dfbc827
...
...
@@ -109,6 +109,11 @@
<Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="device\IO\IOManager.cs" />
<Compile Include="Properties\Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
<Compile Include="store\AutoInoutInfo.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
...
...
@@ -144,6 +149,11 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
<None Include="StoreConfig\box_1_Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
...
...
source/DeviceLibrary/Properties/Settings1.Designer.cs
0 → 100644
查看文件 @
dfbc827
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace
OnlineStore.DeviceLibrary.Properties
{
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"16.8.1.0"
)]
internal
sealed
partial
class
Settings1
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings1
defaultInstance
=
((
Settings1
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings1
())));
public
static
Settings1
Default
{
get
{
return
defaultInstance
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
""
)]
public
string
CurrShelfNum
{
get
{
return
((
string
)(
this
[
"CurrShelfNum"
]));
}
set
{
this
[
"CurrShelfNum"
]
=
value
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
"0"
)]
public
int
CurrShelfType
{
get
{
return
((
int
)(
this
[
"CurrShelfType"
]));
}
set
{
this
[
"CurrShelfType"
]
=
value
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
"0"
)]
public
int
LastOutShelfType
{
get
{
return
((
int
)(
this
[
"LastOutShelfType"
]));
}
set
{
this
[
"LastOutShelfType"
]
=
value
;
}
}
}
}
source/DeviceLibrary/Properties/Settings1.settings
0 → 100644
查看文件 @
dfbc827
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OnlineStore.DeviceLibrary.Properties" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="CurrShelfNum" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="CurrShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="LastOutShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
source/DeviceLibrary/StoreConfig/StoreConfig.csv
查看文件 @
dfbc827
...
...
@@ -51,7 +51,7 @@ DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,,
DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,,
DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,,
DI,0,15寸料盘宽度检测,TrayCheck_15,39,HC,X39,*,,,,,,,,,
DI,0,
卡爪范围确认,Clamp_InRange
,40,HC,X40,*,,,,,,,,,
DI,0,
前门门禁信号,FrontDoor_Check
,40,HC,X40,*,,,,,,,,,
DI,0,卡爪动作中,Clamp_Busy,41,HC,X41,*,,,,,,,,,
DI,0,卡爪异常代码1,Clamp_Abnormal1,42,HC,X42,*,,,,,,,,,
DI,0,卡爪异常代码2,Clamp_Abnormal2,43,HC,X43,*,,,,,,,,,
...
...
source/DeviceLibrary/app.config
0 → 100644
查看文件 @
dfbc827
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
configSections
>
<
sectionGroup
name
=
"userSettings"
type
=
"System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<
section
name
=
"OnlineStore.DeviceLibrary.Properties.Settings1"
type
=
"System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition
=
"MachineToLocalUser"
requirePermission
=
"false"
/>
</
sectionGroup
>
</
configSections
>
<
userSettings
>
<
OnlineStore
.
DeviceLibrary
.
Properties
.
Settings1
>
<
setting
name
=
"CurrShelfNum"
serializeAs
=
"String"
>
<
value
/>
</
setting
>
<
setting
name
=
"CurrShelfType"
serializeAs
=
"String"
>
<
value
>
0
</
value
>
</
setting
>
<
setting
name
=
"LastOutShelfType"
serializeAs
=
"String"
>
<
value
>
0
</
value
>
</
setting
>
</
OnlineStore
.
DeviceLibrary
.
Properties
.
Settings1
>
</
userSettings
>
<
startup
><
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.7.2"
/></
startup
></
configuration
>
source/DeviceLibrary/device/halcon/CodeManager.cs
查看文件 @
dfbc827
...
...
@@ -161,13 +161,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
string
r
=
""
;
foreach
(
int
codesize
in
Code_Block_Size_List
)
//
foreach (int codesize in Code_Block_Size_List)
{
List
<
CodeInfo
>
tlci
=
EyemDecode
.
Decoder
(
ref
bmp
,
null
,
codesize
);
List
<
CodeInfo
>
tlci
=
EyemDecode
2
.
Decoder
(
ref
bmp
,
null
);
foreach
(
CodeInfo
code
in
tlci
)
{
LogUtil
.
info
(
" 【"
+
cameraName
+
$
"】[eyemDecode
blocksize:{codesize}
]"
+
code
.
CodeType
+
"(X: "
+
code
.
X
+
",Y: "
+
code
.
Y
+
") "
+
code
.
CodeStr
);
LogUtil
.
info
(
" 【"
+
cameraName
+
$
"】[eyemDecode]"
+
code
.
CodeType
+
"(X: "
+
code
.
X
+
",Y: "
+
code
.
Y
+
") "
+
code
.
CodeStr
);
string
str
=
CodeManager
.
ReplaceCode
(
code
.
CodeStr
);
lock
(
codeList
)
{
...
...
@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
codeType
,
GetCodeParamFilePath
(
codeType
),
codeCount
,
2
0
00
);
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
codeType
,
GetCodeParamFilePath
(
codeType
),
codeCount
,
2
5
00
);
}
foreach
(
CodeInfo
c
in
cc
)
{
...
...
source/DeviceLibrary/duoStore/BoxBean.cs
查看文件 @
dfbc827
...
...
@@ -115,7 +115,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
"启动失败:设备被禁用"
);
return
false
;
}
LogInfo
(
"开始启动,启动时间:"
+
StartTime
.
ToString
());
LogInfo
(
"开始启动,启动时间:"
+
StartTime
.
ToString
());
WarnMsg
=
""
;
AutoInout
.
StopAuto
();
mainTimer
.
Enabled
=
false
;
alarmType
=
AlarmType
.
None
;
...
...
@@ -393,7 +394,7 @@ namespace OnlineStore.DeviceLibrary
&&
IOValue
(
IO_Type
.
OutDoor_SafeSignal
).
Equals
(
IO_VALUE
.
LOW
))
{
OutDoorCloseCountDown
--;
while
(
OutDoorCloseCountDown
==
0
)
if
(
OutDoorCloseCountDown
==
0
)
{
CylinderMove
(
MoveInfo
,
IO_Type
.
OutDoor_Up
,
IO_Type
.
OutDoor_Down
);
LogInfo
(
"料已被取走,关门"
);
...
...
source/DeviceLibrary/duoStore/BoxBean_Camera.cs
查看文件 @
dfbc827
...
...
@@ -55,17 +55,38 @@ namespace OnlineStore.DeviceLibrary
camera
.
Dispose
();
}
void
CameraGrabOne
(
string
filename
)
{
LogUtil
.
info
(
Name
+
"库位文件名:"
+
filename
);
return
;
if
(!
camera
.
IsOpen
[
0
])
{
camera
.
Open
(
0
);
LogUtil
.
error
(
Name
+
"打开监控相机失败2"
);
}
var
rtn
=
camera
.
GrabOne
(
0
,
out
Bitmap
bmp
);
if
(
rtn
)
try
{
bmp
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
bmp
.
Dispose
();
LogUtil
.
info
(
Name
+
"库位文件名:"
+
filename
);
//return;
if
(!
camera
.
IsOpen
[
0
])
{
camera
.
Open
(
0
);
LogUtil
.
error
(
Name
+
"打开监控相机失败2"
);
}
var
rtn
=
camera
.
GrabOne
(
0
,
out
Bitmap
bmp
);
if
(
rtn
)
{
if
(
File
.
Exists
(
filename
))
File
.
Delete
(
filename
);
bmp
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
bmp
.
Dispose
();
}
else
{
rtn
=
camera
.
GrabOne
(
0
,
out
bmp
);
if
(
rtn
)
{
if
(
File
.
Exists
(
filename
))
File
.
Delete
(
filename
);
bmp
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
bmp
.
Dispose
();
}
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
Name
+
e
.
ToString
());
}
}
string
GetFixtureStateFilename
(
InOutParam
inOutParam
,
FixtureState
fixtureState
)
{
...
...
@@ -81,6 +102,7 @@ namespace OnlineStore.DeviceLibrary
enum
FixtureState
{
In
,
Up
,
Down
,
Out
}
}
...
...
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
查看文件 @
dfbc827
...
...
@@ -162,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_02_AxisBack
))
{
if
(
true
||
StoreManager
.
Store
.
BoxDoorFree
(
ID
))
if
(
StoreManager
.
Store
.
BoxDoorFree
(
ID
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_03_InoutToP2
);
InOutStoreLog
(
outType
+
"进出轴到P2["
+
moveP
.
InOut_P2
+
"] "
);
...
...
@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_03_InoutToP2
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
In
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_04_GetReel
);
InOutStoreLog
(
outType
+
"升降轴到入料口高点P2 ["
+
moveP
.
UpDown_P2
+
"],压紧轴到P2 ["
+
moveP
.
ComPress_P2
+
"] "
);
ComAxis
.
AbsMove
(
MoveInfo
,
moveP
.
ComPress_P2
,
Config
.
CompAxis_P2_Speed
);
...
...
@@ -186,14 +186,14 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_04_GetReel
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
Up
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_05_InoutToP1
);
InOutStoreLog
(
outType
+
"进出轴返回P1 ["
+
moveP
.
InOut_P1
+
"] "
);
InOutBackToP1
(
moveP
.
InOut_P1
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_05_InoutToP1
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
Out
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_06_FixtureCheck
);
InOutStoreLog
(
outType
+
"等待料叉检测信号 "
);
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
))
...
...
@@ -227,6 +227,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_07_InoutToP3
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
In
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_08_PutReel
);
InOutStoreLog
(
outType
+
"升降轴到P4["
+
moveP
.
UpDown_P4
+
"],压紧轴到P3["
+
moveP
.
ComPress_P3
+
"]"
);
...
...
@@ -240,6 +241,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_08_PutReel
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
Down
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_09_InoutToP1
);
InOutStoreLog
(
outType
+
"进出轴返回P1 ["
+
moveP
.
InOut_P1
+
"] "
);
InOutBackToP1
(
moveP
.
InOut_P1
);
...
...
@@ -247,6 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SI_09_InoutToP1
))
{
CameraGrabOne
(
GetFixtureStateFilename
(
MoveInfo
.
MoveParam
,
FixtureState
.
Out
));
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SI_10_GoBack
);
InOutStoreLog
(
outType
+
"升降轴到P1["
+
moveP
.
UpDown_P1
+
"],旋转轴到P1["
+
moveP
.
Middle_P1
+
"] ,压紧轴到P1["
+
moveP
.
ComPress_P1
+
"],"
);
//ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
...
...
@@ -300,7 +303,7 @@ namespace OnlineStore.DeviceLibrary
OutDoorReelType
=
2
;
else
OutDoorReelType
=
1
;
InOutStoreLog
(
outType
+
"打开出料口门
"
);
InOutStoreLog
(
outType
+
"打开出料口门
OutDoor_Check:"
+
IOValue
(
IO_Type
.
OutDoor_Check
).
ToString
()
);
CylinderMove
(
MoveInfo
,
IO_Type
.
OutDoor_Down
,
IO_Type
.
OutDoor_Up
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
OutDoor_Check
,
IO_VALUE
.
LOW
));
}
...
...
@@ -336,7 +339,7 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
#
region
出库
private
DateTime
startOutStoreTime
=
DateTime
.
Now
;
private
void
StartExecuctOut
(
InOutParam
param
)
...
...
@@ -543,14 +546,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_06A_04_FixDisk
);
InOutStoreLog
(
outType
+
"[修正]升降轴到P4["
+
fixMoveP
.
UpDown_P4
+
"],压紧轴到P3["
+
moveP
.
ComPress_P3
+
"]"
);
ComAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
*
3
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
UpDown_P4
,
Config
.
UpDownAxis_P4_Speed
*
3
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
UpDown_P4
,
Config
.
UpDownAxis_P4_Speed
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SO_06A_04_FixDisk
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_06A_05_FixDisk
);
InOutStoreLog
(
outType
+
"[修正]升降轴到P6["
+
fixMoveP
.
UpDown_P6
+
"],压紧轴到P2["
+
fixMoveP
.
ComPress_P2
+
"]"
);
ComAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
ComPress_P2
,
Config
.
CompAxis_P2_Speed
*
3
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
UpDown_P6
,
Config
.
UpDownAxis_P6_Speed
*
3
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
fixMoveP
.
UpDown_P6
,
Config
.
UpDownAxis_P6_Speed
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SO_06A_05_FixDisk
))
{
...
...
source/DeviceLibrary/duoStore/DUOStoreBean.cs
查看文件 @
dfbc827
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/duoStore/DUOStoreBean_Partial.cs
查看文件 @
dfbc827
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/duoStore/ElectricGripper.cs
查看文件 @
dfbc827
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
...
...
@@ -10,8 +12,12 @@ namespace OnlineStore.DeviceLibrary
public
class
ElectricGripper
{
private
int
subType
=
0
;
private
Neotel
.
Rmaxis
axis
;
public
Neotel
.
Rmaxis
axis
;
private
int
Force
=
50
;
public
Enum
GripperType
=
GripperTypeE
.
None
;
public
ElectricGripper
(
int
force
){
Force
=
force
;
}
public
bool
OpenPort
(
string
port
)
{
axis
=
new
Neotel
.
Rmaxis
();
...
...
@@ -22,57 +28,76 @@ namespace OnlineStore.DeviceLibrary
public
void
ClosePort
()
{
axis
.
ClosePort
();
}
public
void
Clamp
(
StoreMoveInfo
moveInfo
=
null
,
int
plateW
=
7
)
public
bool
Clamp
(
StoreMoveInfo
moveInfo
=
null
,
int
plateW
=
7
)
{
GripperType
=
GripperTypeE
.
Gripper
;
if
(!
IsBusy
)
{
//if (plateW > 7)
if
(
true
)
try
{
axis
.
Push
(
99
,
7
,
10
);
axis
.
Push
(
Force
,
4.5f
,
15
);
}
else
{
axis
.
Push
(
50
,
7
,
10
)
;
catch
(
Exception
e
)
{
LogUtil
.
info
(
e
.
ToString
());
return
false
;
}
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
return
true
;
}
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitAction
)));
return
false
;
}
public
bool
Release
(
StoreMoveInfo
moveInfo
=
null
)
{
GripperType
=
GripperTypeE
.
Release
;
if
(!
IsBusy
)
{
axis
.
GoHome
();
//axis.StopAxis();
//Thread.Sleep(500);
axis
.
MoveAbsolute
(
0
,
30
,
500
,
500
,
0.1f
);
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
return
true
;
}
else
{
//axis.StopAxis();
//Thread.Sleep(500);
//axis.GoHome();
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitAction
)));
return
false
;
}
}
public
void
HomeReset
(
StoreMoveInfo
moveInfo
=
null
)
{
public
void
HomeReset
(
StoreMoveInfo
moveInfo
=
null
)
{
GripperType
=
GripperTypeE
.
Reset
;
//if (!IsBusy)
//{
axis
.
ResetError
();
axis
.
GoHome
();
// }
axis
.
StopAxis
();
axis
.
ResetError
();
axis
.
GoHome
();
// }
//if (moveInfo != null)
// moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
}
public
bool
IsBusy
{
get
{
//axis.GetPosition();
return
!
axis
.
IsReached
;
LogUtil
.
info
(
$
"ElectricGripper IsReached:{axis.IsReached},IsMoving:{axis.IsMoving},Pos:{axis.GetPosition()}"
);
//return false;
try
{
return
!
axis
.
IsReached
;
}
catch
(
Exception
e
)
{
LogUtil
.
info
(
e
.
ToString
());
return
true
;
}
}
}
public
bool
IsClamp
{
...
...
@@ -82,6 +107,10 @@ namespace OnlineStore.DeviceLibrary
return
!
axis
.
IsPushEmpty
;
}
}
public
bool
IsPushEmpty
{
get
=>
axis
.
IsPushEmpty
;
}
public
bool
IsMoving
{
get
=>
axis
.
IsMoving
;
}
public
bool
IsReached
{
get
=>
axis
.
IsReached
;
}
public
int
ErrorCode
{
get
=>
axis
.
ErrorCode
;
}
bool
WaitAction
(
WaitResultInfo
w
)
{
...
...
source/DeviceLibrary/duoStore/EquipBase.cs
查看文件 @
dfbc827
...
...
@@ -72,7 +72,12 @@ namespace OnlineStore.DeviceLibrary
{
InProcess
=
true
;
stopwatch
.
Restart
();
TimerProcess
();
if
(!
StoreManager
.
FrontDoorOpen
)
TimerProcess
();
else
{
WarnMsg
=
"前维护门打开,系统暂停运行."
;
}
ShowTimeLog
(
"TimerProcess"
);
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/duoStore/HumitureBean.cs
查看文件 @
dfbc827
...
...
@@ -67,11 +67,14 @@ namespace OnlineStore.DeviceLibrary
private
float
StartBlowValue
=
(
float
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
StartBlowValue
);
private
float
StopBlowValue
=
(
float
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
StopBlowValue
);
public
string
currTempStr
=
""
;
Random
num
=
new
Random
();
internal
void
HumidityProcess
(
BoxBean
box
)
{
try
{
if
((
DateTime
.
Now
-
preLogTime
).
TotalSeconds
>
10
)
int
rad
=
num
.
Next
(
9
,
13
);
if
((
DateTime
.
Now
-
preLogTime
).
TotalSeconds
>
rad
)
{
preLogTime
=
DateTime
.
Now
;
HumitureParam
param
=
QueryData
();
...
...
source/DeviceLibrary/duoStore/StoreManager.cs
查看文件 @
dfbc827
...
...
@@ -24,8 +24,18 @@ namespace OnlineStore.DeviceLibrary
public
static
string
LastVisualRfid
=
""
;
public
volatile
static
bool
ShelfNeedOut
=
false
;
public
StoreManager
()
public
static
bool
FrontDoorOpen
=
false
;
public
static
DateTime
AgvNeedEmptyTime
=
DateTime
.
Now
;
static
StoreManager
()
{
//var CurrShelfNum = Properties.Settings1.Default.CurrShelfNum;
//Properties.Settings1.Default.CurrShelfNum = "12";
//Properties.Settings1.Default.Save();
//CurrShelfNum = Properties.Settings1.Default.CurrShelfNum;
}
#
region
配置文件加载更新
...
...
@@ -345,6 +355,7 @@ namespace OnlineStore.DeviceLibrary
}
private
static
string
spiltStr
=
"##"
;
private
static
string
Addr_PosForPutin
=
"/service/store/emptyPosForPutin"
;
private
static
bool
r
=
false
;
public
static
GetPosResult
GetPosId
(
string
deviceName
,
List
<
string
>
codeList
,
int
height
,
int
width
,
string
shelfNum
)
{
GetPosResult
result
=
new
GetPosResult
();
...
...
@@ -367,18 +378,22 @@ namespace OnlineStore.DeviceLibrary
// 参数:cids: 多个 cid
//code: 条码内容
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
string
cids
=
""
;
List
<
string
>
cids
=
new
List
<
string
>()
;
foreach
(
int
k
in
Store
.
BoxMap
.
Keys
)
{
//if (Store.BoxMap[k].runStatus > StoreRunStatus.Wait && Store.BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
if
(!
Store
.
BoxMap
[
k
].
IsDebug
&&
!
Store
.
BoxMap
[
k
].
Disabled
&&
Store
.
BoxMap
[
k
].
runStatus
>
StoreRunStatus
.
Wait
)
{
cids
+=
Store
.
BoxMap
[
k
].
CID
+
","
;
cids
.
Add
(
Store
.
BoxMap
[
k
].
CID
)
;
}
}
cids
=
cids
.
TrimEnd
(
','
);
paramMap
.
Add
(
"cids"
,
cids
);
if
(
r
)
{
r
=
false
;
cids
.
Reverse
();
}
else
r
=
true
;
paramMap
.
Add
(
"cids"
,
string
.
Join
(
","
,
cids
.
ToArray
()));
paramMap
.
Add
(
"code"
,
codeStr
);
paramMap
.
Add
(
ParamDefine
.
rfid
,
shelfNum
);
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
dfbc827
...
...
@@ -485,7 +485,7 @@ namespace OnlineStore.DeviceLibrary
string
msg
=
""
;
foreach
(
AxisBean
axis
in
axisArray
)
{
bool
result
=
axis
.
Open
(
fals
e
,
out
msg
);
bool
result
=
axis
.
Open
(
tru
e
,
out
msg
);
if
(!
result
||
(!
String
.
IsNullOrEmpty
(
msg
)))
{
SetWarnMsg
(
Name
+
msg
);
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
dfbc827
...
...
@@ -626,6 +626,11 @@ namespace OnlineStore.DeviceLibrary
BOX_H03_SendOut_04
,
BOX_H03_SendOut_05
,
LO_20_UpdownUp_wait
,
LO_15b_UpdownUp
,
LI_25a_UpdownUp
,
LO_15c_UpdownUp
,
LO_20a_UpdownUp
,
LO_20b_UpdownUp
,
#
endregion
}
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
dfbc827
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
5
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
dfbc827
...
...
@@ -260,15 +260,11 @@ namespace OnlineStore.LoadCSVLibrary
///DI 0 15寸料盘宽度检测 X39
/// </summary>
public
static
string
TrayCheck_15
=
"TrayCheck_15"
;
/*
/// <summary>
///DI 0 卡爪到位确认 X39
/// </summary>
public static string Clamp_OnPosition = "Clamp_OnPosition";
/// <summary>
///DI 0
卡爪范围确认
X40
///DI 0
前门门禁信号
X40
/// </summary>
public static string Clamp_InRange = "Clamp_InRange";
public
static
string
FrontDoor_Check
=
"FrontDoor_Check"
;
/*
/// <summary>
///DI 0 卡爪动作中 X41
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论