Commit 7874d5c5 LN

1.脆盘料号配置增加界面,修改后实时生效。

2.预扫码扫码失败照片保存到文件夹。
1 个父辈 628cea4c
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<add key="RfidServer_Port" value="12001" /> <add key="RfidServer_Port" value="12001" />
<add key ="TrayHeightList" value ="8;12;16;20;24;28;36;48"/> <add key ="TrayHeightList" value ="8;12;16;20;24;28;36;48"/>
<!--夹爪夹紧时忽略的料号列表,多个用#分割--> <!--夹爪夹紧时忽略的料号列表,多个用#分割-->
<add key ="PNList" value ="3402021720#"/> <add key ="PNList" value ="3402021720#3402021721#3402021100#3402021101#3402021102#3402021103#3402021104#3402021105#3402021106#3402021107#3402021108#3402021109#3402021112#3402021122"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -106,6 +106,12 @@ ...@@ -106,6 +106,12 @@
<Compile Include="FrmLineIO.Designer.cs"> <Compile Include="FrmLineIO.Designer.cs">
<DependentUpon>FrmLineIO.cs</DependentUpon> <DependentUpon>FrmLineIO.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmCrispTray.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmCrispTray.Designer.cs">
<DependentUpon>FrmCrispTray.cs</DependentUpon>
</Compile>
<Compile Include="FrmRFIPEdit.cs"> <Compile Include="FrmRFIPEdit.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -184,6 +190,9 @@ ...@@ -184,6 +190,9 @@
<EmbeddedResource Include="FrmLineIO.resx"> <EmbeddedResource Include="FrmLineIO.resx">
<DependentUpon>FrmLineIO.cs</DependentUpon> <DependentUpon>FrmLineIO.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmCrispTray.resx">
<DependentUpon>FrmCrispTray.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmRFIPEdit.resx"> <EmbeddedResource Include="FrmRFIPEdit.resx">
<DependentUpon>FrmRFIPEdit.cs</DependentUpon> <DependentUpon>FrmRFIPEdit.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
namespace OnlineStore.AssemblyLine
{
partial class FrmCrispTray
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmCrispTray));
this.btnBack = new System.Windows.Forms.Button();
this.txtPn = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btnNew = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.listView1 = new System.Windows.Forms.ListView();
this.btnSave = new System.Windows.Forms.Button();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnBack
//
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(459, 268);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(110, 45);
this.btnBack.TabIndex = 274;
this.btnBack.Text = "退出";
this.btnBack.UseVisualStyleBackColor = false;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// txtPn
//
this.txtPn.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPn.Location = new System.Drawing.Point(61, 277);
this.txtPn.Name = "txtPn";
this.txtPn.Size = new System.Drawing.Size(145, 26);
this.txtPn.TabIndex = 276;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label2.Location = new System.Drawing.Point(13, 280);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(37, 20);
this.label2.TabIndex = 278;
this.label2.Text = "料号";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnNew
//
this.btnNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNew.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNew.Location = new System.Drawing.Point(217, 268);
this.btnNew.Name = "btnNew";
this.btnNew.Size = new System.Drawing.Size(110, 45);
this.btnNew.TabIndex = 281;
this.btnNew.Text = "新增";
this.btnNew.UseVisualStyleBackColor = false;
this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
//
// groupBox2
//
this.groupBox2.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.groupBox2.Controls.Add(this.listView1);
this.groupBox2.Controls.Add(this.btnSave);
this.groupBox2.Controls.Add(this.btnNew);
this.groupBox2.Controls.Add(this.txtPn);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.btnBack);
this.groupBox2.Location = new System.Drawing.Point(5, 5);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(577, 323);
this.groupBox2.TabIndex = 291;
this.groupBox2.TabStop = false;
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(7, 20);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(564, 231);
this.listView1.TabIndex = 286;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.SmallIcon;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// btnSave
//
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(338, 268);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(110, 45);
this.btnSave.TabIndex = 285;
this.btnSave.Text = "删除";
this.btnSave.UseVisualStyleBackColor = false;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// FrmCrispTray
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(589, 337);
this.Controls.Add(this.groupBox2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmCrispTray";
this.Text = "脆盘料号配置";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmRFIPEdit_FormClosed);
this.Load += new System.EventHandler(this.FrmCrispTray_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnBack;
private System.Windows.Forms.TextBox txtPn;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnNew;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.ListView listView1;
}
}
\ No newline at end of file \ No newline at end of file

using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.AssemblyLine
{
internal partial class FrmCrispTray : FrmBase
{
internal FrmCrispTray()
{
InitializeComponent();
}
private Dictionary<string, string> rfMap = new Dictionary<string, string>();
private void FrmCrispTray_Load(object sender, EventArgs e)
{
LoadList( );
}
private void LoadList( )
{
List<string> list = LineManager.GetPnList();
listView1.Items.Clear();
foreach (string str in list)
{
ListViewItem item = new ListViewItem();
item.Text = str;
listView1.Items.Add(item);
}
}
private void btnBack_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void btnNew_Click(object sender, EventArgs e)
{
string text = txtPn.Text.Trim();
if (String.IsNullOrEmpty(text))
{
MessageBox.Show("请输入正确的Pn号");
return;
}
LineManager.AddPN(text);
LoadList();
}
private void btnSave_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems != null)
{
string test = listView1.SelectedItems[0].Text;
DialogResult result = MessageBox.Show( "确定删除:" + test, "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (result.Equals(DialogResult.OK))
{
LineManager.RemovePN(test);
LoadList();
}
}
}
private void FrmRFIPEdit_FormClosed(object sender, FormClosedEventArgs e)
{
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.SelectedItems != null)
{
string test = listView1.FocusedItem.Text;
}
}
}
}
...@@ -84,6 +84,8 @@ ...@@ -84,6 +84,8 @@
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.iO模块状态ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.iO模块状态ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
...@@ -628,7 +630,9 @@ ...@@ -628,7 +630,9 @@
this.二维码学习ToolStripMenuItem, this.二维码学习ToolStripMenuItem,
this.toolStripSeparator7, this.toolStripSeparator7,
this.托盘初始化ToolStripMenuItem, this.托盘初始化ToolStripMenuItem,
this.toolStripSeparator16,
this.toolStripSeparator9, this.toolStripSeparator9,
this.toolStripMenuItem3,
this.toolStripMenuItem2, this.toolStripMenuItem2,
this.toolStripSeparator13, this.toolStripSeparator13,
this.iO模块状态ToolStripMenuItem, this.iO模块状态ToolStripMenuItem,
...@@ -671,6 +675,18 @@ ...@@ -671,6 +675,18 @@
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator9.Visible = false; this.toolStripSeparator9.Visible = false;
// //
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "脆盘料号配置";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator16
//
this.toolStripSeparator16.Name = "toolStripSeparator16";
this.toolStripSeparator16.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem2 // toolStripMenuItem2
// //
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
...@@ -1050,6 +1066,8 @@ ...@@ -1050,6 +1066,8 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox chbTrayTest; private System.Windows.Forms.CheckBox chbTrayTest;
private System.Windows.Forms.CheckBox chbDisGetWare; private System.Windows.Forms.CheckBox chbDisGetWare;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
} }
} }
...@@ -1130,5 +1130,18 @@ namespace OnlineStore.AssemblyLine ...@@ -1130,5 +1130,18 @@ namespace OnlineStore.AssemblyLine
{ {
} }
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
try
{
FrmCrispTray tray = new FrmCrispTray();
tray.ShowDialog();
}
catch (Exception ex)
{
LogUtil.error("FrmCrispTray 出错:" + ex.ToString());
}
}
} }
} }
20200426 20200428
1.脆盘料号配置增加界面,修改后实时生效。
2.预扫码扫码失败照片保存到文件夹。
3.紧急料直接放入NG箱
20200426
1,出料机构的料架rfid上传到环形线。 1,出料机构的料架rfid上传到环形线。
2,环形线增加夹爪忽略的料号配置,此类料盘夹爪不检测是否有料 2,环形线增加夹爪忽略的料号配置,此类料盘夹爪不检测是否有料
......
...@@ -128,7 +128,8 @@ namespace OnlineStore.Common ...@@ -128,7 +128,8 @@ namespace OnlineStore.Common
{ {
try try
{ {
if (key.Equals("") || value.Equals("")) if (key.Equals(""))
//if (key.Equals("") || value.Equals(""))
{ {
return; return;
} }
......
...@@ -377,7 +377,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -377,7 +377,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_23_CylinderTighten); MoveInfo.NextMoveStep(LineMoveStep.FI_23_CylinderTighten);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧");
ClampJwa.Push(MoveInfo,true,lastcode); ClampJwa.Push(MoveInfo,true,LastCodeList.ToArray());
} }
else if (MoveInfo.IsStep(LineMoveStep.FI_23_CylinderTighten)) else if (MoveInfo.IsStep(LineMoveStep.FI_23_CylinderTighten))
{ {
...@@ -392,7 +392,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -392,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CheckTray); MoveInfo.NextMoveStep(LineMoveStep.FI_25_CheckTray);
MoveInfo.TimeOutSeconds = 5; MoveInfo.TimeOutSeconds = 5;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
if (LineManager.NeedWaitHassReel(lastcode)) if (LineManager.NeedWaitHassReel(LastCodeList.ToArray()))
{ {
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW 且夹爪有料"); InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW 且夹爪有料");
MoveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel()); MoveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
......
...@@ -302,17 +302,67 @@ namespace OnlineStore.DeviceLibrary ...@@ -302,17 +302,67 @@ namespace OnlineStore.DeviceLibrary
} }
return PnList; return PnList;
} }
public static void UpdatePnList()
public static bool NeedWaitHassReel(string code) {
if (PnList == null)
{
return;
}
string str = "";
foreach(string obj in PnList)
{
str += obj + "#";
}
ConfigAppSettings.SaveValue(Setting_Init.PNList, str);
LogUtil.info("更改脆盘料号集合:" + str);
}
public static void RemovePN(string pn)
{
if (PnList.Contains(pn))
{
PnList.Remove(pn);
UpdatePnList();
}
}
public static void AddPN(string pn)
{
if (!PnList.Contains(pn))
{
PnList.Add (pn);
UpdatePnList();
}
}
public static bool NeedWaitHassReel(params string[] codes)
{ {
List<string> list = GetPnList(); try
foreach(string pn in list)
{ {
if (code.Contains(pn)) List<string> list = GetPnList();
foreach (string code in codes)
{ {
return false; string[] array = code.Split('*');
if (array.Length >= 5)
{
string codePn = array[1];
foreach (string pn in list)
{
if (codePn.Equals(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code+"]料号["+ pn + "]是脆盘");
return false;
}
else if (codePn.StartsWith(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code + "]料号[" + pn + "]认为是脆盘");
return false;
}
}
}
} }
} }
catch (Exception ex)
{
LogUtil.error("NeedWaitHassReel出错:" + ex.ToString());
}
return true; return true;
} }
} }
......
...@@ -48,8 +48,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -48,8 +48,15 @@ namespace OnlineStore.DeviceLibrary
rmaxis.ClosePort(); rmaxis.ClosePort();
} }
} }
public void Push(LineMoveInfo moveInfo , bool checkHasReel , string[] code )
public void Push(LineMoveInfo moveInfo = null, bool checkHasReel = true, string code = "") {
ClampPush(moveInfo, checkHasReel, code);
}
public void Push(LineMoveInfo moveInfo = null, bool checkHasReel = true, string code="")
{
ClampPush(moveInfo, checkHasReel, code);
}
public void ClampPush(LineMoveInfo moveInfo, bool checkHasReel, params string[] code)
{ {
if (rmaxis != null && rmaxis.IsPortOpen) if (rmaxis != null && rmaxis.IsPortOpen)
{ {
......
...@@ -102,6 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,6 +102,7 @@ namespace OnlineStore.DeviceLibrary
public static List<string> CameraScan(List<string> cameraList, string deviceName, bool findRightCodeBreak = false, int timeOut = 1500) public static List<string> CameraScan(List<string> cameraList, string deviceName, bool findRightCodeBreak = false, int timeOut = 1500)
{ {
bool isPreScan = deviceName.EndsWith("预扫码"); bool isPreScan = deviceName.EndsWith("预扫码");
isPreScan = false;
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
if (cameraList == null || cameraList.Count <= 0) if (cameraList == null || cameraList.Count <= 0)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!