Skip to main content

read

Function read 

Source
pub fn read(text: &str) -> Result<FlightLog, LogError>
Expand description

Reads a log in this layout.

§Errors

  • LogError::NotThisFormat if the file doesn’t open with *** Configuration *** and a *** Raw data *** line within its first 200 lines.
  • LogError::Syntax for a configuration line the reader can’t take (a sample rate that isn’t a positive number, an input it doesn’t know or listed twice, a rate or a list stated twice), a table header that doesn’t open with Time or doesn’t name the inputs the configuration lists, a row not as wide as the header, a Time that isn’t a number greater than the row before’s, or a count that is a number but not a whole one from 0 to 1,023.
  • LogError::NoData without a row.
  • LogError::Unit where the configuration states no sample rate or lists no inputs, the file holds a single row, or the clock’s average step isn’t the stated rate’s within 1%: then nothing in the file says the clock counts seconds.