Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmartShelf
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6a18db82
由
LN
编写于
2020-08-17 14:31:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
三色灯修改
1 个父辈
8ebdcd5d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
66 行增加
和
10 行删除
Common/Setting_Init.cs
DeviceLibrary/Config/linePositions.csv
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
DeviceLibrary/DeviceLibrary/led/LEDColorArtNet.cs
SmartShelf/App.config
SmartShelf/FrmConfig.Designer.cs
SmartShelf/FrmConfig.cs
Common/Setting_Init.cs
查看文件 @
6a18db8
...
@@ -43,5 +43,11 @@ namespace SmartShelf.Common
...
@@ -43,5 +43,11 @@ namespace SmartShelf.Common
public
static
string
HttpServerAddr
=
"HttpServerAddr"
;
public
static
string
HttpServerAddr
=
"HttpServerAddr"
;
/// <summary>
/// 控制器连接方式,0=默认串联,1=并联
/// </summary>
public
static
string
ConnectionMode
=
"ConnectionMode"
;
}
}
}
}
DeviceLibrary/Config/linePositions.csv
查看文件 @
6a18db8
此文件的差异被折叠,
点击展开。
DeviceLibrary/DeviceLibrary/led/BaseLEDManager.cs
查看文件 @
6a18db8
...
@@ -19,7 +19,7 @@ namespace SmartShelf.DeviceLibrary
...
@@ -19,7 +19,7 @@ namespace SmartShelf.DeviceLibrary
public
static
string
DefaultIP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DefaultDeviceIP
);
public
static
string
DefaultIP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DefaultDeviceIP
);
public
static
int
ConnectionMode
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ConnectionMode
);
public
static
LEDBaseModule
GetLedModule
(
string
ip
)
public
static
LEDBaseModule
GetLedModule
(
string
ip
)
{
{
LEDBaseModule
led
=
null
;
LEDBaseModule
led
=
null
;
...
...
DeviceLibrary/DeviceLibrary/led/LEDColorArtNet.cs
查看文件 @
6a18db8
...
@@ -25,7 +25,7 @@ namespace SmartShelf.DeviceLibrary
...
@@ -25,7 +25,7 @@ namespace SmartShelf.DeviceLibrary
internal
LEDColorArtNet
(
string
ip
)
:
base
(
ip
)
internal
LEDColorArtNet
(
string
ip
)
:
base
(
ip
)
{
{
this
.
phyIP
=
ip
;
this
.
phyIP
=
ip
;
if
(!
String
.
IsNullOrEmpty
(
LEDManager
.
DefaultIP
))
if
(!
String
.
IsNullOrEmpty
(
LEDManager
.
DefaultIP
)
||
LEDManager
.
ConnectionMode
.
Equals
(
1
)
)
{
{
try
try
{
{
...
@@ -41,6 +41,9 @@ namespace SmartShelf.DeviceLibrary
...
@@ -41,6 +41,9 @@ namespace SmartShelf.DeviceLibrary
{
{
LogUtil
.
error
(
"IP【"
+
ip
+
"】解析phyAddr出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"IP【"
+
ip
+
"】解析phyAddr出错:"
+
ex
.
ToString
());
}
}
}
if
(!
String
.
IsNullOrEmpty
(
LEDManager
.
DefaultIP
))
{
iep
=
new
IPEndPoint
(
IPAddress
.
Parse
(
LEDManager
.
DefaultIP
),
6454
);
iep
=
new
IPEndPoint
(
IPAddress
.
Parse
(
LEDManager
.
DefaultIP
),
6454
);
}
}
else
else
...
@@ -53,7 +56,7 @@ namespace SmartShelf.DeviceLibrary
...
@@ -53,7 +56,7 @@ namespace SmartShelf.DeviceLibrary
datalength
=
512
;
datalength
=
512
;
Max_Light
=
datalength
/
3
;
Max_Light
=
datalength
/
3
;
dmxDatas
=
new
List
<
byte
[
]>
(
Max_DMX
);
dmxDatas
=
new
List
<
byte
[
]>
(
Max_DMX
);
AllLightOff
();
AllLightOff
();
}
}
...
...
SmartShelf/App.config
查看文件 @
6a18db8
...
@@ -19,11 +19,13 @@
...
@@ -19,11 +19,13 @@
<!--料仓
cid
-->
<!--料仓
cid
-->
<
add
key
=
"Store_CID"
value
=
"singleledshelf2"
/>
<
add
key
=
"Store_CID"
value
=
"singleledshelf2"
/>
<
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.72"
/>
<!--<
add
key
=
"DefaultDeviceIP"
value
=
"192.168.201.10"
/>-->
<!--状态灯地址,;分割-->
<!--状态灯地址,;分割-->
<
add
key
=
"StatusLedDmx"
value
=
"0"
/>
<
add
key
=
"StatusLedDmx"
value
=
"0"
/>
<!--灯条颜色规则配置-->
<!--灯条颜色规则配置-->
<
add
key
=
"ColorRuleConfig"
value
=
"RGB"
/>
<
add
key
=
"ColorRuleConfig"
value
=
"RGB"
/>
<
add
key
=
"ConnectionMode"
value
=
"0"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
SmartShelf/FrmConfig.Designer.cs
查看文件 @
6a18db8
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
comBoxColor
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
comBoxColor
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cmbConMode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// label1
// label1
...
@@ -55,7 +57,7 @@
...
@@ -55,7 +57,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
(
226
,
250
);
this
.
btnSave
.
Location
=
new
System
.
Drawing
.
Point
(
226
,
323
);
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
);
...
@@ -69,7 +71,7 @@
...
@@ -69,7 +71,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
(
118
,
250
);
this
.
btnBack
.
Location
=
new
System
.
Drawing
.
Point
(
118
,
323
);
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
);
...
@@ -136,11 +138,40 @@
...
@@ -136,11 +138,40 @@
this
.
comBoxColor
.
Size
=
new
System
.
Drawing
.
Size
(
142
,
28
);
this
.
comBoxColor
.
Size
=
new
System
.
Drawing
.
Size
(
142
,
28
);
this
.
comBoxColor
.
TabIndex
=
280
;
this
.
comBoxColor
.
TabIndex
=
280
;
//
//
// cmbConMode
//
this
.
cmbConMode
.
AutoCompleteCustomSource
.
AddRange
(
new
string
[]
{
"串联"
,
"并联"
});
this
.
cmbConMode
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmbConMode
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbConMode
.
FormattingEnabled
=
true
;
this
.
cmbConMode
.
Items
.
AddRange
(
new
object
[]
{
"默认串联"
,
"并联"
});
this
.
cmbConMode
.
Location
=
new
System
.
Drawing
.
Point
(
226
,
237
);
this
.
cmbConMode
.
Name
=
"cmbConMode"
;
this
.
cmbConMode
.
Size
=
new
System
.
Drawing
.
Size
(
142
,
28
);
this
.
cmbConMode
.
TabIndex
=
282
;
//
// label4
//
this
.
label4
.
AutoSize
=
true
;
this
.
label4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
71
,
240
);
this
.
label4
.
Name
=
"label4"
;
this
.
label4
.
Size
=
new
System
.
Drawing
.
Size
(
149
,
20
);
this
.
label4
.
TabIndex
=
281
;
this
.
label4
.
Text
=
"多个控制器连接方式:"
;
this
.
label4
.
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
(
459
,
357
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
459
,
415
);
this
.
Controls
.
Add
(
this
.
cmbConMode
);
this
.
Controls
.
Add
(
this
.
label4
);
this
.
Controls
.
Add
(
this
.
comBoxColor
);
this
.
Controls
.
Add
(
this
.
comBoxColor
);
this
.
Controls
.
Add
(
this
.
label3
);
this
.
Controls
.
Add
(
this
.
label3
);
this
.
Controls
.
Add
(
this
.
txtStaDmxId
);
this
.
Controls
.
Add
(
this
.
txtStaDmxId
);
...
@@ -172,5 +203,7 @@
...
@@ -172,5 +203,7 @@
private
System
.
Windows
.
Forms
.
Label
label2
;
private
System
.
Windows
.
Forms
.
Label
label2
;
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
ComboBox
comBoxColor
;
private
System
.
Windows
.
Forms
.
ComboBox
comBoxColor
;
private
System
.
Windows
.
Forms
.
ComboBox
cmbConMode
;
private
System
.
Windows
.
Forms
.
Label
label4
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
SmartShelf/FrmConfig.cs
查看文件 @
6a18db8
...
@@ -31,7 +31,7 @@ namespace SmartShelf
...
@@ -31,7 +31,7 @@ namespace SmartShelf
"GBR=绿蓝红"
,
"GBR=绿蓝红"
,
"BRG=蓝红绿"
,
"BRG=蓝红绿"
,
"BGR=蓝绿红"
};
"BGR=蓝绿红"
};
comBoxColor
.
Items
.
Clear
();
comBoxColor
.
Items
.
Clear
();
int
index
=
0
;
int
index
=
0
;
int
i
=
0
;
int
i
=
0
;
...
@@ -44,8 +44,15 @@ namespace SmartShelf
...
@@ -44,8 +44,15 @@ namespace SmartShelf
}
}
i
++;
i
++;
}
}
cmbConMode
.
SelectedIndex
=
0
;
comBoxColor
.
SelectedIndex
=
index
;
if
(
LEDManager
.
ConnectionMode
.
Equals
(
0
))
{
comBoxColor
.
SelectedIndex
=
0
;
}
else
{
cmbConMode
.
SelectedIndex
=
1
;
}
}
}
...
@@ -69,6 +76,11 @@ namespace SmartShelf
...
@@ -69,6 +76,11 @@ namespace SmartShelf
LogUtil
.
info
(
"保存灯条颜色配置:"
+
Setting_Init
.
ColorRuleConfig
+
"="
+
result
);
LogUtil
.
info
(
"保存灯条颜色配置:"
+
Setting_Init
.
ColorRuleConfig
+
"="
+
result
);
}
}
int
modeIndex
=
cmbConMode
.
SelectedIndex
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
ConnectionMode
,
modeIndex
);
LogUtil
.
info
(
"保存控制器连接方式:"
+
modeIndex
);
MessageBox
.
Show
(
"保存成功,重启软件后生效"
);
MessageBox
.
Show
(
"保存成功,重启软件后生效"
);
this
.
Close
();
this
.
Close
();
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论