コード例 #1
0
ファイル: MachineDrivers.cs プロジェクト: dimoniche/Service
        /// <summary>
        /// Инициализация драйверов устройств
        /// </summary>
        /// <param name="log"></param>
        public MachineDrivers(Log log)
        {
            this.log = log;

            this.log.Write(LogMessageType.Information, "DRIVERS: Старт драйверов. Версия " + Globals.ProductVersion);

            // создаем все объекты драйверов
            if (scaner == null)
            {
                scaner = new ZebexScaner();
            }
            if (CCNETDriver == null)
            {
                CCNETDriver = new CCRSProtocol();
            }
            if (printer == null)
            {
                printer = new PrinterESC();
            }
            if (control == null)
            {
                control = new ControlDevice();
            }
            if (modem == null)
            {
                modem = new Modem();
            }
        }
コード例 #2
0
ファイル: MachineDrivers.cs プロジェクト: dimoniche/Service
        public void ManualInitDevice()
        {
            if (Globals.ClientConfiguration.Settings.offCheck != 1)
            {
                // не платим чеком - не нужен сканер
                scaner             = new ZebexScaner();
                WorkerScanerDriver = new SaleThread {
                    ThreadName = "WorkerScanerDriver"
                };
                WorkerScanerDriver.Work     += WorkerScanerDriver_Work;
                WorkerScanerDriver.Complete += WorkerScanerDriver_Complete;
            }

            if (Globals.ClientConfiguration.Settings.offBill != 1)
            {
                CCNETDriver          = new CCRSProtocol();
                WorkerBillPollDriver = new SaleThread {
                    ThreadName = "WorkerBillPollDriver"
                };
                WorkerBillPollDriver.Work     += WorkerBillPollDriver_Work;
                WorkerBillPollDriver.Complete += WorkerBillPollDriver_Complete;
            }

            printer = new PrinterESC();

            if (Globals.ClientConfiguration.Settings.offControl != 1)
            {
                control = new ControlDevice();
            }

            if (Globals.ClientConfiguration.Settings.offModem != 1)
            {
                modem = new Modem();
            }
        }