diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-10-18 19:33:13 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-10-18 19:33:13 +0300 |
commit | 366a254b190e704b8365fe2d1dcdac0a01da623b (patch) | |
tree | 6a87974376a56e2b6a1b9eed5f6959185d6581dc /ArcWelder | |
parent | 763d3e1b20d0c677bab8c017ed1ba14ed7c9273a (diff) |
Use rename instead of copying a temp source file. Add segment statistics to console output.
Diffstat (limited to 'ArcWelder')
-rw-r--r-- | ArcWelder/arc_welder.cpp | 6 | ||||
-rw-r--r-- | ArcWelder/arc_welder.h | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/ArcWelder/arc_welder.cpp b/ArcWelder/arc_welder.cpp index c283e26..01de169 100644 --- a/ArcWelder/arc_welder.cpp +++ b/ArcWelder/arc_welder.cpp @@ -162,10 +162,10 @@ arc_welder_results results; std::stringstream stream; stream << std::fixed << std::setprecision(5); - stream << "py_gcode_arc_converter.ConvertFile - Parameters received: source_file_path: '" << + stream << "arc_welder::process - Parameters received: source_file_path: '" << source_path_ << "', target_file_path:'" << target_path_ << "', resolution_mm:" << resolution_mm_ << "mm (+-" << current_arc_.get_resolution_mm() << "mm), max_radius_mm:" << current_arc_.get_max_radius() - << "mm, g90_91_influences_extruder: " << (p_source_position_->get_g90_91_influences_extruder() ? "True" : "False") << "\n"; + << "mm, g90_91_influences_extruder: " << (p_source_position_->get_g90_91_influences_extruder() ? "True" : "False"); p_logger_->log(logger_type_, INFO, stream.str()); @@ -295,7 +295,7 @@ bool arc_welder::on_progress_(const arc_welder_progress& progress) { if (progress_callback_ != NULL) { - return progress_callback_(progress); + return progress_callback_(progress, p_logger_, logger_type_); } else if (info_logging_enabled_) { diff --git a/ArcWelder/arc_welder.h b/ArcWelder/arc_welder.h index d21c2c8..a6fbc38 100644 --- a/ArcWelder/arc_welder.h +++ b/ArcWelder/arc_welder.h @@ -62,8 +62,6 @@ struct segment_statistic { }; struct source_target_segment_statistics { - - source_target_segment_statistics(const double segment_tracking_lengths[], const int num_lengths, logger* p_logger = NULL) { total_length_source = 0; total_length_target = 0; @@ -301,7 +299,7 @@ struct source_target_segment_statistics { // Add the total percent change row std::string total_percent_change_string = utilities::get_percent_change_string(total_count_source, total_count_target, 1); output_stream << std::setw(totals_row_label_size) << std::right << "Total percent change:"; - output_stream << std::setw(table_width - totals_row_label_size) << std::setfill('.') << std::right << total_percent_change_string << "\n" << std::setfill(' '); + output_stream << std::setw(table_width - totals_row_label_size) << std::setfill('.') << std::right << total_percent_change_string << std::setfill(' '); std::string output_string = output_stream.str(); return output_string; } @@ -361,8 +359,9 @@ struct arc_welder_progress { return stream.str(); } }; + // define the progress callback type -typedef bool(*progress_callback)(arc_welder_progress); +typedef bool(*progress_callback)(arc_welder_progress, logger* p_logger, int logger_type); struct arc_welder_results { arc_welder_results() : progress() |