コード例 #1
0
ファイル: Pro2Calc.cs プロジェクト: x893/WDS
 private bool GenerateInputFile(string path, out string input)
 {
     bool flag = false;
     input = "";
     input = new EmbeddedResource("NewWDS.Applications.App_Si4460.App_Si4460_Resource", "input_template").GetText();
     if (input.Length > 0)
     {
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.CrystalFrequency.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.CrystalTolerance.ToString("0.#", CultureInfo.CreateSpecificCulture("en-US")));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.IntermediateFrequencyMode.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.HighPerformanceChannelFilter.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.OversamplingRateTune.ToString("0.#", CultureInfo.CreateSpecificCulture("en-US")));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.ChannelFilterAutoFrequencyControl.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.AntennaDiversity).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.PreamblePattern.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.ModulationType.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.SymbolRate.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.FrequencyDeviation.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.OOK_Bandwidth.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.Manchester).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.AutoFrequencyControl).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", "0." + this.Input.SymbolRateError.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.ChipVersion.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", (((double) this.Input.RF_Frequency) / 1000000.0).ToString("0.#####", CultureInfo.CreateSpecificCulture("en-US")));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.RampingTime.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.FrequencyHoppingChannelSpacing.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.InputRxBandwidth).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.BitErrorRateTest).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.RawDataOutput).ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", this.Input.DataSource.ToString("D"));
         input = ReplaceFirstOccurrence(input, "<VALUE>", Convert.ToInt32(this.Input.HighPerformanceDividerMode).ToString("D"));
         try
         {
             File.WriteAllText(path, input);
             flag = true;
         }
         catch (Exception exception)
         {
             exception.ToString();
         }
     }
     return flag;
 }
コード例 #2
0
ファイル: Pro2Calc.cs プロジェクト: x893/WDS
 private bool ExtractCalculator(string path)
 {
     bool flag = false;
     if (File.Exists(path))
     {
         return true;
     }
     EmbeddedResource resource = new EmbeddedResource("NewWDS.Applications.App_Si4460.App_Si4460_Resource", this.Input.IqCalibrationNeeded ? "pro2_calc_IQcal" : "Pro2_calc");
     if (resource.ExtractToFile(path))
     {
         flag = true;
     }
     return flag;
 }