Beispiel #1
0
        /// <summary>
        /// Save limit line data to a RFL file, substracting the offset if defined
        /// </summary>
        /// <param name="sFilename"></param>
        public void SaveFile(string sFilename)
        {
            if (Count < 2)
            {
                return;
            }

            using (StreamWriter myFile = new StreamWriter(sFilename, true))
            {
                myFile.WriteLine(FileHeaderVersioned());
                myFile.WriteLine("--RF Explorer Limit Lines data file version 01");
                myFile.WriteLine("--Sample points: " + Count);
                myFile.WriteLine("--Generated " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString());

                foreach (PointPair objPoint in this)
                {
                    string sVal = objPoint.X.ToString("f3") + "\t" + RFECommunicator.ConvertAmplitude(m_eUnits, (objPoint.Y - m_dLastOffset), RFECommunicator.eAmplitudeUnit.dBm).ToString("f1");
                    myFile.WriteLine(sVal);
                }

                myFile.WriteLine("--EOF");
            }
        }