优化8头和测试软件通信逻辑

Eight
lhiven 2 months ago
parent 689d3b5167
commit e9073cb450

@ -27,5 +27,14 @@ namespace Rs.MotionPlat.Commom
{
barCode = 0;
}
public static string NumCode
{
get
{
barCode++;
return barCode.ToString().PadLeft(18, '0');
}
}
}
}

@ -54,7 +54,7 @@ namespace Rs.MotionPlat
string logFileName = "";
string regstr = tf.Index+"_(\\d{0,10}).txt";
//打印日志
string logDir = $"d:\\log\\debug\\{DateTime.Now.ToString("yyyyMMdd")}";
string logDir = $"d:\\log\\debug\\{DateTime.Now.ToString("yyyyMMdd")}\\{tf.Index}";
if (!Directory.Exists(logDir))
{
Directory.CreateDirectory(logDir);

File diff suppressed because it is too large Load Diff

@ -28,24 +28,18 @@ namespace Rs.MotionPlat.Flow
{
public enum EDischargeFlowStep
{
//开始排料前准备
,
,
//料仓取料
,
,
,
//治具换料
,
,
,
,
,
//料仓放料
,
,
//工作完成到安全位,
//等待工作完成到安全位,
,
}
@ -560,11 +554,7 @@ namespace Rs.MotionPlat.Flow
case EDischargeFlowStep.:
if (NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count==NozzleManager.GetEnableNozzles().Count-1)
{
//double curXpos = Ops.GetCurPosition(AxisControl.LoadX);
//if(curXpos-GlobalVar.FixtureSafePosX>1)
//{
// DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
//}
logInfo = GetClassName()+ $"检测到需要下料的吸嘴个数为:{NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count},准备下料";
flowStep = EDischargeFlowStep.;
}
else
@ -661,11 +651,11 @@ namespace Rs.MotionPlat.Flow
//lastFixtureIndex = curFixture.Index == checkFixtureList.Max() ? checkFixtureList.Min()-1 : curFixture.Index;
//lastFixtureIndex = curFixture.Index == 6 ? 0 : curFixture.Index;
int num = TestFixtureManager.Instance.GetHaveProductFixtureList().Count();
//int num = TestFixtureManager.Instance.GetHaveProductFixtureList().Count();
int tounloadNum = NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count();
if (
tounloadNum==NozzleManager.GetEnableNozzles().Count - 1
|| num==0
//|| num==0
|| NozzleManager.GetToTestNozzle() == null
)
//GlobalVar.Clear && (
@ -920,26 +910,6 @@ namespace Rs.MotionPlat.Flow
#endregion
//case EDischargeFlowStep.工作完成到安全位:
// targetPosition.X = GlobalVar.DischargeSafePostionX;
// targetPosition.Y1 = GlobalVar.StockSideY1;
// targetPosition.Y2 = GlobalVar.DischargeSafePostionY2;
// if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed))
// {
// flowStep = EDischargeFlowStep.等待工作完成到安全位;
// }
// break;
//case EDischargeFlowStep.等待工作完成到安全位:
// if(Ops.IsStop("LoadX", "LoadY1", "LoadY2"))
// {
// AxisPosPrint.PrintXY1Y2CurrentPos("运动已停止,",GetClassName());
// if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X,targetPosition.Y1,targetPosition.Y2))
// {
// flowStep = EDischargeFlowStep.工作完成收料;
// }
// }
// break;
case EDischargeFlowStep.:
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok,true,true);

@ -200,14 +200,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
//curNozzle.Product = new TestProduct() { SN = VirtualBarCode.Code, TestNum = 0 };
if(GlobalVar.RunSpace)
{
curNozzle.Product = new TestProduct() { SN = VirtualBarCode.Code, FromSlotIndex = waitTakeProductSlot.Index, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" };
curNozzle.Product = new TestProduct() { SN = VirtualBarCode.NumCode, FromSlotIndex = waitTakeProductSlot.Index, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" };
}
else
{
string sn = string.Empty;
if(GlobalVar.EnableVirtualBarCode)
{
sn = VirtualBarCode.Code;
sn = VirtualBarCode.NumCode;
}
else
{

@ -1132,7 +1132,7 @@ namespace Rs.MotionPlat
this.trayNozzle.HeadText = "Loader picker";
this.trayNozzle.InitSlotStatus = Rs.Controls.ESlotStatus.NotHave;
this.trayNozzle.ItemName = null;
this.trayNozzle.LeftSpaceWidth = 20;
this.trayNozzle.LeftSpaceWidth = 0;
this.trayNozzle.Location = new System.Drawing.Point(0, 0);
this.trayNozzle.Margin = new System.Windows.Forms.Padding(4);
this.trayNozzle.Name = "trayNozzle";
@ -1151,7 +1151,7 @@ namespace Rs.MotionPlat
this.trayNozzle.SortDir = Rs.Controls.ESortDir.LeftToRight;
this.trayNozzle.Status = null;
this.trayNozzle.TabIndex = 4;
this.trayNozzle.TopSpaceHeight = 20;
this.trayNozzle.TopSpaceHeight = 0;
this.trayNozzle.DrawTrayAfterEvent += new System.Action<Rs.Controls.RsTray, Rs.Controls.ESlotStatus, System.Collections.Generic.List<Rs.Controls.TraySlot>>(this.trayDischargeNozzle_DrawTrayAfterEvent);
//
// groupBox38

@ -74,8 +74,12 @@
this.panel3 = new System.Windows.Forms.Panel();
this.groupBox13 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.cboxNozzle8 = new System.Windows.Forms.CheckBox();
this.cboxNozzle4 = new System.Windows.Forms.CheckBox();
this.cboxNozzle7 = new System.Windows.Forms.CheckBox();
this.cboxNozzle3 = new System.Windows.Forms.CheckBox();
this.cboxNozzle6 = new System.Windows.Forms.CheckBox();
this.cboxNozzle5 = new System.Windows.Forms.CheckBox();
this.cboxNozzle2 = new System.Windows.Forms.CheckBox();
this.cboxNozzle1 = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
@ -264,10 +268,6 @@
this.txtPlaceProdcutToStockTrayOffsetHeight = new System.Windows.Forms.TextBox();
this.label33 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
this.cboxNozzle5 = new System.Windows.Forms.CheckBox();
this.cboxNozzle6 = new System.Windows.Forms.CheckBox();
this.cboxNozzle7 = new System.Windows.Forms.CheckBox();
this.cboxNozzle8 = new System.Windows.Forms.CheckBox();
this.contextMenuStrip1.SuspendLayout();
this.contextMenuStrip2.SuspendLayout();
this.panelEx2.SuspendLayout();
@ -646,32 +646,68 @@
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// cboxNozzle8
//
resources.ApplyResources(this.cboxNozzle8, "cboxNozzle8");
this.cboxNozzle8.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle8.Name = "cboxNozzle8";
this.cboxNozzle8.UseVisualStyleBackColor = false;
this.cboxNozzle8.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle4
//
resources.ApplyResources(this.cboxNozzle4, "cboxNozzle4");
this.cboxNozzle4.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle4.Name = "cboxNozzle4";
this.cboxNozzle4.UseVisualStyleBackColor = true;
this.cboxNozzle4.UseVisualStyleBackColor = false;
this.cboxNozzle4.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle7
//
resources.ApplyResources(this.cboxNozzle7, "cboxNozzle7");
this.cboxNozzle7.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle7.Name = "cboxNozzle7";
this.cboxNozzle7.UseVisualStyleBackColor = false;
this.cboxNozzle7.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle3
//
resources.ApplyResources(this.cboxNozzle3, "cboxNozzle3");
this.cboxNozzle3.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle3.Name = "cboxNozzle3";
this.cboxNozzle3.UseVisualStyleBackColor = true;
this.cboxNozzle3.UseVisualStyleBackColor = false;
this.cboxNozzle3.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle6
//
resources.ApplyResources(this.cboxNozzle6, "cboxNozzle6");
this.cboxNozzle6.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle6.Name = "cboxNozzle6";
this.cboxNozzle6.UseVisualStyleBackColor = false;
this.cboxNozzle6.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle5
//
resources.ApplyResources(this.cboxNozzle5, "cboxNozzle5");
this.cboxNozzle5.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle5.Name = "cboxNozzle5";
this.cboxNozzle5.UseVisualStyleBackColor = false;
this.cboxNozzle5.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle2
//
resources.ApplyResources(this.cboxNozzle2, "cboxNozzle2");
this.cboxNozzle2.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle2.Name = "cboxNozzle2";
this.cboxNozzle2.UseVisualStyleBackColor = true;
this.cboxNozzle2.UseVisualStyleBackColor = false;
this.cboxNozzle2.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle1
//
resources.ApplyResources(this.cboxNozzle1, "cboxNozzle1");
this.cboxNozzle1.BackColor = System.Drawing.Color.Transparent;
this.cboxNozzle1.Name = "cboxNozzle1";
this.cboxNozzle1.UseVisualStyleBackColor = true;
this.cboxNozzle1.UseVisualStyleBackColor = false;
this.cboxNozzle1.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// groupBox1
@ -2550,34 +2586,6 @@
resources.ApplyResources(this.label27, "label27");
this.label27.Name = "label27";
//
// cboxNozzle5
//
resources.ApplyResources(this.cboxNozzle5, "cboxNozzle5");
this.cboxNozzle5.Name = "cboxNozzle5";
this.cboxNozzle5.UseVisualStyleBackColor = true;
this.cboxNozzle5.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle6
//
resources.ApplyResources(this.cboxNozzle6, "cboxNozzle6");
this.cboxNozzle6.Name = "cboxNozzle6";
this.cboxNozzle6.UseVisualStyleBackColor = true;
this.cboxNozzle6.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle7
//
resources.ApplyResources(this.cboxNozzle7, "cboxNozzle7");
this.cboxNozzle7.Name = "cboxNozzle7";
this.cboxNozzle7.UseVisualStyleBackColor = true;
this.cboxNozzle7.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// cboxNozzle8
//
resources.ApplyResources(this.cboxNozzle8, "cboxNozzle8");
this.cboxNozzle8.Name = "cboxNozzle8";
this.cboxNozzle8.UseVisualStyleBackColor = true;
this.cboxNozzle8.CheckedChanged += new System.EventHandler(this.cboxNozzle_CheckedChanged);
//
// NozzleConfig
//
resources.ApplyResources(this, "$this");

Loading…
Cancel
Save