Ejemplo n.º 1
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            ClearQamFrequency newFrequency = new ClearQamFrequency();

            base.Clone(newFrequency);

            newFrequency.ChannelNumber = channelNumber;
            newFrequency.SymbolRate    = symbolRate;
            newFrequency.FEC           = fec;
            newFrequency.SymbolRate    = symbolRate;
            newFrequency.Modulation    = modulation;

            return(newFrequency);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initialize a new instance of the TuningSpec class for a Clear QAM frequency.
 /// </summary>
 /// <param name="frequency">The frequency to tune to.</param>
 public TuningSpec(ClearQamFrequency frequency)
 {
     this.frequency = frequency;
     symbolRate = frequency.SymbolRate;
     fec = frequency.FEC;
     modulation = frequency.Modulation;
     channelNumber = frequency.ChannelNumber;
 }
Ejemplo n.º 3
0
        internal void load(FileInfo fileInfo)
        {
            ClearQamFrequency clearQamFrequency = null;
            XmlReader reader = null;

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);
            }
            catch (IOException)
            {
                Logger.Instance.Write("Failed to open " + fileInfo.Name);
                return;
            }

            try
            {
                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                            case "Channel":
                                if (clearQamFrequency != null)
                                    AddFrequency(clearQamFrequency);

                                clearQamFrequency = new ClearQamFrequency();
                                clearQamFrequency.Provider = this;

                                break;
                            default:
                                if (clearQamFrequency != null)
                                    clearQamFrequency.load(reader);
                                break;
                        }
                    }
                }

                if (clearQamFrequency != null)
                    AddFrequency(clearQamFrequency);
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }

            if (reader != null)
                reader.Close();
        }
Ejemplo n.º 4
0
        internal void load(FileInfo fileInfo)
        {
            ClearQamFrequency clearQamFrequency = null;
            XmlReader         reader            = null;

            XmlReaderSettings settings = new XmlReaderSettings();

            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);
            }
            catch (IOException)
            {
                Logger.Instance.Write("Failed to open " + fileInfo.Name);
                return;
            }

            try
            {
                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                        case "Channel":
                            if (clearQamFrequency != null)
                            {
                                AddFrequency(clearQamFrequency);
                            }

                            clearQamFrequency          = new ClearQamFrequency();
                            clearQamFrequency.Provider = this;

                            break;

                        default:
                            if (clearQamFrequency != null)
                            {
                                clearQamFrequency.load(reader);
                            }
                            break;
                        }
                    }
                }

                if (clearQamFrequency != null)
                {
                    AddFrequency(clearQamFrequency);
                }
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }

            if (reader != null)
            {
                reader.Close();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            ClearQamFrequency newFrequency = new ClearQamFrequency();
            base.Clone(newFrequency);

            newFrequency.ChannelNumber = channelNumber;
            newFrequency.SymbolRate = symbolRate;
            newFrequency.FEC = fec;
            newFrequency.SymbolRate = symbolRate;
            newFrequency.Modulation = modulation;

            return (newFrequency);
        }