Some minor refactoring / polishing.

This commit is contained in:
Vojtech Bubnik 2020-11-21 13:16:03 +01:00
parent 288dbfd0d8
commit 25ca1fcf77
4 changed files with 10 additions and 9 deletions

View File

@ -390,13 +390,11 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename)
};
// check for temporary lines
auto is_temporary_decoration = [](const std::string& gcode_line) {
auto is_temporary_decoration = [](const std::string_view gcode_line) {
// remove trailing '\n'
std::string line = gcode_line.substr(0, gcode_line.length() - 1);
if (line == ";" + Layer_Change_Tag)
return true;
else
return false;
assert(! gcode_line.empty());
assert(gcode_line.back() == '\n');
return gcode_line.substr(0, gcode_line.length() - 1) == ";" + Layer_Change_Tag;
};
// Iterators for the normal and silent cached time estimate entry recently processed, used by process_line_G1.

View File

@ -808,7 +808,10 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_spool_weight", coFloats);
def->label = L("Spool weight");
def->tooltip = L("Enter weight of the spool without filament. This is only for statistical information.");
def->tooltip = L("Enter weight of the empty filament spool. "
"One may weigh a partially consumed filament spool before printing and one may compare the measured weight "
"with the calculated weight of the filament with the spool to find out whether the amount "
"of filament on the spool is sufficient to finish the print.");
def->sidetext = L("g");
def->min = 0;
def->set_default_value(new ConfigOptionFloats { 0. });

View File

@ -1091,7 +1091,7 @@ wxDEFINE_EVENT(EVT_GLCANVAS_RELOAD_FROM_DISK, SimpleEvent);
const double GLCanvas3D::DefaultCameraZoomToBoxMarginFactor = 1.25;
GLCanvas3D::ArrangeSettings load_arrange_settings()
static GLCanvas3D::ArrangeSettings load_arrange_settings()
{
GLCanvas3D::ArrangeSettings settings;

View File

@ -689,7 +689,7 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
if (sla_print_technology)
m_layers_slider->SetLayersTimes(plater->sla_print().print_statistics().layers_times);
else
m_layers_slider->SetLayersTimes(m_gcode_result->time_statistics.modes[0].layers_times);
m_layers_slider->SetLayersTimes(m_gcode_result->time_statistics.modes.front().layers_times);
m_layers_slider_sizer->Show((size_t)0);
Layout();