void Update() { try { if (logReader != null) { var data = logReader.ReadFrameData(); if (data == null) { return; } this.CollectData(data); System.GC.Collect(); if (data == null) { logReader = null; } this.Repaint(); } } catch (System.Exception e) { logReader = null; Debug.LogError(e); } }
void Update() { try { if (logReader != null) { var frameData = logReader.ReadFrameData(); if (isFirstFrame) { SetAnalyzerInfo(analyzeExecutes, logReader); isFirstFrame = false; } if (frameData == null) { // 終わったタイミングでcsv string dialogStr = "Write to csv files\n"; string outputDir = System.IO.Path.GetDirectoryName(this.filePath); string logfilename = System.IO.Path.GetFileName(this.filePath); foreach (var analyzer in this.analyzeExecutes) { analyzer.WriteResultFile(logfilename, outputDir); dialogStr += analyzer.GetType() + "\n"; } EditorUtility.DisplayDialog("Result", dialogStr, "ok"); analyzeExecutes.Clear(); logReader = null; this.Repaint(); return; } foreach (var analyzer in this.analyzeExecutes) { try { analyzer.CollectData(frameData); } catch (System.Exception e) { Debug.LogError(e); } } System.GC.Collect(); this.Repaint(); } } catch (System.Exception e) { logReader = null; Debug.LogError(e); } }
bool ExecuteFrame() { if (logReader == null) { return(false); } try { var frameData = logReader.ReadFrameData(); if (isFirstFrame) { InitOutputPathInfo(); SetAnalyzerInfo(analyzeExecutes, logReader); isFirstFrame = false; } if (frameData == null || forceStopRequest) { // write all result foreach (var analyzer in this.analyzeExecutes) { analyzer.WriteResultFile(logfilename, outputDir); } requestDialogFlag = true; logReader = null; return(false); } foreach (var analyzer in this.analyzeExecutes) { try { analyzer.CollectData(frameData); } catch (System.Exception e) { Debug.LogError(e); } } System.GC.Collect(); } catch (System.Exception e) { logReader = null; Debug.LogError(e); } return(true); }
void Update() { try { if (logReader != null) { var frameData = logReader.ReadFrameData(); if (frameData == null) { // 終わったタイミングでcsv string dialogStr = "Write to csv files\n"; foreach (var analyzer in this.analyzeExecutes) { string path = analyzer.ConvertPath(this.filePath); analyzer.WriteResultFile(path); dialogStr += path + "\n"; } EditorUtility.DisplayDialog("Result", dialogStr, "ok"); analyzeExecutes.Clear(); logReader = null; this.Repaint(); return; } foreach (var analyzer in this.analyzeExecutes) { try { analyzer.CollectData(frameData); } catch (System.Exception e) { Debug.LogError(e); } } System.GC.Collect(); this.Repaint(); } } catch (System.Exception e) { logReader = null; Debug.LogError(e); } }