Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO827-AutoScanAndLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1a7b2329
由
张东亮
编写于
2023-01-18 19:59:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
959d8cdd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
33 行增加
和
39 行删除
DeviceLibrary/AGVManager.cs
DeviceLibrary/AGVService/Controllers/taskNotificationController.cs → DeviceLibrary/AGVService/Controllers/notificationController.cs
DeviceLibrary/AGVService/Schemas/RtnData.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/AGVManager.cs
查看文件 @
1a7b232
此文件的差异被折叠,
点击展开。
DeviceLibrary/AGVService/Controllers/
taskN
otificationController.cs
→
DeviceLibrary/AGVService/Controllers/
n
otificationController.cs
查看文件 @
1a7b232
...
...
@@ -13,7 +13,7 @@ namespace DeviceLibrary.AGVService.Controllers
/// 任务执行通知
/// </summary>
[
RoutePrefix
(
"nepconSmf/notification"
)]
public
class
taskN
otificationController
:
ApiController
public
class
n
otificationController
:
ApiController
{
[
HttpPost
]
public
RtnData
taskStatus
([
FromBody
]
NotificationDto
dto
)
...
...
DeviceLibrary/AGVService/Schemas/RtnData.cs
查看文件 @
1a7b232
...
...
@@ -8,7 +8,7 @@ namespace DeviceLibrary.AGVService.Schemas
{
public
class
RtnData
{
public
int
code
{
get
;
set
;
}
=
0
;
public
int
code
{
get
;
set
;
}
=
20
0
;
public
object
data
{
get
;
set
;
}
public
string
msg
{
get
;
set
;
}
=
"ok"
;
}
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
1a7b232
...
...
@@ -87,7 +87,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AGVService\Controllers\deviceOperateController.cs" />
<Compile Include="AGVService\Controllers\
taskN
otificationController.cs" />
<Compile Include="AGVService\Controllers\
n
otificationController.cs" />
<Compile Include="AGVService\HttpService.cs" />
<Compile Include="AGVService\Schemas\DeviceCheckDto.cs" />
<Compile Include="AGVService\Schemas\NotificationDto.cs" />
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
1a7b232
...
...
@@ -46,23 +46,10 @@ namespace DeviceLibrary
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Monitor
.
TryEnter
(
serverConnectTimer
))
{
try
{
if
(!
server
.
StartsWith
(
"http"
))
return
;
SendLineStatus
();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"ServerConnectTimer_Elapsed:{ex}"
);
}
finally
{
Monitor
.
Exit
(
serverConnectTimer
);
}
}
if
(!
server
.
StartsWith
(
"http"
))
return
;
SendLineStatus
();
}
public
void
StartConnectServer
()
{
...
...
@@ -164,29 +151,36 @@ namespace DeviceLibrary
{
if
(
RobotManage
.
IsDebug
)
return
;
lock
(
serverclock
)
try
{
bool
printlog
=
false
;
DateTime
time
=
DateTime
.
Now
;
//构建发送给服务器的对象
Operation
lineOperation
=
getLineBoxStatus
();
if
(
lineOperation
.
status
!=
laststatus
)
lock
(
serverclock
)
{
laststatus
=
lineOperation
.
status
;
printlog
=
true
;
}
bool
printlog
=
false
;
DateTime
time
=
DateTime
.
Now
;
//构建发送给服务器的对象
Operation
lineOperation
=
getLineBoxStatus
();
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
lineOperation
,
700
,
printlog
);
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
ResultProcess
(
resultOperation
);
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
700
)
{
LogUtil
.
info
(
StoreName
+
"TimerProcess["
+
span
.
TotalMilliseconds
+
"]"
);
if
(
lineOperation
.
status
!=
laststatus
)
{
laststatus
=
lineOperation
.
status
;
printlog
=
true
;
}
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
lineOperation
,
700
,
printlog
);
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
ResultProcess
(
resultOperation
);
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
700
)
{
LogUtil
.
info
(
StoreName
+
"TimerProcess["
+
span
.
TotalMilliseconds
+
"]"
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"SendLineStatus"
,
ex
);
}
}
public
bool
SendAgvLog
(
string
msg
)
{
...
...
@@ -198,7 +192,7 @@ namespace DeviceLibrary
{
new
AgvLogInfo
(
msg
)
};
LogUtil
.
info
(
JsonHelper
.
SerializeObject
(
operation
));
//
LogUtil.info(JsonHelper.SerializeObject(operation));
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
operation
,
5000
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论