Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d0f3a0b1
由
刘韬
编写于
2022-06-16 09:03:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化气缸暂停
1 个父辈
990fc02d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
48 行增加
和
13 行删除
Common/bean/Bean.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/CylinderManger.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/MainMachine _Common.cs
DeviceLibrary/theMachine/MainMachine_String.cs
Common/bean/Bean.cs
查看文件 @
d0f3a0b
...
@@ -290,5 +290,6 @@ namespace OnlineStore.Common
...
@@ -290,5 +290,6 @@ namespace OnlineStore.Common
public
static
string
enable
=
"enable"
;
public
static
string
enable
=
"enable"
;
public
static
string
disable
=
"disable"
;
public
static
string
disable
=
"disable"
;
public
static
string
queueTaskCount
=
"queueTaskCount"
;
}
}
}
}
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
d0f3a0b
...
@@ -290,7 +290,7 @@ namespace DeviceLibrary
...
@@ -290,7 +290,7 @@ namespace DeviceLibrary
}
}
}));
}));
Task
.
Delay
(
ii
*
5
00
).
Wait
();
Task
.
Delay
(
ii
*
7
00
).
Wait
();
}
}
while
(!
cameraTask
[
0
].
IsCompleted
||
!
cameraTask
[
1
].
IsCompleted
)
while
(!
cameraTask
[
0
].
IsCompleted
||
!
cameraTask
[
1
].
IsCompleted
)
...
...
DeviceLibrary/DeviceLibrary/CylinderManger.cs
查看文件 @
d0f3a0b
...
@@ -46,6 +46,20 @@ namespace DeviceLibrary
...
@@ -46,6 +46,20 @@ namespace DeviceLibrary
public
void
Pause
()
public
void
Pause
()
{
{
LogUtil
.
info
(
$
"{Name},停止运行"
);
LogUtil
.
info
(
$
"{Name},停止运行"
);
if
(
currentIOvalue
==
IO_VALUE
.
None
)
{
LogUtil
.
info
(
$
"{Name},没有在运行"
);
return
;
}
else
if
(
currentIOvalue
==
IO_VALUE
.
HIGH
&&
IOManager
.
IOValue
(
High
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
info
(
$
"{Name},currentIOvalue:{currentIOvalue},暂停是IO已到位"
);
return
;
}
else
if
(
currentIOvalue
==
IO_VALUE
.
LOW
&&
IOManager
.
IOValue
(
Low
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
info
(
$
"{Name},currentIOvalue:{currentIOvalue},暂停是IO已到位"
);
return
;
}
IOManager
.
IOMove
(
Low
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
Low
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
High
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
High
,
IO_VALUE
.
LOW
);
}
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
d0f3a0b
...
@@ -37,6 +37,7 @@ namespace DeviceLibrary
...
@@ -37,6 +37,7 @@ namespace DeviceLibrary
serverConnectTimer
.
Enabled
=
true
;
serverConnectTimer
.
Enabled
=
true
;
serverConnectTimer
.
Elapsed
+=
ServerConnectTimer_Elapsed
;
serverConnectTimer
.
Elapsed
+=
ServerConnectTimer_Elapsed
;
GC
.
KeepAlive
(
serverConnectTimer
);
GC
.
KeepAlive
(
serverConnectTimer
);
LogUtil
.
info
(
$
"server:{server},cid:{CID}"
);
}
}
int
lockerrtime
=
0
;
int
lockerrtime
=
0
;
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
@@ -58,9 +59,9 @@ namespace DeviceLibrary
...
@@ -58,9 +59,9 @@ namespace DeviceLibrary
ProcessMsg
(
Msg
.
msg
);
ProcessMsg
(
Msg
.
msg
);
SendLineStatus
();
SendLineStatus
();
}
}
catch
catch
(
Exception
ex
)
{
{
LogUtil
.
info
(
$
"ServerConnectTimer_Elapsed:{ex}"
);
}
}
finally
{
finally
{
//Monitor.Exit(serverConnectTimer);
//Monitor.Exit(serverConnectTimer);
...
@@ -292,8 +293,10 @@ namespace DeviceLibrary
...
@@ -292,8 +293,10 @@ namespace DeviceLibrary
}
}
}
}
}
}
public
int
queueTaskCount
=-
1
;
ConcurrentQueue
<
string
>
commandResultMsg
=
new
ConcurrentQueue
<
string
>();
ConcurrentQueue
<
string
>
commandResultMsg
=
new
ConcurrentQueue
<
string
>();
void
ResultProcess
(
Operation
resultOperation
)
{
void
ResultProcess
(
Operation
resultOperation
)
{
//发送状态信息到服务器
//发送状态信息到服务器
if
(
resultOperation
==
null
)
if
(
resultOperation
==
null
)
{
{
...
@@ -301,9 +304,6 @@ namespace DeviceLibrary
...
@@ -301,9 +304,6 @@ namespace DeviceLibrary
return
;
return
;
}
}
if
(
resultOperation
.
op
.
Equals
(
1
))
if
(
resultOperation
.
op
.
Equals
(
1
))
{
{
var
barcode
=
""
;
var
barcode
=
""
;
...
@@ -317,14 +317,28 @@ namespace DeviceLibrary
...
@@ -317,14 +317,28 @@ namespace DeviceLibrary
}
}
else
if
(
resultOperation
.
op
.
Equals
(
5
))
else
if
(
resultOperation
.
op
.
Equals
(
5
))
{
{
ProcessHumidityCMD
(
resultOperation
);
//
ProcessHumidityCMD(resultOperation);
}
}
ProcessHumidityCMD
(
resultOperation
);
if
(
resultOperation
.
data
!=
null
)
if
(
resultOperation
.
data
!=
null
)
{
{
string
result
=
""
;
string
result
=
""
;
Dictionary
<
string
,
string
>
dataMap
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
dataMap
=
resultOperation
.
data
;
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
queueTaskCount
))
{
var
s
=
dataMap
[
ParamDefine
.
queueTaskCount
];
if
(
int
.
TryParse
(
s
,
out
int
c
))
{
queueTaskCount
=
c
;
}
else
{
queueTaskCount
=
-
1
;
}
}
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
openLock
)
&&
dataMap
[
ParamDefine
.
openLock
].
Equals
(
ParamDefine
.
doit
))
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
openLock
)
&&
dataMap
[
ParamDefine
.
openLock
].
Equals
(
ParamDefine
.
doit
))
{
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:openLock=doit"
);
LogUtil
.
info
(
StoreName
+
"收到服务器命令:openLock=doit"
);
...
@@ -364,7 +378,6 @@ namespace DeviceLibrary
...
@@ -364,7 +378,6 @@ namespace DeviceLibrary
for
(
int
i
=
0
;
i
<
10
;
i
++)
for
(
int
i
=
0
;
i
<
10
;
i
++)
commandResultMsg
.
Enqueue
(
result
);
commandResultMsg
.
Enqueue
(
result
);
}
}
//SendLineStatus(result);
//SendLineStatus(result);
}
}
...
@@ -489,8 +502,10 @@ namespace DeviceLibrary
...
@@ -489,8 +502,10 @@ namespace DeviceLibrary
/// <param name="resultOperation"></param>
/// <param name="resultOperation"></param>
private
void
ProcessHumidityCMD
(
Operation
resultOperation
)
private
void
ProcessHumidityCMD
(
Operation
resultOperation
)
{
{
if
(
resultOperation
.
data
==
null
)
return
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
maxHumidity
)
&&
data
.
ContainsKey
(
ParamDefine
.
maxTemperature
))
if
(
data
.
ContainsKey
(
ParamDefine
.
maxHumidity
)
&&
data
.
ContainsKey
(
ParamDefine
.
maxTemperature
))
{
{
string
maxHumidity
=
data
[
ParamDefine
.
maxHumidity
];
string
maxHumidity
=
data
[
ParamDefine
.
maxHumidity
];
string
maxTemp
=
data
[
ParamDefine
.
maxTemperature
];
string
maxTemp
=
data
[
ParamDefine
.
maxTemperature
];
...
...
DeviceLibrary/theMachine/MainMachine _Common.cs
查看文件 @
d0f3a0b
...
@@ -140,11 +140,11 @@ namespace DeviceLibrary
...
@@ -140,11 +140,11 @@ namespace DeviceLibrary
if
(!
isbusy
)
if
(!
isbusy
)
{
{
int
outCount
=
AxisManager
.
GetActualtPosition
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
int
outCount
=
AxisManager
.
GetActualtPosition
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
LogUtil
.
info
(
$
"{wait.AxisInfo.
DeviceName
},当前位置:{outCount}"
);
LogUtil
.
info
(
$
"{wait.AxisInfo.
Explain
},当前位置:{outCount}"
);
int
errorCount
=
Math
.
Abs
(
outCount
-
wait
.
TargetPosition
);
int
errorCount
=
Math
.
Abs
(
outCount
-
wait
.
TargetPosition
);
if
(
errorCount
<=
wait
.
AxisInfo
.
CanErrorCountMax
)
if
(
errorCount
<=
wait
.
AxisInfo
.
CanErrorCountMax
)
{
{
LogUtil
.
info
(
$
"{wait.AxisInfo.
DeviceName
},到达目标:errorCount:{errorCount},停止上升"
);
LogUtil
.
info
(
$
"{wait.AxisInfo.
Explain
},到达目标:errorCount:{errorCount},停止上升"
);
axisBean
.
StopAxisCheckMove
();
axisBean
.
StopAxisCheckMove
();
wait
.
IsEnd
=
true
;
wait
.
IsEnd
=
true
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
d0f3a0b
...
@@ -248,6 +248,11 @@ namespace DeviceLibrary
...
@@ -248,6 +248,11 @@ namespace DeviceLibrary
case
MoveStep
.
StringReadyPut
:
case
MoveStep
.
StringReadyPut
:
Msg
.
add
(
crc
.
GetString
(
L
.
string_ready_for_put
,
"料串放料准备就绪"
),
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
L
.
string_ready_for_put
,
"料串放料准备就绪"
),
MsgLevel
.
info
);
StringMoveInfo
.
log
(
$
"料串放料准备就绪"
);
StringMoveInfo
.
log
(
$
"料串放料准备就绪"
);
if
(
ConfigHelper
.
Config
.
Get
(
"Device_String_StandbyAtBottom"
,
true
)
&&
ServerCM
.
queueTaskCount
==
0
&&
boxTransport
.
IsComplateOrFree
)
{
StringMoveInfo
.
log
(
$
"当前服务器反馈没有出库任务, 料串下降待机"
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
}
break
;
break
;
case
MoveStep
.
StringReelPut
:
case
MoveStep
.
StringReelPut
:
LastStringState
=
StringStateE
.
OutStore
;
LastStringState
=
StringStateE
.
OutStore
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论