Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5b068608
由
LN
编写于
2023-01-11 09:26:43 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
canReelToBelt接口默认返回false。
增加禁用托盘上传。
1 个父辈
7c04ee39
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
69 行增加
和
12 行删除
source/Common/util/MyWebClient.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/Common/util/MyWebClient.cs
查看文件 @
5b06860
...
@@ -149,21 +149,21 @@ namespace OnlineStore.Common
...
@@ -149,21 +149,21 @@ namespace OnlineStore.Common
{
{
try
try
{
{
LogUtil
.
info
(
"HTTP GET FROM: "
+
url
);
LogUtil
.
debug
(
"HTTP GET FROM: "
+
url
);
using
(
var
wc
=
new
WebClient
{
Encoding
=
encoding
})
using
(
var
wc
=
new
WebClient
{
Encoding
=
encoding
})
{
{
var
readStream
=
wc
.
OpenRead
(
url
);
var
readStream
=
wc
.
OpenRead
(
url
);
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
{
{
var
result
=
sr
.
ReadToEnd
();
var
result
=
sr
.
ReadToEnd
();
LogUtil
.
info
(
"receive << "
+
result
);
LogUtil
.
debug
(
"receive << "
+
result
);
return
result
;
return
result
;
}
}
}
}
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
LogUtil
.
error
(
"HTTP GET ERROR:"
+
e
.
Message
,
102
);
LogUtil
.
error
(
"HTTP GET ERROR
["
+
url
+
"]
:"
+
e
.
Message
,
102
);
}
}
return
""
;
return
""
;
}
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
5b06860
...
@@ -1176,13 +1176,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1176,13 +1176,17 @@ namespace OnlineStore.DeviceLibrary
alarmList
.
Add
(
new
AlarmMsg
(
equip
.
Name
,
"line."
+
equip
.
Name
+
"_"
+
equip
.
alarmType
,
equip
.
WarnMsg
));
alarmList
.
Add
(
new
AlarmMsg
(
equip
.
Name
,
"line."
+
equip
.
Name
+
"_"
+
equip
.
alarmType
,
equip
.
WarnMsg
));
}
}
List
<
TrayDisableInfo
>
list
=
TrayDisableManager
.
GetDisableList
();
//
List<TrayDisableInfo> list = TrayDisableManager.GetDisableList();
foreach
(
TrayDisableInfo
t
in
list
)
//
foreach (TrayDisableInfo t in list)
{
//
{
alarmList
.
Add
(
new
AlarmMsg
(
"托盘"
+
t
.
TrayCode
+
"禁用"
,
"line.tray_"
+
t
.
TrayCode
,
t
.
DDescribe
));
//
alarmList.Add(new AlarmMsg("托盘" + t.TrayCode + "禁用", "line.tray_" + t.TrayCode, t.DDescribe));
}
//
}
}
}
SServerManager
.
updateDeviceAlarmMsg
(
alarmList
);
SServerManager
.
updateDeviceAlarmMsg
(
alarmList
);
//托盘禁用信息更新
SServerManager
.
disabledTray
(
TrayDisableManager
.
GetDisableList
());
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
5b06860
...
@@ -683,21 +683,29 @@ namespace OnlineStore.DeviceLibrary
...
@@ -683,21 +683,29 @@ namespace OnlineStore.DeviceLibrary
if
(
data
!=
null
)
if
(
data
!=
null
)
{
{
bool
result
=
Convert
.
ToBoolean
(
data
.
data
);
bool
result
=
Convert
.
ToBoolean
(
data
.
data
);
if
(
data
.
code
.
Equals
(
0
)
&&
(!
result
))
if
(
data
.
code
.
Equals
(
0
))
{
if
(!
result
)
{
{
LogUtil
.
error
(
$
"{deviceName}canReelToBelt【 {barcode}】 返回失败 :【{resultStr}】{data.msg}={data.msg}"
);
}
return
result
;
return
result
;
}
}
else
if
(!
data
.
code
.
Equals
(
0
))
else
if
(!
data
.
code
.
Equals
(
0
))
{
{
LogUtil
.
error
(
$
"{deviceName}canReelToBelt【 {barcode}】 返回错误 :{data.msg}={data.msg}"
);
LogUtil
.
error
(
$
"{deviceName}canReelToBelt【 {barcode}】 返回错误 :
【{resultStr}】
{data.msg}={data.msg}"
);
}
}
}
}
else
{
LogUtil
.
error
(
$
"{deviceName}canReelToBelt 未收到服务器反馈 {FormUtil.GetSpanStr(DateTime.Now - startTime)} 【{server}】【{resultStr}】"
);
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
}
return
tru
e
;
return
fals
e
;
}
}
public
static
bool
IgnoreServerStop
=
false
;
public
static
bool
IgnoreServerStop
=
false
;
...
@@ -903,7 +911,52 @@ namespace OnlineStore.DeviceLibrary
...
@@ -903,7 +911,52 @@ namespace OnlineStore.DeviceLibrary
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
deviceName
+
" "
,
ex
);
LogUtil
.
error
(
deviceName
+
" "
,
ex
);
return
"GetReelSize 条码【 "
+
barcode
+
"】出错:"
+
ex
.
ToString
();
return
"GetReelSize 条码【 "
+
barcode
+
"】出错:"
+
ex
.
ToString
();
}
}
//http://localhost:8080/rest/api/qisda/device/updateDisabledTray?disabledTray=E23,E25
private
static
string
Addr_updateDisabledTray
=
"/rest/api/qisda/device/updateDisabledTray"
;
public
static
void
disabledTray
(
List
<
TrayDisableInfo
>
trayDisList
)
{
try
{
string
disabledTray
=
""
;
if
(
trayDisList
==
null
||
trayDisList
.
Count
<=
0
)
{
return
;
}
foreach
(
TrayDisableInfo
dis
in
trayDisList
)
{
if
(
String
.
IsNullOrEmpty
(
disabledTray
))
{
disabledTray
+=
"E"
+
dis
.
TrayCode
;
}
else
{
disabledTray
+=
",E"
+
dis
.
TrayCode
;
}
}
try
{
//code= 0 表示正常,其他为异常
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"disabledTray"
,
disabledTray
);
// disabledTray = 禁用托盘
string
server
=
GetAddr
(
Addr_updateDisabledTray
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Get
(
server
);
LogUtil
.
debug
(
"disabledTray "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"disabledTray = "
+
disabledTray
+
" 出错"
,
ex
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"disabledTray 出错"
,
ex
);
}
}
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论