/// <summary> /// Selects the Optimize text or pitcure for the scanned file /// </summary> /// <param name="optimizeTextOrPicture">Selects the text or pitcure</param> public void SelectOptimizeTextOrPicture(OptimizeTextPic optimizeTextOrPicture) { ScrollToOption("CopyOptimizeTextPictureDialogButton"); if (_controlPanel.GetControls().Contains("CopyOptimizeTextPictureDialogButton")) { _controlPanel.PressWait("CopyOptimizeTextPictureDialogButton", "CopyOptimizeTextPictureDialog"); var controls = _controlPanel.GetControls().ToList(); if (controls.Contains("m_RadioButton")) { switch (optimizeTextOrPicture) { case OptimizeTextPic.Mixed: _controlPanel.Press("Mixed"); break; case OptimizeTextPic.Photo: _controlPanel.Press("Photo"); break; case OptimizeTextPic.Text: _controlPanel.Press("Text"); break; case OptimizeTextPic.Glossy: default: _controlPanel.Press("Glossy"); break; } _controlPanel.Press("m_OKButton"); } } }
/// <summary> /// Gets the Y-offset of the OXPd web browser for the specified <see cref="JediWindjammerControlPanel" />. /// </summary> /// <param name="controlPanel">The control panel.</param> /// <returns>The Y-offset of the OXPd web browser control.</returns> /// <exception cref="DeviceInvalidOperationException">An OXPd browser control could not be found.</exception> public static int GetBrowserOffset(JediWindjammerControlPanel controlPanel) { var browsers = new[] { "mWebBrowser", "WebKitBrowser" }; var controls = controlPanel.GetControls(); foreach (string browser in browsers) { if (controls.Contains(browser, StringComparer.OrdinalIgnoreCase)) { return(controlPanel.GetProperty <int>(browser, "Top")); } } throw new DeviceInvalidOperationException("No known OXPd browser control was found on the control panel."); }
/// <summary> /// Sets the copy count. /// </summary> /// <param name="numCopies">The number copies.</param> public override void SetCopyCount(int numCopies) { ProcessCopyCount(); Thread.Sleep(1000); _controlPanel.Type(SpecialCharacter.Backspace); _controlPanel.Type(numCopies.ToString()); // The name of the OK button differs depending on the screen resolution string okButton = _controlPanel.GetControls().Contains("ok") ? "ok" : "mOkButton"; // moved to press wait to handle the no click event within five (5) seconds _controlPanel.PressWait(okButton, JediWindjammerLaunchHelper.OxpdFormIdentifier, StringMatch.Contains, TimeSpan.FromSeconds(6)); }
/// <summary> /// Monitors an executing job. /// </summary> /// <returns><c>true</c> if the job finishes (regardless of its ending status), <c>false</c> otherwise.</returns> public bool MonitorExecutingJob() { List <string> endingStatuses = new List <string>() { "Success", "Failed", "Partial Success", "Scheduled" }; string performanceMarker = string.Empty; var ctlrs = _controlPanel.GetControls(); int timeCount = 0; DateTime dt = DateTime.Now.AddSeconds(55); try { while (true) { string status = _controlPanel.GetProperty("mStatusTextLine1", "Text"); if (status != _lastStatus || string.IsNullOrEmpty(performanceMarker)) { performanceMarker = SetPerformanceMarker(performanceMarker, status); _lastStatus = status; } if (endingStatuses.Contains(status, StringComparer.OrdinalIgnoreCase)) { SetPerformanceMarkerEnd(performanceMarker); return(true); } else { Thread.Sleep(TimeSpan.FromMilliseconds(250)); } if (dt < DateTime.Now && timeCount < 4) { timeCount++; _controlPanel.PressScreen(5, 5); dt = DateTime.Now.AddSeconds(55); } } } catch (ControlNotFoundException) { // Return false to indicate that another dialog has appeared SetPerformanceMarkerEnd(performanceMarker); return(false); } }
private bool ExistQuickSetButton(string quicksetName) { bool exist = false; IEnumerable <string> controls = _controlPanel.GetControls(); foreach (string ctlr in controls) { if (ctlr.Equals(quicksetName)) { exist = true; break; } } return(exist); }
/// <summary> /// Gets the form controls. /// </summary> /// <returns>string</returns> private string GetFormControls() { string ctlrs = string.Empty; List <string> controls = _controlPanel.GetControls().ToList(); foreach (string control in controls) { if (!string.IsNullOrEmpty(ctlrs)) { ctlrs += ", "; } ctlrs += control; } return(ctlrs); }
/// <summary> /// Sets the collating pages On or Off /// </summary> /// <param name="collate">if set to <c>true</c> enable Collate; otherwise disable it</param> public override void SetCollate(bool collate) { if (_controlPanel.GetControls().Contains("CopyStapleCollateDialogButton")) { _controlPanel.PressWait("CopyStapleCollateDialogButton", "CopyStapleCollateDialog", _waitTimeSpan); if (!collate) { _controlPanel.Press("mCollateCheckBox"); } } else { _controlPanel.PressWait("CopyCollateDialogButton", "CollateDialog", _waitTimeSpan); _controlPanel.Press(collate ? "collated" : "uncollated"); } _controlPanel.PressWait("m_OKButton", "CopyAppMainForm", _waitTimeSpan); }
/// <summary> /// Checks error state of the device by looking at the devices banner. /// </summary> /// <returns></returns> public override bool BannerErrorState() { bool errorState = false; IEnumerable <string> controls = _controlPanel.GetControls(); foreach (string ctlr in controls) { if (ctlr.Equals("mTitleBar")) { string value = _controlPanel.GetProperty("mTitleBar", "Text"); if (value.Contains("Runtime Error")) { errorState = true; break; } } } return(errorState); }
/// <summary> /// Sets the copy count. /// </summary> /// <param name="numCopies">The number copies.</param> public override void SetCopyCount(int numCopies) { LogDebug("Setting Copy count for Windjammer."); if (IsNewVersion()) { LogInfo("SafeComGo new version"); ProcessCopyCount(); } else { LogInfo("SafeCom server 2016 version"); ProcessCopyCount("buttonText"); } Thread.Sleep(1000); _controlPanel.Type(SpecialCharacter.Backspace); _controlPanel.Type(numCopies.ToString()); // The name of the OK button differs depending on the screen resolution string okButton = _controlPanel.GetControls().Contains("ok") ? "ok" : "mOkButton"; // moved to press wait to handle the no click event within five (5) seconds _controlPanel.PressWait(okButton, JediWindjammerLaunchHelper.OxpdFormIdentifier, StringMatch.Contains, TimeSpan.FromSeconds(6)); }
/// <summary> /// Gets the current control ids located on the device panel. /// </summary> public override void GetCurrentControlIds() { ProcessControlIds(_controlPanel.GetControls()); }