Commit 64e1a1b2 LN

禁用启用功能bug修改

1 个父辈 82f0140c
......@@ -54,6 +54,13 @@ namespace TSA_V.DeviceLibrary
/// </summary>
public List<SMTPointInfo> smtList { get; set; }
public List<SMTPointInfo> GetSmtList()
{
List<SMTPointInfo> needWorkSmtList = (from m in smtList where m.Disable.Equals(false) select m).ToList<SMTPointInfo>();
return needWorkSmtList;
}
/// <summary>
/// 基准点坐标X
/// </summary>
......@@ -119,20 +126,20 @@ namespace TSA_V.DeviceLibrary
"," + ResourceControl.GetString(ResourceControl.Width, "宽度") + ":" + boardWidth +
"," + ResourceControl.GetString(ResourceControl.LineWidth, "线体宽度") + ":" + LineWidth +
"," + ResourceControl.GetString(ResourceControl.InfoCount, "组件数量") +
":" + smtList.Count;
":" + GetSmtList().Count;
//return "电路板名称:" + boardName + ",长度:" + boardLength + ",宽度:" + boardWidth + ",组装信息数量:" + pointList.Count;
}
public List<SMTPointInfo> GetSolderingSMTList()
{
List<SMTPointInfo> newList = (from m in smtList where m.NeedSoldering.Equals(true) select m).ToList<SMTPointInfo>();
return newList;
}
public List<SMTPointInfo> GetCheckSMTList()
{
List<SMTPointInfo> newList = (from m in smtList where m.NeedCheck.Equals(true) select m).ToList<SMTPointInfo>();
return newList;
}
//public List<SMTPointInfo> GetSolderingSMTList()
//{
// List<SMTPointInfo> newList = (from m in smtList where m.NeedSoldering.Equals(true) select m).ToList<SMTPointInfo>();
// return newList;
//}
//public List<SMTPointInfo> GetCheckSMTList()
//{
// List<SMTPointInfo> newList = (from m in smtList where m.NeedCheck.Equals(true) select m).ToList<SMTPointInfo>();
// return newList;
//}
public string GetAoiFileName()
{
......
......@@ -457,7 +457,8 @@ namespace TSA_V.LoadCSVLibrary
}
Dictionary<string, int> useCount = new Dictionary<string, int>();
int index = 0;
foreach (SMTPointInfo smt in currBoard.smtList)
List<SMTPointInfo> list = currBoard.GetSmtList();
foreach (SMTPointInfo smt in list)
{
if (index > maxIndex)
{
......
......@@ -34,8 +34,9 @@ namespace TSA_V.DeviceLibrary
public DateTime endWorkTime = DateTime.Now;
public DateTime LastSetpTime = DateTime.Now;
public uint PreNodeId = 0;
public List<SMTPointInfo> needSoldSmtList = new List<SMTPointInfo>();
public List<SMTPointInfo> needCheckSmtList = new List<SMTPointInfo>();
//public List<SMTPointInfo> needSoldSmtList = new List<SMTPointInfo>();
//public List<SMTPointInfo> needCheckSmtList = new List<SMTPointInfo>();
public List<SMTPointInfo> needWorkSmtList = new List<SMTPointInfo>();
//开始工作后共工作了几块电路板
public int BoardCount = 0;
public DateTime beginWorkTime = DateTime.Now;
......@@ -49,8 +50,9 @@ namespace TSA_V.DeviceLibrary
LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件");
// StatusClient.instance.SendNew(Color.Green, "开始组装【" + boardInfo.boardName + "】" );
currBoard = boardInfo;
needSoldSmtList = (from m in currBoard.smtList where m.NeedSoldering.Equals(true) select m).ToList<SMTPointInfo>();
needCheckSmtList = (from m in currBoard.smtList where m.NeedCheck.Equals(true) select m).ToList<SMTPointInfo>();
//needSoldSmtList = (from m in currBoard.smtList where m.NeedSoldering.Equals(true) select m).ToList<SMTPointInfo>();
//needCheckSmtList = (from m in currBoard.smtList where m.NeedCheck.Equals(true) select m).ToList<SMTPointInfo>();
needWorkSmtList = currBoard.GetSmtList();
currIndex = -1;
//IsShowSoldering = false;
IsShowAOI = false;
......@@ -66,19 +68,20 @@ namespace TSA_V.DeviceLibrary
{
return new List<SMTPointInfo>();
}
if (WorkType.Equals(1))
{
return currBoard.smtList;
}
else if (WorkType.Equals(2))
{
return needSoldSmtList;
}
else if (WorkType.Equals(3))
{
return needCheckSmtList;
}
return new List<SMTPointInfo>();
//if (WorkType.Equals(1))
//{
// return currBoard.smtList;
//}
//else if (WorkType.Equals(2))
//{
// return needSoldSmtList;
//}
//else if (WorkType.Equals(3))
//{
// return needCheckSmtList;
//}
//return new List<SMTPointInfo>();
return needWorkSmtList;
}
public void StopWork()
{
......
......@@ -73,7 +73,8 @@ namespace TSA_V.DeviceLibrary
if (maxIndex>0)
{
int index = 0;
foreach (SMTPointInfo sm in board.smtList)
List<SMTPointInfo> list = board.GetSmtList();
foreach (SMTPointInfo sm in list)
{
if (maxIndex > 0 && index > maxIndex)
{
......
......@@ -183,7 +183,7 @@ namespace TSA_V.DeviceLibrary
public static DeviceStatus GetTestStatus(BoardInfo board, string pcbcode = "")
{
DeviceStatus deviceStatus = new DeviceStatus();
OpInfo op = OpInfo.GetOpInfo(board,board.smtList.Count);
OpInfo op = OpInfo.GetOpInfo(board,board.GetSmtList().Count);
deviceStatus.CurrStatus = 3;
//op.ProName = board.boardName;
......
......@@ -132,7 +132,7 @@ namespace TSA_V
this.Column_Up.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Up, "上升");
this.Column_Down.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Down, "下降");
this.Column_CheckOK.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Check, "校准点");
this.Column_disable.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Check, "禁用");
this.Column_disable.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Disable, "禁用");
}
private void FrmBoardInfo_Load(object sender, EventArgs e)
{
......
......@@ -2353,6 +2353,13 @@
<data name="禁用" xml:space="preserve">
<value>Disabled</value>
</data>
<data name = "FrmBoardInfo_llblAllUSel_Text" xml:space = "preserve"> <value> Disable all </value> </data>
<data name = "FrmBoardInfo_llblAllSel_Text" xml:space = "preserve"> <value> To enable all </value> </data>
<data name="FrmBoardInfo_llblAllUSel_Text" xml:space="preserve">
<value> Disable all </value>
</data>
<data name="FrmBoardInfo_llblAllSel_Text" xml:space="preserve">
<value> To enable all </value>
</data>
<data name="ItemText_Disable" xml:space="preserve">
<value>Disable</value>
</data>
</root>
\ No newline at end of file
......@@ -2367,6 +2367,13 @@
<data name="禁用" xml:space="preserve">
<value>禁用</value>
</data>
<data name = "FrmBoardInfo_llblAllUSel_Text" xml:space = "preserve"> <value> 全部禁用 </value> </data>
<data name = "FrmBoardInfo_llblAllSel_Text" xml:space = "preserve"> <value> 全部启用 </value> </data>
<data name="FrmBoardInfo_llblAllUSel_Text" xml:space="preserve">
<value> 全部禁用 </value>
</data>
<data name="FrmBoardInfo_llblAllSel_Text" xml:space="preserve">
<value> 全部启用 </value>
</data>
<data name="ItemText_Disable" xml:space="preserve">
<value>禁用</value>
</data>
</root>
\ No newline at end of file
......@@ -600,6 +600,10 @@ namespace TSA_V
/// </summary>
public static string ItemText_Check = "ItemText_Check";
/// <summary>
/// 禁用
/// </summary>
public static string ItemText_Disable = "ItemText_Disable";
/// <summary>
/// 编号
/// </summary>
public static string Col_Num = "Col_Num";
......
......@@ -68,7 +68,7 @@ namespace TSA_V
this.lblBoardMsg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
BoardManager.CurrBoard = board;
LogUtil.info("切换到新板子:" + board.boardName);
FrmProjectorScreen.instance.ShowPoint(false, board.smtList.ToArray());
FrmProjectorScreen.instance.ShowPoint(false, board.GetSmtList().ToArray());
}
}
}
......@@ -165,31 +165,31 @@ namespace TSA_V
LogUtil.info("选择程序,是否流水线过板=" + TSAVBean.OnlyGuoBan);
if (WorkType.Equals(1))
{
if (BoardManager.CurrBoard.smtList.Count <= 0)
if (BoardManager.CurrBoard.GetSmtList().Count <= 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.CanotFindInfo, "电路板【{0}】没有组装信息,请选择其他程序!", BoardManager.CurrBoard.boardName));
return false;
}
return true;
}
else if (WorkType.Equals(2))
{
if (BoardManager.CurrBoard.GetSolderingSMTList().Count <= 0)
{
MessageBox.Show("电路板【" + BoardManager.CurrBoard.boardName + "】没有配置焊接信息,请选择其他程序!");
return false;
}
return true;
}
else if (WorkType.Equals(3))
{
if (BoardManager.CurrBoard.GetCheckSMTList().Count <= 0)
{
MessageBox.Show("电路板【" + BoardManager.CurrBoard.boardName + "】没有配置检测信息,请选择其他程序!");
return false;
}
return true;
}
//else if (WorkType.Equals(2))
//{
// if (BoardManager.CurrBoard.GetSolderingSMTList().Count <= 0)
// {
// MessageBox.Show("电路板【" + BoardManager.CurrBoard.boardName + "】没有配置焊接信息,请选择其他程序!");
// return false;
// }
// return true;
//}
//else if (WorkType.Equals(3))
//{
// if (BoardManager.CurrBoard.GetCheckSMTList().Count <= 0)
// {
// MessageBox.Show("电路板【" + BoardManager.CurrBoard.boardName + "】没有配置检测信息,请选择其他程序!");
// return false;
// }
// return true;
//}
}
return false;
}
......
......@@ -27,23 +27,25 @@ namespace TSA_V
private bool isInitOk = false;
private BoardInfo board = BoardManager.CurrBoard;
private PointDisplay display = new PointDisplay();
private List<SMTPointInfo> workSmtList = new List<SMTPointInfo>();
private void FrmWelding_Load(object sender, EventArgs e)
{
btnCamera.Visible = TSAVBean.IsNeedAOI;
TSAVBean.Work.WorkType = 1;
LanguageProcess();
BoardInfo board = BoardManager.CurrBoard;
if (board != null)
{
this.Text = "Smart Workstation:" + board.boardName;
workSmtList = board.GetSmtList();
preIndex = -1;
smtPoint = new SMTPointInfo();
timerShowForm.Stop();
if (board.smtList.Count > 0)
if (workSmtList.Count > 0)
{
smtPoint = board.smtList[0];
smtPoint = workSmtList[0];
}
ShowMsg();
......@@ -191,7 +193,7 @@ namespace TSA_V
private Bitmap bitmap = null;
private void loadPictureBoxSize(BoardInfo board)
{
display.LoadWorkFromPoint(board, smtPoint);
display.LoadWorkFromPoint(board, smtPoint,true);
updatePicPointSize(picBoard.Width, picBoard.Height);
pointXMap = display.pointXMap;
pointYMap = display.pointYMap;
......@@ -639,7 +641,7 @@ namespace TSA_V
}
int leftCount = board.smtList.Count - 1 - preIndex;
int leftCount = workSmtList.Count - 1 - preIndex;
if (preIndex.Equals(0))
{
lblLast.Visible = false;
......@@ -704,7 +706,7 @@ namespace TSA_V
private void PreOrNext(bool isNext)
{
if (board != null && board.smtList.Count > 0)
if (board != null && workSmtList.Count > 0)
{
if (isNext)
{
......@@ -721,20 +723,20 @@ namespace TSA_V
if (preIndex < 0)
{
preIndex = board.smtList.Count - 1;
preIndex = workSmtList.Count - 1;
}
}
if (board.smtList.Count <= preIndex)
if (workSmtList.Count <= preIndex)
{
ShowAOI();
preIndex = 0;
}
else if (preIndex < 0)
{
preIndex = board.smtList.Count - 1;
preIndex = workSmtList.Count - 1;
}
smtPoint = board.smtList[preIndex];
smtPoint = workSmtList[preIndex];
ShowMsg();
if (pointXMap.ContainsKey(smtPoint.pointNum))
{
......@@ -771,7 +773,7 @@ namespace TSA_V
{
lblPositionNum.Text = position.PositionNum;
}
int leftCount = board.smtList.Count - 1 - preIndex;
int leftCount = workSmtList.Count - 1 - preIndex;
if (preIndex.Equals(0))
{
lblLast.Visible = false;
......
......@@ -141,7 +141,7 @@ namespace TSA_V
public Dictionary<int, double> pointXMap = new Dictionary<int, double>();
public Dictionary<int, double> pointYMap = new Dictionary<int, double>();
public void LoadWorkFromPoint(BoardInfo board, SMTPointInfo smtPoint)
public void LoadWorkFromPoint(BoardInfo board, SMTPointInfo smtPoint,bool isOnlyWork=true )
{
if (picBoard == null)
{
......@@ -175,7 +175,12 @@ namespace TSA_V
int index = 0;
pointXMap = new Dictionary<int, double>();
pointYMap = new Dictionary<int, double>();
foreach (SMTPointInfo weld in board.smtList)
List<SMTPointInfo> list = board.smtList;
if (isOnlyWork)
{
list = board.GetSmtList();
}
foreach (SMTPointInfo weld in list)
{
float x = (float)Math.Abs(weld.PositionX) * picBoard.Width / Width;
float y = (float)Math.Abs(weld.PositionY) * picBoard.Width / Width;
......@@ -220,51 +225,7 @@ namespace TSA_V
{
LogUtil.error("画图出错:" + ex.ToString());
}
}
//private void PicBoardBlowUp()
//{
// this.picBoard.SizeMode = PictureBoxSizeMode.Zoom;
// if (this.picBoard.Width > 5000 || this.picBoard.Height > 5000)
// {
// //不能继续放大
// return;
// }
// float w = this.picBoard.Width * 1.2f; //每次放大 20%
// float h = this.picBoard.Height * 1.2f;
// CurrBeiLu = CurrBeiLu * 1.2f;
// this.picBoard.Size = Size.Ceiling(new SizeF(w, h));
// picBoard.Invalidate();
//}
//private void PicBoardShrink()
//{
// this.picBoard.SizeMode = PictureBoxSizeMode.Zoom;
// if (this.picBoard.Width < panBoard.Width && this.picBoard.Height < panBoard.Height)
// {
// //不能继续缩小
// return;
// }
// float w = this.picBoard.Width * 0.8f; //每次縮小 20%
// float h = this.picBoard.Height * 0.8f;
// this.picBoard.Size = Size.Ceiling(new SizeF(w, h));
// CurrBeiLu = CurrBeiLu * 0.8f;
//}
//void picBoard_MouseWheel(object sender, MouseEventArgs e)
//{
// //向前
// if (e.Delta > 0)
// {
// PicBoardBlowUp();
// LoadPoint(Width, Height, PointList);
// }
// //向后
// else if (e.Delta < 0)
// {
// PicBoardShrink();
// LoadPoint(Width, Height, PointList);
// }
//}
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!