Commit 54093547 LN

屏蔽:料号未配置NG功能

1 个父辈 876e97c3
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
<add key ="CounParamConfig" value ="\XRAY\countParam.csv"/> <add key ="CounParamConfig" value ="\XRAY\countParam.csv"/>
<add key ="DataPath" value ="\data\DB.db3"/> <add key ="DataPath" value ="\data\DB.db3"/>
<add key ="ResultMinCount" value ="100"/> <add key ="ResultMinCount" value ="100"/>
<add key ="ComPath_Config" value ="\XRAY\pnDetailedList.csv"/>
<add key ="LabelWaitMS" value ="1000"/>
</appSettings> </appSettings>
<log4net> <log4net>
......
...@@ -123,6 +123,12 @@ ...@@ -123,6 +123,12 @@
<Compile Include="FrmAnalyze.Designer.cs"> <Compile Include="FrmAnalyze.Designer.cs">
<DependentUpon>FrmAnalyze.cs</DependentUpon> <DependentUpon>FrmAnalyze.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmComponentList.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmComponentList.Designer.cs">
<DependentUpon>FrmComponentList.cs</DependentUpon>
</Compile>
<Compile Include="FrmLearning.cs"> <Compile Include="FrmLearning.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -192,6 +198,9 @@ ...@@ -192,6 +198,9 @@
<EmbeddedResource Include="FrmAnalyze.resx"> <EmbeddedResource Include="FrmAnalyze.resx">
<DependentUpon>FrmAnalyze.cs</DependentUpon> <DependentUpon>FrmAnalyze.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmComponentList.resx">
<DependentUpon>FrmComponentList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmLearning.resx"> <EmbeddedResource Include="FrmLearning.resx">
<DependentUpon>FrmLearning.cs</DependentUpon> <DependentUpon>FrmLearning.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
namespace OnlineStore.AutoCountClient
{
internal partial class FrmComponentList : FrmBase
{
public static FrmComponentList instance = new FrmComponentList();
private FrmComponentList()
{
InitializeComponent();
}
private void FrmPointType_Load(object sender, EventArgs e)
{
}
private DataGridViewRow SetRowInfo(DataGridViewRow view, ComponetInfo com)
{
if (view == null)
{
view = new DataGridViewRow();
view.CreateCells(dgvList);
}
view.Cells[Column_PN.Index].Value = com.PartNum.ToString();
view.Cells[this.Column_Name.Index].Value = com.ProductName.ToString();
view.Cells[Column_F.Index].Value = com.Encapsulations.ToString();
view.Cells[this.Column_Des.Index].Value = com.Describe.ToString();
return view;
}
private void btnSave_Click(object sender, EventArgs e)
{
////if (groupInfo.Text.StartsWith("新增"))
////{
//// //AddCom();
////}
////else
//{
// if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0)
// {
// int rowIndex = dgvList.SelectedRows[0].Index;
// DataGridViewRow row = dgvList.Rows[rowIndex];
// ComponetInfo obj = getRowPointInfo(row);
// if (obj == null)
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SelectC,"请选择元器件!"));
// return;
// }
// if (cmbPositionNumList.SelectedIndex < 0)
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SelectCPosition,"请选择元器件位置!"));
// cmbPositionNumList.Focus();
// return;
// }
// TSAVPosition position = (TSAVPosition)cmbPositionNumList.SelectedItem;
// obj.ComponentName = FormUtil.getValue(txtName);
// obj.ComponentDes = FormUtil.getValue(txtDes);
// obj.ComCount = FormUtil.GetIntValue(txtCount);
// obj.Notes = FormUtil.getValue(txtNotes);
// obj.PartNum = FormUtil.getValue(txtPartNum);
// obj.PositionNum = position.PositionNum;
// if (obj.ComponentName.Equals(""))
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComName,"请输入元器件名称!"));
// txtName.Focus();
// return;
// }
// //if (obj.PositionNum.Equals(""))
// //{
// // MessageBox.Show("请输入元器件所在位置!");
// // this.txtPosition.Focus();
// // return;
// //}
// if (obj.ComCount<=0)
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComNum,"请输入元器件数量!"));
// txtCount.Focus();
// return;
// }
// CSVReaderBomManager.SaveComponet(cmbList.Text, obj);
// //ComponentManager.Update(obj);
// SetRowInfo(dgvList.Rows[rowIndex], obj);
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ComSaveOk,"元器件【{0}】保存成功!", obj.PartNum + "-" + obj.ComponentName ));
// groupInfo.Text = ResourceCulture.GetString(ResourceCulture.ComInfo,"元器件【{0}】的基本信息",obj.PartNum + "-" + obj.ComponentName);
// }
//}
}
private void btnDel_Click(object sender, EventArgs e)
{
if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0)
{
int rowIndex = dgvList.SelectedRows[0].Index;
DeleteCom(rowIndex);
}
}
private ComponetInfo getRowPointInfo(DataGridViewRow row)
{
ComponetInfo point = new ComponetInfo();
try
{
if (row.Cells[Column_PN.Name].Value == null)
{
return null;
}
point.PartNum = row.Cells[this.Column_PN.Name].Value.ToString();
point.Encapsulations = row.Cells[this.Column_F.Name].Value.ToString();
point.ProductName = row.Cells[this.Column_Name.Name].Value.ToString();
point.Describe = row.Cells[this.Column_Des.Name].Value.ToString();
}
catch (Exception ex)
{
LogUtil.error( "保存数据出错:" + ex.ToString());
return null;
}
return point;
}
private void showDetail(int rowIndex)
{
DataGridViewRow row = dgvList.Rows[rowIndex];
ComponetInfo obj = getRowPointInfo(row);
if (obj == null)
{
MessageBox.Show( "请选择元器件!" );
return;
}
txtPartNum.Tag = obj;
txtName.Text = obj.ProductName;
txtDes.Text = obj.Describe;
txtFengzhuang.Text = obj.Encapsulations.ToString();
txtPartNum.Text = obj.PartNum;
int index = -1;
groupInfo.Text = "元器件【"+ obj.PartNum + "】的基本信息";
}
private void DeleteCom(int rowIndex)
{
DataGridViewRow row = dgvList.Rows[rowIndex];
ComponetInfo obj = getRowPointInfo(row);
if (MessageBox.Show(
"确认要删除元器件【" + obj.PartNum + "】吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
{
return;
}
else
{
CSVBomManager.RemoveCom(obj);
this.dgvList.Rows.RemoveAt(rowIndex);
MessageBox.Show("元器件【" + obj.PartNum + "】删除成功!", "提示");
}
}
private void btnBack_Click(object sender, EventArgs e)
{
//this.Close();
this.Visible = false;
//FrmMenu.frmMain.Visible = true;
}
private void dgvList_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1 && e.ColumnIndex >= 0)
{
string name = this.dgvList.Columns[e.ColumnIndex].Name;
if (name.Equals(this.Column_Del.Name))
{
DeleteCom(e.RowIndex);
}
}
}
private void dgvList_SelectionChanged(object sender, EventArgs e)
{
if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0)
{
int rowIndex = dgvList.SelectedRows[0].Index;
showDetail(rowIndex);
}
}
private void btnDownLoad_Click(object sender, EventArgs e)
{
//SaveFileDialog sfd = new SaveFileDialog();
//sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
//sfd.FileName = ResourceCulture.GetString( "元器件库模板");
//sfd.Filter = @"csv|*.csv";
//DialogResult result = sfd.ShowDialog();
//if (result.Equals(DialogResult.OK))
//{
// string filePath = sfd.FileName;
// //if (Directory.Exists(filePath))
// {
// string sourcePath = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.Componet_Template);
// if (File.Exists(filePath))
// {
// File.Delete(filePath);
// }
// //复制文件
// File.Copy(sourcePath, filePath);
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DemoSave,"模板已保存在:" )+ filePath);
// }
//}
}
private void FrmComponentList_FormClosing(object sender, FormClosingEventArgs e)
{
this.Visible = false;
//FrmMenu.frmMain.Visible = true;
e.Cancel = true;
}
private void FrmComponentList_Shown(object sender, EventArgs e)
{
}
}
}
...@@ -157,7 +157,7 @@ namespace OnlineStore.AutoCountClient ...@@ -157,7 +157,7 @@ namespace OnlineStore.AutoCountClient
btnTest.Enabled = isShowBtn; btnTest.Enabled = isShowBtn;
btnNext.Enabled = isShowBtn; btnNext.Enabled = isShowBtn;
btnEnd.Enabled = isShowBtn; btnEnd.Enabled = true ;
} }
...@@ -214,10 +214,20 @@ namespace OnlineStore.AutoCountClient ...@@ -214,10 +214,20 @@ namespace OnlineStore.AutoCountClient
private bool IsSave = false; private bool IsSave = false;
private void btnSaveParam_Click(object sender, EventArgs e) private void btnSaveParam_Click(object sender, EventArgs e)
{ {
SaveCurrParam();
DialogResult result = MessageBox.Show("当前第[" + (currIndex + 1) + "]张图片,还剩余[" + (ImageList.Count - currIndex - 1) + "]张图片未选择算法,是否结束学习?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
if (result.Equals(DialogResult.Yes))
{
ParamManager.SaveMapToFile(); ParamManager.SaveMapToFile();
IsSave = true; IsSave = true;
this.Close(); this.Close();
} }
else
{
return;
}
}
private void btnNext_Click(object sender, EventArgs e) private void btnNext_Click(object sender, EventArgs e)
{ {
......
...@@ -884,7 +884,7 @@ namespace OnlineStore.AutoCountClient ...@@ -884,7 +884,7 @@ namespace OnlineStore.AutoCountClient
private void 元器件学习ToolStripMenuItem_Click(object sender, EventArgs e) private void 元器件学习ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
string backPath = ParamManager.NoConfigPath; string backPath = ParamManager.NoConfigPath;
folderBrowserDialog1.Description = "请选择需要学习的图片文件夹";
if (!Directory.Exists(backPath)) if (!Directory.Exists(backPath))
{ {
Directory.CreateDirectory(backPath); Directory.CreateDirectory(backPath);
......
...@@ -96,3 +96,9 @@ data=1,IFneed=需要 ...@@ -96,3 +96,9 @@ data=1,IFneed=需要
点料接口修改。 点料接口修改。
去掉取码气缸前进->>后退动作。 去掉取码气缸前进->>后退动作。
IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward
20200817
增加学习界面。
吸盘放标签时等待3秒再离开。
未找到配置暂时不NG.
\ No newline at end of file \ No newline at end of file
...@@ -88,5 +88,13 @@ namespace OnlineStore.Common ...@@ -88,5 +88,13 @@ namespace OnlineStore.Common
public static string DataPath = "DataPath"; public static string DataPath = "DataPath";
public static string ResultMinCount = "ResultMinCount"; public static string ResultMinCount = "ResultMinCount";
public static string ComPath_Config = "ComPath_Config";
/// <summary>
/// 贴标签时,放下标签后等待的时间
/// </summary>
public static string LabelWaitMS = "LabelWaitMS";
} }
} }
...@@ -30,7 +30,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -30,7 +30,7 @@ namespace OnlineStore.DeviceLibrary
public string WorkShelfId = ""; public string WorkShelfId = "";
public bool AutoSendShelfOut = false; public bool AutoSendShelfOut = false;
private int LabelWaitMS = ConfigAppSettings.GetIntValue(Setting_Init.LabelWaitMS);
public OutputEquip(string cid, OutputEquip_Config config) public OutputEquip(string cid, OutputEquip_Config config)
{ {
baseConfig = config; baseConfig = config;
...@@ -56,6 +56,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -56,6 +56,13 @@ namespace OnlineStore.DeviceLibrary
moveAxisArray = new AxisBean[] {MoveXAxis,MoveZAxis }; moveAxisArray = new AxisBean[] {MoveXAxis,MoveZAxis };
labelAxisArray = new AxisBean[] { LabelXAxis,LabelYAxis,LabelZAxis,LabelRAxis}; labelAxisArray = new AxisBean[] { LabelXAxis,LabelYAxis,LabelZAxis,LabelRAxis};
if (LabelWaitMS < 1000)
{
LabelWaitMS = 3000;
ConfigAppSettings.SaveValue(Setting_Init.LabelWaitMS, LabelWaitMS);
LogUtil.info(Name + " 初始化并保存 LabelWaitMS=" + LabelWaitMS);
}
} }
public override bool StartRun() public override bool StartRun()
......
...@@ -489,9 +489,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -489,9 +489,9 @@ namespace OnlineStore.DeviceLibrary
else if (SecMoveInfo.IsStep(StepEnum.OL15_ZToP3)) else if (SecMoveInfo.IsStep(StepEnum.OL15_ZToP3))
{ {
SecMoveInfo.NextMoveStep(StepEnum.OL16_Nozzle_Stop); SecMoveInfo.NextMoveStep(StepEnum.OL16_Nozzle_Stop);
SecWorkLog("贴标: 放标签到料盘,等待1S"); SecWorkLog("贴标: 放标签到料盘,等待 "+LabelWaitMS);
IOMove(IO_Type.Nozzle_Work, IO_VALUE.LOW); IOMove(IO_Type.Nozzle_Work, IO_VALUE.LOW);
SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(LabelWaitMS));
} }
else if (SecMoveInfo.IsStep(StepEnum.OL16_Nozzle_Stop)) else if (SecMoveInfo.IsStep(StepEnum.OL16_Nozzle_Stop))
{ {
......
...@@ -348,6 +348,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,6 +348,10 @@ namespace OnlineStore.DeviceLibrary
string NgMsg = ""; string NgMsg = "";
int count = 0; int count = 0;
CountParam lastParam = ParamManager.GetParamByCode(Work_ReelInfo.WareCode); CountParam lastParam = ParamManager.GetParamByCode(Work_ReelInfo.WareCode);
if (lastParam == null)
{
lastParam = new CountParam("", ThresholdValue, 3);
}
if (lastParam != null) if (lastParam != null)
{ {
string fileP = path1_tif + @"\" + lastFileName; string fileP = path1_tif + @"\" + lastFileName;
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
<Compile Include="storeConfig\config\XRay_Config.cs" /> <Compile Include="storeConfig\config\XRay_Config.cs" />
<Compile Include="storeConfig\config\AIO_Type.cs" /> <Compile Include="storeConfig\config\AIO_Type.cs" />
<Compile Include="CSVAttribute.cs" /> <Compile Include="CSVAttribute.cs" />
<Compile Include="storeConfig\CSVBomManager.cs" />
<Compile Include="storeConfig\CSVConfigReader.cs" /> <Compile Include="storeConfig\CSVConfigReader.cs" />
<Compile Include="CSVReaderBase.cs" /> <Compile Include="CSVReaderBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!