public Setup2Form(CFG tClassAdress, MainForm myMF)
        {
            InitializeComponent();
            // Copy structure reference
            tConfig = tClassAdress;
            s2_MF   = myMF;
            // Preset Feeding - Timeout
            tbFeedTimeout.Text = tConfig.tFeeding.iTimeout.ToString();
            // Preset Feeding - Doublefeed threshold
            tbDoublefeedThreshold.Text =
                tConfig.tFeeding.iDoublefeedThreshold.ToString();

            // Preset Scanning - Maximum image width
            tbMaxImageWidth.Text = tConfig.tScanning.iMaxImageWidth.ToString();
            // Preset Scanning - Maximum image height
            tbMaxImageHeight.Text =
                tConfig.tScanning.iMaxImageHeight.ToString();
            // Preset Scanning - Image directory
            tbImageDirectory.Text =
                tConfig.tScanning.sbImageDirectory.ToString();
            // Preset Scanning - Front side image 1 - File name



            cbReadFont.DropDownStyle = ComboBoxStyle.DropDownList;
            switch (tConfig.tReading.eFont)
            {
            case CFG.READ_FONT.NONE:
            {
                cbReadFont.SelectedIndex = 0;
                break;
            }

            case CFG.READ_FONT.E13B_MAGNETIC:
            {
                cbReadFont.SelectedIndex = 1;
                break;
            }

            case CFG.READ_FONT.E13B_MAGNETIC_AND_OPTICAL:
            {
                cbReadFont.SelectedIndex = 2;
                break;
            }

            case CFG.READ_FONT.E13B_OPTICAL:
            {
                cbReadFont.SelectedIndex = 3;
                break;
            }

            case CFG.READ_FONT.OCRB:
            {
                cbReadFont.SelectedIndex = 1;
                break;
            }
            }
        }
Example #2
0
        //public BarcodeReading(ref CFG myTconfig, MFS100DN myMFS100, ref ValidForm myVS, ref statParams mySP)
        public BarcodeReading(ref MainForm MF, MFS100DN myMFS100)
        {
            br_Tconfig = MF.tConfig;
            br_Mfs100  = myMFS100;
            //br_Tbarcode = br_Tconfig.tBarcode;
            //barcodeReaderPosFormats = new List<BarcodeFormat> {br_Tbarcode};
            //br_VS = myVS;
            //br_SP = mySP;

            DirectoryInfo directory = new DirectoryInfo(br_Tconfig.tScanning.sbImageDirectory.ToString());
            //Clean the directory
            //Empty(directory);

            FileSystemWatcher watcher = new FileSystemWatcher();

            watcher.Path         = br_Tconfig.tScanning.sbImageDirectory.ToString();
            watcher.NotifyFilter = NotifyFilters.LastWrite;
            watcher.Filter       = br_Tconfig.tScanning.tFrontSide1.eFormat.ToString();
            switch (watcher.Filter)
            {
            case "JPEG":
            {
                watcher.Filter = "*.jpg";
                break;
            }

            case "None":
            {
                watcher.Filter = "*.tif";
                break;
            }

            case "BMP":
            {
                watcher.Filter = "*.bmp";
                break;
            }

            case "TIFF_G4":
            {
                watcher.Filter = "*.tif";
                break;
            }
            }
            watcher.Changed            += new FileSystemEventHandler(OnChanged);
            watcher.EnableRaisingEvents = true;
            watcher.Created            += new FileSystemEventHandler(OnChanged);

            //string[] filePaths = Directory.GetFiles(@"C:\Users\m.alsadi\Desktop\MFS_outs\", "*.jpg");
        }