Style fix: const for some functions

This commit is contained in:
ntfshard 2015-07-28 02:26:01 +03:00 committed by Alessandro Ranellucci
parent f2c4a66e45
commit eb7464ace6
10 changed files with 51 additions and 51 deletions

View file

@ -67,7 +67,7 @@ GCodeWriter::preamble()
}
std::string
GCodeWriter::postamble()
GCodeWriter::postamble() const
{
std::ostringstream gcode;
if (FLAVOR_IS(gcfMachinekit))
@ -76,7 +76,7 @@ GCodeWriter::postamble()
}
std::string
GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool)
GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool) const
{
if (wait && (FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)))
return "";
@ -110,7 +110,7 @@ GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool)
}
std::string
GCodeWriter::set_bed_temperature(unsigned int temperature, bool wait)
GCodeWriter::set_bed_temperature(unsigned int temperature, bool wait) const
{
std::string code, comment;
if (wait && FLAVOR_IS_NOT(gcfTeacup)) {
@ -217,7 +217,7 @@ GCodeWriter::reset_e(bool force)
}
std::string
GCodeWriter::update_progress(unsigned int num, unsigned int tot, bool allow_100)
GCodeWriter::update_progress(unsigned int num, unsigned int tot, bool allow_100) const
{
if (FLAVOR_IS_NOT(gcfMakerWare) && FLAVOR_IS_NOT(gcfSailfish))
return "";
@ -273,7 +273,7 @@ GCodeWriter::toolchange(unsigned int extruder_id)
}
std::string
GCodeWriter::set_speed(double F, const std::string &comment)
GCodeWriter::set_speed(double F, const std::string &comment) const
{
std::ostringstream gcode;
gcode << "G1 F" << F;

View file

@ -24,17 +24,17 @@ class GCodeWriter {
void apply_print_config(const PrintConfig &print_config);
void set_extruders(const std::vector<unsigned int> &extruder_ids);
std::string preamble();
std::string postamble();
std::string set_temperature(unsigned int temperature, bool wait = false, int tool = -1);
std::string set_bed_temperature(unsigned int temperature, bool wait = false);
std::string postamble() const;
std::string set_temperature(unsigned int temperature, bool wait = false, int tool = -1) const;
std::string set_bed_temperature(unsigned int temperature, bool wait = false) const;
std::string set_fan(unsigned int speed, bool dont_save = false);
std::string set_acceleration(unsigned int acceleration);
std::string reset_e(bool force = false);
std::string update_progress(unsigned int num, unsigned int tot, bool allow_100 = false);
std::string update_progress(unsigned int num, unsigned int tot, bool allow_100 = false) const;
bool need_toolchange(unsigned int extruder_id) const;
std::string set_extruder(unsigned int extruder_id);
std::string toolchange(unsigned int extruder_id);
std::string set_speed(double F, const std::string &comment = std::string());
std::string set_speed(double F, const std::string &comment = std::string()) const;
std::string travel_to_xy(const Pointf &point, const std::string &comment = std::string());
std::string travel_to_xyz(const Pointf3 &point, const std::string &comment = std::string());
std::string travel_to_z(double z, const std::string &comment = std::string());

View file

@ -61,7 +61,7 @@ Layer::object() const
size_t
Layer::region_count()
Layer::region_count() const
{
return this->regions.size();
}

View file

@ -93,7 +93,7 @@ class Layer {
ExPolygonCollection slices;
size_t region_count();
size_t region_count() const;
LayerRegion* get_region(int idx);
LayerRegion* add_region(PrintRegion* print_region);