private void buttonChangePassword_Click(object sender, EventArgs e) { if (listUsers.SelectedIndex < 0) { return; } var userFile = LoadUserFile(); var user = userFile.Find((string)listUsers.Items[listUsers.SelectedIndex]); if (user == null) { return; } var passwordForm = new FormPassword(); passwordForm.Message = "Enter new password for " + user.UserName + ":"; passwordForm.UserName = user.UserName; passwordForm.UserNameReadOnly = true; passwordForm.ShowDialog(this); if (!passwordForm.Accepted) { return; } user.ResetPassword(passwordForm.Password); SaveUserFile(userFile); }
void CreateNewUser(UserFile userFile, string message) { var passwordForm = new FormPassword(); passwordForm.Message = message; passwordForm.ShowDialog(this); if (!passwordForm.Accepted) { return; } var user = userFile.Find(passwordForm.UserName); if (user != null) { MessageBox.Show(this, "This user already exists", App.Name); return; } // Create and save new user user = new User(); user.UserName = passwordForm.UserName; user.ResetPassword(passwordForm.Password); userFile.Users.Add(user); }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; lbCrntDevice.Text = OM.GetCrntDev(); //Download 버튼 활성화 조건(나중에 확인 진섭) if (SEQ._iSeqStat == EN_SEQ_STAT.Stop || SEQ._iSeqStat == EN_SEQ_STAT.Error) { btDownload.Enabled = true; } //접근레벨에 따른 Setting 버튼 활성화 int iLevel = (int)FormPassword.GetLevel(); switch (iLevel) { case (int)EN_LEVEL.Operator: btSetting.Enabled = false; break; case (int)EN_LEVEL.Engineer: btSetting.Enabled = true; break; case (int)EN_LEVEL.Master: btSetting.Enabled = true; break; default: break; } tmUpdate.Enabled = true; }
private void lbName_Click(object sender, EventArgs e) { if (FormPassword.GetLevel() == EN_LEVEL.Master) { if (FrmMaster.IsDisposed) { FrmMaster = new FormMaster(); } FrmMaster.Show(); } }
private bool Authenticate() { FormPassword f = new FormPassword(); DialogResult dr = DialogResult.OK; for (int i = 0; i < 3 && dr == DialogResult.OK && f.Password != "pass"; ++i) { dr = f.ShowDialog(); } return(f.Password == "pass"); }
private void lvDayInfo_MouseDoubleClick(object sender, MouseEventArgs e) //요거는 확인 해봐야 함 진섭 { if (FormPassword.GetLevel() != EN_LEVEL.Master) { return; } if (Log.ShowMessageModal("Confirm", "Clear Day Info?") != DialogResult.Yes) { return; } SPC.DAY.ClearData(); }
private void lvDayInfo_MouseDoubleClick_1(object sender, MouseEventArgs e) { string sText = ((Button)sender).Text; Log.Trace(sFormText + sText + " Button Clicked", ti.Frm); if (FormPassword.GetLevel() != EN_LEVEL.Master) { return; } if (Log.ShowMessageModal("Confirm", "Clear Day Info?") != DialogResult.Yes) { return; } }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; btLotDelete.Enabled = FormPassword.GetLevel() > EN_LEVEL.Operator; btErrDelete.Enabled = FormPassword.GetLevel() > EN_LEVEL.Operator; btFailDelete.Enabled = FormPassword.GetLevel() > EN_LEVEL.Operator; btSetRepair.Enabled = FormPassword.GetLevel() > EN_LEVEL.Operator; if (!this.Visible) { tmUpdate.Enabled = false; return; } tmUpdate.Enabled = true; }
public FormOperation(Panel _pnBase) { InitializeComponent(); FrmPassword = new FormPassword(); FrmLotOpen = new FormLotOpen(); this.TopLevel = false; this.Parent = _pnBase; //FrmMain = _FrmMain; DayInfoList(); LotInfoList(); pnPassWord.Visible = false; tmUpdate.Enabled = true; btLotEnd.Enabled = LOT.GetLotOpen(); btStart.Enabled = LOT.GetLotOpen(); btLotOpen.Enabled = !LOT.GetLotOpen(); // DM.ARAY[(int)ri.IDX].SetParent(pnIdx); DM.ARAY[(int)ri.IDX].Name = "riIDX"; DM.ARAY[(int)ri.IDX].SetDispColor(cs.None, Color.White); DM.ARAY[(int)ri.IDX].SetDispName(cs.None, "NotExsist"); DM.ARAY[(int)ri.IDX].SetVisible(cs.None, true); DM.ARAY[(int)ri.IDX].SetDispColor(cs.Empty, Color.Gray); DM.ARAY[(int)ri.IDX].SetDispName(cs.Empty, "Empty"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Empty, true); DM.ARAY[(int)ri.IDX].SetDispColor(cs.Unkwn, Color.Aqua); DM.ARAY[(int)ri.IDX].SetDispName(cs.Unkwn, "Unknown"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Unkwn, true); DM.ARAY[(int)ri.IDX].SetDispColor(cs.Move, Color.Yellow); DM.ARAY[(int)ri.IDX].SetDispName(cs.Move, "Move"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Move, true); DM.ARAY[(int)ri.IDX].SetDispColor(cs.Work, Color.Blue); DM.ARAY[(int)ri.IDX].SetDispName(cs.Work, "Work"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Work, true); DM.ARAY[(int)ri.IDX].SetMaxColRow(1, 1); // //DM.ARAY[(int)ri.PST_IDX].SetParent(pnPst); //DM.ARAY[(int)ri.PST_IDX].Name = "riPst"; //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.None , Color.White ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.None , "NotExsist" ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.None , true); //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.Empty, Color.Gray ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.Empty, "Empty" ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.Empty, true); //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.Work , Color.Blue ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.Work , "Work" ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.Work , true); //DM.ARAY[(int)ri.PST_IDX].SetMaxColRow(1, 5); DM.LoadMap(); }
//사용자 레벨 버튼 클릭 이벤트 private void btOper_Click(object sender, EventArgs e) { FormPassword.SetLevel(EN_LEVEL.Operator); pnPassWord.Visible = false; }
private void timer1_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; pnIdx.Refresh(); //pnPst.Refresh(); tbTargetCnt.Text = OM.DevOptn.iTargetCnt.ToString(); tbCrntCnt.Text = OM.EqpStat.iWorkCnt.ToString(); tbNodeCnt.Text = OM.EqpStat.iNodeCnt.ToString(); tbCttrCnt.Text = OM.EqpStat.iCttrCnt.ToString(); tbDegree.Text = OM.NodePos[SEQ.IDX.iNodeCnt].dDegree.ToString(); int iLevel = (int)FormPassword.GetLevel(); switch (iLevel) { case (int)EN_LEVEL.Operator: btOperator.Text = "OPERATOR"; break; case (int)EN_LEVEL.Engineer: btOperator.Text = "ENGINEER"; break; case (int)EN_LEVEL.Master: btOperator.Text = " ADMIN "; break; default: btOperator.Text = " ERROR "; break; } if (bPreLotOpen != LOT.GetLotOpen()) { btLotEnd.Enabled = LOT.GetLotOpen(); btStart.Enabled = LOT.GetLotOpen(); btLotOpen.Enabled = !LOT.GetLotOpen(); bPreLotOpen = LOT.GetLotOpen(); } SPC.DAY.DispDayInfo(lvDayInfo); SPC.LOT.DispLotInfo(lvLotInfo); string Str; int iPreErrCnt = 0; int iCrntErrCnt = 0; for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { iCrntErrCnt++; } } if (iPreErrCnt != iCrntErrCnt) { lbErr.Items.Clear(); int iErrNo = SML.ER.GetLastErr(); for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { Str = string.Format("[ERR{0:000}]", i); Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrMsg(i); lbErr.Items.Add(Str); } } } if (SEQ._iSeqStat != EN_SEQ_STAT.Error) { lbErr.Items.Clear(); } iPreErrCnt = iCrntErrCnt; string sCycleTimeSec; int iCycleTimeMs; //Door Sensor. 나중에 찾아보자 //bool isAllCloseDoor = SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorFt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorLt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRr) ; //if (FormPassword.GetLevel() != EN_LEVEL.lvOperator && isAllCloseDoor && CMachine._bRun) //{ // //FM_SetLevel(lvOperator); //} if (!SM.MT_GetHomeDoneAll()) { btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red; } else { btAllHome.ForeColor = Color.Black; } //DM.ARAY[(int)ri.LENS ].SetMaxColRow(OM.DevInfo.iLensColCnt , OM.DevInfo.iLensRowCnt); //DM.ARAY[(int)ri.REAR ].SetMaxColRow(OM.DevInfo.iRearColCnt , OM.DevInfo.iRearRowCnt); //DM.ARAY[(int)ri.FRNT ].SetMaxColRow(OM.DevInfo.iFrntColCnt , OM.DevInfo.iFrntRowCnt); //DM.ARAY[(int)ri.PICK ].SetMaxColRow(2, 1); pnIDXDetect1.BackColor = !SM.IO_GetX(xi.IDX_Detect1) ? Color.Lime : Color.Red; pnIDXDetect2.BackColor = !SM.IO_GetX(xi.IDX_Detect2) ? Color.Lime : Color.Red; pnIDXDetect3.BackColor = !SM.IO_GetX(xi.IDX_Detect3) ? Color.Lime : Color.Red; pnIDXDetect4.BackColor = !SM.IO_GetX(xi.IDX_Detect4) ? Color.Lime : Color.Red; pnIDXDetect5.BackColor = !SM.IO_GetX(xi.IDX_Detect5) ? Color.Lime : Color.Red; pnULDDetect1.BackColor = SM.IO_GetX(xi.ULD_Detect1) ? Color.Lime : Color.Red; pnULDDetect2.BackColor = SM.IO_GetX(xi.ULD_Detect2) ? Color.Lime : Color.Red; pnULDDetect3.BackColor = SM.IO_GetX(xi.ULD_Detect3) ? Color.Lime : Color.Red; pnULDDetect4.BackColor = SM.IO_GetX(xi.ULD_Detect4) ? Color.Lime : Color.Red; pnULDDetect5.BackColor = SM.IO_GetX(xi.ULD_Detect5) ? Color.Lime : Color.Red; //Option View if (OM.CmnOptn.bUsedLine1) { pnOption1.BackColor = Color.Lime; lbOption1.Text = "ON"; } else { pnOption1.BackColor = Color.Red; lbOption1.Text = "OFF"; } if (OM.CmnOptn.bUsedLine2) { pnOption2.BackColor = Color.Lime; lbOption2.Text = "ON"; } else { pnOption2.BackColor = Color.Red; lbOption2.Text = "OFF"; } if (OM.CmnOptn.bUsedLine3) { pnOption3.BackColor = Color.Lime; lbOption3.Text = "ON"; } else { pnOption3.BackColor = Color.Red; lbOption3.Text = "OFF"; } if (OM.CmnOptn.bUsedLine4) { pnOption4.BackColor = Color.Lime; lbOption4.Text = "ON"; } else { pnOption4.BackColor = Color.Red; lbOption4.Text = "OFF"; } if (OM.CmnOptn.bUsedLine5) { pnOption5.BackColor = Color.Lime; lbOption5.Text = "ON"; } else { pnOption5.BackColor = Color.Red; lbOption5.Text = "OFF"; } if (OM.CmnOptn.bIgnrWork) { pnOption6.BackColor = Color.Lime; lbOption6.Text = "ON"; } else { pnOption6.BackColor = Color.Red; lbOption6.Text = "OFF"; } btCyl1.Text = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ? "FWD" : "BWD"; btCyl1.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ? Color.Lime : Color.Black; btCyl2.Text = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ? "FWD" : "BWD"; btCyl2.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ? Color.Lime : Color.Black; btCyl3.Text = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ? "FWD" : "BWD"; btCyl3.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ? Color.Lime : Color.Black; btCyl4.Text = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ? "FWD" : "BWD"; btCyl4.ForeColor = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ? Color.Lime : Color.Black; //btCyl5 .Text = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ? "FWD" : "BWD" ; //btCyl5 .ForeColor = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ? Color.Lime : Color.Black; btCyl6.Text = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ? "FWD" : "BWD"; btCyl6.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ? Color.Lime : Color.Black; btCyl7.Text = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ? "FWD" : "BWD"; btCyl7.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ? Color.Lime : Color.Black; //btCyl7 .Text = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ? "FWD" : "BWD" ; //btCyl7 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ? Color.Lime : Color.Black; //btCyl8 .Text = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ? "FWD" : "BWD" ; //btCyl8 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ? Color.Lime : Color.Black; btCyl8.Text = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ? "FWD" : "BWD"; btCyl8.ForeColor = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ? Color.Lime : Color.Black; btCyl9.Text = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ? "FWD" : "BWD"; btCyl9.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ? Color.Lime : Color.Black; //if (CMachine._iSeqStat == EN_SEQ_STAT.ssWorkEnd || CMachine._iSeqStat == EN_SEQ_STAT.ssStop) //{ // CMachine.Reset(); // if (bRepeat) CMachine._bBtnStart = true; //} tmUpdate.Enabled = true; }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; lbMainThreadTime.Text = string.Format("{0:0.000ms}", SEQ._dMainThreadCycleTime); lbDevice.Text = OM.GetCrntDev().ToString(); lbLotNo.Text = LOT.GetLotNo(); btExit.Enabled = !SEQ._bRun; //Set Sequence State. if (!OM.MstOptn.bDebugMode) { switch (SEQ._iSeqStat) { default: break; case EN_SEQ_STAT.Init: lbStat.Text = "INIT"; lbStat.ForeColor = Color.Blue; break; case EN_SEQ_STAT.Error: lbStat.Text = "ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red; break; case EN_SEQ_STAT.Running: lbStat.Text = "RUNNING"; lbStat.ForeColor = Color.Lime; break; case EN_SEQ_STAT.Stop: lbStat.Text = "STOP"; lbStat.ForeColor = Color.Black; break; case EN_SEQ_STAT.WorkEnd: lbStat.Text = "LOTEND"; lbStat.ForeColor = Color.Gray; break; case EN_SEQ_STAT.RunWarn: lbStat.Text = "Run End"; lbStat.ForeColor = Color.Gray; break; } } else { switch (SEQ._iSeqStat) { default: break; case EN_SEQ_STAT.Init: lbStat.Text = "DEBUG INIT"; lbStat.ForeColor = Color.Blue; break; case EN_SEQ_STAT.Error: lbStat.Text = "DEBUG ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red; break; case EN_SEQ_STAT.Running: lbStat.Text = "DEBUG RUNNING"; lbStat.ForeColor = Color.Lime; break; case EN_SEQ_STAT.Stop: lbStat.Text = "DEBUG STOP"; lbStat.ForeColor = Color.Black; break; case EN_SEQ_STAT.WorkEnd: lbStat.Text = "DEBUG LOTEND"; lbStat.ForeColor = Color.Gray; break; } } //접근 레벨 Operator에서 Option/Util 버튼 비활성화 if (FormPassword.GetLevel() == EN_LEVEL.Operator) { //btSpc.Enabled = false; btUtil.Enabled = false; btOption.Enabled = false; } else { //btSpc.Enabled = true; btUtil.Enabled = true; btOption.Enabled = true; } tmUpdate.Enabled = true; }
public bool CanOpen(LivelloPassword minLevel, DBL.LinguaManager linguaMngr, bool force) { bool ok = false; if (Properties.Settings.Default.UsaPassword || force) { if (this.lastLivello != LivelloPassword.NN && swTempoLogin.ElapsedMilliseconds < Properties.Settings.Default.TempoPassword * 60 * 1000 && minLevel <= this.lastLivello) { ok = minLevel <= this.lastLivello; } else { FormPassword frmPsw = new FormPassword(linguaMngr); if (frmPsw.ShowDialog() == DialogResult.OK) { bool pswTrovata = false; bool livBasso = true; DataType.ConfigurazioneCorrente confObj = DataType.ConfigurazioneCorrente.Deserialize(Path.Combine(Properties.Settings.Default.DatiVisionePath, "ConfigurazioneCorrente.xml")); string psw = frmPsw.GetPassword(); if (psw == confObj.PswCostruttore) { ok = true; lastLivello = LivelloPassword.Costruttore; swTempoLogin.Restart(); pswTrovata = true; livBasso = false; } if (!ok && psw == confObj.PswTecnico) { if (minLevel <= LivelloPassword.Tecnico) { ok = true; lastLivello = LivelloPassword.Tecnico; swTempoLogin.Restart(); livBasso = false; } pswTrovata = true; } if (!ok && psw == confObj.PswOperatore) { if (minLevel <= LivelloPassword.Operatore) { ok = true; lastLivello = LivelloPassword.Operatore; swTempoLogin.Restart(); livBasso = false; } pswTrovata = true; } if (!pswTrovata) { MessageBox.Show(linguaMngr.GetTranslation("MSG_PSW_ERRATA"), linguaMngr.GetTranslation("MSG_ERRORE"), MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (livBasso) { MessageBox.Show(linguaMngr.GetTranslation("MSG_LIVELLO_PSW_BASSO"), linguaMngr.GetTranslation("MSG_ATTENZIONE"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } } else { ok = true; } return(ok); }