this->register_for_event(ON_CONSOLE_LINE_RECEIVED);
this->register_for_event(ON_MAIN_LOOP);
this->register_for_event(ON_SECOND_TICK);
-
+
this->on_boot_file_name = this->kernel->config->value(on_boot_gcode_checksum)->by_default("/sd/on_boot.gcode -q")->as_string();
this->on_boot_enable = this->kernel->config->value(on_boot_gcode_enable_checksum)->by_default(true)->as_bool();
this->elapsed_secs= 0;
// Get filename
string filename = this->absolute_from_relative(shift_parameter( parameters ));
- stream->printf("Playing %s\r\n", filename.c_str());
string options = shift_parameter( parameters );
this->current_file_handler = fopen( filename.c_str(), "r");
return;
}
+ stream->printf("Playing %s\r\n", filename.c_str());
+
this->playing_file = true;
// Do not output to any stream if we were passed the -q ( quiet ) option
if(bytespersec > 0)
est= (file_size - played_cnt) / bytespersec;
}
-
+
int pcnt= (file_size - (file_size - played_cnt)) * 100 / file_size;
stream->printf("%d %% complete, elapsed time: %d s", pcnt, this->elapsed_secs);
if(est > 0){
stream->printf(", est time: %d s", est);
}
stream->printf("\r\n");
-
+
}else{
stream->printf("File size is unknown\r\n");
}