Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7871d050
由
几米阳光
编写于
2019-03-19 11:23:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
ee28c326
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
69 行增加
和
84 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/Resources/AgrGridLink.dll
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
7871d05
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
7871d05
...
@@ -876,22 +876,11 @@ namespace OnlineStore.ACSingleStore
...
@@ -876,22 +876,11 @@ namespace OnlineStore.ACSingleStore
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PleaseStartStore
,
"请先启动料仓!"
));
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PleaseStartStore
,
"请先启动料仓!"
));
}
}
}
}
//private void btnAxisConfig_Click(object sender, EventArgs e)
//{
// FormManager.ShowAxisConfig(store);
//}
private
void
轴卡点动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
轴卡点动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
button1_Click
(
null
,
null
);
button1_Click
(
null
,
null
);
}
}
private
void
轴运动配置
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
//FormManager.ShowAxisConfig(store);
}
private
void
启动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
启动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
start_button_Click
(
null
,
null
);
start_button_Click
(
null
,
null
);
...
@@ -921,13 +910,6 @@ namespace OnlineStore.ACSingleStore
...
@@ -921,13 +910,6 @@ namespace OnlineStore.ACSingleStore
//this.richTextBox1.Text = "";
//this.richTextBox1.Text = "";
LogUtil
.
ClearLog
();
LogUtil
.
ClearLog
();
}
}
private
void
btnRelMove_Click
(
object
sender
,
EventArgs
e
)
{
//int posi = FormUtil.GetIntValue(txtLinePosition);
//ShuoKeControls.RelativeMove(this.store.Config.CompressAxis_Slv, posi);
}
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
this
.
Enabled
=
false
;
this
.
Enabled
=
false
;
...
@@ -940,12 +922,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -940,12 +922,7 @@ namespace OnlineStore.ACSingleStore
{
{
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
//List<string> codeList = HDevelopExport.CameraScan();
//foreach (string str in codeList)
//{
// string code = HDevelopExport.SubStrCode(str);
// message = message + code + "##";
//}
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
foreach
(
string
str
in
codeList
)
foreach
(
string
str
in
codeList
)
{
{
...
@@ -1021,8 +998,6 @@ namespace OnlineStore.ACSingleStore
...
@@ -1021,8 +998,6 @@ namespace OnlineStore.ACSingleStore
this
.
btnInOutP3
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
btnInOutP3
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
btnMiddleP1
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
192
)))));
this
.
btnMiddleP1
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
192
)))));
this
.
btnMiddleP2
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
192
)))));
this
.
btnMiddleP2
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
192
)))));
}
}
/// <summary>
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// 判断AC伺服电机轴是否运动完成
...
@@ -1185,20 +1160,8 @@ namespace OnlineStore.ACSingleStore
...
@@ -1185,20 +1160,8 @@ namespace OnlineStore.ACSingleStore
ExitApp
();
ExitApp
();
}
}
}
}
//private void 摄像机调试ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// FrmCamera frm = new FrmCamera(store);
// frm.ShowDialog();
//}
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
//string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
//string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
//HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
//FrmCodeLearn learn = new FrmCodeLearn();
//learn.ShowDialog();
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
...
@@ -1231,16 +1194,9 @@ namespace OnlineStore.ACSingleStore
...
@@ -1231,16 +1194,9 @@ namespace OnlineStore.ACSingleStore
FrmLanguage
frm
=
new
FrmLanguage
();
FrmLanguage
frm
=
new
FrmLanguage
();
frm
.
ShowDialog
();
frm
.
ShowDialog
();
}
}
private
void
开启
DEBUGToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
}
private
void
清理日志
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
清理日志
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
string
str
=
ResourceCulture
.
China
;
string
str
=
ResourceCulture
.
China
;
ResourceCulture
.
SetCurrentCulture
(
str
);
ResourceCulture
.
SetCurrentCulture
(
str
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
str
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
str
);
this
.
LanguageProcess
();
this
.
LanguageProcess
();
...
@@ -1252,16 +1208,35 @@ namespace OnlineStore.ACSingleStore
...
@@ -1252,16 +1208,35 @@ namespace OnlineStore.ACSingleStore
ResourceCulture
.
SetCurrentCulture
(
str
);
ResourceCulture
.
SetCurrentCulture
(
str
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
str
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
str
);
this
.
LanguageProcess
();
this
.
LanguageProcess
();
}
}
private
void
德文
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
德文
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
}
}
private
void
DebugStatus
(
bool
status
)
{
if
(
status
)
{
启用调试
ToolStripMenuItem
.
Text
=
"禁用调试"
;
}
else
{
启用调试
ToolStripMenuItem
.
Text
=
"启用调试"
;
}
groupAxis
.
Enabled
=
status
;
private
void
groupBox5_Enter
(
object
sender
,
EventArgs
e
)
groupInout
.
Enabled
=
status
;
}
private
void
启用调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
启用调试
ToolStripMenuItem
.
Text
.
Equals
(
"启用调试"
))
{
DebugStatus
(
true
);
}
else
{
DebugStatus
(
false
);
}
}
}
}
}
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
7871d05
...
@@ -99,9 +99,6 @@
...
@@ -99,9 +99,6 @@
<Content Include="halcon.dll">
<Content Include="halcon.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</Content>
<Content Include="Resources\AgrGridLink.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<ProjectReference Include="..\Common\Common.csproj">
...
...
source/DeviceLibrary/Resources/AgrGridLink.dll
deleted
100644 → 0
查看文件 @
ee28c32
此文件类型无法预览
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
7871d05
...
@@ -85,15 +85,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -85,15 +85,12 @@ namespace OnlineStore.DeviceLibrary
//初始化摄像机配置
//初始化摄像机配置
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
//HDevelopExport.LoadConfig(nameStr,codeStr);
CodeManager
.
LoadConfig
(
nameStr
,
codeStr
);
CodeManager
.
LoadConfig
(
nameStr
,
codeStr
);
//初始化 //连接设备
//初始化 //连接设备
IOManager
.
instance
.
ConnectionKND
(
Config
.
DIODeviceNameList
);
IOManager
.
instance
.
ConnectionKND
(
Config
.
DIODeviceNameList
);
//scanSocket.OnScanRevice += onCodeReceived;
timersTimer
.
Enabled
=
false
;
timersTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
if
(
isAuto
==
1
)
...
@@ -1051,11 +1048,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1051,11 +1048,6 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
else
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
{
//if (scanSocket.isScannerRun.Equals(false))
//{
// scanSocket.ConnectScanner(Config.Scanner_Ip,Config.Scanner_Port);
//}
//判断是否需要出入库
//判断是否需要出入库
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)&&
alarmType
.
Equals
(
StoreAlarmType
.
None
))
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)&&
alarmType
.
Equals
(
StoreAlarmType
.
None
))
{
{
...
@@ -1103,10 +1095,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1103,10 +1095,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
//private void BeginScannering()
//{
// scanSocket.BeginScannering();
//}
private
DateTime
preIoTimerOutTime
=
DateTime
.
Now
;
private
DateTime
preIoTimerOutTime
=
DateTime
.
Now
;
/// <summary>
/// <summary>
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
7871d05
...
@@ -761,11 +761,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -761,11 +761,7 @@ namespace OnlineStore.DeviceLibrary
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
InStore
))
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
InStore
))
{
{
int
newIndex
=
autoPositionIndex
;
int
newIndex
=
autoPositionIndex
;
//int newIndex = autoPositionIndex - 1;
//if (autoJiange == 0)
//{
// newIndex = autoPositionIndex;
//}
if
(
newIndex
<
0
)
if
(
newIndex
<
0
)
{
{
if
(
AutoStartIndex
>=
0
&&
AutoStartIndex
<
PositionNumList
.
Count
)
if
(
AutoStartIndex
>=
0
&&
AutoStartIndex
<
PositionNumList
.
Count
)
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
7871d05
...
@@ -6,6 +6,7 @@ using System.Collections.Generic;
...
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using
System.Drawing
;
using
System.Drawing
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.ExceptionServices
;
using
System.Text
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -45,6 +46,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -45,6 +46,17 @@ namespace OnlineStore.DeviceLibrary
codeTypeList
.
Add
(
str
.
Trim
());
codeTypeList
.
Add
(
str
.
Trim
());
}
}
LoadCamera
();
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
ToString
());
}
}
private
static
void
LoadCamera
()
{
string
[]
names
=
CodeLibrary
.
HIKCamera
.
Instance
.
CameraName
;
string
[]
names
=
CodeLibrary
.
HIKCamera
.
Instance
.
CameraName
;
hikNameList
.
AddRange
(
names
);
hikNameList
.
AddRange
(
names
);
names
=
CodeLibrary
.
BaslerCamera
.
Instance
.
CameraName
;
names
=
CodeLibrary
.
BaslerCamera
.
Instance
.
CameraName
;
...
@@ -57,19 +69,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -57,19 +69,17 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
"加载到Balser相机:"
+
name
);
LogUtil
.
info
(
"加载到Balser相机:"
+
name
);
}
}
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
ToString
());
}
}
}
public
static
Bitmap
GetCamerImage
(
string
cameraName
)
public
static
Bitmap
GetCamerImage
(
string
cameraName
)
{
{
Bitmap
bitm
=
null
;
Bitmap
bitm
=
null
;
//若未加载到相机,需要重新加载相机
if
(
balserNameList
.
Count
<=
0
&&
hikNameList
.
Count
<=
0
)
{
LogUtil
.
error
(
"获取图片时发现未加载到相机,重新加载相机"
);
LoadCamera
();
}
if
(
balserNameList
.
Contains
(
cameraName
))
if
(
balserNameList
.
Contains
(
cameraName
))
{
{
BaslerCamera
.
Instance
.
Open
(
cameraName
);
BaslerCamera
.
Instance
.
Open
(
cameraName
);
...
@@ -77,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -77,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
bitm
=
BaslerCamera
.
Instance
.
Image
;
bitm
=
BaslerCamera
.
Instance
.
Image
;
BaslerCamera
.
Instance
.
Close
();
BaslerCamera
.
Instance
.
Close
();
}
}
else
if
(
hikNameList
.
Contains
(
cameraName
))
else
if
(
hikNameList
.
Contains
(
cameraName
))
{
{
HIKCamera
.
Instance
.
Open
(
cameraName
);
HIKCamera
.
Instance
.
Open
(
cameraName
);
HIKCamera
.
Instance
.
GrabOne
();
HIKCamera
.
Instance
.
GrabOne
();
...
@@ -86,12 +96,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -86,12 +96,13 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
info
(
"未找到摄像机【"
+
cameraName
+
"】无法获取图片"
);
LogUtil
.
info
(
"未找到摄像机【"
+
cameraName
+
"】无法获取图片"
);
}
}
return
bitm
;
return
bitm
;
}
}
public
static
List
<
string
>
CameraScan
(
)
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
()
{
{
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
...
@@ -100,28 +111,46 @@ namespace OnlineStore.DeviceLibrary
...
@@ -100,28 +111,46 @@ namespace OnlineStore.DeviceLibrary
{
{
foreach
(
string
cameraName
in
cameraNameList
)
foreach
(
string
cameraName
in
cameraNameList
)
{
{
Bitmap
bitmap
=
GetCamerImage
(
cameraName
);
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
{
if
(
bitmap
==
null
)
if
(
bitmap
==
null
)
{
{
LogUtil
.
info
(
" 摄像机【"
+
cameraName
+
"】获取图片失败"
);
LogUtil
.
info
(
" 摄像机【"
+
cameraName
+
"】获取图片失败"
);
continue
;
}
}
else
{
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
foreach
(
string
codeType
in
codeTypeList
)
foreach
(
string
codeType
in
codeTypeList
)
{
{
//判断是否是一维码
if
(
codeType
.
ToLower
().
Equals
(
"barcode"
))
{
cc
=
HDCodeHelper
.
DecodeBarCode
(
ho_Image
);
}
else
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
1
,
GetCodeParamFilePath
(
codeType
),
codeType
);
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
1
,
GetCodeParamFilePath
(
codeType
),
codeType
);
}
}
//LogUtil.info(" 摄像机【" + cameraName + "】【"+ codeType + "】扫码完成");
allCodeList
.
AddRange
(
cc
);
allCodeList
.
AddRange
(
cc
);
}
}
}
}
}
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
"扫码出现AccessViolationException异常:"
+
e
.
ToString
());
GC
.
Collect
();
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
}
}
foreach
(
CodeInfo
info
in
allCodeList
)
foreach
(
CodeInfo
info
in
allCodeList
)
{
{
codeList
.
Add
(
info
.
CodeStr
);
codeList
.
Add
(
info
.
CodeStr
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论