Commit df76da28 刘韬

1

1 个父辈 60923ab4
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -19,7 +20,7 @@ namespace DeviceLibrary ...@@ -19,7 +20,7 @@ namespace DeviceLibrary
if (CheckWait(FeedingMoveinfo)) if (CheckWait(FeedingMoveinfo))
return; 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); Msg.add("The safety grating is blocked", MsgLevel.warning);
return; return;
} }
...@@ -198,19 +199,19 @@ namespace DeviceLibrary ...@@ -198,19 +199,19 @@ namespace DeviceLibrary
var Tray7= Math.Max(Tray7_L, Tray7_R); var Tray7= Math.Max(Tray7_L, Tray7_R);
var Tray13 = Math.Max(Tray13_L, Tray13_R); var Tray13 = Math.Max(Tray13_L, Tray13_R);
var Tray15 = Math.Max(Tray15_L, Tray15_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; int v=0;
if (Tray15 < overhight) if (Tray15 < overhight && Tray15>0)
{ {
if (SensorDebounce.Debounce(Tray15, out v)) if (SensorDebounce.Debounce(Tray15, out v))
TrayWidth = 15; TrayWidth = 15;
} }
else if (Tray13 < overhight) else if (Tray13 < overhight && Tray13>0)
{ {
if (SensorDebounce.Debounce(Tray13, out v)) if (SensorDebounce.Debounce(Tray13, out v))
TrayWidth = 13; TrayWidth = 13;
} }
else if (Tray7 < overhight) else if (Tray7 < overhight && Tray7 > 0)
{ {
if (SensorDebounce.Debounce(Tray7, out v)) if (SensorDebounce.Debounce(Tray7, out v))
TrayWidth = 7; TrayWidth = 7;
......
...@@ -33,8 +33,8 @@ namespace DeviceLibrary ...@@ -33,8 +33,8 @@ namespace DeviceLibrary
public bool IgnoreSafecheck { get; set; } public bool IgnoreSafecheck { get; set; }
public bool IgnoreGratingSignal { get; set; } public bool IgnoreGratingSignal { get; set; }
AxisBean Line_Entry_Axis; public AxisBean Line_Entry_Axis;
AxisBean Line_In_Axis; public AxisBean Line_In_Axis;
AxisBean ExitLine_Location_Axis; AxisBean ExitLine_Location_Axis;
AxisBean SideMove_X_Axis; AxisBean SideMove_X_Axis;
AxisBean SideMove_Z_Axis; AxisBean SideMove_Z_Axis;
...@@ -221,11 +221,14 @@ namespace DeviceLibrary ...@@ -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.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.Entry_Close, IO_XRay_Type.Entry_Open);
CylinderMove(ResetMoveInfo, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open); CylinderMove(ResetMoveInfo, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open);
SideMove_Z_Axis.HomeMove(ResetMoveInfo);
ExitLine_Location_Axis.HomeMove(ResetMoveInfo);
break; break;
case MoveStep.H02_HomeReset: case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
Line_Entry_Axis.RelMove(ResetMoveInfo, Config.Line_Entry_Relative*2, Config.Line_Entry_Relative_speed); 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); Line_In_Axis.RelMove(ResetMoveInfo, Config.Line_In_Relative*2, Config.Line_In_Relative_speed);
SideMove_X_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.log("正在回原"); ResetMoveInfo.log("正在回原");
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
......
...@@ -141,6 +141,10 @@ namespace DeviceLibrary ...@@ -141,6 +141,10 @@ namespace DeviceLibrary
{ {
AxisManager.SpeedMove(Config.DeviceName, Config.GetAxisValue(), targetSpeed); AxisManager.SpeedMove(Config.DeviceName, Config.GetAxisValue(), targetSpeed);
} }
public bool IsBusy
{
get => AxisManager.GetBusyStatus(Config.DeviceName, Config.GetAxisValue()) == 1;
}
/// <summary> /// <summary>
/// 判断AC伺服电机轴是否运动完成 /// 判断AC伺服电机轴是否运动完成
/// </summary> /// </summary>
......
...@@ -40,8 +40,9 @@ ...@@ -40,8 +40,9 @@
<Reference Include="Asa.PrintLabel"> <Reference Include="Asa.PrintLabel">
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath> <HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary, Version=1.0.8693.16314, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper"> <Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath> <HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath> <HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference> </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> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath> <HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="X-Ray, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="X-Ray, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <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> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -55,6 +55,7 @@ namespace AutoCountMachine ...@@ -55,6 +55,7 @@ namespace AutoCountMachine
this.btn_ManualCount = new System.Windows.Forms.Button(); this.btn_ManualCount = new System.Windows.Forms.Button();
this.cylinderButton4 = new AutoCountMachine.CylinderButton(); this.cylinderButton4 = new AutoCountMachine.CylinderButton();
this.cylinderButton5 = new AutoCountMachine.CylinderButton(); this.cylinderButton5 = new AutoCountMachine.CylinderButton();
this.btn_linesync = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
...@@ -163,6 +164,7 @@ namespace AutoCountMachine ...@@ -163,6 +164,7 @@ namespace AutoCountMachine
// panel1 // panel1
// //
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btn_linesync);
this.panel1.Controls.Add(this.axisMoveControl1); this.panel1.Controls.Add(this.axisMoveControl1);
this.panel1.Controls.Add(this.configControl1); this.panel1.Controls.Add(this.configControl1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
...@@ -363,6 +365,16 @@ namespace AutoCountMachine ...@@ -363,6 +365,16 @@ namespace AutoCountMachine
this.cylinderButton5.Text = "Entry_Open"; this.cylinderButton5.Text = "Entry_Open";
this.cylinderButton5.UseVisualStyleBackColor = false; 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 // XrayControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -412,5 +424,6 @@ namespace AutoCountMachine ...@@ -412,5 +424,6 @@ namespace AutoCountMachine
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btn_Calibration; private System.Windows.Forms.Button btn_Calibration;
private System.Windows.Forms.Button btn_linesync;
} }
} }
...@@ -382,5 +382,28 @@ namespace AutoCountMachine ...@@ -382,5 +382,28 @@ namespace AutoCountMachine
ManualCountRunning = false; 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!