Commit 4f9a19c2 LN

增加托盘编辑功能

1 个父辈 003634a7
...@@ -32,6 +32,19 @@ ...@@ -32,6 +32,19 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLineStore)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLineStore));
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label5 = new System.Windows.Forms.Label();
this.chbInStoNG = new System.Windows.Forms.CheckBox();
this.cmbTrayType = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.txtTrayW = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtTrayH = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtTrayPosid = new System.Windows.Forms.TextBox();
this.cmbTray = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.btnUpdateTray = new System.Windows.Forms.Button();
this.lblMoveInfo = new System.Windows.Forms.Label(); this.lblMoveInfo = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnClearTray = new System.Windows.Forms.Button(); this.btnClearTray = new System.Windows.Forms.Button();
...@@ -83,6 +96,7 @@ ...@@ -83,6 +96,7 @@
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
...@@ -107,6 +121,7 @@ ...@@ -107,6 +121,7 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Controls.Add(this.lblMoveInfo); this.tabPage1.Controls.Add(this.lblMoveInfo);
this.tabPage1.Controls.Add(this.groupBox2); this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.groupBox1); this.tabPage1.Controls.Add(this.groupBox1);
...@@ -119,6 +134,142 @@ ...@@ -119,6 +134,142 @@
this.tabPage1.Text = "状态信息"; this.tabPage1.Text = "状态信息";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.label5);
this.groupBox3.Controls.Add(this.chbInStoNG);
this.groupBox3.Controls.Add(this.cmbTrayType);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Controls.Add(this.txtTrayW);
this.groupBox3.Controls.Add(this.label3);
this.groupBox3.Controls.Add(this.txtTrayH);
this.groupBox3.Controls.Add(this.label2);
this.groupBox3.Controls.Add(this.txtTrayPosid);
this.groupBox3.Controls.Add(this.cmbTray);
this.groupBox3.Controls.Add(this.label1);
this.groupBox3.Controls.Add(this.btnUpdateTray);
this.groupBox3.Location = new System.Drawing.Point(460, 534);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(860, 68);
this.groupBox3.TabIndex = 197;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "托盘信息编辑";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(135, 31);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(68, 20);
this.label5.TabIndex = 206;
this.label5.Text = "料盘类型:";
//
// chbInStoNG
//
this.chbInStoNG.AutoSize = true;
this.chbInStoNG.Location = new System.Drawing.Point(650, 29);
this.chbInStoNG.Name = "chbInStoNG";
this.chbInStoNG.Size = new System.Drawing.Size(84, 24);
this.chbInStoNG.TabIndex = 205;
this.chbInStoNG.Text = "入库失败";
this.chbInStoNG.UseVisualStyleBackColor = true;
//
// cmbTrayType
//
this.cmbTrayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTrayType.FormattingEnabled = true;
this.cmbTrayType.Items.AddRange(new object[] {
"无",
"入库",
"出库"});
this.cmbTrayType.Location = new System.Drawing.Point(207, 27);
this.cmbTrayType.Name = "cmbTrayType";
this.cmbTrayType.Size = new System.Drawing.Size(78, 28);
this.cmbTrayType.TabIndex = 204;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(557, 31);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(26, 20);
this.label4.TabIndex = 203;
this.label4.Text = "宽:";
//
// txtTrayW
//
this.txtTrayW.Location = new System.Drawing.Point(587, 28);
this.txtTrayW.Name = "txtTrayW";
this.txtTrayW.Size = new System.Drawing.Size(48, 26);
this.txtTrayW.TabIndex = 202;
this.txtTrayW.Text = "7";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(464, 31);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(26, 20);
this.label3.TabIndex = 201;
this.label3.Text = "高:";
//
// txtTrayH
//
this.txtTrayH.Location = new System.Drawing.Point(494, 28);
this.txtTrayH.Name = "txtTrayH";
this.txtTrayH.Size = new System.Drawing.Size(48, 26);
this.txtTrayH.TabIndex = 200;
this.txtTrayH.Text = "8";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(300, 31);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 20);
this.label2.TabIndex = 199;
this.label2.Text = "库位:";
//
// txtTrayPosid
//
this.txtTrayPosid.Location = new System.Drawing.Point(344, 28);
this.txtTrayPosid.Name = "txtTrayPosid";
this.txtTrayPosid.Size = new System.Drawing.Size(105, 26);
this.txtTrayPosid.TabIndex = 198;
this.txtTrayPosid.Text = "11#AC1_1_1";
//
// cmbTray
//
this.cmbTray.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTray.FormattingEnabled = true;
this.cmbTray.Location = new System.Drawing.Point(69, 27);
this.cmbTray.Name = "cmbTray";
this.cmbTray.Size = new System.Drawing.Size(51, 28);
this.cmbTray.TabIndex = 194;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(11, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(54, 20);
this.label1.TabIndex = 193;
this.label1.Text = "托盘号:";
//
// btnUpdateTray
//
this.btnUpdateTray.BackColor = System.Drawing.Color.White;
this.btnUpdateTray.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateTray.Location = new System.Drawing.Point(738, 24);
this.btnUpdateTray.Name = "btnUpdateTray";
this.btnUpdateTray.Size = new System.Drawing.Size(105, 35);
this.btnUpdateTray.TabIndex = 192;
this.btnUpdateTray.Text = "更新托盘信息";
this.btnUpdateTray.UseVisualStyleBackColor = false;
this.btnUpdateTray.Click += new System.EventHandler(this.btnUpdateTray_Click);
//
// lblMoveInfo // lblMoveInfo
// //
this.lblMoveInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblMoveInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
...@@ -258,9 +409,9 @@ ...@@ -258,9 +409,9 @@
this.lblPosId.AutoSize = true; this.lblPosId.AutoSize = true;
this.lblPosId.Location = new System.Drawing.Point(366, 35); this.lblPosId.Location = new System.Drawing.Point(366, 35);
this.lblPosId.Name = "lblPosId"; this.lblPosId.Name = "lblPosId";
this.lblPosId.Size = new System.Drawing.Size(51, 20); this.lblPosId.Size = new System.Drawing.Size(40, 20);
this.lblPosId.TabIndex = 197; this.lblPosId.TabIndex = 197;
this.lblPosId.Text = "库位"; this.lblPosId.Text = "库位:";
// //
// btnUpdateStatus // btnUpdateStatus
// //
...@@ -352,7 +503,7 @@ ...@@ -352,7 +503,7 @@
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(460, 85); this.logBox.Location = new System.Drawing.Point(460, 85);
this.logBox.Name = "logBox"; this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(860, 517); this.logBox.Size = new System.Drawing.Size(860, 445);
this.logBox.TabIndex = 106; this.logBox.TabIndex = 106;
this.logBox.Text = ""; this.logBox.Text = "";
// //
...@@ -612,6 +763,8 @@ ...@@ -612,6 +763,8 @@
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout(); this.tabPage1.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
...@@ -677,6 +830,19 @@ ...@@ -677,6 +830,19 @@
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnTrayInfo; private System.Windows.Forms.Button btnTrayInfo;
private System.Windows.Forms.Button btnClearTray; private System.Windows.Forms.Button btnClearTray;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox chbInStoNG;
private System.Windows.Forms.ComboBox cmbTrayType;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtTrayW;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtTrayH;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtTrayPosid;
private System.Windows.Forms.ComboBox cmbTray;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnUpdateTray;
private System.Windows.Forms.Label label5;
} }
} }
...@@ -118,9 +118,17 @@ namespace OnlineStore.AssemblyLine ...@@ -118,9 +118,17 @@ namespace OnlineStore.AssemblyLine
LoadListView(); LoadListView();
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1); 托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
cmbTray.Items.Clear();
for(int i = 1; i <= 30; i++)
{
cmbTray.Items.Add(i.ToString());
}
cmbTrayType.SelectedIndex = 0;
cmbTray.SelectedIndex = 0;
LoadOk = true; LoadOk = true;
HideForm(); HideForm();
timer1.Start(); timer1.Start();
} }
private void LoadListView() private void LoadListView()
...@@ -248,22 +256,36 @@ namespace OnlineStore.AssemblyLine ...@@ -248,22 +256,36 @@ namespace OnlineStore.AssemblyLine
DialogResult result = MessageBox.Show("是否确定退出流水线客户端?", "提示", MessageBoxButtons.YesNo); DialogResult result = MessageBox.Show("是否确定退出流水线客户端?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
try
{
//如果料仓还在运行状态,先关闭料仓 //如果料仓还在运行状态,先关闭料仓
if (!lineBean.runStatus.Equals(LineRunStatus.Wait)) if (!lineBean.runStatus.Equals(LineRunStatus.Wait))
{ {
LogUtil.info(LOGGER, "退出程序之前先停止运行 "); LogUtil.info(LOGGER, "即将退出程序,停止" + lineBean.Name + "运行 ");
lineBean.StopRun(); lineBean.StopRun();
} }
foreach (EquipBase equip in lineBean.AllEquipMap.Values)
{
if (equip.runStatus > LineRunStatus.Wait)
{
LogUtil.info(LOGGER, "即将退出程序,停止" + equip.Name + "运行 ");
equip.StopRun();
}
}
// IOManager.instance.CloseAllDO(); // IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect(); //AIManager.CloseConnect();
ACServerManager.CloseAllPort(); ACServerManager.CloseAllPort();
// CodeManager.CloseAllCamera(); // CodeManager.CloseAllCamera();
RFIDManager.RfidReader.Close(); RFIDManager.RfidReader.Close();
//this.Close();
System.Environment.Exit(System.Environment.ExitCode); System.Environment.Exit(System.Environment.ExitCode);
} }
catch(Exception ex)
{
LogUtil.error("退出出错:" + ex.ToString());
}
//this.Close();
}
} }
private void 显示ToolStripMenuItem_Click(object sender, EventArgs e) private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -734,6 +756,9 @@ namespace OnlineStore.AssemblyLine ...@@ -734,6 +756,9 @@ namespace OnlineStore.AssemblyLine
private void btnClearTray_Click(object sender, EventArgs e) private void btnClearTray_Click(object sender, EventArgs e)
{ {
DialogResult resut = MessageBox.Show("确定手动清空所有托盘信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
List<TrayInfo> tray = TrayManager.getTrayList(); List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:"); LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:");
foreach (TrayInfo t in tray) foreach (TrayInfo t in tray)
...@@ -744,4 +769,35 @@ namespace OnlineStore.AssemblyLine ...@@ -744,4 +769,35 @@ namespace OnlineStore.AssemblyLine
LogUtil.info("-------------------点击:清空托盘。托盘内容已清空"); LogUtil.info("-------------------点击:清空托盘。托盘内容已清空");
} }
} }
private void btnUpdateTray_Click(object sender, EventArgs e)
{
int num = cmbTray.SelectedIndex + 1;
DialogResult resut = MessageBox.Show("确定手动更新托盘【"+num+"】的信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
int trayType = cmbTrayType.SelectedIndex;
string posId = txtTrayPosid.Text;
int ph = FormUtil.GetIntValue(txtTrayH);
int pw = FormUtil.GetIntValue(txtTrayW);
bool hasTray = trayType > 0;
bool inNg = chbInStoNG.Checked;
if (hasTray)
{
TrayManager.UpdateTrayInfo(num, hasTray, trayType, "CodeTest", posId, ph, pw);
}
else
{
TrayManager.UpdateTrayInfo(num, hasTray);
}
if (trayType.Equals(1) && inNg)
{
TrayManager.UpdateInStoreNG(num, inNg, "InStoreNG ");
}
TrayInfo info = TrayManager.GetTrayInfo(num);
MessageBox.Show("更新成功:\r" + info.ToStr());
LogUtil.info("手动更新托盘信息:" + info.ToStr());
}
}
}
} }
...@@ -970,14 +970,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -970,14 +970,15 @@ namespace OnlineStore.DeviceLibrary
if (Config.IsCanOut.Equals(1)) if (Config.IsCanOut.Equals(1))
{ {
//此托盘是紧急出料盘,需要通过料架出库 //此托盘是紧急出料盘,需要通过料架出库
bool debugNeed = (runStatus >= LineRunStatus.Runing)&&info.IsFull&&info.InOrOutStore.Equals(2); bool debugNeed = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InOrOutStore.Equals(2);
if (info.PosId.Equals("")) if (info.PosId.Equals(""))
{ {
param = new InOutParam(trayNum, "紧急出料测试", "1#AC1_3_2", 12, 7); param = new InOutParam(trayNum, "紧急出料测试", "1#AC1_3_2", 12, 7);
} }
bool isJinji = info.EmergencyOut && info.IsFull && runStatus >= LineRunStatus.Runing; bool isJinji = info.EmergencyOut && info.IsFull && runStatus >= LineRunStatus.Runing;
//入料失败的盘也从此处出库
if (debugNeed || isJinji) bool instoeEnd = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InStoreNG;
if (debugNeed || isJinji || instoeEnd)
{ {
//判断是否有料架,是否可以出库 //判断是否有料架,是否可以出库
......
...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
internal static TrayInfo GetTrayInfo(int trayNum) public static TrayInfo GetTrayInfo(int trayNum)
{ {
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
{ {
...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
} }
internal static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, string wareCode = "", string posId = "", int plateH = 0, int plateW = 0) public static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, string wareCode = "", string posId = "", int plateH = 0, int plateW = 0)
{ {
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
{ {
...@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
internal static void UpdateInStoreNG(int trayNum, bool isNg, string msg) public static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
{ {
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】"); LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】");
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
......
...@@ -41,10 +41,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -41,10 +41,10 @@ namespace OnlineStore.DeviceLibrary
{ {
type = "出库"; type = "出库";
} }
string err =InStoreNG? "入库失败:"+NgMsg:""; string err =InStoreNG? "[入库失败:"+NgMsg+"]":"";
string jinji = EmergencyOut ? "紧急出料" : ""; string jinji = EmergencyOut ? "[紧急出料]" : "";
return "托盘[" + TrayCode + "][" + (IsFull ? "有料," : "空,") +"]["+ type + return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
"]二维码[" + WareCode + "]库位号[" + PosId + "]盘高[" + PlateH + "]盘宽[" + PlateW + "] [" + err + "] ["+ jinji + "]" ; "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
} }
/// <summary> /// <summary>
/// 夹具编码值(1-32?) /// 夹具编码值(1-32?)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!