Commit aceaf5c7 LN

导入数据提示修改。

1 个父辈 254ae75e
...@@ -37,7 +37,7 @@ namespace TSA_V ...@@ -37,7 +37,7 @@ namespace TSA_V
private List<ComponetInfo> comList = new List<ComponetInfo>(); private List<ComponetInfo> comList = new List<ComponetInfo>();
private void btnBomImport_Click(object sender, EventArgs e) private void btnBomImport_Click(object sender, EventArgs e)
{ {
openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
DialogResult result = this.openFileDialog1.ShowDialog(); DialogResult result = this.openFileDialog1.ShowDialog();
if (result.Equals(DialogResult.OK)) if (result.Equals(DialogResult.OK))
{ {
...@@ -74,43 +74,65 @@ namespace TSA_V ...@@ -74,43 +74,65 @@ namespace TSA_V
positionPNMap[com.PositionNum].Add(com.PN); positionPNMap[com.PositionNum].Add(com.PN);
} }
} }
string msg = "";
foreach (string pnKey in PnPositonMap.Keys) foreach (string pnKey in PnPositonMap.Keys)
{ {
List<string> positions = new List<string>(PnPositonMap[pnKey]); List<string> positions = new List<string>(PnPositonMap[pnKey]);
if (positions.Count > 1) if (positions.Count > 1)
{ {
result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPosition, msg += ResourceCulture.GetString(ResourceCulture.SureImportPosition, "元器件【{0}】配置多个位置【{1}】", pnKey, getListMsg(positions)) + "\r\n";
"元器件【{0}】配置多个位置【{1}】,是否确定导入?", pnKey, getListMsg(positions), "", //result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPosition,
MessageBoxButtons.OKCancel)); ; // "元器件【{0}】配置多个位置【{1}】,是否确定导入?", pnKey, getListMsg(positions), "",
if (!result.Equals(DialogResult.OK)) // MessageBoxButtons.OKCancel)); ;
{ //if (!result.Equals(DialogResult.OK))
comList = new List<ComponetInfo>(); //{
return; // comList = new List<ComponetInfo>();
} // return;
//}
} }
} }
if (msg != "")
{
result = MessageBox.Show(msg, ResourceCulture.GetString(ResourceCulture.SureImportPositionStr), MessageBoxButtons.OKCancel);
if (!result.Equals(DialogResult.OK))
{
comList = new List<ComponetInfo>();
return;
}
}
msg = "";
foreach (string key in positionPNMap.Keys) foreach (string key in positionPNMap.Keys)
{ {
List<string> pnList = new List<string>(positionPNMap[key]); List<string> pnList = new List<string>(positionPNMap[key]);
if (pnList.Count > 1) if (pnList.Count > 1)
{ {
result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPn, msg += MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPn,
"位置【{0}】配置多个元器件【{1}】,是否确定导入?", key, getListMsg(pnList), "", "位置【{0}】配置多个元器件【{1}】", key, getListMsg(pnList))) + "\r\n";
MessageBoxButtons.OKCancel)); ; // result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPn,
if (!result.Equals(DialogResult.OK)) // "位置【{0}】配置多个元器件【{1}】,是否确定导入?", key, getListMsg(pnList), "",
{ // MessageBoxButtons.OKCancel)); ;
comList = new List<ComponetInfo>(); // if (!result.Equals(DialogResult.OK))
return; // {
} // comList = new List<ComponetInfo>();
// return;
// }
//}
}
}
if (msg != "")
{
result = MessageBox.Show(msg, ResourceCulture.GetString(ResourceCulture.SureImportPositionStr), MessageBoxButtons.OKCancel);
if (!result.Equals(DialogResult.OK))
{
comList = new List<ComponetInfo>();
return;
} }
} }
} }
} }
private void btnCancel_Click(object sender, EventArgs e)
private void btnCancel_Click(object sender, EventArgs e)
{ {
if (this.txtBomName.Text.Equals("") || this.txtBomFilePath.Text.Equals("")) if (this.txtBomName.Text.Equals("") || this.txtBomFilePath.Text.Equals(""))
{ {
......
...@@ -2456,13 +2456,16 @@ ...@@ -2456,13 +2456,16 @@
<value> The component is in use and cannot be deleted. </value> <value> The component is in use and cannot be deleted. </value>
</data> </data>
<data name="SureImportPosition" xml:space="preserve"> <data name="SureImportPosition" xml:space="preserve">
<value> The component [{0}] is configured with multiple locations [{1}], whether it is determined to import ? </value> <value> The component [{0}] is configured with multiple locations [{1}] </value>
</data>
<data name="SureImportPositionStr" xml:space="preserve">
<value> whether it is determined to import </value>
</data> </data>
<data name="ComExists" xml:space="preserve"> <data name="ComExists" xml:space="preserve">
<value> The component already exists. </value> <value> The component already exists. </value>
</data> </data>
<data name="SureImportPn" xml:space="preserve"> <data name="SureImportPn" xml:space="preserve">
<value> Location [{0}] Configure multiple components [{1}], determine whether to import? </value> <value> Location [{0}] Configure multiple components [{1}] </value>
</data> </data>
<data name="BLText" xml:space="preserve"> <data name="BLText" xml:space="preserve">
<value> Program [{0}] component library [{1}] is preparing materials </value> <value> Program [{0}] component library [{1}] is preparing materials </value>
......
...@@ -2473,13 +2473,16 @@ ...@@ -2473,13 +2473,16 @@
<value> 元器件已使用,不能删除 </value> <value> 元器件已使用,不能删除 </value>
</data> </data>
<data name="SureImportPosition" xml:space="preserve"> <data name="SureImportPosition" xml:space="preserve">
<value> 元器件【{0}】配置多个位置【{1}】,是否确定导入? </value> <value> 元器件【{0}】配置多个位置【{1}】 </value>
</data>
<data name="SureImportPositionStr" xml:space="preserve">
<value> 是否确定导入? </value>
</data> </data>
<data name="ComExists" xml:space="preserve"> <data name="ComExists" xml:space="preserve">
<value> 元器件已存在 </value> <value> 元器件已存在 </value>
</data> </data>
<data name="SureImportPn" xml:space="preserve"> <data name="SureImportPn" xml:space="preserve">
<value> 位置【{0}】配置多个元器件【{1}】,是否确定导入? </value> <value> 位置【{0}】配置多个元器件【{1}】 </value>
</data> </data>
<data name="BLText" xml:space="preserve"> <data name="BLText" xml:space="preserve">
<value> 程序【{0}】元器件库【{1}】备料中 </value> <value> 程序【{0}】元器件库【{1}】备料中 </value>
......
...@@ -2467,14 +2467,17 @@ ...@@ -2467,14 +2467,17 @@
<value> 元器件已使用,不能删除 </value> <value> 元器件已使用,不能删除 </value>
</data> </data>
<data name="SureImportPosition" xml:space="preserve"> <data name="SureImportPosition" xml:space="preserve">
<value> 元器件【{0}】配置多个位置【{1}】,是否确定导入? </value> <value> 元器件【{0}】配置多个位置【{1}】 </value>
</data>
<data name="SureImportPositionStr" xml:space="preserve">
<value> 是否确定导入</value>
</data> </data>
<data name="ComExists" xml:space="preserve"> <data name="ComExists" xml:space="preserve">
<value> 元器件已存在 </value> <value> 元器件已存在 </value>
</data> </data>
<data name="SureImportPn" xml:space="preserve"> <data name="SureImportPn" xml:space="preserve">
<value> 位置【{0}】配置多个元器件【{1}】,是否确定导入? </value> <value> 位置【{0}】配置多个元器件【{1}】 </value>
</data> </data>
<data name="BLText" xml:space="preserve"> <data name="BLText" xml:space="preserve">
<value> 程序【{0}】元器件库【{1}】备料中 </value> <value> 程序【{0}】元器件库【{1}】备料中 </value>
</data> </data>
......
...@@ -835,10 +835,14 @@ namespace TSA_V ...@@ -835,10 +835,14 @@ namespace TSA_V
/// </summary> /// </summary>
public static string CanotDelCom = "CanotDelCom"; public static string CanotDelCom = "CanotDelCom";
/// <summary> /// <summary>
/// 元器件【{0}】配置多个位置【{1}】,是否确定导入? /// 元器件【{0}】配置多个位置【{1}】
/// </summary> /// </summary>
public static string SureImportPosition = "SureImportPosition"; public static string SureImportPosition = "SureImportPosition";
/// <summary> /// <summary>
/// 是否确定导入?
/// </summary>
public static string SureImportPositionStr= "SureImportPositionStr";
/// <summary>
/// 元器件已存在 /// 元器件已存在
/// </summary> /// </summary>
internal static string ComExists= "ComExists"; internal static string ComExists= "ComExists";
...@@ -857,7 +861,7 @@ namespace TSA_V ...@@ -857,7 +861,7 @@ namespace TSA_V
internal static string smtpoint_select= "smtpoint_select"; internal static string smtpoint_select= "smtpoint_select";
/// <summary> /// <summary>
/// 位置【{0}】配置多个元器件【{1}】,是否确定导入? /// 位置【{0}】配置多个元器件【{1}】
/// </summary> /// </summary>
internal static readonly string SureImportPn= "SureImportPn"; internal static readonly string SureImportPn= "SureImportPn";
......
...@@ -569,7 +569,7 @@ namespace TSA_V ...@@ -569,7 +569,7 @@ namespace TSA_V
} }
private bool ProcessComData(List<ComponetInfo> uploadPointList) private bool ProcessComData(List<ComponetInfo> uploadPointList)
{ {
if (uploadPointList.Count <= 0) if (uploadPointList.Count <= 0)
{ {
...@@ -600,38 +600,62 @@ namespace TSA_V ...@@ -600,38 +600,62 @@ namespace TSA_V
} }
} }
string showMsg = "";
foreach (string pnKey in PnPositonMap.Keys) foreach (string pnKey in PnPositonMap.Keys)
{ {
List<string> positions = new List<string>(PnPositonMap[pnKey]); List<string> positions = new List<string>(PnPositonMap[pnKey]);
if (positions.Count > 1) if (positions.Count > 1)
{ {
DialogResult result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPosition, showMsg += ResourceCulture.GetString(ResourceCulture.SureImportPosition,
"元器件【{0}】配置多个位置【{1}】,是否确定导入?", pnKey, getListMsg(positions), "", "元器件【{0}】配置多个位置【{1}】,是否确定导入?", pnKey, getListMsg(positions)) + "\r\n";
MessageBoxButtons.OKCancel)); ; // DialogResult result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPosition,
if (!result.Equals(DialogResult.OK)) // "元器件【{0}】配置多个位置【{1}】,是否确定导入?", pnKey, getListMsg(positions), "",
{ // MessageBoxButtons.OKCancel)); ;
uploadPointList = new List<ComponetInfo>(); // if (!result.Equals(DialogResult.OK))
return false ; // {
} // uploadPointList = new List<ComponetInfo>();
// return false ;
// }
}
}
if (showMsg != "")
{
DialogResult result = MessageBox.Show(showMsg, ResourceCulture.GetString(ResourceCulture.SureImportPositionStr), MessageBoxButtons.OKCancel); ;
if (!result.Equals(DialogResult.OK))
{
uploadPointList = new List<ComponetInfo>();
return false;
} }
} }
showMsg = "";
foreach (string key in positionPNMap.Keys) foreach (string key in positionPNMap.Keys)
{ {
List<string> pnList = new List<string>(positionPNMap[key]); List<string> pnList = new List<string>(positionPNMap[key]);
if (pnList.Count > 1) if (pnList.Count > 1)
{ {
DialogResult result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPn, showMsg += ResourceCulture.GetString(ResourceCulture.SureImportPn,
"位置【{0}】配置多个元器件【{1}】,是否确定导入?", key, getListMsg(pnList), "", "位置【{0}】配置多个元器件【{1}】,是否确定导入?", key, getListMsg(pnList)) + "\r\n";
MessageBoxButtons.OKCancel)); ; //DialogResult result = MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureImportPn,
if (!result.Equals(DialogResult.OK)) // "位置【{0}】配置多个元器件【{1}】,是否确定导入?", key, getListMsg(pnList), "",
{ // MessageBoxButtons.OKCancel)); ;
uploadPointList = new List<ComponetInfo>(); //if (!result.Equals(DialogResult.OK))
return false ; //{
} // uploadPointList = new List<ComponetInfo>();
// return false ;
//}
} }
} }
if (showMsg != "")
{
DialogResult result = MessageBox.Show(showMsg, ResourceCulture.GetString(ResourceCulture.SureImportPositionStr), MessageBoxButtons.OKCancel);
if (!result.Equals(DialogResult.OK))
{
uploadPointList = new List<ComponetInfo>();
return false;
}
}
return true; return true;
} }
......
using System; using log4net.Filter;
using System;
using System.CodeDom; using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
...@@ -57,6 +58,10 @@ namespace TSA_V ...@@ -57,6 +58,10 @@ namespace TSA_V
//校准点不再自动计算 //校准点不再自动计算
return smtPoint; return smtPoint;
} }
if (checkOKList.Count < 2)
{
return smtPoint;
}
double oldX = smtPoint.NodePositionX; double oldX = smtPoint.NodePositionX;
double oldY = smtPoint.NodePositionY; double oldY = smtPoint.NodePositionY;
//SMTPointInfo APoint = GetPoint(smtPoint, checkOKList); //SMTPointInfo APoint = GetPoint(smtPoint, checkOKList);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!