Пример #1
0
 /// <summary>
 /// Create the exporters to write the data.
 /// </summary>
 public ExportWriter()
 {
     csv          = null;
     matlab       = null;
     matlabMatrix = null;
     pd0          = null;
     ensEx        = null;
 }
Пример #2
0
        /// <summary>
        /// Open the exporters based off the selection.
        /// </summary>
        /// <param name="folderPath">Folder path of the exported files.</param>
        /// <param name="filename">File name of the exported file.</param>
        /// <param name="options">Options for exporting.</param>
        /// <param name="isCsvSelected">CSV Exporter selected.</param>
        /// <param name="isMatlabSelected">MATLAB exporter selected.</param>
        /// <param name="isMatlabMatrixSelected">MATLAB matrix selected.</param>
        /// <param name="isPd0Selected">PD0 exporter selected.</param>
        /// <param name="isEnsSelected">ENS exporter selected.</param>
        public void Open(string folderPath, string filename, ExportOptions options, bool isCsvSelected, bool isMatlabSelected, bool isMatlabMatrixSelected, bool isPd0Selected, bool isEnsSelected)
        {
            // Open all the exporters that are selected
            // The filename is name without the extension
            csv          = new CsvExporterWriter();
            matlab       = new MatlabExporterWriter();
            matlabMatrix = new MatlabMatrixExporterWriter();
            pd0          = new Pd0ExporterWriter();
            ensEx        = new EnsExporterWriter();

            try
            {
                if (isCsvSelected)
                {
                    csv.Open(folderPath, filename + ".csv", options);
                }
                if (isMatlabSelected)
                {
                    matlab.Open(folderPath, filename, options);
                }
                if (isMatlabMatrixSelected)
                {
                    matlabMatrix.Open(folderPath, filename, options);
                }
                if (isPd0Selected)
                {
                    pd0.Open(folderPath, filename + "_pd0" + ".pd0", options);
                }
                if (isEnsSelected)
                {
                    ensEx.Open(folderPath, filename + "_rtb" + ".ens", options);
                }
            }
            catch (Exception ex)
            {
                log.Error("Error opening ensemble file.", ex);
            }
        }