/// <summary> /// Initialize a new instance of the TuningSpec class for a DVB satellite frequency. /// </summary> /// <param name="satellite">The satellite to tune to.</param> /// <param name="frequency">The frequency to tune to.</param> public TuningSpec(Satellite satellite, SatelliteFrequency frequency) { this.frequency = frequency; this.satellite = satellite; symbolRate = frequency.SymbolRate; fec = frequency.FEC; signalPolarization = frequency.Polarization; modulation = frequency.Modulation; }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static CableProvider FindProvider(int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { foreach (CableProvider provider in Providers) { foreach (CableFrequency cableFrequency in provider.Frequencies) { if (cableFrequency.Frequency == frequency && cableFrequency.SymbolRate == symbolRate && cableFrequency.FEC.Rate == fecRate.Rate && cableFrequency.Modulation == modulation) { return(provider); } } } return(null); }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="polarization">The polarization of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static Satellite FindProvider(int frequency, int symbolRate, FECRate fecRate, SignalPolarization polarization) { foreach (Satellite provider in Providers) { foreach (SatelliteFrequency satelliteFrequency in provider.Frequencies) { if (provider.Longitude == 1600) { int count = 0; count++; } if (satelliteFrequency.Frequency == frequency && satelliteFrequency.SymbolRate == symbolRate && satelliteFrequency.FEC.Rate == fecRate.Rate && satelliteFrequency.Polarization.Polarization == polarization.Polarization) return (provider); } } return (null); }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="channelNumber">The channel number of the provider.</param> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static AtscProvider FindProvider(int channelNumber, int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { if (fecRate == null) throw (new ArgumentException("The FEC rate cannot be null", "fecRate")); foreach (AtscProvider provider in Providers) { foreach (AtscFrequency atscFrequency in provider.Frequencies) { if (atscFrequency.ChannelNumber == channelNumber && atscFrequency.Frequency == frequency && atscFrequency.SymbolRate == symbolRate && atscFrequency.FEC.Rate == fecRate.Rate && atscFrequency.Modulation == modulation) return (provider); } } return (null); }
private int processSatelliteFrequency(string[] parameters) { if (parameters.Length != 5 && parameters.Length != 8) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } try { int frequency = Int32.Parse(parameters[0].Trim()); int symbolRate = Int32.Parse(parameters[1].Trim()); FECRate fecRate = new FECRate(parameters[2]); SignalPolarization polarization = new SignalPolarization(parameters[3].Trim()[0]); Pilot pilot = Pilot.NotSet; RollOff rollOff = RollOff.NotSet; Modulation modulation = Modulation.QPSK; int nextParameter = 4; if (parameters.Length == 8) { pilot = (Pilot)Enum.Parse(typeof(Pilot), parameters[4]); rollOff = (RollOff)Enum.Parse(typeof(RollOff), parameters[5]); modulation = (Modulation)Enum.Parse(typeof(Modulation), parameters[6]); nextParameter = 7; } if (currentFrequency == null) currentFrequency = new SatelliteFrequency(); SatelliteFrequency satelliteFrequency = currentFrequency as SatelliteFrequency; satelliteFrequency.Frequency = frequency; satelliteFrequency.SymbolRate = symbolRate; satelliteFrequency.FEC = fecRate; satelliteFrequency.Polarization = polarization; satelliteFrequency.Pilot = pilot; satelliteFrequency.RollOff = rollOff; satelliteFrequency.Modulation = modulation; int errorCode = getCollectionType(parameters[nextParameter].Trim().ToUpperInvariant(), satelliteFrequency); if (errorCode != errorCodeNoError) return (errorCode); satelliteFrequency.SatelliteDish = currentDish; if (currentFrequency.Provider == null) currentFrequency.Provider = currentSatellite; TuningFrequency.FrequencyCollection.Add(satelliteFrequency); } catch (FormatException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } catch (ArithmeticException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } return (errorCodeNoError); }
private int processISDBSatelliteFrequency(string[] parameters) { if (parameters.Length != 5) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } try { int frequency = Int32.Parse(parameters[0].Trim()); int symbolRate = Int32.Parse(parameters[1].Trim()); FECRate fecRate = new FECRate(parameters[2]); SignalPolarization polarization = new SignalPolarization(parameters[3].Trim()[0]); if (currentFrequency == null) currentFrequency = new ISDBSatelliteFrequency(); ISDBSatelliteFrequency satelliteFrequency = currentFrequency as ISDBSatelliteFrequency; satelliteFrequency.Frequency = frequency; satelliteFrequency.SymbolRate = symbolRate; satelliteFrequency.FEC = fecRate; satelliteFrequency.Polarization = polarization; int errorCode = getCollectionType(parameters[4].Trim().ToUpperInvariant(), satelliteFrequency); if (errorCode != errorCodeNoError) return (errorCode); satelliteFrequency.SatelliteDish = currentDish; if (currentFrequency.Provider == null) currentFrequency.Provider = currentSatellite; TuningFrequency.FrequencyCollection.Add(satelliteFrequency); } catch (FormatException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } catch (ArithmeticException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } return (errorCodeNoError); }
internal void load(XmlReader reader) { switch (reader.Name) { case "ChannelNumber": ChannelNumber = Int32.Parse(reader.ReadString(), CultureInfo.InvariantCulture); break; case "CarrierFrequency": Frequency = Int32.Parse(reader.ReadString(), CultureInfo.InvariantCulture); break; case "SymbolRate": symbolRate = Int32.Parse(reader.ReadString(), CultureInfo.InvariantCulture); break; case "Modulation": switch (reader.ReadString()) { case "BPSK": modulation = Modulation.BPSK; break; case "OQPSK": modulation = Modulation.OQPSK; break; case "PSK8": modulation = Modulation.PSK8; break; case "QAM1024": modulation = Modulation.QAM1024; break; case "QAM112": modulation = Modulation.QAM112; break; case "QAM128": modulation = Modulation.QAM128; break; case "QAM16": modulation = Modulation.QAM16; break; case "QAM160": modulation = Modulation.QAM160; break; case "QAM192": modulation = Modulation.QAM192; break; case "QAM224": modulation = Modulation.QAM224; break; case "QAM256": modulation = Modulation.QAM256; break; case "QAM32": modulation = Modulation.QAM32; break; case "QAM320": modulation = Modulation.QAM320; break; case "QAM384": modulation = Modulation.QAM384; break; case "QAM448": modulation = Modulation.QAM448; break; case "QAM512": modulation = Modulation.QAM512; break; case "QAM64": modulation = Modulation.QAM64; break; case "QAM640": modulation = Modulation.QAM640; break; case "QAM768": modulation = Modulation.QAM768; break; case "QAM80": modulation = Modulation.QAM80; break; case "QAM896": modulation = Modulation.QAM896; break; case "QAM96": modulation = Modulation.QAM96; break; case "QPSK": modulation = Modulation.QPSK; break; case "VSB16": modulation = Modulation.VSB16; break; case "VSB8": modulation = Modulation.VSB8; break; } break; case "InnerFecRate": switch (reader.ReadString()) { case "Rate1_2": fec = new FECRate(FECRate.FECRate12); break; case "Rate1_3": fec = new FECRate(FECRate.FECRate13); break; case "Rate1_4": fec = new FECRate(FECRate.FECRate14); break; case "Rate2_3": fec = new FECRate(FECRate.FECRate23); break; case "Rate2_5": fec = new FECRate(FECRate.FECRate25); break; case "Rate3_4": fec = new FECRate(FECRate.FECRate34); break; case "Rate3_5": fec = new FECRate(FECRate.FECRate35); break; case "Rate4_5": fec = new FECRate(FECRate.FECRate45); break; case "Rate5_11": fec = new FECRate(FECRate.FECRate511); break; case "Rate5_6": fec = new FECRate(FECRate.FECRate56); break; case "Rate6_7": fec = new FECRate(FECRate.FECRate67); break; case "Rate7_8": fec = new FECRate(FECRate.FECRate78); break; case "Rate8_9": fec = new FECRate(FECRate.FECRate89); break; case "Rate9_10": fec = new FECRate(FECRate.FECRate910); break; } break; case "CollectionType": switch (reader.ReadString()) { case "EIT": CollectionType = CollectionType.EIT; break; case "MHEG5": CollectionType = CollectionType.MHEG5; break; case "OPENTV": CollectionType = CollectionType.OpenTV; break; case "MHW1": CollectionType = CollectionType.MediaHighway1; break; case "MHW2": CollectionType = CollectionType.MediaHighway2; break; case "FREESAT": CollectionType = CollectionType.FreeSat; break; case "PSIP": CollectionType = CollectionType.PSIP; break; case "DISHNETWORK": CollectionType = CollectionType.DishNetwork; break; case "BELLTV": CollectionType = CollectionType.BellTV; break; case "SIEHFERNINFO": CollectionType = CollectionType.SiehfernInfo; break; } break; default: break; } }
internal void load(XmlReader reader) { switch (reader.Name) { case "CarrierFrequency": Frequency = Int32.Parse(reader.ReadString()); break; case "Polarisation": switch (reader.ReadString()) { case "CircularL": polarization = new SignalPolarization(SignalPolarization.CircularLeft); break; case "CircularR": polarization = new SignalPolarization(SignalPolarization.CircularRight); break; case "LinearH": polarization = new SignalPolarization(SignalPolarization.LinearHorizontal); break; case "LinearV": polarization = new SignalPolarization(SignalPolarization.LinearVertical); break; } break; case "SymbolRate": symbolRate = Int32.Parse(reader.ReadString()); break; case "InnerFecRate": switch (reader.ReadString()) { case "Rate1_2": fec = new FECRate(FECRate.FECRate12); break; case "Rate1_3": fec = new FECRate(FECRate.FECRate13); break; case "Rate1_4": fec = new FECRate(FECRate.FECRate14); break; case "Rate2_3": fec = new FECRate(FECRate.FECRate23); break; case "Rate2_5": fec = new FECRate(FECRate.FECRate25); break; case "Rate3_4": fec = new FECRate(FECRate.FECRate34); break; case "Rate3_5": fec = new FECRate(FECRate.FECRate35); break; case "Rate4_5": fec = new FECRate(FECRate.FECRate45); break; case "Rate5_11": fec = new FECRate(FECRate.FECRate511); break; case "Rate5_6": fec = new FECRate(FECRate.FECRate56); break; case "Rate6_7": fec = new FECRate(FECRate.FECRate67); break; case "Rate7_8": fec = new FECRate(FECRate.FECRate78); break; case "Rate8_9": fec = new FECRate(FECRate.FECRate89); break; case "Rate9_10": fec = new FECRate(FECRate.FECRate910); break; } break; case "CollectionType": switch (reader.ReadString()) { case "EIT": CollectionType = CollectionType.EIT; break; case "MHEG5": CollectionType = CollectionType.MHEG5; break; case "OPENTV": CollectionType = CollectionType.OpenTV; break; case "MHW1": CollectionType = CollectionType.MediaHighway1; break; case "MHW2": CollectionType = CollectionType.MediaHighway2; break; case "FREESAT": CollectionType = CollectionType.FreeSat; break; case "PSIP": CollectionType = CollectionType.PSIP; break; case "DISHNETWORK": CollectionType = CollectionType.DishNetwork; break; case "BELLTV": CollectionType = CollectionType.BellTV; break; case "SIEHFERNINFO": CollectionType = CollectionType.SiehfernInfo; break; } break; case "Pilot": switch (reader.ReadString()) { case "NotSet": pilot = Pilot.NotSet; break; case "NotDefined": pilot = Pilot.NotDefined; break; case "On": pilot = Pilot.On; break; case "Off": pilot = Pilot.Off; break; default: pilot = Pilot.NotSet; break; } break; case "Rolloff": switch (reader.ReadString()) { case "NotSet": rollOff = RollOff.NotSet; break; case "NotDefined": rollOff = RollOff.NotDefined; break; case "Twenty": rollOff = RollOff.RollOff20; break; case "TwentyFive": rollOff = RollOff.RollOff25; break; case "ThirtyFive": rollOff = RollOff.RollOff35; break; default: rollOff = RollOff.NotSet; break; } break; case "Modulation": switch (reader.ReadString()) { case "ModBPSK": modulation = Modulation.BPSK; break; case "ModOQPSK": modulation = Modulation.OQPSK; break; case "Mod8Psk": modulation = Modulation.PSK8; break; case "Mod1024Qam": modulation = Modulation.QAM1024; break; case "Mod112Qam": modulation = Modulation.QAM112; break; case "Mod128Qam": modulation = Modulation.QAM128; break; case "Mod16Qam": modulation = Modulation.QAM16; break; case "Mod160Qam": modulation = Modulation.QAM160; break; case "Mod192Qam": modulation = Modulation.QAM192; break; case "Mod224Qam": modulation = Modulation.QAM224; break; case "Mod256Qam": modulation = Modulation.QAM256; break; case "Mod32Qam": modulation = Modulation.QAM32; break; case "Mod320Qam": modulation = Modulation.QAM320; break; case "Mod384Qam": modulation = Modulation.QAM384; break; case "Mod448Qam": modulation = Modulation.QAM448; break; case "Mod512Qam": modulation = Modulation.QAM512; break; case "Mod64Qam": modulation = Modulation.QAM64; break; case "Mod640Qam": modulation = Modulation.QAM640; break; case "Mod768Qam": modulation = Modulation.QAM768; break; case "Mod80Qam": modulation = Modulation.QAM80; break; case "Mod896Qam": modulation = Modulation.QAM896; break; case "Mod96Qam": modulation = Modulation.QAM96; break; case "ModQPSK": modulation = Modulation.QPSK; break; } break; case "OpenTVCode": OpenTVCode = reader.ReadString(); break; default: break; } }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="polarization">The polarization of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static ISDBSatelliteProvider FindProvider(int frequency, int symbolRate, FECRate fecRate, SignalPolarization polarization) { foreach (ISDBSatelliteProvider provider in Providers) { foreach (ISDBSatelliteFrequency satelliteFrequency in provider.Frequencies) { if (provider.Longitude == 1600) { int count = 0; count++; } if (satelliteFrequency.Frequency == frequency && satelliteFrequency.SymbolRate == symbolRate && satelliteFrequency.FEC.Rate == fecRate.Rate && satelliteFrequency.Polarization.Polarization == polarization.Polarization) { return(provider); } } } return(null); }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static CableProvider FindProvider(int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { foreach (CableProvider provider in Providers) { foreach (CableFrequency cableFrequency in provider.Frequencies) { if (cableFrequency.Frequency == frequency && cableFrequency.SymbolRate == symbolRate && cableFrequency.FEC.Rate == fecRate.Rate && cableFrequency.Modulation == modulation) return (provider); } } return (null); }
internal void load(XmlReader reader) { switch (reader.Name) { case "CarrierFrequency": Frequency = Int32.Parse(reader.ReadString()); break; case "Polarisation": switch (reader.ReadString()) { case "CircularL": polarization = new SignalPolarization(SignalPolarization.CircularLeft); break; case "CircularR": polarization = new SignalPolarization(SignalPolarization.CircularRight); break; case "LinearH": polarization = new SignalPolarization(SignalPolarization.LinearHorizontal); break; case "LinearV": polarization = new SignalPolarization(SignalPolarization.LinearVertical); break; } break; case "SymbolRate": symbolRate = Int32.Parse(reader.ReadString()); break; case "InnerFecRate": switch (reader.ReadString()) { case "Rate1_2": fec = new FECRate(FECRate.FECRate12); break; case "Rate1_3": fec = new FECRate(FECRate.FECRate13); break; case "Rate1_4": fec = new FECRate(FECRate.FECRate14); break; case "Rate2_3": fec = new FECRate(FECRate.FECRate23); break; case "Rate2_5": fec = new FECRate(FECRate.FECRate25); break; case "Rate3_4": fec = new FECRate(FECRate.FECRate34); break; case "Rate3_5": fec = new FECRate(FECRate.FECRate35); break; case "Rate4_5": fec = new FECRate(FECRate.FECRate45); break; case "Rate5_11": fec = new FECRate(FECRate.FECRate511); break; case "Rate5_6": fec = new FECRate(FECRate.FECRate56); break; case "Rate6_7": fec = new FECRate(FECRate.FECRate67); break; case "Rate7_8": fec = new FECRate(FECRate.FECRate78); break; case "Rate8_9": fec = new FECRate(FECRate.FECRate89); break; case "Rate9_10": fec = new FECRate(FECRate.FECRate910); break; } break; case "CollectionType": switch (reader.ReadString()) { case "EIT": CollectionType = CollectionType.EIT; break; case "MHEG5": CollectionType = CollectionType.MHEG5; break; case "OPENTV": CollectionType = CollectionType.OpenTV; break; case "MHW1": CollectionType = CollectionType.MediaHighway1; break; case "MHW2": CollectionType = CollectionType.MediaHighway2; break; case "FREESAT": CollectionType = CollectionType.FreeSat; break; case "PSIP": CollectionType = CollectionType.PSIP; break; case "DISHNETWORK": CollectionType = CollectionType.DishNetwork; break; case "BELLTV": CollectionType = CollectionType.BellTV; break; case "SIEHFERNINFO": CollectionType = CollectionType.SiehfernInfo; break; } break; case "OpenTVCode": OpenTVCode = reader.ReadString(); break; default: break; } }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="channelNumber">The channel number of the provider.</param> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static AtscProvider FindProvider(int channelNumber, int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { if (fecRate == null) { throw (new ArgumentException("The FEC rate cannot be null", "fecRate")); } foreach (AtscProvider provider in Providers) { foreach (AtscFrequency atscFrequency in provider.Frequencies) { if (atscFrequency.ChannelNumber == channelNumber && atscFrequency.Frequency == frequency && atscFrequency.SymbolRate == symbolRate && atscFrequency.FEC.Rate == fecRate.Rate && atscFrequency.Modulation == modulation) { return(provider); } } } return(null); }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="channelNumber">The channel number of the provider.</param> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static ClearQamProvider FindProvider(int channelNumber, int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { foreach (ClearQamProvider provider in Providers) { foreach (ClearQamFrequency atscFrequency in provider.Frequencies) { if (atscFrequency.ChannelNumber == channelNumber && atscFrequency.Frequency == frequency && atscFrequency.SymbolRate == symbolRate && atscFrequency.FEC.Rate == fecRate.Rate && atscFrequency.Modulation == modulation) return (provider); } } return (null); }
/// <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; }
/// <summary> /// Find a provider given the broadcast parameters. /// </summary> /// <param name="channelNumber">The channel number of the provider.</param> /// <param name="frequency">The frequency of the provider.</param> /// <param name="symbolRate">The symbol rate of the provider.</param> /// <param name="fecRate">The FEC rate of the provider.</param> /// <param name="modulation">The modulation of the provider.</param> /// <returns>The provider or null if it cannot be located.</returns> public static ClearQamProvider FindProvider(int channelNumber, int frequency, int symbolRate, FECRate fecRate, Modulation modulation) { foreach (ClearQamProvider provider in Providers) { foreach (ClearQamFrequency atscFrequency in provider.Frequencies) { if (atscFrequency.ChannelNumber == channelNumber && atscFrequency.Frequency == frequency && atscFrequency.SymbolRate == symbolRate && atscFrequency.FEC.Rate == fecRate.Rate && atscFrequency.Modulation == modulation) { return(provider); } } } return(null); }
/// <summary> /// Initialize a new instance of the TuningSpec class for a DVB cable frequency. /// </summary> /// <param name="frequency">The frequency to tune to.</param> public TuningSpec(CableFrequency frequency) { this.frequency = frequency; symbolRate = frequency.SymbolRate; fec = frequency.FEC; modulation = frequency.Modulation; }
private int processCableFrequency(string[] parameters) { if (parameters.Length != 5) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } try { int frequency = Int32.Parse(parameters[0].Trim()); int symbolRate = Int32.Parse(parameters[1].Trim()); FECRate fecRate = new FECRate(parameters[2]); Modulation modulation = (Modulation)Enum.Parse(typeof(Modulation), parameters[3].ToUpperInvariant(), true); if (currentFrequency == null) { currentFrequency = new CableFrequency(); currentFrequency.Provider = CableProvider.FindProvider(frequency, symbolRate, fecRate, modulation); if (currentFrequency.Provider == null) currentFrequency.Provider = new CableProvider("Unknown"); } CableFrequency cableFrequency = currentFrequency as CableFrequency; cableFrequency.Frequency = frequency; cableFrequency.SymbolRate = symbolRate; cableFrequency.FEC = fecRate; cableFrequency.Modulation = modulation; int errorCode = getCollectionType(parameters[4].Trim().ToUpperInvariant(), cableFrequency); if (errorCode != errorCodeNoError) return (errorCode); TuningFrequency.FrequencyCollection.Add(cableFrequency); } catch (FormatException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } catch (ArithmeticException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } return (errorCodeNoError); }
private int processClearQamFrequency(string[] parameters) { if (parameters.Length != 6) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } try { int frequency = Int32.Parse(parameters[0].Trim()); int channelNumber = Int32.Parse(parameters[1].Trim()); int symbolRate = Int32.Parse(parameters[2].Trim()); FECRate fecRate = new FECRate(parameters[3]); Modulation modulation = (Modulation)Enum.Parse(typeof(Modulation), parameters[4].ToUpperInvariant(), true); ClearQamFrequency clearQamFrequency = currentFrequency as ClearQamFrequency; clearQamFrequency.Frequency = frequency; clearQamFrequency.ChannelNumber = channelNumber; clearQamFrequency.SymbolRate = symbolRate; clearQamFrequency.FEC = fecRate; clearQamFrequency.Modulation = modulation; int errorCode = getCollectionType(parameters[5].Trim().ToUpperInvariant(), clearQamFrequency); if (errorCode != errorCodeNoError) return (errorCode); TuningFrequency.FrequencyCollection.Add(clearQamFrequency); } catch (FormatException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } catch (ArithmeticException) { Logger.Instance.Write("INI file format error: A Frequency line is wrong."); return (errorCodeFormatError); } return (errorCodeNoError); }