void FrmUserLoad(object sender, EventArgs e) { combUserName.Items.Clear(); combUserName.Items.AddRange(UserManager.GetAllUserNames().ToArray()); combUserName.SelectedItem = Globals.CurrentUser; combUserName2.Items.Clear(); combUserName2.Items.AddRange(UserManager.GetAllUserNames().ToArray()); combUserName2.SelectedItem = Globals.CurrentUser; btnProductionMode.Text = EnumDescription.GetFieldText(Globals.RunMode.ProductionMode); btnEngineeringMode.Text = EnumDescription.GetFieldText(Globals.RunMode.EngineeringMode); btnCpkGrrMode.Text = EnumDescription.GetFieldText(Globals.RunMode.CpkGrrMode); Globals.SetControlsEnable(panelMode); }
private void tUpdateUI_Tick(object sender, EventArgs e) { TSSL_DateTime.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss"); tsslRunStatus.Text = EnumDescription.GetFieldText(Globals.runStatus); tsslRunStatus.ForeColor = Globals.runStatus == Globals.RunStatus.Alarm ? Color.Red : Color.Black; if (tsslCurrentUser.Text != Globals.CurrentUser) { tsslCurrentUser.Text = Globals.CurrentUser; tsslCurrentUser.ForeColor = Globals.CurrentUser == "工程师" ? Color.Red : Color.Black; Globals.SetControlsEnable(panelTitle); } tsslMode.Text = EnumDescription.GetFieldText(Globals.CurrentRunMode); tsslMode.ForeColor = Globals.CurrentRunMode == Globals.RunMode.ProductionMode ? Color.Black : Color.Red; }