ENABLE_GCODE_VIEWER -> Estimated print time statistics moved from PrintStatistics to GCodeProcessor

This commit is contained in:
enricoturri1966 2020-08-03 13:57:10 +02:00
parent 69a0a1c96e
commit 5249b3e018
7 changed files with 227 additions and 258 deletions

View file

@ -304,22 +304,12 @@ struct PrintStatistics
{
PrintStatistics() { clear(); }
#if ENABLE_GCODE_VIEWER
float estimated_normal_print_time;
float estimated_silent_print_time;
#if ENABLE_GCODE_VIEWER_USE_OLD_TIME_ESTIMATOR
std::string estimated_normal_print_time_str;
std::string estimated_silent_print_time_str;
#endif // ENABLE_GCODE_VIEWER_USE_OLD_TIME_ESTIMATOR
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> estimated_normal_custom_gcode_print_times;
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> estimated_silent_custom_gcode_print_times;
#if ENABLE_GCODE_VIEWER_USE_OLD_TIME_ESTIMATOR
std::vector<std::pair<CustomGCode::Type, std::pair<std::string, std::string>>> estimated_normal_custom_gcode_print_times_str;
std::vector<std::pair<CustomGCode::Type, std::pair<std::string, std::string>>> estimated_silent_custom_gcode_print_times_str;
#endif // ENABLE_GCODE_VIEWER_USE_OLD_TIME_ESTIMATOR
std::vector<std::pair<GCodeProcessor::EMoveType, float>> estimated_normal_moves_times;
std::vector<std::pair<GCodeProcessor::EMoveType, float>> estimated_silent_moves_times;
std::vector<std::pair<ExtrusionRole, float>> estimated_normal_roles_times;
std::vector<std::pair<ExtrusionRole, float>> estimated_silent_roles_times;
#else
std::string estimated_normal_print_time;
std::string estimated_silent_print_time;
@ -344,7 +334,6 @@ struct PrintStatistics
void clear() {
#if ENABLE_GCODE_VIEWER
clear_time_estimates();
#if ENABLE_GCODE_VIEWER_USE_OLD_TIME_ESTIMATOR
estimated_normal_print_time_str.clear();
estimated_silent_print_time_str.clear();
@ -366,19 +355,6 @@ struct PrintStatistics
total_wipe_tower_filament = 0.;
filament_stats.clear();
}
#if ENABLE_GCODE_VIEWER
void clear_time_estimates() {
estimated_normal_print_time = 0.0f;
estimated_silent_print_time = 0.0f;
estimated_normal_custom_gcode_print_times.clear();
estimated_silent_custom_gcode_print_times.clear();
estimated_normal_moves_times.clear();
estimated_silent_moves_times.clear();
estimated_normal_roles_times.clear();
estimated_silent_roles_times.clear();
}
#endif //ENABLE_GCODE_VIEWER
};
typedef std::vector<PrintObject*> PrintObjectPtrs;