Exemple #1
0
        private void print_RadioButton_CheckedChanged(object sender, EventArgs e)
        {
            pageCount_groupBox.Text                 = _textFolderPath;
            path_label.Visible                      = true;
            path_label.Enabled                      = true;
            path_textBox.Visible                    = true;
            path_textBox.Enabled                    = true;
            jobBuildPageCount_label.Visible         = false;
            jobBuildPageCount_numericUpDown.Visible = false;
            jobBuildPageCountCaption_label.Text     = _textFolderPathCaption;

            scanDestination_comboBox.Enabled = false;
            printSource_comboBox.Enabled     = true;

            job_label.Text = RegusKioskJobType.Print.GetDescription();
            sourceDestination_label.Visible        = true;
            sourceDestinationCaption_label.Visible = true;
            sourceDestination_label.Text           = printSource_comboBox.Text;
            sourceDestinationCaption_label.Text    = _textSource;

            options_Button.Enabled = true;

            RegusKioskPrintSource printsource = EnumUtil.GetByDescription <RegusKioskPrintSource>(printSource_comboBox.Text);

            switch (printsource)
            {
            case RegusKioskPrintSource.PrinterOn:
                options_Button.Enabled = false;
                break;

            case RegusKioskPrintSource.USB:
                options_Button.Enabled = true;
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Navigate the location to save scan file(to select print file)
        /// <param name="printSource">Navigate to destination by FilePath</param>
        /// <param name="filePath">Navigate to destination by FilePath</param>
        /// </summary>
        public bool NavigateToDestination(RegusKioskPrintSource printSource, string filePath)
        {
            string current_string = null;
            string filename       = null;
            string path           = filePath;

            path = path.Trim();

            while (path.Contains("/"))
            {
                current_string = path.Substring(0, path.IndexOf('/'));
                path           = path.Substring(path.IndexOf('/') + 1);
                filename       = current_string;
                LinkUI.Controller.Click(new UiSelector().TextContains(filename));
            }

            if (!string.IsNullOrEmpty(path))
            {
                filename = path;
                UpdateStatus($"Final path : {filename}");
                if (RegusKioskPrintSource.PrinterOn.Equals(printSource))
                {
                    WaitingForUploadFile(filename);
                }
                return(LinkUI.Controller.Click(new UiSelector().TextContains(filename)));
            }

            return(false);
        }
Exemple #3
0
        private void PrintSource_comboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            sourceDestination_label.Text = printSource_comboBox.Text;

            RegusKioskPrintSource printsource = EnumUtil.GetByDescription <RegusKioskPrintSource>(printSource_comboBox.Text);

            switch (printsource)
            {
            case RegusKioskPrintSource.PrinterOn:
                options_Button.Enabled = false;
                break;

            case RegusKioskPrintSource.USB:
                options_Button.Enabled = true;
                break;
            }
        }
Exemple #4
0
        /// <summary>
        /// Launch with print
        /// <param name="jobType">JobType</param>
        /// <param name="printSource">Print source</param>
        /// <param name="path">File path</param>
        /// </summary>
        public void LaunchPrint(RegusKioskJobType jobType, RegusKioskPrintSource printSource, string path)
        {
            bool result = false;

            UpdateStatus($"Launch start: {jobType.GetDescription()}");

            result = LinkUI.Controller.Click("//*[@resource-id=\'com.hp.kiosk:id/homeLayout\']/*[2]/*[1]/*[1]/*[2]/*[1]/*[1]");

            if (result)
            {
                NavigatePrintFilePath(printSource, path);
                VerifyLaunch(jobType, new UiSelector().ResourceId($"{KioskPackageName}:id/start_tab"));
            }
            else
            {
                DeviceWorkflowException e = new DeviceWorkflowException($"Launch failed: Selecting print source is failed: {printSource.GetDescription()}");
                e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.AppLaunch.GetDescription());
                throw e;
            }
        }
Exemple #5
0
        /// <summary>
        /// Navigate to select print file
        /// <param name="printSource">Print source</param>
        /// <param name="path">File path</param>
        /// </summary>
        public void NavigatePrintFilePath(RegusKioskPrintSource printSource, string path)
        {
            if (RegusKioskPrintSource.USB.Equals(printSource))
            {
                if (JetAdvantageLinkControlHelper.WaitingObjectAppear(new UiSelector().ResourceId($"{KioskPackageName}:id/usb_btn"), 500, 120))
                {
                    if (!LinkUI.Controller.Click(new UiSelector().ResourceId($"{KioskPackageName}:id/usb_btn")))
                    {
                        DeviceWorkflowException e = new DeviceWorkflowException($"Failed to select USB.");
                        e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.NavigateFilePath.GetDescription());
                        throw e;
                    }
                }
            }

            if (!NavigateToDestination(printSource, path))
            {
                DeviceWorkflowException e = new DeviceWorkflowException($"Failed to Navigate file path.");
                e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.NavigateFilePath.GetDescription());
                throw e;
            }
        }