Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 69aaaa89
由
刘韬
编写于
2022-07-15 16:06:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
407fa49b
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
213 行增加
和
66 行删除
语言资源.xlsx → 815语言资源.xlsx
source/ACSingleStore/App.config
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Properties/AssemblyInfo.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/DeviceLibrary/Camera.cs
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/StoreConfig/Camera.json
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
语言资源.xlsx
→
815
语言资源.xlsx
查看文件 @
69aaaa8
此文件类型无法预览
source/ACSingleStore/App.config
查看文件 @
69aaaa8
...
...
@@ -122,38 +122,6 @@
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
</
startup
>
<!-- 部署服务库项目时,必须将配置文件的内容添加到
主机的
app
.
config
文件中。
System
.
Configuration
不支持库的配置文件。 -->
<
system
.
serviceModel
>
<
services
>
<
service
name
=
"AcStoreWCF.CWSMDBox"
>
<
endpoint
address
=
""
binding
=
"basicHttpBinding"
contract
=
"AcStoreWCF.ICWSMDBox"
>
<
identity
>
<
dns
value
=
"localhost"
/>
</
identity
>
</
endpoint
>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
host
>
<
baseAddresses
>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
</
baseAddresses
>
</
host
>
</
service
>
</
services
>
<
behaviors
>
<
serviceBehaviors
>
<
behavior
>
<!-- 为避免泄漏元数据信息,
请在部署前将以下值设置为
false
-->
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<!-- 要接收故障异常详细信息以进行调试,
请将以下值设置为
true
。在部署前设置为
false
以避免泄漏异常信息 -->
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
</
behavior
>
</
serviceBehaviors
>
</
behaviors
>
</
system
.
serviceModel
>
<
system
.
web
>
<
membership
defaultProvider
=
"ClientAuthenticationMembershipProvider"
>
<
providers
>
...
...
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
69aaaa8
...
...
@@ -319,9 +319,9 @@
this
.
cmbJianGe
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmbJianGe
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbJianGe
.
FormattingEnabled
=
true
;
this
.
cmbJianGe
.
Location
=
new
System
.
Drawing
.
Point
(
231
,
60
);
this
.
cmbJianGe
.
Location
=
new
System
.
Drawing
.
Point
(
192
,
60
);
this
.
cmbJianGe
.
Name
=
"cmbJianGe"
;
this
.
cmbJianGe
.
Size
=
new
System
.
Drawing
.
Size
(
1
46
,
28
);
this
.
cmbJianGe
.
Size
=
new
System
.
Drawing
.
Size
(
1
85
,
28
);
this
.
cmbJianGe
.
TabIndex
=
282
;
//
// label30
...
...
@@ -332,7 +332,7 @@
this
.
label30
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
59
);
this
.
label30
.
Name
=
"label30"
;
this
.
label30
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
label30
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
36
);
this
.
label30
.
Size
=
new
System
.
Drawing
.
Size
(
183
,
36
);
this
.
label30
.
TabIndex
=
281
;
this
.
label30
.
Text
=
"入库存料库位间隔:"
;
this
.
label30
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
...
...
@@ -367,9 +367,9 @@
this
.
cmbPosition
.
Items
.
AddRange
(
new
object
[]
{
"料仓0"
,
"料仓1"
});
this
.
cmbPosition
.
Location
=
new
System
.
Drawing
.
Point
(
231
,
23
);
this
.
cmbPosition
.
Location
=
new
System
.
Drawing
.
Point
(
192
,
23
);
this
.
cmbPosition
.
Name
=
"cmbPosition"
;
this
.
cmbPosition
.
Size
=
new
System
.
Drawing
.
Size
(
1
46
,
28
);
this
.
cmbPosition
.
Size
=
new
System
.
Drawing
.
Size
(
1
85
,
28
);
this
.
cmbPosition
.
TabIndex
=
174
;
this
.
cmbPosition
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cmbPosition_SelectedIndexChanged
);
//
...
...
@@ -381,7 +381,7 @@
this
.
label21
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
19
);
this
.
label21
.
Name
=
"label21"
;
this
.
label21
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
label21
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
36
);
this
.
label21
.
Size
=
new
System
.
Drawing
.
Size
(
183
,
36
);
this
.
label21
.
TabIndex
=
172
;
this
.
label21
.
Text
=
"选择仓位:"
;
this
.
label21
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
...
...
@@ -425,7 +425,7 @@
this
.
groupBox6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox6
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
119
);
this
.
groupBox6
.
Name
=
"groupBox6"
;
this
.
groupBox6
.
Size
=
new
System
.
Drawing
.
Size
(
668
,
2
86
);
this
.
groupBox6
.
Size
=
new
System
.
Drawing
.
Size
(
668
,
2
74
);
this
.
groupBox6
.
TabIndex
=
302
;
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
Text
=
"批量上下料操作"
;
...
...
@@ -572,7 +572,7 @@
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
29
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
1
287
,
533
);
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
1
008
,
700
);
this
.
tabControl1
.
TabIndex
=
301
;
//
// tabPage4
...
...
@@ -582,7 +582,7 @@
this
.
tabPage4
.
Controls
.
Add
(
this
.
btnClearLog
);
this
.
tabPage4
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage4
.
Name
=
"tabPage4"
;
this
.
tabPage4
.
Size
=
new
System
.
Drawing
.
Size
(
1
279
,
499
);
this
.
tabPage4
.
Size
=
new
System
.
Drawing
.
Size
(
1
000
,
666
);
this
.
tabPage4
.
TabIndex
=
4
;
this
.
tabPage4
.
Text
=
"日志"
;
//
...
...
@@ -617,7 +617,7 @@
this
.
tabPage5
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage5
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage5
.
Name
=
"tabPage5"
;
this
.
tabPage5
.
Size
=
new
System
.
Drawing
.
Size
(
994
,
67
6
);
this
.
tabPage5
.
Size
=
new
System
.
Drawing
.
Size
(
1000
,
66
6
);
this
.
tabPage5
.
TabIndex
=
5
;
this
.
tabPage5
.
Text
=
"设备信息"
;
//
...
...
@@ -686,7 +686,7 @@
this
.
tabPage2
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage2
.
Name
=
"tabPage2"
;
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
994
,
67
6
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
1000
,
66
6
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
"伺服调试"
;
//
...
...
@@ -713,7 +713,7 @@
this
.
panel1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
panel1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
panel1
.
Name
=
"panel1"
;
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
9
88
,
67
0
);
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
9
94
,
66
0
);
this
.
panel1
.
TabIndex
=
307
;
//
// axisMoveControl1
...
...
@@ -809,7 +809,7 @@
this
.
btnInOutP4
.
Location
=
new
System
.
Drawing
.
Point
(
288
,
246
);
this
.
btnInOutP4
.
Name
=
"btnInOutP4"
;
this
.
btnInOutP4
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP4
.
Size
=
new
System
.
Drawing
.
Size
(
1
90
,
34
);
this
.
btnInOutP4
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
34
);
this
.
btnInOutP4
.
TabIndex
=
277
;
this
.
btnInOutP4
.
Text
=
"进出轴仓门出料点P4:"
;
this
.
btnInOutP4
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1175,7 +1175,7 @@
this
.
btnInOutP2
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
246
);
this
.
btnInOutP2
.
Name
=
"btnInOutP2"
;
this
.
btnInOutP2
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP2
.
Size
=
new
System
.
Drawing
.
Size
(
1
90
,
34
);
this
.
btnInOutP2
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
34
);
this
.
btnInOutP2
.
TabIndex
=
211
;
this
.
btnInOutP2
.
Text
=
"进出轴吸盘取料点P2:"
;
this
.
btnInOutP2
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1226,7 +1226,7 @@
this
.
btnUpDownP1
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
19
);
this
.
btnUpDownP1
.
Name
=
"btnUpDownP1"
;
this
.
btnUpDownP1
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpDownP1
.
Size
=
new
System
.
Drawing
.
Size
(
226
,
34
);
this
.
btnUpDownP1
.
Size
=
new
System
.
Drawing
.
Size
(
174
,
34
);
this
.
btnUpDownP1
.
TabIndex
=
199
;
this
.
btnUpDownP1
.
Text
=
"升降轴吸盘下方取料点P1:"
;
this
.
btnUpDownP1
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1306,7 +1306,7 @@
this
.
btnInOutP3
.
Location
=
new
System
.
Drawing
.
Point
(
288
,
208
);
this
.
btnInOutP3
.
Name
=
"btnInOutP3"
;
this
.
btnInOutP3
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP3
.
Size
=
new
System
.
Drawing
.
Size
(
1
90
,
34
);
this
.
btnInOutP3
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
34
);
this
.
btnInOutP3
.
TabIndex
=
193
;
this
.
btnInOutP3
.
Text
=
"进出轴库位取料点P3:"
;
this
.
btnInOutP3
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1354,7 +1354,7 @@
this
.
btnUpDownP6
.
Location
=
new
System
.
Drawing
.
Point
(
288
,
132
);
this
.
btnUpDownP6
.
Name
=
"btnUpDownP6"
;
this
.
btnUpDownP6
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpDownP6
.
Size
=
new
System
.
Drawing
.
Size
(
1
90
,
34
);
this
.
btnUpDownP6
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
34
);
this
.
btnUpDownP6
.
TabIndex
=
189
;
this
.
btnUpDownP6
.
Text
=
"升降轴出料缓冲点P6:"
;
this
.
btnUpDownP6
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1386,7 +1386,7 @@
this
.
btnUpDownP4
.
Location
=
new
System
.
Drawing
.
Point
(
288
,
56
);
this
.
btnUpDownP4
.
Name
=
"btnUpDownP4"
;
this
.
btnUpDownP4
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpDownP4
.
Size
=
new
System
.
Drawing
.
Size
(
1
90
,
34
);
this
.
btnUpDownP4
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
34
);
this
.
btnUpDownP4
.
TabIndex
=
165
;
this
.
btnUpDownP4
.
Text
=
"升降轴入料缓冲点P4:"
;
this
.
btnUpDownP4
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1511,7 +1511,7 @@
this
.
tabPage_Pos
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage_Pos
.
Name
=
"tabPage_Pos"
;
this
.
tabPage_Pos
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage_Pos
.
Size
=
new
System
.
Drawing
.
Size
(
994
,
67
6
);
this
.
tabPage_Pos
.
Size
=
new
System
.
Drawing
.
Size
(
1000
,
66
6
);
this
.
tabPage_Pos
.
TabIndex
=
6
;
this
.
tabPage_Pos
.
Text
=
"库位调试"
;
this
.
tabPage_Pos
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -1536,7 +1536,7 @@
this
.
语言
});
this
.
menuStrip1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
menuStrip1
.
Name
=
"menuStrip1"
;
this
.
menuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
1
287
,
29
);
this
.
menuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
1
008
,
29
);
this
.
menuStrip1
.
TabIndex
=
257
;
this
.
menuStrip1
.
Text
=
"menuStrip1"
;
//
...
...
@@ -1912,7 +1912,7 @@
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1
287
,
562
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1
008
,
729
);
this
.
Controls
.
Add
(
this
.
tabControl1
);
this
.
Controls
.
Add
(
this
.
menuStrip1
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
...
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
69aaaa8
...
...
@@ -633,6 +633,11 @@ namespace OnlineStore.AutoInOutStore
{
positionConfigFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Position_Config
,
"_"
+
store
.
StoreID
.
ToString
());
}
if
(
ktkPosition
.
PositionNum
.
StartsWith
(
"1#AC1_0A_"
))
{
var
fixposfile
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
positionConfigFile
),
@"FixPositions.csv"
);
positionConfigFile
=
fixposfile
;
}
bool
result
=
CSVPositionReader
<
AutoStorePosition
>.
SavePostion
(
positionConfigFile
,
ktkPosition
);
if
(!
result
)
{
...
...
source/ACSingleStore/Properties/AssemblyInfo.cs
查看文件 @
69aaaa8
...
...
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO815-AutoInOutStore-newui
3f2df85964baa20c171b0ce228d8bc29c4a2eb1f
")]
[assembly: AssemblyProduct("SO815-AutoInOutStore-newui
407fa49b653c99a7b801432901b0ab5226d03f6b
")]
[assembly: AssemblyCopyright("edf7e3d07d3c8cafa890a08f4b855e559a36d414")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
69aaaa8
...
...
@@ -36,6 +36,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Camera.VisionLib">
<HintPath>..\..\..\Camera\CameraVisionLib\bin\Debug\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.IOModule.AIOBOX, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
...
...
@@ -71,6 +74,7 @@
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="DeviceLibrary\AxisManager.cs" />
<Compile Include="DeviceLibrary\Camera.cs" />
<Compile Include="DeviceLibrary\halcon\CodeManager.cs" />
<Compile Include="DeviceLibrary\HC\HCAxisManager.cs" />
<Compile Include="DeviceLibrary\IO\HCIOManager.cs" />
...
...
@@ -124,6 +128,7 @@
<None Include="StoreConfig\AC\StoreConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\Camera.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
...
...
source/DeviceLibrary/DeviceLibrary/Camera.cs
0 → 100644
查看文件 @
69aaaa8
using
Asa.Camera
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore
{
public
class
HIKCamera
{
Thread
camerathread
;
static
HIKCamera
_camera
;
Asa
.
Camera
.
VisionLib
camera
;
public
static
HIKCamera
Current
{
get
{
if
(
_camera
==
null
)
_camera
=
new
HIKCamera
();
return
_camera
;
}
}
public
string
Name
=
""
;
public
event
EventHandler
<
Bitmap
>
camera_event
;
public
string
DeviceName
=
"monitor1"
;
bool
loop
=
true
;
public
void
LoadCameraConfig
()
{
string
path
=
@".\StoreConfig\Camera.json"
;
if
(!
File
.
Exists
(
path
))
{
LogUtil
.
error
(
Name
+
"找不到监控相机配置文件"
+
path
);
return
;
}
try
{
var
configtxt
=
File
.
ReadAllText
(
path
);
if
(
configtxt
.
IndexOf
(
"Pwd"
)
>
0
)
{
configtxt
=
configtxt
.
Replace
(
"Pwd"
,
"Password"
);
configtxt
=
configtxt
.
Replace
(
"\"8000\""
,
"8000"
);
File
.
WriteAllText
(
path
,
configtxt
);
}
var
m
=
Regex
.
Match
(
configtxt
,
"name\".*?\"(.+)\""
,
RegexOptions
.
IgnoreCase
);
DeviceName
=
m
.
Groups
[
1
].
Value
;
camera
=
new
VisionLib
(
path
,
true
,
"HIK.IPCamera"
);
}
catch
(
Exception
e
){
LogUtil
.
error
(
Name
+
"加载监控相机配置文件失败:"
+
e
.
ToString
());
return
;
}
camera
.
Open
(
DeviceName
);
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
==
null
)
{
LogUtil
.
error
(
Name
+
$
"监控相机打开失败"
);
}
loop
=
true
;
camerathread
=
new
Thread
(
new
ThreadStart
(
startCamera
));
camerathread
.
Start
();
GC
.
KeepAlive
(
camerathread
);
}
int
errortimes
=
0
;
void
startCamera
()
{
while
(
loop
)
{
try
{
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
!=
null
)
{
errortimes
=
0
;
camera_event
?.
Invoke
(
this
,
bmp
);
}
else
if
(
bmp
==
null
&&
errortimes
<
5
)
{
errortimes
++;
LogUtil
.
error
(
Name
+
$
"相机获取图像出错,{errortimes}"
);
}
else
if
(
errortimes
==
5
)
{
camera
.
Close
(
DeviceName
);
Thread
.
Sleep
(
1000
);
camera
.
Open
(
DeviceName
);
errortimes
=
0
;
LogUtil
.
error
(
Name
+
$
"相机错误次数过多,重新打开,{errortimes}"
);
Thread
.
Sleep
(
5000
);
}
Thread
.
Sleep
(
1000
/
7
);
}
catch
{
errortimes
++;
}
}
camera
.
Close
(
DeviceName
);
camera
.
Dispose
();
}
public
void
Close
()
{
LogUtil
.
info
(
Name
+
"线程退出"
);
loop
=
false
;
}
public
void
CameraGrabOne
(
string
filename
)
{
try
{
LogUtil
.
info
(
Name
+
"库位文件名:"
+
filename
);
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
!=
null
)
{
if
(
File
.
Exists
(
filename
))
File
.
Delete
(
filename
);
bmp
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
bmp
.
Dispose
();
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
Name
+
e
.
ToString
());
}
}
public
string
GetFixtureStateFilename
(
InOutStoreParam
inOutParam
,
StoreMoveType
storeMoveType
,
FixtureState
fixtureState
)
{
string
dir
=
$
"\\image\\Fixture\\{storeMoveType}\\{inOutParam.PositionNum}\\"
;
Directory
.
CreateDirectory
(
dir
);
string
filename
=
$
"{inOutParam.WareNumber}@@{fixtureState}.jpg"
;
foreach
(
var
x
in
Path
.
GetInvalidFileNameChars
())
{
filename
=
filename
.
Replace
(
x
.
ToString
(),
""
);
}
return
dir
+
filename
;
}
}
public
enum
FixtureState
{
In
,
Up
,
Down
,
Out
,
DoorIn
,
DoorOut
,
}
}
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
69aaaa8
...
...
@@ -159,9 +159,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
cameraNameList
.
Count
()+
" 开始取图片"
);
for
(
int
i
=
0
;
i
<
cameraNameList
.
Count
();
i
++)
{
var
ci
=
i
;
cameraTask
[
i
]
=
Task
.
Run
(()
=>
{
var
cameraName
=
cameraNameList
[
i
];
var
cameraName
=
cameraNameList
[
c
i
];
if
(
cameraName
.
Trim
().
Equals
(
""
))
{
...
...
source/DeviceLibrary/StoreConfig/Camera.json
0 → 100644
查看文件 @
69aaaa8
{
"HIKIPCamera"
:
[
{
"Name"
:
"monitor"
,
"IP"
:
"192.168.1.64"
,
"User"
:
"admin"
,
"Password"
:
"Acc123456"
,
"Port"
:
8000
}
]
}
\ No newline at end of file
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
69aaaa8
...
...
@@ -552,7 +552,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位完成检测到叉子有料,启动清料失败:无可用库位"
);
return
false
;
}
InOutStoreParam
param
=
new
InOutStoreParam
(
""
,
PositionNumList
[
0
]);
InOutStoreParam
param
=
new
InOutStoreParam
(
""
,
PositionNumList
[
PositionNumList
.
Count
-
1
]);
if
(
LoadParamPosition
(
param
))
{
StoreMove
.
MoveParam
=
param
;
...
...
@@ -1912,10 +1912,7 @@ namespace OnlineStore.DeviceLibrary
public
void
OperationProcess
(
Operation
resultOperation
)
{
if
(
resultOperation
.
op
.
Equals
(
5
))
{
ProcessHumidityCMD
(
resultOperation
);
}
if
(
resultOperation
.
op
.
Equals
(
2
))
{
try
...
...
@@ -1933,7 +1930,10 @@ namespace OnlineStore.DeviceLibrary
//ReviceInStoreProcess("", resultOperation);
LogUtil
.
error
(
"发送定时消息时,服务器返回Op=1 【"
+
json
+
"】"
);
}
else
if
(
resultOperation
.
op
.
Equals
(
5
))
{
ProcessHumidityCMD
(
resultOperation
);
}
if
(
resultOperation
.
data
!=
null
)
{
string
result
=
""
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
69aaaa8
...
...
@@ -1004,7 +1004,7 @@ namespace OnlineStore.DeviceLibrary
movePfix
.
UpDown_P1
=
Config
.
GetUpDownP1
(
StoreMove
.
MoveParam
.
PlateH
);
movePfix
.
ComPress_P2
=
moveP
.
ComPress_P2
;
movePfix
.
ComPress_P3
=
moveP
.
ComPress_P3
;
movePfix
.
ComPress_P3
=
Config
.
CompressAxis_P1_Position
;
//
moveP.ComPress_P3;
movePfix
.
InOut_P3
=
fixposition
.
InOutAxis_Position_P3
;
movePfix
.
Middle_P2
=
fixposition
.
MiddleAxis_Position_P2
;
movePfix
.
UpDown_P3
=
fixposition
.
UpDownAxis_IHPosition_P3
;
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
69aaaa8
...
...
@@ -640,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
//string code = CodeManager.ProcessCode(LastCodeList);
string
msg
=
Name
+
" 计算盘高:上升前 ["
+
StartMovePosition
+
"]实时[
"
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
LastCode
+
"】"
;
string
msg
=
Name
+
" 计算盘高:上升前 ["
+
StartMovePosition
+
"]实时["
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
LastCode
+
"】"
;
LogUtil
.
info
(
msg
);
return
LastHeight
;
}
...
...
@@ -691,7 +691,7 @@ namespace OnlineStore.DeviceLibrary
private
static
void
SendTrayOut
()
{
string
posId
=
StoreManager
.
Store
.
PositionNumList
[
0
];
string
posId
=
StoreManager
.
Store
.
PositionNumList
[
StoreManager
.
Store
.
PositionNumList
.
Count
-
1
];
//盘先根据高低排序
if
(
AllPosList
==
null
)
{
...
...
@@ -701,7 +701,7 @@ namespace OnlineStore.DeviceLibrary
List
<
AutoStorePosition
>
okList
=
(
from
m
in
AllPosList
where
m
.
BagHeight
>=
LastHeight
select
m
).
ToList
<
AutoStorePosition
>();
if
(
okList
.
Count
>
0
)
{
posId
=
okList
[
0
].
PositionNum
;
posId
=
okList
[
okList
.
Count
-
1
].
PositionNum
;
}
else
{
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
69aaaa8
...
...
@@ -331,7 +331,12 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
WaitType
==
2
)
{
return
ResourceControl
.
GetString
(
ResourceControl
.
WaitIo
,
"IO信号等待"
)
+
"【"
+
IoType
+
"】=【"
+
IoValue
+
"】"
;
var
iodef
=
""
;
if
(
StoreManager
.
Config
.
DILIst
.
ContainsKey
(
IoType
))
{
iodef
=
StoreManager
.
Config
.
DILIst
[
IoType
].
ElectricalDefinition
+
";"
;
}
return
ResourceControl
.
GetString
(
ResourceControl
.
WaitIo
,
"IO信号等待"
)
+
"【"
+
iodef
+
IoType
+
"】=【"
+
IoValue
+
"】"
;
}
else
if
(
WaitType
==
3
)
{
...
...
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
69aaaa8
...
...
@@ -156,6 +156,7 @@ namespace OnlineStore.LoadCSVLibrary
public
static
bool
SavePostion
(
string
filePath
,
T
position
)
{
Type
type
=
typeof
(
T
);
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论