private void ReadChannel(byte channel)
        {
            var reading = readADC_SingleEnded(channel);

            ChannelChanged?.Invoke(this, new ChannelReadingDone {
                RawValue = reading, Channel = channel, SlaveAddress = _ads1115.ConnectionSettings.SlaveAddress
            });
        }
Exemplo n.º 2
0
 private void DirectMessageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         var selectedItem = ((PrivateChannelViewModel)directMessageList.SelectedItem)?.PrivateChannel;
         if (directMessageList != null && selectedItem != null)
         {
             ChannelChanged?.Invoke(selectedItem);
         }
     }
     catch (Exception exception)
     {
         App.LogUnhandledError(exception);
     }
 }
Exemplo n.º 3
0
        /// <summary>Set the channel, using the zero indexed number</summary>
        /// <param name="channelIndex">A zero based number to switch to</param>
        public static void SetChannel(uint channelIndex)
        {
            var totalChannels = ChannelIndexList.Count;

            if (channelIndex > totalChannels)
            {
                channelIndex = (uint)totalChannels;
            }

            if (CurrentChannel != null && CurrentChannelIndex == channelIndex)
            {
                return;
            }

            LogDebug($"[TVCore] Setting channelIndex to {channelIndex}");

            CurrentChannel           = Channels.Find(x => x.Index == ChannelIndexList[(int)channelIndex]);
            CurrentChannelIndex      = channelIndex;
            CurrentChannelProgrammes = Guide.Where(x => x.Channel == CurrentChannel.Id).ToList();
            CurrentProgramme         = CurrentChannelProgrammes.Find(x => x.Start <DateTime.UtcNow && x.Stop> DateTime.UtcNow);

            ChannelChanged?.Invoke(channelIndex);
        }
Exemplo n.º 4
0
 private void ExecuteChangeChannelCommand(Channel channel)
 {
     ChannelChanged?.Invoke(this, channel);
 }