Commit 3c40c3b3 LN

增加单个托盘清空功能,方便处理。

1 个父辈 f39622e9
......@@ -136,7 +136,7 @@ namespace OnlineStore.AssemblyLine
}
if (LineManager.UseBuzzer)
{
启用蜂鸣器ToolStripMenuItem.Text =gouStr+ "启用蜂鸣器";
启用蜂鸣器ToolStripMenuItem.Text = gouStr + "启用蜂鸣器";
}
else
{
......@@ -177,7 +177,7 @@ namespace OnlineStore.AssemblyLine
{
string online = "✘";
lvi.SubItems.Add(box.CId.ToString());
if ((DateTime.Now - box.LastMsgTime).TotalSeconds < LineServer.ClientKeepSecond)
{
online = "✔";
......@@ -291,14 +291,14 @@ namespace OnlineStore.AssemblyLine
//如果料仓还在运行状态,先关闭料仓
if (!lineBean.runStatus.Equals(LineRunStatus.Wait))
{
LogUtil.info( "即将退出程序,停止" + lineBean.Name + "运行 ");
LogUtil.info("即将退出程序,停止" + lineBean.Name + "运行 ");
lineBean.StopRun();
}
foreach (EquipBase equip in lineBean.AllEquipMap.Values)
{
if (equip.runStatus > LineRunStatus.Wait)
{
LogUtil.info( "即将退出程序,停止" + equip.Name + "运行 ");
LogUtil.info("即将退出程序,停止" + equip.Name + "运行 ");
equip.StopRun();
}
}
......@@ -352,7 +352,7 @@ namespace OnlineStore.AssemblyLine
MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!");
return;
}
LogUtil.info( "点击 开始启动");
LogUtil.info("点击 开始启动");
startTimer.Interval = 300;
startTimer.Elapsed += timer_Elapsed;
startTimer.AutoReset = false;
......@@ -454,7 +454,7 @@ namespace OnlineStore.AssemblyLine
private void btnClearLog_Click(object sender, EventArgs e)
{
LogUtil.ClearLog();
}
}
private void btnCopyLog_Click(object sender, EventArgs e)
{
......@@ -506,10 +506,10 @@ namespace OnlineStore.AssemblyLine
if (process != null)
{
StringBuilder sbResult = new StringBuilder();
PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName);
PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName);
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存:{1}M ", process.ProcessName, Math.Round(pf1.NextValue() / 1024 / 1024F, 2));
float cpu = curtime.NextValue() / Environment.ProcessorCount;
sbResult.AppendFormat(", CPU : {0} %",cpu);
sbResult.AppendFormat(", CPU : {0} %", cpu);
if (cpu >= 10)
{
logMinute = 1;
......@@ -535,7 +535,7 @@ namespace OnlineStore.AssemblyLine
{
return;
}
string canScanCode = "";
string canScanCode = "";
if (AgvClient.CurrCancelState)
{
aGVCancelStateToolStripMenuItem.Text = gouStr + " AGV cancelState";
......@@ -546,7 +546,7 @@ namespace OnlineStore.AssemblyLine
}
lblStatus.Text = lineBean.GetRunStr() + canScanCode;
string time = LineManager.Line.alarmType.Equals(LineAlarmType.None) ? "" : LineManager.Line.LastAlarmTime.ToLongTimeString();
string warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : time+ LineManager.Line.WarnMsg + "\r\n";
string warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : time + LineManager.Line.WarnMsg + "\r\n";
lblMoveInfo.Text = LineManager.Line.GetMoveStr();
if (TrayManager.TrayErrorMsg.Equals("").Equals(false))
......@@ -561,7 +561,7 @@ namespace OnlineStore.AssemblyLine
if (move.alarmType.Equals(LineAlarmType.None).Equals(false))
{
warnMsg +=move.LastAlarmTime.ToLongTimeString()+" "+ move.WarnMsg + "\r\n";
warnMsg += move.LastAlarmTime.ToLongTimeString() + " " + move.WarnMsg + "\r\n";
}
else
{
......@@ -569,7 +569,7 @@ namespace OnlineStore.AssemblyLine
}
}
}
lblWarnMsg.Text = warnMsg;
if (!listView1.Visible)
{
......@@ -606,12 +606,12 @@ namespace OnlineStore.AssemblyLine
}
else
{
SetItemText(i, item_cid_index, "");
SetItemText(i, item_cid_index, "");
SetItemText(i, item_LastMsgTime_index, "");
SetItemText(i, item_SAlarmType_index, "");
SetItemText(i, item_BoxStr_index, "");
}
SetItemColor(i, move.runStatus,move.alarmType);
SetItemColor(i, move.runStatus, move.alarmType);
i++;
}
i++;
......@@ -668,6 +668,7 @@ namespace OnlineStore.AssemblyLine
{
chbAGV.Checked = AgvClient.CurrCancelState;
}
numTrayNum_ValueChanged(null, null);
}
private void SetItemColor(int i, LineRunStatus runStatus, LineAlarmType alarmType)
......@@ -924,11 +925,11 @@ namespace OnlineStore.AssemblyLine
foreach (TrayInfo t in tray)
{
LogUtil.info(t.ToStr());
msg += t.ToStr()+ "\r\n";
msg += t.ToStr() + "\r\n";
}
LogUtil.info("-------------------结束打印托盘信息");
msg += "-------------------结束打印托盘信息";
MessageBox.Show(msg,"托盘信息列表");
MessageBox.Show(msg, "托盘信息列表");
}
//private void btnClearTray_Click(object sender, EventArgs e)
......@@ -1092,7 +1093,7 @@ namespace OnlineStore.AssemblyLine
{
return;
}
lineBean.DisableShunt = (chbShunt.Checked);
lineBean.DisableShunt = (chbShunt.Checked);
LogUtil.info("勾选 禁用分流横移1功能:lineBean.DisableShunt =" + lineBean.DisableShunt);
}
......@@ -1212,5 +1213,81 @@ namespace OnlineStore.AssemblyLine
FrmDisableTray frm = new FrmDisableTray();
frm.ShowDialog();
}
private void numTrayNum_ValueChanged(object sender, EventArgs e)
{
try
{
int trayNum = (int)numTrayNum.Value;
if (trayNum >= 0)
{
TrayInfo tray = TrayManager.GetTrayInfo(trayNum);
lblSelTrayNum.Text = tray.ToStr();
}
}catch(Exception ex)
{
}
}
private void btnClear_Click(object sender, EventArgs e)
{
int num = (int)numTrayNum.Value;
if (num < 1)
{
MessageBox.Show("请输入大于1的托盘号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
return;
}
TrayInfo tray = TrayManager.GetTrayInfo(num);
DialogResult resut = MessageBox.Show("确定手动清空托盘【" + num + "】的信息?\r\n " + tray.ToStr() + "", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
TrayManager.ClearInstore(tray,"手动清空托盘");
TrayManager.UpdateTrayInfo(num);
TrayInfo info = TrayManager.GetTrayInfo(num);
MessageBox.Show("更新成功:\r" + info.ToStr());
LogUtil.info("界面点击手动清空托盘,清空前【" + tray.ToStr() + "】,清空后:" + info.ToStr());
}
}
private void 启用分流横移1ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (启用分流横移1ToolStripMenuItem.Text.Contains(gouStr))
{
启用分流横移1ToolStripMenuItem.Text = "启用分流横移1";
lineBean.DisableShunt = true;
}
else
{
启用分流横移1ToolStripMenuItem.Text = gouStr + "启用分流横移1";
lineBean.DisableShunt = false ;
}
LogUtil.info(Name + " 点击:" + 启用分流横移1ToolStripMenuItem.Text + ",lineBean.DisableShunt=" + lineBean.DisableShunt);
}
private void 启用分流横移2ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (启用分流横移2ToolStripMenuItem.Text.Contains(gouStr))
{
启用分流横移2ToolStripMenuItem.Text = "启用分流横移2";
lineBean.DisableShunt2 = true;
}
else
{
启用分流横移2ToolStripMenuItem.Text = gouStr + "启用分流横移2";
lineBean.DisableShunt2 = false;
}
LogUtil.info(Name + " 点击:" + 启用分流横移2ToolStripMenuItem.Text+ ",lineBean.DisableShunt2="+ lineBean.DisableShunt2);
}
}
}
......@@ -88,6 +88,10 @@
this.txtP2 = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.lblName = new System.Windows.Forms.Label();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.txtPosId = new System.Windows.Forms.TextBox();
this.btnClear = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -100,6 +104,7 @@
this.groupDetial.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panel1.SuspendLayout();
this.groupBox8.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -255,7 +260,7 @@
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Location = new System.Drawing.Point(251, 6);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(240, 467);
this.groupBox4.Size = new System.Drawing.Size(240, 469);
this.groupBox4.TabIndex = 104;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表";
......@@ -273,7 +278,7 @@
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(229, 447);
this.tableLayoutPanel2.Size = new System.Drawing.Size(229, 449);
this.tableLayoutPanel2.TabIndex = 103;
//
// groupBox3
......@@ -283,7 +288,7 @@
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(6, 6);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(240, 467);
this.groupBox3.Size = new System.Drawing.Size(240, 469);
this.groupBox3.TabIndex = 103;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表";
......@@ -301,7 +306,7 @@
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(229, 447);
this.tableLayoutPanel1.Size = new System.Drawing.Size(229, 449);
this.tableLayoutPanel1.TabIndex = 102;
//
// groupBox5
......@@ -434,7 +439,7 @@
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(274, 64);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(528, 132);
this.lblThisSta.Size = new System.Drawing.Size(528, 75);
this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
......@@ -525,14 +530,15 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(5, 54);
this.tabControl1.Location = new System.Drawing.Point(5, 53);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1323, 513);
this.tabControl1.Size = new System.Drawing.Size(1323, 515);
this.tabControl1.TabIndex = 257;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox8);
this.tabPage1.Controls.Add(this.groupBox6);
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Controls.Add(this.groupBox4);
......@@ -541,7 +547,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1315, 480);
this.tabPage1.Size = new System.Drawing.Size(1315, 485);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " IO列表 ";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -556,9 +562,9 @@
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblInstoreList);
this.groupBox6.Controls.Add(this.lblThisSta);
this.groupBox6.Location = new System.Drawing.Point(498, 156);
this.groupBox6.Location = new System.Drawing.Point(498, 155);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(808, 314);
this.groupBox6.Size = new System.Drawing.Size(808, 259);
this.groupBox6.TabIndex = 278;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息";
......@@ -567,7 +573,7 @@
//
this.chbUseTrayCheck.AutoSize = true;
this.chbUseTrayCheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseTrayCheck.Location = new System.Drawing.Point(9, 271);
this.chbUseTrayCheck.Location = new System.Drawing.Point(9, 228);
this.chbUseTrayCheck.Name = "chbUseTrayCheck";
this.chbUseTrayCheck.Size = new System.Drawing.Size(112, 24);
this.chbUseTrayCheck.TabIndex = 282;
......@@ -602,7 +608,7 @@
this.lblInstoreList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblInstoreList.ForeColor = System.Drawing.Color.Green;
this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblInstoreList.Location = new System.Drawing.Point(274, 180);
this.lblInstoreList.Location = new System.Drawing.Point(274, 137);
this.lblInstoreList.Name = "lblInstoreList";
this.lblInstoreList.Size = new System.Drawing.Size(528, 115);
this.lblInstoreList.TabIndex = 277;
......@@ -1023,6 +1029,48 @@
this.lblName.Text = "出料流水线";
this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox8
//
this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox8.Controls.Add(this.label7);
this.groupBox8.Controls.Add(this.txtPosId);
this.groupBox8.Controls.Add(this.btnClear);
this.groupBox8.Location = new System.Drawing.Point(498, 414);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(808, 63);
this.groupBox8.TabIndex = 280;
this.groupBox8.TabStop = false;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(14, 28);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(47, 17);
this.label7.TabIndex = 284;
this.label7.Text = "库位号:";
//
// txtPosId
//
this.txtPosId.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPosId.Location = new System.Drawing.Point(72, 23);
this.txtPosId.Name = "txtPosId";
this.txtPosId.Size = new System.Drawing.Size(150, 26);
this.txtPosId.TabIndex = 283;
//
// btnClear
//
this.btnClear.BackColor = System.Drawing.Color.White;
this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClear.Location = new System.Drawing.Point(233, 19);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(105, 35);
this.btnClear.TabIndex = 286;
this.btnClear.Text = "清空入库任务";
this.btnClear.UseVisualStyleBackColor = false;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// FrmMoveEquip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -1056,6 +1104,8 @@
this.groupBox2.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
this.ResumeLayout(false);
}
......@@ -1133,6 +1183,10 @@
private System.Windows.Forms.Label label8;
private System.Windows.Forms.ComboBox cmbP3Width;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtPosId;
private System.Windows.Forms.Button btnClear;
}
}
......@@ -679,6 +679,39 @@ namespace OnlineStore.AssemblyLine
}
}
}
private void btnClear_Click(object sender, EventArgs e)
{
string posId = txtPosId.Text.Trim();
if (String.IsNullOrEmpty(posId))
{
MessageBox.Show("请输入正确的库位号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
txtPosId.Focus();
return;
}
LogUtil.info("点击 " + btnClear.Text + " , 库位号[" + posId + "]");
InOutParam param = null;
List<InOutParam> paramList = new List<InOutParam>(equipBean.waitInStoreList);
foreach (InOutParam p in paramList)
{
if (p.PosId.Equals(posId))
{
param = p;
break;
}
}
if (param == null)
{
MessageBox.Show("未找到对应的任务,请输入正确的库位号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
txtPosId.Focus();
return;
}
else
{
equipBean.RemoveInStore(param, "手动清除入库任务");
txtPosId.Clear();
}
}
}
}
......
......@@ -385,7 +385,7 @@ namespace OnlineStore.DeviceLibrary
}
}
#endregion
}
}
......@@ -677,7 +677,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
internal bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
public bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
{
if (waitInStoreList.Count > 0)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!