/// <summary> /// Build the final converted data file path /// </summary> /// <param name="OutputFolder">Output file folder</param> /// <param name="OutputFormat">Output format</param> /// <returns>Final converted data file path</returns> private string BuildOutputFilePtah(string OutputFolder, RecordConversionFormat OutputFormat) { string OutputFile = OutputFolder; if (!(OutputFolder.EndsWith("\\"))) { OutputFile = OutputFile + "\\"; } if (!(oRecordEvent == null || oRecordSession == null)) { if (!(Directory.Exists(OutputFile + oRecordEvent.Name))) { Directory.CreateDirectory(OutputFile + oRecordEvent.Name); oRecordEvent.Write_RecordEventInformationFile(OutputFile + oRecordEvent.Name + "\\EventDetails.xml"); } OutputFile += (oRecordEvent.Name + "\\"); if (!(Directory.Exists(OutputFile + oRecordSession.Name))) { Directory.CreateDirectory(OutputFile + oRecordSession.Name); oRecordSession.Write_RecordSessionInformationFile(OutputFile + oRecordSession.Name + "\\SessionDetails.xml"); } OutputFile += (oRecordSession.Name + "\\"); } OutputFile = OutputFile + Path.GetFileNameWithoutExtension(BaseTrcFilePath); switch (OutputFormat) { case RecordConversionFormat.Text: OutputFile = OutputFile + ".csv"; break; case RecordConversionFormat.Xml: OutputFile = OutputFile + ".xrdf"; break; case RecordConversionFormat.Wintax: OutputFile = OutputFile + ".ztx"; break; default: OutputFile = OutputFile + ".csv"; break; } return(OutputFile); }
/// <summary> /// Converts the decoded PCAN trace file into a the specified format /// </summary> /// <param name="OutputFolder">Output file folder</param> /// <param name="OutputFormat">Output format</param> /// <returns>Converion result (True: OK / False: Error)</returns> public bool ConvertTrcFile(string OutputFolder, RecordConversionFormat OutputFormat) { switch (OutputFormat) { case RecordConversionFormat.Text: return(WriteTextRecordData(OutputFolder)); case RecordConversionFormat.Xml: return(WriteXmlRecordData(OutputFolder)); case RecordConversionFormat.Wintax: return(WriteWintaxRecordData(OutputFolder)); default: return(false); } }