Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@fr.fr>2019-08-24 00:55:41 +0300
committersupermerill <merill@fr.fr>2019-08-24 00:55:41 +0300
commitf61087df02e950e4843c4e5af2251d83f978923b (patch)
tree1b2bdbb38b3f0680213226adeeccbdbac253c107
parente03079b68d75f51d1565d121b4621d177d34a6d7 (diff)
infill pattern: gui field to enum conversion fixed.
Scattered rectilinear now is really scat recti.
-rw-r--r--src/libslic3r/PrintConfig.cpp2
-rw-r--r--src/slic3r/GUI/Field.cpp64
2 files changed, 33 insertions, 33 deletions
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 92c8f687f..33913b111 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -1043,7 +1043,7 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("hilbertcurve");
def->enum_values.push_back("archimedeanchords");
def->enum_values.push_back("octagramspiral");
- def->enum_values.push_back("rectilineargapfill");
+ def->enum_values.push_back("scatteredrectilinear");
def->enum_labels.push_back(L("Rectilinear"));
def->enum_labels.push_back(L("Grid"));
def->enum_labels.push_back(L("Triangles"));
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index 7f558eb63..d416104fb 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -838,35 +838,36 @@ void Choice::set_value(const boost::any& value, bool change_event)
field->SetValue(text_value);
}
else
- field->SetSelection(idx);
- break;
- }
- case coEnum: {
- int val = boost::any_cast<int>(value);
- if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern")
- {
- if (!m_opt.enum_values.empty()) {
- std::string key;
- t_config_enum_values map_names = ConfigOptionEnum<InfillPattern>::get_enum_values();
- for (auto it : map_names) {
- if (val == it.second) {
- key = it.first;
- break;
- }
- }
-
- size_t idx = 0;
- for (auto el : m_opt.enum_values)
- {
- if (el.compare(key) == 0)
- break;
- ++idx;
- }
-
- val = idx == m_opt.enum_values.size() ? 0 : idx;
- }
- else
- val = 0;
+ field->SetSelection(idx);
+ break;
+ }
+ case coEnum: {
+ int val = boost::any_cast<int>(value);
+ if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern"
+ || m_opt_id == "fill_pattern" || m_opt_id == "support_fill_pattern")
+ {
+ if (!m_opt.enum_values.empty()) {
+ std::string key;
+ t_config_enum_values map_names = ConfigOptionEnum<InfillPattern>::get_enum_values();
+ for (auto it : map_names) {
+ if (val == it.second) {
+ key = it.first;
+ break;
+ }
+ }
+
+ size_t idx = 0;
+ for (auto el : m_opt.enum_values)
+ {
+ if (el.compare(key) == 0)
+ break;
+ ++idx;
+ }
+
+ val = idx == m_opt.enum_values.size() ? 0 : idx;
+ }
+ else
+ val = 0;
} else if (m_opt_id.compare("perimeter_loop_seam") == 0) {
if (!m_opt.enum_values.empty()) {
std::string key;
@@ -934,7 +935,8 @@ boost::any& Choice::get_value()
if (m_opt.type == coEnum)
{
int ret_enum = field->GetSelection();
- if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern" || m_opt_id == "support_material_interface_pattern")
+ if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern"
+ || m_opt_id == "support_material_interface_pattern" || m_opt_id == "fill_pattern")
{
if (!m_opt.enum_values.empty()) {
std::string key = m_opt.enum_values[ret_enum];
@@ -946,8 +948,6 @@ boost::any& Choice::get_value()
else
m_value = static_cast<InfillPattern>(0);
}
- if (m_opt_id.compare("fill_pattern") == 0)
- m_value = static_cast<InfillPattern>(ret_enum);
else if (m_opt_id.compare("gcode_flavor") == 0)
m_value = static_cast<GCodeFlavor>(ret_enum);
else if (m_opt_id.compare("support_material_pattern") == 0)