Commit 6a18db82 LN

三色灯修改

1 个父辈 8ebdcd5d
......@@ -43,5 +43,11 @@ namespace SmartShelf.Common
public static string HttpServerAddr = "HttpServerAddr";
/// <summary>
/// 控制器连接方式,0=默认串联,1=并联
/// </summary>
public static string ConnectionMode = "ConnectionMode";
}
}
......@@ -19,7 +19,7 @@ namespace SmartShelf.DeviceLibrary
public static string DefaultIP = ConfigAppSettings.GetValue(Setting_Init.DefaultDeviceIP);
public static int ConnectionMode = ConfigAppSettings.GetIntValue(Setting_Init.ConnectionMode);
public static LEDBaseModule GetLedModule(string ip)
{
LEDBaseModule led = null;
......
......@@ -25,7 +25,7 @@ namespace SmartShelf.DeviceLibrary
internal LEDColorArtNet(string ip) : base(ip)
{
this.phyIP = ip;
if (!String.IsNullOrEmpty(LEDManager.DefaultIP))
if (!String.IsNullOrEmpty(LEDManager.DefaultIP) || LEDManager.ConnectionMode.Equals(1))
{
try
{
......@@ -41,6 +41,9 @@ namespace SmartShelf.DeviceLibrary
{
LogUtil.error("IP【" + ip + "】解析phyAddr出错:" + ex.ToString());
}
}
if (!String.IsNullOrEmpty(LEDManager.DefaultIP))
{
iep = new IPEndPoint(IPAddress.Parse(LEDManager.DefaultIP), 6454);
}
else
......@@ -53,7 +56,7 @@ namespace SmartShelf.DeviceLibrary
datalength = 512;
Max_Light = datalength / 3;
dmxDatas = new List<byte[]>(Max_DMX);
AllLightOff();
}
......
......@@ -19,11 +19,13 @@
<!--料仓cid-->
<add key="Store_CID" value="singleledshelf2" />
<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 ="ColorRuleConfig" value ="RGB"/>
<add key ="ConnectionMode" value ="0"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -37,6 +37,8 @@
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.comBoxColor = new System.Windows.Forms.ComboBox();
this.cmbConMode = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
......@@ -55,7 +57,7 @@
this.btnSave.Anchor = System.Windows.Forms.AnchorStyles.Top;
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.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.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(103, 36);
......@@ -69,7 +71,7 @@
this.btnBack.Anchor = System.Windows.Forms.AnchorStyles.Top;
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.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.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(103, 36);
......@@ -136,11 +138,40 @@
this.comBoxColor.Size = new System.Drawing.Size(142, 28);
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
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.label3);
this.Controls.Add(this.txtStaDmxId);
......@@ -172,5 +203,7 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comBoxColor;
private System.Windows.Forms.ComboBox cmbConMode;
private System.Windows.Forms.Label label4;
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ namespace SmartShelf
"GBR=绿蓝红",
"BRG=蓝红绿",
"BGR=蓝绿红"};
comBoxColor.Items.Clear();
int index = 0;
int i = 0;
......@@ -44,8 +44,15 @@ namespace SmartShelf
}
i++;
}
comBoxColor.SelectedIndex = index;
cmbConMode.SelectedIndex = 0;
if (LEDManager.ConnectionMode.Equals(0))
{
comBoxColor.SelectedIndex = 0;
}
else
{
cmbConMode.SelectedIndex = 1;
}
}
......@@ -69,6 +76,11 @@ namespace SmartShelf
LogUtil.info("保存灯条颜色配置:" + Setting_Init.ColorRuleConfig +"="+ result);
}
int modeIndex = cmbConMode.SelectedIndex;
ConfigAppSettings.SaveValue(Setting_Init.ConnectionMode, modeIndex);
LogUtil.info("保存控制器连接方式:" + modeIndex);
MessageBox.Show("保存成功,重启软件后生效");
this.Close();
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!