Exemplo n.º 1
0
 /// <summary>
 /// Конструктор по умолчанию.
 /// </summary>
 public OutChannelInfoImpl()
 {
     device = null;
      channelNumber = 0;
      group = null;
      deviceId = 0;
      groupId = 0;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Генерируем каналы для заданного устройства.
        /// </summary>
        /// <param name="aDeviceInfo">OutputDeviceInfo.</param>
        /// <param name="aDevice">OutputDevice.</param>
        private void FillOutChannels(OutputDeviceInfo aDeviceInfo, OutputDevice aDevice)
        {
            var channelsCount = aDeviceInfo.GetChannelsCount();
            if (channelsCount > aDevice.GetChannelsCount()) {
                throw new ArgumentException("Сhannels count on phisical device is less than in configuration");
            }

            for (var channelIndex = 0; channelIndex < channelsCount; ++channelIndex) {
                var channelInfo = aDeviceInfo.GetChannel(channelIndex);

                ChannelGroup channelGroup = null;
                foreach (var group in groups) {
                    if (group.GetChannelGroupInfo().GetId() == channelInfo.GetGroup().GetId()) {
                        channelGroup = group;
                        break;
                    }
                }

                if (channelGroup == null) {
                    throw new ArgumentException("Channel group was not found for channel " + channelInfo.GetId());
                }

                var channel = new OutChannel(channelInfo, aDevice, channelGroup);
                outChannels.Add(channel);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Изменяет устройство вывода.
 /// </summary>
 /// <param name="aDevice">Устройство вывода.</param>
 public void SetDevice( OutputDeviceInfo aDevice )
 {
     device = aDevice;
 }