mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 16:51:21 -06:00
GCode Viewer - Show print/printer/filament settings names in legend
This commit is contained in:
parent
8448d1a1dc
commit
479d4b70f2
4 changed files with 88 additions and 20 deletions
|
|
@ -561,9 +561,17 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
|||
if (bed_shape != nullptr)
|
||||
m_result.bed_shape = bed_shape->values;
|
||||
|
||||
const ConfigOptionString* print_settings_id = config.option<ConfigOptionString>("print_settings_id");
|
||||
if (print_settings_id != nullptr)
|
||||
m_result.settings_ids.print = print_settings_id->value;
|
||||
|
||||
const ConfigOptionStrings* filament_settings_id = config.option<ConfigOptionStrings>("filament_settings_id");
|
||||
if (filament_settings_id != nullptr)
|
||||
m_result.settings_ids.filament = filament_settings_id->values;
|
||||
|
||||
const ConfigOptionString* printer_settings_id = config.option<ConfigOptionString>("printer_settings_id");
|
||||
if (printer_settings_id != nullptr)
|
||||
m_result.printer_settings_id = printer_settings_id->value;
|
||||
m_result.settings_ids.printer = printer_settings_id->value;
|
||||
|
||||
const ConfigOptionFloats* filament_diameters = config.option<ConfigOptionFloats>("filament_diameter");
|
||||
if (filament_diameters != nullptr) {
|
||||
|
|
|
|||
|
|
@ -266,10 +266,23 @@ namespace Slic3r {
|
|||
|
||||
struct Result
|
||||
{
|
||||
struct SettingsIds
|
||||
{
|
||||
std::string print;
|
||||
std::vector<std::string> filament;
|
||||
std::string printer;
|
||||
|
||||
void reset()
|
||||
{
|
||||
print = "";
|
||||
filament = std::vector<std::string>();
|
||||
printer = "";
|
||||
}
|
||||
};
|
||||
unsigned int id;
|
||||
std::vector<MoveVertex> moves;
|
||||
Pointfs bed_shape;
|
||||
std::string printer_settings_id;
|
||||
SettingsIds settings_ids;
|
||||
std::vector<std::string> extruder_colors;
|
||||
PrintEstimatedTimeStatistics time_statistics;
|
||||
|
||||
|
|
@ -281,6 +294,7 @@ namespace Slic3r {
|
|||
moves = std::vector<MoveVertex>();
|
||||
bed_shape = Pointfs();
|
||||
extruder_colors = std::vector<std::string>();
|
||||
settings_ids.reset();
|
||||
}
|
||||
#else
|
||||
void reset()
|
||||
|
|
@ -288,6 +302,7 @@ namespace Slic3r {
|
|||
moves = std::vector<MoveVertex>();
|
||||
bed_shape = Pointfs();
|
||||
extruder_colors = std::vector<std::string>();
|
||||
settings_ids.reset();
|
||||
}
|
||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue