Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmartShelf
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3618c65e
由
LN
编写于
2020-04-30 09:19:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改:多个灯一起亮。
1 个父辈
2bfce709
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
63 行增加
和
13 行删除
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
DeviceLibrary/manager/BOXManager.cs
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
查看文件 @
3618c65
...
...
@@ -47,14 +47,14 @@ namespace SmartShelf.DeviceLibrary
{
List
<
Light
>
sLed
=
new
List
<
Light
>();
for
(
int
index
=
0
;
index
<
=
module
.
Max_Light
;
index
++)
for
(
int
index
=
0
;
index
<
module
.
Max_Light
;
index
++)
{
if
(
"green"
==
color
)
if
(
"green"
.
Equals
(
color
)
)
{
CurrLedStatus
=
1
;
sLed
.
Add
(
Light
.
GreenLight
(
StatusLedDmx
,
index
));
}
else
if
(
"yellow"
==
color
)
else
if
(
"yellow"
.
Equals
(
color
)
)
{
CurrLedStatus
=
2
;
sLed
.
Add
(
Light
.
YellowLight
(
StatusLedDmx
,
index
));
...
...
@@ -62,7 +62,6 @@ namespace SmartShelf.DeviceLibrary
}
module
.
LightOn
(
sLed
.
ToArray
());
}
}
...
...
DeviceLibrary/manager/BOXManager.cs
查看文件 @
3618c65
...
...
@@ -34,7 +34,7 @@ namespace SmartShelf.DeviceLibrary
}
return
""
;
}
public
static
void
UpdatePosIdColor
(
string
posId
,
string
color
=
""
)
public
static
void
UpdatePosIdColor
(
string
posId
,
string
color
=
""
)
{
if
(
StatusColorMap
.
ContainsKey
(
posId
))
{
...
...
@@ -157,14 +157,14 @@ namespace SmartShelf.DeviceLibrary
{
if
(!
LEDManager
.
CurrLedStatus
.
Equals
(
2
))
{
// LEDManager.OpenStatusLights("green");
// LEDManager.OpenStatusLights("green");
}
}
else
{
if
(!
LEDManager
.
CurrLedStatus
.
Equals
(
1
))
{
// LEDManager.OpenStatusLights("yellow");
// LEDManager.OpenStatusLights("yellow");
}
}
...
...
@@ -360,16 +360,27 @@ namespace SmartShelf.DeviceLibrary
led
.
AllLightOff
();
}
}
Dictionary
<
string
,
List
<
Light
>>
lightsMap
=
new
Dictionary
<
string
,
List
<
Light
>>();
foreach
(
string
key
in
posIdList
)
{
string
status
=
GetPosIdColor
(
key
);
if
(
status
.
ToLower
().
Equals
(
color
.
ToLower
()))
{
BoxPosition
position
=
PositionMap
[
key
];
LEDManager
.
GetLedModule
(
position
.
DeviceIp
).
LightOff
(
Light
.
GetLights
(
position
.
DmxId
,
position
.
GetLedList
(),
0
));
Light
[]
lightArray
=
Light
.
GetLights
(
position
.
DmxId
,
position
.
GetLedList
(),
0
);
SaveLightToMap
(
lightsMap
,
position
.
DeviceIp
,
lightArray
);
// LEDManager.GetLedModule(position.DeviceIp).LightOff(Light.GetLights(position.DmxId, position.GetLedList(), 0));
UpdatePosIdColor
(
key
);
}
}
foreach
(
string
dip
in
lightsMap
.
Keys
)
{
List
<
Light
>
lights
=
lightsMap
[
dip
];
if
(
lights
.
Count
>
0
)
{
LEDManager
.
GetLedModule
(
dip
).
LightOff
(
lights
.
ToArray
());
}
}
return
true
;
}
...
...
@@ -378,6 +389,7 @@ namespace SmartShelf.DeviceLibrary
LogUtil
.
info
(
BoxName
+
proMsg
+
" open命令:"
+
posids
);
string
[]
posArray
=
posids
.
Split
(
PosId_SpiltChar
);
Dictionary
<
string
,
List
<
Light
>>
lightsMap
=
new
Dictionary
<
string
,
List
<
Light
>>();
foreach
(
string
posStr
in
posArray
)
{
string
posid
=
posStr
;
...
...
@@ -392,8 +404,10 @@ namespace SmartShelf.DeviceLibrary
if
(
PositionMap
.
ContainsKey
(
posid
))
{
BoxPosition
position
=
PositionMap
[
posid
];
Light
[]
lights
=
Light
.
GetLights
(
position
.
DmxId
,
color
,
position
.
GetLedList
().
ToArray
());
LEDManager
.
GetLedModule
(
position
.
DeviceIp
).
LightOn
(
lights
);
Light
[]
lightArray
=
Light
.
GetLights
(
position
.
DmxId
,
color
,
position
.
GetLedList
().
ToArray
());
SaveLightToMap
(
lightsMap
,
position
.
DeviceIp
,
lightArray
);
// LEDManager.GetLedModule(position.DeviceIp).LightOn(lights);
UpdatePosIdColor
(
posid
,
color
);
}
...
...
@@ -409,14 +423,42 @@ namespace SmartShelf.DeviceLibrary
}
}
}
foreach
(
string
dip
in
lightsMap
.
Keys
)
{
List
<
Light
>
lights
=
lightsMap
[
dip
];
if
(
lights
.
Count
>
0
)
{
LEDManager
.
GetLedModule
(
dip
).
LightOn
(
lights
.
ToArray
());
}
}
return
true
;
}
private
static
void
SaveLightToMap
(
Dictionary
<
string
,
List
<
Light
>>
lightsMap
,
string
ip
,
Light
[]
lightArray
)
{
if
(
lightArray
!=
null
&&
lightArray
.
Length
>
0
)
{
List
<
Light
>
lights
=
new
List
<
Light
>();
if
(
lightsMap
.
ContainsKey
(
ip
))
{
lights
=
lightsMap
[
ip
];
}
lights
.
AddRange
(
lightArray
);
if
(
lightsMap
.
ContainsKey
(
ip
))
{
lightsMap
[
ip
]
=
lights
;
}
else
{
lightsMap
.
Add
(
ip
,
lights
);
}
}
}
public
static
bool
ProcessCloseLed
(
string
posids
,
string
proMsg
=
"Revice "
)
{
LogUtil
.
info
(
BoxName
+
proMsg
+
" close命令:"
+
posids
);
string
[]
posArray
=
posids
.
Split
(
PosId_SpiltChar
);
Dictionary
<
string
,
List
<
Light
>>
lightsMap
=
new
Dictionary
<
string
,
List
<
Light
>>();
foreach
(
string
posid
in
posArray
)
{
...
...
@@ -429,8 +471,9 @@ namespace SmartShelf.DeviceLibrary
if
(
PositionMap
.
ContainsKey
(
posName
))
{
BoxPosition
position
=
PositionMap
[
posName
];
LEDManager
.
GetLedModule
(
position
.
DeviceIp
).
LightOff
(
Light
.
GetLights
(
position
.
DmxId
,
position
.
GetLedList
(),
0
));
// StatusColorMap[posName] = "";
Light
[]
lightArray
=
Light
.
GetLights
(
position
.
DmxId
,
position
.
GetLedList
());
SaveLightToMap
(
lightsMap
,
position
.
DeviceIp
,
lightArray
);
// LEDManager.GetLedModule(position.DeviceIp).LightOff(Light.GetLights(position.DmxId, position.GetLedList(), 0));
UpdatePosIdColor
(
posName
);
}
else
...
...
@@ -438,6 +481,14 @@ namespace SmartShelf.DeviceLibrary
LogUtil
.
error
(
BoxName
+
"关闭灯败,未找到库位号:"
+
posName
);
}
}
foreach
(
string
dip
in
lightsMap
.
Keys
)
{
List
<
Light
>
lights
=
lightsMap
[
dip
];
if
(
lights
.
Count
>
0
)
{
LEDManager
.
GetLedModule
(
dip
).
LightOff
(
lights
.
ToArray
());
}
}
return
true
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论