Commit 20c16f74 LN

1.有料托盘需要入库时,若检测信号不亮,直接禁用托盘。

2.禁用托盘界面增加选项:开始处理托盘。勾选后,禁用的托盘到达出料4后,会等待托盘启用后再放行。退出界面自动退出托盘处理。
3.启用托盘会清理托盘信息,需拿走托盘上的物料。
4.有托盘被禁用时,发送报警信息到服务器。
1 个父辈 1a94036c
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmDisableTray.resx"> <EmbeddedResource Include="FrmDisableTray.resx">
<DependentUpon>FrmDisableTray.cs</DependentUpon> <DependentUpon>FrmDisableTray.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmIOMsg.resx"> <EmbeddedResource Include="FrmIOMsg.resx">
<DependentUpon>FrmIOMsg.cs</DependentUpon> <DependentUpon>FrmIOMsg.cs</DependentUpon>
......
...@@ -29,17 +29,22 @@ namespace OnlineStore.AssemblyLine ...@@ -29,17 +29,22 @@ namespace OnlineStore.AssemblyLine
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.group3 = new System.Windows.Forms.GroupBox(); this.group3 = new System.Windows.Forms.GroupBox();
this.lblPro4Warnmsg = new System.Windows.Forms.Label();
this.lblMsg = new System.Windows.Forms.Label();
this.chbProTray = new System.Windows.Forms.CheckBox();
this.lblTrayInfo = new System.Windows.Forms.Label();
this.btnrefresh = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.btnrefresh = new System.Windows.Forms.Button();
this.Column_trayNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_trayNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_DeviceName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_DeviceName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_datetime = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_datetime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_describle = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_describle = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_TrayInfo = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_TrayInfo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Del = new System.Windows.Forms.DataGridViewLinkColumn(); this.Column_Del = new System.Windows.Forms.DataGridViewLinkColumn();
this.lblTrayInfo = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.group3.SuspendLayout(); this.group3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
...@@ -49,24 +54,80 @@ namespace OnlineStore.AssemblyLine ...@@ -49,24 +54,80 @@ namespace OnlineStore.AssemblyLine
this.group3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.group3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.group3.Controls.Add(this.lblPro4Warnmsg);
this.group3.Controls.Add(this.lblMsg);
this.group3.Controls.Add(this.chbProTray);
this.group3.Controls.Add(this.lblTrayInfo); this.group3.Controls.Add(this.lblTrayInfo);
this.group3.Controls.Add(this.btnrefresh); this.group3.Controls.Add(this.btnrefresh);
this.group3.Controls.Add(this.btnClose); this.group3.Controls.Add(this.btnClose);
this.group3.Controls.Add(this.dataGridView1); this.group3.Controls.Add(this.dataGridView1);
this.group3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.group3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.group3.Location = new System.Drawing.Point(8, 7); this.group3.Location = new System.Drawing.Point(5, 5);
this.group3.Name = "group3"; this.group3.Name = "group3";
this.group3.Size = new System.Drawing.Size(827, 504); this.group3.Size = new System.Drawing.Size(900, 556);
this.group3.TabIndex = 321; this.group3.TabIndex = 321;
this.group3.TabStop = false; this.group3.TabStop = false;
this.group3.Text = "禁用托盘列表"; this.group3.Text = "禁用托盘列表";
this.group3.Enter += new System.EventHandler(this.group3_Enter);
//
// lblPro4Warnmsg
//
this.lblPro4Warnmsg.AutoSize = true;
this.lblPro4Warnmsg.Location = new System.Drawing.Point(6, 443);
this.lblPro4Warnmsg.Name = "lblPro4Warnmsg";
this.lblPro4Warnmsg.Size = new System.Drawing.Size(0, 17);
this.lblPro4Warnmsg.TabIndex = 331;
//
// lblMsg
//
this.lblMsg.AutoSize = true;
this.lblMsg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lblMsg.Location = new System.Drawing.Point(502, 454);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(387, 17);
this.lblMsg.TabIndex = 330;
this.lblMsg.Text = "勾选开始处理托盘,禁用的托盘到达出料4后,会等待托盘启用后再放行";
//
// chbProTray
//
this.chbProTray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chbProTray.AutoSize = true;
this.chbProTray.Location = new System.Drawing.Point(511, 515);
this.chbProTray.Name = "chbProTray";
this.chbProTray.Size = new System.Drawing.Size(99, 21);
this.chbProTray.TabIndex = 329;
this.chbProTray.Text = "开始处理托盘";
this.chbProTray.UseVisualStyleBackColor = true;
this.chbProTray.CheckedChanged += new System.EventHandler(this.chbProTray_CheckedChanged);
//
// lblTrayInfo
//
this.lblTrayInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblTrayInfo.Location = new System.Drawing.Point(6, 475);
this.lblTrayInfo.Name = "lblTrayInfo";
this.lblTrayInfo.Size = new System.Drawing.Size(480, 74);
this.lblTrayInfo.TabIndex = 328;
this.lblTrayInfo.Text = "label1";
//
// btnrefresh
//
this.btnrefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnrefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnrefresh.ForeColor = System.Drawing.Color.Black;
this.btnrefresh.Location = new System.Drawing.Point(643, 507);
this.btnrefresh.Name = "btnrefresh";
this.btnrefresh.Size = new System.Drawing.Size(121, 36);
this.btnrefresh.TabIndex = 327;
this.btnrefresh.Text = "刷新";
this.btnrefresh.UseVisualStyleBackColor = true;
this.btnrefresh.Click += new System.EventHandler(this.btnrefresh_Click);
// //
// btnClose // btnClose
// //
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClose.ForeColor = System.Drawing.Color.Black; this.btnClose.ForeColor = System.Drawing.Color.Black;
this.btnClose.Location = new System.Drawing.Point(673, 442); this.btnClose.Location = new System.Drawing.Point(767, 507);
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(121, 36); this.btnClose.Size = new System.Drawing.Size(121, 36);
this.btnClose.TabIndex = 326; this.btnClose.TabIndex = 326;
...@@ -89,30 +150,17 @@ namespace OnlineStore.AssemblyLine ...@@ -89,30 +150,17 @@ namespace OnlineStore.AssemblyLine
this.Column_describle, this.Column_describle,
this.Column_TrayInfo, this.Column_TrayInfo,
this.Column_Del}); this.Column_Del});
this.dataGridView1.Location = new System.Drawing.Point(10, 22); this.dataGridView1.Location = new System.Drawing.Point(6, 22);
this.dataGridView1.MultiSelect = false; this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidth = 5; this.dataGridView1.RowHeadersWidth = 5;
this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(803, 400); this.dataGridView1.Size = new System.Drawing.Size(887, 414);
this.dataGridView1.TabIndex = 323; this.dataGridView1.TabIndex = 323;
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged); this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
// //
// btnrefresh
//
this.btnrefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnrefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnrefresh.ForeColor = System.Drawing.Color.Black;
this.btnrefresh.Location = new System.Drawing.Point(546, 442);
this.btnrefresh.Name = "btnrefresh";
this.btnrefresh.Size = new System.Drawing.Size(121, 36);
this.btnrefresh.TabIndex = 327;
this.btnrefresh.Text = "刷新";
this.btnrefresh.UseVisualStyleBackColor = true;
this.btnrefresh.Click += new System.EventHandler(this.btnrefresh_Click);
//
// Column_trayNum // Column_trayNum
// //
this.Column_trayNum.HeaderText = "托盘编号"; this.Column_trayNum.HeaderText = "托盘编号";
...@@ -128,19 +176,19 @@ namespace OnlineStore.AssemblyLine ...@@ -128,19 +176,19 @@ namespace OnlineStore.AssemblyLine
// //
this.Column_datetime.HeaderText = "禁用时间"; this.Column_datetime.HeaderText = "禁用时间";
this.Column_datetime.Name = "Column_datetime"; this.Column_datetime.Name = "Column_datetime";
this.Column_datetime.Width = 140; this.Column_datetime.Width = 150;
// //
// Column_describle // Column_describle
// //
this.Column_describle.HeaderText = "禁用原因"; this.Column_describle.HeaderText = "禁用原因";
this.Column_describle.Name = "Column_describle"; this.Column_describle.Name = "Column_describle";
this.Column_describle.Width = 200; this.Column_describle.Width = 220;
// //
// Column_TrayInfo // Column_TrayInfo
// //
this.Column_TrayInfo.HeaderText = "料盘信息"; this.Column_TrayInfo.HeaderText = "料盘信息";
this.Column_TrayInfo.Name = "Column_TrayInfo"; this.Column_TrayInfo.Name = "Column_TrayInfo";
this.Column_TrayInfo.Width = 200; this.Column_TrayInfo.Width = 220;
// //
// Column_Del // Column_Del
// //
...@@ -153,24 +201,23 @@ namespace OnlineStore.AssemblyLine ...@@ -153,24 +201,23 @@ namespace OnlineStore.AssemblyLine
this.Column_Del.UseColumnTextForLinkValue = true; this.Column_Del.UseColumnTextForLinkValue = true;
this.Column_Del.Width = 70; this.Column_Del.Width = 70;
// //
// lblTrayInfo // timer1
// //
this.lblTrayInfo.Location = new System.Drawing.Point(10, 429); this.timer1.Interval = 1000;
this.lblTrayInfo.Name = "lblTrayInfo"; this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
this.lblTrayInfo.Size = new System.Drawing.Size(530, 63);
this.lblTrayInfo.TabIndex = 328;
this.lblTrayInfo.Text = "label1";
// //
// FrmDisableTray // FrmDisableTray
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(843, 521); this.ClientSize = new System.Drawing.Size(910, 565);
this.Controls.Add(this.group3); this.Controls.Add(this.group3);
this.Name = "FrmDisableTray"; this.Name = "FrmDisableTray";
this.Text = "托盘禁用信息"; this.Text = "托盘禁用处理";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmDisableTray_FormClosed);
this.Load += new System.EventHandler(this.FrmDisableTray_Load); this.Load += new System.EventHandler(this.FrmDisableTray_Load);
this.group3.ResumeLayout(false); this.group3.ResumeLayout(false);
this.group3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
...@@ -182,12 +229,16 @@ namespace OnlineStore.AssemblyLine ...@@ -182,12 +229,16 @@ namespace OnlineStore.AssemblyLine
private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnrefresh; private System.Windows.Forms.Button btnrefresh;
private System.Windows.Forms.Label lblTrayInfo;
private System.Windows.Forms.CheckBox chbProTray;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_trayNum; private System.Windows.Forms.DataGridViewTextBoxColumn Column_trayNum;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_DeviceName; private System.Windows.Forms.DataGridViewTextBoxColumn Column_DeviceName;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_datetime; private System.Windows.Forms.DataGridViewTextBoxColumn Column_datetime;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_describle; private System.Windows.Forms.DataGridViewTextBoxColumn Column_describle;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_TrayInfo; private System.Windows.Forms.DataGridViewTextBoxColumn Column_TrayInfo;
private System.Windows.Forms.DataGridViewLinkColumn Column_Del; private System.Windows.Forms.DataGridViewLinkColumn Column_Del;
private System.Windows.Forms.Label lblTrayInfo; private System.Windows.Forms.Label lblMsg;
private System.Windows.Forms.Label lblPro4Warnmsg;
private System.Windows.Forms.Timer timer1;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,12 +21,15 @@ namespace OnlineStore.AssemblyLine ...@@ -21,12 +21,15 @@ namespace OnlineStore.AssemblyLine
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
timer1.Stop();
this.Close(); this.Close();
} }
private void FrmDisableTray_Load(object sender, EventArgs e) private void FrmDisableTray_Load(object sender, EventArgs e)
{ {
LoadList(); LoadList();
timer1.Start();
lblMsg.Text = "勾选开始处理托盘,禁用的托盘到达出料4后,会等待托盘启用后再放行\r\n关闭当前界面后,自动退出托盘处理";
} }
private void LoadList() private void LoadList()
...@@ -78,15 +81,22 @@ namespace OnlineStore.AssemblyLine ...@@ -78,15 +81,22 @@ namespace OnlineStore.AssemblyLine
if (e.RowIndex != -1 && e.ColumnIndex >= 0) if (e.RowIndex != -1 && e.ColumnIndex >= 0)
{ {
string name = this.dataGridView1.Columns[e.ColumnIndex].Name; string name = this.dataGridView1.Columns[e.ColumnIndex].Name;
int num = Convert.ToInt32( this.dataGridView1.Rows[e.RowIndex].Cells[Column_trayNum.Index].Value); int num = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[Column_trayNum.Index].Value);
int rowIndex = e.RowIndex; int rowIndex = e.RowIndex;
if (name.Equals(this.Column_Del.Name)) if (name.Equals(this.Column_Del.Name))
{ {
DialogResult dialogResult = MessageBox.Show("确定启用托盘【"+num+"】?", "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); TrayInfo tray = TrayManager.GetTrayInfo(num);
string msg = "启用托盘将清空托盘信息,确定启用托盘【" + num + "】?";
DialogResult dialogResult = MessageBox.Show(msg, "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dialogResult.Equals(DialogResult.OK)) if (dialogResult.Equals(DialogResult.OK))
{ {
LogUtil.info("用户手动启用托盘【" + num + "】"); LogUtil.info("用户手动启用托盘【" + num + "】" + tray.ToStr());
TrayDisableManager.RemoveDisable(num); if (tray.IsFull && tray.InOrOutStore.Equals(1))
{
TrayManager.ClearInstore(tray,"清理禁用托盘");
}
TrayDisableManager.RemoveDisable(num);
this.dataGridView1.Rows.RemoveAt(rowIndex); this.dataGridView1.Rows.RemoveAt(rowIndex);
lblTrayInfo.Text = ""; lblTrayInfo.Text = "";
...@@ -106,5 +116,44 @@ namespace OnlineStore.AssemblyLine ...@@ -106,5 +116,44 @@ namespace OnlineStore.AssemblyLine
lblTrayInfo.Text = tray.ToStr(); lblTrayInfo.Text = tray.ToStr();
} }
} }
private void chbProTray_CheckedChanged(object sender, EventArgs e)
{
TrayDisableManager.ProcessTray = chbProTray.Checked;
LogUtil.info("用户更改" + chbProTray.Text + "=" + chbProTray.Checked);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
try
{
ProvidingEquip pro4 = LineManager.Line.ProvidingEquipMap[204];
if(pro4.WarnMsg.Contains( TrayDisableManager.ProWarnMsg))
{
lblPro4Warnmsg.Text = pro4.WarnMsg;
}else
{
lblPro4Warnmsg.Text = "";
}
}catch (Exception ex)
{
LogUtil.error("FrmDisableTray timer1_Tick error:" + ex.ToString());
}
}
}
private void group3_Enter(object sender, EventArgs e)
{
}
private void FrmDisableTray_FormClosed(object sender, FormClosedEventArgs e)
{
TrayDisableManager.ProcessTray = false;
LogUtil.info("退出禁用托盘处理界面," + chbProTray.Text + "=false" );
}
} }
} }
...@@ -135,4 +135,25 @@ ...@@ -135,4 +135,25 @@
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_trayNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_DeviceName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_datetime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_describle.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_TrayInfo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file \ No newline at end of file
20200225 20200226
环形线更新文件 20210226-AssemblyLine-更新,能重启时帮忙更新下。
修改内容:
1.有料托盘需要入库时,若检测信号不亮,直接禁用托盘。
2.禁用托盘界面增加选项:开始处理托盘。勾选后,禁用的托盘到达出料4后,会等待托盘启用后再放行。退出界面自动退出托盘处理。
3.启用托盘会清理托盘信息,需拿走托盘上的物料。
4.有托盘被禁用时,发送报警信息到服务器。
20200225
1.托盘增加禁用功能,禁用的托盘可在(设备调试->查看禁用托盘)界面手动启用。 1.托盘增加禁用功能,禁用的托盘可在(设备调试->查看禁用托盘)界面手动启用。
2.进仓界面增加启用托盘检测的勾选配置。 2.进仓界面增加启用托盘检测的勾选配置。
3.进仓启用托盘检测功能后,若拦截到入库托盘,需要等待托盘检测信号亮。拦截空托盘出库时,如果托盘检测信号亮,直接禁用托盘。 3.进仓启用托盘检测功能后,若拦截到入库托盘,需要等待托盘检测信号亮。拦截空托盘出库时,如果托盘检测信号亮,直接禁用托盘。
......
...@@ -1089,9 +1089,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1089,9 +1089,13 @@ namespace OnlineStore.DeviceLibrary
alarmList.Add(new AlarmMsg(Name, "line_" + alarmType, WarnMsg)); alarmList.Add(new AlarmMsg(Name, "line_" + alarmType, WarnMsg));
} }
int num = TrayDisableManager.GetDisableList().Count; int num = TrayDisableManager.GetDisableList().Count;
if (num > 5) if (num >= 5)
{ {
alarmList.Add(new AlarmMsg(Name, "line_Tray" , "已有["+num+"]个托盘被禁用,请尽快处理")); alarmList.Add(new AlarmMsg(Name, "line_Tray", "已有[" + num + "]个托盘被禁用,请尽快处理"));
}
else if (num >= 1)
{
alarmList.Add(new AlarmMsg(Name, "line_Tray", "已有[" + num + "]个托盘被禁用,请尽快处理"));
} }
foreach (EquipBase equip in AllEquipMap.Values) foreach (EquipBase equip in AllEquipMap.Values)
{ {
......
...@@ -498,8 +498,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -498,8 +498,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals(""))) if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
{ {
if (LineManager.useTrayCheck.Contains(DeviceID) && IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
LogInfo(" 入库需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮");
return false;
}
//判断是否验证成功,如果验证失败,不入库 //判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, cc.PosId)) else if (LineServer.RightInPosId(DeviceID, cc.PosId))
{ {
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg);
return true; return true;
...@@ -648,7 +654,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -648,7 +654,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
private bool RemoveInStore(InOutParam param) internal bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
{ {
if (waitInStoreList.Count > 0) if (waitInStoreList.Count > 0)
{ {
...@@ -669,7 +675,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -669,7 +675,7 @@ namespace OnlineStore.DeviceLibrary
if (reIndex >= 0) if (reIndex >= 0)
{ {
waitInStoreList.RemoveAt(reIndex); waitInStoreList.RemoveAt(reIndex);
LogInfo("*******料盘已移走,清理入库任务:【" + param.ToStr() + "】"); LogInfo("*******"+ logName + ",清理入库任务:【" + param.ToStr() + "】");
return true; return true;
} }
} }
...@@ -833,16 +839,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -833,16 +839,17 @@ namespace OnlineStore.DeviceLibrary
if (isNeed) if (isNeed)
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
if (isFull && LineManager.useTrayCheck.Contains(DeviceID)) //if (isFull && LineManager.useTrayCheck.Contains(DeviceID))
{ //{
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200,等待料盘检测信号"); // CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200,等待料盘检测信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck, IO_VALUE.HIGH)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck, IO_VALUE.HIGH));
} //}
else //else
{ //{
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200"); // CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200");
} //}
} }
else else
{ {
......
...@@ -307,19 +307,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,19 +307,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)"); LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
} }
// else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
// {
// SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_Stop2Down);
// CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 再次检测料盘信号");
// //CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待" + TrayManager.SwTrayWaitTime + ",再次检测料盘信号");
//// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
// if (Config.SidesWayNum.Equals(4))
// {
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(400));
// }
// }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_Stop2Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_Stop2Down))
{ {
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定StopCylinder_Check2=1"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定StopCylinder_Check2=1");
...@@ -365,24 +353,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -365,24 +353,16 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
// SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown); if (this.Config.SidesWayNum.Equals(4) && TrayDisableManager.ProcessTray && TrayDisableManager.DisableTray(currTrayNum))
CheckLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 托盘 【" + currTrayNum + "】直接放行,判断顶升需要下降或上升");
if (Config.SidesWayNum <= 0)
{ {
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_10_WaitProDisableTray);
LogInfo(Name + "拦截禁用托盘【"+currTrayNum+"】,等待托盘启用后再放行");
} }
else if (Config.SidesWayNum.Equals(4))
else
{ {
CylinderMove(null, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP); MO_14_TopDown();
if (LineManager.Line.SwCanUpMove(1))
{
LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
}
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
} }
} }
} }
...@@ -425,6 +405,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -425,6 +405,24 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 不需要出出料,直接放行 #region 不需要出出料,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_10_WaitProDisableTray))
{
bool isOk = (!TrayDisableManager.ProcessTray) || (!TrayDisableManager.DisableTray(currTrayNum));
if (isOk)
{
ClearTimeoutAlarm(TrayDisableManager.ProWarnMsg);
MO_14_TopDown();
}
else if(SecondMoveInfo.IsTimeOut(30))
{
WarnMsg = Name + TrayDisableManager.ProWarnMsg+ "[" + currTrayNum + "], 请处理并启用托盘,已超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
}
else
{
WarnMsg = Name + TrayDisableManager.ProWarnMsg + "[" + currTrayNum + "], 请处理并启用托盘";
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopDown)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopDown))
{ {
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
...@@ -485,7 +483,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -485,7 +483,27 @@ namespace OnlineStore.DeviceLibrary
} }
#endregion #endregion
} }
private void MO_14_TopDown()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
CheckLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 托盘 【" + currTrayNum + "】直接放行,判断顶升需要下降或上升");
if (Config.SidesWayNum <= 0)
{
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
else if (Config.SidesWayNum.Equals(4))
{
CylinderMove(null, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
if (LineManager.Line.SwCanUpMove(1))
{
LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
}
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
}
#endregion #endregion
#region 料盘移栽处理 #region 料盘移栽处理
......
...@@ -259,9 +259,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -259,9 +259,9 @@ namespace OnlineStore.DeviceLibrary
public static List<int> useTrayCheck = new List<int>(); public static List<int> useTrayCheck = new List<int>();
public static void LoadTrayCheck() public static void LoadTrayCheck()
{ {
string config = ConfigAppSettings.GetValue(Setting_Init.UseTrayCheck); string config = ConfigAppSettings.GetValue(Setting_Init.UseTrayCheck);
string[] array = config.Split(','); string[] array = config.Split(',');
foreach(string st in array) foreach(string st in array)
{ {
try try
......
...@@ -10,7 +10,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -10,7 +10,8 @@ namespace OnlineStore.DeviceLibrary
{ {
public class TrayDisableManager public class TrayDisableManager
{ {
public static bool ProcessTray = false;
public static string ProWarnMsg = "拦截到禁用托盘";
/// <summary> /// <summary>
/// 托盘集合,key=托盘编号,value=托盘详细信息 /// 托盘集合,key=托盘编号,value=托盘详细信息
/// </summary> /// </summary>
...@@ -50,7 +51,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,7 +51,9 @@ namespace OnlineStore.DeviceLibrary
} }
public static void RemoveDisable(int trayNum) public static void RemoveDisable(int trayNum)
{ {
TrayManager.UpdateTrayInfo(trayNum);
bool result = TrayDisableMap.TryRemove(trayNum, out TrayDisableInfo removeInfo); bool result = TrayDisableMap.TryRemove(trayNum, out TrayDisableInfo removeInfo);
if (result && removeInfo != null) if (result && removeInfo != null)
{ {
......
...@@ -176,6 +176,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -176,6 +176,24 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>(); TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
} }
public static void ClearInstore(TrayInfo tray,string msg = "手动清空托盘")
{
if (tray == null)
{
return;
}
//如果是入库托盘,需要清理入库消息
if (tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false) && (!tray.InoutPar.PosId.Equals("")))
{
int storeId = tray.InoutPar.GetStoreId();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
{
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
moveEquip.RemoveInStore(tray.InoutPar, msg);
}
}
}
#region 横移状态缓存 #region 横移状态缓存
internal static bool LineCanMoveSW(int swNum) internal static bool LineCanMoveSW(int swNum)
{ {
......
...@@ -305,6 +305,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -305,6 +305,11 @@ namespace OnlineStore.DeviceLibrary
/// 等待StoreMove移走料盘开始放托盘通过 /// 等待StoreMove移走料盘开始放托盘通过
/// </summary> /// </summary>
MIO_09_WaitLetFixtureGo=3089, MIO_09_WaitLetFixtureGo=3089,
/// <summary>
/// 等待禁用托盘被启用
/// </summary>
MIO_10_WaitProDisableTray=3090,
#endregion #endregion
#region 移栽装置出库处理 3100-3200 #region 移栽装置出库处理 3100-3200
...@@ -391,7 +396,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -391,7 +396,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 移载(流水线)装置出库处理,上下气缸1上升 /// 移载(流水线)装置出库处理,上下气缸1上升
/// </summary> /// </summary>
MO_60_CylinderUp , MO_60_CylinderUp,
#region 入料模块,紧急出料移栽处理 #region 入料模块,紧急出料移栽处理
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!