- /* Now scan the eeprom, reading blocks of data and converting to .eeprom file form */
-
- state_block = log.start_block;
- for (block = log.start_block; !done && block < log.end_block; block++) {
- monitor.set_value(state.state_name(),
- state.state,
- block - state_block,
- block - log.start_block);
-
- AltosEepromChunk eechunk = new AltosEepromChunk(link, block, block == log.start_block);
-
- /*
- * Guess what kind of data is there if the device
- * didn't tell us
- */
-
- if (log_format == AltosLib.AO_LOG_FORMAT_UNKNOWN) {
- if (block == log.start_block) {
- if (eechunk.data(0) == AltosLib.AO_LOG_FLIGHT)
- log_format = AltosLib.AO_LOG_FORMAT_FULL;
- else
- log_format = AltosLib.AO_LOG_FORMAT_TINY;
- }
- }
+ monitor.set_serial(log.serial);
+ monitor.set_flight(log.flight);
+
+ int start_block = log.start_block;
+ int end_block = FindLastLog(log, cache);
+
+ monitor.set_max(end_block - start_block - 1);