Пример #1
0
        public Program()
        {
            BrcScanner = new BarcodeScaner();
            BrcScanner.ScanBarcodeEvnt += new BarcodeScanning(evScanbrcode);
            DimScanner    = new DimensionScaner();
            WeightScanner = new WeightMeasure();

            try
            {
                MessageQueue Queue = new MessageQueue(StartProgram.queueName);
                if (!Queue.CanWrite)
                {
                    throw new Exception(Resurses.ErrorQueue);
                }
                BrcScanner.Open(Settings.Default.PortBarcodeScanner, 9600, 8);
                DimScanner.Open(Settings.Default.PortDimensionScaner, 9600, 8);
                WeightScanner.Open(Settings.Default.PortWeighr, 9600, 8);
            }
            catch (Exception error)
            {
                log.Error("Ошибка запуска программы..." + error.Message);
            }
        }
Пример #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            BrcScanner = new BarcodeScaner();
            BrcScanner.ScanBarcodeEvnt += new BarcodeScanning(evScanbrcode);
            DimScanner        = new DimensionScaner();
            WeightScanner     = new WeightMeasure();
            DoMeizure         = new CubiscanWeightScan();
            checkBox1.Checked = true;


            // ЛОГИРОВАНИЕ ПОД ApacheMQ



            //publisher.SendMessage("Hello");*/



            try
            {
                /*MessageQueue Queue = new MessageQueue(StartProgram.queueName);
                 * if (!Queue.CanWrite)
                 * {
                 *   throw new Exception(Resurses.ErrorQueue);
                 * }*/

                BrcScanner.Open(Settings.Default.PortBarcodeScanner, 9600, 8);
                DimScanner.Open(Settings.Default.PortDimensionScaner, 9600, 8);
                WeightScanner.Open(Settings.Default.PortWeighr, 9600, 8);
            }
            catch (Exception error)
            {
                log.Error("Ошибка запуска программы..." + error.Message);
                lblError.Text = error.Message;
            }
        }