/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; var jobCompleted = _executionManager.ExecuteScanJob(executionOptions, "#hpid-button-copy-start"); return(jobCompleted); }
/// <summary> /// Finishes the setup portion of the job. /// </summary> /// <param name="device">The device.</param> protected override PluginExecutionResult FinishJob(IDevice device) { PluginExecutionResult result = new PluginExecutionResult(PluginResult.Failed, "Error occurred After Login and Job Configuration.", "Device automation error."); UpdateStatus(string.Format("Pressing HPCR workflow button {0}.", _activityData.HpcrScanButton)); try { ScanExecutionOptions options = new ScanExecutionOptions() { JobBuildSegments = _activityData.PageCount }; if (_hpcrScanApplication.ExecuteJob(options)) { result = new PluginExecutionResult(PluginResult.Passed); } ScanLog.JobEndStatus = _hpcrScanApplication.HpcrFinalStatus; _hpcrScanApplication.JobFinished(); } catch (System.ServiceModel.FaultException e) { ExecutionServices.SystemTrace.LogError(e); result = new PluginExecutionResult(PluginResult.Error, e); } finally { // We got far enough to start the scan job, so submit the log SetJobEndStatus(result); ExecutionServices.DataLogger.Submit(ScanLog); } return(result); }
private bool ProcessWorkflow() { bool success = false; ScanExecutionOptions seo = new ScanExecutionOptions(); string appWaitForm = "OxpUIAppMainForm800X600"; // "EmailForm"; if (ExecutionOptions.ImagePreview) { seo.ImagePreview = ImagePreviewOption.GeneratePreview; appWaitForm = "ImagePreviewForm"; } seo.JobBuildSegments = ExecutionOptions.JobBuildSegments; JediWindjammerJobExecutionManager jwMgr = new JediWindjammerJobExecutionManager(_device); jwMgr.WorkflowLogger = WorkflowLogger; success = jwMgr.ExecuteScanJob(seo, appWaitForm); //OxpUIAppMainForm800X600" string curForm = _controlPanel.CurrentForm(); if (curForm.Equals("ImagePreviewForm")) { success = ProcessScanJob(); } return(success); }
/// <summary> /// Finish up the copy job. /// </summary> /// <param name="device">The device.</param> protected override PluginExecutionResult FinishJob(IDevice device) { PluginExecutionResult result = new PluginExecutionResult(PluginResult.Failed, "Error occurred After Login and Job Configuration.", "Device automation error."); try { ScanExecutionOptions options = new ScanExecutionOptions(); if (UseJobBuild) { options.JobBuildSegments = _data.ScanOptions.PageCount; } _jobStorageScanApp.Pacekeeper = new Pacekeeper(_data.AutomationPause); if (_jobStorageScanApp.ExecuteScanJob(options)) { result = new PluginExecutionResult(PluginResult.Passed); } } finally { // We got far enough to start the scan job, so submit the log ExecutionServices.DataLogger.Submit(ScanLog); } return(result); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool completedJob = false; if (_controlPanel.CurrentForm() == JediWindjammerLaunchHelper.OxpdBaseForm) { _executionManager.WorkflowLogger = WorkflowLogger; completedJob = _executionManager.ExecuteScanJob(executionOptions, JediWindjammerLaunchHelper.OxpdBaseForm); if (_controlPanel.CurrentForm() == "OxpDialogForm") { // Clear the OXP confirmation dialog _controlPanel.PressToNavigate("m_OKButton", "OxpBaseForm", ignorePopups: true); completedJob = true; } } else { _enhancedWorkflowApp.WorkflowLogger = WorkflowLogger; // job build process if (executionOptions.JobBuildSegments > 1) { completedJob = ScanDocuments(executionOptions); } else // scanning one document { completedJob = _enhancedWorkflowApp.ExecuteJob(_controlPanel); } } return(completedJob); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; var jobCompleted = _executionManager.ExecuteScanJob(executionOptions, "Scan_NetworkFolder_HomeGlass"); return(jobCompleted); }
protected override PluginExecutionResult FinishJob(IDevice device) { PluginExecutionResult result = new PluginExecutionResult(PluginResult.Failed, "Error occurred After Login and Job Configuration.", "Device automation error."); // Start the job try { ScanExecutionOptions options = new ScanExecutionOptions(); if (this.UseJobBuild) { options.JobBuildSegments = _data.PageCount; } if (_workflowApp.ExecuteJob(options)) { result = new PluginExecutionResult(PluginResult.Passed); } } finally { // We got far enough to start the scan job, so submit the log SetJobEndStatus(result); ExecutionServices.DataLogger.Submit(ScanLog); } return(result); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool completedJob = false; string statusMsg = string.Empty; _enhancedWorkflowApp.WorkflowLogger = this.WorkflowLogger; if (executionOptions.JobBuildSegments > 1) { completedJob = ScanDocuments(executionOptions); } else { _enhancedWorkflowApp.ExecuteJob(); _masthead.WaitForActiveJobsButtonState(true, TimeSpan.FromSeconds(3)); statusMsg = _engine.ExecuteFunction("getStatusMessage").Trim('"'); RecordEvent(DeviceWorkflowMarker.ProcessingJobBegin); if (string.IsNullOrEmpty(statusMsg)) // old way of finding the status { completedJob = ProcessNoStatusBanner(executionOptions); } else { completedJob = ProcessStatusBanner(statusMsg); } } return(completedJob); }
private void ExecuteJobBuildScan(ScanExecutionOptions executionOptions, string startButton) { _optionsManager.SetPromptForAdditionalPages(); CloseOptionsPanel(startButton); // Start first page RecordEvent(DeviceWorkflowMarker.JobBuildBegin); _controlPanel.Press(startButton); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); HandlePopups(TimeSpan.FromSeconds(5)); for (int i = 2; i <= executionOptions.JobBuildSegments; i++) { // Wait for the previous page to finish scanning, and press the scan button when prompted Wait.ForTrue(() => _popupManager.HandleScanMorePrompt(true), _idleTimeoutOffset, TimeSpan.FromMilliseconds(250)); // Previous page is done scanning, and the current page has started scanning RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); } // Wait for the last page to finish scanning and press Done Wait.ForTrue(() => _popupManager.HandleScanMorePrompt(false), _idleTimeoutOffset, TimeSpan.FromMilliseconds(250)); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.JobBuildEnd); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; var jobCompleted = _executionManager.ExecuteScanJob("Scan Settings"); return(jobCompleted); }
protected override PluginExecutionResult FinishJob(IDevice device) { var result = new PluginExecutionResult(PluginResult.Failed, "Error occurred After Login and Job Configuration.", "Device automation error."); try { ScanExecutionOptions options = new ScanExecutionOptions(); if (UseJobBuild) { options.JobBuildSegments = _data.ScanOptions.PageCount; } options.ImagePreview = (ImagePreviewOption)_data.ImagePreviewOptions; // Load the network folder application _folderApp = NetworkFolderAppFactory.Create(device); _folderApp.WorkflowLogger = WorkflowLogger; _folderApp.Pacekeeper = new Pacekeeper(_data.AutomationPause); if (_folderApp.ExecuteJob(options)) { result = new PluginExecutionResult(PluginResult.Passed); } else { throw new DeviceWorkflowException(result.Message); } } finally { SetJobEndStatus(result); // We got far enough to start the scan job, so submit the log ExecutionServices.DataLogger.Submit(ScanLog); } return(result); }
/// <summary> /// Scans the documents. /// </summary> /// <param name="executionOptions">The execution options.</param> private bool ScanDocuments(ScanExecutionOptions executionOptions) { bool completedJob = false; RecordEvent(DeviceWorkflowMarker.JobBuildBegin); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _enhancedWorkflowApp.ExecuteJob(); for (int pc = 2; pc <= executionOptions.JobBuildSegments; pc++) { //Wait for the job build form _controlPanel.WaitForForm("JobBuildPrompt", false); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); PressOkButton(1); } //Wait for the job build form _controlPanel.WaitForForm("JobBuildPrompt", false); _controlPanel.Press("mFinishButton"); string script = "document.getElementById('statusPopDown').getElementsByTagName('label')[0].innerHTML"; string status = _controlPanel.ExecuteJavaScript(script); if (status.Contains("Scanning")) { while (status.Contains("Scanning")) { Thread.Sleep(100); status = _controlPanel.ExecuteJavaScript(script); } } RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.JobBuildEnd); // Check for sending... if (status.Contains("Sending")) { RecordEvent(DeviceWorkflowMarker.SendingJobBegin); while (status.Contains("Sending")) { Thread.Sleep(100); status = _controlPanel.ExecuteJavaScript(script); } RecordEvent(DeviceWorkflowMarker.SendingJobEnd); } if (status.ToLower().Contains("success")) { completedJob = true; } return(completedJob); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool jobCompleted = false; _executionManager.WorkflowLogger = WorkflowLogger; jobCompleted = _executionManager.ExecuteScanJob(executionOptions); return(jobCompleted); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool completedJob = false; _executionManager.WorkflowLogger = WorkflowLogger; completedJob = _executionManager.ExecuteScanJob("Scan Settings"); return(completedJob); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool completedExecution = false; _executionManager.WorkflowLogger = WorkflowLogger; completedExecution = _executionManager.ExecuteScanJob(executionOptions, "#hpid-button-folder-start"); return(completedExecution); }
private bool SendFaxFinishJob(IDevice device) { // Start the job ScanExecutionOptions options = new ScanExecutionOptions(); if (this.UseJobBuild) { options.JobBuildSegments = _data.ScanOptions.PageCount; } return(_faxApp.ExecuteJob(options)); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; bool complete = _executionManager.ExecuteScanJob(executionOptions, "#hpid-button-sendfax-start"); if (complete && _popupManager.HandleRetainSettingsPopup(false)) { _controlPanel.WaitForState("#hpid-sendfax-landing-page", OmniElementState.Useable); } return(complete); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; bool complete = _executionManager.ExecuteScanJob(executionOptions, "FolderAppMainForm"); if (complete && _controlPanel.CurrentForm() == "BaseJobStartPopup") { _controlPanel.PressToNavigate("m_OKButton", "FolderAppMainForm", ignorePopups: true); } return(complete); }
/// <summary> /// Starts the Scan job and runs it to completion" />. /// </summary> /// <param name="executionOptions">The execution options</param> public bool ExecuteScanJob(ScanExecutionOptions executionOptions) { _executionManager.WorkflowLogger = WorkflowLogger; bool done = _executionManager.ExecuteScanJob(executionOptions, "#hpid-button-send-job-storage-start"); if (_device.ControlPanel.CheckState("#hpid-retain-settings-clear-button", OmniElementState.Exists)) { _device.ControlPanel.Press("#hpid-retain-settings-clear-button"); } return(done); }
/// <summary> /// Executes the currently configured scan job. /// </summary> /// <param name="executionOptions">The execution options.</param> /// <returns><c>true</c> if the job finishes (regardless of its ending status), <c>false</c> otherwise.</returns> public bool ExecuteScanJob(ScanExecutionOptions executionOptions) { bool completedJob = false; if (executionOptions == null) { throw new ArgumentNullException(nameof(executionOptions)); } if (executionOptions.JobBuildSegments > 1) { RecordEvent(DeviceWorkflowMarker.JobBuildBegin); } RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.PressKey(OzHardKey.Start); if (executionOptions.JobBuildSegments > 1) { for (int i = 1; i <= executionOptions.JobBuildSegments; i++) { _controlPanel.WaitForScreen(_jobBuildScanningScreen, TimeSpan.FromSeconds(10)); _controlPanel.WaitForScreen(_jobBuildPrompt, TimeSpan.FromSeconds(60)); Wait.ForNotNull(() => _controlPanel.GetWidgets().Find("Scan"), TimeSpan.FromSeconds(5)); // If this is the last time, press "Finish" instead of "Scan" if (i == executionOptions.JobBuildSegments) { RecordEvent(DeviceWorkflowMarker.ScanJobEnd); _controlPanel.Press("Finish"); } else { RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.Press("Scan"); } } RecordEvent(DeviceWorkflowMarker.JobBuildEnd); } // Wait for the prompt asking whether to stay logged in - this means the job is done scanning. if (_controlPanel.WaitForScreen(_jobProcessingPopup, TimeSpan.FromSeconds(30))) { RecordEvent(DeviceWorkflowMarker.ProcessingJobBegin); Widget yesWidget = _controlPanel.GetWidgets().First(n => n.Text == "Yes" || n.Text == "OK"); _controlPanel.Press(yesWidget); } RecordEvent(DeviceWorkflowMarker.ProcessingJobEnd); completedJob = true; return(completedJob); }
/// <summary> /// Executes the job. /// </summary> /// <param name="executionOptions">The execution options.</param> /// <exception cref="System.Exception">Unable to complete scan on device</exception> public override bool ExecuteJob(ScanExecutionOptions executionOptions) { if (ProcessForHpcr(executionOptions.JobBuildSegments)) { HpcrFinalStatus = "Success"; } else { HpcrFinalStatus = "Failed"; throw new DeviceWorkflowException("Unable to complete scan on device"); } return(true); }
private void ExecuteImagePreviewScan(ScanExecutionOptions executionOptions, string startButton) { if (_controlPanel.GetScreenSize().Width > 480) { _controlPanel.WaitForAvailable(".hp-preview-touch-to-start-label"); } else { _controlPanel.WaitForAvailable("#hpid-preview-button"); } if (executionOptions.JobBuildSegments > 1) { RecordEvent(DeviceWorkflowMarker.JobBuildBegin); } for (int i = 1; i <= executionOptions.JobBuildSegments; i++) { // Different button for 1st page than for the rest if (i == 1) { _controlPanel.Press((_controlPanel.CheckState("#hpid-preview-button", OmniElementState.Exists)) ? "#hpid-preview-button" : ".hp-preview-touch-to-start-label"); } else { _controlPanel.WaitForAvailable("#hpid-preview-button-add-pages"); _controlPanel.PressWait("#hpid-preview-button-add-pages", "#hpid-original-size-label"); _popupManager.HandleScanMorePrompt(true); } HandlePopups(TimeSpan.FromSeconds(5)); // Record timestamps RecordEvent(DeviceWorkflowMarker.ImagePreviewBegin); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); WaitForScanToFinish(); // Record timestamps RecordEvent(DeviceWorkflowMarker.ScanJobEnd); RecordEvent(DeviceWorkflowMarker.ImagePreviewEnd); } if (executionOptions.JobBuildSegments > 1) { RecordEvent(DeviceWorkflowMarker.JobBuildEnd); } // Setup is finished - start the scan _controlPanel.WaitForAvailable(startButton); _controlPanel.Press(startButton); }
private void ValidateImagePreviewAvailability(ScanExecutionOptions executionOptions, string startButton) { bool previewDisabled = _controlPanel.CheckState(".hp-preview-disabled", OmniElementState.VisiblePartially); bool previewRequired = _controlPanel.GetValue(startButton, "innerText", OmniPropertyType.Property) == "Preview"; if (previewDisabled && executionOptions.ImagePreview == ImagePreviewOption.GeneratePreview) { throw new DeviceWorkflowException("Configuration requires image preview be used, but the device is not configured to allow image preview."); } else if (previewRequired && executionOptions.ImagePreview == ImagePreviewOption.RestrictPreview) { throw new DeviceWorkflowException("Configuration requires image preview not be used, but the device is configured to require image preview."); } }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public bool ExecuteScanJob(ScanExecutionOptions executionOptions) { bool success = false; _executionManager.WorkflowLogger = WorkflowLogger; success = _executionManager.ExecuteScanJob(executionOptions, "SaveToUsbMainForm"); if (success && _controlPanel.CurrentForm() == "BaseJobStartPopup") { _controlPanel.PressToNavigate("m_OKButton", "SaveToUsbMainForm", true); } return(success); }
/// <summary> /// Executes HPCR Scan Job /// </summary> /// <param name="executionOptions"></param> /// <returns></returns> public override bool ExecuteJob(ScanExecutionOptions executionOptions) { bool done = false; int pagesScanned = 0; try { NavigateWorkflowPath(); // wait for start scan screen WaitForControl("Ready for Scanning", TimeSpan.FromSeconds(6)); int pagesToScan = executionOptions?.JobBuildSegments ?? 1; if (pagesToScan > 1) { RecordEvent(DeviceWorkflowMarker.JobBuildBegin); } while (pagesScanned < pagesToScan) { UpdateStatus("Scanning page {0} of {1}...", pagesScanned + 1, pagesToScan); if (pagesScanned > 0) { _controlPanel.WaitForWidgetByValue("Scan More"); _controlPanel.PressByValue("Scan More"); WaitForControl("Ready for Scanning", DefaultScreenWait); } RecordEvent(DeviceWorkflowMarker.ScanJobBegin); UpdateStatus("Pressing start button"); _controlPanel.WaitForWidgetByValue("Start", TimeSpan.FromSeconds(10)); _controlPanel.PressByValue("Start"); UpdateStatus("Scan activity started"); WaitForControl("Scan Completed", DefaultScreenWait); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); pagesScanned++; } done = true; } catch (Exception) { HpcrFinalStatus = "Failed"; throw; } HpcrFinalStatus = "Success"; UpdateStatus("Scanned {0} pages", pagesScanned); return(done); }
/// <summary> /// Executes Scan Job /// </summary> /// <param name="executionOptions"></param> /// <returns></returns> public override bool ExecuteJob(ScanExecutionOptions executionOptions) { VerifyReadyForScanning(true); bool done = false; int pagesScanned = 0; int pagesToScan = (executionOptions == null ? 1 : executionOptions.JobBuildSegments); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); while (pagesScanned < pagesToScan) { UpdateStatus("Scanning page {0} of {1}...", pagesScanned + 1, pagesToScan); if (pagesScanned > 0) { // wait for scan completed WaitForWidget("Scan Completed", StringMatch.Contains, TimeSpan.FromSeconds(6)); // press button Scan More _controlPanel.PressScreen(new Coordinate(560, 65)); VerifyReadyForScanning(true); } _controlPanel.PressKey(OzHardKey.Start); WaitForWidget("Scan Completed", StringMatch.Contains, TimeSpan.FromSeconds(30)); pagesScanned++; } done = true; HpcrFinalStatus = "Success"; RecordEvent(DeviceWorkflowMarker.ScanJobEnd); UpdateStatus("Scanned {0} pages", pagesScanned); // Press button Finished _controlPanel.PressScreen(new Coordinate(560, 175)); if (!_controlPanel.WaitForScreen(_homeScreen, TimeSpan.FromSeconds(30))) { HpcrFinalStatus = "Failed"; throw new DeviceInvalidOperationException("Unable to return to home screen"); } // sign out RecordEvent(DeviceWorkflowMarker.DeviceSignOutBegin); _controlPanel.PressScreen(new Coordinate(565, 220)); RecordEvent(DeviceWorkflowMarker.DeviceSignOutEnd); return(done); }
/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> public bool ExecuteJob(ScanExecutionOptions executionOptions) { bool completedJob = false; if (_executionManager.ButtonExist(_executionManager.FaxStartButton)) { _executionManager.PressApplicationButton(_executionManager.FaxStartButton); _executionManager.PressSolutionButton("fax from flatbed scanner?", _executionManager.YesButton); var data = _controlPanel.GetDisplayedStrings(); if (data.Any(display => display.Contains("Load page"))) { _executionManager.PressApplicationButton(_executionManager.OkayButton); _executionManager.PressSolutionButton("Scan another page?", _executionManager.NoButton); } completedJob = _executionManager.DoneProcessingJob("Dialing"); } return(completedJob); }
private bool ProcessNoStatusBanner(ScanExecutionOptions executionOptions) { if (_popupManager.WaitForPopup("Contacting Quota server", TimeSpan.FromSeconds(2))) { _popupManager.HandleTemporaryPopup("Contacting Quota server", TimeSpan.FromSeconds(30)); } _notificationPanel.WaitForNotDisplaying("Initiating job"); _notificationPanel.WaitForNotDisplaying("Pending"); RecordEvent(DeviceWorkflowMarker.ProcessingJobEnd); if (executionOptions.JobBuildSegments == 0) { RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _notificationPanel.WaitForNotDisplaying(_idleTimeoutOffset, "Scanning"); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); } return(MarkSendingJob(statusMsg: string.Empty)); }
/// <summary> /// Executes the currently configured scan job. /// </summary> /// <param name="executionOptions">The execution options.</param> /// <param name="startButton">The name of the start button.</param> /// <returns><c>true</c> if the job finishes (regardless of its ending status), <c>false</c> otherwise.</returns> public bool ExecuteScanJob(ScanExecutionOptions executionOptions, string startButton) { if (executionOptions == null) { throw new ArgumentNullException(nameof(executionOptions)); } // Close the options panel if it is visible (applicable to 4.3" control panels) CloseOptionsPanel(startButton); // Close the keyboard if it is visible if (_controlPanel.CheckState("#hpid-keyboard-key-done", OmniElementState.Useable)) { _controlPanel.PressWait("#hpid-keyboard-key-done", startButton); } // Check image preview availability and make sure it is compatible with the execution options ValidateImagePreviewAvailability(executionOptions, startButton); // Determine parameters and start job if (UseImagePreview(executionOptions)) { ExecuteImagePreviewScan(executionOptions, startButton); } else if (executionOptions.JobBuildSegments > 1) { ExecuteJobBuildScan(executionOptions, startButton); } else { // Simple single page scan - no setup, just need to press the button _controlPanel.WaitForAvailable(startButton); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.Press(startButton); WaitForScanToFinish(); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); } // Wait for the job to finish and report success return(WaitForJobFinish(executionOptions.ValidateJobExecution)); }
private void JobBuildPages(ScanExecutionOptions executionOptions) { _enhancedWorkflowApp.ExecuteJob(); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.WaitForAvailable("#hpid-button-scan"); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); for (int iTimes = 1; iTimes < executionOptions.JobBuildSegments; iTimes++) { RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.WaitForAvailable("#hpid-button-scan"); _controlPanel.ScrollPressWait("#hpid-button-scan", "#hpid-button-done", _idleTimeoutOffset); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); Thread.Sleep(250); } // presses the send button _controlPanel.Press("#hpid-button-done"); }