mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 16:21:24 -06:00
Add weight/cost output to gcode. On the way to #647
This commit is contained in:
parent
bbd63616b1
commit
3846d9e734
7 changed files with 63 additions and 1 deletions
|
@ -111,6 +111,18 @@ Extruder::filament_diameter() const
|
|||
return this->config->filament_diameter.get_at(this->id);
|
||||
}
|
||||
|
||||
double
|
||||
Extruder::filament_density() const
|
||||
{
|
||||
return this->config->filament_density.get_at(this->id);
|
||||
}
|
||||
|
||||
double
|
||||
Extruder::filament_cost() const
|
||||
{
|
||||
return this->config->filament_cost.get_at(this->id);
|
||||
}
|
||||
|
||||
double
|
||||
Extruder::extrusion_multiplier() const
|
||||
{
|
||||
|
|
|
@ -29,6 +29,8 @@ class Extruder
|
|||
double used_filament() const;
|
||||
|
||||
double filament_diameter() const;
|
||||
double filament_density() const;
|
||||
double filament_cost() const;
|
||||
double extrusion_multiplier() const;
|
||||
double retract_length() const;
|
||||
double retract_lift() const;
|
||||
|
|
|
@ -335,6 +335,30 @@ PrintConfigDef::PrintConfigDef()
|
|||
opt->values.push_back(3);
|
||||
def->default_value = opt;
|
||||
}
|
||||
|
||||
def = this->add("filament_density", coFloats);
|
||||
def->label = "Density";
|
||||
def->tooltip = "Enter your filament density here. This is only for statistical information. A decent way is to weigh a known length of filament and compute the ratio of the length to volume.";
|
||||
def->sidetext = "g/mm^3";
|
||||
def->cli = "filament-density=f@";
|
||||
def->min = 0;
|
||||
{
|
||||
ConfigOptionFloats* opt = new ConfigOptionFloats();
|
||||
opt->values.push_back(0);
|
||||
def->default_value = opt;
|
||||
}
|
||||
|
||||
def = this->add("filament_cost", coFloats);
|
||||
def->label = "Cost";
|
||||
def->tooltip = "Enter your filament cost per kg here. This is only for statistical information.";
|
||||
def->sidetext = "money/kg";
|
||||
def->cli = "filament-cost=f@";
|
||||
def->min = 0;
|
||||
{
|
||||
ConfigOptionFloats* opt = new ConfigOptionFloats();
|
||||
opt->values.push_back(0);
|
||||
def->default_value = opt;
|
||||
}
|
||||
|
||||
def = this->add("filament_settings_id", coString);
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
|
|
@ -299,6 +299,8 @@ class GCodeConfig : public virtual StaticPrintConfig
|
|||
ConfigOptionString extrusion_axis;
|
||||
ConfigOptionFloats extrusion_multiplier;
|
||||
ConfigOptionFloats filament_diameter;
|
||||
ConfigOptionFloats filament_density;
|
||||
ConfigOptionFloats filament_cost;
|
||||
ConfigOptionFloats filament_max_volumetric_speed;
|
||||
ConfigOptionBool gcode_comments;
|
||||
ConfigOptionEnum<GCodeFlavor> gcode_flavor;
|
||||
|
@ -334,6 +336,8 @@ class GCodeConfig : public virtual StaticPrintConfig
|
|||
OPT_PTR(extrusion_axis);
|
||||
OPT_PTR(extrusion_multiplier);
|
||||
OPT_PTR(filament_diameter);
|
||||
OPT_PTR(filament_density);
|
||||
OPT_PTR(filament_cost);
|
||||
OPT_PTR(filament_max_volumetric_speed);
|
||||
OPT_PTR(gcode_comments);
|
||||
OPT_PTR(gcode_flavor);
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
%code%{ RETVAL = THIS->retract_speed_mm_min; %};
|
||||
|
||||
double filament_diameter();
|
||||
double filament_density();
|
||||
double filament_cost();
|
||||
double extrusion_multiplier();
|
||||
double retract_length();
|
||||
double retract_lift();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue