Commit 24c36711 LN

增加清理料架按钮

1 个父辈 cd6dd4a7
...@@ -17,6 +17,7 @@ namespace DeviceLibrary ...@@ -17,6 +17,7 @@ namespace DeviceLibrary
private static string Addr_ShelfFinish = "/rest/api/shelf/putShelfFinished"; private static string Addr_ShelfFinish = "/rest/api/shelf/putShelfFinished";
private static string Addr_getLocation = "/rest/api/shelf/getLocation"; private static string Addr_getLocation = "/rest/api/shelf/getLocation";
private static string Addr_getShelfEmptySlot = "/rest/api/shelf/getShelfEmptySlot"; private static string Addr_getShelfEmptySlot = "/rest/api/shelf/getShelfEmptySlot";
private static string Addr_clearRfid = "/rest/api/shelf/clearRfid";
/// <summary> /// <summary>
/// rest/api/dcs/device/getShelfEmptySlot /// rest/api/dcs/device/getShelfEmptySlot
/// 获取当前任务数及料架的剩余空位 /// 获取当前任务数及料架的剩余空位
...@@ -267,7 +268,29 @@ namespace DeviceLibrary ...@@ -267,7 +268,29 @@ namespace DeviceLibrary
return tray; return tray;
} }
public static string ClearRfid(string rfid, string orderNo)
{
DateTime startTime = DateTime.Now;
try
{
string api = Addr_clearRfid;
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("orderNo", orderNo);
paramMap.Add("rfid", rfid);
string url = GetAddr(api, paramMap);
LogUtil.debug("http :URL:" + url);
string resultStr = HttpHelper.Get(url);
LogUtil.info("http :URL:" + url + " :Response:" + resultStr + " 耗时[" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "]");
return resultStr;
}
catch (Exception ex)
{
LogUtil.error("http error : " + ex.ToString());
}
return "";
}
} }
public class TrayInfo public class TrayInfo
{ {
......
...@@ -32,14 +32,21 @@ namespace TheMachine ...@@ -32,14 +32,21 @@ namespace TheMachine
this.button_positiontool = new System.Windows.Forms.Button(); this.button_positiontool = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_set = new System.Windows.Forms.TabPage(); this.tabPage_set = new System.Windows.Forms.TabPage();
this.group = new System.Windows.Forms.GroupBox();
this.label_newpwd = new System.Windows.Forms.Label();
this.label_oldpwd = new System.Windows.Forms.Label();
this.txtRfid = new System.Windows.Forms.TextBox();
this.txtOrderNo = new System.Windows.Forms.TextBox();
this.button_Clear = new System.Windows.Forms.Button();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword(); this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage_set.SuspendLayout(); this.tabPage_set.SuspendLayout();
this.group.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// button_positiontool // button_positiontool
// //
this.button_positiontool.Location = new System.Drawing.Point(36, 32); this.button_positiontool.Location = new System.Drawing.Point(18, 290);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(10); this.button_positiontool.Margin = new System.Windows.Forms.Padding(10);
this.button_positiontool.Name = "button_positiontool"; this.button_positiontool.Name = "button_positiontool";
this.button_positiontool.Size = new System.Drawing.Size(181, 36); this.button_positiontool.Size = new System.Drawing.Size(181, 36);
...@@ -60,6 +67,7 @@ namespace TheMachine ...@@ -60,6 +67,7 @@ namespace TheMachine
// //
// tabPage_set // tabPage_set
// //
this.tabPage_set.Controls.Add(this.group);
this.tabPage_set.Controls.Add(this.uC_SetUserPassword1); this.tabPage_set.Controls.Add(this.uC_SetUserPassword1);
this.tabPage_set.Controls.Add(this.button_positiontool); this.tabPage_set.Controls.Add(this.button_positiontool);
this.tabPage_set.Location = new System.Drawing.Point(4, 22); this.tabPage_set.Location = new System.Drawing.Point(4, 22);
...@@ -70,13 +78,74 @@ namespace TheMachine ...@@ -70,13 +78,74 @@ namespace TheMachine
this.tabPage_set.Text = "常规设置"; this.tabPage_set.Text = "常规设置";
this.tabPage_set.UseVisualStyleBackColor = true; this.tabPage_set.UseVisualStyleBackColor = true;
// //
// group
//
this.group.Controls.Add(this.button_Clear);
this.group.Controls.Add(this.label_newpwd);
this.group.Controls.Add(this.label_oldpwd);
this.group.Controls.Add(this.txtRfid);
this.group.Controls.Add(this.txtOrderNo);
this.group.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.group.Location = new System.Drawing.Point(6, 6);
this.group.Name = "group";
this.group.Size = new System.Drawing.Size(411, 271);
this.group.TabIndex = 8;
this.group.TabStop = false;
this.group.Text = "清空料架";
//
// label_newpwd
//
this.label_newpwd.Location = new System.Drawing.Point(8, 94);
this.label_newpwd.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label_newpwd.Name = "label_newpwd";
this.label_newpwd.Size = new System.Drawing.Size(134, 23);
this.label_newpwd.TabIndex = 4;
this.label_newpwd.Text = "RFID:";
this.label_newpwd.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label_oldpwd
//
this.label_oldpwd.Location = new System.Drawing.Point(8, 49);
this.label_oldpwd.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label_oldpwd.Name = "label_oldpwd";
this.label_oldpwd.Size = new System.Drawing.Size(134, 23);
this.label_oldpwd.TabIndex = 5;
this.label_oldpwd.Text = "工单号:";
this.label_oldpwd.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtRfid
//
this.txtRfid.Location = new System.Drawing.Point(152, 91);
this.txtRfid.Margin = new System.Windows.Forms.Padding(5);
this.txtRfid.Name = "txtRfid";
this.txtRfid.Size = new System.Drawing.Size(165, 26);
this.txtRfid.TabIndex = 2;
//
// txtOrderNo
//
this.txtOrderNo.Location = new System.Drawing.Point(152, 46);
this.txtOrderNo.Margin = new System.Windows.Forms.Padding(5);
this.txtOrderNo.Name = "txtOrderNo";
this.txtOrderNo.Size = new System.Drawing.Size(165, 26);
this.txtOrderNo.TabIndex = 3;
//
// button_Clear
//
this.button_Clear.Location = new System.Drawing.Point(152, 152);
this.button_Clear.Name = "button_Clear";
this.button_Clear.Size = new System.Drawing.Size(119, 33);
this.button_Clear.TabIndex = 6;
this.button_Clear.Text = "清理料架";
this.button_Clear.UseVisualStyleBackColor = true;
this.button_Clear.Click += new System.EventHandler(this.button_Clear_Click);
//
// uC_SetUserPassword1 // uC_SetUserPassword1
// //
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(335, 8); this.uC_SetUserPassword1.Location = new System.Drawing.Point(425, 6);
this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5); this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5);
this.uC_SetUserPassword1.Name = "uC_SetUserPassword1"; this.uC_SetUserPassword1.Name = "uC_SetUserPassword1";
this.uC_SetUserPassword1.Size = new System.Drawing.Size(533, 596); this.uC_SetUserPassword1.Size = new System.Drawing.Size(411, 271);
this.uC_SetUserPassword1.TabIndex = 7; this.uC_SetUserPassword1.TabIndex = 7;
// //
// SettingControl // SettingControl
...@@ -88,6 +157,8 @@ namespace TheMachine ...@@ -88,6 +157,8 @@ namespace TheMachine
this.Load += new System.EventHandler(this.SettingControl_Load); this.Load += new System.EventHandler(this.SettingControl_Load);
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage_set.ResumeLayout(false); this.tabPage_set.ResumeLayout(false);
this.group.ResumeLayout(false);
this.group.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -97,5 +168,11 @@ namespace TheMachine ...@@ -97,5 +168,11 @@ namespace TheMachine
private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage_set; private System.Windows.Forms.TabPage tabPage_set;
private UC_SetUserPassword uC_SetUserPassword1; private UC_SetUserPassword uC_SetUserPassword1;
private System.Windows.Forms.GroupBox group;
private System.Windows.Forms.Label label_newpwd;
private System.Windows.Forms.Label label_oldpwd;
private System.Windows.Forms.TextBox txtRfid;
private System.Windows.Forms.TextBox txtOrderNo;
private System.Windows.Forms.Button button_Clear;
} }
} }
...@@ -52,5 +52,22 @@ namespace TheMachine ...@@ -52,5 +52,22 @@ namespace TheMachine
frmPositionTool.ShowDialog(); frmPositionTool.ShowDialog();
} }
} }
private void button_Clear_Click(object sender, EventArgs e)
{
string rfid = txtRfid.Text.Trim();
string orderNo = txtOrderNo.Text.Trim();
if (rfid == "" && orderNo == "")
{
MessageBox.Show("请输入要清理的RFID", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
LogUtil.info($"点击按钮 {button_Clear.Text.ToString()} ,rfid=[{rfid}],orderNo=[{orderNo}],调用接口清理料架信息");
string result = HttpServer.ClearRfid(rfid, orderNo);
MessageBox.Show($"清理料架,rfid={rfid} ,orderNo={orderNo} 结果:\r\n {result}", "提示", MessageBoxButtons.OK);
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!