Commit 1e8ce892 LN

三色灯闪烁bug修改

1 个父辈 6a18db82
......@@ -72,21 +72,24 @@ namespace SmartShelf.DeviceLibrary
}
}
}
/// <summary>
/// 1=绿灯,2=黄灯
/// </summary>
public static int CurrLedStatus = -1;
///// <summary>
///// 1=绿灯,2=黄灯
///// </summary>
//public static int CurrLedStatus = -1;
public static List<int> StatusLedDmx = new List<int>();
public static string statusMsg = "";
public static void UpdateStatusLights(Dictionary<string,string> dataMap)
{
statusMsg = "";
Dictionary<string, List<Light>> lightsMap = new Dictionary<string, List<Light>>();
List<string> ipDmx = new List<string>(dataMap.Keys);
foreach (string key in ipDmx)
{
string color = dataMap[key];
statusMsg += "[" + key + "=" + color + "]";
string[] array = key.Split('_');
if (array.Length == 2)
{
......@@ -99,22 +102,22 @@ namespace SmartShelf.DeviceLibrary
{
if ("green".Equals(color))
{
CurrLedStatus = 1;
// CurrLedStatus = 1;
sLed.Add(Light.GreenLight(dmx, index));
}
else if ("yellow".Equals(color))
{
CurrLedStatus = 2;
// CurrLedStatus = 2;
sLed.Add(Light.YellowLight(dmx, index));
}
else if ("red".Equals(color))
{
CurrLedStatus = 2;
// CurrLedStatus = 2;
sLed.Add(Light.RedLight(dmx, index));
}
else
{
CurrLedStatus = 0;
// CurrLedStatus = 0;
sLed.Add(Light.CloseLight(dmx, index));
}
}
......@@ -132,7 +135,7 @@ namespace SmartShelf.DeviceLibrary
List<Light> lights = lightsMap[dip];
if (lights.Count > 0)
{
LEDManager.GetLedModule(dip).LightOff(lights.ToArray());
LEDManager.GetLedModule(dip).LightOn(lights.ToArray());
Thread.Sleep(50);
}
}
......
......@@ -124,7 +124,7 @@ namespace SmartShelf.DeviceLibrary
{
timersTimer = new System.Timers.Timer();
timersTimer.Enabled = false;
timersTimer.Interval = 1500;
timersTimer.Interval = 1000;
timersTimer.Elapsed += timersTimer_Elapsed;
timersTimer.AutoReset = true;
......@@ -232,7 +232,7 @@ namespace SmartShelf.DeviceLibrary
List<string> keys = new List<string>(StatusLedColorMap.Keys);
foreach(string key in keys)
{
if (shanShuoLed.Contains(key))
......
......@@ -75,6 +75,7 @@
this.txtIp2 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numYu)).BeginInit();
this.groupBox1.SuspendLayout();
......@@ -111,7 +112,7 @@
this.groupBox2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox2.Location = new System.Drawing.Point(4, 5);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(349, 194);
this.groupBox2.Size = new System.Drawing.Size(364, 194);
this.groupBox2.TabIndex = 106;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "库位操作测试";
......@@ -262,7 +263,7 @@
// button5
//
this.button5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button5.Location = new System.Drawing.Point(127, 21);
this.button5.Location = new System.Drawing.Point(106, 22);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(95, 35);
this.button5.TabIndex = 112;
......@@ -273,7 +274,7 @@
// btnCloseSLed
//
this.btnCloseSLed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseSLed.Location = new System.Drawing.Point(228, 21);
this.btnCloseSLed.Location = new System.Drawing.Point(204, 22);
this.btnCloseSLed.Name = "btnCloseSLed";
this.btnCloseSLed.Size = new System.Drawing.Size(95, 35);
this.btnCloseSLed.TabIndex = 111;
......@@ -284,7 +285,7 @@
// btnOpenSLed
//
this.btnOpenSLed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenSLed.Location = new System.Drawing.Point(26, 21);
this.btnOpenSLed.Location = new System.Drawing.Point(8, 22);
this.btnOpenSLed.Name = "btnOpenSLed";
this.btnOpenSLed.Size = new System.Drawing.Size(95, 35);
this.btnOpenSLed.TabIndex = 110;
......@@ -375,7 +376,7 @@
this.lblData.ForeColor = System.Drawing.Color.Red;
this.lblData.Location = new System.Drawing.Point(4, 618);
this.lblData.Name = "lblData";
this.lblData.Size = new System.Drawing.Size(349, 179);
this.lblData.Size = new System.Drawing.Size(364, 179);
this.lblData.TabIndex = 109;
this.lblData.Text = "label4";
this.lblData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
......@@ -386,9 +387,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.panel1);
this.groupBox1.Location = new System.Drawing.Point(359, 4);
this.groupBox1.Location = new System.Drawing.Point(374, 4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(740, 797);
this.groupBox1.Size = new System.Drawing.Size(725, 797);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "亮灯信息";
......@@ -401,7 +402,7 @@
this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel1.Location = new System.Drawing.Point(3, 22);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(734, 772);
this.panel1.Size = new System.Drawing.Size(719, 772);
this.panel1.TabIndex = 0;
//
// lblLedInfo
......@@ -413,7 +414,7 @@
this.lblLedInfo.ForeColor = System.Drawing.Color.Blue;
this.lblLedInfo.Location = new System.Drawing.Point(3, 6);
this.lblLedInfo.Name = "lblLedInfo";
this.lblLedInfo.Size = new System.Drawing.Size(728, 765);
this.lblLedInfo.Size = new System.Drawing.Size(713, 765);
this.lblLedInfo.TabIndex = 0;
this.lblLedInfo.Text = "?";
//
......@@ -440,7 +441,7 @@
this.groupTest.Controls.Add(this.btnCloseLed);
this.groupTest.Location = new System.Drawing.Point(4, 276);
this.groupTest.Name = "groupTest";
this.groupTest.Size = new System.Drawing.Size(349, 339);
this.groupTest.Size = new System.Drawing.Size(364, 339);
this.groupTest.TabIndex = 110;
this.groupTest.TabStop = false;
this.groupTest.Text = "灯条测试";
......@@ -588,16 +589,29 @@
//
// groupBox3
//
this.groupBox3.Controls.Add(this.linkLabel1);
this.groupBox3.Controls.Add(this.btnOpenSLed);
this.groupBox3.Controls.Add(this.btnCloseSLed);
this.groupBox3.Controls.Add(this.button5);
this.groupBox3.Location = new System.Drawing.Point(4, 203);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(349, 69);
this.groupBox3.Size = new System.Drawing.Size(364, 69);
this.groupBox3.TabIndex = 111;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "状态灯";
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linkLabel1.Location = new System.Drawing.Point(302, 31);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(56, 17);
this.linkLabel1.TabIndex = 113;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "打印状态";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// FrmSMStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -628,6 +642,7 @@
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
}
......@@ -678,5 +693,6 @@
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label lblAddr;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.LinkLabel linkLabel1;
}
}
\ No newline at end of file
......@@ -81,7 +81,7 @@ namespace SmartShelf
{
groupBox2.Enabled = true;
lblMsg.Text = "料架未启动";
}
}
lblData.Text = BOXManager.StrMsg;
List<BoxPosition> alls = new List<BoxPosition>(PMap.Values);
for (int i = 1; i <= BOXManager.BoxCount; i++)
......@@ -286,5 +286,10 @@ namespace SmartShelf
{
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
LogUtil.info("状态灯当前信息:" + LEDManager.statusMsg);
}
}
}
......@@ -26,4 +26,9 @@ linePositions.csv文件里面:
RGB颜色顺序增加配置。
状态灯亮黄灯时 ,亮蓝灯即可。是硬件里直接把蓝色的替换成黄色的灯珠了。
\ No newline at end of file
状态灯亮黄灯时 ,亮蓝灯即可。是硬件里直接把蓝色的替换成黄色的灯珠了。
20200817
三色灯状态修改:
软件启动后亮绿灯,当有库位灯打开时黄灯闪烁
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!