Commit 4ba556c0 几米阳光

增加中间点的配置功能

1 个父辈 4024e72c
...@@ -14,12 +14,8 @@ namespace URSoldering.DeviceLibrary ...@@ -14,12 +14,8 @@ namespace URSoldering.DeviceLibrary
public delegate void AOICheck( ); public delegate void AOICheck( );
public static event AOICheck AOICheckFun; public static event AOICheck AOICheckFun;
public static string StartWeld() public static string StartWeld( )
{
return StartWeld(0);
}
public static string StartWeld(int type)
{ {
StopSleep(); StopSleep();
KeepTemp(); KeepTemp();
...@@ -44,7 +40,7 @@ namespace URSoldering.DeviceLibrary ...@@ -44,7 +40,7 @@ namespace URSoldering.DeviceLibrary
WeldCount++; WeldCount++;
LogUtil.info(RobotName + "开始【" + BoardManager.CurrBoard.boardName + "】的焊接 ,WeldCount="+WeldCount); LogUtil.info(RobotName + "开始【" + BoardManager.CurrBoard.boardName + "】的焊接 ,WeldCount="+WeldCount);
if (!WeldMoveStep.NewWeld(MoveType.Weld, BoardManager.CurrBoard, type)) if (!WeldMoveStep.NewWeld(MoveType.Weld, BoardManager.CurrBoard))
{ {
return "没有找到需要焊接的焊点,启动焊接失败!"; return "没有找到需要焊接的焊点,启动焊接失败!";
} }
...@@ -69,26 +65,33 @@ namespace URSoldering.DeviceLibrary ...@@ -69,26 +65,33 @@ namespace URSoldering.DeviceLibrary
} }
else if (WeldMoveStep.moveStep.Equals(MoveStep.W01_RobotMoveToPoint)) else if (WeldMoveStep.moveStep.Equals(MoveStep.W01_RobotMoveToPoint))
{ {
if (WeldMoveStep.CurrPoint.pointType.Equals(0))
if (WeldMoveStep.IsSlowSendWire)
{ {
//已经慢速送丝
WeldMoveStep.NextMoveStep(MoveStep.W03_SendWire); if (WeldMoveStep.IsSlowSendWire)
SendWire();
}
else
{
if (WeldMoveStep.CurrPoint.startSendWireTime > 0 && WeldMoveStep.CurrPoint.startSendWireSpeed > 0)
{ {
WeldMoveStep.NextMoveStep(MoveStep.W02_SlowSendWire); //已经慢速送丝
SlowSendWire(); WeldMoveStep.NextMoveStep(MoveStep.W03_SendWire);
SendWire();
} }
else else
{ {
WeldMoveStep.NextMoveStep(MoveStep.W03_SendWire); if (WeldMoveStep.CurrPoint.startSendWireTime > 0 && WeldMoveStep.CurrPoint.startSendWireSpeed > 0)
SendWire(); {
WeldMoveStep.NextMoveStep(MoveStep.W02_SlowSendWire);
SlowSendWire();
}
else
{
WeldMoveStep.NextMoveStep(MoveStep.W03_SendWire);
SendWire();
}
} }
} }
else
{
PointEndPross();
}
} }
else if (WeldMoveStep.moveStep.Equals(MoveStep.W02_SlowSendWire)) else if (WeldMoveStep.moveStep.Equals(MoveStep.W02_SlowSendWire))
{ {
...@@ -184,12 +187,19 @@ namespace URSoldering.DeviceLibrary ...@@ -184,12 +187,19 @@ namespace URSoldering.DeviceLibrary
{ {
SetPreTemp(true, false); SetPreTemp(true, false);
} }
LogUtil.info(" 新焊点【" + WeldMoveStep.CurrPoint.pointName + "】预热" + WeldMoveStep.CurrPoint.preheatTemperature + "度,送丝下降,移动机械臂"); if (WeldMoveStep.CurrPoint.pointType.Equals(0))
MoveToPoint(WeldMoveStep.CurrPoint, false); {
WorkCountManager.AddWeldPint(); LogUtil.info(" 新" + WeldMoveStep.CurrPoint.TypeValue + "【" + WeldMoveStep.CurrPoint.pointName + "】预热" + WeldMoveStep.CurrPoint.preheatTemperature + "度,送丝下降,移动机械臂");
WeldMoveStep.IsSlowSendWire = true; MoveToPoint(WeldMoveStep.CurrPoint, false);
SlowSendWire(); WorkCountManager.AddWeldPint();
WeldMoveStep.IsSlowSendWire = true;
SlowSendWire();
}
else
{
LogUtil.info(" 新" + WeldMoveStep.CurrPoint.TypeValue + "【" + WeldMoveStep.CurrPoint.pointName + "】 移动机械臂");
MoveToPoint(WeldMoveStep.CurrPoint, false);
}
} }
private static void PointEndPross() private static void PointEndPross()
{ {
......
...@@ -3,6 +3,7 @@ using System; ...@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using URSoldering.Common;
namespace URSoldering.DeviceLibrary namespace URSoldering.DeviceLibrary
{ {
...@@ -92,8 +93,8 @@ namespace URSoldering.DeviceLibrary ...@@ -92,8 +93,8 @@ namespace URSoldering.DeviceLibrary
/// <summary> /// <summary>
/// 开始焊接 /// 开始焊接
/// </summary> /// </summary>
/// <param name="pointType">焊点类型,0=所有,1=只焊接左侧,2=只焊接右侧</param> /// <param name="pointType">焊点类型,0=所有 </param>
public bool NewWeld(MoveType type, BoardInfo board, int pointType) public bool NewWeld(MoveType type, BoardInfo board )
{ {
IsSlowSendWire = false; IsSlowSendWire = false;
StartPointIndex = 0; StartPointIndex = 0;
...@@ -101,14 +102,14 @@ namespace URSoldering.DeviceLibrary ...@@ -101,14 +102,14 @@ namespace URSoldering.DeviceLibrary
NewWeld(type); NewWeld(type);
this.currBoard = board; this.currBoard = board;
CurrPointIndex = 0; CurrPointIndex = 0;
if (pointType.Equals(0)) //if (pointType.Equals(0))
{ //{
weldPointList = board.pointList; weldPointList = board.pointList;
} //}
else //else
{ //{
weldPointList = (from m in board.pointList where m.pointType.Equals(pointType) && m.pointType.Equals(0) select m).ToList<WeldPointInfo>(); // weldPointList = (from m in board.pointList where m.pointType.Equals(pointType) && m.pointType.Equals(0) select m).ToList<WeldPointInfo>();
} //}
if (weldPointList.Count <= 0) if (weldPointList.Count <= 0)
{ {
return false; return false;
...@@ -117,6 +118,8 @@ namespace URSoldering.DeviceLibrary ...@@ -117,6 +118,8 @@ namespace URSoldering.DeviceLibrary
{ {
if (!URRobotControl.PointIsValid(p.GetURPoint())) if (!URRobotControl.PointIsValid(p.GetURPoint()))
{ {
LogUtil.error("【"+ board .boardName+ "】的焊点【"+p.pointName+"】坐标无效,无法开始焊接");
return false; return false;
} }
} }
......
...@@ -168,9 +168,9 @@ namespace URSoldering.DeviceLibrary ...@@ -168,9 +168,9 @@ namespace URSoldering.DeviceLibrary
isNeedClear = false; isNeedClear = false;
pointType = 0; pointType = 0;
} }
public WeldPointInfo(int hand) public WeldPointInfo(int type)
{ {
//this.HandDirection = hand; this.pointType = type;
} }
/// <summary> /// <summary>
...@@ -184,7 +184,7 @@ namespace URSoldering.DeviceLibrary ...@@ -184,7 +184,7 @@ namespace URSoldering.DeviceLibrary
public string pointName { get; set; } public string pointName { get; set; }
public double RobotX { get; set; } public double RobotX { get; set; }
public double RoobtY { get; set; } public double RobotY { get; set; }
public double RobotZ { get; set; } public double RobotZ { get; set; }
public double RobotRX { get; set; } public double RobotRX { get; set; }
public double RobotRY { get; set; } public double RobotRY { get; set; }
...@@ -242,7 +242,7 @@ namespace URSoldering.DeviceLibrary ...@@ -242,7 +242,7 @@ namespace URSoldering.DeviceLibrary
public double sendWireTime { get; set; } public double sendWireTime { get; set; }
/// <summary> /// <summary>
/// 焊点类型,0=普通焊点,必须要焊接,1=左侧焊点,起始运行模式不焊接。2=右侧焊点,排料模式不焊接 /// 焊点类型,0=普通焊点,必须要焊接,1=中间点,机器人跳转位置使用
/// </summary> /// </summary>
public int pointType { get; set; } public int pointType { get; set; }
/// <summary> /// <summary>
...@@ -253,10 +253,25 @@ namespace URSoldering.DeviceLibrary ...@@ -253,10 +253,25 @@ namespace URSoldering.DeviceLibrary
/// 清洗时间,毫秒数 /// 清洗时间,毫秒数
/// </summary> /// </summary>
public int ClearTime { get; set; } public int ClearTime { get; set; }
public string TypeValue
{
get
{
if (pointType.Equals(0))
{
return "普通焊点";
}
else
{
return "中间点";
}
} set
{
}
}
public URPointValue GetURPoint() public URPointValue GetURPoint()
{ {
URPointValue p = new URPointValue(RobotX, RoobtY, RobotZ, RobotRX, RobotRY, RobotRZ); URPointValue p = new URPointValue(RobotX, RobotY, RobotZ, RobotRX, RobotRY, RobotRZ);
return p; return p;
} }
......
...@@ -186,8 +186,9 @@ namespace URSoldering.DeviceLibrary ...@@ -186,8 +186,9 @@ namespace URSoldering.DeviceLibrary
} }
//关闭所有的DO //关闭所有的DO
public static void CloseAllDO() public static void CloseAllDO()
{ {
foreach (string key in mastMap.Keys) List<string> keyList = new List<string>(mastMap.Keys);
foreach (string key in keyList)
{ {
byte[] data = new byte[] { 0,0}; byte[] data = new byte[] { 0,0};
WriteMultipleDO(key, DefualtSlaveID, DoStartAddress, DefaultDOLength, data); WriteMultipleDO(key, DefualtSlaveID, DoStartAddress, DefaultDOLength, data);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{ {
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtCode = new System.Windows.Forms.TextBox(); this.txtAOIName = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 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.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.txtCode); this.groupBox2.Controls.Add(this.txtAOIName);
this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label8); this.groupBox2.Controls.Add(this.label8);
...@@ -106,27 +106,27 @@ ...@@ -106,27 +106,27 @@
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "程序信息"; this.groupBox2.Text = "程序信息";
// //
// txtCode // txtAOIName
// //
this.txtCode.Enabled = false; this.txtAOIName.Enabled = false;
this.txtCode.Location = new System.Drawing.Point(322, 23); this.txtAOIName.Location = new System.Drawing.Point(353, 23);
this.txtCode.Name = "txtCode"; this.txtAOIName.Name = "txtAOIName";
this.txtCode.Size = new System.Drawing.Size(135, 23); this.txtAOIName.Size = new System.Drawing.Size(177, 23);
this.txtCode.TabIndex = 41; this.txtAOIName.TabIndex = 41;
// //
// label10 // label10
// //
this.label10.AutoSize = true; this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(265, 27); this.label10.Location = new System.Drawing.Point(280, 26);
this.label10.Name = "label10"; this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(56, 17); this.label10.Size = new System.Drawing.Size(66, 17);
this.label10.TabIndex = 40; this.label10.TabIndex = 40;
this.label10.Text = "条码:"; this.label10.Text = "AOI程序:";
// //
// label9 // label9
// //
this.label9.AutoSize = true; this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(422, 68); this.label9.Location = new System.Drawing.Point(453, 68);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(35, 17); this.label9.Size = new System.Drawing.Size(35, 17);
this.label9.TabIndex = 39; this.label9.TabIndex = 39;
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
// label8 // label8
// //
this.label8.AutoSize = true; this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(142, 67); this.label8.Location = new System.Drawing.Point(150, 68);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(30, 17); this.label8.Size = new System.Drawing.Size(30, 17);
this.label8.TabIndex = 38; this.label8.TabIndex = 38;
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
// label24 // label24
// //
this.label24.AutoSize = true; this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(144, 108); this.label24.Location = new System.Drawing.Point(152, 108);
this.label24.Name = "label24"; this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(30, 17); this.label24.Size = new System.Drawing.Size(30, 17);
this.label24.TabIndex = 37; this.label24.TabIndex = 37;
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
// txtMianji // txtMianji
// //
this.txtMianji.Enabled = false; this.txtMianji.Enabled = false;
this.txtMianji.Location = new System.Drawing.Point(322, 65); this.txtMianji.Location = new System.Drawing.Point(353, 65);
this.txtMianji.Name = "txtMianji"; this.txtMianji.Name = "txtMianji";
this.txtMianji.Size = new System.Drawing.Size(94, 23); this.txtMianji.Size = new System.Drawing.Size(94, 23);
this.txtMianji.TabIndex = 36; this.txtMianji.TabIndex = 36;
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
// label7 // label7
// //
this.label7.AutoSize = true; this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(272, 69); this.label7.Location = new System.Drawing.Point(302, 68);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(44, 17); this.label7.Size = new System.Drawing.Size(44, 17);
this.label7.TabIndex = 35; this.label7.TabIndex = 35;
...@@ -172,9 +172,9 @@ ...@@ -172,9 +172,9 @@
this.listPoint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.listPoint.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)));
this.listPoint.GridLines = true; this.listPoint.GridLines = true;
this.listPoint.Location = new System.Drawing.Point(22, 142); this.listPoint.Location = new System.Drawing.Point(12, 141);
this.listPoint.Name = "listPoint"; this.listPoint.Name = "listPoint";
this.listPoint.Size = new System.Drawing.Size(461, 382); this.listPoint.Size = new System.Drawing.Size(572, 382);
this.listPoint.TabIndex = 34; this.listPoint.TabIndex = 34;
this.listPoint.UseCompatibleStateImageBehavior = false; this.listPoint.UseCompatibleStateImageBehavior = false;
this.listPoint.View = System.Windows.Forms.View.Details; this.listPoint.View = System.Windows.Forms.View.Details;
...@@ -197,9 +197,9 @@ ...@@ -197,9 +197,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panBoard.Controls.Add(this.picBoard); this.panBoard.Controls.Add(this.picBoard);
this.panBoard.Location = new System.Drawing.Point(489, 21); this.panBoard.Location = new System.Drawing.Point(601, 21);
this.panBoard.Name = "panBoard"; this.panBoard.Name = "panBoard";
this.panBoard.Size = new System.Drawing.Size(501, 502); this.panBoard.Size = new System.Drawing.Size(389, 502);
this.panBoard.TabIndex = 10; this.panBoard.TabIndex = 10;
// //
// picBoard // picBoard
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
this.picBoard.BackColor = System.Drawing.Color.Green; this.picBoard.BackColor = System.Drawing.Color.Green;
this.picBoard.Location = new System.Drawing.Point(3, 3); this.picBoard.Location = new System.Drawing.Point(3, 3);
this.picBoard.Name = "picBoard"; this.picBoard.Name = "picBoard";
this.picBoard.Size = new System.Drawing.Size(428, 225); this.picBoard.Size = new System.Drawing.Size(316, 225);
this.picBoard.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.picBoard.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picBoard.TabIndex = 10; this.picBoard.TabIndex = 10;
this.picBoard.TabStop = false; this.picBoard.TabStop = false;
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
// txtPointCount // txtPointCount
// //
this.txtPointCount.Enabled = false; this.txtPointCount.Enabled = false;
this.txtPointCount.Location = new System.Drawing.Point(323, 100); this.txtPointCount.Location = new System.Drawing.Point(354, 105);
this.txtPointCount.Name = "txtPointCount"; this.txtPointCount.Name = "txtPointCount";
this.txtPointCount.Size = new System.Drawing.Size(70, 23); this.txtPointCount.Size = new System.Drawing.Size(70, 23);
this.txtPointCount.TabIndex = 8; this.txtPointCount.TabIndex = 8;
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
// label5 // label5
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(262, 103); this.label5.Location = new System.Drawing.Point(290, 108);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17); this.label5.Size = new System.Drawing.Size(56, 17);
this.label5.TabIndex = 7; this.label5.TabIndex = 7;
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
// txtWidth // txtWidth
// //
this.txtWidth.Enabled = false; this.txtWidth.Enabled = false;
this.txtWidth.Location = new System.Drawing.Point(68, 106); this.txtWidth.Location = new System.Drawing.Point(76, 105);
this.txtWidth.Name = "txtWidth"; this.txtWidth.Name = "txtWidth";
this.txtWidth.Size = new System.Drawing.Size(70, 23); this.txtWidth.Size = new System.Drawing.Size(70, 23);
this.txtWidth.TabIndex = 6; this.txtWidth.TabIndex = 6;
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(19, 107); this.label4.Location = new System.Drawing.Point(24, 108);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17); this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 5; this.label4.TabIndex = 5;
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
// txtLength // txtLength
// //
this.txtLength.Enabled = false; this.txtLength.Enabled = false;
this.txtLength.Location = new System.Drawing.Point(68, 64); this.txtLength.Location = new System.Drawing.Point(76, 65);
this.txtLength.Name = "txtLength"; this.txtLength.Name = "txtLength";
this.txtLength.Size = new System.Drawing.Size(70, 23); this.txtLength.Size = new System.Drawing.Size(70, 23);
this.txtLength.TabIndex = 4; this.txtLength.TabIndex = 4;
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(18, 68); this.label3.Location = new System.Drawing.Point(24, 68);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17); this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 3; this.label3.TabIndex = 3;
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
// txtBoardName // txtBoardName
// //
this.txtBoardName.Enabled = false; this.txtBoardName.Enabled = false;
this.txtBoardName.Location = new System.Drawing.Point(68, 23); this.txtBoardName.Location = new System.Drawing.Point(76, 23);
this.txtBoardName.Name = "txtBoardName"; this.txtBoardName.Name = "txtBoardName";
this.txtBoardName.Size = new System.Drawing.Size(177, 23); this.txtBoardName.Size = new System.Drawing.Size(177, 23);
this.txtBoardName.TabIndex = 2; this.txtBoardName.TabIndex = 2;
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(20, 27); this.label2.Location = new System.Drawing.Point(24, 26);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17); this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
private System.Windows.Forms.Label label24; private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button btnCopy; private System.Windows.Forms.Button btnCopy;
private System.Windows.Forms.TextBox txtCode; private System.Windows.Forms.TextBox txtAOIName;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -22,6 +22,14 @@ namespace URSoldering.Client ...@@ -22,6 +22,14 @@ namespace URSoldering.Client
{ {
LoadCom(); LoadCom();
} }
private void AddColumn(string text,int width)
{
ColumnHeader chName = new ColumnHeader();
chName.Text =text ; //设置列标题
chName.Width = width; //设置列宽度
chName.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
this.listPoint.Columns.Add(chName); //将列头添加到ListView控件。
}
private void LoadCom() private void LoadCom()
{ {
List<BoardInfo> newList = (from m in BoardManager.boardList orderby m.PartNumber ascending, m.boardName ascending select m).ToList<BoardInfo>(); List<BoardInfo> newList = (from m in BoardManager.boardList orderby m.PartNumber ascending, m.boardName ascending select m).ToList<BoardInfo>();
...@@ -34,31 +42,12 @@ namespace URSoldering.Client ...@@ -34,31 +42,12 @@ namespace URSoldering.Client
cmbBoardList.SelectedIndex = 0; cmbBoardList.SelectedIndex = 0;
} }
this.listPoint.Columns.Clear(); this.listPoint.Columns.Clear();
ColumnHeader chName = new ColumnHeader(); AddColumn("焊点名称", 120);
chName.Text = "焊点名称"; //设置列标题 AddColumn("类型", 90);
chName.Width = 150; //设置列宽度 AddColumn("预热温度", 90);
chName.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式 AddColumn("焊接温度", 90);
this.listPoint.Columns.Add(chName); //将列头添加到ListView控件。 AddColumn("初始送丝", 90);
//ColumnHeader chValue = new ColumnHeader(); AddColumn("送丝量", 80);
//chValue.Text = "预热温度"; //设置列标题
//chValue.Width = 80; //设置列宽度
//chValue.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
//this.listPoint.Columns.Add(chValue); //将列头添加到ListView控件。
ColumnHeader chStatus = new ColumnHeader();
chStatus.Text = "焊接温度"; //设置列标题
chStatus.Width = 80; //设置列宽度
chStatus.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
this.listPoint.Columns.Add(chStatus); //将列头添加到ListView控件。
ColumnHeader preSendwire = new ColumnHeader();
preSendwire.Text = "初始送丝"; //设置列标题
preSendwire.Width = 80; //设置列宽度
preSendwire.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
this.listPoint.Columns.Add(preSendwire); //将列头添加到ListView控件。
ColumnHeader sendWire = new ColumnHeader();
sendWire.Text = "送丝量"; //设置列标题
sendWire.Width = 60; //设置列宽度
sendWire.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
this.listPoint.Columns.Add(sendWire); //将列头添加到ListView控件。
} }
private void btnSave_Click(object sender, EventArgs e) private void btnSave_Click(object sender, EventArgs e)
{ {
...@@ -95,7 +84,7 @@ namespace URSoldering.Client ...@@ -95,7 +84,7 @@ namespace URSoldering.Client
txtWidth.Text = board.boardWidth.ToString(); txtWidth.Text = board.boardWidth.ToString();
txtPointCount.Text = board.pointList.Count.ToString(); txtPointCount.Text = board.pointList.Count.ToString();
txtMianji.Text = (board.boardLength * board.boardWidth).ToString(); txtMianji.Text = (board.boardLength * board.boardWidth).ToString();
txtCode.Text = board.WareCode; txtAOIName.Text = board.AoiFileName;
loadPictureBoxSize(board); loadPictureBoxSize(board);
LoadPoint(board); LoadPoint(board);
} }
...@@ -115,7 +104,9 @@ namespace URSoldering.Client ...@@ -115,7 +104,9 @@ namespace URSoldering.Client
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.ImageIndex = i; lvi.ImageIndex = i;
lvi.Text = point.pointName; lvi.Text = point.pointName;
lvi.SubItems.Add(point.TypeValue);
lvi.SubItems.Add(point.preheatTemperature.ToString());
lvi.SubItems.Add(point.weldTemperature.ToString()); lvi.SubItems.Add(point.weldTemperature.ToString());
lvi.SubItems.Add((point.startSendWireSpeed * point.startSendWireTime).ToString()); lvi.SubItems.Add((point.startSendWireSpeed * point.startSendWireTime).ToString());
lvi.SubItems.Add((point.sendWireTime * point.sendWireSpeed).ToString()); lvi.SubItems.Add((point.sendWireTime * point.sendWireSpeed).ToString());
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{ {
this.groupPoint = new System.Windows.Forms.GroupBox(); this.groupPoint = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label17 = new System.Windows.Forms.Label(); this.lblMsg = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.txtClearTime = new System.Windows.Forms.TextBox(); this.txtClearTime = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
...@@ -102,14 +102,14 @@ ...@@ -102,14 +102,14 @@
this.groupPoint.Controls.Add(this.gbWireFeeding); this.groupPoint.Controls.Add(this.gbWireFeeding);
this.groupPoint.Location = new System.Drawing.Point(3, 1); this.groupPoint.Location = new System.Drawing.Point(3, 1);
this.groupPoint.Name = "groupPoint"; this.groupPoint.Name = "groupPoint";
this.groupPoint.Size = new System.Drawing.Size(712, 487); this.groupPoint.Size = new System.Drawing.Size(737, 487);
this.groupPoint.TabIndex = 61; this.groupPoint.TabIndex = 61;
this.groupPoint.TabStop = false; this.groupPoint.TabStop = false;
this.groupPoint.Text = "修改焊点[P2]"; this.groupPoint.Text = "修改焊点[P2]";
// //
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.label17); this.groupBox1.Controls.Add(this.lblMsg);
this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.txtClearTime); this.groupBox1.Controls.Add(this.txtClearTime);
this.groupBox1.Controls.Add(this.label15); this.groupBox1.Controls.Add(this.label15);
...@@ -118,22 +118,21 @@ ...@@ -118,22 +118,21 @@
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtName); this.groupBox1.Controls.Add(this.txtName);
this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(21, 19); this.groupBox1.Location = new System.Drawing.Point(33, 30);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(470, 119); this.groupBox1.Size = new System.Drawing.Size(470, 119);
this.groupBox1.TabIndex = 59; this.groupBox1.TabIndex = 59;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "焊点基本信息"; this.groupBox1.Text = "焊点基本信息";
// //
// label17 // lblMsg
// //
this.label17.AutoSize = true; this.lblMsg.AutoSize = true;
this.label17.Location = new System.Drawing.Point(219, 68); this.lblMsg.Location = new System.Drawing.Point(233, 68);
this.label17.Name = "label17"; this.lblMsg.Name = "lblMsg";
this.label17.Size = new System.Drawing.Size(92, 17); this.lblMsg.Size = new System.Drawing.Size(92, 17);
this.label17.TabIndex = 66; this.lblMsg.TabIndex = 66;
this.label17.Text = "正常焊接的焊点"; this.lblMsg.Text = "正常焊接的焊点";
this.label17.Visible = false;
// //
// label16 // label16
// //
...@@ -181,11 +180,13 @@ ...@@ -181,11 +180,13 @@
this.cmbPointType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbPointType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPointType.FormattingEnabled = true; this.cmbPointType.FormattingEnabled = true;
this.cmbPointType.Items.AddRange(new object[] { this.cmbPointType.Items.AddRange(new object[] {
"普通焊点"}); "普通焊点",
"中间点"});
this.cmbPointType.Location = new System.Drawing.Point(92, 65); this.cmbPointType.Location = new System.Drawing.Point(92, 65);
this.cmbPointType.Name = "cmbPointType"; this.cmbPointType.Name = "cmbPointType";
this.cmbPointType.Size = new System.Drawing.Size(121, 25); this.cmbPointType.Size = new System.Drawing.Size(121, 25);
this.cmbPointType.TabIndex = 61; this.cmbPointType.TabIndex = 61;
this.cmbPointType.SelectedIndexChanged += new System.EventHandler(this.cmbPointType_SelectedIndexChanged);
// //
// label2 // label2
// //
...@@ -217,7 +218,7 @@ ...@@ -217,7 +218,7 @@
// //
this.groupBox2.Controls.Add(this.urRobot); this.groupBox2.Controls.Add(this.urRobot);
this.groupBox2.Controls.Add(this.btnUpdate); this.groupBox2.Controls.Add(this.btnUpdate);
this.groupBox2.Location = new System.Drawing.Point(499, 139); this.groupBox2.Location = new System.Drawing.Point(527, 159);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(202, 306); this.groupBox2.Size = new System.Drawing.Size(202, 306);
this.groupBox2.TabIndex = 60; this.groupBox2.TabIndex = 60;
...@@ -243,7 +244,7 @@ ...@@ -243,7 +244,7 @@
// //
// btnSave // btnSave
// //
this.btnSave.Location = new System.Drawing.Point(540, 31); this.btnSave.Location = new System.Drawing.Point(581, 52);
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(120, 35); this.btnSave.Size = new System.Drawing.Size(120, 35);
this.btnSave.TabIndex = 57; this.btnSave.TabIndex = 57;
...@@ -277,7 +278,7 @@ ...@@ -277,7 +278,7 @@
this.gbIron.Controls.Add(this.lblIronTime); this.gbIron.Controls.Add(this.lblIronTime);
this.gbIron.Controls.Add(this.txtDweldTemperature); this.gbIron.Controls.Add(this.txtDweldTemperature);
this.gbIron.Controls.Add(this.txtDweldTime); this.gbIron.Controls.Add(this.txtDweldTime);
this.gbIron.Location = new System.Drawing.Point(21, 139); this.gbIron.Location = new System.Drawing.Point(33, 155);
this.gbIron.Name = "gbIron"; this.gbIron.Name = "gbIron";
this.gbIron.Size = new System.Drawing.Size(470, 188); this.gbIron.Size = new System.Drawing.Size(470, 188);
this.gbIron.TabIndex = 55; this.gbIron.TabIndex = 55;
...@@ -502,7 +503,7 @@ ...@@ -502,7 +503,7 @@
// //
// btnCancel // btnCancel
// //
this.btnCancel.Location = new System.Drawing.Point(540, 74); this.btnCancel.Location = new System.Drawing.Point(581, 95);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 35); this.btnCancel.Size = new System.Drawing.Size(120, 35);
this.btnCancel.TabIndex = 58; this.btnCancel.TabIndex = 58;
...@@ -524,7 +525,7 @@ ...@@ -524,7 +525,7 @@
this.gbWireFeeding.Controls.Add(this.lblWirdFeedingTime); this.gbWireFeeding.Controls.Add(this.lblWirdFeedingTime);
this.gbWireFeeding.Controls.Add(this.txtStartDsendWireSpeed); this.gbWireFeeding.Controls.Add(this.txtStartDsendWireSpeed);
this.gbWireFeeding.Controls.Add(this.txtDsendWireTime); this.gbWireFeeding.Controls.Add(this.txtDsendWireTime);
this.gbWireFeeding.Location = new System.Drawing.Point(21, 329); this.gbWireFeeding.Location = new System.Drawing.Point(33, 349);
this.gbWireFeeding.Name = "gbWireFeeding"; this.gbWireFeeding.Name = "gbWireFeeding";
this.gbWireFeeding.Size = new System.Drawing.Size(470, 116); this.gbWireFeeding.Size = new System.Drawing.Size(470, 116);
this.gbWireFeeding.TabIndex = 56; this.gbWireFeeding.TabIndex = 56;
...@@ -639,14 +640,14 @@ ...@@ -639,14 +640,14 @@
this.txtDsendWireTime.TabIndex = 42; this.txtDsendWireTime.TabIndex = 42;
this.txtDsendWireTime.Text = "2"; this.txtDsendWireTime.Text = "2";
// //
// FrmWeldPointInfo // FrmPointInfo
// //
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(719, 491); this.ClientSize = new System.Drawing.Size(744, 491);
this.Controls.Add(this.groupPoint); this.Controls.Add(this.groupPoint);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmWeldPointInfo"; this.Name = "FrmPointInfo";
this.Text = "FrmWeldPointInfo"; this.Text = "FrmWeldPointInfo";
this.Load += new System.EventHandler(this.FrmWeldPointInfo_Load); this.Load += new System.EventHandler(this.FrmWeldPointInfo_Load);
this.groupPoint.ResumeLayout(false); this.groupPoint.ResumeLayout(false);
...@@ -714,7 +715,7 @@ ...@@ -714,7 +715,7 @@
private System.Windows.Forms.TextBox txtClearTime; private System.Windows.Forms.TextBox txtClearTime;
private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label17; private System.Windows.Forms.Label lblMsg;
private System.Windows.Forms.GroupBox groupPoint; private System.Windows.Forms.GroupBox groupPoint;
private UserFromControl.URRobotMControl urRobot; private UserFromControl.URRobotMControl urRobot;
} }
......
...@@ -87,68 +87,18 @@ namespace URSoldering.Client ...@@ -87,68 +87,18 @@ namespace URSoldering.Client
int wTemp = FormUtil.GetIntValue(txtDweldTemperature); int wTemp = FormUtil.GetIntValue(txtDweldTemperature);
int wTempMax = FormUtil.GetIntValue(txtDweldTemMax); int wTempMax = FormUtil.GetIntValue(txtDweldTemMax);
int wTempMin = FormUtil.GetIntValue(txtDweldTemMin ); int wTempMin = FormUtil.GetIntValue(txtDweldTemMin );
if (ptemp > 400) double sendSpeed = FormUtil.getDoubleValue(txtDsendWireSpeed);
{ double sendtime = FormUtil.getDoubleValue(this.txtDsendWireTime);
MessageBox.Show("预热温度范围:200°-400°"); double startsendSpeed = FormUtil.getDoubleValue(txtStartDsendWireSpeed);
txtDpreheatTemperature.Focus(); double startsendTime = FormUtil.getDoubleValue(txtStartDsendWireTime);
return; string name = FormUtil.getValue(txtName);
} int clearTime = FormUtil.GetIntValue(txtClearTime);
if (ptempmin < 0)
{
MessageBox.Show("预热温度下限必须大于0°");
txtDweldTemMin.Focus();
return;
} if (wTemp > 400)
{
MessageBox.Show("焊接温度范围:200°-400°");
txtDweldTemperature.Focus();
return;
}
if (wTempMin < 0)
{
MessageBox.Show("焊接温度下限必须大于0°");
txtPreTempMin.Focus();
return;
}
if (ptempmax < ptempmin)
{
MessageBox.Show("预设温度上限必须大于预设温度下限");
this.txtPreTempMax.Focus();
return;
}
if (wTempMax < wTempMin)
{
MessageBox.Show("焊接温度上限必须大于焊接温度下限");
this.txtDweldTemMax.Focus();
return;
}
if (!(ptempmin <= ptemp && ptemp <= ptempmax))
{
MessageBox.Show("预设温度范围在:" + ptempmin + "°-"+ptempmax+"°");
this.txtDpreheatTemperature.Focus();
return;
}
if (!(wTempMin <= wTemp && wTemp <= wTempMax))
{
MessageBox.Show("焊接温度范围在:" + wTempMin + "°-" + wTempMax + "°");
this.txtDweldTemperature.Focus();
return;
}
double pTime = FormUtil.getDoubleValue(txtDpreheatTime); double pTime = FormUtil.getDoubleValue(txtDpreheatTime);
if (pTime < 0 || pTime > 60)
{
MessageBox.Show("预热时间范围:0-60!");
txtDpreheatTime.Focus();
return;
}
double wTime = FormUtil.getDoubleValue(txtDweldTime); double wTime = FormUtil.getDoubleValue(txtDweldTime);
if (pTime < 0 || pTime > 60) if (name.Equals(""))
{ {
MessageBox.Show("焊接时间范围:0-60!"); MessageBox.Show("请输入焊点名称!");
txtDweldTime.Focus(); txtName.Focus();
return; return;
} }
if (cmbPointType.SelectedIndex < 0) if (cmbPointType.SelectedIndex < 0)
...@@ -157,53 +107,108 @@ namespace URSoldering.Client ...@@ -157,53 +107,108 @@ namespace URSoldering.Client
cmbPointType.Focus(); cmbPointType.Focus();
return; return;
} }
double sendSpeed = FormUtil.getDoubleValue(txtDsendWireSpeed); int pointType = cmbPointType.SelectedIndex;
double sendtime = FormUtil.getDoubleValue(this.txtDsendWireTime); if (pointType.Equals(0))
double startsendSpeed = FormUtil.getDoubleValue(txtStartDsendWireSpeed);
double startsendTime = FormUtil.getDoubleValue(txtStartDsendWireTime);
if (startsendSpeed < 0)
{ {
MessageBox.Show("请正确输入起始送丝速度!"); if (ptemp > 400)
txtStartDsendWireSpeed.Focus(); {
return; MessageBox.Show("预热温度范围:200°-400°");
} txtDpreheatTemperature.Focus();
return;
}
if (ptempmin < 0)
{
MessageBox.Show("预热温度下限必须大于0°");
txtDweldTemMin.Focus();
return;
}
if (wTemp > 400)
{
MessageBox.Show("焊接温度范围:200°-400°");
txtDweldTemperature.Focus();
return;
}
if (wTempMin < 0)
{
MessageBox.Show("焊接温度下限必须大于0°");
txtPreTempMin.Focus();
return;
}
if (ptempmax < ptempmin)
{
MessageBox.Show("预设温度上限必须大于预设温度下限");
this.txtPreTempMax.Focus();
return;
}
if (wTempMax < wTempMin)
{
MessageBox.Show("焊接温度上限必须大于焊接温度下限");
this.txtDweldTemMax.Focus();
return;
}
if (!(ptempmin <= ptemp && ptemp <= ptempmax))
{
MessageBox.Show("预设温度范围在:" + ptempmin + "°-" + ptempmax + "°");
this.txtDpreheatTemperature.Focus();
return;
}
if (startsendTime < 0) if (!(wTempMin <= wTemp && wTemp <= wTempMax))
{ {
MessageBox.Show("起始送丝时间范围:0-60"); MessageBox.Show("焊接温度范围在:" + wTempMin + "°-" + wTempMax + "°");
txtStartDsendWireTime.Focus(); this.txtDweldTemperature.Focus();
return; return;
} }
if (sendSpeed < 0)
{
MessageBox.Show("请正确输入送丝速度!");
txtDsendWireSpeed.Focus();
return;
}
if (sendtime < 0 || sendtime > 60) if (pTime < 0 || pTime > 60)
{ {
MessageBox.Show("送丝时间范围:0-60 "); MessageBox.Show("预热时间范围:0-60!");
txtDsendWireSpeed.Focus(); txtDpreheatTime.Focus();
return; return;
} }
string name = FormUtil.getValue(txtName); if (pTime < 0 || pTime > 60)
if (name.Equals("")) {
{ MessageBox.Show("焊接时间范围:0-60!");
MessageBox.Show("请输入焊点名称!"); txtDweldTime.Focus();
txtName.Focus(); return;
return; }
}
int clearTime = FormUtil.GetIntValue(txtClearTime); if (startsendSpeed < 0)
if (chbClear.Checked) {
{ MessageBox.Show("请正确输入起始送丝速度!");
if (clearTime <= 0) txtStartDsendWireSpeed.Focus();
return;
}
if (startsendTime < 0)
{
MessageBox.Show("起始送丝时间范围:0-60");
txtStartDsendWireTime.Focus();
return;
}
if (sendSpeed < 0)
{ {
MessageBox.Show("请输入清洗时间!"); MessageBox.Show("请正确输入送丝速度!");
txtClearTime.Focus(); txtDsendWireSpeed.Focus();
return; return;
} }
if (sendtime < 0 || sendtime > 60)
{
MessageBox.Show("送丝时间范围:0-60 ");
txtDsendWireSpeed.Focus();
return;
}
if (chbClear.Checked)
{
if (clearTime <= 0)
{
MessageBox.Show("请输入清洗时间!");
txtClearTime.Focus();
return;
}
}
} }
weldPointInfo.preheatTemperature = ptemp; weldPointInfo.preheatTemperature = ptemp;
weldPointInfo.preheatTime = pTime; weldPointInfo.preheatTime = pTime;
...@@ -224,7 +229,7 @@ namespace URSoldering.Client ...@@ -224,7 +229,7 @@ namespace URSoldering.Client
URPointValue p = urRobot.GetPoint(); URPointValue p = urRobot.GetPoint();
weldPointInfo.RobotX = p.X; weldPointInfo.RobotX = p.X;
weldPointInfo.RoobtY = p.Y; weldPointInfo.RobotY = p.Y;
weldPointInfo.RobotZ = p.Z; weldPointInfo.RobotZ = p.Z;
weldPointInfo.RobotRX = p.RX; weldPointInfo.RobotRX = p.RX;
...@@ -280,6 +285,21 @@ namespace URSoldering.Client ...@@ -280,6 +285,21 @@ namespace URSoldering.Client
txtClearTime.Enabled = false; txtClearTime.Enabled = false;
} }
} }
private void cmbPointType_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbPointType.SelectedIndex.Equals(0))
{
lblMsg .Text= "正常焊接的焊点";
gbIron.Enabled = true ;
gbWireFeeding.Enabled = true ;
}
else if (cmbPointType.SelectedIndex.Equals(1))
{
lblMsg.Text = "两个焊点之间的位置跳转点";
gbIron.Enabled = false;
gbWireFeeding.Enabled = false;
}
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!