Ejemplo n.º 1
0
        // Static Methods

        /// <summary>
        /// Exports the given <see cref="CycleDataSet"/> to a CSV file.
        /// </summary>
        /// <param name="fileName">The name of the CSV file.</param>
        /// <param name="cycles">The cycle data set to be exported.</param>
        public static void ExportToCSV(string fileName, CycleDataSet cycles)
        {
            const string Header =
                "AN V RMS,AN V Phase,AN V Peak," +
                "BN V RMS,BN V Phase,BN V Peak," +
                "CN V RMS,CN V Phase,CN V Peak," +
                "Pos V Magnitude,Pos V Angle," +
                "Neg V Magnitude,Neg V Angle," +
                "Zero V Magnitude,Zero V Angle," +
                "AN I RMS,AN I Phase,AN I Peak," +
                "BN I RMS,BN I Phase,BN I Peak," +
                "CN I RMS,CN I Phase,CN I Peak," +
                "Pos I Magnitude,Pos I Angle," +
                "Neg I Magnitude,Neg I Angle," +
                "Zero I Magnitude,Zero I Angle";

            using (FileStream fileStream = File.OpenWrite(fileName))
            {
                using (TextWriter fileWriter = new StreamWriter(fileStream))
                {
                    // Write the CSV header to the file
                    fileWriter.WriteLine(Header);

                    // Write data to the file
                    foreach (CycleData cycleData in cycles.m_cycles)
                    {
                        fileWriter.WriteLine(ToCSV(cycleData));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the <see cref="FaultLocationDataSet"/> class.
        /// </summary>
        public FaultLocationDataSet()
        {
            m_voltages  = new MeasurementDataSet();
            m_currents  = new MeasurementDataSet();
            m_cycles    = new CycleDataSet();
            m_frequency = 60.0D;

            m_values = new Dictionary <string, object>();
        }