Commit 11b90637 LN

rest/api/v1/shelf/allPosOff?color=green 指定灭灯的颜色,如果为空,所有灯全部熄灭

1 个父辈 9a53769b
......@@ -154,6 +154,7 @@ namespace SmartShelf.DeviceLibrary
public class Light
{
public static string defaultColor = "green";
public static byte defaultR = 0;
public static byte defaultG = 50;
public static byte defaultB = 0;
......
......@@ -32,9 +32,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSMStore));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button5 = new System.Windows.Forms.Button();
this.btnCloseSLed = new System.Windows.Forms.Button();
this.btnOpenSLed = new System.Windows.Forms.Button();
this.lblAddr = new System.Windows.Forms.Label();
this.cmbNum = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.txtDmxId = new System.Windows.Forms.TextBox();
......@@ -48,6 +46,9 @@
this.label5 = new System.Windows.Forms.Label();
this.cmbPositionList = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.button5 = new System.Windows.Forms.Button();
this.btnCloseSLed = new System.Windows.Forms.Button();
this.btnOpenSLed = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.numYu = new System.Windows.Forms.NumericUpDown();
......@@ -73,7 +74,6 @@
this.btOAll = new System.Windows.Forms.Button();
this.txtIp2 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.lblAddr = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numYu)).BeginInit();
......@@ -116,38 +116,14 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "库位操作测试";
//
// 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.Name = "button5";
this.button5.Size = new System.Drawing.Size(95, 35);
this.button5.TabIndex = 112;
this.button5.Text = "亮黄灯";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// 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.Name = "btnCloseSLed";
this.btnCloseSLed.Size = new System.Drawing.Size(95, 35);
this.btnCloseSLed.TabIndex = 111;
this.btnCloseSLed.Text = "关闭灯";
this.btnCloseSLed.UseVisualStyleBackColor = true;
this.btnCloseSLed.Click += new System.EventHandler(this.btnCloseSLed_Click);
//
// btnOpenSLed
// lblAddr
//
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.Name = "btnOpenSLed";
this.btnOpenSLed.Size = new System.Drawing.Size(95, 35);
this.btnOpenSLed.TabIndex = 110;
this.btnOpenSLed.Text = "亮绿灯";
this.btnOpenSLed.UseVisualStyleBackColor = true;
this.btnOpenSLed.Click += new System.EventHandler(this.btnOpenSLed_Click);
this.lblAddr.AutoSize = true;
this.lblAddr.Location = new System.Drawing.Point(232, 112);
this.lblAddr.Name = "lblAddr";
this.lblAddr.Size = new System.Drawing.Size(0, 17);
this.lblAddr.TabIndex = 113;
this.lblAddr.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmbNum
//
......@@ -283,6 +259,39 @@
this.label10.Text = "库位列表:";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// 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.Name = "button5";
this.button5.Size = new System.Drawing.Size(95, 35);
this.button5.TabIndex = 112;
this.button5.Text = "亮黄灯";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// 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.Name = "btnCloseSLed";
this.btnCloseSLed.Size = new System.Drawing.Size(95, 35);
this.btnCloseSLed.TabIndex = 111;
this.btnCloseSLed.Text = "关闭灯";
this.btnCloseSLed.UseVisualStyleBackColor = true;
this.btnCloseSLed.Click += new System.EventHandler(this.btnCloseSLed_Click);
//
// 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.Name = "btnOpenSLed";
this.btnOpenSLed.Size = new System.Drawing.Size(95, 35);
this.btnOpenSLed.TabIndex = 110;
this.btnOpenSLed.Text = "亮绿灯";
this.btnOpenSLed.UseVisualStyleBackColor = true;
this.btnOpenSLed.Click += new System.EventHandler(this.btnOpenSLed_Click);
//
// label3
//
this.label3.AutoSize = true;
......@@ -389,6 +398,7 @@
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.lblLedInfo);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
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);
......@@ -396,14 +406,16 @@
//
// lblLedInfo
//
this.lblLedInfo.AutoSize = true;
this.lblLedInfo.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLedInfo.ForeColor = System.Drawing.Color.Green;
this.lblLedInfo.Location = new System.Drawing.Point(12, 16);
this.lblLedInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblLedInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
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(51, 19);
this.lblLedInfo.Size = new System.Drawing.Size(728, 765);
this.lblLedInfo.TabIndex = 0;
this.lblLedInfo.Text = "label3";
this.lblLedInfo.Text = "?";
//
// groupTest
//
......@@ -574,15 +586,6 @@
this.label6.Text = "模块IP:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblAddr
//
this.lblAddr.AutoSize = true;
this.lblAddr.Location = new System.Drawing.Point(232, 112);
this.lblAddr.Name = "lblAddr";
this.lblAddr.Size = new System.Drawing.Size(0, 17);
this.lblAddr.TabIndex = 113;
this.lblAddr.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.btnOpenSLed);
......@@ -619,7 +622,6 @@
((System.ComponentModel.ISupportInitialize)(this.numYu)).EndInit();
this.groupBox1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupTest.ResumeLayout(false);
this.groupTest.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
......
......@@ -98,19 +98,20 @@ namespace SmartShelf
foreach (BoxPosition p in positions)
{
int status = BOXManager.StatusMap[p.PositionNum];
string status = BOXManager.GetPosIdColor(p.PositionNum);
str += status.ToString();
if (status.Equals(1))
if (!String.IsNullOrEmpty(status))
{
num++;
int length = p.PositionNum.Length;
if ((num % 10).Equals(0))
int length = p.PositionNum.Length;
//if ((num % 10).Equals(0))
//{
// msg += p.PositionNum.PadLeft(24 - length, ' ') +"["+status+"]"+ "\r\n ";
//}
//else
{
msg += p.PositionNum.PadLeft(24- length, ' ') + "\r\n ";
}
else {
msg += p.PositionNum.PadLeft(24- length, ' ');
msg += p.PositionNum.PadLeft(20 - length, ' ')+"[" + status + "]";
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!