/// <summary> /// The sign-out operation desired. /// </summary> /// <param name="signOut">The sign out.</param> public void SignOut(DeviceSignOutMethod signOut, IDevice device) { IDevicePreparationManager dpm = DevicePreparationManagerFactory.Create(device); dpm.WorkflowLogger = _workflowLogger; dpm.SignOut(signOut); }
public PluginExecutionResult RunJetAdvantage() { PluginExecutionResult result = new PluginExecutionResult(PluginResult.Passed); try { SetDataLogger(); _jetAdvantageApp = JetAdvantageFactory.Create(_device); _jetAdvantageApp.WorkflowLogger = WorkflowLogger; IDevicePreparationManager dpm = DevicePreparationManagerFactory.Create(_device); dpm.InitializeDevice(true); dpm.WorkflowLogger = WorkflowLogger; _jetAdvantageApp.ActivityStatusChange += _jetAdvantageApp_ActivityStatusChange; LaunchJetAdvantage(); _jetAdvantageApp.RunHPJetAdvantage(_activityData.PrintAllDocuments, _activityData.DeleteAfterPrint); RecordEvent(DeviceWorkflowMarker.DeviceSignOutBegin); _jetAdvantageApp.Logout(); RecordEvent(DeviceWorkflowMarker.DeviceSignOutEnd); if (!_jetAdvantageApp.DocumentPrinted) { string logText = string.Format("No print jobs found to pull; user {0}", _activityData.JetAdvantageLoginId); result = new PluginExecutionResult(PluginResult.Skipped, logText); OnStatusUpdate(logText); } UpdateDataLogger(result); dpm.NavigateHome(); dpm.SignOut(); } catch (Exception ex) { string message = ex.ToString(); if (!string.IsNullOrEmpty(message) && message.Length > 1024) { message = message.Substring(0, 1024); } result = new PluginExecutionResult(PluginResult.Failed, message, "JetAdvantage Error"); UpdateDataLogger(result); throw; } return(result); }
/// <summary> /// Signs the user out of the device. /// </summary> /// <param name="_pullPrintApp"></param> protected void SignOut(IDeviceWorkflowLogSource _pullPrintApp) { DateTime startTime = DateTime.Now; try { IDevicePreparationManager manager = DevicePreparationManagerFactory.Create(Device); manager.WorkflowLogger = _pullPrintApp.WorkflowLogger; manager.NavigateHome(); manager.SignOut(); } catch (Exception ex) { OnStatusUpdate(ex.Message); ExecutionServices.SystemTrace.LogError(ex.ToString()); } OnTimeStatusUpdate("SignOut", startTime, DateTime.Now); }
/// <summary> /// Device side operation for Twain Scan /// </summary> /// <param name="twainDriver"></param> /// <param name="deviceDetails"></param> public static void ExecuteJob(IDevice deviceDetails, TwainDriverActivityData twainDriver) { JediOmniDevice device = (JediOmniDevice)deviceDetails; IDevicePreparationManager preparationManager = DevicePreparationManagerFactory.Create(device); preparationManager.WakeDevice(); //Checking For Home Screen if (!device.ControlPanel.WaitForState("#hpid-homescreen-logo-icon", OmniElementState.VisibleCompletely, TimeSpan.FromSeconds(1))) { preparationManager.NavigateHome(); } device.ControlPanel.ScrollPress("#hpid-scan-homescreen-button"); if (device.ControlPanel.WaitForState("#hpid-remoteScanRequest-homescreen-button", OmniElementState.Exists)) { device.ControlPanel.ScrollToItem("#hpid-remoteScanRequest-homescreen-button"); device.ControlPanel.PressWait("#hpid-remoteScanRequest-homescreen-button", "#hpid-remote-scan-request-landing-page"); if (device.ControlPanel.WaitForState("#hpid-remote-scan-request-job-list-item", OmniElementState.Exists)) { if (device.ControlPanel.WaitForState("#hpid-remote-scan-request-job-list-item", OmniElementState.Useable, ScreenWaitTimeout)) { device.ControlPanel.Press("#hpid-remote-scan-request-job-list-item:first"); } else { device.ControlPanel.Press("#hpid-remote-scan-request-unlock-private-jobs:first"); if (device.ControlPanel.CheckState("#undefined", OmniElementState.Exists)) { device.ControlPanel.PressWait("#hpid-pin-to-unlock-job-textbox", "#hpid-keyboard", ShortScreenWaitTimeout); device.ControlPanel.TypeOnVirtualKeyboard(twainDriver.Pin); //Check for 4.3 inch control panel where the keypad/keyboard hides the 'OK' button after entering the Pin/Password. //Close the numeric keypad after PIN is entered if (device.ControlPanel.CheckState("#hpid-keypad-key-close", OmniElementState.Exists)) { device.ControlPanel.Press("#hpid-keypad-key-close"); } //Close the virtual keyboard after PIN/Password is entered else if (device.ControlPanel.CheckState("#hpid-keyboard-key-done", OmniElementState.Exists)) { device.ControlPanel.Press("#hpid-keyboard-key-done"); } device.ControlPanel.Press("#hpid-button-ok"); //Automatic selection of job was not happening when reservation was enabled and a password is set for Remote Scan Request using Twain driver in the previous device firmware.Now the issue is fixed in device firmware 2458466 and above //Hence commenting the below line of code //device.ControlPanel.Press("#hpid-remote-scan-request-job-list-item:first"); if (device.ControlPanel.CheckState(".hp-popup-modal-overlay", OmniElementState.Exists)) { throw new DeviceWorkflowException("Invalid Pin/Pin Not Entered"); } } } if (device.ControlPanel.WaitForState("#hpid-button-remote-scan-request-start", OmniElementState.Useable, ScreenWaitTimeout)) { device.ControlPanel.Press("#hpid-button-remote-scan-request-start"); if (device.ControlPanel.WaitForState("#hpid-button-ok", OmniElementState.Exists, ShortScreenWaitTimeout)) { device.ControlPanel.Press("#hpid-button-ok"); device.ControlPanel.Press("#hpid-button-remote-scan-request-start"); } } } else { throw new DeviceWorkflowException("No Remote scan jobs found."); } } else { throw new DeviceWorkflowException("Remote Scan Request was not found in the scan folder."); } if (device.ControlPanel.WaitForState("#hpid-message-center-screen", OmniElementState.Exists, ShortScreenWaitTimeout)) { throw new DeviceWorkflowException("There is an error displayed on the device, Please check the device and try again"); } }