增加打印测试软件连接信息

master
lhiven 12 months ago
parent 731bbe0998
commit bcd3b391f4

@ -36,10 +36,10 @@ namespace Rs.MotionPlat.Commom
SysConfigParam.Init(); SysConfigParam.Init();
int errNum = 0; int errNum = 0;
TestFixtureManager.Instance.StartLister(); TestFixtureManager.Instance.StartLister();
//if (GlobalVar.IsSimTest) if (GlobalVar.IsSimTest)
//{ {
// SimulateTesterManager.Instance.Init(); SimulateTesterManager.Instance.Init();
//} }
//Task.Run(() => { //Task.Run(() => {
if (!GlobalVar.VirtualAxis) if (!GlobalVar.VirtualAxis)
{ {

@ -98,6 +98,8 @@ namespace Rs.MotionPlat.Entitys
{ {
this.PassCount = 0; this.PassCount = 0;
this.TotalCount = 0; this.TotalCount = 0;
this.LastCT = 0;
this.Yield = 0;
} }
private int _Index; private int _Index;
@ -848,6 +850,7 @@ namespace Rs.MotionPlat.Entitys
ThreadPool.QueueUserWorkItem((obj) => { ThreadPool.QueueUserWorkItem((obj) => {
List<byte> registData=new List<byte>(); List<byte> registData=new List<byte>();
Socket soct=(Socket)obj; Socket soct=(Socket)obj;
IPEndPoint ep = ((IPEndPoint)soct.RemoteEndPoint);
byte[] buffer = new byte[1024 * 10]; byte[] buffer = new byte[1024 * 10];
bool stop = false; bool stop = false;
while (!stop) while (!stop)
@ -863,10 +866,13 @@ namespace Rs.MotionPlat.Entitys
} }
else else
{ {
string content=Encoding.ASCII.GetString(registData.ToArray()); string content=Encoding.ASCII.GetString(registData.ToArray());
MessageQueue.Instance.Insert($">>> ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{content}");
string[] items = content.TrimEnd(new char[] { '$' }).Split('#'); string[] items = content.TrimEnd(new char[] { '$' }).Split('#');
string reg = "Register#1$"; string reg = "Register#1$";
int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg)); int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg));
MessageQueue.Instance.Insert($"<<< ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{reg}");
TestFixture tf = GetTestFixture(int.Parse(items[2])); TestFixture tf = GetTestFixture(int.Parse(items[2]));
tf.SetSocket(soct); tf.SetSocket(soct);
tf.AddLog(" <<< " + content); tf.AddLog(" <<< " + content);
@ -885,6 +891,7 @@ namespace Rs.MotionPlat.Entitys
} }
}, clientSocket); }, clientSocket);
Thread.Sleep(10);
} }
}); });
} }

Loading…
Cancel
Save