public void PauseCycle(System.Timers.Timer countdown) { this.elapsed += 200; if (this.elapsed == 200) { NotPaused.Invoke(new MethodInvoker(delegate { NotPaused.Hide(); })); gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Show(); })); } if (this.elapsed == 400) { gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Hide(); })); gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Show(); })); } if (this.elapsed == 600) { gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Hide(); })); gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Show(); })); } if (this.elapsed == 800) { gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Hide(); })); gettingPaused4.Invoke(new MethodInvoker(delegate { gettingPaused4.Show(); })); } if (this.elapsed == 1000) { PauseStatus.Invoke(new MethodInvoker(delegate { PauseStatus.Text = "Paused"; })); gettingPaused4.Invoke(new MethodInvoker(delegate { gettingPaused4.Hide(); })); gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Hide(); })); gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Hide(); })); gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Hide(); })); countdown.Stop(); this.elapsed = 0; } else { } }
public void PlayCycle(System.Timers.Timer countdown2) { this.elapsed2 += 200; if (this.elapsed2 == 200) { Paused.Invoke(new MethodInvoker(delegate { Paused.Hide(); })); gettingPaused4.Invoke(new MethodInvoker(delegate { gettingPaused4.Show(); })); } if (this.elapsed2 == 400) { gettingPaused4.Invoke(new MethodInvoker(delegate { gettingPaused4.Hide(); })); gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Show(); })); } if (this.elapsed2 == 600) { gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Hide(); })); gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Show(); })); } if (this.elapsed2 == 800) { gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Hide(); })); gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Show(); })); } if (this.elapsed2 == 1000) { gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Hide(); })); PauseStatus.Invoke(new MethodInvoker(delegate { PauseStatus.Text = ""; })); countdown2.Stop(); Paused.Invoke(new MethodInvoker(delegate { Paused.Hide(); })); gettingPaused4.Invoke(new MethodInvoker(delegate { gettingPaused4.Hide(); })); gettingPaused3.Invoke(new MethodInvoker(delegate { gettingPaused3.Hide(); })); gettingPaused2.Invoke(new MethodInvoker(delegate { gettingPaused2.Hide(); })); gettingPaused1.Invoke(new MethodInvoker(delegate { gettingPaused1.Hide(); })); this.elapsed2 = 0; } }
private void SetPausedMode(bool lidClosed, bool isPauseCommand, string pauseCommandCaption) { // Instrument has paused -- disable the timeout timer timerPausingTimeout.Stop(); // enable buttons SetButton2Visible(!isTipStripError); button_2.Enabled = !isTipStripError; SetButton1Visible(true); button_1.Enabled = true; button_1.Text = SeparatorResourceManager.GetSeparatorString(StringId.RunResumeText); button_2.Text = SeparatorResourceManager.GetSeparatorString(StringId.RunHaltText); //myButtonLabels = new string[2] { okButton.Text, cancelButton.Text }; GUI_Controls.MessageIcon icon = GUI_Controls.MessageIcon.MBICON_INFORMATION; if (isPauseCommand) { myPauseStatus = PauseStatus.Manual; myCaption = SeparatorResourceManager.GetSeparatorString(StringId.RunPauseText); myMessage = pauseCommandCaption; System.Diagnostics.Debug.WriteLine("(new) in PauseResumeDlg.cs - SetPausedMode()...setting paused msg type 0 - PAUSE COMMAND\r"); // bdr LogFile.AddMessage(System.Diagnostics.TraceLevel.Verbose, "System paused manually"); } else if (pauseCommandCaption.Equals("Manual tip strip")) { isTipStripError = true; myPauseStatus = PauseStatus.TipStrip; // show general paused msg or custom paused-due-to-lid-up msg icon = GUI_Controls.MessageIcon.MBICON_ERROR; myCaption = LanguageINI.GetString("headerTipStripError"); myMessage = LanguageINI.GetString("msgTipStripError"); System.Diagnostics.Debug.WriteLine("(new) in PauseResumeDlg.cs - SetPausedMode()...setting paused msg type TIP - lid is closed\r"); // bdr pauseCommandCaption = ""; SetButton2Visible(false); button_2.Enabled = false; //myButtonLabels = new string[1] { okButton.Text }; LogFile.AddMessage(TraceLevel.Warning, "PauseResumeDialog: Tip Strip error warning displayed"); } else if (pauseCommandCaption.Equals("Tip strip recovery")) { isTipStripError = false; myPauseStatus = PauseStatus.Recovery; // show general paused msg or custom paused-due-to-lid-up msg myCaption = LanguageINI.GetString("headerTipStripRecovery"); myMessage = LanguageINI.GetString("msgTipStripRecovery"); myMessage = myMessage + '\n' + SeparatorResourceManager.GetSeparatorString(StringId.PausePausedMessage); System.Diagnostics.Debug.WriteLine("(new) in PauseResumeDlg.cs - SetPausedMode()...setting paused msg type TIP2 - lid is closed\r"); // bdr pauseCommandCaption = ""; SetButton2Visible(true); button_2.Enabled = true; LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, "PauseResumeDialog: Tip strip recovery window displayed"); } else if (lidClosed) { myPauseStatus = PauseStatus.Lid; // show general paused msg or custom paused-due-to-lid-up msg myCaption = SeparatorResourceManager.GetSeparatorString(StringId.RunPauseText); myMessage = SeparatorResourceManager.GetSeparatorString(StringId.PausePausedMessage); System.Diagnostics.Debug.WriteLine("(new) in PauseResumeDlg.cs - SetPausedMode()...setting paused msg type 1 - lid is closed\r"); // bdr LogFile.AddMessage(TraceLevel.Warning, "PauseResumeDialog: Lid Sensor pause window displayed"); } else { //this branch is never used... ?? RL myCaption = SeparatorResourceManager.GetSeparatorString(StringId.RunPauseText); myMessage = SeparatorResourceManager.GetSeparatorString(StringId.PauseLidUpMessage); System.Diagnostics.Debug.WriteLine("(new) in PauseResumeDlg.cs - SetPausedMode()...setting paused msg type 2 - lid is open\r"); // bdr LogFile.AddMessage(TraceLevel.Warning, "PauseResumeDialog: unexpected branch"); } SetIcon(icon); SetMessage(myMessage); this.label_WindowTitle.Text = myCaption; this.Size = determineSize(myMessage); ResizeButtons(); this.button_1.Refresh(); this.button_2.Refresh(); Refresh(); }