修改主页的类名

master
lhiven 3 years ago
parent 91f9910a03
commit 16253c59af

File diff suppressed because it is too large Load Diff

@ -42,7 +42,6 @@ namespace Rs.MotionPlat
HOperatorSet.GenEmptyObj(out hmodelImage); HOperatorSet.GenEmptyObj(out hmodelImage);
modelID = new HTuple(); modelID = new HTuple();
HOperatorSet.ReadShapeModel("Model/model.shm", out modelID); HOperatorSet.ReadShapeModel("Model/model.shm", out modelID);
inputTray1.Fill();
LoadModel(); LoadModel();
WorkFlow.Instance.CameraOkEvent += Instance_CameraOkEvent1; WorkFlow.Instance.CameraOkEvent += Instance_CameraOkEvent1;
SpaceFlow.Instance.CameraOkEvent += Instance_CameraOkEvent1; SpaceFlow.Instance.CameraOkEvent += Instance_CameraOkEvent1;
@ -286,103 +285,26 @@ namespace Rs.MotionPlat
inputTray2.Init(); inputTray2.Init();
inputTray3.ItemName = "料盘4"; inputTray3.ItemName = "料盘4";
inputTray3.Init(); inputTray3.Init();
okTray1.ItemName = "料盘5"; //okTray1.ItemName = "料盘5";
okTray1.Init(); //okTray1.Init();
okTray2.ItemName = "料盘6"; //okTray2.ItemName = "料盘6";
okTray2.Init(); //okTray2.Init();
okTray3.ItemName = "料盘7"; //okTray3.ItemName = "料盘7";
okTray3.Init(); //okTray3.Init();
ngTray.ItemName = "料盘8"; //ngTray.ItemName = "料盘8";
ngTray.Init(); //ngTray.Init();
GlobalTray.InputTray1 = inputTray1; GlobalTray.InputTray1 = inputTray1;
GlobalTray.InputTray2 = inputTray2; GlobalTray.InputTray2 = inputTray2;
GlobalTray.InputTray3 = inputTray3; GlobalTray.InputTray3 = inputTray3;
GlobalTray.MultiTray = multiTray; GlobalTray.MultiTray = multiTray;
GlobalTray.OkTray1 = okTray1; //GlobalTray.OkTray1 = okTray1;
GlobalTray.OkTray2 = okTray2; //GlobalTray.OkTray2 = okTray2;
GlobalTray.OkTray3 = okTray3; //GlobalTray.OkTray3 = okTray3;
GlobalTray.NgTray = ngTray; //GlobalTray.NgTray = ngTray;
tabControlEx1.TabPages.RemoveAt(1);
} }
private void btnStart_Click(object sender, EventArgs e)
{
//axis = AxisControl.VacZ7;
//axis.Enable();
//AxisControl.VacR7.Enable();
//int workStep = 0;
//Task.Run(() => {
// while (true)
// {
// switch (workStep)
// {
// case 0://到起点
// if(testNum>100)
// {
// testNum = 0;
// speed += 1;
// }
// else
// {
// testNum++;
// }
// axis.MovePos(2, speed);
// workStep++;
// break;
// case 1:
// axis.IsStop(out bool bStop);
// if (bStop)
// {
// workStep++;
// Thread.Sleep(100);
// //设置
// //double targetPos = -105;
// //targetPos-
// //axis.SetPosCompare(1, new double[] { -20, -80 });
// }
// break;
// case 2:
// axis.MovePos(15, speed);
// workStep++;
// break;
// case 3:
// axis.IsStop(out bStop);
// if (bStop)
// {
// workStep++;
// Thread.Sleep(100);
// HikCamera.Instance.Grab("MV-CA050-10GM (00C32922251)");
// }
// break;
// case 4:
// if (cameraFinished)
// {
// cameraFinished = false;
// workStep = 0;
// }
// break;
// default:
// break;
// }
// }
//});
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void btnWholeHome_Load(object sender, EventArgs e) private void btnWholeHome_Load(object sender, EventArgs e)
{ {
HomeFlow.Instance.StartGoHome(); HomeFlow.Instance.StartGoHome();

@ -1,6 +1,6 @@
namespace Rs.MotionPlat namespace Rs.MotionPlat
{ {
partial class Home2 partial class Home
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.panel_main = new System.Windows.Forms.Panel(); this.panel_main = new System.Windows.Forms.Panel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.btnPermission = new Rs.Controls.ButtonEx(); this.btnPermission = new Rs.Controls.ButtonEx();
@ -40,8 +41,13 @@
this.btnRecipe = new Rs.Controls.ButtonEx(); this.btnRecipe = new Rs.Controls.ButtonEx();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.panelEx1 = new Rs.Controls.PanelEx(); this.panelEx1 = new Rs.Controls.PanelEx();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.lblMachineState = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// panel_main // panel_main
@ -268,6 +274,7 @@
// panel1 // panel1
// //
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(46)))), ((int)(((byte)(46)))), ((int)(((byte)(46))))); this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(46)))), ((int)(((byte)(46)))), ((int)(((byte)(46)))));
this.panel1.Controls.Add(this.tableLayoutPanel3);
this.panel1.Controls.Add(this.panelEx1); this.panel1.Controls.Add(this.panelEx1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 907); this.panel1.Location = new System.Drawing.Point(0, 907);
@ -283,7 +290,49 @@
this.panelEx1.Size = new System.Drawing.Size(997, 33); this.panelEx1.Size = new System.Drawing.Size(997, 33);
this.panelEx1.TabIndex = 0; this.panelEx1.TabIndex = 0;
// //
// Home2 // tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.tableLayoutPanel3.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.lblMachineState, 1, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Left;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(158, 33);
this.tableLayoutPanel3.TabIndex = 1;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 33);
this.label1.TabIndex = 0;
this.label1.Text = "State:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblMachineState
//
this.lblMachineState.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblMachineState.ForeColor = System.Drawing.Color.White;
this.lblMachineState.Location = new System.Drawing.Point(50, 0);
this.lblMachineState.Name = "lblMachineState";
this.lblMachineState.Size = new System.Drawing.Size(105, 33);
this.lblMachineState.TabIndex = 1;
this.lblMachineState.Text = "Noinit";
this.lblMachineState.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// timer1
//
this.timer1.Interval = 300;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Home
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@ -291,8 +340,8 @@
this.Controls.Add(this.panel_main); this.Controls.Add(this.panel_main);
this.Controls.Add(this.tableLayoutPanel2); this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.HeadText = "三温机"; this.HeadText = "天线";
this.Name = "Home2"; this.Name = "Home";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Home2"; this.Text = "Home2";
this.Load += new System.EventHandler(this.Home2_Load); this.Load += new System.EventHandler(this.Home2_Load);
@ -301,6 +350,7 @@
this.Controls.SetChildIndex(this.panel_main, 0); this.Controls.SetChildIndex(this.panel_main, 0);
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -319,5 +369,9 @@
private Controls.ButtonEx btnRecipe; private Controls.ButtonEx btnRecipe;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private Controls.PanelEx panelEx1; private Controls.PanelEx panelEx1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblMachineState;
private System.Windows.Forms.Timer timer1;
} }
} }

@ -16,12 +16,13 @@ using Rs.Camera;
using System.Threading; using System.Threading;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using static System.Runtime.CompilerServices.RuntimeHelpers; using static System.Runtime.CompilerServices.RuntimeHelpers;
using Rs.Motion.GugaoPulse;
namespace Rs.MotionPlat namespace Rs.MotionPlat
{ {
public partial class Home2 : BaseFormHeader public partial class Home : BaseFormHeader
{ {
public Home2() public Home()
{ {
this.StartPosition = FormStartPosition.Manual; this.StartPosition = FormStartPosition.Manual;
InitializeComponent(); InitializeComponent();
@ -137,8 +138,6 @@ namespace Rs.MotionPlat
}); });
} }
// 5
// .6+7+10=17+5.6=22.6+0.5=23+10=33+1.3=34.3+5=39.3+3.5=42.8+2=44.8
} }
private void Home2_Load(object sender, EventArgs e) private void Home2_Load(object sender, EventArgs e)
@ -163,93 +162,10 @@ namespace Rs.MotionPlat
panel_main.Controls.Add(form); panel_main.Controls.Add(form);
form.Visible = true; form.Visible = true;
ActiveForms.Add(form); ActiveForms.Add(form);
btnMain.Selected = true;
} }
#region 初始化固高卡 Ops.Init();
ErrorCode errCode = GugaoCardManager.Instance.Init(); timer1.Enabled = true;
if (errCode > ErrorCode.Ok)
{
MessageQueue.Instance.Warn("Gugao motion card load fail");
}
else
{
AxisControl.LoadX.Enable();
AxisControl.LoadY.Enable();
AxisControl.PressZ.Enable();
AxisControl.TestZ.Enable();
AxisControl.TestY.Enable();
MessageQueue.Instance.Insert("Gugao motion card load ok");
}
#endregion
#region 初始化ztm卡
errCode = ZtmCardManager.Instance.Init();
if (errCode > ErrorCode.Ok)
{
MessageQueue.Instance.Warn("ZTM motion card load fail");
}
else
{
AxisControl.VacZ1.Enable();
AxisControl.VacZ2.Enable();
AxisControl.VacR1.Enable();
AxisControl.VacR2.Enable();
MessageQueue.Instance.Insert("ZTM motion card load ok");
}
#endregion
#region 初始化IO
IoManager.Instance.Init();
#endregion
#region 链接相机
//链接相机
ECameraErrorCode ceCode = HikCamera.Instance.Init();
if (ceCode > ECameraErrorCode.Ok)
{
MessageQueue.Instance.Warn(ceCode.ToString());
}
else
{
MessageQueue.Instance.Insert("Camera load ok!");
int ret = HikCamera.Instance.SetReverseX("upCamera", EDir.Y, true);
ret += HikCamera.Instance.SetReverseX("upCamera", EDir.X, true);
if (ret!=0)
{
MessageQueue.Instance.Warn("Camera init error");
}
ret = 0;
ret = HikCamera.Instance.SetReverseX("downCamera", EDir.X, true);
ret += HikCamera.Instance.SetReverseX("downCamera", EDir.Y, false);
if (ret != 0)
{
MessageQueue.Instance.Warn("Camera init error");
}
ret = HikCamera.Instance.StartGrab("upCamera");
if (ret != 0)
{
MessageQueue.Instance.Warn("Camera init error");
}
ret = HikCamera.Instance.StartGrab("downCamera");
if (ret != 0)
{
MessageQueue.Instance.Warn("Camera init error");
}
}
#endregion
//AxisControl.FX.ClearCompare(1);
for (int i = 1; i <= 16; i++)
{
IoManager.Instance.WriteOut($"吸嘴真空{i}", 1);
}
IoManager.Instance.WriteOut($"吸嘴1真空吸", 0);
IoManager.Instance.WriteOut($"吸嘴2真空吸", 0);
IoManager.Instance.WriteOut($"吸嘴1真空破", 0);
IoManager.Instance.WriteOut($"吸嘴2真空破", 0);
SafeControl.Instance.Init();
NozzleManager.Init();
TestCenter.Instance.Init();
MachineManage.Instance.InitializeState = EInitializeState.Initialized;
} }
private void SetFormStyle() private void SetFormStyle()
@ -259,5 +175,11 @@ namespace Rs.MotionPlat
this.WindowState = FormWindowState.Maximized;//设置窗体最大化显示 this.WindowState = FormWindowState.Maximized;//设置窗体最大化显示
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;//设置窗体在无边框和最大化时不遮挡任务栏 this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;//设置窗体在无边框和最大化时不遮挡任务栏
} }
private void timer1_Tick(object sender, EventArgs e)
{
if(MachineManage.Instance.MachineStatus.ToString()!=lblMachineState.Text)
lblMachineState.Text=MachineManage.Instance.MachineStatus.ToString();
}
} }
} }

@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

@ -18,7 +18,7 @@ namespace Rs.MotionPlat
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Home2()); Application.Run(new Home());
} }
} }
} }

Loading…
Cancel
Save