Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
SO1131-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 14ed3bc3
由
张东亮
编写于
2023-04-11 10:17:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
暂停改为按钮
1 个父辈
66a61cc9
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
44 行增加
和
86 行删除
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Camera.cs
source/XLRStoreClient/boxForm/FrmBoxEquip.Designer.cs
source/XLRStoreClient/boxForm/FrmBoxEquip.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
查看文件 @
14ed3bc
...
@@ -1064,8 +1064,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1064,8 +1064,6 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
门禁
#
region
门禁
//门禁状态:0正常。1=安全门禁打开,已停止运动
private
int
CurDoorLimitState
=
0
;
protected
void
DoorLimitProcess
()
protected
void
DoorLimitProcess
()
{
{
try
try
...
@@ -1078,9 +1076,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1078,9 +1076,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
//if (CurDoorLimitState.Equals(0))
{
if
(
StoreManager
.
DisBoxDoorLimit
)
if
(
StoreManager
.
DisBoxDoorLimit
)
{
{
}
}
...
@@ -1092,16 +1088,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1092,16 +1088,15 @@ namespace OnlineStore.DeviceLibrary
{
{
SecurityAccessStop
(
"后门门禁"
);
SecurityAccessStop
(
"后门门禁"
);
}
}
}
//else
if
(
CurDoorLimitState
.
Equals
(
1
))
{
if
(
IOValue
(
IO_Type
.
FrontDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
)
&&
if
(
IOValue
(
IO_Type
.
FrontDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
BackDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
))
IOValue
(
IO_Type
.
BackDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SecurityAccessReset
();
SecurityAccessReset
();
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -1121,16 +1116,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1121,16 +1116,12 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
CurDoorLimitState
=
1
;
if
(!
MoveStop
)
if
(
alarmType
>
(
AlarmType
.
IoSingleTimeOut
))
{
{
return
;
MoveStop
=
true
;
SetWarnMsg
(
$
"{doorname}被打开,{Name}暂停运动"
);
}
}
//LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},暂停运动");
MoveStop
=
true
;
SetWarnMsg
(
$
"{doorname}被打开,{Name}暂停运动"
);
//Alarm(AlarmType.SuddenStop);
}
}
...
@@ -1144,17 +1135,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1144,17 +1135,10 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
CurDoorLimitState
=
0
;
//MoveStop = false;
if
(
WarnMsg
.
Contains
(
"暂停运动"
))
if
(
WarnMsg
.
Contains
(
"暂停运动"
))
{
{
SetWarnMsg
(
""
);
SetWarnMsg
(
""
);
}
}
if
(
alarmType
>
(
AlarmType
.
IoSingleTimeOut
))
{
return
;
}
//光栅恢复处理
}
}
#
endregion
#
endregion
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Camera.cs
查看文件 @
14ed3bc
...
@@ -18,42 +18,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -18,42 +18,13 @@ namespace OnlineStore.DeviceLibrary
{
{
public
const
string
boxACamName
=
"box_A"
;
public
const
string
boxACamName
=
"box_A"
;
public
const
string
boxBCamName
=
"box_B"
;
public
const
string
boxBCamName
=
"box_B"
;
Thread
[]
camerathread
;
bool
IsOpen
=
false
;
Asa
.
Camera
.
VisionLib
camera
;
bool
loadCameraState
=
false
;
public
delegate
void
CameraAcqEventHandler
(
CameraArgs
cameraArgs
);
public
delegate
void
CameraAcqEventHandler
(
CameraArgs
cameraArgs
);
public
event
CameraAcqEventHandler
camera_event
;
public
event
CameraAcqEventHandler
camera_event
;
public
void
RegisterCameraGrabImage
(
CameraAcqEventHandler
grabbedEventHandler
)
{
//camera_event += grabbedEventHandler;
}
void
LoadCameraConfig
(
object
boxA
,
object
boxB
)
void
LoadCameraConfig
(
object
boxA
,
object
boxB
)
{
{
//Task.Factory.StartNew(new Action(() =>
//{
// if (loadCameraState)
// return;
// string path = @".\Config\Camera.json";
// if (!File.Exists(path))
// {
// LogUtil.error(Name + "找不到监控相机配置文件" + path);
// }
// camera = new Asa.Camera.VisionLib(path,true);
// camera.PreviewImage(boxACamName, (IntPtr)boxA);
// camera.PreviewImage(boxBCamName, (IntPtr)boxB);
// camera.Open();
// loadCameraState = true;
//}));
}
}
public
Bitmap
AcqImage
(
string
camName
)
{
Bitmap
bitmap
=
camera
.
GetImage
(
camName
);
return
bitmap
;
}
public
void
StartRecord
(
string
boxAFileName
,
string
boxBFileName
)
public
void
StartRecord
(
string
boxAFileName
,
string
boxBFileName
)
{
{
StartBoxARecord
(
boxAFileName
);
StartBoxARecord
(
boxAFileName
);
...
...
source/XLRStoreClient/boxForm/FrmBoxEquip.Designer.cs
查看文件 @
14ed3bc
...
@@ -47,9 +47,9 @@
...
@@ -47,9 +47,9 @@
this
.
lblMoveInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblMoveInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
panBase
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panBase
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
btnMoveStop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnHlhasReel
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnHlhasReel
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnDebugAxis
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnDebugAxis
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
chbMoveStop
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
chbDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chbDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
lblStoreStatus
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblStoreStatus
=
new
System
.
Windows
.
Forms
.
Label
();
...
@@ -437,9 +437,9 @@
...
@@ -437,9 +437,9 @@
this
.
panBase
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
panBase
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
panBase
.
BorderStyle
=
System
.
Windows
.
Forms
.
BorderStyle
.
FixedSingle
;
this
.
panBase
.
BorderStyle
=
System
.
Windows
.
Forms
.
BorderStyle
.
FixedSingle
;
this
.
panBase
.
Controls
.
Add
(
this
.
btnMoveStop
);
this
.
panBase
.
Controls
.
Add
(
this
.
btnHlhasReel
);
this
.
panBase
.
Controls
.
Add
(
this
.
btnHlhasReel
);
this
.
panBase
.
Controls
.
Add
(
this
.
btnDebugAxis
);
this
.
panBase
.
Controls
.
Add
(
this
.
btnDebugAxis
);
this
.
panBase
.
Controls
.
Add
(
this
.
chbMoveStop
);
this
.
panBase
.
Controls
.
Add
(
this
.
lblName
);
this
.
panBase
.
Controls
.
Add
(
this
.
lblName
);
this
.
panBase
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
panBase
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
panBase
.
Controls
.
Add
(
this
.
lblStoreStatus
);
this
.
panBase
.
Controls
.
Add
(
this
.
lblStoreStatus
);
...
@@ -450,6 +450,19 @@
...
@@ -450,6 +450,19 @@
this
.
panBase
.
Size
=
new
System
.
Drawing
.
Size
(
997
,
50
);
this
.
panBase
.
Size
=
new
System
.
Drawing
.
Size
(
997
,
50
);
this
.
panBase
.
TabIndex
=
260
;
this
.
panBase
.
TabIndex
=
260
;
//
//
// btnMoveStop
//
this
.
btnMoveStop
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnMoveStop
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnMoveStop
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnMoveStop
.
Location
=
new
System
.
Drawing
.
Point
(
572
,
3
);
this
.
btnMoveStop
.
Name
=
"btnMoveStop"
;
this
.
btnMoveStop
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
40
);
this
.
btnMoveStop
.
TabIndex
=
290
;
this
.
btnMoveStop
.
Text
=
"暂停运动"
;
this
.
btnMoveStop
.
UseVisualStyleBackColor
=
false
;
this
.
btnMoveStop
.
Click
+=
new
System
.
EventHandler
(
this
.
btnMoveStop_Click
);
//
// btnHlhasReel
// btnHlhasReel
//
//
this
.
btnHlhasReel
.
BackColor
=
System
.
Drawing
.
Color
.
SkyBlue
;
this
.
btnHlhasReel
.
BackColor
=
System
.
Drawing
.
Color
.
SkyBlue
;
...
@@ -476,18 +489,6 @@
...
@@ -476,18 +489,6 @@
this
.
btnDebugAxis
.
UseVisualStyleBackColor
=
false
;
this
.
btnDebugAxis
.
UseVisualStyleBackColor
=
false
;
this
.
btnDebugAxis
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDebugAxis_Click
);
this
.
btnDebugAxis
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDebugAxis_Click
);
//
//
// chbMoveStop
//
this
.
chbMoveStop
.
AutoSize
=
true
;
this
.
chbMoveStop
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbMoveStop
.
Location
=
new
System
.
Drawing
.
Point
(
597
,
14
);
this
.
chbMoveStop
.
Name
=
"chbMoveStop"
;
this
.
chbMoveStop
.
Size
=
new
System
.
Drawing
.
Size
(
104
,
28
);
this
.
chbMoveStop
.
TabIndex
=
262
;
this
.
chbMoveStop
.
Text
=
"暂停运动"
;
this
.
chbMoveStop
.
UseVisualStyleBackColor
=
true
;
this
.
chbMoveStop
.
Click
+=
new
System
.
EventHandler
(
this
.
chbMoveStop_CheckedChanged
);
//
// lblName
// lblName
//
//
this
.
lblName
.
BackColor
=
System
.
Drawing
.
Color
.
DodgerBlue
;
this
.
lblName
.
BackColor
=
System
.
Drawing
.
Color
.
DodgerBlue
;
...
@@ -504,7 +505,7 @@
...
@@ -504,7 +505,7 @@
//
//
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
4
96
,
14
);
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
4
62
,
13
);
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
104
,
28
);
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
104
,
28
);
this
.
chbDebug
.
TabIndex
=
247
;
this
.
chbDebug
.
TabIndex
=
247
;
...
@@ -611,7 +612,6 @@
...
@@ -611,7 +612,6 @@
private
System
.
Windows
.
Forms
.
Label
lblInoutInfo
;
private
System
.
Windows
.
Forms
.
Label
lblInoutInfo
;
private
System
.
Windows
.
Forms
.
TextBox
txtSlaveId
;
private
System
.
Windows
.
Forms
.
TextBox
txtSlaveId
;
protected
System
.
Windows
.
Forms
.
Panel
panBase
;
protected
System
.
Windows
.
Forms
.
Panel
panBase
;
protected
System
.
Windows
.
Forms
.
CheckBox
chbMoveStop
;
protected
System
.
Windows
.
Forms
.
Label
lblName
;
protected
System
.
Windows
.
Forms
.
Label
lblName
;
protected
System
.
Windows
.
Forms
.
CheckBox
chbDebug
;
protected
System
.
Windows
.
Forms
.
CheckBox
chbDebug
;
protected
System
.
Windows
.
Forms
.
Label
lblStoreStatus
;
protected
System
.
Windows
.
Forms
.
Label
lblStoreStatus
;
...
@@ -624,6 +624,7 @@
...
@@ -624,6 +624,7 @@
private
System
.
Windows
.
Forms
.
Button
btnHlhasReel
;
private
System
.
Windows
.
Forms
.
Button
btnHlhasReel
;
private
System
.
Windows
.
Forms
.
Button
button2
;
private
System
.
Windows
.
Forms
.
Button
button2
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
Button
button1
;
protected
System
.
Windows
.
Forms
.
Button
btnMoveStop
;
}
}
}
}
source/XLRStoreClient/boxForm/FrmBoxEquip.cs
查看文件 @
14ed3bc
...
@@ -36,7 +36,6 @@ namespace OnlineStore.XLRStore
...
@@ -36,7 +36,6 @@ namespace OnlineStore.XLRStore
}
}
private
void
FrmStoreIOStatus_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmStoreIOStatus_Load
(
object
sender
,
EventArgs
e
)
{
{
chbMoveStop
.
Checked
=
boxBean
.
MoveStop
;
lblStoreStatus
.
Text
=
DeviceBase
.
GetRunStr
(
boxBean
.
runStatus
);
lblStoreStatus
.
Text
=
DeviceBase
.
GetRunStr
(
boxBean
.
runStatus
);
lblThisSta
.
Text
=
boxBean
.
WarnMsg
;
lblThisSta
.
Text
=
boxBean
.
WarnMsg
;
...
@@ -191,9 +190,15 @@ namespace OnlineStore.XLRStore
...
@@ -191,9 +190,15 @@ namespace OnlineStore.XLRStore
{
{
FormStatus
(
true
);
FormStatus
(
true
);
}
}
if
(
boxBean
.
MoveStop
!=
chbMoveStop
.
Checked
)
if
(
boxBean
.
MoveStop
)
{
{
chbMoveStop
.
Checked
=
boxBean
.
MoveStop
;
btnMoveStop
.
Text
=
"恢复运动"
;
btnMoveStop
.
BackColor
=
Color
.
Green
;
}
else
{
btnMoveStop
.
Text
=
"暂停运动"
;
btnMoveStop
.
BackColor
=
Color
.
Yellow
;
}
}
}
}
else
else
...
@@ -477,20 +482,6 @@ namespace OnlineStore.XLRStore
...
@@ -477,20 +482,6 @@ namespace OnlineStore.XLRStore
tabcon
.
Controls
.
Add
(
lineTabPage
);
tabcon
.
Controls
.
Add
(
lineTabPage
);
}
}
private
void
chbMoveStop_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
IsLoad
)
{
return
;
}
if
(
boxBean
.
MoveStop
==
chbMoveStop
.
Checked
)
{
return
;
}
boxBean
.
MoveStop
=
chbMoveStop
.
Checked
;
LogUtil
.
info
(
boxBean
.
Name
+
"用户切换是否暂停: "
+
boxBean
.
MoveStop
);
}
private
void
btnDebugAxis_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDebugAxis_Click
(
object
sender
,
EventArgs
e
)
{
{
//boxBean.IsDebug
//boxBean.IsDebug
...
@@ -530,6 +521,17 @@ namespace OnlineStore.XLRStore
...
@@ -530,6 +521,17 @@ namespace OnlineStore.XLRStore
{
{
boxBean
.
StopRecord
();
boxBean
.
StopRecord
();
}
}
private
void
btnMoveStop_Click
(
object
sender
,
EventArgs
e
)
{
if
(
boxBean
.
runStatus
<=
RunStatus
.
Wait
)
{
MessageBox
.
Show
(
boxBean
.
Name
+
"请先启动设备"
,
"提示"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
return
;
}
boxBean
.
MoveStop
=
!
boxBean
.
MoveStop
;
LogUtil
.
info
(
boxBean
.
Name
+
"用户切换是否暂停: "
+
boxBean
.
MoveStop
);
}
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论