Commit 5b8bfa55 几米阳光

增加Z轴最低点配置和验证

1 个父辈 5233cad6
......@@ -561,7 +561,20 @@ namespace URSoldering.DeviceLibrary
{
return LastPoint;
}
/// <summary>
/// 是否是有效的z轴
/// </summary>
/// <param name="z"></param>
/// <returns></returns>
public static bool IsValidZ(double z)
{
return true;
if (z >= Robot_LIM_Z)
{
return true;
}
return false;
}
}
public class URPointValue
{
......
......@@ -55,6 +55,8 @@
this.panBoard = new System.Windows.Forms.Panel();
this.picBoard = new System.Windows.Forms.PictureBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label17 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.txtCode = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.chbIsSafe = new System.Windows.Forms.CheckBox();
......@@ -133,8 +135,6 @@
this.btnSStop = new System.Windows.Forms.Button();
this.btnWStop = new System.Windows.Forms.Button();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picRight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picLeft)).BeginInit();
......@@ -426,9 +426,27 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "机器人实时坐标";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(834, 66);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(30, 17);
this.label17.TabIndex = 330;
this.label17.Text = "mm";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(833, 35);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(41, 17);
this.label15.TabIndex = 329;
this.label15.Text = "mm/s";
//
// txtCode
//
this.txtCode.Location = new System.Drawing.Point(39, 19);
this.txtCode.Location = new System.Drawing.Point(39, 155);
this.txtCode.Name = "txtCode";
this.txtCode.Size = new System.Drawing.Size(155, 23);
this.txtCode.TabIndex = 268;
......@@ -437,7 +455,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(5, 22);
this.label10.Location = new System.Drawing.Point(5, 158);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(32, 17);
this.label10.TabIndex = 267;
......@@ -1253,24 +1271,6 @@
this.label14.Text = "条形码";
this.label14.Visible = false;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(833, 35);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(41, 17);
this.label15.TabIndex = 329;
this.label15.Text = "mm/s";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(834, 66);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(30, 17);
this.label17.TabIndex = 330;
this.label17.Text = "mm";
//
// FrmBoardInfo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......
......@@ -172,6 +172,10 @@ namespace URSoldering.Client
lblRobotRX.Text = point.RX.ToString();
lblRobotRY.Text = point.RY.ToString();
lblRobotRZ.Text = point.RZ.ToString();
if (!URRobotControl.IsValidZ(point.Z))
{
label11.Text = label11.Text + " " + "机器人低于最低Z点";
}
}
private bool SureMoveRobot()
{
......@@ -274,6 +278,7 @@ namespace URSoldering.Client
private void timer_Elapsed(object sender, EventArgs e)
{
label11.Text = URRobotControl.GetStatus();
//判断是否开急停
if (RobotBean.ShuddenOK().Equals(false))
{
......@@ -335,9 +340,10 @@ namespace URSoldering.Client
{
URPointValue point = GetCurrRobotPoint();
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
AddNewPoint(point);
......@@ -926,11 +932,16 @@ namespace URSoldering.Client
{
URPointValue point = GetCurrRobotPoint();
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,原点Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return;
//}
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,原点Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,原点Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
}
DialogResult result = MessageBox.Show("是否将当前位置" +point.ToShowStr() + "保存为原点?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
......@@ -1058,6 +1069,11 @@ namespace URSoldering.Client
{
URPointValue point = GetCurrRobotPoint();
point.Z -= StepValue;
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("已达到最低Z轴,无法向下移动","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
RovotMove(point);
}
......@@ -1256,11 +1272,16 @@ namespace URSoldering.Client
{
URPointValue point = GetCurrRobotPoint();
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,清洗点1的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return;
//}
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,清洗点1的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,清洗点1的Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
}
DialogResult result = MessageBox.Show("是否将当前位置" +point.ToShowStr()+ "保存为清洗点1?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
......@@ -1273,12 +1294,16 @@ namespace URSoldering.Client
{
URPointValue point = GetCurrRobotPoint();
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,清洗点2的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return;
//}
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,清洗点2的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,清洗点2的Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
DialogResult result = MessageBox.Show("是否将当前位置" + point.ToShowStr() + "保存为清洗点2?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
......
......@@ -108,9 +108,14 @@ namespace URSoldering.Client
private DialogResult ShowConfire(URPointValue point, string strMsg)
{
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,"+ strMsg + "的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return DialogResult.Cancel;
//}
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,"+ strMsg + "的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return DialogResult.Cancel;
}
......
......@@ -257,9 +257,14 @@ namespace URSoldering.Client
URPointValue point = URRobotControl.GetLastPosition();
//判断原点的Z轴
if (point.Z > URRobotControl.Robot_LIM_Z)
//if (point.Z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return;
//}
if (!URRobotControl.IsValidZ(point.Z))
{
MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能低于最低Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
DialogResult result = MessageBox.Show("当前坐标:" +point.ToShowStr()+ ",是否确定更新?", "提示", MessageBoxButtons.YesNo);
......
......@@ -230,7 +230,7 @@
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(63, 17);
this.label8.TabIndex = 6;
this.label8.Text = "最Z点:";
this.label8.Text = "最Z点:";
//
// groupBox5
//
......@@ -260,7 +260,7 @@
this.minControl.Size = new System.Drawing.Size(168, 226);
this.minControl.TabIndex = 2;
//
// FrmSolderingSetting
// FrmSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
......@@ -273,7 +273,7 @@
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnSaveSetting);
this.Controls.Add(this.gbEpsonSetting);
this.Name = "FrmSolderingSetting";
this.Name = "FrmSetting";
this.Text = "设备配置";
this.Load += new System.EventHandler(this.FrmRobotSetting_Load);
this.groupBox3.ResumeLayout(false);
......
......@@ -26,23 +26,7 @@ namespace URSoldering.Client
}
private void getValue()
{
//int index = -1;
//foreach (BoardInfo obj in BoardManager.boardList)
//{
// index++;
// if (obj.boardId.Equals(BoardManager.CurrBoardId))
// {
// break;
// }
//}
//if (index >= 0)
//{
// cmbBoardList.SelectedIndex = index;
//}
//this.txtOriginX.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_X);
//this.txtOriginY.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_Y);
//int ch = WeldRobotBean.SendWireXiShu;
txtLimZ.Text = ((double)ConfigAppSettings.GetNumValue(Setting_Init.Soldering_LIM_Z)).ToString();
txtsendWireSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireSpeed);
txtsendWireTime.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireTime);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!