Commit dd128ff7 刘韬

1

1 个父辈 2e627ea5
......@@ -124,6 +124,9 @@
<Compile Include="userControl\AxisTipControl.Designer.cs">
<DependentUpon>AxisTipControl.cs</DependentUpon>
</Compile>
<Compile Include="userControl\ToucDownBtn.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="userControl\AxisMoveControl.resx">
......
......@@ -156,7 +156,7 @@ namespace DeviceLibrary
if (retrytime > 2)
return;
retrytime++;
CloseCamera(cameraName);
LoadCamera(true);
LogUtil.info($"bitmap为空重试第{retrytime}次");
Task.Delay(1500).Wait();
goto retry;
......@@ -165,7 +165,7 @@ namespace DeviceLibrary
if (ho_Image == null && !nohalcon)
{
LogUtil.error(" 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName);
LoadCamera(true);
return;
}
if (idx==0)
......
......@@ -178,10 +178,9 @@ namespace DeviceLibrary
}
else
{
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false;
if (!RobotManage.mainMachine.AutoInOutTest && To.posid== BoxStorePosition.strings && ConfigHelper.Config.Get("Device_Use_Fixpos",false) && Fix!=null)
if (To.posid== BoxStorePosition.strings && ConfigHelper.Config.Get("Device_Use_Fixpos",false) && Fix!=null)
MoveInfo.NextMoveStep(MoveStep.StoreFIX01);
else
MoveInfo.NextMoveStep(MoveStep.StoreTS10);
......
......@@ -182,7 +182,7 @@ namespace DeviceLibrary
if (reel.PlateW > 7 && Config.InOut_P4 > 0)
InOut_P2 = Config.InOut_P4;
}
Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH - 8 + Config.Comp_PH_MM);
Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH - 8 + Config.Comp_PH_MM+20);
Comp_PL = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH - 8) - (reel.PlateH > 8 ? Config.Comp_PoToMM * Config.Comp_PL_MM : 0);
Comp_PH = Comp_PH < 0 ? 0 : Comp_PH;
Comp_PL = Comp_PL < 0 ? 0 : Comp_PL;
......
......@@ -13,7 +13,7 @@ namespace DeviceLibrary
{
partial class MainMachine
{
public bool StartAutoInOutTest(int posindex, out string errmsg)
public bool StartAutoInOutTest(string posname, out string errmsg)
{
errmsg = "";
if (!boxTransport.IsComplateOrFree)
......@@ -27,9 +27,10 @@ namespace DeviceLibrary
return false;
}
poslist = RobotManage.PositionNumList.Select(a => { return CSVPositionReader<ACStorePosition>.allPositionMap[a]; }).ToList();//CSVPositionReader<ACStorePosition>.getPositionList();
poslist.RemoveAll(x=> { return x.PositionNum.StartsWith("fix#"); });
CurrentPosIndex = poslist.FindIndex(x => x.PositionNum == posname);
AutoInOutTest = true;
StopAutoInOut = false;
CurrentPosIndex = posindex;
//AIOTMoveInfo.NewMove(MoveStep.Wait);
return true;
}
......
......@@ -78,10 +78,10 @@
this.btnAxisStop = new System.Windows.Forms.Button();
this.btnAxisReturnHome = new System.Windows.Forms.Button();
this.cmbAxis = new System.Windows.Forms.ComboBox();
this.btnDelMove = new System.Windows.Forms.Button();
this.btnDelMove = new ToucDownBtn();
this.btnOpenAxis = new System.Windows.Forms.Button();
this.btnCloseAxis = new System.Windows.Forms.Button();
this.btnAddMove = new System.Windows.Forms.Button();
this.btnAddMove = new ToucDownBtn();
this.txtASpeed = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label47 = new System.Windows.Forms.Label();
......@@ -1005,8 +1005,8 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtServoStatue;
private System.Windows.Forms.Button btnDelMove;
private System.Windows.Forms.Button btnAddMove;
private ToucDownBtn btnDelMove;
private ToucDownBtn btnAddMove;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comjSpeed;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
class ToucDownBtn : System.Windows.Forms.Button
{
public const int WM_POINTERDOWN = 0x246;
public const int WM_POINTERUP = 0x247;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_POINTERDOWN:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseDown(args);
//Console.WriteLine("WM_POINTERDOWN");
break;
}
case WM_POINTERUP:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseUp(args);
//Console.WriteLine("WM_POINTERUP");
break;
}
}
base.WndProc(ref m);
}
}
......@@ -179,7 +179,7 @@ namespace TheMachine
this.tabc.Location = new System.Drawing.Point(0, 119);
this.tabc.Name = "tabc";
this.tabc.SelectedIndex = 0;
this.tabc.Size = new System.Drawing.Size(1008, 610);
this.tabc.Size = new System.Drawing.Size(1008, 600);
this.tabc.TabIndex = 1;
//
// tabP1
......@@ -187,7 +187,7 @@ namespace TheMachine
this.tabP1.Controls.Add(this.pnl);
this.tabP1.Location = new System.Drawing.Point(4, 30);
this.tabP1.Name = "tabP1";
this.tabP1.Size = new System.Drawing.Size(1000, 576);
this.tabP1.Size = new System.Drawing.Size(1000, 566);
this.tabP1.TabIndex = 0;
this.tabP1.Text = "信息";
this.tabP1.UseVisualStyleBackColor = true;
......@@ -206,7 +206,7 @@ namespace TheMachine
this.pnl.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnl.Location = new System.Drawing.Point(0, 0);
this.pnl.Name = "pnl";
this.pnl.Size = new System.Drawing.Size(1000, 576);
this.pnl.Size = new System.Drawing.Size(1000, 566);
this.pnl.TabIndex = 273;
//
// groupBox1
......@@ -214,7 +214,7 @@ namespace TheMachine
this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(3, 4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(598, 292);
this.groupBox1.Size = new System.Drawing.Size(598, 248);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "运行状态";
......@@ -228,13 +228,13 @@ namespace TheMachine
this.stateView.Location = new System.Drawing.Point(3, 25);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(592, 264);
this.stateView.Size = new System.Drawing.Size(592, 220);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
//
// btn_releasestring
//
this.btn_releasestring.Location = new System.Drawing.Point(607, 225);
this.btn_releasestring.Location = new System.Drawing.Point(607, 212);
this.btn_releasestring.Name = "btn_releasestring";
this.btn_releasestring.Size = new System.Drawing.Size(301, 40);
this.btn_releasestring.TabIndex = 272;
......@@ -257,7 +257,7 @@ namespace TheMachine
// pictureBox2
//
this.pictureBox2.BackColor = System.Drawing.Color.Gainsboro;
this.pictureBox2.Location = new System.Drawing.Point(472, 302);
this.pictureBox2.Location = new System.Drawing.Point(472, 258);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(436, 271);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -281,7 +281,7 @@ namespace TheMachine
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Gainsboro;
this.pictureBox1.Location = new System.Drawing.Point(3, 302);
this.pictureBox1.Location = new System.Drawing.Point(3, 258);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(451, 271);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -370,7 +370,7 @@ namespace TheMachine
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1008, 729);
this.ClientSize = new System.Drawing.Size(1008, 719);
this.Controls.Add(this.tabc);
this.Controls.Add(this.listView1);
this.Controls.Add(this.btn_stop);
......
......@@ -37,12 +37,13 @@ namespace TheMachine
this.cylinderButton2 = new TheMachine.CylinderButton();
this.cylinderButton7 = new TheMachine.CylinderButton();
this.cylinderButton6 = new TheMachine.CylinderButton();
this.cylinderButton1 = new TheMachine.CylinderButton();
this.ioControl1 = new TheMachine.IOControl();
this.btn_flipopen = new System.Windows.Forms.Button();
this.btn_flipclose = new System.Windows.Forms.Button();
this.btn_stringdooropen = new System.Windows.Forms.Button();
this.btn_stringdoorclose = new System.Windows.Forms.Button();
this.btn_ngdooropen = new System.Windows.Forms.Button();
this.btn_ngdoorclose = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btn_linerun
......@@ -81,7 +82,7 @@ namespace TheMachine
this.cylinderButton5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton5.IO_HIGH = "StringPosChecker_Work";
this.cylinderButton5.IO_LOW = "StringPosChecker_Home";
this.cylinderButton5.Location = new System.Drawing.Point(566, 327);
this.cylinderButton5.Location = new System.Drawing.Point(566, 293);
this.cylinderButton5.Name = "cylinderButton5";
this.cylinderButton5.Size = new System.Drawing.Size(224, 32);
this.cylinderButton5.TabIndex = 1;
......@@ -95,7 +96,7 @@ namespace TheMachine
this.cylinderButton4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton4.IO_HIGH = "Clamping_Work";
this.cylinderButton4.IO_LOW = "Clamping_Relax";
this.cylinderButton4.Location = new System.Drawing.Point(566, 290);
this.cylinderButton4.Location = new System.Drawing.Point(566, 255);
this.cylinderButton4.Name = "cylinderButton4";
this.cylinderButton4.Size = new System.Drawing.Size(224, 32);
this.cylinderButton4.TabIndex = 1;
......@@ -109,7 +110,7 @@ namespace TheMachine
this.cylinderButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton2.IO_HIGH = "StringFix_Top";
this.cylinderButton2.IO_LOW = "StringFix_Bottom";
this.cylinderButton2.Location = new System.Drawing.Point(566, 253);
this.cylinderButton2.Location = new System.Drawing.Point(566, 217);
this.cylinderButton2.Name = "cylinderButton2";
this.cylinderButton2.Size = new System.Drawing.Size(224, 32);
this.cylinderButton2.TabIndex = 1;
......@@ -145,20 +146,6 @@ namespace TheMachine
this.cylinderButton6.Text = "Camera_Led";
this.cylinderButton6.UseVisualStyleBackColor = false;
//
// cylinderButton1
//
this.cylinderButton1.BackColor = System.Drawing.Color.White;
this.cylinderButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton1.IO_HIGH = "NGDoor_Open";
this.cylinderButton1.IO_LOW = "NGDoor_Close";
this.cylinderButton1.Location = new System.Drawing.Point(566, 216);
this.cylinderButton1.Name = "cylinderButton1";
this.cylinderButton1.Size = new System.Drawing.Size(224, 32);
this.cylinderButton1.TabIndex = 1;
this.cylinderButton1.Tag = "not";
this.cylinderButton1.Text = "NGDoor_Open";
this.cylinderButton1.UseVisualStyleBackColor = false;
//
// ioControl1
//
this.ioControl1.BackColor = System.Drawing.Color.White;
......@@ -211,6 +198,26 @@ namespace TheMachine
this.btn_stringdoorclose.UseVisualStyleBackColor = true;
this.btn_stringdoorclose.Click += new System.EventHandler(this.btn_stringdoorclose_Click);
//
// btn_ngdooropen
//
this.btn_ngdooropen.Location = new System.Drawing.Point(566, 331);
this.btn_ngdooropen.Name = "btn_ngdooropen";
this.btn_ngdooropen.Size = new System.Drawing.Size(113, 32);
this.btn_ngdooropen.TabIndex = 2;
this.btn_ngdooropen.Text = "单料门打开";
this.btn_ngdooropen.UseVisualStyleBackColor = true;
this.btn_ngdooropen.Click += new System.EventHandler(this.btn_ngdooropen_Click);
//
// btn_ngdoorclose
//
this.btn_ngdoorclose.Location = new System.Drawing.Point(685, 331);
this.btn_ngdoorclose.Name = "btn_ngdoorclose";
this.btn_ngdoorclose.Size = new System.Drawing.Size(105, 32);
this.btn_ngdoorclose.TabIndex = 2;
this.btn_ngdoorclose.Text = "单料门关闭";
this.btn_ngdoorclose.UseVisualStyleBackColor = true;
this.btn_ngdoorclose.Click += new System.EventHandler(this.btn_ngdoorclose_Click);
//
// IOControls
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -218,15 +225,16 @@ namespace TheMachine
this.Controls.Add(this.btn_stringdooropen);
this.Controls.Add(this.btn_flipclose);
this.Controls.Add(this.btn_flipopen);
this.Controls.Add(this.btn_ngdoorclose);
this.Controls.Add(this.btn_linerev);
this.Controls.Add(this.btn_linestop);
this.Controls.Add(this.btn_ngdooropen);
this.Controls.Add(this.btn_linerun);
this.Controls.Add(this.cylinderButton5);
this.Controls.Add(this.cylinderButton4);
this.Controls.Add(this.cylinderButton2);
this.Controls.Add(this.cylinderButton7);
this.Controls.Add(this.cylinderButton6);
this.Controls.Add(this.cylinderButton1);
this.Controls.Add(this.ioControl1);
this.Font = new System.Drawing.Font("新宋体", 9F);
this.Name = "IOControls";
......@@ -238,7 +246,6 @@ namespace TheMachine
#endregion
private IOControl ioControl1;
private CylinderButton cylinderButton1;
private CylinderButton cylinderButton2;
private CylinderButton cylinderButton4;
private CylinderButton cylinderButton5;
......@@ -251,5 +258,7 @@ namespace TheMachine
private System.Windows.Forms.Button btn_flipclose;
private System.Windows.Forms.Button btn_stringdooropen;
private System.Windows.Forms.Button btn_stringdoorclose;
private System.Windows.Forms.Button btn_ngdooropen;
private System.Windows.Forms.Button btn_ngdoorclose;
}
}
......@@ -73,5 +73,15 @@ namespace TheMachine
LogUtil.info("手动控制:折叠门门关闭");
RobotManage.mainMachine.StringDoorClose(null);
}
private void btn_ngdooropen_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.SingleDoor.ToHigh(null);
}
private void btn_ngdoorclose_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.SingleDoor.ToLow(null);
}
}
}
......@@ -441,8 +441,7 @@ namespace TheMachine
DialogResult res = MessageBox.Show(crc.GetString(L.autotest_msg_02, "确定开始自动库位测试?\n请确保料仓库位全部为空."), crc.GetString(L.tips, "提示"), MessageBoxButtons.YesNo);
if (res == DialogResult.No)
return;
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
if (!RobotManage.mainMachine.StartAutoInOutTest(posindex,out string errmsg))
if (!RobotManage.mainMachine.StartAutoInOutTest(cmbPosition.Text, out string errmsg))
{
MessageBox.Show(errmsg);
return;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!