/// <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></returns> /// <exception cref="DeviceWorkflowException"> /// Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow /// or /// Unable to press the AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow /// </exception> public override bool ExecuteJob(AutoStoreExecutionOptions executionOptions) { bool success = false; ExecutionOptions = executionOptions; _yOffset = OxpdBrowserEngine.GetBrowserOffset(_controlPanel); _footerPos = GetFooterTop("footerOXPd"); GetButtonIdsTitles(); if (success = PressWorkflowButton() == true) { TurnOnOffOptions(executionOptions, TimeSpan.FromSeconds(20)); if (executionOptions.AutoStoreWorkflow.Contains("Email")) { EmailFormInput(); } else if (executionOptions.AutoStoreWorkflow.Contains("Folder")) { FolderFormInput(); } else { throw new DeviceWorkflowException("Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow); } ProcessWorkflow(); } else { throw new DeviceWorkflowException("Unable to press the AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow); } return(success); }
/// <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></returns> /// <exception cref="DeviceWorkflowException">Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow</exception> public override bool ExecuteJob(AutoStoreExecutionOptions executionOptions) { bool success = false; ExecutionOptions = executionOptions; if (success = PressWorkflowButton() == true) { if (_controlPanel.GetScreenSize().Width > 480) { TurnOnOffOptions(executionOptions, TimeSpan.FromSeconds(20)); } if (executionOptions.AutoStoreWorkflow.Contains("Email")) { EmailFormInput(); } else if (executionOptions.AutoStoreWorkflow.Contains("Folder")) { FolderFormInput(); } else { throw new DeviceWorkflowException("Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow); } ProcessWorkflow(executionOptions); } return(success); }
private void JobBuildOnly(AutoStoreExecutionOptions executionOptions) { UpdateStatus("Utilizing the job build option."); RecordEvent(DeviceWorkflowMarker.JobBuildBegin); _controlPanel.Press("#hpid-button-oxpd-start"); UpdateStatus("Scanning page 1 of " + executionOptions.JobBuildSegments.ToString()); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); // This is sort of a pop up that covers the HPEC and HPCR app _controlPanel.WaitForState("#hpid-button-scan", OmniElementState.Useable); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); for (int pc = 2; pc <= executionOptions.JobBuildSegments; pc++) { string status = "Scanning page " + pc.ToString() + " of " + executionOptions.JobBuildSegments.ToString(); UpdateStatus(status); if (!_controlPanel.WaitForAvailable("#hpid-button-scan", TimeSpan.FromSeconds(20))) { throw new DeviceWorkflowException("The scan button did not become available within 20 seconds."); } RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.PressWait("#hpid-button-scan", "#hpid-button-done", _idleTimeoutOffset); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); } _controlPanel.PressWait("#hpid-button-done", "#hpid-oxpd-scroll-pane", _idleTimeoutOffset); _masthead.WaitForActiveJobsButtonState(false, _idleTimeoutOffset); RecordEvent(DeviceWorkflowMarker.JobBuildEnd); }
private void TurnOnOffOptions(AutoStoreExecutionOptions executionOptions, TimeSpan ts) { _engine.PressElementById(MoreOptionsBtnId); WaitForButtonExist(MoreOptionsBtnId, ts); SetOption(ts, MoreOptionsImagePreview, executionOptions.ImagePreview); bool turnOnOption = (executionOptions.JobBuildSegments > 1) == true ? true : false; SetOption(ts, MoreOptionsJobBuild, turnOnOption); _engine.PressElementById(HideMoreOptionsBtnId); }
private bool ProcessWorkflow(AutoStoreExecutionOptions executionOptions) { bool success = false; if (executionOptions.ImagePreview || executionOptions.JobBuildSegments > 1) { // image preview one scan if (executionOptions.ImagePreview && executionOptions.JobBuildSegments == 1) { ImagePreviewOnly(); } else if (executionOptions.ImagePreview && executionOptions.JobBuildSegments > 1) { ImagePreviewJobBuild(executionOptions.JobBuildSegments, TimeSpan.FromSeconds(30)); } else // Job build only { JobBuildOnly(executionOptions); } } else if (executionOptions.JobBuildSegments == 1) { ScanOnly(); } else { throw new DeviceWorkflowException("Unable to determine AutoStore Workflow."); } RecordEvent(DeviceWorkflowMarker.ProcessingJobBegin); if (success = _masthead.WaitForActiveJobsButtonState(false, _idleTimeoutOffset) == true) { RecordEvent(DeviceWorkflowMarker.ProcessingJobEnd); } return(success); }
/// <summary> /// Method used to determine or run the end results of the job /// </summary> /// <param name="executionOptions">The execution options.</param> public abstract void JobFinished(AutoStoreExecutionOptions executionOptions);
/// <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></returns> public abstract bool ExecuteJob(AutoStoreExecutionOptions executionOptions);
public override void JobFinished(AutoStoreExecutionOptions executionOptions) { }