Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-HCSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 06c29840
由
LN
编写于
2021-03-13 18:29:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出入库过程中进出轴报警,调用disablePos库位
1 个父辈
8fa1e7ee
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
72 行增加
和
66 行删除
source/DeviceLibrary/acSingleStore/BoxBean.cs
source/DeviceLibrary/acSingleStore/StoreManager.cs
source/HCSingleStore/FrmBox.Designer.cs
source/DeviceLibrary/acSingleStore/BoxBean.cs
查看文件 @
06c2984
...
@@ -475,26 +475,48 @@ namespace OnlineStore.DeviceLibrary
...
@@ -475,26 +475,48 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
",停止运行,总运行时间:"
+
span
.
ToString
());
LogInfo
(
",停止运行,总运行时间:"
+
span
.
ToString
());
}
}
private
DateTime
lastDisTime
=
DateTime
.
Now
;
public
override
void
Alarm
(
StoreAlarmType
alarmType
,
string
alarmDetial
,
string
alarmMsg
,
StoreMoveType
storeMoveType
)
private
string
LastPosId
=
""
;
public
override
void
Alarm
(
StoreAlarmType
nalarmType
,
string
alarmDetial
,
string
alarmMsg
,
StoreMoveType
storeMoveType
)
{
{
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
SaveAlarmInfo
(
n
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
autoNext
=
false
;
autoNext
=
false
;
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
StoreAlarmType
.
SuddenStop
&&
alarmType
!=
StoreAlarmType
.
NoAirCheck
)
if
(
this
.
alarmType
.
Equals
(
nalarmType
)
&&
nalarmType
!=
StoreAlarmType
.
SuddenStop
&&
n
alarmType
!=
StoreAlarmType
.
NoAirCheck
)
{
{
return
;
return
;
}
}
LogUtil
.
error
(
Name
+
" 报警,报警类型:"
+
alarmType
);
LogUtil
.
error
(
Name
+
" 报警,报警类型:"
+
n
alarmType
);
this
.
alarmType
=
alarmType
;
this
.
alarmType
=
nalarmType
;
if
(
alarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
if
(
nalarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
nalarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
{
if
(
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
//只有第一次报警才处理库位号
{
if
(
alarmDetial
.
Equals
(
LineAlarm
.
InOutAxisAlarm
.
ToString
())
&&
MoveInfo
.
MoveParam
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfo
!=
null
)
{
{
string
posId
=
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
;
TimeSpan
span
=
DateTime
.
Now
-
lastDisTime
;
if
(
lastPosId
.
Equals
(
posId
)
&&
span
.
TotalSeconds
<
8
)
{
//同一个库位8秒内不重复发
}
else
{
lastDisTime
=
DateTime
.
Now
;
LastPosId
=
posId
;
LogUtil
.
info
(
Name
+
" ["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"]"
+
MoveInfo
.
MoveParam
.
PosInfo
.
ToStr
()
+
" 过程中进出轴报警,记录库位号["
+
posId
+
"],调用disablePos"
);
Task
.
Factory
.
StartNew
(
delegate
()
{
StoreManager
.
disablePos
(
posId
);
});
}
}
}
LogUtil
.
error
(
Name
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
LogUtil
.
error
(
Name
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
//IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
//IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StopMove
();
StopMove
();
}
}
else
if
(
alarmType
==
StoreAlarmType
.
SuddenStop
)
else
if
(
n
alarmType
==
StoreAlarmType
.
SuddenStop
)
{
{
isInSuddenDown
=
true
;
isInSuddenDown
=
true
;
LogUtil
.
error
(
Name
+
"收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "
);
LogUtil
.
error
(
Name
+
"收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "
);
...
@@ -502,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -502,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
StopMove
();
StopMove
();
storeStatus
=
StoreStatus
.
SuddenStop
;
storeStatus
=
StoreStatus
.
SuddenStop
;
}
}
else
if
(
alarmType
.
Equals
(
StoreAlarmType
.
NoAirCheck
))
else
if
(
n
alarmType
.
Equals
(
StoreAlarmType
.
NoAirCheck
))
{
{
isNoAirCheck
=
true
;
isNoAirCheck
=
true
;
LogUtil
.
error
(
Name
+
" 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "
);
LogUtil
.
error
(
Name
+
" 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "
);
...
...
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
06c2984
...
@@ -126,59 +126,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -126,59 +126,7 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
//public static BoxBean InitStore()
//{
// try
// {
// BaseConfig.ProIOIpMap = new Dictionary<string, string>();
// if (!isInit)
// {
// string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
// if (server.Equals(""))
// {
// IsConnectServer = false;
// }
// else
// {
// //IsConnectServer = true;
// }
// CheckEnum(typeof(StoreMoveStep));
// CheckEnum(typeof(StoreStatus));
// CheckEnum(typeof(StoreRunStatus));
// isInit = true;
// string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type);
// LogUtil.info( "配置的料仓 类型=" + storeType + ",开始加载料仓配置");
// if (storeType == StoreType.RC_AC_SA)
// {
// string appPath = Application.StartupPath;
// string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
// string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
// int storeID = ConfigAppSettings.GetIntValue(Setting_Init.Store_ID);
// BaseConfig storeConfig = CSVConfigReader.LoadConfig(storeID, CID, StoreType.RC_AC_SA, linefilePath);
// string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
// if (File.Exists(positionConfigFile))
// {
// LogUtil.info( "加载位置文件:" + positionConfigFile);
// CSVPositionReader<ACStorePosition>.ReloadCSVFile(positionConfigFile);
// }
// Config = (BoxConfig)storeConfig;
// Store = new BoxBean(Config);
// Store.CID = CID;
// LogUtil.info( "加载料仓完成!");
// return Store;
// }
// }
// }
// catch (Exception ex)
// {
// LogUtil.error("出错:", ex);
// MessageBox.Show(ex.ToString(), "加载配置错误(请检查配置)");
// Application.Exit();
// }
// return Store;
//}
public
static
string
GetLocationPosId
(
int
deviceID
,
int
width
)
public
static
string
GetLocationPosId
(
int
deviceID
,
int
width
)
{
{
if
(
deviceID
<=
0
)
if
(
deviceID
<=
0
)
...
@@ -366,6 +314,42 @@ namespace OnlineStore.DeviceLibrary
...
@@ -366,6 +314,42 @@ namespace OnlineStore.DeviceLibrary
}
}
return
msg
;
return
msg
;
}
}
// 料仓进出轴报警时,屏蔽正在执行的库位: /rest/api/qisda/device/disablePos //参数: posName: 库位编号
// 返回:{ "code":0,"msg":"ok","data":""} code: 0为正常,其他为异常,msg: 消息,data:
private
static
string
Addr_disablePos
=
"/rest/api/qisda/device/disablePos"
;
public
static
string
disablePos
(
string
posName
)
{
string
msg
=
""
;
try
{
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"posName"
,
posName
);
string
server
=
GetAddr
(
Addr_cancelPutInTask
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"disablePos "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
ResultData
data
=
JsonHelper
.
DeserializeJsonToObject
<
ResultData
>(
resultStr
);
if
(
data
==
null
)
{
return
msg
=
" disablePos【 "
+
posName
+
"】 没有收到服务器反馈"
;
}
else
if
(
data
.
code
.
Equals
(
0
).
Equals
(
false
))
{
return
msg
=
" disablePos【 "
+
posName
+
"】 :"
+
data
.
msg
;
}
return
""
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" disablePos error :"
+
ex
.
ToString
());
}
return
msg
;
}
}
}
public
class
ResultData
public
class
ResultData
...
...
source/HCSingleStore/FrmBox.Designer.cs
查看文件 @
06c2984
...
@@ -315,7 +315,7 @@
...
@@ -315,7 +315,7 @@
this
.
groupBox1
.
Controls
.
Add
(
this
.
label43
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label43
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label42
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label42
);
this
.
groupBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
42
3
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
42
7
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
476
,
136
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
476
,
136
);
this
.
groupBox1
.
TabIndex
=
217
;
this
.
groupBox1
.
TabIndex
=
217
;
...
@@ -494,7 +494,7 @@
...
@@ -494,7 +494,7 @@
this
.
groupBox2
.
Controls
.
Add
(
this
.
button6
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
button6
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
button3
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
button3
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
button5
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
button5
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
3
39
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
3
43
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
476
,
78
);
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
476
,
78
);
this
.
groupBox2
.
TabIndex
=
276
;
this
.
groupBox2
.
TabIndex
=
276
;
...
@@ -667,10 +667,10 @@
...
@@ -667,10 +667,10 @@
//
//
this
.
tabPage5
.
Controls
.
Add
(
this
.
picAxis4
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
picAxis4
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
picPPoint
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
picPPoint
);
this
.
tabPage5
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
2
2
);
this
.
tabPage5
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
2
9
);
this
.
tabPage5
.
Name
=
"tabPage5"
;
this
.
tabPage5
.
Name
=
"tabPage5"
;
this
.
tabPage5
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage5
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage5
.
Size
=
new
System
.
Drawing
.
Size
(
495
,
5
58
);
this
.
tabPage5
.
Size
=
new
System
.
Drawing
.
Size
(
495
,
5
35
);
this
.
tabPage5
.
TabIndex
=
1
;
this
.
tabPage5
.
TabIndex
=
1
;
this
.
tabPage5
.
Text
=
"点位示意图"
;
this
.
tabPage5
.
Text
=
"点位示意图"
;
this
.
tabPage5
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage5
.
UseVisualStyleBackColor
=
true
;
...
@@ -748,7 +748,7 @@
...
@@ -748,7 +748,7 @@
this
.
groupInout
.
Enabled
=
false
;
this
.
groupInout
.
Enabled
=
false
;
this
.
groupInout
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
6
);
this
.
groupInout
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
6
);
this
.
groupInout
.
Name
=
"groupInout"
;
this
.
groupInout
.
Name
=
"groupInout"
;
this
.
groupInout
.
Size
=
new
System
.
Drawing
.
Size
(
472
,
569
);
this
.
groupInout
.
Size
=
new
System
.
Drawing
.
Size
(
798
,
569
);
this
.
groupInout
.
TabIndex
=
100
;
this
.
groupInout
.
TabIndex
=
100
;
this
.
groupInout
.
TabStop
=
false
;
this
.
groupInout
.
TabStop
=
false
;
this
.
groupInout
.
Text
=
"料仓操作"
;
this
.
groupInout
.
Text
=
"料仓操作"
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论