Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmartShelf
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e618cd30
由
LN
编写于
2020-06-03 16:18:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加配置,表示状态灯区域地址。
1 个父辈
01df7a66
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
92 行增加
和
18 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
DeviceLibrary/manager/BOXManager.cs
SmartShelf/App.config
SmartShelf/FrmConfig.Designer.cs
SmartShelf/FrmConfig.cs
SmartShelf/记录.txt
Common/Setting_Init.cs
查看文件 @
e618cd3
...
@@ -30,5 +30,10 @@ namespace SmartShelf.Common
...
@@ -30,5 +30,10 @@ namespace SmartShelf.Common
public
static
string
DeviceLedType
=
"DeviceLedType"
;
public
static
string
DeviceLedType
=
"DeviceLedType"
;
public
static
string
DefaultDeviceIP
=
"DefaultDeviceIP"
;
public
static
string
DefaultDeviceIP
=
"DefaultDeviceIP"
;
/// <summary>
/// 状态灯区域ID
/// </summary>
public
static
string
StatusLedDmx
=
"StatusLedDmx"
;
}
}
}
}
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
查看文件 @
e618cd3
...
@@ -15,9 +15,7 @@ namespace SmartShelf.DeviceLibrary
...
@@ -15,9 +15,7 @@ namespace SmartShelf.DeviceLibrary
public
static
int
DeviceLedType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DeviceLedType
);
public
static
int
DeviceLedType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DeviceLedType
);
public
static
string
DefaultIP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DefaultDeviceIP
);
public
static
string
DefaultIP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DefaultDeviceIP
);
public
void
Init
()
{
}
public
static
LEDBaseModule
GetLedModule
(
string
ip
)
public
static
LEDBaseModule
GetLedModule
(
string
ip
)
{
{
LEDBaseModule
led
=
null
;
LEDBaseModule
led
=
null
;
...
@@ -32,12 +30,36 @@ namespace SmartShelf.DeviceLibrary
...
@@ -32,12 +30,36 @@ namespace SmartShelf.DeviceLibrary
}
}
return
led
;
return
led
;
}
}
public
static
void
LoadStatusDMX
()
{
StatusLedDmx
=
new
List
<
int
>();
string
str
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
StatusLedDmx
);
if
(
String
.
IsNullOrEmpty
(
str
))
{
str
=
"0"
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
StatusLedDmx
,
str
);
}
string
[]
array
=
str
.
Split
(
';'
);
foreach
(
string
s
in
array
)
{
try
{
int
a
=
Convert
.
ToInt32
(
s
);
StatusLedDmx
.
Add
(
a
);
}
catch
(
Exception
ex
)
{
}
}
}
/// <summary>
/// <summary>
/// 1=绿灯,2=黄灯
/// 1=绿灯,2=黄灯
/// </summary>
/// </summary>
public
static
int
CurrLedStatus
=
-
1
;
public
static
int
CurrLedStatus
=
-
1
;
private
static
int
StatusLedDmx
=
0
;
private
static
List
<
int
>
StatusLedDmx
=
new
List
<
int
>();
/// <summary>
/// <summary>
/// 打开状态灯
/// 打开状态灯
...
@@ -49,17 +71,20 @@ namespace SmartShelf.DeviceLibrary
...
@@ -49,17 +71,20 @@ namespace SmartShelf.DeviceLibrary
{
{
List
<
Light
>
sLed
=
new
List
<
Light
>();
List
<
Light
>
sLed
=
new
List
<
Light
>();
for
(
int
index
=
0
;
index
<
module
.
Max_Light
;
index
++
)
for
each
(
int
dmx
in
StatusLedDmx
)
{
{
if
(
"green"
.
Equals
(
color
)
)
for
(
int
index
=
0
;
index
<
module
.
Max_Light
;
index
++
)
{
{
CurrLedStatus
=
1
;
if
(
"green"
.
Equals
(
color
))
sLed
.
Add
(
Light
.
GreenLight
(
StatusLedDmx
,
index
));
{
}
CurrLedStatus
=
1
;
else
if
(
"yellow"
.
Equals
(
color
))
sLed
.
Add
(
Light
.
GreenLight
(
dmx
,
index
));
{
}
CurrLedStatus
=
2
;
else
if
(
"yellow"
.
Equals
(
color
))
sLed
.
Add
(
Light
.
YellowLight
(
StatusLedDmx
,
index
));
{
CurrLedStatus
=
2
;
sLed
.
Add
(
Light
.
YellowLight
(
dmx
,
index
));
}
}
}
}
}
module
.
LightOn
(
sLed
.
ToArray
());
module
.
LightOn
(
sLed
.
ToArray
());
...
@@ -76,7 +101,10 @@ namespace SmartShelf.DeviceLibrary
...
@@ -76,7 +101,10 @@ namespace SmartShelf.DeviceLibrary
CurrLedStatus
=
0
;
CurrLedStatus
=
0
;
foreach
(
LEDBaseModule
module
in
deviceMap
.
Values
)
foreach
(
LEDBaseModule
module
in
deviceMap
.
Values
)
{
{
module
.
AllLightOff
(
StatusLedDmx
);
foreach
(
int
dmx
in
StatusLedDmx
)
{
module
.
AllLightOff
(
dmx
);
}
}
}
}
}
}
}
...
...
DeviceLibrary/manager/BOXManager.cs
查看文件 @
e618cd3
...
@@ -71,6 +71,7 @@ namespace SmartShelf.DeviceLibrary
...
@@ -71,6 +71,7 @@ namespace SmartShelf.DeviceLibrary
{
{
return
false
;
return
false
;
}
}
LEDManager
.
LoadStatusDMX
();
LEDManager
.
deviceMap
=
new
Dictionary
<
string
,
LEDBaseModule
>();
LEDManager
.
deviceMap
=
new
Dictionary
<
string
,
LEDBaseModule
>();
StatusColorMap
=
new
Dictionary
<
string
,
string
>();
StatusColorMap
=
new
Dictionary
<
string
,
string
>();
foreach
(
BoxPosition
box
in
PositionMap
.
Values
)
foreach
(
BoxPosition
box
in
PositionMap
.
Values
)
...
...
SmartShelf/App.config
查看文件 @
e618cd3
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
<
add
key
=
"Store_CID"
value
=
"rc1272_1"
/>
<
add
key
=
"Store_CID"
value
=
"rc1272_1"
/>
<
add
key
=
"BoxCount"
value
=
"1"
/>
<
add
key
=
"BoxCount"
value
=
"1"
/>
<
add
key
=
"DefaultDeviceIP"
value
=
"192.168.201.191"
/>
<
add
key
=
"DefaultDeviceIP"
value
=
"192.168.201.191"
/>
<!--状态灯地址,;分割-->
<
add
key
=
"StatusLedDmx"
value
=
"0"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
SmartShelf/FrmConfig.Designer.cs
查看文件 @
e618cd3
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
this
.
btnSave
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSave
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnBack
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnBack
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
txtIP
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtIP
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtStaDmxId
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// label1
// label1
...
@@ -50,7 +52,7 @@
...
@@ -50,7 +52,7 @@
this
.
btnSave
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
;
this
.
btnSave
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
;
this
.
btnSave
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnSave
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnSave
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSave
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
192
,
115
);
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
192
,
231
);
this
.
btnSave
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
2
,
3
,
2
);
this
.
btnSave
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
2
,
3
,
2
);
this
.
btnSave
.
Name
=
"btnSave"
;
this
.
btnSave
.
Name
=
"btnSave"
;
this
.
btnSave
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
36
);
this
.
btnSave
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
36
);
...
@@ -64,7 +66,7 @@
...
@@ -64,7 +66,7 @@
this
.
btnBack
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
;
this
.
btnBack
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
;
this
.
btnBack
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnBack
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnBack
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnBack
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnBack
.
Location
=
new
System
.
Drawing
.
Point
(
84
,
115
);
this
.
btnBack
.
Location
=
new
System
.
Drawing
.
Point
(
84
,
231
);
this
.
btnBack
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
2
,
3
,
2
);
this
.
btnBack
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
2
,
3
,
2
);
this
.
btnBack
.
Name
=
"btnBack"
;
this
.
btnBack
.
Name
=
"btnBack"
;
this
.
btnBack
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
36
);
this
.
btnBack
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
36
);
...
@@ -83,11 +85,32 @@
...
@@ -83,11 +85,32 @@
this
.
txtIP
.
TabIndex
=
276
;
this
.
txtIP
.
TabIndex
=
276
;
this
.
txtIP
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
txtPwd_KeyDown
);
this
.
txtIP
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
txtPwd_KeyDown
);
//
//
// txtStaDmxId
//
this
.
txtStaDmxId
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtStaDmxId
.
Location
=
new
System
.
Drawing
.
Point
(
84
,
157
);
this
.
txtStaDmxId
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
2
,
3
,
2
);
this
.
txtStaDmxId
.
Name
=
"txtStaDmxId"
;
this
.
txtStaDmxId
.
Size
=
new
System
.
Drawing
.
Size
(
211
,
29
);
this
.
txtStaDmxId
.
TabIndex
=
278
;
//
// label2
//
this
.
label2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
123
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
356
,
20
);
this
.
label2
.
TabIndex
=
277
;
this
.
label2
.
Text
=
"状态灯区域地址(用;分隔):"
;
this
.
label2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// FrmConfig
// FrmConfig
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
380
,
205
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
380
,
308
);
this
.
Controls
.
Add
(
this
.
txtStaDmxId
);
this
.
Controls
.
Add
(
this
.
label2
);
this
.
Controls
.
Add
(
this
.
txtIP
);
this
.
Controls
.
Add
(
this
.
txtIP
);
this
.
Controls
.
Add
(
this
.
btnSave
);
this
.
Controls
.
Add
(
this
.
btnSave
);
this
.
Controls
.
Add
(
this
.
btnBack
);
this
.
Controls
.
Add
(
this
.
btnBack
);
...
@@ -111,5 +134,7 @@
...
@@ -111,5 +134,7 @@
private
System
.
Windows
.
Forms
.
Button
btnSave
;
private
System
.
Windows
.
Forms
.
Button
btnSave
;
private
System
.
Windows
.
Forms
.
Button
btnBack
;
private
System
.
Windows
.
Forms
.
Button
btnBack
;
private
System
.
Windows
.
Forms
.
TextBox
txtIP
;
private
System
.
Windows
.
Forms
.
TextBox
txtIP
;
private
System
.
Windows
.
Forms
.
TextBox
txtStaDmxId
;
private
System
.
Windows
.
Forms
.
Label
label2
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
SmartShelf/FrmConfig.cs
查看文件 @
e618cd3
...
@@ -23,6 +23,7 @@ namespace SmartShelf
...
@@ -23,6 +23,7 @@ namespace SmartShelf
private
void
FrmPwd_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmPwd_Load
(
object
sender
,
EventArgs
e
)
{
{
txtIP
.
Text
=
LEDManager
.
DefaultIP
;
txtIP
.
Text
=
LEDManager
.
DefaultIP
;
txtStaDmxId
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
StatusLedDmx
);
}
}
private
void
btnNext_Click
(
object
sender
,
EventArgs
e
)
private
void
btnNext_Click
(
object
sender
,
EventArgs
e
)
...
@@ -31,6 +32,11 @@ namespace SmartShelf
...
@@ -31,6 +32,11 @@ namespace SmartShelf
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DefaultDeviceIP
,
ip
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DefaultDeviceIP
,
ip
);
LEDManager
.
DefaultIP
=
ip
;
LEDManager
.
DefaultIP
=
ip
;
string
dmxIds
=
txtStaDmxId
.
Text
.
Trim
();
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
StatusLedDmx
,
dmxIds
);
LEDManager
.
LoadStatusDMX
();
MessageBox
.
Show
(
"保存成功,重启软件后生效"
);
MessageBox
.
Show
(
"保存成功,重启软件后生效"
);
this
.
Close
();
this
.
Close
();
}
}
...
...
SmartShelf/记录.txt
查看文件 @
e618cd3
...
@@ -12,4 +12,11 @@ linePositions.csv文件里面:
...
@@ -12,4 +12,11 @@ linePositions.csv文件里面:
20200601
20200601
增加与电脑连接的模块IP地址的配置。
增加与电脑连接的模块IP地址的配置。
库位中对应的IP转为站号使用
\ No newline at end of file
\ No newline at end of file
库位中对应的IP转为站号使用
20200602
/rest/api/v1/shelf/allPosOff 增加 shelf参数 表示料架号
增加配置,表示状态灯区域地址。
<!--状态灯地址,;分割-->
<add key ="StatusLedDmx" value ="0"/>
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论