Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
AGV_3D_SMD
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4b7b6377
由
张东亮
编写于
2020-12-22 16:27:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1222
1 个父辈
e98428f4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
32 行增加
和
23 行删除
AGV_3D_SMD/App.config
AGV_3D_SMD/FrmMain.Designer.cs
AGV_3D_SMD/FrmMain.cs
AGV_UI/Status.cs
DeviceLibrary/AgvServer.cs
DeviceLibrary/Control.cs
DeviceLibrary/bean/Agv_Info.cs
AGV_3D_SMD/App.config
查看文件 @
4b7b637
...
...
@@ -21,6 +21,7 @@
<
file
value
=
"logs/AgvServer.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"60"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
...
...
@@ -31,6 +32,7 @@
<
file
value
=
"logs/MiR_API.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"30"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
...
...
@@ -42,12 +44,12 @@
<
appender
-
ref
ref
=
"MiR_API"
/>
</
logger
>
<
logger
name
=
"AgvServer"
>
<
level
value
=
"
Debug
"
/>
<
level
value
=
"
Info
"
/>
<
appender
-
ref
ref
=
"AgvServer"
/>
</
logger
>
<
root
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"AGV
Control_SMD_BOX
"
/>
<
appender
-
ref
ref
=
"AGV
_3D_SMD
"
/>
</
root
>
</
log4net
>
<
appSettings
>
...
...
AGV_3D_SMD/FrmMain.Designer.cs
查看文件 @
4b7b637
此文件的差异被折叠,
点击展开。
AGV_3D_SMD/FrmMain.cs
查看文件 @
4b7b637
...
...
@@ -72,7 +72,6 @@ namespace AGVControl
{
Invoke
(
new
Action
(()
=>
{
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
CommonVar
.
nodeInfo
[
nodeIndex
].
Online
&&
CommonVar
.
nodeInfo
[
nodeIndex
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
CommonVar
.
nodeInfo
[
nodeIndex
].
ToRow
());
}));
System
.
GC
.
Collect
();
...
...
@@ -83,7 +82,6 @@ namespace AGVControl
Invoke
(
new
Action
(()
=>
{
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
CommonVar
.
nodeInfo
[
nodeIndex
].
Online
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
CommonVar
.
nodeInfo
[
nodeIndex
].
ToRow
());
}));
System
.
GC
.
Collect
();
}
...
...
@@ -129,12 +127,10 @@ namespace AGVControl
ShowConfig
();
change
=
true
;
//ChkAutoCharge.Checked = CommonVar.chargeStatus.AutoCharge;
change
=
false
;
// CommonVar.control.AgvChanged += Control_AgvChanged;
CommonVar
.
server
.
NodeChanged
+=
Server_NodeChanged
;
CommonVar
.
server
.
NodeOnline
+=
Server_NodeOnline
;
richTextBox1
=
LogUtil
.
logBox
;
LogUtil
.
logBox
=
richTextBox1
;
}
private
void
FrmMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
...
...
AGV_UI/Status.cs
查看文件 @
4b7b637
...
...
@@ -69,6 +69,10 @@ namespace AGV_UI
{
this
.
Invoke
(
new
Action
(()
=>
{
if
(
curBattery
<
MinBattery
)
lblBattery
.
ForeColor
=
Color
.
White
;
else
lblBattery
.
ForeColor
=
Color
.
Black
;
lblBattery
.
Text
=
objs
[
0
]
as
string
;
lblBattery
.
Image
=
objs
[
1
]
as
Image
;
}
...
...
DeviceLibrary/AgvServer.cs
查看文件 @
4b7b637
...
...
@@ -298,10 +298,10 @@ namespace DeviceLibrary
else
{
time
+=
sleep
;
if
(
time
>
1
0000
)
if
(
time
>
6
0000
)
{
Offline
(
client
);
log
.
Info
(
"["
+
client
.
IP
+
"] 超过1
0s没有收到数据,关闭连接"
);
log
.
Debug
(
"["
+
client
.
IP
+
"] 超过6
0s没有收到数据,关闭连接"
);
}
}
}
...
...
@@ -396,9 +396,8 @@ namespace DeviceLibrary
{
CommonVar
.
nodeInfo
[
idx
].
Online
=
true
;
NodeOnline
?.
Invoke
(
idx
);
NodeChanged
?.
Invoke
(
idx
);
}
NodeChanged
?.
Invoke
(
idx
);
if
(
CommonVar
.
nodeInfo
[
idx
].
CheckNodeStateChanged
(
node
))
{
log
.
Info
(
"节点状态更新 "
+
node
.
StatetText
());
...
...
@@ -417,8 +416,7 @@ namespace DeviceLibrary
int
idx
=
CommonVar
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
client
.
nodeName
[
i
]);
if
(
idx
==
-
1
)
continue
;
CommonVar
.
nodeInfo
[
idx
].
Offline
();
NodeChanged
(
idx
);
NodeOnline
(
idx
);
NodeOnline
?.
Invoke
(
idx
);
}
client
.
nodeName
.
Clear
();
}
...
...
DeviceLibrary/Control.cs
查看文件 @
4b7b637
...
...
@@ -25,10 +25,6 @@ namespace DeviceLibrary
/// </summary>
public
ScopeLimit
limitArea
;
/// <summary>
/// 获取任务打开
/// </summary>
public
static
bool
OpenGetJob
=
true
;
public
Control
()
{
AgvCallTimer
=
new
System
.
Timers
.
Timer
...
...
@@ -87,7 +83,6 @@ namespace DeviceLibrary
{
try
{
// if (!CheckOnline(i)) continue;
CheckOnline
(
i
);
bool
change
=
false
;
MiR_API
.
Get_Task_State
(
CommonVar
.
agvInfo
[
i
].
CurTaskID
,
out
string
stateStr
);
...
...
@@ -131,7 +126,7 @@ namespace DeviceLibrary
{
Job
job
=
null
;
if
(
OpenGetJob
)
if
(
agv_Info
.
IsUse
)
{
job
=
find
.
GetNewJob
(
agv_Info
);
...
...
@@ -141,6 +136,10 @@ namespace DeviceLibrary
return
job
;
}
}
else
{
return
null
;
}
}
}
...
...
@@ -207,7 +206,6 @@ namespace DeviceLibrary
CommonVar
.
agvInfo
[
idx
].
IsCon
=
true
;
LogUtil
.
info
(
CommonVar
.
agvInfo
[
idx
].
Name
+
" Online"
);
AgvOnline
?.
Invoke
(
idx
);
AgvChanged
?.
Invoke
(
idx
);
}
}
else
...
...
@@ -217,11 +215,10 @@ namespace DeviceLibrary
CommonVar
.
agvInfo
[
idx
].
IsCon
=
false
;
LogUtil
.
info
(
CommonVar
.
agvInfo
[
idx
].
Name
+
" Offline"
);
AgvOnline
?.
Invoke
(
idx
);
AgvChanged
?.
Invoke
(
idx
);
}
else
{
LogUtil
.
info
(
CommonVar
.
agvInfo
[
idx
].
Name
+
" Offline"
);
LogUtil
.
debug
(
CommonVar
.
agvInfo
[
idx
].
Name
+
" Offline"
);
}
}
return
rtn
;
...
...
DeviceLibrary/bean/Agv_Info.cs
查看文件 @
4b7b637
...
...
@@ -36,7 +36,19 @@ namespace DeviceLibrary
/// <summary>
/// 是否在线
/// </summary>
public
bool
IsCon
{
set
;
get
;
}
public
bool
IsCon
{
set
{
if
(!
value
.
Equals
(
isCon
))
{
isCon
=
value
;
StateKanban
.
SetConnectState
(
isCon
);
}
}
get
{
return
isCon
;
}
}
private
bool
isCon
=
false
;
/// <summary>
/// 是否可用
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论