OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{calib_dlg.cpp} Namespace Reference

Functions

void ParseStringValues (std::string str, std::vector< double > &vec)
int GetTextMax (wxWindow *parent, const std::vector< wxString > &labels)
CheckBox * add_scale_checkbox (wxWindow *parent, wxSizer *settings_sizer)
std::vector< std::string > get_shaper_type_values ()
std::vector< wxString > make_shaper_type_labels ()
bool is_belt_printer_selected ()

Function Documentation

◆ add_scale_checkbox()

CheckBox * Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::add_scale_checkbox ( wxWindow * parent,
wxSizer * settings_sizer )
68{
69 auto row = new wxBoxSizer(wxHORIZONTAL);
70 auto cb = new CheckBox(parent);
71 cb->SetValue(true);
72 auto text = new wxStaticText(parent, wxID_ANY, _L("Auto-scale for nozzle"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
73 cb->SetToolTip(_L("This model is designed around a 0.4 mm nozzle with a 0.2 mm layer height. \n"
74 "When the scaling option is enabled (recommended), it dynamically resizes to match your current nozzle diameter"
75 " and an appropriate layer height, making the test both accurate and easy to read.\n"
76 "Turn scaling off only if you wish to print the reference model exactly as-is."));
77 text->SetToolTip(cb->GetToolTipText());
78 row->Add(cb , 0, wxALL | wxALIGN_CENTER_VERTICAL, parent->FromDIP(2));
79 row->Add(text, 0, wxALL | wxALIGN_CENTER_VERTICAL, parent->FromDIP(2));
80 settings_sizer->Add(row, 0, wxLEFT | wxTOP, parent->FromDIP(3));
81 return cb;
82}
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
Definition Field.hpp:363

References _L, add_scale_checkbox(), and wxStaticText.

Referenced by add_scale_checkbox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_shaper_type_values()

std::vector< std::string > Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::get_shaper_type_values ( )
85{
86 if (auto* preset_bundle = wxGetApp().preset_bundle) {
87 auto printer_config = &preset_bundle->printers.get_edited_preset().config;
88 const auto* gcode_flavor_option = printer_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor");
89 const ConfigOptionDef* def = printer_config->def()->get("input_shaping_type");
90 if (gcode_flavor_option) {
91 auto types = input_shaper_types_for_flavor(gcode_flavor_option->value);
92 if (!types.empty()) {
93 std::vector<std::string> values;
94 values.reserve(types.size());
95 for (InputShaperType type : types) {
96 if (type == InputShaperType::Disable)
97 continue;
98 const size_t idx = static_cast<size_t>(type);
99 if (def && idx < def->enum_values.size())
100 values.push_back(def->enum_values[idx]);
101 else
102 values.push_back(std::to_string(static_cast<int>(type)));
103 }
104 if (!values.empty())
105 return values;
106 }
107 }
108
109 if (def && !def->enum_values.empty())
110 return {def->enum_values.front()};
111 }
112 return {"Default"};
113}
Definition Config.hpp:2316
Definition Config.hpp:2076
static DynamicPrintConfig & printer_config()
Definition GUI_ObjectList.cpp:131
std::vector< InputShaperType > input_shaper_types_for_flavor(GCodeFlavor flavor)
Definition Tab.cpp:6540
InputShaperType
Definition PrintConfig.hpp:565
@ Disable
Definition PrintConfig.hpp:578

References Slic3r::Disable, get_shaper_type_values(), Slic3r::GUI::input_shaper_types_for_flavor(), and Slic3r::GUI::printer_config().

Referenced by get_shaper_type_values(), and make_shaper_type_labels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTextMax()

int Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::GetTextMax ( wxWindow * parent,
const std::vector< wxString > & labels )
60{
61 wxSize text_size;
62 for (wxString label : labels)
63 text_size.IncTo(parent->GetTextExtent(label));
64 return text_size.x + parent->FromDIP(10);
65}

References GetTextMax().

Referenced by GetTextMax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_belt_printer_selected()

bool Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::is_belt_printer_selected ( )
132{
133 if (auto* preset_bundle = wxGetApp().preset_bundle) {
134 const auto& cfg = preset_bundle->printers.get_edited_preset().config;
135 const auto* opt = cfg.option<ConfigOptionBool>("belt_printer");
136 return opt != nullptr && opt->value;
137 }
138 return false;
139}
Definition Config.hpp:1908
Definition BruteforceOptimizer.hpp:11

References is_belt_printer_selected().

Referenced by is_belt_printer_selected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_shaper_type_labels()

std::vector< wxString > Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::make_shaper_type_labels ( )
116{
117 auto values = get_shaper_type_values();
118 if (values.empty())
119 values.emplace_back("");
120
121 std::vector<wxString> labels;
122 labels.reserve(values.size());
123 for (const auto& label : values)
124 labels.emplace_back(wxString::FromUTF8(label.c_str()));
125 return labels;
126}
std::vector< std::string > get_shaper_type_values()
Definition calib_dlg.cpp:84

References get_shaper_type_values(), and make_shaper_type_labels().

Referenced by make_shaper_type_labels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseStringValues()

void Slic3r::GUI::anonymous_namespace{calib_dlg.cpp}::ParseStringValues ( std::string str,
std::vector< double > & vec )
51{
52 vec.clear();
53 std::replace(str.begin(), str.end(), ',', ' ');
54 std::istringstream inss(str);
55 std::copy_if(std::istream_iterator<int>(inss), std::istream_iterator<int>(), std::back_inserter(vec),
56 [](int x){ return x > 0; });
57}

References ParseStringValues().

Referenced by ParseStringValues().

Here is the call graph for this function:
Here is the caller graph for this function: