diff --git a/HexcalMC/Hexcal/TcpIpServer.cs b/HexcalMC/Hexcal/TcpIpServer.cs
index f164d72..9c42ebb 100644
--- a/HexcalMC/Hexcal/TcpIpServer.cs
+++ b/HexcalMC/Hexcal/TcpIpServer.cs
@@ -6,6 +6,7 @@ using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Windows.Forms;
+using HexcalMC.Base;
using Timer = System.Windows.Forms.Timer;
namespace HexcalMC.Hexcal
@@ -64,8 +65,8 @@ namespace HexcalMC.Hexcal
{
try
{
- _serverTimer.Tick += ServerTimerLoop; //510,增加时钟,判断是否有断掉的连接。
- _serverTimer.Start();
+ //_serverTimer.Tick += ServerTimerLoop; //510,增加时钟,判断是否有断掉的连接。
+ //_serverTimer.Start();
_mWatchSocket =
new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //创建负责监听的套接字,注意其中的参数;
@@ -304,6 +305,7 @@ namespace HexcalMC.Hexcal
{
success = TrySendData(soc, arrMsg);
attemptCount++;
+ DebugDfn.AddLogText("正在重发");
}
}
}
@@ -382,7 +384,7 @@ namespace HexcalMC.Hexcal
for (int i = _dictSocket.Values.ToArray().Length - 1; i >= 0; i--)
{
if (_dictSocket.Values.ToArray()[i]
- .Poll(10, SelectMode.SelectRead)) //10毫秒,检查套接字状态, SelectMode 参数指定要监视的套接字的类别。
+ .Poll(100, SelectMode.SelectRead)) //10毫秒,检查套接字状态, SelectMode 参数指定要监视的套接字的类别。
{
// DictSocket.Remove(DictSocket.Keys.ToArray()[i]);
diff --git a/HexcalMC/HexcalMC.csproj b/HexcalMC/HexcalMC.csproj
index 405214f..739563f 100644
--- a/HexcalMC/HexcalMC.csproj
+++ b/HexcalMC/HexcalMC.csproj
@@ -19,6 +19,27 @@
+ true
+ ftp://wio.me/upgrade/dotnet/Hexcal/
+ true
+ Web
+ true
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ http://wio.me/upgrade/dotnet/Hexcal/
+ Zhengxuan.zhang
+ HexcalMC
+ true
+ publish.htm
+ 2
+ 1.0.0.%2a
+ false
+ true
+ true
x86
@@ -64,6 +85,18 @@
Hexagon.ico
+
+ 6EDD851028CAF15F53977FDAABCEB5A0859CFE89
+
+
+ HexcalMC_TemporaryKey.pfx
+
+
+ true
+
+
+ true
+
False
@@ -203,6 +236,7 @@
True
+
SettingsSingleFileGenerator
@@ -249,6 +283,18 @@
+
+
+ False
+ Microsoft .NET Framework 4.6.2 %28x86 和 x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
diff --git a/HexcalMC/MainFrom.Designer.cs b/HexcalMC/MainFrom.Designer.cs
index 32dbc52..fc8d428 100644
--- a/HexcalMC/MainFrom.Designer.cs
+++ b/HexcalMC/MainFrom.Designer.cs
@@ -50,6 +50,7 @@
this.radRibbonBarGroup5 = new Telerik.WinControls.UI.RadRibbonBarGroup();
this.radRibbonBarButtonGroup7 = new Telerik.WinControls.UI.RadRibbonBarButtonGroup();
this.rtb_demo = new Telerik.WinControls.UI.RadButtonElement();
+ this.radRibbonBarGroup6 = new Telerik.WinControls.UI.RadRibbonBarGroup();
this.ribbonTab2 = new Telerik.WinControls.UI.RibbonTab();
this.radRibbonBarGroup2 = new Telerik.WinControls.UI.RadRibbonBarGroup();
this.rtb_about = new Telerik.WinControls.UI.RadButtonElement();
@@ -87,28 +88,21 @@
this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.lamp_hexcal = new HexcalMC.Lamp();
this.Btn_StopServer = new System.Windows.Forms.Button();
this.Btn_StartServer = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.grpSafety = new System.Windows.Forms.GroupBox();
this.lblEMG = new System.Windows.Forms.Label();
- this.lblRL3 = new System.Windows.Forms.Label();
- this.lblLL3 = new System.Windows.Forms.Label();
this.lblRL2 = new System.Windows.Forms.Label();
this.lblLL2 = new System.Windows.Forms.Label();
this.lblRL1 = new System.Windows.Forms.Label();
- this.lblRL4 = new System.Windows.Forms.Label();
this.lblLL1 = new System.Windows.Forms.Label();
- this.lblLL4 = new System.Windows.Forms.Label();
this.lblRL0 = new System.Windows.Forms.Label();
this.lblLL0 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
- this.label33 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
@@ -128,7 +122,6 @@
this.btnEnable = new System.Windows.Forms.Button();
this.btnDisable = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.lamp_acs = new HexcalMC.Lamp();
this.txtPort = new System.Windows.Forms.TextBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.btn_ACSStop = new System.Windows.Forms.Button();
@@ -139,7 +132,8 @@
this.TextBoxMsg = new System.Windows.Forms.RichTextBox();
this.tmrMonitor = new System.Windows.Forms.Timer(this.components);
this.timer_RefreshUI = new System.Windows.Forms.Timer(this.components);
- this.radRibbonBarGroup6 = new Telerik.WinControls.UI.RadRibbonBarGroup();
+ this.lamp_hexcal = new HexcalMC.Lamp();
+ this.lamp_acs = new HexcalMC.Lamp();
((System.ComponentModel.ISupportInitialize)(this.radRibbonBar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radRibbonBarBackstageView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radStatusStrip1)).BeginInit();
@@ -335,6 +329,11 @@
this.rtb_demo.TextAlignment = System.Drawing.ContentAlignment.BottomLeft;
this.rtb_demo.Click += new System.EventHandler(this.rtb_demo_Click);
//
+ // radRibbonBarGroup6
+ //
+ this.radRibbonBarGroup6.Name = "radRibbonBarGroup6";
+ this.radRibbonBarGroup6.Text = "快速定位";
+ //
// ribbonTab2
//
this.ribbonTab2.AutoEllipsis = false;
@@ -404,7 +403,7 @@
//
this.radRibbonBar1.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.radRibbonBar1.ShowExpandButton = false;
- this.radRibbonBar1.Size = new System.Drawing.Size(1192, 176);
+ this.radRibbonBar1.Size = new System.Drawing.Size(1192, 173);
this.radRibbonBar1.StartButtonImage = global::HexcalMC.Properties.Resources.Hexagon;
this.radRibbonBar1.StartMenuItems.AddRange(new Telerik.WinControls.RadItem[] {
this.radMenuItem2});
@@ -610,7 +609,7 @@
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer1.Location = new System.Drawing.Point(0, 176);
+ this.splitContainer1.Location = new System.Drawing.Point(0, 173);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
@@ -624,7 +623,7 @@
//
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer1.Panel2.Controls.Add(this.groupBox3);
- this.splitContainer1.Size = new System.Drawing.Size(1192, 693);
+ this.splitContainer1.Size = new System.Drawing.Size(1192, 696);
this.splitContainer1.SplitterDistance = 760;
this.splitContainer1.TabIndex = 2;
//
@@ -718,23 +717,11 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "通讯状态";
//
- // lamp_hexcal
- //
- this.lamp_hexcal.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134)));
- this.lamp_hexcal.Location = new System.Drawing.Point(57, 23);
- this.lamp_hexcal.LText = "";
- this.lamp_hexcal.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
- this.lamp_hexcal.Name = "lamp_hexcal";
- this.lamp_hexcal.Shadow = false;
- this.lamp_hexcal.Size = new System.Drawing.Size(24, 24);
- this.lamp_hexcal.State = -1;
- this.lamp_hexcal.TabIndex = 29;
- //
// Btn_StopServer
//
this.Btn_StopServer.Location = new System.Drawing.Point(113, 79);
this.Btn_StopServer.Name = "Btn_StopServer";
- this.Btn_StopServer.Size = new System.Drawing.Size(81, 23);
+ this.Btn_StopServer.Size = new System.Drawing.Size(81, 30);
this.Btn_StopServer.TabIndex = 26;
this.Btn_StopServer.Text = "关闭服务";
this.Btn_StopServer.UseVisualStyleBackColor = true;
@@ -744,7 +731,7 @@
//
this.Btn_StartServer.Location = new System.Drawing.Point(18, 79);
this.Btn_StartServer.Name = "Btn_StartServer";
- this.Btn_StartServer.Size = new System.Drawing.Size(81, 23);
+ this.Btn_StartServer.Size = new System.Drawing.Size(81, 30);
this.Btn_StartServer.TabIndex = 25;
this.Btn_StartServer.Text = "开启服务";
this.Btn_StartServer.UseVisualStyleBackColor = true;
@@ -775,21 +762,15 @@
// grpSafety
//
this.grpSafety.Controls.Add(this.lblEMG);
- this.grpSafety.Controls.Add(this.lblRL3);
- this.grpSafety.Controls.Add(this.lblLL3);
this.grpSafety.Controls.Add(this.lblRL2);
this.grpSafety.Controls.Add(this.lblLL2);
this.grpSafety.Controls.Add(this.lblRL1);
- this.grpSafety.Controls.Add(this.lblRL4);
this.grpSafety.Controls.Add(this.lblLL1);
- this.grpSafety.Controls.Add(this.lblLL4);
this.grpSafety.Controls.Add(this.lblRL0);
this.grpSafety.Controls.Add(this.lblLL0);
this.grpSafety.Controls.Add(this.label18);
this.grpSafety.Controls.Add(this.label27);
- this.grpSafety.Controls.Add(this.label26);
this.grpSafety.Controls.Add(this.label25);
- this.grpSafety.Controls.Add(this.label33);
this.grpSafety.Controls.Add(this.label24);
this.grpSafety.Controls.Add(this.label20);
this.grpSafety.Controls.Add(this.label19);
@@ -809,24 +790,6 @@
this.lblEMG.Size = new System.Drawing.Size(19, 17);
this.lblEMG.TabIndex = 5;
//
- // lblRL3
- //
- this.lblRL3.Image = ((System.Drawing.Image)(resources.GetObject("lblRL3.Image")));
- this.lblRL3.Location = new System.Drawing.Point(142, 67);
- this.lblRL3.Name = "lblRL3";
- this.lblRL3.Size = new System.Drawing.Size(19, 17);
- this.lblRL3.TabIndex = 5;
- this.lblRL3.Tag = "13";
- //
- // lblLL3
- //
- this.lblLL3.Image = ((System.Drawing.Image)(resources.GetObject("lblLL3.Image")));
- this.lblLL3.Location = new System.Drawing.Point(142, 45);
- this.lblLL3.Name = "lblLL3";
- this.lblLL3.Size = new System.Drawing.Size(19, 17);
- this.lblLL3.TabIndex = 5;
- this.lblLL3.Tag = "3";
- //
// lblRL2
//
this.lblRL2.Image = ((System.Drawing.Image)(resources.GetObject("lblRL2.Image")));
@@ -854,15 +817,6 @@
this.lblRL1.TabIndex = 5;
this.lblRL1.Tag = "11";
//
- // lblRL4
- //
- this.lblRL4.Image = ((System.Drawing.Image)(resources.GetObject("lblRL4.Image")));
- this.lblRL4.Location = new System.Drawing.Point(164, 67);
- this.lblRL4.Name = "lblRL4";
- this.lblRL4.Size = new System.Drawing.Size(19, 17);
- this.lblRL4.TabIndex = 5;
- this.lblRL4.Tag = "14";
- //
// lblLL1
//
this.lblLL1.Image = ((System.Drawing.Image)(resources.GetObject("lblLL1.Image")));
@@ -872,15 +826,6 @@
this.lblLL1.TabIndex = 5;
this.lblLL1.Tag = "1";
//
- // lblLL4
- //
- this.lblLL4.Image = ((System.Drawing.Image)(resources.GetObject("lblLL4.Image")));
- this.lblLL4.Location = new System.Drawing.Point(164, 45);
- this.lblLL4.Name = "lblLL4";
- this.lblLL4.Size = new System.Drawing.Size(19, 17);
- this.lblLL4.TabIndex = 5;
- this.lblLL4.Tag = "4";
- //
// lblRL0
//
this.lblRL0.Image = ((System.Drawing.Image)(resources.GetObject("lblRL0.Image")));
@@ -917,15 +862,6 @@
this.label27.Text = "急停";
this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(146, 21);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(13, 13);
- this.label26.TabIndex = 5;
- this.label26.Text = "3";
- //
// label25
//
this.label25.AutoSize = true;
@@ -933,16 +869,7 @@
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(13, 13);
this.label25.TabIndex = 5;
- this.label25.Text = "2";
- //
- // label33
- //
- this.label33.AutoSize = true;
- this.label33.Location = new System.Drawing.Point(168, 21);
- this.label33.Name = "label33";
- this.label33.Size = new System.Drawing.Size(13, 13);
- this.label33.TabIndex = 5;
- this.label33.Text = "4";
+ this.label25.Text = "8";
//
// label24
//
@@ -1005,8 +932,8 @@
this.cboAxisNo.FormattingEnabled = true;
this.cboAxisNo.Items.AddRange(new object[] {
"1",
- "2",
- "4"});
+ "0",
+ "8"});
this.cboAxisNo.Location = new System.Drawing.Point(88, 17);
this.cboAxisNo.Name = "cboAxisNo";
this.cboAxisNo.Size = new System.Drawing.Size(60, 20);
@@ -1104,7 +1031,7 @@
//
this.btnEnable.Location = new System.Drawing.Point(6, 23);
this.btnEnable.Name = "btnEnable";
- this.btnEnable.Size = new System.Drawing.Size(75, 23);
+ this.btnEnable.Size = new System.Drawing.Size(75, 30);
this.btnEnable.TabIndex = 9;
this.btnEnable.Text = "3轴使能";
this.btnEnable.UseVisualStyleBackColor = true;
@@ -1112,9 +1039,9 @@
//
// btnDisable
//
- this.btnDisable.Location = new System.Drawing.Point(6, 52);
+ this.btnDisable.Location = new System.Drawing.Point(6, 53);
this.btnDisable.Name = "btnDisable";
- this.btnDisable.Size = new System.Drawing.Size(75, 23);
+ this.btnDisable.Size = new System.Drawing.Size(75, 30);
this.btnDisable.TabIndex = 8;
this.btnDisable.Text = "3轴取消";
this.btnDisable.UseVisualStyleBackColor = true;
@@ -1136,18 +1063,6 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "通讯状态";
//
- // lamp_acs
- //
- this.lamp_acs.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134)));
- this.lamp_acs.Location = new System.Drawing.Point(57, 50);
- this.lamp_acs.LText = "";
- this.lamp_acs.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
- this.lamp_acs.Name = "lamp_acs";
- this.lamp_acs.Shadow = false;
- this.lamp_acs.Size = new System.Drawing.Size(24, 24);
- this.lamp_acs.State = -1;
- this.lamp_acs.TabIndex = 30;
- //
// txtPort
//
this.txtPort.Location = new System.Drawing.Point(103, 52);
@@ -1168,7 +1083,7 @@
//
this.btn_ACSStop.Location = new System.Drawing.Point(113, 84);
this.btn_ACSStop.Name = "btn_ACSStop";
- this.btn_ACSStop.Size = new System.Drawing.Size(81, 23);
+ this.btn_ACSStop.Size = new System.Drawing.Size(81, 30);
this.btn_ACSStop.TabIndex = 20;
this.btn_ACSStop.Text = "断开";
this.btn_ACSStop.UseVisualStyleBackColor = true;
@@ -1178,7 +1093,7 @@
//
this.btn_ACSStart.Location = new System.Drawing.Point(18, 84);
this.btn_ACSStart.Name = "btn_ACSStart";
- this.btn_ACSStart.Size = new System.Drawing.Size(81, 23);
+ this.btn_ACSStart.Size = new System.Drawing.Size(81, 30);
this.btn_ACSStart.TabIndex = 19;
this.btn_ACSStart.Text = "连接";
this.btn_ACSStart.UseVisualStyleBackColor = true;
@@ -1225,7 +1140,6 @@
//
// tmrMonitor
//
- this.tmrMonitor.Interval = 50;
this.tmrMonitor.Tick += new System.EventHandler(this.TmrMonitor_Tick);
//
// timer_RefreshUI
@@ -1233,10 +1147,29 @@
this.timer_RefreshUI.Interval = 1000;
this.timer_RefreshUI.Tick += new System.EventHandler(this.Timer_RefreshUI_Tick);
//
- // radRibbonBarGroup6
+ // lamp_hexcal
//
- this.radRibbonBarGroup6.Name = "radRibbonBarGroup6";
- this.radRibbonBarGroup6.Text = "快速定位";
+ this.lamp_hexcal.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134)));
+ this.lamp_hexcal.Location = new System.Drawing.Point(57, 23);
+ this.lamp_hexcal.LText = "";
+ this.lamp_hexcal.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.lamp_hexcal.Name = "lamp_hexcal";
+ this.lamp_hexcal.Shadow = false;
+ this.lamp_hexcal.Size = new System.Drawing.Size(24, 24);
+ this.lamp_hexcal.State = -1;
+ this.lamp_hexcal.TabIndex = 29;
+ //
+ // lamp_acs
+ //
+ this.lamp_acs.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134)));
+ this.lamp_acs.Location = new System.Drawing.Point(57, 50);
+ this.lamp_acs.LText = "";
+ this.lamp_acs.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.lamp_acs.Name = "lamp_acs";
+ this.lamp_acs.Shadow = false;
+ this.lamp_acs.Size = new System.Drawing.Size(24, 24);
+ this.lamp_acs.State = -1;
+ this.lamp_acs.TabIndex = 30;
//
// MainFrom
//
@@ -1360,21 +1293,15 @@
private System.Windows.Forms.Label label13;
private System.Windows.Forms.GroupBox grpSafety;
private System.Windows.Forms.Label lblEMG;
- private System.Windows.Forms.Label lblRL3;
- private System.Windows.Forms.Label lblLL3;
private System.Windows.Forms.Label lblRL2;
private System.Windows.Forms.Label lblLL2;
private System.Windows.Forms.Label lblRL1;
- private System.Windows.Forms.Label lblRL4;
private System.Windows.Forms.Label lblLL1;
- private System.Windows.Forms.Label lblLL4;
private System.Windows.Forms.Label lblRL0;
private System.Windows.Forms.Label lblLL0;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label27;
- private System.Windows.Forms.Label label26;
private System.Windows.Forms.Label label25;
- private System.Windows.Forms.Label label33;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label19;
diff --git a/HexcalMC/MainFrom.cs b/HexcalMC/MainFrom.cs
index 66c6d35..40ba803 100644
--- a/HexcalMC/MainFrom.cs
+++ b/HexcalMC/MainFrom.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Net;
using System.Windows.Forms;
using ACS.SPiiPlusNET;
using HexcalMC.Base;
@@ -187,8 +188,9 @@ namespace HexcalMC
#region hexcal软件交互
private TcpIpServer _mTcpIpServer; //创建tcpserver,用于接收hexcal传来的指令,并解析传递平台
+
private bool _mBHexcalConnected;
- public string LISTEN_ADDRESS = "100.0.0.1";
+ //public string LISTEN_ADDRESS = "100.0.0.1";
private void StartServer()
{
@@ -203,16 +205,16 @@ namespace HexcalMC
//判断 要监听的IP地址是否存在
- if (!Internet.IsIpReachable(LISTEN_ADDRESS))
- {
- MyBase.TraceWriteLine("启动服务失败,请确认本地网卡是否启用且配置 " + LISTEN_ADDRESS);
- MessageBox.Show("请确认本地网卡是否启用且配置 " + LISTEN_ADDRESS, "启动服务失败");
- return;
- }
+ //if (!Internet.IsIpReachable(LISTEN_ADDRESS))
+ //{
+ // MyBase.TraceWriteLine("启动服务失败,请确认本地网卡是否启用且配置 " + LISTEN_ADDRESS);
+ // MessageBox.Show("请确认本地网卡是否启用且配置 " + LISTEN_ADDRESS, "启动服务失败");
+ // return;
+ //}
//启动服务器,并获取数据,解析
- _mTcpIpServer = new TcpIpServer(LISTEN_ADDRESS, Convert.ToString(1234));
+ _mTcpIpServer = new TcpIpServer(IPAddress.Any.ToString(), Convert.ToString(1234));
_mTcpIpServer.UseMode = 1; //设置通讯返回数据流格式
try
{
@@ -250,11 +252,11 @@ namespace HexcalMC
string sourceIp = clientIp.Split(':')[0];
switch (sourceIp)
{
- case "100.0.0.1": //L2系统
-
- //解析处理数据
+ case "100.0.0.1":
+ ParseHexcalMsg(msg);
+ break;
+ case "100.0.0.2":
ParseHexcalMsg(msg);
-
break;
default:
DebugDfn.AddLogText("未知来源,没有应答");
@@ -299,6 +301,7 @@ namespace HexcalMC
private void CheckPlatformStatus()
{
+ //检查平台状态,如果运动中,返回BUSY,否则返回READY
if (_currentMotionState == MotionStates.None || _currentMotionState == MotionStates.InPos) //默认或到位
{
SendMsgToHexcal("READY");
@@ -311,7 +314,7 @@ namespace HexcalMC
private void ParseHexcalMsg(string msg) //编写一个Hexcal协议解析函数
{
- DebugDfn.AddLogText("正在解析 " + msg);
+ //DebugDfn.AddLogText("正在解析 " + msg);
//去除Msg中\r\n
msg = msg.Replace("\r\n", "");
@@ -326,20 +329,21 @@ namespace HexcalMC
if (msg.Contains("\x02") || msg.Contains("\u0002"))
{
+ //DebugDfn.AddLogText("接收到STX,开始解析");
CheckPlatformStatus();
}
else if (msg.Contains("\x03") || msg.Contains("\u0003"))
{
CheckPlatformStatus();
}
- else if (msg.Contains("^B")) //查询状态, READY或BUSY
- {
- CheckPlatformStatus();
- }
+ //else if (msg.Contains("^B")) //查询状态, READY或BUSY
+ //{
+ // CheckPlatformStatus();
+ //}
else if (msg.Contains("CMMTYP")) //测量机类型
{
- SendMsgToHexcal("CMMTYP MA 19617, FDC V15.00, 6 6 2 , 0");
+ SendMsgToHexcal("CMMTYP MA 19617, FDC V15.00, 10 8 3 , 0");
}
else if (msg.Contains("VERSION")) //版本号
{
@@ -495,6 +499,9 @@ namespace HexcalMC
private void SendMsgToHexcal(string msg)
{
+ if (_mTcpIpServer == null) return;
+
+
//发送数据
DebugDfn.AddLogText("回复 " + msg);
_mTcpIpServer.SendMessageToAllClients(msg += "\r\n"); //回复内容末尾加上\r\n,协议要求
@@ -502,6 +509,8 @@ namespace HexcalMC
private void Btn_StartServer_Click(object sender, EventArgs e)
{
+ Btn_StartServer.Enabled = false;
+ Btn_StopServer.Enabled = true;
StartServer();
}
@@ -512,6 +521,9 @@ namespace HexcalMC
{
_mTcpIpServer.StopListen();
}
+
+ Btn_StopServer.Enabled = false;
+ Btn_StartServer.Enabled = true;
}
#endregion
@@ -545,6 +557,7 @@ namespace HexcalMC
private HomeStates _homeStates; //回家状态
private MotionStates _currentMotionState; //当前运动状态
+ private MotionStates _currentMotorStateLast;
private readonly int _motionTimeout = 50000; //定义运动超时时间
@@ -683,19 +696,32 @@ namespace HexcalMC
{
DebugDfn.AddLogText("ACS平台刷新异常" + ex);
MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ Btn_ACSStop_Click(null, null);
}
}
if (IsMotionInPose())
{
_currentMotionState = MotionStates.InPos;
- DebugDfn.AddLogText("运动到位");
+ //DebugDfn.AddLogText("运动到位");
}
else
{
_currentMotionState = MotionStates.Moving;
DebugDfn.AddLogText("运动中");
}
+
+ //增加判断 运动中到 运动到位,主动发送READY
+ if (_currentMotionState == MotionStates.InPos && _currentMotionState != _currentMotorStateLast)
+ {
+ // //发送READY
+ // CheckPlatformStatus();
+ // _mPoint3DLast = _mPoint3D;
+ // DebugDfn.AddLogText("主动发送到位");
+ DebugDfn.AddLogText("运动到位");
+ }
+
+ _currentMotorStateLast = _currentMotionState;
}
private void Btn_ACSStart_Click(object sender, EventArgs e) //连接
@@ -883,7 +909,7 @@ namespace HexcalMC
}
}
- private bool IsWithinStrokes(Point3D point) //判断点是否在行程范围内
+ public static bool IsWithinStrokes(Point3D point) //判断点是否在行程范围内
{
if (point.X >= XMinstrokesw && point.X <= XMaxstrokesw &&
point.Y >= YMinstrokesw && point.Y <= YMaxstrokesw &&
diff --git a/HexcalMC/MainFrom.resx b/HexcalMC/MainFrom.resx
index 65140a9..c223879 100644
--- a/HexcalMC/MainFrom.resx
+++ b/HexcalMC/MainFrom.resx
@@ -143,60 +143,6 @@
FxcPDw8ABx8fHx8fHx8XFxcXDw8PAg8fHx8fHx8fHxcXFw8PDwIfFx8lJSUfHx8XFxcXDwcXKA8lJSUl
Hx8fFxcXFw8CJigfFyUlJR8fHxcXFxcHFygoKBcXJR8fHx8XFxcHDygoKCgoHw8XHx8fFw8HHygoKCgo
KCgoHw8HBwcfKCgoKCg=
-
-
-
-
- Qk02BQAAAAAAADYEAAAoAAAAEAAAABAAAAABAAgAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAt7e3/7i4
- uP+8vLz/vb29/7+/v//BwcH/wsLC/8PDw//FxcX/xsbG/8fHx//IyMj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AA/ygo
- KCgmFwICAAIXJigoKCgoKCgXAgcPDw8PBwIXKCgoKCgPBw8PDw8PDw8PAgcoKCgfBxcXFw8PDw8PDw8C
- FygoBxcXFxcXFxcPDw8PDwImHw8XFxcXFxcXFw8PDw8HFwcXFxcXFxcXFxcXDw8PDwIHHx8fHx8fFxcX
- FxcPDw8ABx8fHx8fHx8XFxcXDw8PAg8fHx8fHx8fHxcXFw8PDwIfFx8lJSUfHx8XFxcXDwcXKA8lJSUl
- Hx8fFxcXFw8CJigfFyUlJR8fHxcXFxcHFygoKBcXJR8fHx8XFxcHDygoKCgoHw8XHx8fFw8HHygoKCgo
- KCgoHw8HBwcfKCgoKCg=
@@ -530,7 +422,7 @@
17, 17
- 25
+ 87
diff --git a/HexcalMC/Motion/Motion.Designer.cs b/HexcalMC/Motion/Motion.Designer.cs
index 8640d51..ca985f5 100644
--- a/HexcalMC/Motion/Motion.Designer.cs
+++ b/HexcalMC/Motion/Motion.Designer.cs
@@ -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;
diff --git a/HexcalMC/Motion/Motion.cs b/HexcalMC/Motion/Motion.cs
index 4452fdf..f739b75 100644
--- a/HexcalMC/Motion/Motion.cs
+++ b/HexcalMC/Motion/Motion.cs
@@ -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)
diff --git a/HexcalMC/Program.cs b/HexcalMC/Program.cs
index 1efdc84..ab52e09 100644
--- a/HexcalMC/Program.cs
+++ b/HexcalMC/Program.cs
@@ -24,7 +24,7 @@ using static Telerik.WinControls.UI.Export.ExportSettings;
//
//
//6、点击停止报错,运动测试界面问题?
-//
+//7、发现交互过程中,需要hexcal发送指令后,中间件再进行回应,主动回应,hexcal流程有问题
//
//
//