Commit df76da28 刘韬

1

1 个父辈 60923ab4
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -19,7 +20,7 @@ namespace DeviceLibrary
if (CheckWait(FeedingMoveinfo))
return;
if (IOValue(IO_XRay_Type.Manual_Confirm_BTN).Equals(IO_VALUE.LOW)) {
if (IOValue(IO_XRay_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW)) {
Msg.add("The safety grating is blocked", MsgLevel.warning);
return;
}
......@@ -198,19 +199,19 @@ namespace DeviceLibrary
var Tray7= Math.Max(Tray7_L, Tray7_R);
var Tray13 = Math.Max(Tray13_L, Tray13_R);
var Tray15 = Math.Max(Tray15_L, Tray15_R);
//LogUtil.OutputDebugString($"Tray7:{Tray7},Tray13:{Tray13},Tray15:{Tray15}");
Debug.WriteLine($"Tray7:{Tray7},Tray13:{Tray13},Tray15:{Tray15}");
int v=0;
if (Tray15 < overhight)
if (Tray15 < overhight && Tray15>0)
{
if (SensorDebounce.Debounce(Tray15, out v))
TrayWidth = 15;
}
else if (Tray13 < overhight)
else if (Tray13 < overhight && Tray13>0)
{
if (SensorDebounce.Debounce(Tray13, out v))
TrayWidth = 13;
}
else if (Tray7 < overhight)
else if (Tray7 < overhight && Tray7 > 0)
{
if (SensorDebounce.Debounce(Tray7, out v))
TrayWidth = 7;
......
......@@ -33,8 +33,8 @@ namespace DeviceLibrary
public bool IgnoreSafecheck { get; set; }
public bool IgnoreGratingSignal { get; set; }
AxisBean Line_Entry_Axis;
AxisBean Line_In_Axis;
public AxisBean Line_Entry_Axis;
public AxisBean Line_In_Axis;
AxisBean ExitLine_Location_Axis;
AxisBean SideMove_X_Axis;
AxisBean SideMove_Z_Axis;
......@@ -221,11 +221,14 @@ namespace DeviceLibrary
CylinderMove(ResetMoveInfo, IO_XRay_Type.Location_Cylinder_Down, IO_XRay_Type.Location_Cylinder_Up,IO_VALUE.LOW);
CylinderMove(ResetMoveInfo, IO_XRay_Type.Entry_Close, IO_XRay_Type.Entry_Open);
CylinderMove(ResetMoveInfo, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open);
SideMove_Z_Axis.HomeMove(ResetMoveInfo);
ExitLine_Location_Axis.HomeMove(ResetMoveInfo);
break;
case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
Line_Entry_Axis.RelMove(ResetMoveInfo, Config.Line_Entry_Relative*2, Config.Line_Entry_Relative_speed);
Line_In_Axis.RelMove(ResetMoveInfo, Config.Line_In_Relative*2, Config.Line_In_Relative_speed);
SideMove_X_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.log("正在回原");
break;
case MoveStep.H03_HomeReset:
......
......@@ -141,6 +141,10 @@ namespace DeviceLibrary
{
AxisManager.SpeedMove(Config.DeviceName, Config.GetAxisValue(), targetSpeed);
}
public bool IsBusy
{
get => AxisManager.GetBusyStatus(Config.DeviceName, Config.GetAxisValue()) == 1;
}
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
......
......@@ -40,8 +40,9 @@
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
<Reference Include="CodeLibrary, Version=1.0.8693.16314, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
......
......@@ -49,9 +49,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.7777.39934, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="CodeLibrary, Version=1.0.8693.16314, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -85,7 +85,7 @@
<Reference Include="WindowsBase" />
<Reference Include="X-Ray, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\X-Ray\X-Ray\bin\Debug\X-Ray.dll</HintPath>
<HintPath>..\..\..\X-Ray\X-Ray\bin\Debug\X-Ray.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
......
......@@ -55,6 +55,7 @@ namespace AutoCountMachine
this.btn_ManualCount = new System.Windows.Forms.Button();
this.cylinderButton4 = new AutoCountMachine.CylinderButton();
this.cylinderButton5 = new AutoCountMachine.CylinderButton();
this.btn_linesync = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
......@@ -163,6 +164,7 @@ namespace AutoCountMachine
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btn_linesync);
this.panel1.Controls.Add(this.axisMoveControl1);
this.panel1.Controls.Add(this.configControl1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
......@@ -363,6 +365,16 @@ namespace AutoCountMachine
this.cylinderButton5.Text = "Entry_Open";
this.cylinderButton5.UseVisualStyleBackColor = false;
//
// btn_linesync
//
this.btn_linesync.Location = new System.Drawing.Point(57, 431);
this.btn_linesync.Name = "btn_linesync";
this.btn_linesync.Size = new System.Drawing.Size(107, 26);
this.btn_linesync.TabIndex = 2;
this.btn_linesync.Text = "皮带同步运行";
this.btn_linesync.UseVisualStyleBackColor = true;
this.btn_linesync.Click += new System.EventHandler(this.btn_linesync_Click);
//
// XrayControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -412,5 +424,6 @@ namespace AutoCountMachine
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btn_Calibration;
private System.Windows.Forms.Button btn_linesync;
}
}
......@@ -382,5 +382,28 @@ namespace AutoCountMachine
ManualCountRunning = false;
}
private void btn_linesync_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
var Line_Entry_Axis = RobotManage.xrayMachine.Line_Entry_Axis;
var Line_In_Axis = RobotManage.xrayMachine.Line_In_Axis;
var Config = RobotManage.xrayMachine.Config;
Line_Entry_Axis.Open(true,out _);
Line_In_Axis.Open(true, out _);
Line_Entry_Axis.SpeedMove(Config.Line_Entry_Relative_speed);
Line_In_Axis.RelMove(null, Config.Line_In_Relative, Config.Line_In_Relative_speed);
RobotManage.xrayMachine.IOMove(IO_XRay_Type.ExitLine_Reel_Run, IO_VALUE.HIGH);
Task.Delay(200).Wait();
while (Line_In_Axis.IsBusy) {
Task.Delay(100).Wait();
}
Task.Delay(500).Wait();
Line_Entry_Axis.SuddenStop();
RobotManage.xrayMachine.IOMove(IO_XRay_Type.ExitLine_Reel_Run, IO_VALUE.LOW);
});
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!