Commit 58a5fc1f authored by Moritz's avatar Moritz

VTKToVF: added variable indicating if the script is still computing

parent 75235d4e
......@@ -5,9 +5,7 @@ using UnityEngine;
namespace Teamproject {
public class VTKToVF : MonoBehaviour {
[Tooltip("Path to CEL Data files containing the extensions .cel, .daten and .vrt \n" +
"STAR-CCM+ export options should be: Export Data: all Regions, Velocity (only vector \"Lab Reference Frame\"," +
" not magnitude or i, j, k; Export Type: Mesh and Solution Data")]
[Tooltip("Path to VTK Data file")]
public string PathToFolder = "";
[Tooltip("Distance between adjacent gridpoints on any axis, in Millimeter")]
......@@ -15,6 +13,9 @@ namespace Teamproject {
public bool ConvertVTKToVectorfield = default;
[HideInInspector]
public bool IsComputing = false;
Dictionary<int, PCachePoint> points;
private void Update() {
......@@ -25,6 +26,7 @@ namespace Teamproject {
}
public IEnumerator StartConvert() {
IsComputing = true;
var startingTime = DateTime.Now;
string filenames = FileNameFinder.GetName(PathToFolder, ".vtk");
......@@ -46,6 +48,7 @@ namespace Teamproject {
Debug.Log("<color=teal> Mapping complete, starting writing to vectorfield </color>");
yield return new WaitForEndOfFrame();
/*
//test test
Debug.Log("ding start");
var testPointVis = GameObject.FindObjectOfType<Testing.PointCloudVisualizer>().GetComponent<Testing.PointCloudVisualizer>();
......@@ -54,16 +57,18 @@ namespace Teamproject {
var testVis = GameObject.FindObjectOfType<Testing.Array3DVisualizer>().GetComponent<Testing.Array3DVisualizer>();
testVis.Visualize(gridMapper.directionGrid);
Debug.Log("ding ende");
//test test ende
//test test ende */
var writer = new VectorFieldWriter(PathToFolder, filenames);
//writer.WriteToVectorfield(gridMapper.directionGrid);
writer.WriteToVectorfield(gridMapper.directionGrid);
//writer.WriteToVectorfield(gridMapper.info);
Debug.Log("<color=teal> Writing to vectorfield complete </color>");
var calcTime = (DateTime.Now - startingTime);
Debug.Log("<color=teal> Everything done in " + (calcTime.Minutes * 60 + calcTime.Seconds) + " seconds. </color>");
IsComputing = false;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment