You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Tooltip("When the measurements should be taken.\n\nManual should only be selected if the user is calling the RecordRow method either from another script or a custom Tracker class.")]
58
+
[Tooltip("When the measurements should be taken."+
59
+
"\n\nManual should only be selected if the user is calling the RecordRow method"+
60
+
" either from another script or a custom Tracker class.")]
"Tracker measurements cannot be taken when not recording!");
79
88
80
89
UXFDataRownewRow=GetCurrentValues();
81
90
newRow.Add(("time",Time.time));
@@ -87,17 +96,54 @@ public void RecordRow()
87
96
/// </summary>
88
97
publicvoidStartRecording()
89
98
{
99
+
if(currentState==TrackerState.Recording)
100
+
{
101
+
Utilities.UXFDebugLogWarning($"Start command received for tracker in state: '{TrackerState.Recording}'."+
102
+
" This will dump exisiting data! "+
103
+
$"If you want to restart a paused tracker, use '{nameof(ResumeRecording)}()' instead.");
104
+
}
90
105
varheader=baseHeaders.Concat(CustomHeader);
91
106
Data=newUXFDataTable(header.ToArray());
92
-
recording=true;
107
+
currentState=TrackerState.Recording;
93
108
}
94
109
95
110
/// <summary>
96
111
/// Stops recording.
97
112
/// </summary>
98
113
publicvoidStopRecording()
99
114
{
100
-
recording=false;
115
+
if(currentState!=TrackerState.Recording)
116
+
{
117
+
Utilities.UXFDebugLogWarning($"Stop command received for tracker in state: '{currentState}'."+
118
+
$" This should only be called when tracker is in state '{TrackerState.Recording}'");
119
+
}
120
+
currentState=TrackerState.Stopped;
121
+
}
122
+
123
+
/// <summary>
124
+
/// Pauses recording.
125
+
/// </summary>
126
+
publicvoidPauseRecording()
127
+
{
128
+
if(currentState!=TrackerState.Recording)
129
+
{
130
+
Utilities.UXFDebugLogWarning($"Pause command received for tracker in state: '{currentState}'."+
131
+
$"This should only be called when tracker is in state '{TrackerState.Recording}'");
132
+
}
133
+
currentState=TrackerState.Paused;
134
+
}
135
+
136
+
/// <summary>
137
+
/// Resumes recording.
138
+
/// </summary>
139
+
publicvoidResumeRecording()
140
+
{
141
+
if(currentState!=TrackerState.Paused)
142
+
{
143
+
Utilities.UXFDebugLogWarning($"Resume command received for tracker in state: '{currentState}'."+
144
+
$"This should only be called when tracker is in state '{TrackerState.Paused}'");
145
+
}
146
+
currentState=TrackerState.Recording;
101
147
}
102
148
103
149
/// <summary>
@@ -109,10 +155,20 @@ public void StopRecording()
109
155
}
110
156
111
157
/// <summary>
112
-
/// When the tracker should collect new measurements. Manual should only be selected if the user is calling the RecordRow method either from another script or a custom Tracker class.
158
+
/// When the tracker should collect new measurements.
159
+
/// Manual should only be selected if the user is calling the RecordRow method
160
+
/// either from another script or a custom Tracker class.
0 commit comments