Пример #1
0
        public EUShip(Intermec.DataCollection.BarcodeReader _bcr, string _TN)
        {
            InitializeComponent();

            set = new Settings("DataBrCode.xml");


            TN = _TN;

            ///TODO На тестирование
            ///
            bcr = _bcr;



            labelCaption.Text = TN;
            try
            {
                InitScaner();
            }

            catch (Exception)
            {
            }
            //Выводим инфушку
            try
            {
                string StatusBD = StatusBar.getSatus();

                labelBD.BeginInvoke(new Action(() =>
                {
                    labelBD.Text      = StatusBD;
                    labelBD.ForeColor = StatusBar.GetColorLabel();
                }));
            }

            catch (Exception) { }
            this.KeyPreview = true;
            //CreateTable();

            //

            CreateColumn("ФОК", "ФОК", 160, 0);
            // CreateColumn("Марка", "Марка", 120, 1);
            CreateColumn("Размер", "Размер", 140, 1);
            CreateColumn("МХ", "МХ", 400, 2);
            // CreateColumn("Select", "Select", 40, 3);
            try
            {
                GetDataForDoc(TN);
            }

            catch (Exception exp)
            {
                CLog.WriteException("EUShip.cs", "Init", exp.Message);
            }

            SetColorBackGround(StatusScan.Ok);
            listEU = new List <WebReference.Relmuch>();
        }
Пример #2
0
        /// <summary>
        /// Close the scanner device
        /// </summary>
        public void Close()
        {
            if (timeout != null)
            {
                timeout.Dispose();
            }

            if (scannerStatus == ScannerStatus.Closed)
            {
                return;
            }

            if (reader != null)
            {
                reader.ScannerOn     = false;
                reader.ScannerEnable = false;
                reader.BarcodeRead  -= scanEvent;
                reader.CancelRead(true);
                reader.Dispose();
                reader = null;
            }

            scannedData   = null;
            scannerStatus = ScannerStatus.Closed;
        }
Пример #3
0
        /// <summary>
        /// Open the scanner device
        /// </summary>
        public void Open()
        {
            if (scannerStatus == ScannerStatus.Opened)
            {
                return;
            }

            try
            {
                if (reader == null)
                {
                    reader = new IntermecBarcodeReader {
                        ScannerOn = false, ScannerEnable = false
                    }
                }
                ;

                reader.BarcodeRead  += scanEvent;
                reader.ScannerEnable = true;
                reader.ThreadedRead(true);

                scannedData   = new string[1];
                scannerStatus = ScannerStatus.Opened;
            }
            catch
            {
                Close();
                throw;
            }
        }
Пример #4
0
        public void InitScaner()
        {
            try
            {
                if (bcr == null)
                {
                    bcr = new BarcodeReader();
                    //set BarcodeRead event
                }

                bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeRead);
                //sends the BarcodeRead event after each successful read
                bcr.ThreadedRead(true);

                bcr.symbology.Code128.Enable = true;
                //set Interleaved 2 of 5
                bcr.symbology.Interleaved2Of5.Enable = false;
                //set PDF417
                bcr.symbology.Pdf417.Enable = false;
            }

            catch (Exception exp)
            {
                //MessageBox.Show(exp.Message);
                CLog.WriteException("StartMenu.cs", "InitScaner", exp.Message);
            }
        }
Пример #5
0
        public QueueTaskEU(Intermec.DataCollection.BarcodeReader _bcr, string _RZDN)
        {
            InitializeComponent();

            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            //  ScanOperation = _ScanOperation;
            listEU = new List <string>();

            bcr = _bcr;

            this.RZDN = _RZDN;
            InitTable();
            InitScaner();


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
            //  labelMX.Text += " " + this.RZDN;

            ScanWeigth      = SqlLiteQuery.GetWEIGHTByRZDN(_RZDN);
            details         = SqlLiteQuery.GetDetalisbyRZDN(_RZDN);
            MarkaRZDN       = SqlLiteQuery.GetMarkabyRZDN(_RZDN);
            labelDetal.Text = details;
            MarkaRZDNList   = SqlLiteQuery.GetMarkabyRZDNList(_RZDN);
        }
Пример #6
0
        public Form1()
        {
            InitializeComponent();

            readSettings();

            readPersonData();
            readProductData();
            readBarcodes();

            initProductBox();

            succesTone = this.CreatePolyTone2(1);
            errorTone  = this.CreatePolyTone1(1);

            updates           = 0;
            MAX_UPDATES       = 5;
            personInListArray = new Person[0];

            try
            {
                //create a instance of BarcodeReader class
                bcr = new BarcodeReader();
                //set BarcodeRead event
                bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeRead);
                //sends the BarcodeRead event after each successful read
                bcr.ThreadedRead(true);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Пример #7
0
        public Form1()
        {
            InitializeComponent();

            readSettings();

            readPersonData();
            readProductData();
            readCategoryData();
            readBarcodes();

            initCategoryBox(1);
            //initPersonBox(1);
            initProductBox();
            categoryBox.SelectedIndex   = 0;
            personListBox.SelectedIndex = 0;
            productBox.SelectedIndex    = 0;

            succesTone = this.CreatePolyTone2(1);
            errorTone  = this.CreatePolyTone1(1);

            try
            {
                //create a instance of BarcodeReader class
                bcr = new BarcodeReader();
                //set BarcodeRead event
                bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeRead);
                //sends the BarcodeRead event after each successful read
                bcr.ThreadedRead(true);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Пример #8
0
        /// <summary>
        /// Creates an instance of the Intermec barcode scanner device
        /// </summary>
        public IntermecScanner()
        {
            scanEvent     = OnBarcodeRead;
            scannerStatus = ScannerStatus.Closed;

            reader = new IntermecBarcodeReader {
                ScannerOn = false, ScannerEnable = false
            };
        }
Пример #9
0
        /// <summary>
        /// Creates an instance of the Intermec barcode scanner device
        /// </summary>
        public IntermecScanner()
        {
            scanEvent     = new BarcodeReadEventHandler(OnBarcodeRead);
            scannerStatus = Barcode.ScannerStatus.Closed;

            reader = new IntermecBarcodeReader {
                ScannerOn = false, ScannerEnable = false
            };
        }
Пример #10
0
        protected override void OnClosing(CancelEventArgs e)
        {
            FullScreenHandle.StopFullScreen(this);

            if (this.barReader != null)
            {
                this.barReader.Dispose();
                this.barReader = null;
            }
            base.OnClosing(e);
        }
Пример #11
0
 public WarehousePost(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation, string FixWeigth)
 {
     InitializeComponent();
     // InitForms(_bcr, LabelPlace, _ScanOperation);
     FormActive       = true;
     labelMXMore.Text = "Ст-1";
     labelMX.Text     = "Фикс. вес: " + FixWeigth;
     InitTable();
     this.KeyPreview     = true;
     labelCountScan.Text = "0";
     listEU = new List <string>();
 }
Пример #12
0
        public QueueTaskEU(Intermec.DataCollection.BarcodeReader _bcr, string _RZDN)
        {
            InitializeComponent();

            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            //  ScanOperation = _ScanOperation;
            listEU = new List <WebReference.Relmuch>();

            bcr = _bcr;

            this.RZDN = _RZDN;
            InitTable();
            InitScaner();


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
            //  labelMX.Text += " " + this.RZDN;

            ScanWeigth   = SqlLiteQuery.GetWEIGHTByRZDN(_RZDN);
            labelMX.Text = "Осталось: " + Math.Round(ScanWeigth, 2).ToString() + " т.";

            if (ScanWeigth <= 0)
            {
                labelMX.ForeColor = Color.White;
            }
            else
            {
                labelMX.ForeColor = Color.Tomato;
            }


            details         = SqlLiteQuery.GetDetalisbyRZDN(_RZDN);
            MarkaRZDN       = SqlLiteQuery.GetMarkabyRZDN(_RZDN);
            labelDetal.Text = details;
            MarkaRZDNList   = SqlLiteQuery.GetMarkabyRZDNList(_RZDN);

            labelCountScan.BeginInvoke(new Action(() =>
            {
                labelCountScan.Text = "0";
            }));
        }
Пример #13
0
        // public delegate void GetDataDelegate();

        public DataScales(Intermec.DataCollection.BarcodeReader _bcr)
        {
            InitializeComponent();
            CLog.WriteInfo("DataScales.cs", "Start Ui");
            set = new Settings("DataBrCode.xml");

            bcr = _bcr;

            InitScaner();

            _TblScales = SqlLiteQuery.GetScales();

            if (_TblScales != null)
            {
                comboBoxScales.DataSource    = _TblScales;
                comboBoxScales.DisplayMember = "VESY_NAME";
                comboBoxScales.ValueMember   = "VESY_NOM";
                // comboBoxAgr.SelectedIndex = -1;
                if (comboBoxScales.Items.Count > 0)
                {
                    comboBoxScales.SelectedIndex = -1;
                    // buttonFix.Enabled = true;
                    comboBoxScales.DropDownStyle = ComboBoxStyle.DropDownList;
                }
                else
                {
                    buttonFix.Enabled = false;
                }
            }


            LabelEU = null;

            GetDataScales       = true;
            GetDataScalesThread = new Thread(ThreadGetDataScales);
            GetDataScalesThread.Start();

            buttonFix.Enabled = false;

            //Тут правим лейбл
            string StatusBD = StatusBar.getSatus();

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;
        }
Пример #14
0
 public void DisposeScaner()
 {
     try
     {
         if (bcr != null)
         {
             bcr.Dispose();
             bcr = null;
         }
     }
     catch (Exception exp)
     {
         // MessageBox.Show(exp.Message);
         CLog.WriteException("StartMenu.cs", "DisposeScaner", exp.Message);
     }
 }
Пример #15
0
 private void InitScaner()
 {
     if (bcr == null)
     {
         bcr = new BarcodeReader();
     }
     //set BarcodeRead event
     bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeReadQueueTaskEU);
     //sends the BarcodeRead event after each successful read
     bcr.ThreadedRead(true);
     bcr.symbology.Code128.Enable = false;
     //set Interleaved 2 of 5
     bcr.symbology.Interleaved2Of5.Enable = false;
     //set PDF417
     bcr.symbology.Pdf417.Enable = false;
     bcr.symbology.QrCode.Enable = false;
 }
Пример #16
0
        //public void SendScanEU(string EU)
        //{
        //    WebReference.WebSDataBrCode test = new WebReference.WebSDataBrCode();
        //    test.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
        //    test.BeginScanEU(EU, MyAsyncCallbackMethod, test);

        //}
        //// Целевые методы AsyncCallback должны иметь следующую сигнатуру
        //void MyAsyncCallbackMethod(IAsyncResult res)
        //{
        //    try
        //    {
        //        WebReference.WebSDataBrCode test = res.AsyncState as WebReference.WebSDataBrCode;
        //        // Trace.Assert(test != null, "Неверный тип объекта");
        //        string result = test.EndScanEU(res);
        //        //txtText.Text += Environment.NewLine + result;
        //        //MessageBox.Show(result);

        //        txtText.BeginInvoke(new Action(() =>
        //        {
        //            txtText.Text += Environment.NewLine + result;
        //        }));

        //    }

        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.Message);
        //    }
        // }



        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (bcr != null)
                {
                    bcr.Dispose();
                    bcr = null;
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }

            this.Close();
        }
Пример #17
0
        public BaseForm()
        {
            InitializeComponent();

            FullScreenHandle.StartFullScreen(this);

            //create a instance of CSymbology object
            if (this.symb == null)
            {
                this.symb = new CSymbology("AllScanners");
                this.symb.EnableAll();

                //use symbology exception
                this.symb.EnableSymbologyExceptions(true);
            }

            if (this.barReader == null)
            {
                this.barReader = new Intermec.DataCollection.BarcodeReader();
                this.SuspendLayout();
            }
        }
Пример #18
0
        public ScanWareHouse(Intermec.DataCollection.BarcodeReader _bcr, ListScanOperation _ScanOperation)
        {
            InitializeComponent();
            ScanOperation = _ScanOperation;
            bcr           = _bcr;
            initUi();
            InitScaner();
            //Выводим инфушку
            try
            {
                string StatusBD = StatusBar.getSatus();

                labelBD.BeginInvoke(new Action(() =>
                {
                    labelBD.Text      = StatusBD;
                    labelBD.ForeColor = StatusBar.GetColorLabel();
                }));
            }

            catch (Exception) { }
            this.KeyPreview = true;
        }
Пример #19
0
        public InventTaskMX(Intermec.DataCollection.BarcodeReader _bcr, ListScanOperation _ScanOperation, string RZDN, string DateRZDN, string MoreRZDN)
        {
            InitializeComponent();
            labelData.Text    = DateRZDN;
            labelDetalIN.Text = MoreRZDN;
            SelectRZDN        = RZDN;

            bcr           = _bcr;
            ScanOperation = _ScanOperation;
            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;

            LoadRZDN();

            InitScaner();
        }
Пример #20
0
        public void InitScaner()
        {
            try
            {
                bcr = new BarcodeReader();
                //set BarcodeRead event
                bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeRead);
                //sends the BarcodeRead event after each successful read
                bcr.ThreadedRead(true);

                bcr.symbology.Code128.Enable = false;
                //set Interleaved 2 of 5
                bcr.symbology.Interleaved2Of5.Enable = false;
                //set PDF417
                bcr.symbology.Pdf417.Enable = false;
            }

            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Пример #21
0
        public WarehouseSel(Intermec.DataCollection.BarcodeReader _bcr, string _LoginUser, string _Date, string _Sm, ListScanOperation _ScanOperation)
        {
            InitializeComponent();
            bcr = _bcr;

            ScanOperation = _ScanOperation;

            this.LoginUser = _LoginUser;
            this.Text      = _LoginUser + " Смена:" + _Sm;

            try
            {
                _TblAgr = SqlLiteQuery.GetWareHouse();
            }

            catch (Exception exe)
            {
                CLog.WriteException("WarehouseSel.cs", "WarehouseSel", exe.Message);
            }
            InitUi();
            InitScaner();



            labelStatus.Text = "";

            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
        }
Пример #22
0
        public WarehousePost(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation, int MxCodeAutomation)
        {
            InitializeComponent();
            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            ScanOperation = _ScanOperation;
            listEU        = new List <WebReference.Relmuch>();

            bcr = _bcr;

            this.labelPlace = LabelPlace;
            _tblEU          = InitTable();

            CreateColumn("УЕ", "УЕ", 180, 0);
            CreateColumn("Марка", "Марка", 120, 1);
            CreateColumn("Вес", "Вес", 100, 2);
            CreateColumn("Размер", "Размер", 140, 3);
            CreateColumn("Label", "Label", 400, 4);
            dataGridEu.DataSource = _tblEU;

            InitScaner();

            labelMX.Text = LabelPlace;

            //Выгрузим подробную инфу по месту хранения
            //labelMXMore.Text = getValueDataTableColumnRow(_TblWarehouse, "TEHUZ_LABEL", LabelPlace, "TEHUZ_NAME");
            labelMXMore.Text = SqlLiteQuery.GetNameMX(LabelPlace);

            CMxPlace               = new DataBarCode.WebReference.MXPlace();
            CMxPlace.LABEL         = LabelPlace;
            CMxPlace.CODEAUTOMATIC = MxCodeAutomation;


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;



            switch (ScanOperation)
            {
            case ListScanOperation.MXSet:
            {
                this.Text = "Размещение ЕУ";
                break;
            }


            case ListScanOperation.EUTaskMove:
            {
                this.Text = "Перемещение ЕУ";
                break;
            }

            case ListScanOperation.EuInAgr:
            {
                this.Text = "ЕУ в агрегат";
                break;
            }

            case ListScanOperation.EuInAgrTESA:
            {
                this.Text      = "ЕУ в агрегат ТЭСА";
                addManualFirst = true;
                break;
            }

            case ListScanOperation.InventoryTask:
            {
                this.Text = "Инвентаризация МХ: " + labelMXMore.Text;
                break;
            }
            }
            labelCountScan.Text = "0";
        }
Пример #23
0
        // public BarcodeReadEventHandler _returnFunc;


        public WarehousePost(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation)
        {
            InitializeComponent();
            InitForms(_bcr, LabelPlace, _ScanOperation);
        }
Пример #24
0
        public void InitForms(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation)
        {
            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            ScanOperation = _ScanOperation;
            listEU        = new List <string>();

            bcr = _bcr;

            this.labelPlace = LabelPlace;
            InitTable();
            InitScaner();

            labelMX.Text = LabelPlace;

            //Выгрузим подробную инфу по месту хранения
            //labelMXMore.Text = getValueDataTableColumnRow(_TblWarehouse, "TEHUZ_LABEL", LabelPlace, "TEHUZ_NAME");
            if (LabelPlace == "MX0000")
            {
                labelMXMore.Text = "ТЭСА";
            }
            else
            {
                labelMXMore.Text = SqlLiteQuery.GetNameMX(LabelPlace);
            }



            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;



            switch (ScanOperation)
            {
            case ListScanOperation.MXSet:
            {
                this.Text = "Размещение ЕУ";
                break;
            }


            case ListScanOperation.EUTaskMove:
            {
                this.Text = "Перемещение ЕУ";
                break;
            }

            case ListScanOperation.EuInAgr:
            {
                this.Text = "ЕУ в агрегат";
                break;
            }

            case ListScanOperation.InventoryTask:
            {
                this.Text = "Инвентаризация МХ: " + labelMXMore.Text;
                break;
            }
            }
            labelCountScan.Text = "0";
        }