Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 033376d3
由
LN
编写于
2020-06-04 16:03:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加点料按钮
1 个父辈
4e2f4d73
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
110 行增加
和
39 行删除
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.Designer.cs
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.Designer.cs
查看文件 @
033376d
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
this
.
txtSlaveId
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtSlaveId
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
cmbWriteIO
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cmbWriteIO
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
btnImage
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
panel1
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage3
.
SuspendLayout
();
this
.
tabPage3
.
SuspendLayout
();
...
@@ -220,11 +221,12 @@
...
@@ -220,11 +221,12 @@
//
//
// groupBox7
// groupBox7
//
//
this
.
groupBox7
.
Controls
.
Add
(
this
.
btnImage
);
this
.
groupBox7
.
Controls
.
Add
(
this
.
btnXStart
);
this
.
groupBox7
.
Controls
.
Add
(
this
.
btnXStart
);
this
.
groupBox7
.
Controls
.
Add
(
this
.
btnXStop
);
this
.
groupBox7
.
Controls
.
Add
(
this
.
btnXStop
);
this
.
groupBox7
.
Location
=
new
System
.
Drawing
.
Point
(
294
,
306
);
this
.
groupBox7
.
Location
=
new
System
.
Drawing
.
Point
(
294
,
306
);
this
.
groupBox7
.
Name
=
"groupBox7"
;
this
.
groupBox7
.
Name
=
"groupBox7"
;
this
.
groupBox7
.
Size
=
new
System
.
Drawing
.
Size
(
258
,
168
);
this
.
groupBox7
.
Size
=
new
System
.
Drawing
.
Size
(
337
,
168
);
this
.
groupBox7
.
TabIndex
=
283
;
this
.
groupBox7
.
TabIndex
=
283
;
this
.
groupBox7
.
TabStop
=
false
;
this
.
groupBox7
.
TabStop
=
false
;
this
.
groupBox7
.
Text
=
"X光测试"
;
this
.
groupBox7
.
Text
=
"X光测试"
;
...
@@ -736,6 +738,19 @@
...
@@ -736,6 +738,19 @@
this
.
tabPage2
.
Text
=
" X光射线 "
;
this
.
tabPage2
.
Text
=
" X光射线 "
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
//
//
// btnImage
//
this
.
btnImage
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnImage
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnImage
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnImage
.
Location
=
new
System
.
Drawing
.
Point
(
158
,
63
);
this
.
btnImage
.
Name
=
"btnImage"
;
this
.
btnImage
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
35
);
this
.
btnImage
.
TabIndex
=
287
;
this
.
btnImage
.
Text
=
"拍照片"
;
this
.
btnImage
.
UseVisualStyleBackColor
=
false
;
this
.
btnImage
.
Click
+=
new
System
.
EventHandler
(
this
.
btnImage_Click
);
//
// FrmXRay
// FrmXRay
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
@@ -824,6 +839,7 @@
...
@@ -824,6 +839,7 @@
private
System
.
Windows
.
Forms
.
GroupBox
groupBox7
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox7
;
private
System
.
Windows
.
Forms
.
Button
btnXStart
;
private
System
.
Windows
.
Forms
.
Button
btnXStart
;
private
System
.
Windows
.
Forms
.
Button
btnXStop
;
private
System
.
Windows
.
Forms
.
Button
btnXStop
;
private
System
.
Windows
.
Forms
.
Button
btnImage
;
}
}
}
}
RC1266-AutoCountMachine/source/AutoCountClient/FrmXRay.cs
查看文件 @
033376d
...
@@ -158,7 +158,7 @@ namespace OnlineStore.AutoCountClient
...
@@ -158,7 +158,7 @@ namespace OnlineStore.AutoCountClient
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
LogUtil
.
error
(
""
,
ex
);
LogUtil
.
error
(
""
,
ex
);
}
}
}
}
private
void
btnOpenDo_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenDo_Click
(
object
sender
,
EventArgs
e
)
...
@@ -175,7 +175,7 @@ namespace OnlineStore.AutoCountClient
...
@@ -175,7 +175,7 @@ namespace OnlineStore.AutoCountClient
int
index
=
FormUtil
.
GetIntValue
(
txtDOIndex
);
int
index
=
FormUtil
.
GetIntValue
(
txtDOIndex
);
ConfigIO
io
=
GetSelectDO
();
ConfigIO
io
=
GetSelectDO
();
if
(
io
.
ProName
.
Equals
(
IO_Type
.
X_Lock_On
)
&&
value
.
Equals
(
IO_VALUE
.
HIGH
))
if
(
io
.
ProName
.
Equals
(
IO_Type
.
X_Lock_On
)
&&
value
.
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(!
equipBean
.
LockOnCanMove
())
if
(!
equipBean
.
LockOnCanMove
())
{
{
...
@@ -354,7 +354,7 @@ namespace OnlineStore.AutoCountClient
...
@@ -354,7 +354,7 @@ namespace OnlineStore.AutoCountClient
{
{
Control
c
=
(
Control
)
sender
;
Control
c
=
(
Control
)
sender
;
string
ioType
=
c
.
Name
;
string
ioType
=
c
.
Name
;
if
(
ioType
.
Equals
(
IO_Type
.
X_Lock_On
)
&&
(
!
equipBean
.
IOValue
(
IO_Type
.
X_Lock_On
).
Equals
(
IO_VALUE
.
HIGH
)))
if
(
ioType
.
Equals
(
IO_Type
.
X_Lock_On
)
&&
(
!
equipBean
.
IOValue
(
IO_Type
.
X_Lock_On
).
Equals
(
IO_VALUE
.
HIGH
)))
{
{
if
(!
equipBean
.
LockOnCanMove
())
if
(!
equipBean
.
LockOnCanMove
())
{
{
...
@@ -385,8 +385,8 @@ namespace OnlineStore.AutoCountClient
...
@@ -385,8 +385,8 @@ namespace OnlineStore.AutoCountClient
if
(!
equipBean
.
xRayCanStart
)
if
(!
equipBean
.
xRayCanStart
)
{
{
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 打开X光 :"
+
"不能打开X光, 当前状态:"
+
equipBean
.
LastXRayState
);
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 打开X光 :"
+
"不能打开X光, 当前状态:"
+
equipBean
.
LastXRayState
);
MessageBox
.
Show
(
"不能打开X光, 当前状态:"
+
equipBean
.
LastXRayState
,
"警告 "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
"不能打开X光, 当前状态:"
+
equipBean
.
LastXRayState
,
"警告 "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
return
;
return
;
}
}
if
(!
equipBean
.
LockOnCanMove
())
if
(!
equipBean
.
LockOnCanMove
())
...
@@ -408,6 +408,13 @@ namespace OnlineStore.AutoCountClient
...
@@ -408,6 +408,13 @@ namespace OnlineStore.AutoCountClient
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 关闭X光 "
);
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 关闭X光 "
);
equipBean
.
xRay
.
Stop
();
equipBean
.
xRay
.
Stop
();
}
}
private
void
btnImage_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
equipBean
.
Name
+
"用户点击 拍照片 "
);
string
fileName
=
equipBean
.
CapImage
();
MessageBox
.
Show
(
"获取图片完成:"
+
fileName
);
}
}
}
}
}
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
查看文件 @
033376d
...
@@ -315,39 +315,40 @@ namespace OnlineStore.DeviceLibrary
...
@@ -315,39 +315,40 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StepEnum
.
XW13_GetXRayImage
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
XW13_GetXRayImage
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
8000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
8000
));
WorkLog
(
"点料:清理"
+
path1_tif
+
"内容,开始获取X射线图形 "
);
WorkLog
(
"点料:清理"
+
path1_tif
+
"内容,开始获取X射线图形 "
);
string
lastData
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
//string lastData = DateTime.Now.ToString("yyyy-MM-dd");
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
XRay_Data
,
lastData
);
//ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData);
ClearFilePath
();
//ClearFilePath();
carerayImage
.
GetImage
();
//carerayImage.GetImage();
carerayImage
.
WindowWidth
=
Config
.
WindowWidth
;
//carerayImage.WindowWidth = Config.WindowWidth;
carerayImage
.
WindowLevel
=
Config
.
WindowLevel
;
//carerayImage.WindowLevel = Config.WindowLevel;
Bitmap
bmp
=
carerayImage
.
Get48bImage
();
//Bitmap bmp = carerayImage.Get48bImage();
lastFileName
=
Work_ReelInfo
.
GetRealId
()+
"-"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".png"
;
//lastFileName =Work_ReelInfo.GetRealId()+"-"+ DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
string
fileP
=
path1_tif
+
@"\"
+
lastFileName
;
//string fileP = path1_tif + @"\" + lastFileName;
bmp
.
Save
(
fileP
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
);
//bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png);
string
backFile
=
path_XRAY
+
lastFileName
;
//string backFile = path_XRAY + lastFileName;
try
//try
{
//{
bmp
.
Save
(
backFile
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
);
// bmp.Save(backFile, System.Drawing.Imaging.ImageFormat.Png);
}
//}
catch
(
Exception
ex
)
//catch (Exception ex)
{
//{
LogUtil
.
error
(
"X图片备份到【"
+
backFile
+
"】错误:"
+
ex
.
ToString
());
// LogUtil.error("X图片备份到【" + backFile + "】错误:" + ex.ToString());
}
//}
WorkLog
(
"点料:获取X射线图形,保存到: "
+
fileP
+
",备份到:"
+
backFile
+
",记录时间"
+
lastData
+
",停止X射线"
);
//WorkLog("点料:获取X射线图形,保存到: " + fileP + ",备份到:" + backFile + ",记录时间" + lastData + ",停止X射线");
GetImageEvent
?.
Invoke
(
bmp
);
//GetImageEvent?.Invoke(bmp);
bool
result
=
xRay
.
Stop
();
//bool result = xRay.Stop();
if
(!
result
)
//if (!result)
{
//{
LogUtil
.
error
(
" xRay.Stop() 第一次失败,再次调用Stop"
);
// LogUtil.error(" xRay.Stop() 第一次失败,再次调用Stop");
result
=
xRay
.
Stop
();
// result = xRay.Stop();
if
(!
result
)
// if (!result)
{
// {
LogUtil
.
error
(
" xRay.Stop()失败:"
+
result
);
// LogUtil.error(" xRay.Stop()失败:" + result);
}
// }
}
//}
CapImage
();
MoveInfo
.
EndStepWait
();
MoveInfo
.
EndStepWait
();
}
}
...
@@ -403,6 +404,53 @@ namespace OnlineStore.DeviceLibrary
...
@@ -403,6 +404,53 @@ namespace OnlineStore.DeviceLibrary
});
});
MoveInfo
.
EndStepWait
();
MoveInfo
.
EndStepWait
();
}
}
public
string
CapImage
()
{
try
{
string
lastData
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
XRay_Data
,
lastData
);
ClearFilePath
();
carerayImage
.
GetImage
();
carerayImage
.
WindowWidth
=
Config
.
WindowWidth
;
carerayImage
.
WindowLevel
=
Config
.
WindowLevel
;
Bitmap
bmp
=
carerayImage
.
Get48bImage
();
lastFileName
=
Work_ReelInfo
.
GetRealId
()
+
"-"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".png"
;
string
fileP
=
path1_tif
+
@"\"
+
lastFileName
;
bmp
.
Save
(
fileP
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
);
string
backFile
=
path_XRAY
+
lastFileName
;
try
{
bmp
.
Save
(
backFile
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"X图片备份到【"
+
backFile
+
"】错误:"
+
ex
.
ToString
());
}
WorkLog
(
"点料:获取X射线图形,保存到: "
+
fileP
+
",备份到:"
+
backFile
+
",记录时间"
+
lastData
+
",停止X射线"
);
GetImageEvent
?.
Invoke
(
bmp
);
bool
result
=
xRay
.
Stop
();
if
(!
result
)
{
LogUtil
.
error
(
" xRay.Stop() 第一次失败,再次调用Stop"
);
result
=
xRay
.
Stop
();
if
(!
result
)
{
LogUtil
.
error
(
" xRay.Stop()失败:"
+
result
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" CapImage 出错:"
+
ex
.
ToString
());
}
return
lastFileName
;
}
private
void
ClearFilePath
()
private
void
ClearFilePath
()
{
{
try
try
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论