public ArduinoDetails(IRadio radio, ILoggerFactoryAdapter loggerFactory, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer) { _radio = radio; _logger = loggerFactory.GetLogger(GetType()); _configuration = configuration; _commandProcessor = commandProcessor; _registerContainer = registerContainer; }
public SimilarArtistsTrackStream(IRadio radio, IEnumerable<string> similarArtists) { _radio = radio; _similarArtists = similarArtists; _similarArtistsEnumerator =_similarArtists.GetEnumerator(); _currentTrackList = new Track[0]; }
public StyleTrackStream( StaticArgument argument, IRadio radio, IToastService toastService) { _argument = argument; _radio = radio; _toastService = toastService; }
public MainStationViewModel( ILoadingIndicatorService loadingIndicatorService, IRadio radio, IToastService toastService, ILoggerFacade logger, IDocumentStore documentStore) { _loadingIndicatorService = loadingIndicatorService; _radio = radio; _toastService = toastService; _logger = logger; _documentStore = documentStore; _fetchPreviewTimer = new Timer(1000); _fetchPreviewTimer.Elapsed += FetchPreviewTimerTick; _scheduler = TaskScheduler.FromCurrentSynchronizationContext(); _styles = new ObservableCollection <TermModel>(); _moods = new ObservableCollection <TermModel>(); _selectedMoods = new ObservableCollection <TermModel>(); _selectedMoods.CollectionChanged += (sender, args) => { RaisePropertyChanged("SelectedMoodsText"); _fetchPreviewTimer.Stop(); _fetchPreviewTimer.Start(); }; _selectedStyles = new ObservableCollection <TermModel>(); _selectedStyles.CollectionChanged += (sender, args) => { RaisePropertyChanged("SelectedStylesText"); _fetchPreviewTimer.Stop(); _fetchPreviewTimer.Start(); }; ToggleStyleCommand = new StaticCommand <TermModel>(ExecuteToggleStyle); ToggleMoodCommand = new StaticCommand <TermModel>(ExecuteToggleMood); StartRadioCommand = new AutomaticCommand(ExecuteStartRadio, CanExecuteStartRadio); IncreaseBoostCommand = new StaticCommand <TermModel>(ExecuteIncreaseBoost); DecreaseBoostCommand = new StaticCommand <TermModel>(ExecuteDecreaseBoost); RequireTermCommand = new StaticCommand <TermModel>(ExecuteRequireTerm); BanTermCommand = new StaticCommand <TermModel>(ExecuteBanTerm); Tempo = new Range(); Tempo.Rounding = MidpointRounding.ToEven; Tempo.RangeChanged += MetricChanged; Loudness = new Range(); Loudness.RangeChanged += MetricChanged; Energy = new Range(); Energy.RangeChanged += MetricChanged; ArtistFamiliarity = new Range(); ArtistFamiliarity.RangeChanged += MetricChanged; ArtistHotness = new Range(); ArtistHotness.RangeChanged += MetricChanged; SongHotness = new Range(); SongHotness.RangeChanged += MetricChanged; Danceability = new Range(); Danceability.RangeChanged += MetricChanged; }
public MainStationViewModel( ILoadingIndicatorService loadingIndicatorService, IRadio radio, IToastService toastService, ILoggerFacade logger, IDocumentStore documentStore) { _loadingIndicatorService = loadingIndicatorService; _radio = radio; _toastService = toastService; _logger = logger; _documentStore = documentStore; _fetchPreviewTimer = new Timer(1000); _fetchPreviewTimer.Elapsed += FetchPreviewTimerTick; _scheduler = TaskScheduler.FromCurrentSynchronizationContext(); _styles = new ObservableCollection<TermModel>(); _moods = new ObservableCollection<TermModel>(); _selectedMoods = new ObservableCollection<TermModel>(); _selectedMoods.CollectionChanged += (sender, args) => { RaisePropertyChanged("SelectedMoodsText"); _fetchPreviewTimer.Stop(); _fetchPreviewTimer.Start(); }; _selectedStyles = new ObservableCollection<TermModel>(); _selectedStyles.CollectionChanged += (sender, args) => { RaisePropertyChanged("SelectedStylesText"); _fetchPreviewTimer.Stop(); _fetchPreviewTimer.Start(); }; ToggleStyleCommand = new StaticCommand<TermModel>(ExecuteToggleStyle); ToggleMoodCommand = new StaticCommand<TermModel>(ExecuteToggleMood); StartRadioCommand = new AutomaticCommand(ExecuteStartRadio, CanExecuteStartRadio); IncreaseBoostCommand = new StaticCommand<TermModel>(ExecuteIncreaseBoost); DecreaseBoostCommand = new StaticCommand<TermModel>(ExecuteDecreaseBoost); RequireTermCommand = new StaticCommand<TermModel>(ExecuteRequireTerm); BanTermCommand = new StaticCommand<TermModel>(ExecuteBanTerm); Tempo = new Range(); Tempo.Rounding = MidpointRounding.ToEven; Tempo.RangeChanged += MetricChanged; Loudness = new Range(); Loudness.RangeChanged += MetricChanged; Energy = new Range(); Energy.RangeChanged += MetricChanged; ArtistFamiliarity = new Range(); ArtistFamiliarity.RangeChanged += MetricChanged; ArtistHotness = new Range(); ArtistHotness.RangeChanged += MetricChanged; SongHotness = new Range(); SongHotness.RangeChanged += MetricChanged; Danceability = new Range(); Danceability.RangeChanged += MetricChanged; }
public void Setup() { var battleTheatreMock = new Mock <IBattleTheatre>(); battleTheatreMock.SetupGet(x => x.Height).Returns(10); battleTheatreMock.SetupGet(x => x.Width).Returns(10); _battleTheatre = battleTheatreMock.Object; _radio = new Mock <IRadio>().Object; }
public static void SetPacketHookFromScript(this WirelessMedium medium, IRadio radio, string script) { if (string.IsNullOrEmpty(script)) { throw new RecoverableException("Cannot initialize packet interception hook because no script was provided"); } var runner = new PacketInterceptionPythonEngine(radio, script: script); medium.AttachHookToRadio(radio, runner.Hook); }
public async Task GetRadioById() { IRadio radio = await _browse.GetRadioById(6); Assert.IsNotNull(radio, nameof(radio)); Assert.AreEqual(6, radio.Id, nameof(radio.Id)); Assert.AreEqual("Elektronikus zene", radio.Title, nameof(radio.Title)); Assert.AreEqual("Elektronikus zene", radio.Description, nameof(radio.Description)); }
public LoveHateTrackStream( string initialArtistName, IRadio radio, IToastService toastService) { _currentTracks = new Track[0]; _initialArtistName = initialArtistName; _radio = radio; _toastService = toastService; }
public static void Test() { Console.WriteLine("Choose radio (M)otorola (H)ytera"); string input = Console.ReadLine(); IRadioAdapterFactory radioAdapterFactory = new RadioAdapterFactory(); IRadio radio = radioAdapterFactory.Create(input); radio.Send(10, "Hello World!"); }
internal virtual void LoadRadio(IRadio radio, bool validateLoadCapacity = true) { this.BeginChangeModules(); this.LoadedModules.Radio = this.AvailableRadios[radio]; if (validateLoadCapacity) { this.TryUpgradeChassis(); } this.EndChangeModules(); }
public VolumeCommand( ILogger log, Action <string> output, IConfigurationProvider configurationProvider, IRadio radio) { _output = output; _configurationProvider = configurationProvider; _log = log; _radio = radio; }
public void GetRadioById() { IRadio radio = session.Radio.GetById(6u, CancellationToken.None) .Result; Assert.IsNotNull(radio, nameof(radio)); Assert.AreEqual(6, radio.Id, nameof(radio.Id)); Assert.That(!string.IsNullOrEmpty(radio.Title), nameof(radio.Title)); Assert.That(!string.IsNullOrEmpty(radio.Description), nameof(radio.Description)); }
private void FrameSentHandler(IRadio sender, byte[] packet) { var senderPosition = radios[sender]; var currentEmulation = EmulationManager.Instance.CurrentEmulation; currentEmulation.TryGetEmulationElementName(sender, out var senderName); FrameProcessed?.Invoke(this, sender, packet); if (!mediumFunction.CanTransmit(senderPosition)) { this.NoisyLog("Packet from {0} can't be transmitted, size {1}.", senderName, packet.Length); return; } foreach (var radioAndPosition in radios.Where(x => x.Key != sender)) { var receiver = radioAndPosition.Key; currentEmulation.TryGetEmulationElementName(receiver, out var receiverName); if (!mediumFunction.CanReach(senderPosition, radioAndPosition.Value) || receiver.Channel != sender.Channel) { this.NoisyLog("Packet {0}:chan{1} -> {2}:chan{3} NOT delivered, size {4}.", senderName, sender.Channel, receiverName, receiver.Channel, packet.Length); continue; } if (!TimeDomainsManager.Instance.TryGetVirtualTimeStamp(out var vts)) { // e.g. when the sender is a SLIP radio vts = new TimeStamp(default(TimeInterval), EmulationManager.ExternalWorld); } var packetCopy = packet.ToArray(); if (radioHooks.TryGetValue(receiver, out var hook)) { hook(packetCopy); } if (receiver is ISlipRadio) { // send immediately receiver.ReceiveFrame(packetCopy); continue; } receiver.GetMachine().HandleTimeDomainEvent(receiver.ReceiveFrame, packetCopy, vts, () => { this.NoisyLog("Packet {0}:chan{1} -> {2}:chan{3} delivered, size {4}.", senderName, sender.Channel, receiverName, receiver.Channel, packet.Length); FrameTransmitted?.Invoke(this, sender, receiver, packetCopy); }); } }
public NetworkInterfaceTester(IRadio iface) { this.iface = iface as IPeripheral; if (this.iface == null) { throw new ConstructionException("This tester can only be attached to an IPeripheral"); } iface.FrameSent += HandleFrame; newFrameEvent = new AutoResetEvent(false); }
public void SetPosition(IRadio radio, decimal x, decimal y, decimal z) { if (radios.ContainsKey(radio)) { radios[radio] = new Position(x, y, z); } else { EmulationManager.Instance.CurrentEmulation.TryGetEmulationElementName(radio, out string name); this.Log(LogLevel.Error, $"Cannot set position for {name} as it is not registered in this wireless medium."); } }
static void Main(string[] args) { // Make a raw COM car. ComCarClass c = new ComCarClass(); // See if this guy is a COM object... Console.WriteLine("Am I a COM object? {0}", Marshal.IsComObject(c).ToString()); // Get IUnknown of object. IntPtr itfUnknownPtr = Marshal.GetIUnknownForObject(c); // Manually AddRef() and Release() // using the IUnknown pointer. for (int i = 0; i < 5; i++) { Console.WriteLine("AddReffing! Count: {0}", Marshal.AddRef(itfUnknownPtr)); Console.WriteLine("Releasing! Count: {0}", Marshal.Release(itfUnknownPtr)); } // Manually call QueryInterface(). IntPtr itfRadioPtr; Guid IIDRadio = Marshal.GenerateGuidForType(typeof(IRadio)); Marshal.QueryInterface(itfUnknownPtr, ref IIDRadio, out itfRadioPtr); // Convert raw IntPtr to IRadio and // manually crank tunes. IRadio itfRadio = (IRadio)Marshal.GetObjectForIUnknown(itfRadioPtr); itfRadio.CrankTunes(); // This releases ALL interfaces // held by the RCW. ComCarClass c2 = new ComCarClass(); Console.WriteLine("Ref Count after calling Marshal.ReleaseComObject(c2): {0}", Marshal.ReleaseComObject(c2)); // This will throw an error. try { c2.CrankTunes(); } catch (NullReferenceException ex) { Console.WriteLine(ex.Message); } }
public PlayCommand( ILogger log, Action <string> output, IStationProvider stationProvider, IConfigurationProvider configurationProvider, IRadio radio) { _log = log; _output = output; _configurationProvider = configurationProvider; _stationProvider = stationProvider; _radio = radio; }
public MainLoop( Func<string> input, ILogger log, IRadio radio, Action<string> output, IEnumerable<ICommand> commands) { _output = output; _input = input; _log = log; _radio = radio; _commands = commands; }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand<Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand <Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public static void ClassInitialize(TestContext testContext) { GpioController gpioController = GpioController.GetDefault(); _irqPin = gpioController.InitGpioPin(25, GpioPinDriveMode.InputPullUp); _cePin = gpioController.InitGpioPin(22, GpioPinDriveMode.Output); DeviceInformationCollection devicesInfo = DeviceInformation.FindAllAsync(SpiDevice.GetDeviceSelector("SPI0")).GetAwaiter().GetResult(); _spiDevice = SpiDevice.FromIdAsync(devicesInfo[0].Id, new SpiConnectionSettings(0)).GetAwaiter().GetResult(); _commandProcessor = new CommandProcessor(_spiDevice); // new MockCommandProcessor(); _loggerFactoryAdapter = new NoOpLoggerFactoryAdapter(); _radio = new Radio(_commandProcessor, _loggerFactoryAdapter, _cePin, _irqPin); }
private void FrameSentHandler(IRadio sender, byte[] packet) { lock (packetsToSend) { packetsToSend.Enqueue(new PacketWithSender(packet, sender.Channel, sender, radios[sender])); if (executeOnSyncAlreadyQueued) { return; } executeOnSyncAlreadyQueued = true; ExecuteOnNearestSync(NearestSyncHandler); } }
public async Task GetByGenres() { IEnumerable <IGenreWithRadios> genres = await _radio.GetByGenres(); Assert.IsNotNull(genres, nameof(genres)); IRadio oneRadio = genres.First().Radios.First(); IEnumerable <ITrack> tracks = oneRadio.GetFirst40Tracks() .GetAwaiter().GetResult(); Assert.AreEqual(40, tracks.Count(), "Count"); }
public void GetRadioById() { handler.Content = base.GetServerResponse("radio"); IRadio radio = session.Radio.GetById(DUMMY_ID, CancellationToken.None) .Result; Assert.IsNotNull(radio, nameof(radio)); Assert.AreEqual(6, radio.Id, nameof(radio.Id)); Assert.AreEqual("Elektronikus zene", radio.Title, nameof(radio.Title)); Assert.AreEqual("Elektronikus zene", radio.Description, nameof(radio.Description)); Assert.AreEqual("https://www.deezer.com/mixes/genre/6?utm_source=deezer&utm_content=mixes-genre-6&utm_term=0_1562079884&utm_medium=web", radio.ShareLink, nameof(radio.ShareLink)); }
public static void SetPacketHookFromFile(this WirelessMedium medium, IRadio radio, string filename) { if (string.IsNullOrEmpty(filename)) { throw new RecoverableException("Cannot initialize packet interception hook because no file was provided"); } if (!File.Exists(filename)) { throw new RecoverableException($"Cannot create the hook because file {filename} does not exist"); } var runner = new PacketInterceptionPythonEngine(radio, filename: filename); medium.AttachHookToRadio(radio, runner.Hook); }
public async Task GetRadioById() { _server.Content = base.GetServerResponse("radio"); IRadio radio = await _browse.GetRadioById(_dummyID); Assert.IsNotNull(radio, nameof(radio)); Assert.AreEqual(6, radio.Id, nameof(radio.Id)); Assert.AreEqual("Elektronikus zene", radio.Title, nameof(radio.Title)); Assert.AreEqual("Elektronikus zene", radio.Description, nameof(radio.Description)); Assert.AreEqual("https://www.deezer.com/mixes/genre/6?utm_source=deezer&utm_content=mixes-genre-6&utm_term=0_1562079884&utm_medium=web", radio.ShareLink, nameof(radio.ShareLink)); }
public static void ClassInitialize(TestContext testContext) { GpioController gpioController = GpioController.GetDefault(); _irqPin = gpioController.InitGpioPin(25, GpioPinDriveMode.InputPullUp); _cePin = gpioController.InitGpioPin(22, GpioPinDriveMode.Output); DeviceInformationCollection devicesInfo = DeviceInformation.FindAllAsync(SpiDevice.GetDeviceSelector("SPI0")).GetAwaiter().GetResult(); _spiDevice = SpiDevice.FromIdAsync(devicesInfo[0].Id, new SpiConnectionSettings(0)).GetAwaiter().GetResult(); _commandProcessor = new CommandProcessor(_spiDevice); // new MockCommandProcessor(); _loggerFactoryAdapter = new NoOpLoggerFactoryAdapter(); _radio = new Radio(_commandProcessor, _loggerFactoryAdapter, _cePin, _irqPin); }
public void SetUp() { radio = new Radio() { Id = 0, Title = "Test Radio", Description = "Description", ShareLink = "www.deezer.com", SmallPicture = Str.SMALL_PICTURE, MediumPicture = Str.MEDIUM_PICTURE, LargePicture = Str.LARGE_PICTURE, }; base.Setup(); }
private static void Main(string[] args) { IUnityContainer container = new UnityContainer(); ContainerMagic.RegisterElements(container); IBattery battery = container.Resolve <IBattery>(); Dial dial = container.Resolve <Dial>(); ITuner tuner = container.Resolve <ITuner>(); IRadio radio = container.Resolve <IRadio>(new ParameterOverride("radioBattery", battery), new ParameterOverride("radioTuner", tuner), new ParameterOverride("radioName", "BrokenRadio")); radio.Start(); }
public HotArtistsViewModel( IRadio radio, IToastService toastService, ILoadingIndicatorService loadingIndicator, ILoggerFacade logger, Dispatcher dispatcher) { _radio = radio; _toastService = toastService; _loadingIndicator = loadingIndicator; _logger = logger; _dispatcher = dispatcher; _artists = new ObservableCollection<HotArtistModel>(); PlayAllTracksCommand = new DelegateCommand(ExecutePlayAllTracks); PlayTopTrackCommand = new DelegateCommand<HotArtistModel>(ExecutePlayTopTrack); QueueTopTrackCommand = new DelegateCommand<HotArtistModel>(ExecuteQueueTopTrack); }
public HotArtistsViewModel( IRadio radio, IToastService toastService, ILoadingIndicatorService loadingIndicator, ILoggerFacade logger, Dispatcher dispatcher) { _radio = radio; _toastService = toastService; _loadingIndicator = loadingIndicator; _logger = logger; _dispatcher = dispatcher; _artists = new ObservableCollection <HotArtistModel>(); PlayAllTracksCommand = new DelegateCommand(ExecutePlayAllTracks); PlayTopTrackCommand = new DelegateCommand <HotArtistModel>(ExecutePlayTopTrack); QueueTopTrackCommand = new DelegateCommand <HotArtistModel>(ExecuteQueueTopTrack); }
static void Main(string[] args) { IUnityContainer container = new UnityContainer(); ContainerMagic.RegisterElements(container); IBattery battery = container.Resolve <IBattery>(); Console.WriteLine(battery.SerialNumber()); Dial dial = container.Resolve <Dial>(); Console.WriteLine(dial.DialType()); ITuner tuner = container.Resolve <ITuner>(); IRadio radio = container.Resolve <IRadio>(new ParameterOverride("radioBattery2", battery), new ParameterOverride("radioTuner2", tuner), new ParameterOverride("radioName", "BrokenRadio")); radio.Start(); ISpeaker cheapSpeaker = container.Resolve <ISpeaker>("Cheap"); ISpeaker priceySpeaker = container.Resolve <ISpeaker>("Expensive"); cheapSpeaker.Start(); priceySpeaker.Start(); // create a dummy extension for string String a = "Je suis une vrai string"; Console.WriteLine(a + ", et en appelant MySuperExtentionMethod, ça retourne : " + a.MySuperExtentionMethod()); // string format with property, of instance variable LogItem r = new LogItem() { ItemCount = 455 }; Console.WriteLine(String.Format($"Write cache dump {r} ({r.ItemCount} items affected)")); }
private void MainForm_Shown(object sender, EventArgs e) { RadioFactory radioFactory = new RadioFactory(); RadioConnectionSettings rcs = new RadioConnectionSettings(); RadioModel model; string logbookUrl; using (ConnectionForm connForm = new ConnectionForm()) { DialogResult dr = connForm.ShowDialog(this); if (dr == System.Windows.Forms.DialogResult.OK) { model = connForm.Model; rcs.BaudRate = connForm.Speed; rcs.Port = connForm.SerialPort; rcs.UseDTR = connForm.UseDTR; rcs.UseRTS = connForm.UseRTS; logbookUrl = connForm.LogbookURL; } else { Close(); return; } } try { m_Radio = radioFactory.GetRadio(model, rcs); m_RadioLabel.Text = m_Radio.ToString(); m_API = new CloudlogAPI(logbookUrl); m_UpdateThread = new Thread(UpdateFrequency); m_UpdateThread.IsBackground = true; m_UpdateThread.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void SpreadMessage(IRadio source, IEntity speaker, string message, int channel) { if (_messages.Contains(message)) { return; } _messages.Add(message); foreach (var radio in ComponentManager.EntityQuery <IRadio>(true)) { if (radio.Channels.Contains(channel)) { //TODO: once voice identity gets added, pass into receiver via source.GetSpeakerVoice() radio.Receive(message, channel, speaker); } } _messages.Remove(message); }
private void MainForm_Shown(object sender, EventArgs e) { RadioFactory radioFactory = new RadioFactory(); RadioConnectionSettings rcs = new RadioConnectionSettings(); RadioModel model; string logbookUrl; using (ConnectionForm connForm = new ConnectionForm()) { DialogResult dr = connForm.ShowDialog(this); if (dr == System.Windows.Forms.DialogResult.OK) { model = connForm.Model; rcs.BaudRate = connForm.Speed; rcs.Port = connForm.SerialPort; rcs.UseDTR = connForm.UseDTR; rcs.UseRTS = connForm.UseRTS; logbookUrl = connForm.LogbookURL; } else { Close(); return; } } try { m_Radio = radioFactory.GetRadio(model, rcs); m_RadioLabel.Text = m_Radio.ToString(); m_API = new CloudlogAPI(logbookUrl); m_UpdateThread = new Thread(UpdateFrequency); m_UpdateThread.IsBackground = true; m_UpdateThread.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void FrameSentHandler(IRadio sender, byte[] packet) { var senderPosition = radios[sender]; var currentEmulation = EmulationManager.Instance.CurrentEmulation; currentEmulation.TryGetEmulationElementName(sender, out var senderName); FrameProcessed?.Invoke(this, sender, packet); if (!mediumFunction.CanTransmit(senderPosition)) { this.NoisyLog("Packet from {0} can't be transmitted, size {1}.", senderName, packet.Length); return; } foreach (var radioAndPosition in radios.Where(x => x.Key != sender)) { var receiver = radioAndPosition.Key; currentEmulation.TryGetEmulationElementName(receiver, out var receiverName); if (!mediumFunction.CanReach(senderPosition, radioAndPosition.Value) || receiver.Channel != sender.Channel) { this.NoisyLog("Packet {0} -> {1} NOT delivered, size {2}.", senderName, receiverName, packet.Length); continue; } var packetCopy = packet.ToArray(); if (radioHooks.TryGetValue(receiver, out var hook)) { hook(packetCopy); } receiver.GetMachine().HandleTimeDomainEvent(receiver.ReceiveFrame, packetCopy, TimeDomainsManager.Instance.VirtualTimeStamp, () => { this.NoisyLog("Packet {0} -> {1} delivered, size {2}.", senderName, receiverName, packetCopy.Length); FrameTransmitted?.Invoke(this, sender, receiver, packetCopy); }); } }
public PacketInterceptionPythonEngine(IRadio radio, string script = null, OptionalReadFilePath filename = null) { if ((script == null && filename == null) || (script != null && filename != null)) { throw new ConstructionException("Parameters `script` and `filename` cannot be both set or both unset."); } this.radio = radio; this.script = script; this.filename = filename; machine = radio.GetMachine(); InnerInit(); Hook = packet => { Scope.SetVariable("packet", packet); Execute(code, error => { this.radio.Log(LogLevel.Error, "Python runtime error: {0}", error); }); }; }
public RadioWizardStep(IRadio radio, IRadioConfiguration radioConfiguration) { _radio = radio; _radioConfiguration = radioConfiguration; }
public virtual void AttachRadio(IRadio radio) { Radio = radio; }
public virtual void DetachRadio() { Radio = null; }
public TopHotttTrackStream(IRadio radio) { _start = 0; _radio = radio; _currentTracks = new Track[0]; }
private void CivServerChanged(object sender, EventArgs e) { if (m_RadioCAT != null) { m_RadioCAT.FrequencyChanged -= m_CivServer_FrequencyChanged; } m_RadioCAT = Controller.Radio; if (m_RadioCAT != null) { m_RadioCAT.FrequencyChanged += m_CivServer_FrequencyChanged; } }