Ejemplo n.º 1
0
        /// <summary>
        /// Finishes the scan job.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <returns>
        /// The result of the scan.
        /// </returns>
        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 AutoStore workflow button {0}.", _activityData.AutoStoreScanButton));
            try
            {
                AutoStoreExecutionOptions options = new AutoStoreExecutionOptions()
                {
                    JobBuildSegments = _activityData.ScanOptions.PageCount,
                    ImagePreview     = _activityData.ImagePreview
                };
                options.SetAutoStoreWorkflow(_activityData.AutoStoreScanButton, _activityData.UseOcr);

                if (_autoStoreApplication.ExecuteJob(options))
                {
                    result = new PluginExecutionResult(PluginResult.Passed);
                    ScanLog.JobEndStatus = "Success";
                }

                // Method used to clean up AutoStore settings after a run. If  options have been turned on they
                // must be turned off. Options are NOT auto reset after logout. So any option that is set by the
                // plugin must be reset back to default at end of run.

                _autoStoreApplication.JobFinished(options);
            }
            finally
            {
                _collectMemoryManager.CollectDeviceMemoryProfile(_activityData.DeviceMemoryProfilerConfig, "AutoStore");
                // We got far enough to start the scan job, so submit the log
                ExecutionServices.DataLogger.Submit(ScanLog);
            }
            return(result);
        }
Ejemplo n.º 2
0
        protected override PluginExecutionResult ExecuteScan(IDevice device, IDeviceInfo deviceInfo)
        {
            //var result = new PluginExecutionResult(PluginResult.Passed);
            var result = new PluginExecutionResult(PluginResult.Failed, "Automation Failure", "Device workflow error.");

            try
            {
                _collectMemoryManager = new CollectMemoryManager(device, deviceInfo);
                result = base.ExecuteScan(device, deviceInfo);
            }
            finally
            {
                _collectMemoryManager.CollectDeviceMemoryProfile(_activityData.DeviceMemoryProfilerConfig, "ScanToHpcr");
            }
            return(result);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Collects the memory data.
 /// </summary>
 /// <param name="memoryProfilerConfig">The memory profiler configuration.</param>
 /// <param name="snapshotLabel">The snapshot label.</param>
 public void CollectMemoryData(DeviceMemoryProfilerConfig memoryProfilerConfig, string snapshotLabel)
 {
     _collectMemoryManager.CollectDeviceMemoryProfile(memoryProfilerConfig, snapshotLabel);
 }