[wpiutil] Add DataLog and DataLogManager Stop() (#5860)

Restarting a stopped log results in creating a new log file with fresh copies of the same start records and schema data records.

Also check to see if the file has been deleted or if the log file exceeds 1.8 GB, and start a new one.
This commit is contained in:
Peter Johnson
2023-11-03 20:34:43 -07:00
committed by GitHub
parent 2a04e12c6f
commit f1a82828fe
11 changed files with 398 additions and 135 deletions

View File

@@ -111,6 +111,22 @@ Java_edu_wpi_first_util_datalog_DataLogJNI_resume
reinterpret_cast<DataLog*>(impl)->Resume();
}
/*
* Class: edu_wpi_first_util_datalog_DataLogJNI
* Method: stop
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_util_datalog_DataLogJNI_stop
(JNIEnv* env, jclass, jlong impl)
{
if (impl == 0) {
wpi::ThrowNullPointerException(env, "impl is null");
return;
}
reinterpret_cast<DataLog*>(impl)->Stop();
}
/*
* Class: edu_wpi_first_util_datalog_DataLogJNI
* Method: addSchema