Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9475593b
由
LN
编写于
2020-06-24 11:12:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改点料方式
1 个父辈
b19dbc38
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
68 行增加
和
27 行删除
RC1266-AutoCountMachine/dll/X-Ray/Asa.CarerayImage.dll
RC1266-AutoCountMachine/dll/X-Ray/eyemLib.dll
RC1266-AutoCountMachine/source/AutoCountClient/AutoCountClient.csproj
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
RC1266-AutoCountMachine/dll/X-Ray/Asa.CarerayImage.dll
查看文件 @
9475593
此文件类型无法预览
RC1266-AutoCountMachine/dll/X-Ray/eyemLib.dll
0 → 100644
查看文件 @
9475593
此文件类型无法预览
RC1266-AutoCountMachine/source/AutoCountClient/AutoCountClient.csproj
查看文件 @
9475593
...
@@ -58,6 +58,10 @@
...
@@ -58,6 +58,10 @@
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="Asa.CarerayImage, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\X-Ray\Asa.CarerayImage.dll</HintPath>
</Reference>
<Reference Include="Asa.PrintLabel">
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\dll\label\Asa.PrintLabel.dll</HintPath>
<HintPath>..\..\dll\label\Asa.PrintLabel.dll</HintPath>
</Reference>
</Reference>
...
...
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.cs
查看文件 @
9475593
...
@@ -38,7 +38,7 @@ namespace OnlineStore.AutoCountClient
...
@@ -38,7 +38,7 @@ namespace OnlineStore.AutoCountClient
chbDebug
.
Checked
=
equipBean
.
IsDebug
;
chbDebug
.
Checked
=
equipBean
.
IsDebug
;
lblCom
.
Text
=
"X射线端口号:"
+
equipBean
.
Config
.
XRay_Port
;
lblCom
.
Text
=
"X射线端口号:"
+
equipBean
.
Config
.
XRay_Port
;
lblDianl
.
Text
=
"电流:"
+
equipBean
.
Config
.
XRay_Electricity
;
lblDianl
.
Text
=
"电流:"
+
equipBean
.
Config
.
XRay_Electricity
;
lblDiany
.
Text
=
"电压:"
+
equipBean
.
Config
.
XRay_Voltage
;
lblDiany
.
Text
=
"电压:"
+
equipBean
.
Config
.
XRay_Voltage
;
//lblDiany.Text = "窗宽:" + equipBean.Config.WindowWidth + ",窗位:" + equipBean.Config.WindowLevel;
//lblDiany.Text = "窗宽:" + equipBean.Config.WindowWidth + ",窗位:" + equipBean.Config.WindowLevel;
lblData
.
Text
=
"最后使用时间:"
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
XRay_Data
);
lblData
.
Text
=
"最后使用时间:"
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
XRay_Data
);
...
@@ -425,14 +425,18 @@ namespace OnlineStore.AutoCountClient
...
@@ -425,14 +425,18 @@ namespace OnlineStore.AutoCountClient
try
try
{
{
txtResult
.
Text
=
"点料中..."
;
txtResult
.
Text
=
"点料中..."
;
int
th
=
(
int
)
numTh
.
Value
;
int
th
=
(
int
)
numTh
.
Value
;
int
outCount
=
0
;
int
outCount
=
0
;
equipBean
.
countImage
.
GetCount
(
th
,
out
outCount
);
// equipBean.countImage.GetCount(th, out outCount);
int
n
=
equipBean
.
carerayImage
.
GetCount
(
2
,
3
,
out
outCount
,
out
Asa
.
API
.
EyemImage
tpDstImg
);
txtResult
.
Text
=
outCount
.
ToString
();
txtResult
.
Text
=
outCount
.
ToString
();
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 点料测试
["
+
th
+
"] 结果:"
+
outCount
);
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 点料测试
结果["
+
n
+
"]:"
+
outCount
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
MessageBox
.
Show
(
ex
.
ToString
());
LogUtil
.
error
(
"点料测试出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"点料测试出错:"
+
ex
.
ToString
());
}
}
btnWorkTest
.
Enabled
=
true
;
btnWorkTest
.
Enabled
=
true
;
...
@@ -443,8 +447,8 @@ namespace OnlineStore.AutoCountClient
...
@@ -443,8 +447,8 @@ namespace OnlineStore.AutoCountClient
int
th
=
(
int
)
numTh
.
Value
;
int
th
=
(
int
)
numTh
.
Value
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
ThresholdValue
,
th
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
ThresholdValue
,
th
);
equipBean
.
ThresholdValue
=
th
;
equipBean
.
ThresholdValue
=
th
;
MessageBox
.
Show
(
"保存阈值["
+
th
+
"]成功!"
);
MessageBox
.
Show
(
"保存阈值["
+
th
+
"]成功!"
);
LogUtil
.
info
(
"用户点击:保存阈值["
+
th
+
"]成功!"
);
LogUtil
.
info
(
"用户点击:保存阈值["
+
th
+
"]成功!"
);
}
}
}
}
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip.cs
查看文件 @
9475593
...
@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
public
XRay
xRay
=
null
;
public
XRay
xRay
=
null
;
public
CountImage
countImage
=
null
;
//
public CountImage countImage = null;
public
CarerayImage
carerayImage
=
null
;
public
CarerayImage
carerayImage
=
null
;
public
bool
xRayCanStart
=
false
;
public
bool
xRayCanStart
=
false
;
...
@@ -66,12 +66,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -66,12 +66,12 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
countImage
=
new
CountImage
(
"Count"
);
//
countImage = new CountImage("Count");
countImage
.
SetDirectory
(
path1_tif
,
path2_out
,
path3_area
);
//
countImage.SetDirectory(path1_tif, path2_out, path3_area);
LogUtil
.
info
(
Name
+
"CountImage path1【"
+
path1_tif
+
"】"
);
//
LogUtil.info(Name + "CountImage path1【" + path1_tif + "】");
LogUtil
.
info
(
Name
+
"CountImage path2【"
+
path2_out
+
"】"
);
//
LogUtil.info(Name + "CountImage path2【" + path2_out + "】");
LogUtil
.
info
(
Name
+
"CountImage path3【"
+
path3_area
+
"】"
);
//
LogUtil.info(Name + "CountImage path3【" + path3_area + "】");
LogUtil
.
info
(
Name
+
"CountImage SetDirectory: 完成"
);
//
LogUtil.info(Name + "CountImage SetDirectory: 完成");
carerayImage
=
new
CarerayImage
(
"XRay"
);
carerayImage
=
new
CarerayImage
(
"XRay"
);
bool
cResult
=
carerayImage
.
Open
();
bool
cResult
=
carerayImage
.
Open
();
...
@@ -174,6 +174,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -174,6 +174,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
#
region
启动,复位,停止
public
override
bool
StartRun
()
public
override
bool
StartRun
()
{
{
if
(
CanStartRun
().
Equals
(
false
))
if
(
CanStartRun
().
Equals
(
false
))
...
@@ -308,8 +309,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -308,8 +309,9 @@ namespace OnlineStore.DeviceLibrary
StopMove
();
StopMove
();
runStatus
=
RobotRunStatus
.
Wait
;
runStatus
=
RobotRunStatus
.
Wait
;
}
}
#
endregion
#
region
定时器
protected
override
void
BaseTimerProcess
()
protected
override
void
BaseTimerProcess
()
{
{
if
(
isInSuddenDown
||
isNoAirCheck
)
if
(
isInSuddenDown
||
isNoAirCheck
)
...
@@ -326,10 +328,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -326,10 +328,12 @@ namespace OnlineStore.DeviceLibrary
StartWorking
(
new
WorkParam
());
StartWorking
(
new
WorkParam
());
}
}
}
}
LockOnProcess
();
LockOnProcess
();
}
}
#
endregion
#
region
互锁信号处理
private
void
LockOnProcess
()
private
void
LockOnProcess
()
{
{
...
@@ -374,6 +378,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -374,6 +378,9 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
#
endregion
public
override
string
GetMoveStr
()
public
override
string
GetMoveStr
()
{
{
string
msg
=
""
;
string
msg
=
""
;
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
查看文件 @
9475593
...
@@ -80,6 +80,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -80,6 +80,8 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
protected
override
void
WorkingProcess
()
protected
override
void
WorkingProcess
()
{
{
if
(
MoveInfo
.
IsInWait
)
if
(
MoveInfo
.
IsInWait
)
...
@@ -303,11 +305,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -303,11 +305,8 @@ namespace OnlineStore.DeviceLibrary
InXWork
=
true
;
InXWork
=
true
;
bool
result
=
xRay
.
Start
();
bool
result
=
xRay
.
Start
();
WorkLog
(
"料盘处理:启动X射线["
+
result
+
"],等待1秒"
);
WorkLog
(
"料盘处理:启动X射线["
+
result
+
"],等待1秒"
);
}
}
private
string
lastFileName
=
""
;
private
int
lastTh
=
0
;
private
void
XW13_GetXRayImage
()
private
void
XW13_GetXRayImage
()
{
{
if
(
IOValue
(
IO_Type
.
X_Lock_On
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
X_Lock_On
).
Equals
(
IO_VALUE
.
LOW
))
...
@@ -322,6 +321,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -322,6 +321,11 @@ namespace OnlineStore.DeviceLibrary
CapImage
();
CapImage
();
MoveInfo
.
EndStepWait
();
MoveInfo
.
EndStepWait
();
}
}
#
endregion
#
region
点料处理
private
string
lastFileName
=
""
;
private
int
lastTh
=
0
;
private
void
XW15_GetResult
()
private
void
XW15_GetResult
()
{
{
...
@@ -337,9 +341,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -337,9 +341,13 @@ namespace OnlineStore.DeviceLibrary
xRay
.
Stop
();
xRay
.
Stop
();
}
}
int
count
=
99999
;
int
count
=
99999
;
//WorkLog("点料:开始调用 countImage.GetCount ");
//bool result = countImage.GetCount(lastTh, out count);
//WorkLog("点料:获取点料结果[" + lastTh + "]=【" + count + "】,result=" + result + ",保存并上传结果");
WorkLog
(
"点料:开始调用 countImage.GetCount "
);
WorkLog
(
"点料:开始调用 countImage.GetCount "
);
bool
result
=
countImage
.
GetCount
(
lastTh
,
out
count
);
int
n
=
carerayImage
.
GetCount
(
2
,
3
,
out
count
,
out
Asa
.
API
.
EyemImage
tpDstImg
);
WorkLog
(
"点料:获取点料结果
["
+
lastTh
+
"]=【"
+
count
+
"】,result="
+
result
+
",保存并上传结果"
);
WorkLog
(
"点料:获取点料结果
【"
+
count
+
"】,n ="
+
n
+
",保存并上传结果"
);
if
(
Work_ReelInfo
.
WareCount
<=
0
)
if
(
Work_ReelInfo
.
WareCount
<=
0
)
{
{
...
@@ -347,6 +355,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -347,6 +355,7 @@ namespace OnlineStore.DeviceLibrary
Work_ReelInfo
.
WareCount
=
count
;
Work_ReelInfo
.
WareCount
=
count
;
}
}
string
outF
=
path2_out
+
lastFileName
;
string
outF
=
path2_out
+
lastFileName
;
try
try
{
{
...
@@ -388,7 +397,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -388,7 +397,25 @@ namespace OnlineStore.DeviceLibrary
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
XRay_Data
,
lastData
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
XRay_Data
,
lastData
);
ClearFilePath
();
ClearFilePath
();
//取图失败关掉重开。
bool
imgResult
=
carerayImage
.
GetImage
();
bool
imgResult
=
carerayImage
.
GetImage
();
if
(!
imgResult
)
{
bool
closeR
=
carerayImage
.
Close
();
if
(
closeR
)
{
bool
openR
=
carerayImage
.
Open
();
LogUtil
.
error
(
Name
+
"carerayImage.GetImage 获取图片失败 = "
+
imgResult
+
", carerayImage.Close 成功 ,重新打开并获取图片"
);
imgResult
=
carerayImage
.
GetImage
();
}
else
{
LogUtil
.
error
(
Name
+
"carerayImage.GetImage 获取图片失败 = "
+
imgResult
+
", carerayImage.Close 失败"
);
}
}
carerayImage
.
WindowWidth
=
Config
.
WindowWidth
;
carerayImage
.
WindowWidth
=
Config
.
WindowWidth
;
carerayImage
.
WindowLevel
=
Config
.
WindowLevel
;
carerayImage
.
WindowLevel
=
Config
.
WindowLevel
;
if
(
imgResult
)
if
(
imgResult
)
...
@@ -443,6 +470,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -443,6 +470,8 @@ namespace OnlineStore.DeviceLibrary
}
}
return
lastFileName
;
return
lastFileName
;
}
}
private
void
UpdateArea
(
string
codeStr
)
private
void
UpdateArea
(
string
codeStr
)
{
{
lastTh
=
ThresholdValue
;
lastTh
=
ThresholdValue
;
...
@@ -459,9 +488,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -459,9 +488,10 @@ namespace OnlineStore.DeviceLibrary
lastTh
=
countParamMap
[
pn
].
Threshold
;
lastTh
=
countParamMap
[
pn
].
Threshold
;
}
}
}
}
LogUtil
.
info
(
"【"
+
codeStr
+
"】使用参数【"
+
lastTh
+
"】【"
+
area
+
"】,文件名【"
+
lastFileName
+
"】内容【"
+
fileValue
+
"】"
);
LogUtil
.
info
(
"【"
+
codeStr
+
"】使用参数【"
+
lastTh
+
"】【"
+
area
+
"】,文件名【"
+
lastFileName
+
"】内容【"
+
fileValue
+
"】"
);
File
.
WriteAllText
(
path3_area
,
fileValue
);
File
.
WriteAllText
(
path3_area
,
fileValue
);
}
}
private
void
ClearFilePath
()
private
void
ClearFilePath
()
{
{
try
try
...
@@ -477,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -477,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
}
}
try
try
{
{
System
.
IO
.
Directory
.
CreateDirectory
(
path1_tif
+
@"\"
);
System
.
IO
.
Directory
.
CreateDirectory
(
path1_tif
+
@"\"
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -486,10 +516,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -486,10 +516,6 @@ namespace OnlineStore.DeviceLibrary
}
}
private
bool
IsInStoreNeed
()
{
return
false
;
}
#
endregion
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论