private void EndSync(EndSyncEventArgs args)
        {
            switch (args.Result)
            {
            case SyncResult.Finished:
                if (args.StatisticsContainer.IsEmpty())
                {
                    return;
                }

                ServiceProvider.ShowNotification(
                    SyncNotificationResources.SyncFinish,
                    args.StatisticsContainer.GetFormattedValues(ServiceProvider),
                    NotificationType.Info);

                if (Config.Instance.SoundConfig.MakeSound)
                {
                    Beeper.DoBeep(Config.Instance.SoundConfig.SoundFile);
                }
                break;

            case SyncResult.Failed:
                ServiceProvider.ShowNotification(
                    SyncNotificationResources.SyncError,
                    args.Exception.Message,
                    NotificationType.Error);
                break;
            }
        }
Пример #2
0
 /// <summary>
 /// Returns a clone of this revision
 /// </summary>
 /// <returns>Cloned revision</returns>
 public SpectrumEdition Clone()
 {
     return(new SpectrumEdition
     {
         Cpu = Cpu.Clone(),
         Rom = Rom.Clone(),
         Memory = Memory.Clone(),
         Screen = Screen.Clone(),
         Beeper = Beeper.Clone(),
         Sound = Sound?.Clone()
     });
 }
Пример #3
0
        public MainForm()
        {
            InitializeComponent();
            Visible          = false;
            taskbarIcon.Icon = Resources.FancyMicUnknown;

            myHidHandler = new HyperXHidHandler(Handle);
            myHidHandler.MicMuteChanged += MyHidHandler_MicMuteChanged;
            _ = RegisterHidHandlerDevicesAsync();

            myBeeper = new Beeper();
            keepHeadsetAwakeMenuItem.Checked = myBeeper.IsTurnedOn;
        }
Пример #4
0
 /// <summary>
 /// Returns a clone of this revision
 /// </summary>
 /// <returns>Cloned revision</returns>
 public SpectrumEdition Clone()
 {
     return(new SpectrumEdition
     {
         Cpu = Cpu.Clone(),
         Rom = Rom.Clone(),
         Memory = Memory.Clone(),
         Screen = Screen.Clone(),
         Beeper = Beeper.Clone(),
         Sound = Sound?.Clone(),
         Floppy = Floppy?.Clone(),
         UlaIssue = UlaIssue
     });
 }
Пример #5
0
        public void DeliverBeeperToTargetLocation(Beeper beeper, Vector2Int targetLocation)
        {
            // 1) Доехать до бипера
            TravelToLocation(beeper.Position);

            // 2) Поднять бипер
            _robot.TakeBeeper();

            // 3) Доехать до цели
            TravelToLocation(targetLocation);

            // 4) Положить бипер
            _robot.PutBeeper();
        }
Пример #6
0
        /// <summary>
        /// Inits this scanner.
        /// </summary>
        public void Init()
        {
            scanner = new Barcode2(Symbol.Barcode2.Devices.SupportedDevices[0]);
            scanner.Config.Reader.ReaderSpecific.LaserSpecific.AimType = AIM_TYPE.AIM_TYPE_TRIGGER;
            scanner.Config.Reader.Set();
            scanner.OnScan += new Barcode2.OnScanHandler(scanner_OnScan);
            scanner.Scan();

            beep           = new Beeper(Symbol.Notification.Device.AvailableDevices.First(d => d.ObjectType == NotifyType.BEEPER));
            beep.Duration  = 500;
            beep.Frequency = 3000;
            beep.Volume    = 5;
            beep.State     = NotifyState.OFF;
        }
Пример #7
0
        private static void Main(string[] args)
        {
            Configuration config = ReadConfig();

            try
            {
                var beeper = new Beeper(
                    requirements: config,
                    beepRequirements: config.BeepConfiguration,
                    workTimer: new CountingManualTimer(),
                    restTimer: new CountingManualTimer());
                beeper.Go();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                Console.Read();
            }
        }
Пример #8
0
        public IOProcessor(DSystem system)
        {
            _system   = system;
            _io       = new IOPIOBus();
            _mem      = new IOPMemoryBus(_io);
            _cpu      = new i8085(_mem, _io);
            _keyboard = new Keyboard();
            _mouse    = new Mouse();

            //
            // 8" floppy drive used by the IOP
            //
            _floppyDrive = new FloppyDrive(_system);

            //
            // Add devices to the IO bus
            //
            _miscIO           = new MiscIO(this);
            _floppyController = new FloppyController(_floppyDrive, _system);
            _dma    = new DMAController(this);
            _tty    = new Printer();
            _beeper = new Beeper();

            //
            // Register DMA devices with controller
            //
            _dma.RegisterDevice(_floppyController, 0);  // Floppy, DMA Channel 0
            _dma.RegisterDevice(_system.CP, 1);         // CP, DMA Channel 1

            _io.RegisterDevice(_miscIO);
            _io.RegisterDevice(_floppyController);
            _io.RegisterDevice(_dma);
            _io.RegisterDevice(_system.CP);
            _io.RegisterDevice(_tty);

            Reset();
        }
Пример #9
0
        public void SelectNodeByAttribute(StepDirection dir, AttrType attrType, SearchMessageArea area)
        {
            var activeNode = (IMsg)_tgMsgs.ActiveNode;

            if (activeNode == null)
            {
                return;
            }

            var topic = activeNode.Topic;

            // Ищем в текущей ветке.
            var treeNodes = dir == StepDirection.Down
                                ? TreeGrid.TreeGrid.GetFlatArrayOfSubNodes(topic, activeNode)
                                : TreeGrid.TreeGrid.GetFlatArrayOfSubNodesReverse(topic, activeNode);

            foreach (IMsg msg in treeNodes)
            {
                if (IsMsgConformAttribute(msg, attrType))
                {
                    _tgMsgs.ActiveNode = msg;
                    return;
                }
            }

            // Если не нашли, то ищем темы (кроневые ветки) имеющие ответы.
            var isCurrPassed = false;
            var messages     = new Msg[_tgMsgs.Nodes.Count];

            _tgMsgs.Nodes.CopyTo(messages, 0);

            if (dir == StepDirection.Up)
            {
                Array.Reverse(messages);
            }

            foreach (IMsg msg in messages)
            {
                // Пропускаем все ветки пока не найдем текущую тему.
                if (!isCurrPassed && msg != topic)
                {
                    continue;
                }

                if (!isCurrPassed)
                {
                    isCurrPassed = true;
                    continue;                     // Текущую тему тоже нужно пропустить.
                }

                // если топик сменился, а нас просили искать только в текущем топике - выходим
                if (area == SearchMessageArea.CurrentTopic && msg.TopicID != topic.TopicID)
                {
                    break;
                }

                // Если в тему есть
                var isFound = false;
                switch (attrType)
                {
                case AttrType.Any:
                    isFound = true;
                    break;

                case AttrType.Marked:
                    isFound = msg.RepliesMarked > 0 || msg.Marked;
                    break;

                case AttrType.Unread:
                    isFound = msg.RepliesUnread > 0 || msg.IsUnread;
                    break;

                case AttrType.UnreadAnswerToMe:
                    isFound = msg.RepliesToMeUnread > 0;
                    break;
                }

                if (isFound)
                {
                    switch (attrType)
                    {
                    case AttrType.Any:
                        break;

                    case AttrType.Marked:
                        isFound = msg.IsMarked;
                        break;

                    case AttrType.Unread:
                        isFound = msg.IsUnread;
                        break;

                    default:
                        isFound = false;
                        break;
                    }

                    if (isFound)
                    {
                        _tgMsgs.ActiveNode = msg;
                        return;
                    }

                    treeNodes = TreeGrid.TreeGrid.GetFlatArrayOfSubNodes(msg);

                    if (dir == StepDirection.Up)
                    {
                        Array.Reverse(treeNodes);
                    }

                    foreach (IMsg subMsg in treeNodes)
                    {
                        if (IsMsgConformAttribute(subMsg, attrType))
                        {
                            _tgMsgs.ActiveNode = subMsg;
                            return;
                        }
                    }

                    throw new ApplicationException(
                              "Аргрегированная информация не соответсвует реальному содержанию БД. Произведите " +
                              "пересчет БД и обратитесь к разработчикам.");
                }
            }

            Beeper.DoBeep();
            return;
        }
Пример #10
0
        protected override void OnReadBarCode(string Code, string OriginalCode)
        {
            switch (task.Kind)
            {
            case TaskKind.In:
            {
                ((InputTask)task).ReadBarCode(Code);
                if (task.number > -1)
                {
                    if (!notConfirmation)
                    {
                        if (!DialogShowed)
                        {
                            l_name.Text     = ((InputTask)task).vName;
                            l_code.Text     = ((InputTask)task).vCode;
                            tb_count.Text   = ((InputTask)task).vCount;
                            panel1.Location = new Point(0, 38);
                            tb_count.SelectAll();
                            tb_count.Focus();
                            savedRowNumber = task.number;
                            DialogShowed   = true;
                            AutoSave();
                        }
                        else
                        {
                            if (l_code.Text == ((InputTask)task).vCode)
                            {
                                l_name.Text = ((InputTask)task).vName;
                                l_code.Text = ((InputTask)task).vCode;
                                int prevValue = 0;
                                if (IntTryParse(tb_count.Text, out prevValue))
                                {
                                    int newValue = 0;
                                    if (IntTryParse(((InputTask)task).vCount, out newValue))
                                    {
                                        tb_count.Text = (prevValue + newValue).ToString();
                                    }
                                }
                                else
                                {
                                    tb_count.Text = ((InputTask)task).vCount;
                                }
                                savedRowNumber  = task.number;
                                panel1.Location = new Point(0, 38);
                                tb_count.SelectAll();
                                tb_count.Focus();
                                AutoSave();
                            }
                            else
                            {
                                var currentRowNumber = task.number;
                                task.number = savedRowNumber;
                                ((InputTask)task).CountEntered(tb_count.Text);
                                task.number    = currentRowNumber;
                                savedRowNumber = task.number;

                                l_name.Text     = ((InputTask)task).vName;
                                l_code.Text     = ((InputTask)task).vCode;
                                tb_count.Text   = ((InputTask)task).vCount;
                                panel1.Location = new Point(0, 38);
                                tb_count.SelectAll();
                                tb_count.Focus();
                                AutoSave();
                            }
                        }
                    }
                    else
                    {
                        ((InputTask)task).CountEntered("1");
                        dataGrid1.CurrentCell = new DataGridCell(((InputTask)task).vGridRow, 0);
                        dataGrid1.Focus();
                        AutoSave();
                    }
                }
            }
            break;

            case TaskKind.Out:
            {
                ((OutputTask)task).ReadBarCode(Code);

                if (((OutputTask)task).vGridRow > -1)
                {
                    if (!notConfirmation)
                    {
                        l_name.Text      = ((OutputTask)task).vName;
                        l_code.Text      = ((OutputTask)task).vCode;
                        l_count_doc.Text = ((OutputTask)task).vCountDoc;
                        tb_count.Text    = ((OutputTask)task).vCount;
                        panel1.Location  = new Point(0, 38);
                        tb_count.SelectAll();
                        tb_count.Focus();
                    }
                    else
                    {
                        ((OutputTask)task).CountEntered("1");
                        if (((OutputTask)task).vGridRow > -1)
                        {
                            dataGrid1.Focus();
                            dataGrid1.CurrentCell = new DataGridCell(((OutputTask)task).vGridRow, 0);
                            AutoSave();
                        }
                    }
                }
            }
            break;

            case TaskKind.Recalc:
            {
                if (!((RecalcTask)task).ReadBarCode(Code))
                {
                    Beeper.MessageBeep();
                }

                if (!notConfirmation)
                {
                    l_name.Text     = ((RecalcTask)task).vName;
                    l_code.Text     = ((RecalcTask)task).vCode;
                    tb_count.Text   = ((RecalcTask)task).vCount;
                    panel1.Location = new Point(0, 38);
                    tb_count.SelectAll();
                    tb_count.Focus();
                }
                else
                {
                    ((RecalcTask)task).CountEntered("1");
                    dataGrid1.CurrentCell = new DataGridCell(((RecalcTask)task).vGridRow, 0);
                    dataGrid1.Focus();
                    AutoSave();
                }
            }
            break;
            }
        }
Пример #11
0
 public TapePlayer(Beeper <byte> beeper)
 {
     _beeper = beeper;
 }
Пример #12
0
 public Bus16Bit(Beeper beeper)
 {
     _beeper = beeper;
 }
Пример #13
0
        /// <summary>
        /// Считан код
        /// </summary>
        /// <param name="Code">The code.</param>
        protected override void OnReadBarCode(string Code, string OriginalCode)
        {
            switch (task.Kind)
            {
            case TaskKind.In:
            {
                ((InputTask)task).ReadBarCode(Code);
                l_name.Text     = ((InputTask)task).vName;
                l_code.Text     = ((InputTask)task).vCode;
                tb_count.Text   = ((InputTask)task).vCount;
                panel1.Location = new Point(0, 38);
                tb_count.SelectAll();
                tb_count.Focus();
            }
            break;

            case TaskKind.Out:
            {
                ((OutputTask)task).ReadBarCode(Code);
                if (((OutputTask)task).vGridRow > -1)
                {
                    l_name.Text      = ((OutputTask)task).vName;
                    l_code.Text      = ((OutputTask)task).vCode;
                    l_count_doc.Text = ((OutputTask)task).vCountDoc;
                    tb_count.Text    = ((OutputTask)task).vCount;
                    panel1.Location  = new Point(0, 38);
                    tb_count.SelectAll();
                    tb_count.Focus();
                }
            }
            break;

            case TaskKind.CheckOut:
            {
                ((CheckOutputTask)task).ReadBarCode(Code);
                if (((CheckOutputTask)task).vGridRow > -1)
                {
                    l_name.Text      = ((CheckOutputTask)task).vName;
                    l_code.Text      = ((CheckOutputTask)task).vCode;
                    l_count_doc.Text = ((CheckOutputTask)task).vCountDoc;
                    tb_count.Text    = ((CheckOutputTask)task).vCount;
                    panel1.Location  = new Point(0, 38);
                    tb_count.SelectAll();
                    tb_count.Focus();
                }
            }
            break;

            case TaskKind.Recalc:
            {
                if (!((RecalcTask)task).ReadBarCode(Code))
                {
                    Beeper.MessageBeep(16);
                    Beeper.MessageBeep(16);
                    Beeper.MessageBeep(16);
                }

                if (!notConfirmation)
                {
                    l_name.Text      = ((RecalcTask)task).vName;
                    l_code.Text      = ((RecalcTask)task).vCode;
                    tb_count.Text    = ((RecalcTask)task).vCount;
                    l_count_doc.Text = ((RecalcTask)task).place;
                    panel1.Location  = new Point(0, 38);
                    tb_count.SelectAll();
                    tb_count.Focus();
                }
                else
                {
                    ((RecalcTask)task).CountEntered("1");
                    dataGrid1.CurrentCell = new DataGridCell(((RecalcTask)task).vGridRow, 0);
                    dataGrid1.Focus();
                    // AutoSave();
                }
            }
            break;

            case TaskKind.InSup:
            {
                ((InputFromSupplierTask)task).ReadBarCode(Code);
                l_name.Text     = ((InputFromSupplierTask)task).vName;
                l_code.Text     = ((InputFromSupplierTask)task).vCode;
                tb_count.Text   = ((InputFromSupplierTask)task).vCount;
                panel1.Location = new Point(0, 38);
                tb_count.SelectAll();
                tb_count.Focus();
            }
            break;
            }
        }