Beispiel #1
0
        private static List <TuningInfo> CreateTuningInfosForChannel(
            int channel_number, int subchannel,
            ModulationType modulation_type, IEnumerable <Device> devices)
        {
            List <TuningInfo> tuning_infos = new List <TuningInfo>();

            foreach (Device d in devices)
            {
                string old_tuningspace_name = d.DeviceType.TuningSpaceName;
                if (string.IsNullOrEmpty(old_tuningspace_name))
                {
                    // hacky.  Why is it null for all my devices currently?
                    string temp_tuningspace_name = GetTuningSpaceNameForModulation(modulation_type);
                    // What really seems to matter looking at
                    // ChannelTuningInfo(Device device, SerializationFormat format, byte[] serializedTuneRequest, TuneRequest tr) : base(device, format, serializedTuneRequest, tr)
                    // in .NET Reflector is whether the tuning space has subnumbers or not.  So if we can't figure out
                    // what TuningSpace makes sense, pick one based on if subchannel is 0.
                    if (string.IsNullOrEmpty(temp_tuningspace_name))
                    {
                        temp_tuningspace_name = ((subchannel != 0) ? "Digital Cable" : "Cable");
                    }
                    d.DeviceType.TuningSpaceName = temp_tuningspace_name;
                }
                ChannelTuningInfo channel_tuning_info = new ChannelTuningInfo(d, channel_number, subchannel, modulation_type);
                tuning_infos.Add(channel_tuning_info);
            }
            return(tuning_infos);
        }
Beispiel #2
0
 public ChannelMapEntry(int number, string callsign, ModulationType modulation, ChannelNumber physicalChannel)
 {
     number_           = number;
     callsign_         = callsign;
     modulation_       = modulation;
     physical_channel_ = physicalChannel;
 }
Beispiel #3
0
 public static Channel AddUserChannelToLineupWithoutMerge(
     Lineup lineup, string callsign,
     int channel_number, int subchannel, ModulationType modulation_type,
     Service service)
 {
     return(AddUserChannelToLineupWithoutMerge(lineup, callsign, channel_number, subchannel, modulation_type, service, null));
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATSCChannel"/> class.
 /// </summary>
 public ATSCChannel()
 {
   _majorChannel = -1;
   _minorChannel = -1;
   _physicalChannel = -1;
   _modulation = ModulationType.Mod8Vsb;
 }
Beispiel #5
0
 public MCS()
 {
     this.m_Modulation = ModulationType.QPSK;
     this.technology = NetWorkType.LTE;
     this.m_ID = 0;
     this.TBSIndex = 26;
 }
 public ChannelMapEntry(int number, string callsign, ModulationType modulation, ChannelNumber physicalChannel)
 {
     number_ = number;
     callsign_ = callsign;
     modulation_ = modulation;
     physical_channel_ = physicalChannel;
 }
Beispiel #7
0
        private void BuildModulationGraph(object sender, EventArgs e, Signal init, Signal fin)
        {
            Signal         signalInit     = init;
            Signal         signalFin      = fin;
            ModulationType modulationType = (ModulationType)comboBox4.SelectedIndex;

            try
            {
                chart1.Series.Remove(DataSer);
            }
            finally
            {
                DataSer           = new System.Windows.Forms.DataVisualization.Charting.Series();
                HarS              = new System.Windows.Forms.DataVisualization.Charting.Legend();
                DataSer.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
                DataSer.Color     = Color.Red;
                HarS.Name         = "Harmonic signal";
                HarS.Title        = "Harmonic signal";

                //chart1.Legends.Add(HarS);
                int N = 1024;
                A   = (double)trackBar2.Value;
                f   = (double)trackBar3.Value;
                phi = (double)trackBar1.Value;

                //   double correction = (double)trackBar19.Value;

                // double Q = 0.25;
                label4.Text = Convert.ToString(trackBar2.Value);
                label5.Text = Convert.ToString(trackBar3.Value);
                label6.Text = Convert.ToString(trackBar1.Value);
                //  label37.Text = Convert.ToString(trackBar19.Value);

                modulationType = (ModulationType)comboBox4.SelectedIndex;
                Modulation newWave = new Modulation(A, f, phi, modulationType);

                newWave.CreateInit(signalInit);
                newWave.CreateFin(signalFin);

                double t = 0;

                for (int n = 1; n <= N - 1; n++)
                {
                    t = newWave.GetPointsForWave(N, n);

                    /* double res = 0;
                     * for (int k = 0; k <= 1; k++)
                     * {
                     *   t = arrWaves[k].GetPointsForWave(N, n, noize ? NoizeStep : 0);
                     *   //t= (phc[k*3 + 2]) * Math.Sin(2 * Math.PI * (phc[k*3 + 1]) * n / N + (double)(phc[k*3]) / 180 * Math.PI);
                     *   // double t = (3 * phc[k * 3 + 2]) * Math.Sin(2 * Math.PI * (3 * phc[k * 3 + 1]) * n / N + (double)(3 * phc[k * 3]) / 180 * Math.PI);
                     *   res += t;
                     * }*/
                    //if(DataSer.Points.)
                    DataSer.Points.AddXY(n, t);
                }
            }
            chart1.ResetAutoValues();
            chart1.Series.Add(DataSer);
        }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATSCChannel"/> class.
 /// </summary>
 public ATSCChannel()
 {
     _majorChannel    = -1;
     _minorChannel    = -1;
     _physicalChannel = -1;
     _modulation      = ModulationType.Mod8Vsb;
 }
Beispiel #9
0
        //  double correction;

        public Modulation(double A, double f, double phi, ModulationType modType)
        {
            this.Amplitude      = A;
            this.frequency      = f;
            this.phase          = phi;
            this.modulationType = modType;
        }
        internal override bool SetDVBS2Parameters(TuningSpec tuningSpec, IBaseFilter tunerFilter, ITuneRequest tuneRequest)
        {
            if (!dvbs2Capable)
            {
                return(true);
            }

            IBDA_DigitalDemodulator demodulator = FindDemodulator("GenPix", tunerFilter);

            if (demodulator == null)
            {
                Logger.Instance.Write("GenPix DVB-S2 handler: Demodulator not located");
                return(false);
            }

            ModulationType modulationType = ModulationType.ModNotSet;

            switch (modulationType)
            {
            case ModulationType.ModQpsk:
                modulationType = ModulationType.Mod8Vsb;
                break;

            case ModulationType.Mod8Psk:
                modulationType = ModulationType.Mod8Vsb;
                break;

            case ModulationType.Mod16Apsk:
                modulationType = ModulationType.Mod16Vsb;
                break;

            case ModulationType.Mod32Apsk:
                modulationType = ModulationType.ModOqpsk;
                break;

            default:
                break;
            }

            if (modulationType != ModulationType.ModNotSet)
            {
                reply = demodulator.put_ModulationType(ref modulationType);
                if (reply != 0)
                {
                    Logger.Instance.Write("GenPix DVB-S2 handler: Set Modulation Type failed error code 0x" + reply.ToString("X"));
                    return(false);
                }
                else
                {
                    Logger.Instance.Write("GenPix DVB-S2 handler: Modulation type changed to " + modulationType);
                }
            }
            else
            {
                Logger.Instance.Write("GenPix DVB-S2 handler: Modulation type not changed");
            }

            return(true);
        }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATSCChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public ATSCChannel(ATSCChannel chan)
   : base(chan)
 {
   _majorChannel = chan.MajorChannel;
   _minorChannel = chan.MinorChannel;
   _physicalChannel = chan.PhysicalChannel;
   _modulation = chan.ModulationType;
 }
Beispiel #12
0
 public TDHSDPABearer()
 {
     base.Technology = NetWorkType.TDSCDMA;
     this.m_BearerIndex = 1;
     this.m_CI = 0;
     this.m_Modulation = ModulationType.QPSK;
     this.m_RTBS = 0;
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATSCChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public ATSCChannel(ATSCChannel chan)
     : base(chan)
 {
     _majorChannel    = chan.MajorChannel;
     _minorChannel    = chan.MinorChannel;
     _physicalChannel = chan.PhysicalChannel;
     _modulation      = chan.ModulationType;
 }
Beispiel #14
0
 public void OnModulationMode(AtscTransmissionMedium transmissionMedium, byte index, TransmissionSystem transmissionSystem,
                              BinaryConvolutionCodeRate innerCodingMode, bool isSplitBitstreamMode, ModulationType modulationFormat, int symbolRate)
 {
     if (transmissionMedium != AtscTransmissionMedium.Cable)
     {
         return;
     }
     _modulationModes[index] = modulationFormat;
 }
Beispiel #15
0
 public UMTSHSDPABearer()
 {
     base.Technology = NetWorkType.UMTS;
     this.CQI = 1;
     this.m_TransportBlSize = 0;
     this.m_HspdschNum = 1;
     this.m_RlcPeakthroughput = 0f;
     this.m_Modulation = ModulationType.QPSK;
 }
Beispiel #16
0
 public void CopyFrom(UMTSHSDPABearer copyObj)
 {
     base.Technology = copyObj.Technology;
     this.CQI = copyObj.CQI;
     this.m_TransportBlSize = copyObj.TransportBlSize;
     this.m_HspdschNum = copyObj.HspdschNum;
     this.m_RlcPeakthroughput = copyObj.RlcPeakthroughput;
     this.m_Modulation = copyObj.Modulation;
 }
Beispiel #17
0
        public void Get_s_SignalType(string strWaveform, string strWaveformName, out s_SignalType value)
        {
            //Get the all value from 'struct s_SignalType'
            NoiseFloorWaveformMode ModulationType;

            ModulationType = (NoiseFloorWaveformMode)Enum.Parse(typeof(NoiseFloorWaveformMode), strWaveformName.ToUpper());
            int arrayNo = (int)Enum.Parse(ModulationType.GetType(), ModulationType.ToString());         //to get the int value from System.Enum

            value = NF_VSTDriver.SignalType[arrayNo];
        }
Beispiel #18
0
 public MCS(ModulationType modulationType, int modulationOrder, float codingRate, float bearEfficiency)
 {
     this.m_Modulation = ModulationType.QPSK;
     this.technology = NetWorkType.LTE;
     this.m_ID = 0;
     this.m_Modulation = modulationType;
     this.m_ModulationOrder = modulationOrder;
     this.m_CodingRate = codingRate;
     this.m_BearEfficiency = bearEfficiency;
 }
Beispiel #19
0
 public void CopyFrom(MCS mcs)
 {
     this.m_BearEfficiency = mcs.BearEfficiency;
     this.m_CodingRate = mcs.CodingRate;
     this.m_Name = mcs.Name;
     this.m_MCSLINKTYPE = mcs.MCSLINKTYPE;
     this.m_Modulation = mcs.Modulation;
     this.m_ModulationOrder = mcs.ModulationOrder;
     this.m_TBSIndex = mcs.TBSIndex;
 }
Beispiel #20
0
 private void SetSelectedModulation(ModulationType modulation_type)
 {
     foreach (Object o in ModulationTypeComboBox.Items)
     {
         if ((o as ModulationTypeWrapper).modulation_type == modulation_type)
         {
             ModulationTypeComboBox.SelectedItem = o;
         }
     }
 }
Beispiel #21
0
 public void CopyFrom(TDHSDPABearer copyObj)
 {
     base.Technology = copyObj.Technology;
     this.m_BearerIndex = copyObj.m_BearerIndex;
     this.m_CI = copyObj.m_CI;
     this.m_MaxUserGrade = copyObj.m_MaxUserGrade;
     this.m_MinUserGrade = copyObj.m_MinUserGrade;
     this.m_Modulation = copyObj.Modulation;
     this.m_RTBS = copyObj.m_RTBS;
 }
Beispiel #22
0
        public static void AddUserChannelAndMergedChannelInLineup(Lineup lineup, string callsign,
                                                                  int channel_number, int subchannel,
                                                                  ModulationType modulation_type,
                                                                  int guide_channel_number, int guide_subchannel,
                                                                  Service service)
        {
            Channel scanned_channel = AddUserChannelToLineupWithoutMerge(lineup, callsign, channel_number, subchannel, modulation_type, service);

            CreateMergedChannelFromChannels(new List <Channel>(new Channel[] { scanned_channel }), guide_channel_number, guide_subchannel);
            return;
        }
        private void TestModulationType()
        {
            int            hr = 0;
            ModulationType modType2, modType1 = ModulationType.Mod64Qam;

            hr = digitalDemux.put_ModulationType(ref modType1);
            //DsError.ThrowExceptionForHR(hr);

            hr = digitalDemux.get_ModulationType(out modType2);
            //DsError.ThrowExceptionForHR(hr);
        }
 private void SelectMatchingModulationType(ModulationType modulation_type)
 {
     foreach (object o in ModulationListBox.Items)
     {
         if ((o as ModulationTypeWrapper).modulation_type == modulation_type)
         {
             ModulationListBox.SelectedItem = o;
             return;
         }
     }
 }
Beispiel #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 public DVBSChannel()
 {
     SwitchingFrequency = 0;
     DisEqc             = DisEqcType.SimpleA;
     _bandType          = BandType.Universal;
     _satelliteIndex    = -1;
     _modulation        = ModulationType.ModQpsk;
     _innerFecRate      = BinaryConvolutionCodeRate.RateNotSet;
     _pilot             = Pilot.NotSet;
     _rollOff           = RollOff.NotSet;
 }
Beispiel #26
0
        /// <summary>
        /// Vol 1, pp. 2.105
        /// </summary>
        /// <param name="formatType"></param>
        /// <returns></returns>
        public static string ToSerialString(this ModulationType formatType)
        {
            switch (formatType)
            {
            case ModulationType.ASK: return("ASK");

            case ModulationType.BPSK: return("BPSK");

            case ModulationType.QPSK: return("QPSK");

            case ModulationType.QPSK_IS95: return("QIS95");

            case ModulationType.QPSK_Inmarsat: return("QINM");

            case ModulationType.QPSK_ICO: return("QICO");

            case ModulationType.QPSK_WCDMA: return("QWCD");

            case ModulationType.OQPSK: return("OQPS");

            case ModulationType.OQPSK_IS95: return("OIS95");

            case ModulationType.P4QPSK: return("P4QP");

            case ModulationType.P4DQPSK: return("P4DQ");

            case ModulationType.PSK8: return("PSK8");

            case ModulationType.PSK8Edge: return("PSKE8");

            case ModulationType.GMSK: return("GMSK");

            case ModulationType.GFSK: return("GFSK");

            case ModulationType.FSK2: return("FSK2");

            case ModulationType.FSK4: return("FSK4");

            case ModulationType.FSK4_APCO25: return("AFSK4");

            case ModulationType.QAM16: return("QAM16");

            case ModulationType.QAM32: return("QAM32");

            case ModulationType.QAM64: return("QAM64");

            case ModulationType.QAM256: return("QAM256");

            case ModulationType.USER: return("USER");

            default: throw new NotSupportedException();
            }
        }
Beispiel #27
0
        /// <summary>
        /// Метод, привязывающий некие другие параметры плагина к редактору.
        /// </summary>
        private void BindMasterSettings(Routing routing)
        {
            var color = (Brush)Resources["masterKnobColor"];

            MasterVolume.AttachTo(routing.MasterVolumeManager, color,
                                  Converters.PercentsToString);

            Oversampling.AttachTo(routing.OversamplingOrderManager, color,
                                  Converters.OversamplingOrderToString);

            ModulationType.AttachTo(routing.VoicesManager.ModulationTypeManager, color,
                                    Converters.ModulationTypeToString);
        }
 public static bool TryGetLineupModulation(Lineup lineup, out ModulationType modulation_type)
 {
     foreach (Channel ch in lineup.GetChannels())
     {
         foreach (TuningInfo tuning_info in ch.TuningInfos)
         {
             modulation_type = (tuning_info as ChannelTuningInfo).ModulationType;
             return(true);
         }
     }
     modulation_type = ModulationType.BDA_MOD_NOT_SET;
     return(false);
 }
Beispiel #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public DVBSChannel(DVBSChannel chan)
     : base(chan)
 {
     _polarisation       = chan.Polarisation;
     _symbolRate         = chan.SymbolRate;
     _switchingFrequency = chan.SwitchingFrequency;
     DisEqc          = chan.DisEqc;
     _bandType       = chan.BandType;
     _modulation     = chan.ModulationType;
     _innerFecRate   = chan.InnerFecRate;
     _pilot          = chan.Pilot;
     _rollOff        = chan.Rolloff;
     _satelliteIndex = chan.SatelliteIndex;
 }
        internal override bool ClearDVBS2Parameters(TuningSpec tuningSpec, IBaseFilter tunerFilter, ITuneRequest tuneRequest)
        {
            if (!dvbs2Capable)
            {
                return(true);
            }

            IBDA_DigitalDemodulator demodulator = FindDemodulator("Hauppauge", tunerFilter);

            if (demodulator == null)
            {
                Logger.Instance.Write("Hauppauge DVB-S2 handler: Demodulator not located");
                return(false);
            }

            ModulationType modulationType = tuningSpec.NativeModulation;

            reply = demodulator.put_ModulationType(ref modulationType);
            if (reply != 0)
            {
                Logger.Instance.Write("Hauppauge DVB-S2 handler: Set Modulation Type failed error code 0x" + reply.ToString("X"));
                return(false);
            }
            else
            {
                Logger.Instance.Write("Hauppauge DVB-S2 handler: Modulation type set to " + modulationType);
            }

            IntPtr commandBuffer  = Marshal.AllocCoTaskMem(1024);
            IntPtr instanceBuffer = Marshal.AllocCoTaskMem(1024);

            SatelliteFrequency frequency = tuningSpec.Frequency as SatelliteFrequency;

            Marshal.WriteInt32(commandBuffer, (int)DirectShowAPI.Pilot.NotSet);
            reply = propertySet.Set(bdaTunerExtensionProperties, (int)BdaTunerExtension.KSPROPERTY_BDA_PILOT, instanceBuffer, 32, commandBuffer, 4);
            if (reply != 0)
            {
                Logger.Instance.Write("Hauppauge DVB-S2 handler: Set Pilot command failed error code 0x" + reply.ToString("X"));
            }
            else
            {
                Logger.Instance.Write("Hauppauge DVB-S2 handler: Pilot set to off");
            }

            return(reply == 0);
        }
Beispiel #31
0
        public static Channel AddUserChannelToLineupWithoutMerge(
            Lineup lineup, string callsign,
            int channel_number, int subchannel, ModulationType modulation_type,
            Service service, IEnumerable <Device> devices, ChannelType channel_type = ChannelType.UserAdded)
        {
            if (devices == null)
            {
                List <Device> device_list = new List <Device>();
                foreach (Device d in lineup.ScanDevices)
                {
                    device_list.Add(d);
                }
                devices = device_list;
            }
            List <TuningInfo> tuning_infos = CreateTuningInfosForChannel(channel_number, subchannel, modulation_type, devices);
            Channel           ch           = AddUserChannelToLineupWithoutMerge(lineup, callsign, channel_number, subchannel, tuning_infos, service, channel_type);

            return(ch);
        }
        private TMOD Translate(ModulationType mod)
        {
            switch (mod)
            {
            case ModulationType.Mod8Psk:
                return(TMOD.TMOD_TURBO_8PSK);

            //return TMOD.TMOD_DVBS2_8PSK;
            case ModulationType.ModQpsk:
                return(TMOD.TMOD_TURBO_QPSK);

            //return TMOD.TMOD_DVBS2_QPSK;
            case ModulationType.Mod8Vsb:
                return(TMOD.TMOD_8VSB);

            default:
                return(TMOD.TMOD_AUTO);
            }
        }
Beispiel #33
0
 private TMOD Translate(ModulationType mod)
 {
   switch (mod)
   {
     case ModulationType.Mod8Psk:
       return TMOD.TMOD_TURBO_8PSK;
       //return TMOD.TMOD_DVBS2_8PSK;
     case ModulationType.ModQpsk:
       return TMOD.TMOD_TURBO_QPSK;
       //return TMOD.TMOD_DVBS2_QPSK;
     case ModulationType.Mod8Vsb:
       return TMOD.TMOD_8VSB;
     default:
       return TMOD.TMOD_AUTO;
   }
 }
Beispiel #34
0
 public void OnModulationMode(AtscTransmissionMedium transmissionMedium, byte index, TransmissionSystem transmissionSystem,
   BinaryConvolutionCodeRate innerCodingMode, bool isSplitBitstreamMode, ModulationType modulationFormat, int symbolRate)
 {
   if (transmissionMedium != AtscTransmissionMedium.Cable)
   {
     return;
   }
   _modulationModes[index] = modulationFormat;
 }
Beispiel #35
0
 public void setModulatorType(ModulationType type)
 {
     modType = type;
 }
Beispiel #36
0
 private void SetSelectedModulation(ModulationType modulation_type)
 {
     foreach (Object o in ModulationTypeComboBox.Items)
     {
         if ((o as ModulationTypeWrapper).modulation_type == modulation_type)
         {
             ModulationTypeComboBox.SelectedItem = o;
         }
     }
 }
Beispiel #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 public DVBSChannel()
 {
   SwitchingFrequency = 0;
   DisEqc = DisEqcType.SimpleA;
   _bandType = BandType.Universal;
   _satelliteIndex = -1;
   _modulation = ModulationType.ModQpsk;
   _innerFecRate = BinaryConvolutionCodeRate.RateNotSet;
   _pilot = Pilot.NotSet;
   _rollOff = RollOff.NotSet;
 }
Beispiel #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public DVBSChannel(DVBSChannel chan)
   : base(chan)
 {
   _polarisation = chan.Polarisation;
   _symbolRate = chan.SymbolRate;
   _switchingFrequency = chan.SwitchingFrequency;
   DisEqc = chan.DisEqc;
   _bandType = chan.BandType;
   _modulation = chan.ModulationType;
   _innerFecRate = chan.InnerFecRate;
   _pilot = chan.Pilot;
   _rollOff = chan.Rolloff;
   _satelliteIndex = chan.SatelliteIndex;
 }
Beispiel #39
0
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="p_Frequency">Frequency</param>
 /// <param name="p_ModulationType">ModulationType</param>
 /// <param name="p_SymbolRate">SymbolRate</param>
 public DVBCTuning(long p_Frequency, ModulationType p_ModulationType, int p_SymbolRate)
 {
   Frequency = p_Frequency;
   ModulationType = p_ModulationType;
   SymbolRate = p_SymbolRate;
 }
Beispiel #40
0
        private void LineupSelectionComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Device> channel_tuning_info_devices =
                ChannelEditing.GetLineupScannedDevicesByTuningInfoType(
                    SelectedLineup, ChannelEditing.TuningInfoType.ChannelTuningInfo);
            List <Device> dvb_devices =
                ChannelEditing.GetLineupScannedDevicesByTuningInfoType(
                    SelectedLineup, ChannelEditing.TuningInfoType.DvbTuningInfo);
            List <Device> dvblink_devices =
                ChannelEditing.GetLineupScannedDevicesByTuningInfoType(
                    SelectedLineup, ChannelEditing.TuningInfoType.DvbLink);

            bool supports_channeltuninginfo = channel_tuning_info_devices.Count != 0;
            bool supports_dvbtuning         = dvb_devices.Count != 0;
            bool has_dvblink = dvblink_devices.Count != 0;

            SetTabVisibility(ChannelTuningInfoPage, supports_channeltuninginfo);
            SetTabVisibility(DVBTuningInfoPage, supports_dvbtuning);
            SetTabVisibility(DVBLinkPage, has_dvblink);

            TunerSelectionListBox.Items.Clear();
            foreach (Device d in channel_tuning_info_devices)
            {
                TunerSelectionListBox.Items.Add(new DeviceWrapper(d));
            }
            for (int index = 0; index < channel_tuning_info_devices.Count; ++index)
            {
                TunerSelectionListBox.SetItemChecked(index, true);
            }

            DvbTunersCheckedListBox.Items.Clear();
            foreach (Device d in dvb_devices)
            {
                DvbTunersCheckedListBox.Items.Add(new DeviceWrapper(d));
            }
            for (int index = 0; index < dvb_devices.Count; ++index)
            {
                DvbTunersCheckedListBox.SetItemChecked(index, true);
            }

            DVBLinkTunerCheckedListBox.Items.Clear();
            foreach (Device d in dvblink_devices)
            {
                DVBLinkTunerCheckedListBox.Items.Add(new DeviceWrapper(d));
            }
            for (int index = 0; index < dvblink_devices.Count; ++index)
            {
                DVBLinkTunerCheckedListBox.SetItemChecked(index, true);
            }

            PopulateDvbCombos();

            // set modulation to match the first channel we find in the lineup.
            foreach (Channel ch in SelectedLineup.GetChannels())
            {
                if (ch.TuningInfos != null && !ch.TuningInfos.Empty)
                {
                    foreach (TuningInfo ti in ch.TuningInfos)
                    {
                        if (!(ti is ChannelTuningInfo))
                        {
                            continue;                             // DvbTuningInfos not handled!!!
                        }
                        ModulationType mod_type = ((ChannelTuningInfo)ti).ModulationType;
                        for (int index = 0; index < ModulationCombo.Items.Count; ++index)
                        {
                            if (((ModulationTypeWrapper)ModulationCombo.Items[index]).modulation_type == mod_type)
                            {
                                ModulationCombo.SelectedIndex = index;
                                break;
                            }
                        }
                        break;
                    }
                }
            }
        }
 public static string ModulationTypeName(ModulationType modulation_type)
 {
     return(modulation_type.ToString().Substring(8)); // skip the BDA_MOD_ part.
 }
Beispiel #42
0
        internal override bool SetDVBS2Parameters(TuningSpec tuningSpec, IBaseFilter tunerFilter, ITuneRequest tuneRequest)
        {
            if (!dvbs2Capable)
            {
                return(true);
            }

            IBDA_DigitalDemodulator demodulator = FindDemodulator("DigitalEverywhere", tunerFilter);

            if (demodulator == null)
            {
                Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Demodulator not located");
                return(false);
            }

            ModulationType modulationType = ModulationType.ModNotSet;

            switch (tuningSpec.Modulation)
            {
            case Modulation.QPSK:
                modulationType = ModulationType.ModNbcQpsk;
                break;

            case Modulation.PSK8:
                modulationType = ModulationType.ModNbc8Psk;
                break;

            default:
                break;
            }

            if (modulationType != ModulationType.ModNotSet)
            {
                reply = demodulator.put_ModulationType(ref modulationType);
                if (reply != 0)
                {
                    Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Set Modulation Type failed error code 0x" + reply.ToString("X"));
                    return(false);
                }
                else
                {
                    Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Modulation type changed to " + modulationType);
                }
            }
            else
            {
                Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Modulation type not changed");
            }

            BinaryConvolutionCodeRate oldCodeRate;

            reply = demodulator.get_InnerFECRate(out oldCodeRate);
            if (reply != 0)
            {
                Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Get FEC Rate failed error code 0x" + reply.ToString("X"));
                return(false);
            }

            SatelliteFrequency satelliteFrequency = tuningSpec.Frequency as SatelliteFrequency;

            BinaryConvolutionCodeRate newCodeRate = oldCodeRate;

            if (satelliteFrequency.Pilot == DomainObjects.Pilot.Off)
            {
                newCodeRate += 64;
            }
            else
            {
                if (satelliteFrequency.Pilot == DomainObjects.Pilot.On)
                {
                    newCodeRate += 128;
                }
            }

            switch (satelliteFrequency.RollOff)
            {
            case DomainObjects.RollOff.RollOff20:
                newCodeRate += 16;
                break;

            case DomainObjects.RollOff.RollOff25:
                newCodeRate += 32;
                break;

            case DomainObjects.RollOff.RollOff35:
                newCodeRate += 48;
                break;

            default:
                break;
            }

            if (oldCodeRate != newCodeRate)
            {
                reply = demodulator.put_InnerFECRate(newCodeRate);
                if (reply != 0)
                {
                    Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: Set FEC Rate failed error code 0x" + reply.ToString("X"));
                    return(false);
                }

                Logger.Instance.Write("DigitalEverywhere DVB-S2 handler: FEC Rate changed from " + oldCodeRate + " to " + newCodeRate);
            }

            return(true);
        }
 private void SelectMatchingModulationType(ModulationType modulation_type)
 {
     foreach (object o in ModulationListBox.Items)
     {
         if ((o as ModulationTypeWrapper).modulation_type == modulation_type)
         {
             ModulationListBox.SelectedItem = o;
             return;
         }
     }
 }
Beispiel #44
0
 public Modulation(int value, string caption)
 {
     Value = value;
       Caption = caption;
       Type = (ModulationType)value;
 }
        public static string GetTuningSpaceNameForModulation(ModulationType modulation_type)
        {
            switch (modulation_type)
            {
            case ModulationType.BDA_MOD_1024QAM:
            case ModulationType.BDA_MOD_112QAM:
            case ModulationType.BDA_MOD_128QAM:
            case ModulationType.BDA_MOD_160QAM:
            case ModulationType.BDA_MOD_16QAM:
            case ModulationType.BDA_MOD_192QAM:
            case ModulationType.BDA_MOD_224QAM:
            case ModulationType.BDA_MOD_256QAM:
            case ModulationType.BDA_MOD_320QAM:
            case ModulationType.BDA_MOD_32QAM:
            case ModulationType.BDA_MOD_384QAM:
            case ModulationType.BDA_MOD_448QAM:
            case ModulationType.BDA_MOD_512QAM:
            case ModulationType.BDA_MOD_640QAM:
            case ModulationType.BDA_MOD_64QAM:
            case ModulationType.BDA_MOD_768QAM:
            case ModulationType.BDA_MOD_80QAM:
            case ModulationType.BDA_MOD_896QAM:
            case ModulationType.BDA_MOD_96QAM:
                return("ClearQAM");

            case ModulationType.BDA_MOD_16APSK:
            case ModulationType.BDA_MOD_32APSK:
            case ModulationType.BDA_MOD_8PSK:
            case ModulationType.BDA_MOD_DIRECTV:
            case ModulationType.BDA_MOD_BPSK:
            case ModulationType.BDA_MOD_NBC_8PSK:
            case ModulationType.BDA_MOD_NBC_QPSK:
            case ModulationType.BDA_MOD_QPSK:
            case ModulationType.BDA_MOD_OQPSK:
                return("DVB-S");

            case ModulationType.BDA_MOD_16VSB:
                return("ATSCCable");

            case ModulationType.BDA_MOD_8VSB:
                return("ATSC");

            case ModulationType.BDA_MOD_ANALOG_AMPLITUDE:
                return("Antenna");

            case ModulationType.BDA_MOD_ANALOG_FREQUENCY:
                return("FM Radio");

            case ModulationType.BDA_MOD_ISDB_S_TMCC:
                return("ISDB-S");

            case ModulationType.BDA_MOD_ISDB_T_TMCC:
                return("ISDB-T");

            case ModulationType.BDA_MOD_RF:
                return("Cable");

            default:
                return(null);
            }
        }
Beispiel #46
0
        private void CreateChannelButton_Click(object sender, EventArgs e)
        {
            if (CallsignInput.Text.Length == 0)
            {
                MessageBox.Show("Callsign is required.");
                return;
            }
            Service new_channel_service = null;

            if (destination_merged_channel_ != null)
            {
                new_channel_service = destination_merged_channel_.Service;
            }
            else
            {
                if (ListingSelectionCombo.SelectedItem is Service)
                {
                    new_channel_service = ListingSelectionCombo.SelectedItem as Service;
                }
                else if (ListingSelectionCombo.SelectedItem is ChannelService)
                {
                    new_channel_service = (ListingSelectionCombo.SelectedItem as ChannelService).Service;
                }
            }

            Channel new_channel = null;

            if (ChannelTypeTabControl.SelectedTab == ChannelTuningInfoPage)
            {
                ModulationType mod_type = ((ModulationTypeWrapper)ModulationCombo.SelectedItem).modulation_type;

                try
                {
                    new_channel = ChannelEditing.AddUserChannelToLineupWithoutMerge(
                        SelectedLineup, CallsignInput.Text, (int)ChannelNumberInput.Value, (int)SubchannelInput.Value,
                        mod_type, new_channel_service, GetCheckedDevices());
                }
                catch (Exception exc)
                {
                    AddInputsToException(exc);
                    new ErrorReporter.ErrorReportingForm("Exception occured when trying to add the scanned channel.", exc);
                    return;
                }
            }
            else if (ChannelTypeTabControl.SelectedTab == DVBTuningInfoPage)
            {
                try
                {
                    new_channel = ChannelEditing.AddDvbUserChannelToLineupWithoutMerge(
                        SelectedLineup, CallsignInput.Text, (int)ChannelNumberInput.Value, (int)SubchannelInput.Value,
                        int.Parse(DvbONIDCombo.Text), int.Parse(DvbTSIDCombo.Text), int.Parse(DvbSIDCombo.Text),
                        int.Parse(DvbNIDCombo.Text), int.Parse(DvbFrequencyCombo.Text), (int)DvbLCNInput.Value,
                        new_channel_service, GetCheckedDevices());
                }
                catch (Exception exc)
                {
                    AddInputsToException(exc);
                    new ErrorReporter.ErrorReportingForm("Exception occured when trying to add the DVB scanned channel.", exc);
                    return;
                }
            }
            else if (ChannelTypeTabControl.SelectedTab == DVBLinkPage)
            {
                try
                {
                    int dvblink_channel_key = (int)DVBLinkChannelNumInput.Value;
                    int frequency           = dvblink_channel_key * 10000;
                    new_channel = ChannelEditing.AddDvbUserChannelToLineupWithoutMerge(
                        SelectedLineup, CallsignInput.Text, (int)ChannelNumberInput.Value, (int)SubchannelInput.Value,
                        dvblink_channel_key, dvblink_channel_key, dvblink_channel_key, dvblink_channel_key,
                        frequency, (int)DVBLinkLCNInput.Value, new_channel_service, GetCheckedDevices());
                }
                catch (Exception exc)
                {
                    AddInputsToException(exc);
                    new ErrorReporter.ErrorReportingForm("Exception occured when trying to add the DVBLink scanned channel.", exc);
                    return;
                }
            }

            try
            {
                MergedChannel updated_merged_channel = null;
                if (destination_merged_channel_ != null)
                {
                    ChannelEditing.AddScannedChannelToMergedChannel(new_channel, destination_merged_channel_, AddAsFirstRadio.Checked);
                    updated_merged_channel = destination_merged_channel_;
                }
                else if (CreateNewChannelCheckbox.Checked)
                {
                    updated_merged_channel = ChannelEditing.CreateMergedChannelFromChannels(new List <Channel>(new Channel[] { new_channel }),
                                                                                            (int)GuideNumberInput.Value, (int)GuideSubNumberInput.Value);
                }

                /* if (ChannelAdded != null)
                 * {
                 *  ChannelAddedEventArgs args = new ChannelAddedEventArgs(e, updated_merged_channel, new_channel);
                 *  ChannelAdded(sender, args);
                 * } */
                guide_channel_entered_ = false;
            }
            catch (Exception exc)
            {
                if (new_channel != null)
                {
                    exc.Data.Add("new_channel number", new_channel.Number);
                    exc.Data.Add("new_channel subnumber", new_channel.SubNumber);
                    if (new_channel.TuningInfos != null)
                    {
                        exc.Data.Add("new_channel tuninginfo count", new_channel.TuningInfos.Count());
                    }
                    else
                    {
                        exc.Data.Add("new_channel tuning infos", "NULL");
                    }
                }
                else
                {
                    exc.Data.Add("new_channel", "NULL");
                }
                AddInputsToException(exc);
                new ErrorReporter.ErrorReportingForm("Exception occured when trying to put the newly created scanned channel in a merged channel.", exc);
                return;
            }
        }
        private void DecodeModulationMode(byte[] section, int endOfSection, ref int pointer, ref byte firstIndex, AtscTransmissionMedium transmissionMedium)
        {
            if (pointer + 6 > endOfSection)
            {
                throw new Exception(string.Format("NIT: corruption detected at modulation mode, pointer = {0}, end of section = {1}", pointer, endOfSection));
            }
            TransmissionSystem        transmissionSystem = (TransmissionSystem)(section[pointer] >> 4);
            BinaryConvolutionCodeRate innerCodingMode    = BinaryConvolutionCodeRate.RateNotDefined;

            switch (section[pointer] & 0x0f)
            {
            case 0:
                innerCodingMode = BinaryConvolutionCodeRate.Rate5_11;
                break;

            case 1:
                innerCodingMode = BinaryConvolutionCodeRate.Rate1_2;
                break;

            case 3:
                innerCodingMode = BinaryConvolutionCodeRate.Rate3_5;
                break;

            case 5:
                innerCodingMode = BinaryConvolutionCodeRate.Rate2_3;
                break;

            case 7:
                innerCodingMode = BinaryConvolutionCodeRate.Rate3_4;
                break;

            case 8:
                innerCodingMode = BinaryConvolutionCodeRate.Rate4_5;
                break;

            case 9:
                innerCodingMode = BinaryConvolutionCodeRate.Rate5_6;
                break;

            case 11:
                innerCodingMode = BinaryConvolutionCodeRate.Rate7_8;
                break;

            case 15:
                // concatenated coding not used
                innerCodingMode = BinaryConvolutionCodeRate.RateNotSet;
                break;
            }
            pointer++;

            bool           isSplitBitstreamMode = ((section[pointer] & 0x80) != 0);
            ModulationType modulationFormat     = ModulationType.ModNotSet;

            switch (section[pointer] & 0x1f)
            {
            case 1:
                modulationFormat = ModulationType.ModQpsk;
                break;

            case 2:
                modulationFormat = ModulationType.ModBpsk;
                break;

            case 3:
                modulationFormat = ModulationType.ModOqpsk;
                break;

            case 4:
                modulationFormat = ModulationType.Mod8Vsb;
                break;

            case 5:
                modulationFormat = ModulationType.Mod16Vsb;
                break;

            case 6:
                modulationFormat = ModulationType.Mod16Qam;
                break;

            case 7:
                modulationFormat = ModulationType.Mod32Qam;
                break;

            case 8:
                modulationFormat = ModulationType.Mod64Qam;
                break;

            case 9:
                modulationFormat = ModulationType.Mod80Qam;
                break;

            case 10:
                modulationFormat = ModulationType.Mod96Qam;
                break;

            case 11:
                modulationFormat = ModulationType.Mod112Qam;
                break;

            case 12:
                modulationFormat = ModulationType.Mod128Qam;
                break;

            case 13:
                modulationFormat = ModulationType.Mod160Qam;
                break;

            case 14:
                modulationFormat = ModulationType.Mod192Qam;
                break;

            case 15:
                modulationFormat = ModulationType.Mod224Qam;
                break;

            case 16:
                modulationFormat = ModulationType.Mod256Qam;
                break;

            case 17:
                modulationFormat = ModulationType.Mod320Qam;
                break;

            case 18:
                modulationFormat = ModulationType.Mod384Qam;
                break;

            case 19:
                modulationFormat = ModulationType.Mod448Qam;
                break;

            case 20:
                modulationFormat = ModulationType.Mod512Qam;
                break;

            case 21:
                modulationFormat = ModulationType.Mod640Qam;
                break;

            case 22:
                modulationFormat = ModulationType.Mod768Qam;
                break;

            case 23:
                modulationFormat = ModulationType.Mod896Qam;
                break;

            case 24:
                modulationFormat = ModulationType.Mod1024Qam;
                break;
            }
            pointer++;

            // s/s
            int symbolRate = ((section[pointer] & 0x0f) << 24) + (section[pointer + 1] << 16) + (section[pointer + 2] << 8) + section[pointer + 3];

            pointer += 4;
            Log.Log.Debug("NIT: modulation mode, transmission system = {0}, inner coding mode = {1}, is split bitstream mode = {2}, modulation format = {3}, symbol rate = {4} s/s",
                          transmissionSystem, innerCodingMode, isSplitBitstreamMode, modulationFormat, symbolRate);

            if (OnModulationMode != null)
            {
                OnModulationMode(transmissionMedium, firstIndex++, transmissionSystem, innerCodingMode, isSplitBitstreamMode, modulationFormat, symbolRate);
            }
        }
        public static void AddUserChannelInLineup(Lineup lineup, string callsign, int channel_number, int subchannel, ModulationType modulation_type)
        {
            List <ChannelTuningInfo> tuning_infos = new List <ChannelTuningInfo>();

            foreach (Device device in lineup.ScanDevices)
            {
                string old_tuningspace_name = device.DeviceType.TuningSpaceName;
                if (string.IsNullOrEmpty(old_tuningspace_name))
                {
                    // hacky.  For now I'm just trying to get it to work with ClearQAM.  Ultimately I guess this would be a case
                    // statement picking a value based on modulation_type.  Why is it null for all my devices currently?
                    string temp_tuningspace_name = GetTuningSpaceNameForModulation(modulation_type);
                    // What really seems to matter looking at
                    // ChannelTuningInfo(Device device, SerializationFormat format, byte[] serializedTuneRequest, TuneRequest tr) : base(device, format, serializedTuneRequest, tr)
                    // in .NET Reflector is whether the tuning space has subnumbers or not.  So if we can't figure out
                    // what TuningSpace makes sense, pick one based on if subchannel is 0.
                    if (string.IsNullOrEmpty(temp_tuningspace_name))
                    {
                        temp_tuningspace_name = ((subchannel != 0) ? "ClearQAM" : "Cable");
                    }
                    device.DeviceType.TuningSpaceName = temp_tuningspace_name;
                }
                try
                {
                    ChannelTuningInfo channel_tuning_info = new ChannelTuningInfo(device, channel_number, subchannel, modulation_type);
                    tuning_infos.Add(channel_tuning_info);
                }
                finally
                {
                    device.DeviceType.TuningSpaceName = old_tuningspace_name;
                }
            }
            Channel ch = new Channel();

            ch.CallSign    = callsign;
            ch.ChannelType = ChannelType.UserAdded;
            ch.Number      = channel_number;
            ch.SubNumber   = subchannel;
            lineup.AddChannel(ch);
            foreach (ChannelTuningInfo channel_tuning_info in tuning_infos)
            {
                ch.TuningInfos.Add(channel_tuning_info);
            }
            ch.Update();
            MergedChannel merged_channel = new MergedChannel();

            merged_channel.Number      = channel_number;
            merged_channel.SubNumber   = subchannel;
            merged_channel.CallSign    = callsign;
            merged_channel.ChannelType = ChannelType.UserAdded;
            merged_channel.FullMerge(ch);
            MergedLineup merged_lineup = (lineup.PrimaryProvider != null) ? lineup.PrimaryProvider : lineup.SecondaryProvider;

            if (merged_lineup == null)
            {
                merged_lineup = new MergedLineups(lineup.ObjectStore).First;
            }
            List <Channel> new_channels_list = new List <Channel>();

            new_channels_list.Add(ch);
            bool old_keepAllPrimary   = merged_lineup.LineupMergeRule.KeepAllPrimary;
            bool old_keepAllSecondary = merged_lineup.LineupMergeRule.KeepAllSecondary;

            merged_lineup.LineupMergeRule.KeepAllPrimary   = true;
            merged_lineup.LineupMergeRule.KeepAllSecondary = true;
            try
            {
                lineup.NotifyChannelAdded(ch);
//                merged_lineup.OnChannelsAdded(lineup, new_channels_list);
            }
            finally
            {
                merged_lineup.LineupMergeRule.KeepAllPrimary   = old_keepAllPrimary;
                merged_lineup.LineupMergeRule.KeepAllSecondary = old_keepAllSecondary;
            }
        }