infill pattern: gui field to enum conversion fixed.

Scattered rectilinear now is really scat recti.
This commit is contained in:
supermerill 2019-08-23 23:55:41 +02:00
parent e03079b68d
commit f61087df02
2 changed files with 31 additions and 31 deletions

View File

@ -1043,7 +1043,7 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("hilbertcurve"); def->enum_values.push_back("hilbertcurve");
def->enum_values.push_back("archimedeanchords"); def->enum_values.push_back("archimedeanchords");
def->enum_values.push_back("octagramspiral"); 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("Rectilinear"));
def->enum_labels.push_back(L("Grid")); def->enum_labels.push_back(L("Grid"));
def->enum_labels.push_back(L("Triangles")); def->enum_labels.push_back(L("Triangles"));

View File

@ -843,7 +843,8 @@ void Choice::set_value(const boost::any& value, bool change_event)
} }
case coEnum: { case coEnum: {
int val = boost::any_cast<int>(value); 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_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()) { if (!m_opt.enum_values.empty()) {
std::string key; std::string key;
@ -934,7 +935,8 @@ boost::any& Choice::get_value()
if (m_opt.type == coEnum) if (m_opt.type == coEnum)
{ {
int ret_enum = field->GetSelection(); 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()) { if (!m_opt.enum_values.empty()) {
std::string key = m_opt.enum_values[ret_enum]; std::string key = m_opt.enum_values[ret_enum];
@ -946,8 +948,6 @@ boost::any& Choice::get_value()
else else
m_value = static_cast<InfillPattern>(0); 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) else if (m_opt_id.compare("gcode_flavor") == 0)
m_value = static_cast<GCodeFlavor>(ret_enum); m_value = static_cast<GCodeFlavor>(ret_enum);
else if (m_opt_id.compare("support_material_pattern") == 0) else if (m_opt_id.compare("support_material_pattern") == 0)