优化登录用户权限的控制

Eight
lhiven 6 months ago
parent 111494038e
commit 804341110a

@ -48,8 +48,41 @@ namespace Rs.MotionPlat
{ {
if(!string.IsNullOrEmpty(GlobalUser.UserName)) if(!string.IsNullOrEmpty(GlobalUser.UserName))
{ {
if (tableLayoutPanel2.Enabled==false)
{
if(!GlobalUser.IsPm())
{
tableLayoutPanel2.Enabled = true;
}
}
if (cboxTestMode.Enabled==false) if (cboxTestMode.Enabled==false)
{
cboxTestMode.Items.Clear();
if (GlobalUser.IsOp())
{
cboxTestMode.Items.Add("Production");
cboxTestMode.Items.Add("REL");
//cboxTestMode.SelectedIndex = 0;
}
else if(GlobalUser.IsAudit())
{
cboxTestMode.Items.Add("GRR");
cboxTestMode.Items.Add("AUDIT");
cboxTestMode.SelectedIndex = 0;
}
else if(GlobalUser.IsSuper()||GlobalUser.IsVender())
{
cboxTestMode.Items.Add("Production");
cboxTestMode.Items.Add("GRR");
cboxTestMode.Items.Add("AUDIT");
cboxTestMode.Items.Add("REL");
cboxTestMode.Items.Add("DOE");
//cboxTestMode.SelectedIndex = 0;
}
cboxTestMode.Enabled = true; cboxTestMode.Enabled = true;
}
if(cboxTestMethod.Enabled==false) if(cboxTestMethod.Enabled==false)
cboxTestMethod.Enabled = true; cboxTestMethod.Enabled = true;
if(txtLotName.Enabled==false) if(txtLotName.Enabled==false)
@ -68,8 +101,21 @@ namespace Rs.MotionPlat
} }
else else
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Working)
{
Ops.Stop();
}
if (tableLayoutPanel2.Enabled)
{
tableLayoutPanel2.Enabled = false;
}
if (cboxTestMode.Enabled == true) if (cboxTestMode.Enabled == true)
{
cboxTestMode.Items.Clear();
cboxTestMode.Enabled = false; cboxTestMode.Enabled = false;
}
if (cboxTestMethod.Enabled == true) if (cboxTestMethod.Enabled == true)
cboxTestMethod.Enabled = false; cboxTestMethod.Enabled = false;
if (txtLotName.Enabled == true) if (txtLotName.Enabled == true)
@ -792,5 +838,15 @@ namespace Rs.MotionPlat
} }
} }
} }
private void btnEndLot_Click(object sender, EventArgs e)
{
List<TestFixture> fixtureList = TestFixtureManager.Instance.GetEnableFixtureList();
if(fixtureList!=null && fixtureList.Count>0)
{
fixtureList[0].Send("LotEnd$");
DevLog.EventTracker("End", 0, "", "End");
}
}
} }
} }

@ -84,6 +84,7 @@ namespace Rs.MotionPlat
this.panel7 = new System.Windows.Forms.Panel(); this.panel7 = new System.Windows.Forms.Panel();
this.panel8 = new System.Windows.Forms.Panel(); this.panel8 = new System.Windows.Forms.Panel();
this.groupBox39 = new System.Windows.Forms.GroupBox(); this.groupBox39 = new System.Windows.Forms.GroupBox();
this.btnEndLot = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.cboxNoise = new System.Windows.Forms.CheckBox(); this.cboxNoise = new System.Windows.Forms.CheckBox();
this.cboxMtcp = new System.Windows.Forms.CheckBox(); this.cboxMtcp = new System.Windows.Forms.CheckBox();
@ -376,6 +377,7 @@ namespace Rs.MotionPlat
this.tableLayoutPanel2.Controls.Add(this.panelEx3, 0, 2); this.tableLayoutPanel2.Controls.Add(this.panelEx3, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.panelEx4, 0, 3); this.tableLayoutPanel2.Controls.Add(this.panelEx4, 0, 3);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Enabled = false;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 4; this.tableLayoutPanel2.RowCount = 4;
@ -934,6 +936,7 @@ namespace Rs.MotionPlat
// //
// groupBox39 // groupBox39
// //
this.groupBox39.Controls.Add(this.btnEndLot);
this.groupBox39.Controls.Add(this.btnSave); this.groupBox39.Controls.Add(this.btnSave);
this.groupBox39.Controls.Add(this.cboxNoise); this.groupBox39.Controls.Add(this.cboxNoise);
this.groupBox39.Controls.Add(this.cboxMtcp); this.groupBox39.Controls.Add(this.cboxMtcp);
@ -956,6 +959,20 @@ namespace Rs.MotionPlat
this.groupBox39.TabStop = false; this.groupBox39.TabStop = false;
this.groupBox39.Text = "Config"; this.groupBox39.Text = "Config";
// //
// btnEndLot
//
this.btnEndLot.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnEndLot.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnEndLot.FlatAppearance.BorderSize = 0;
this.btnEndLot.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEndLot.Location = new System.Drawing.Point(407, 74);
this.btnEndLot.Name = "btnEndLot";
this.btnEndLot.Size = new System.Drawing.Size(86, 29);
this.btnEndLot.TabIndex = 0;
this.btnEndLot.Text = "LotEnd";
this.btnEndLot.UseVisualStyleBackColor = false;
this.btnEndLot.Click += new System.EventHandler(this.btnEndLot_Click);
//
// btnSave // btnSave
// //
this.btnSave.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnSave.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
@ -1081,12 +1098,6 @@ namespace Rs.MotionPlat
this.cboxTestMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboxTestMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboxTestMode.Enabled = false; this.cboxTestMode.Enabled = false;
this.cboxTestMode.FormattingEnabled = true; this.cboxTestMode.FormattingEnabled = true;
this.cboxTestMode.Items.AddRange(new object[] {
"Production",
"GRR",
"AUDIT",
"REL",
"DOE"});
this.cboxTestMode.Location = new System.Drawing.Point(83, 45); this.cboxTestMode.Location = new System.Drawing.Point(83, 45);
this.cboxTestMode.Name = "cboxTestMode"; this.cboxTestMode.Name = "cboxTestMode";
this.cboxTestMode.Size = new System.Drawing.Size(173, 20); this.cboxTestMode.Size = new System.Drawing.Size(173, 20);
@ -2049,5 +2060,6 @@ namespace Rs.MotionPlat
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lblAvgUpg; private System.Windows.Forms.Label lblAvgUpg;
private System.Windows.Forms.Timer timeruph; private System.Windows.Forms.Timer timeruph;
private System.Windows.Forms.Button btnEndLot;
} }
} }
Loading…
Cancel
Save