1、修复在于Hexcal 补偿过程中的通讯问题;2、改变监听端口方式,改为监听所有端口,不在固定 测量机默认IP 100.0.0.1 ;

This commit is contained in:
zhengxuan.zhang
2024-03-11 10:37:51 +08:00
parent 8e15635264
commit 92705068f7
8 changed files with 207 additions and 273 deletions
+24 -24
View File
@@ -185,9 +185,9 @@
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.btn_movepose = new System.Windows.Forms.Button();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox_y = new System.Windows.Forms.TextBox();
this.textBox_z = new System.Windows.Forms.TextBox();
this.textBox_x = new System.Windows.Forms.TextBox();
this.label46 = new System.Windows.Forms.Label();
this.label45 = new System.Windows.Forms.Label();
this.label44 = new System.Windows.Forms.Label();
@@ -1792,9 +1792,9 @@
//
this.groupBox8.Controls.Add(this.btn_movepose);
this.groupBox8.Controls.Add(this.checkBox1);
this.groupBox8.Controls.Add(this.textBox3);
this.groupBox8.Controls.Add(this.textBox2);
this.groupBox8.Controls.Add(this.textBox1);
this.groupBox8.Controls.Add(this.textBox_y);
this.groupBox8.Controls.Add(this.textBox_z);
this.groupBox8.Controls.Add(this.textBox_x);
this.groupBox8.Controls.Add(this.label46);
this.groupBox8.Controls.Add(this.label45);
this.groupBox8.Controls.Add(this.label44);
@@ -1825,26 +1825,26 @@
this.checkBox1.Text = "等待";
this.checkBox1.UseVisualStyleBackColor = true;
//
// textBox3
// textBox_y
//
this.textBox3.Location = new System.Drawing.Point(149, 54);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 21);
this.textBox3.TabIndex = 5;
this.textBox_y.Location = new System.Drawing.Point(149, 54);
this.textBox_y.Name = "textBox_y";
this.textBox_y.Size = new System.Drawing.Size(100, 21);
this.textBox_y.TabIndex = 5;
//
// textBox2
// textBox_z
//
this.textBox2.Location = new System.Drawing.Point(149, 87);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 4;
this.textBox_z.Location = new System.Drawing.Point(149, 87);
this.textBox_z.Name = "textBox_z";
this.textBox_z.Size = new System.Drawing.Size(100, 21);
this.textBox_z.TabIndex = 4;
//
// textBox1
// textBox_x
//
this.textBox1.Location = new System.Drawing.Point(149, 21);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 3;
this.textBox_x.Location = new System.Drawing.Point(149, 21);
this.textBox_x.Name = "textBox_x";
this.textBox_x.Size = new System.Drawing.Size(100, 21);
this.textBox_x.TabIndex = 3;
//
// label46
//
@@ -2252,9 +2252,9 @@
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Button btn_movepose;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox_y;
private System.Windows.Forms.TextBox textBox_z;
private System.Windows.Forms.TextBox textBox_x;
private System.Windows.Forms.Label label46;
private System.Windows.Forms.Label label45;
private System.Windows.Forms.Label label44;
+41
View File
@@ -5,6 +5,7 @@ using System.Windows.Forms;
using ACS.SPiiPlusNET;
using HexcalMC.Base;
using HexcalMC.Properties;
using Telerik.WinControls.UI;
// ACS .NET Library
@@ -892,6 +893,46 @@ namespace HexcalMC
private void btn_movepose_Click(object sender, EventArgs e)
{
//判断是否为textBox_x空
if (string.IsNullOrWhiteSpace(textBox_x.Text) || string.IsNullOrEmpty(textBox_y.Text) ||
string.IsNullOrEmpty(textBox_z.Text))
{
MessageBox.Show("输入文本框为空,请修改", "警告");
return;
}
//获取 textBox_x 的值
double x = double.Parse(textBox_x.Text);
double y = double.Parse(textBox_y.Text);
double z = double.Parse(textBox_z.Text);
Point3D _point3D = new Point3D(x, y, z);
if (MainFrom.IsWithinStrokes(_point3D)) //判断点是否在行程范围内
{
double[] pointsArray =
{
_point3D.X,
_point3D.Y,
_point3D.Z
};
//执行运动指令
_acs.ToPointM(MotionFlags.ACSC_NONE, MainFrom.UseAxis, pointsArray); //多轴运动到指定位置
////等待运动完成
//for (int i = 0; i < USE_AXIS.Length; i++)
//{
// _acs.WaitMotionEnd(USE_AXIS[i], _motionTimeout); //等待回家完成
//}
//_currentMotionState = MotionStates.InPos;
//DebugDfn.AddLogText("运动到位");
}
else
{
DebugDfn.AddLogText("目标位置超出行程范围,请重新设置");
MessageBox.Show("目标位置超出行程范围,请重新设置", "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btn_start_Click(object sender, EventArgs e)