Esempio n. 1
0
        public RadioController()
        {
            _radio = new Radio();

            _radio.ScanUpdated += (s, e) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(e.Frequency));

            _radio.ScanCompleted += (s, e) => ScanCompleted?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 2
0
        private void OnPathfinderScanCompleted()
        {
            foreach (var cell in Cells)
            {
                cell.IsWalkable = Pathfinder.Instance.IsPointWalkable(cell.transform.position);
            }

            ScanCompleted?.Invoke();
        }
        /// <summary>
        /// Raises the ItemScanCompleted event.
        /// </summary>
        /// <param name="e"></param>
        protected void OnItemScanCompleted(ScanCompletedArgs e)
        {
            ScanCompleted completed = ItemScanCompleted;

            if (completed != null)
            {
                completed(e);
            }
        }
    public Task Handle(ScanCompleted message, IMessageHandlerContext context)
    {
        // log.Info($"Handling: ImageStored for Image Id: {message.ImageGuid}");
        string methodID = string.Empty;

        ScanCompletedEvent(methodID);

        return(Task.CompletedTask);
    }
Esempio n. 5
0
        private void InitCallbacks()
        {
            _scanCompletedCallback = _ => ScanCompleted?.Invoke(this, EventArgs.Empty);

            _interruptedCallback =
                (reason, _) => Interrupted?.Invoke(this, new RadioInterruptedEventArgs(reason));

            _scanUpdatedCallback =
                (frequency, _) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency));

            _scanStoppedCallback = _ => ScanStopped?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 6
0
        void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            ScanCompleteEvent args = new ScanCompleteEvent();

            args.EndFrequency      = _endFreq;
            args.StartFrequency    = _startFreq;
            args.MinSignalStrength = _minStrength;
            args.PeakDictionary    = PeakDictionary;
            args.passes            = Passes;
            if (e.Result != null && e.Result is Exception)
            {
                args.Error        = e.Result as Exception;
                args.EndFrequency = 0;
                Debug.WriteLine("Scan interrupted by exception. Firing Event.");
                Debug.WriteLine("Exception details: " + args.Error.Message + Environment.NewLine +
                                args.Error.StackTrace);
            }
            else
            {
                Debug.WriteLine("Scan complete. Firing Event.");
            }

            StringBuilder sb = new StringBuilder();

#if DEBUG
            foreach (KeyValuePair <MicrowaveTuning, MicrowaveLinkQuality> fr in PeakDictionary)
            {
                sb.AppendLine("Freq: " + fr.Key.FrequencyMHz + "   Strength: " + fr.Value.ReceivedCarrierLevel);
            }
            Debug.WriteLine(sb.ToString());
#endif

            if (this.ScanCompleted != null)
            {
                ScanCompleted.Invoke(this, args);
            }
            inSearch = false;
        }
Esempio n. 7
0
 public void Scan()
 {
     this.pathfinder.Scan();
     ScanCompleted?.Invoke();
 }
Esempio n. 8
0
 private static void _bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     ScanCompleted?.Invoke(null, e);
 }
Esempio n. 9
0
 protected void OnScanCompleted(int[] Value) => ScanCompleted?.Invoke(Value);