1using System.Collections;
2using System.Collections.Generic;
4using System.Threading.Tasks;
66 m_LastFileLabel.text =
"ERROR: Avatar needs to walk to get timestamps";
85 DateTime dob = DateTime.Now;
86 string timeStamp = dob.ToString(
"MM_dd_yyyyTHH_mm_ss" );
88 string postfix = type + name +
"_" + timeStamp +
".txt";
92 if( type.Equals(
"Pink") || type.Equals(
"Random") )
96 foreach(
float value
in valList )
103 else if( type.Equals(
"ISO") )
105 if( name.Equals(
"Noise") )
113 foreach(
float value
in valList )
137 using( StreamWriter myStreamWriter =
new StreamWriter( path, append:
true ) )
141 await myStreamWriter.WriteLineAsync(
"" + Mathf.Abs(line) );
145 await myStreamWriter.WriteLineAsync(
"Error Code: " + line );
155 int idx = path.LastIndexOf(
'/');
156 string fileName =
"";
160 fileName = path.Substring( idx + 1 );
163 if ( System.IO.File.Exists( path ) )
165 label.text = fileName;
This class is used to control the avartar animation state.
List< float > AnimationLength
Property to get the Animation length (Read-Only)
This class is a helper class used to export data to files.
void CheckFileExists(string path, TextMeshPro label)
Check the file exists and set the name of last file generated by the user.
string m_DirectoryLocation
Directory location where files stored. C:\Users\yourname\AppData\LocalLow\DefaultCompany_BarMetronome...
AvatarAnimationState m_AvatarAnimationState
Need this to access heel strike time stamps.
TextMeshPro m_AnimLenLabel
TextMeshPro m_SignalFileLabel
async void ExportGenericFiles(string name, TextMeshPro label, List< float > valList)
Export the data currently being used in the walking trials.
bool m_CoroutineIsRunning
Check Coroutine is running or not. This is to prevent calling for multiple coroutines.
void Start()
Initialize persistentDataPath
void ExportDataFiles()
This function start a Coroutine to export data Mapped to export data button.
async Task WriteToFile(string path, float line)
Asynchronously write and append line by line to a file. The using statement before the StreamWrite al...
TextMeshPro m_LastFileLabel
IEnumerator ExportFiles()
This function exports signal data and left/right heel strike time stamps.
This class initiate appopriate noise objects.