Beispiel #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            CashCode cc = new CashCode();

            cc.NumberOfComPort = ushort.Parse(txb.Text);
            cc.OpenComPort();

            cc.DelegatePollingBill    = PollingBill;
            cc.DelegateProcessMessage = ProcessMessage;
            cc.Reset();

            string name = string.Empty, id = string.Empty;

            cc.Identification(ref name, ref id);

            l_id.Content = name + " " + id;

            cc.Reset();
            var rubs  = Enum.GetValues(typeof(CashCode.RUB));
            var lrubs = rubs.OfType <CashCode.RUB>().ToList();

            cc.EnableBillTypes(new List <CashCode.RUB> {
                CashCode.RUB.B100
            });

            var res = cc.PollingLoop(100, 20);

            cc.Reset();

            cc.CloseComPort();
        }
Beispiel #2
0
        public MainWindow()
        {
            try {
                InitializeComponent();

                GeckoPreferences.User["extensions.blocklist.enabled"] = false;
                Util.NavigateTo(_browser, CurrentWindow.Main);

                _browser.DomClick          += BrowserDomClick;
                _browser.DocumentCompleted += (s, e) => DocumentReady();

                Controls.Add(_browser);

                _timer = new System.Threading.Timer(WaitTimeIsUp);

                _thrSync = new Thread(_synchronization.Synchronize)
                {
                    IsBackground = true, Name = "Synchronization"
                };
                _thrSync.Start();

                _thrCashCode = new Thread(_cashCode.StartPolling)
                {
                    IsBackground = true, Name = "Poll"
                };
                _thrCashCode.Start();

                _cashCode.Reset();
                _cashCode.MoneyAcceptedHandler += AcceptedBanknote;
            } catch (Exception exception) {
                Log.Error(exception);
            }
        }
Beispiel #3
0
 public CashCodeWrapper()
 {
     if (!PrintBoxApp.instance.runOptions.testMode)
     {
         log.Debug("Initializing cashcode");
         cashCode = new CashCode(PrintBoxApp.instance.config.CashCodePort);
         cashCode.BillStacked += new BillStackedEventHandler(cashCode_BillStacked);
         cashCode.Reset();
     }
 }