/// <summary> /// Closes a dialog /// </summary> /// <returns> /// <br>True: if the dialog was successfully closed</br> /// <br>False: if the dialog is still open</br> /// </returns> public bool Run() { var dialogMessage = new GUI.ProfIdtmDpv1RepoElements().DialogMessage; var buttonOk = new GUI.ProfIdtmDpv1RepoElements().DialogButtonOk; var click = new Functions.ApplicationArea.Execution.PressButton(); var watch = new Stopwatch(); // log the dialog message Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), dialogMessage.TextValue); // close the dialog click.Run(buttonOk); // check if pop up is closed watch.Start(); bool visible = buttonOk.Visible; while (!visible) { if (watch.ElapsedMilliseconds <= 30000) { return(false); } visible = buttonOk.Visible; } watch.Stop(); return(true); }
/// <summary> /// Check if the PROFIdtm DPV1 dialogbox is shown /// </summary> /// <returns> /// <br>True: if the dialog is shown in time</br> /// <br>False: if dialog is not shown in time</br> /// </returns> public bool IsDialogShown() { var dialogButton = new GUI.ProfIdtmDpv1RepoElements().DialogButtonOk; Stopwatch watch = new Stopwatch(); watch.Start(); while (dialogButton == null) { if (watch.ElapsedMilliseconds >= 10000) { return(false); } dialogButton = new GUI.ProfIdtmDpv1RepoElements().DialogButtonOk; } watch.Stop(); if (dialogButton.Visible) { return(true); } return(false); }
/// <summary> /// Clicks the Defaults button /// </summary> public bool Run() { var pressButton = new Functions.ApplicationArea.Execution.PressButton(); Button button = new GUI.ProfIdtmDpv1RepoElements().ButtonDefaults; return(pressButton.Run(button)); }
/// <summary> /// Checks if button [OK] is available /// </summary> /// <returns> /// <br>True: if module is ready</br> /// <br>False: if module is not ready</br> /// </returns> public bool Run() { Button button = new GUI.ProfIdtmDpv1RepoElements().ButtonOk; if (button == null) { return(false); } return(true); }
/// <summary> /// Checks if the module configurable (offline) /// by determining if the Baud Rate combo box is enabled /// </summary> /// <param name="suppressLogging"> /// The suppress Logging. /// </param> /// <returns> /// <br>True: if module is configurable (offline)</br> /// <br>False: if module is not configurable (online) or an error occurred</br> /// </returns> public bool Run(bool suppressLogging) { ComboBox cb = new GUI.ProfIdtmDpv1RepoElements().BaudRateComboBox; if (!cb.Enabled) { return(false); } if (!suppressLogging) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Module is configurable"); } return(true); }