优化治具显示状态

master
lhiven 2 years ago
parent 69c260945c
commit 668d9893a8

@ -1,5 +1,6 @@
using Rs.Controls;
using Rs.Framework;
using Rs.MotionPlat.Flow;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -73,5 +74,17 @@ namespace Rs.MotionPlat
}
}
}
public void CheckPermission()
{
if (MachineManage.Instance.MachineStatus == EMachineStatus.Working)
{
this.Enabled = false;
}
else
{
this.Enabled = true;
}
}
}
}

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

@ -274,9 +274,10 @@
//
this.lblStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36)))));
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblStatus.Location = new System.Drawing.Point(95, 151);
this.lblStatus.Location = new System.Drawing.Point(92, 151);
this.lblStatus.Margin = new System.Windows.Forms.Padding(0);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(205, 29);
this.lblStatus.Size = new System.Drawing.Size(211, 29);
this.lblStatus.TabIndex = 3;
this.lblStatus.Text = "None";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -356,9 +357,10 @@
// lblResult
//
this.lblResult.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblResult.Location = new System.Drawing.Point(95, 301);
this.lblResult.Location = new System.Drawing.Point(92, 301);
this.lblResult.Margin = new System.Windows.Forms.Padding(0);
this.lblResult.Name = "lblResult";
this.lblResult.Size = new System.Drawing.Size(205, 29);
this.lblResult.Size = new System.Drawing.Size(211, 29);
this.lblResult.TabIndex = 4;
this.lblResult.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//

@ -80,7 +80,7 @@ namespace Rs.MotionPlat
break;
case ETestFixtureStatus.Homing:
btnReset.Enabled = false;
lblStatus.BackColor = Color.Yellow;
lblStatus.BackColor = Color.YellowGreen;
break;
}
}

@ -497,7 +497,7 @@ namespace Rs.MotionPlat.Entitys
MessageQueue.Instance.Warn($"TC{Index} disconned!");
Connected = false;
}
Thread.Sleep(10);
}
});
}
@ -864,32 +864,9 @@ namespace Rs.MotionPlat.Entitys
else
{
string content=Encoding.ASCII.GetString(registData.ToArray());
//MessageQueue.Instance.Insert($"ip:{((IPEndPoint)soct.RemoteEndPoint).Address.ToString()},port:{((IPEndPoint)soct.RemoteEndPoint).Port.ToString()},{content}");
string[] items = content.TrimEnd(new char[] { '$' }).Split('#');
//打印日志
//string logDir = $"d:\\Communition\\{DateTime.Now.ToString("yyyyMMdd")}";
//if (!Directory.Exists(logDir))
//{
// Directory.CreateDirectory(logDir);
//}
//string logFileName = $"{logDir}\\{items[2]}.txt";
//File.AppendAllText(logFileName, $"{DateTime.Now.ToString("HH:mm:ss fff")} >>> {content}\r\n");
string reg = "Register#1$";
int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg));
//打印日志
//logDir = $"d:\\Communition\\{DateTime.Now.ToString("yyyyMMdd")}";
//if (!Directory.Exists(logDir))
//{
// Directory.CreateDirectory(logDir);
//}
//logFileName = $"{logDir}\\{items[2]}.txt";
//File.AppendAllText(logFileName, $"{DateTime.Now.ToString("HH:mm:ss fff")} <<< {reg},{sendLen}\r\n");
TestFixture tf = GetTestFixture(int.Parse(items[2]));
tf.SetSocket(soct);
tf.AddLog(" <<< " + content);
@ -898,29 +875,13 @@ namespace Rs.MotionPlat.Entitys
tf.Connected = true;
tf.Status = ETestFixtureStatus.IDLE;
tf.CsvTitle = items[3];
//tf.QueryStatus();
//tf.StartRecive();
tf.SetEvent();
stop = true;
break;
}
}
//string content = Encoding.ASCII.GetString(buffer, 0, len);
//if (content.IndexOf("Register") >= 0)
//{
// try
// {
// break;
// }
// catch (Exception ex)
// {
// LogHelper.Error(ex.Message + ex.StackTrace);
// break;
// }
//}
}
Thread.Sleep(10);
}
}, clientSocket);

@ -73,6 +73,7 @@ namespace Rs.MotionPlat.Recipe
private void StockTrayLocationRecipe_Load(object sender, EventArgs e)
{
CheckPermission();
if(m_trayName=="Input" || m_trayName=="Grab")
{
btnThreePointLocation.Visible = false;

@ -72,6 +72,7 @@ namespace Rs.MotionPlat.SysConfig
private void FixtureConfig_Load(object sender, EventArgs e)
{
CheckPermission();
PositionHelper.BindPosition(groupBox1,"int");
PositionHelper.BindPosition(groupBox23);
PositionHelper.BindPosition(groupBox24);

@ -28,6 +28,7 @@ namespace Rs.MotionPlat.SysConfig
private void NozzleConfig_Load(object sender, EventArgs e)
{
CheckPermission();
PositionHelper.BindPosition(groupBox5);
PositionHelper.BindPosition(groupBox2);
PositionHelper.BindPosition(groupBox1, "int");

@ -26,6 +26,7 @@ namespace Rs.MotionPlat.SysConfig
private void StockConfig_Load(object sender, EventArgs e)
{
CheckPermission();
foreach (Control item in panelEx3.Controls)
{
PositionHelper.BindPosition(item);

@ -39,6 +39,7 @@ namespace Rs.MotionPlat.SysConfig
private void TurnoverConfig_Load(object sender, EventArgs e)
{
CheckPermission();
PositionHelper.BindPosition(groupBox1);
PositionHelper.BindPosition(groupBox3, "int");
PositionHelper.BindPosition(groupBox5);

@ -44,22 +44,23 @@
this.button12 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton16 = new System.Windows.Forms.RadioButton();
this.radioButton6 = new System.Windows.Forms.RadioButton();
this.radioButton15 = new System.Windows.Forms.RadioButton();
this.radioButton5 = new System.Windows.Forms.RadioButton();
this.radioButton14 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton13 = new System.Windows.Forms.RadioButton();
this.radioButton8 = new System.Windows.Forms.RadioButton();
this.radioButton12 = new System.Windows.Forms.RadioButton();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.radioButton5 = new System.Windows.Forms.RadioButton();
this.radioButton6 = new System.Windows.Forms.RadioButton();
this.radioButton11 = new System.Windows.Forms.RadioButton();
this.radioButton7 = new System.Windows.Forms.RadioButton();
this.radioButton8 = new System.Windows.Forms.RadioButton();
this.radioButton9 = new System.Windows.Forms.RadioButton();
this.radioButton10 = new System.Windows.Forms.RadioButton();
this.radioButton11 = new System.Windows.Forms.RadioButton();
this.radioButton12 = new System.Windows.Forms.RadioButton();
this.radioButton13 = new System.Windows.Forms.RadioButton();
this.radioButton14 = new System.Windows.Forms.RadioButton();
this.radioButton15 = new System.Windows.Forms.RadioButton();
this.radioButton16 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton9 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
@ -182,7 +183,7 @@
//
// button11
//
this.button11.Location = new System.Drawing.Point(82, 545);
this.button11.Location = new System.Drawing.Point(572, 531);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(75, 23);
this.button11.TabIndex = 26;
@ -231,36 +232,72 @@
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Controls.Add(this.button13);
this.groupBox1.ForeColor = System.Drawing.Color.White;
this.groupBox1.Location = new System.Drawing.Point(82, 599);
this.groupBox1.Location = new System.Drawing.Point(82, 628);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(336, 187);
this.groupBox1.TabIndex = 31;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "飞拍";
//
// radioButton1
// radioButton16
//
this.radioButton1.AutoSize = true;
this.radioButton1.ForeColor = System.Drawing.Color.White;
this.radioButton1.Location = new System.Drawing.Point(22, 33);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(29, 16);
this.radioButton1.TabIndex = 29;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "1";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton16.AutoSize = true;
this.radioButton16.ForeColor = System.Drawing.Color.White;
this.radioButton16.Location = new System.Drawing.Point(196, 76);
this.radioButton16.Name = "radioButton16";
this.radioButton16.Size = new System.Drawing.Size(35, 16);
this.radioButton16.TabIndex = 29;
this.radioButton16.TabStop = true;
this.radioButton16.Text = "14";
this.radioButton16.UseVisualStyleBackColor = true;
//
// radioButton2
// radioButton6
//
this.radioButton2.AutoSize = true;
this.radioButton2.ForeColor = System.Drawing.Color.White;
this.radioButton2.Location = new System.Drawing.Point(57, 33);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(29, 16);
this.radioButton2.TabIndex = 29;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "2";
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton6.AutoSize = true;
this.radioButton6.ForeColor = System.Drawing.Color.White;
this.radioButton6.Location = new System.Drawing.Point(196, 33);
this.radioButton6.Name = "radioButton6";
this.radioButton6.Size = new System.Drawing.Size(29, 16);
this.radioButton6.TabIndex = 29;
this.radioButton6.TabStop = true;
this.radioButton6.Text = "6";
this.radioButton6.UseVisualStyleBackColor = true;
//
// radioButton15
//
this.radioButton15.AutoSize = true;
this.radioButton15.ForeColor = System.Drawing.Color.White;
this.radioButton15.Location = new System.Drawing.Point(161, 76);
this.radioButton15.Name = "radioButton15";
this.radioButton15.Size = new System.Drawing.Size(35, 16);
this.radioButton15.TabIndex = 29;
this.radioButton15.TabStop = true;
this.radioButton15.Text = "13";
this.radioButton15.UseVisualStyleBackColor = true;
//
// radioButton5
//
this.radioButton5.AutoSize = true;
this.radioButton5.ForeColor = System.Drawing.Color.White;
this.radioButton5.Location = new System.Drawing.Point(161, 33);
this.radioButton5.Name = "radioButton5";
this.radioButton5.Size = new System.Drawing.Size(29, 16);
this.radioButton5.TabIndex = 29;
this.radioButton5.TabStop = true;
this.radioButton5.Text = "5";
this.radioButton5.UseVisualStyleBackColor = true;
//
// radioButton14
//
this.radioButton14.AutoSize = true;
this.radioButton14.ForeColor = System.Drawing.Color.White;
this.radioButton14.Location = new System.Drawing.Point(92, 76);
this.radioButton14.Name = "radioButton14";
this.radioButton14.Size = new System.Drawing.Size(35, 16);
this.radioButton14.TabIndex = 29;
this.radioButton14.TabStop = true;
this.radioButton14.Text = "11";
this.radioButton14.UseVisualStyleBackColor = true;
//
// radioButton3
//
@ -274,6 +311,42 @@
this.radioButton3.Text = "3";
this.radioButton3.UseVisualStyleBackColor = true;
//
// radioButton13
//
this.radioButton13.AutoSize = true;
this.radioButton13.ForeColor = System.Drawing.Color.White;
this.radioButton13.Location = new System.Drawing.Point(268, 76);
this.radioButton13.Name = "radioButton13";
this.radioButton13.Size = new System.Drawing.Size(35, 16);
this.radioButton13.TabIndex = 29;
this.radioButton13.TabStop = true;
this.radioButton13.Text = "16";
this.radioButton13.UseVisualStyleBackColor = true;
//
// radioButton8
//
this.radioButton8.AutoSize = true;
this.radioButton8.ForeColor = System.Drawing.Color.White;
this.radioButton8.Location = new System.Drawing.Point(268, 33);
this.radioButton8.Name = "radioButton8";
this.radioButton8.Size = new System.Drawing.Size(29, 16);
this.radioButton8.TabIndex = 29;
this.radioButton8.TabStop = true;
this.radioButton8.Text = "8";
this.radioButton8.UseVisualStyleBackColor = true;
//
// radioButton12
//
this.radioButton12.AutoSize = true;
this.radioButton12.ForeColor = System.Drawing.Color.White;
this.radioButton12.Location = new System.Drawing.Point(126, 76);
this.radioButton12.Name = "radioButton12";
this.radioButton12.Size = new System.Drawing.Size(35, 16);
this.radioButton12.TabIndex = 29;
this.radioButton12.TabStop = true;
this.radioButton12.Text = "12";
this.radioButton12.UseVisualStyleBackColor = true;
//
// radioButton4
//
this.radioButton4.AutoSize = true;
@ -286,29 +359,17 @@
this.radioButton4.Text = "4";
this.radioButton4.UseVisualStyleBackColor = true;
//
// radioButton5
//
this.radioButton5.AutoSize = true;
this.radioButton5.ForeColor = System.Drawing.Color.White;
this.radioButton5.Location = new System.Drawing.Point(161, 33);
this.radioButton5.Name = "radioButton5";
this.radioButton5.Size = new System.Drawing.Size(29, 16);
this.radioButton5.TabIndex = 29;
this.radioButton5.TabStop = true;
this.radioButton5.Text = "5";
this.radioButton5.UseVisualStyleBackColor = true;
//
// radioButton6
// radioButton11
//
this.radioButton6.AutoSize = true;
this.radioButton6.ForeColor = System.Drawing.Color.White;
this.radioButton6.Location = new System.Drawing.Point(196, 33);
this.radioButton6.Name = "radioButton6";
this.radioButton6.Size = new System.Drawing.Size(29, 16);
this.radioButton6.TabIndex = 29;
this.radioButton6.TabStop = true;
this.radioButton6.Text = "6";
this.radioButton6.UseVisualStyleBackColor = true;
this.radioButton11.AutoSize = true;
this.radioButton11.ForeColor = System.Drawing.Color.White;
this.radioButton11.Location = new System.Drawing.Point(233, 76);
this.radioButton11.Name = "radioButton11";
this.radioButton11.Size = new System.Drawing.Size(35, 16);
this.radioButton11.TabIndex = 29;
this.radioButton11.TabStop = true;
this.radioButton11.Text = "15";
this.radioButton11.UseVisualStyleBackColor = true;
//
// radioButton7
//
@ -322,30 +383,6 @@
this.radioButton7.Text = "7";
this.radioButton7.UseVisualStyleBackColor = true;
//
// radioButton8
//
this.radioButton8.AutoSize = true;
this.radioButton8.ForeColor = System.Drawing.Color.White;
this.radioButton8.Location = new System.Drawing.Point(268, 33);
this.radioButton8.Name = "radioButton8";
this.radioButton8.Size = new System.Drawing.Size(29, 16);
this.radioButton8.TabIndex = 29;
this.radioButton8.TabStop = true;
this.radioButton8.Text = "8";
this.radioButton8.UseVisualStyleBackColor = true;
//
// radioButton9
//
this.radioButton9.AutoSize = true;
this.radioButton9.ForeColor = System.Drawing.Color.White;
this.radioButton9.Location = new System.Drawing.Point(22, 76);
this.radioButton9.Name = "radioButton9";
this.radioButton9.Size = new System.Drawing.Size(29, 16);
this.radioButton9.TabIndex = 29;
this.radioButton9.TabStop = true;
this.radioButton9.Text = "9";
this.radioButton9.UseVisualStyleBackColor = true;
//
// radioButton10
//
this.radioButton10.AutoSize = true;
@ -358,83 +395,57 @@
this.radioButton10.Text = "10";
this.radioButton10.UseVisualStyleBackColor = true;
//
// radioButton11
//
this.radioButton11.AutoSize = true;
this.radioButton11.ForeColor = System.Drawing.Color.White;
this.radioButton11.Location = new System.Drawing.Point(233, 76);
this.radioButton11.Name = "radioButton11";
this.radioButton11.Size = new System.Drawing.Size(35, 16);
this.radioButton11.TabIndex = 29;
this.radioButton11.TabStop = true;
this.radioButton11.Text = "15";
this.radioButton11.UseVisualStyleBackColor = true;
//
// radioButton12
//
this.radioButton12.AutoSize = true;
this.radioButton12.ForeColor = System.Drawing.Color.White;
this.radioButton12.Location = new System.Drawing.Point(126, 76);
this.radioButton12.Name = "radioButton12";
this.radioButton12.Size = new System.Drawing.Size(35, 16);
this.radioButton12.TabIndex = 29;
this.radioButton12.TabStop = true;
this.radioButton12.Text = "12";
this.radioButton12.UseVisualStyleBackColor = true;
//
// radioButton13
// radioButton2
//
this.radioButton13.AutoSize = true;
this.radioButton13.ForeColor = System.Drawing.Color.White;
this.radioButton13.Location = new System.Drawing.Point(268, 76);
this.radioButton13.Name = "radioButton13";
this.radioButton13.Size = new System.Drawing.Size(35, 16);
this.radioButton13.TabIndex = 29;
this.radioButton13.TabStop = true;
this.radioButton13.Text = "16";
this.radioButton13.UseVisualStyleBackColor = true;
this.radioButton2.AutoSize = true;
this.radioButton2.ForeColor = System.Drawing.Color.White;
this.radioButton2.Location = new System.Drawing.Point(57, 33);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(29, 16);
this.radioButton2.TabIndex = 29;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "2";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton14
// radioButton9
//
this.radioButton14.AutoSize = true;
this.radioButton14.ForeColor = System.Drawing.Color.White;
this.radioButton14.Location = new System.Drawing.Point(92, 76);
this.radioButton14.Name = "radioButton14";
this.radioButton14.Size = new System.Drawing.Size(35, 16);
this.radioButton14.TabIndex = 29;
this.radioButton14.TabStop = true;
this.radioButton14.Text = "11";
this.radioButton14.UseVisualStyleBackColor = true;
this.radioButton9.AutoSize = true;
this.radioButton9.ForeColor = System.Drawing.Color.White;
this.radioButton9.Location = new System.Drawing.Point(22, 76);
this.radioButton9.Name = "radioButton9";
this.radioButton9.Size = new System.Drawing.Size(29, 16);
this.radioButton9.TabIndex = 29;
this.radioButton9.TabStop = true;
this.radioButton9.Text = "9";
this.radioButton9.UseVisualStyleBackColor = true;
//
// radioButton15
// radioButton1
//
this.radioButton15.AutoSize = true;
this.radioButton15.ForeColor = System.Drawing.Color.White;
this.radioButton15.Location = new System.Drawing.Point(161, 76);
this.radioButton15.Name = "radioButton15";
this.radioButton15.Size = new System.Drawing.Size(35, 16);
this.radioButton15.TabIndex = 29;
this.radioButton15.TabStop = true;
this.radioButton15.Text = "13";
this.radioButton15.UseVisualStyleBackColor = true;
this.radioButton1.AutoSize = true;
this.radioButton1.ForeColor = System.Drawing.Color.White;
this.radioButton1.Location = new System.Drawing.Point(22, 33);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(29, 16);
this.radioButton1.TabIndex = 29;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "1";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton16
// groupBox2
//
this.radioButton16.AutoSize = true;
this.radioButton16.ForeColor = System.Drawing.Color.White;
this.radioButton16.Location = new System.Drawing.Point(196, 76);
this.radioButton16.Name = "radioButton16";
this.radioButton16.Size = new System.Drawing.Size(35, 16);
this.radioButton16.TabIndex = 29;
this.radioButton16.TabStop = true;
this.radioButton16.Text = "14";
this.radioButton16.UseVisualStyleBackColor = true;
this.groupBox2.Location = new System.Drawing.Point(82, 522);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(336, 100);
this.groupBox2.TabIndex = 32;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "groupBox2";
//
// TestFrm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1336, 854);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button12);
this.Controls.Add(this.button11);
@ -491,5 +502,6 @@
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton9;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.GroupBox groupBox2;
}
}

@ -40,7 +40,7 @@ namespace Rs.MotionPlat.Vision
else
{
data = Encoding.ASCII.GetString(reciveBuffer.ToArray());
//MessageQueue.Instance.Insert(data);
MessageQueue.Instance.Insert(data);
if (data == "M,0")
{
//MessageQueue.Instance.Insert("视觉收到拍照指令");
@ -74,14 +74,16 @@ namespace Rs.MotionPlat.Vision
public bool ClearQueue(int fixtureIndex,int timeout = 10000)
{
visionGrabEvent.Reset();
int len = vNozzleCalib.Send($"M{fixtureIndex}C;");
string content = $"M{fixtureIndex}C;";
int len = vNozzleCalib.Send(content);
//reciveData = true;
if (len > 0)
{
MessageQueue.Instance.Insert($" <<< {content}");
if (visionGrabEvent.WaitOne(timeout))
{
//reciveData = false;
MessageQueue.Instance.Insert($"收到视觉结果:{data}");
MessageQueue.Instance.Insert($" >>> {data}");
return true;
}
else
@ -108,6 +110,7 @@ namespace Rs.MotionPlat.Vision
result = null;
visionGrabEvent.Reset();
string cmd = $"M{fixtureIndex},{sn};";
MessageQueue.Instance.Insert($" <<< {cmd}");
int len = vNozzleCalib.Send(cmd);
//reciveData = true;
//if (len > 0)

Loading…
Cancel
Save