mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 14:05:55 +08:00
fix compile errors
This commit is contained in:
parent
2f1c045873
commit
e96f51bfee
@ -67,7 +67,7 @@ struct ArrangePolygon {
|
|||||||
{
|
{
|
||||||
ExPolygon ret = poly;
|
ExPolygon ret = poly;
|
||||||
ret.rotate(rotation);
|
ret.rotate(rotation);
|
||||||
ret.translate(translation.x(), translation.y());
|
ret.translate(double(translation.x()), double(translation.y()));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
|||||||
if (m_flavor != gcfMarlin) {
|
if (m_flavor != gcfMarlin) {
|
||||||
double time_estimation_compensation = config.get_abs_value("time_estimation_compensation");
|
double time_estimation_compensation = config.get_abs_value("time_estimation_compensation");
|
||||||
for (auto& machine : this->m_time_processor.machines) {
|
for (auto& machine : this->m_time_processor.machines) {
|
||||||
machine.time_acceleration = time_estimation_compensation;
|
machine.time_acceleration = float(time_estimation_compensation);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
@ -774,7 +774,7 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
|||||||
if (m_flavor != gcfMarlin) {
|
if (m_flavor != gcfMarlin) {
|
||||||
double time_estimation_compensation = config.get_abs_value("time_estimation_compensation");
|
double time_estimation_compensation = config.get_abs_value("time_estimation_compensation");
|
||||||
for (auto& machine : this->m_time_processor.machines) {
|
for (auto& machine : this->m_time_processor.machines) {
|
||||||
machine.time_acceleration = time_estimation_compensation;
|
machine.time_acceleration = float(time_estimation_compensation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -819,7 +819,7 @@ void GCodeProcessor::reset()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_filament_diameters = std::vector<float>(Min_Extruder_Count, 1.75f);
|
m_filament_diameters = std::vector<float>(Min_Extruder_Count, 1.75f);
|
||||||
m_extruded_last_z = 0.0f;
|
m_extruded_last_z = 0.0;
|
||||||
m_g1_line_id = 0;
|
m_g1_line_id = 0;
|
||||||
m_layer_id = 0;
|
m_layer_id = 0;
|
||||||
m_cp_color.reset();
|
m_cp_color.reset();
|
||||||
@ -928,7 +928,8 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr
|
|||||||
|
|
||||||
//update times for results
|
//update times for results
|
||||||
for (size_t i = 0; i < m_result.moves.size(); i++) {
|
for (size_t i = 0; i < m_result.moves.size(); i++) {
|
||||||
size_t layer_id = m_result.moves[i].layer_duration;
|
//field layer_duration contains the layer id for the move in which the layer_duration has to be set.
|
||||||
|
size_t layer_id = size_t(m_result.moves[i].layer_duration);
|
||||||
std::vector<float>& layer_times = m_result.time_statistics.modes[0].layers_times;
|
std::vector<float>& layer_times = m_result.time_statistics.modes[0].layers_times;
|
||||||
if (layer_times.size() > layer_id - 1 && layer_id > 0)
|
if (layer_times.size() > layer_id - 1 && layer_id > 0)
|
||||||
m_result.moves[i].layer_duration = layer_times[layer_id - 1];
|
m_result.moves[i].layer_duration = layer_times[layer_id - 1];
|
||||||
@ -1808,7 +1809,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
|
|
||||||
if (lineG1.has(Slic3r::Axis(axis))) {
|
if (lineG1.has(Slic3r::Axis(axis))) {
|
||||||
float lengthsScaleFactor = (m_units == EUnits::Inches) ? INCHES_TO_MM : 1.0f;
|
float lengthsScaleFactor = (m_units == EUnits::Inches) ? INCHES_TO_MM : 1.0f;
|
||||||
float ret = lineG1.value(Slic3r::Axis(axis)) * lengthsScaleFactor;
|
double ret = lineG1.value(Slic3r::Axis(axis)) * lengthsScaleFactor;
|
||||||
#if ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
|
#if ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
|
||||||
if (axis == E && m_use_volumetric_e)
|
if (axis == E && m_use_volumetric_e)
|
||||||
ret /= area_filament_cross_section;
|
ret /= area_filament_cross_section;
|
||||||
@ -1879,7 +1880,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
double area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
|
double area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
|
||||||
|
|
||||||
// volume extruded filament / tool displacement = area toolpath cross section
|
// volume extruded filament / tool displacement = area toolpath cross section
|
||||||
m_mm3_per_mm = area_toolpath_cross_section;
|
m_mm3_per_mm = float(area_toolpath_cross_section);
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_mm3_per_mm_compare.update(area_toolpath_cross_section, m_extrusion_role);
|
m_mm3_per_mm_compare.update(area_toolpath_cross_section, m_extrusion_role);
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
@ -1889,7 +1890,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
m_height = m_forced_height;
|
m_height = m_forced_height;
|
||||||
else {
|
else {
|
||||||
if (m_end_position[Z] > m_extruded_last_z + EPSILON) {
|
if (m_end_position[Z] > m_extruded_last_z + EPSILON) {
|
||||||
m_height = m_end_position[Z] - m_extruded_last_z;
|
m_height = float(m_end_position[Z] - m_extruded_last_z);
|
||||||
m_extruded_last_z = m_end_position[Z];
|
m_extruded_last_z = m_end_position[Z];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1900,7 +1901,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
#else
|
#else
|
||||||
if ((m_producers_enabled && m_producer != EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3r) || m_height == 0.0f) {
|
if ((m_producers_enabled && m_producer != EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3r) || m_height == 0.0f) {
|
||||||
if (m_end_position[Z] > m_extruded_last_z + EPSILON) {
|
if (m_end_position[Z] > m_extruded_last_z + EPSILON) {
|
||||||
m_height = m_end_position[Z] - m_extruded_last_z;
|
m_height = float(m_end_position[Z] - m_extruded_last_z);
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_height_compare.update(m_height, m_extrusion_role);
|
m_height_compare.update(m_height, m_extrusion_role);
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
@ -1919,13 +1920,13 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
if (m_extrusion_role == erExternalPerimeter)
|
if (m_extrusion_role == erExternalPerimeter)
|
||||||
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
||||||
// cross section: rectangle
|
// cross section: rectangle
|
||||||
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height);
|
m_width = float(delta_pos[E] * (M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height));
|
||||||
else if (is_bridge(m_extrusion_role) || m_extrusion_role == erNone)
|
else if (is_bridge(m_extrusion_role) || m_extrusion_role == erNone)
|
||||||
// cross section: circle
|
// cross section: circle
|
||||||
m_width = static_cast<float>(m_filament_diameters[m_extruder_id]) * std::sqrt(delta_pos[E] / delta_xyz);
|
m_width = float(m_filament_diameters[m_extruder_id] * std::sqrt(delta_pos[E] / delta_xyz));
|
||||||
else
|
else
|
||||||
// cross section: rectangle + 2 semicircles
|
// cross section: rectangle + 2 semicircles
|
||||||
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(filament_radius)) / (delta_xyz * m_height) + static_cast<float>(1.0 - 0.25 * M_PI) * m_height;
|
m_width = float(delta_pos[E] * (M_PI * sqr(filament_radius)) / (delta_xyz * m_height) + (1.0 - 0.25 * M_PI) * m_height);
|
||||||
|
|
||||||
// if teh value seems wrong, fall back to circular extrusion from flow
|
// if teh value seems wrong, fall back to circular extrusion from flow
|
||||||
if (m_width > m_height * 10 || m_width < m_height) {
|
if (m_width > m_height * 10 || m_width < m_height) {
|
||||||
@ -1944,7 +1945,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
|
|
||||||
// time estimate section
|
// time estimate section
|
||||||
auto move_length = [](const AxisCoords& delta_pos) {
|
auto move_length = [](const AxisCoords& delta_pos) {
|
||||||
float sq_xyz_length = sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]);
|
float sq_xyz_length = (float)sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]);
|
||||||
return (sq_xyz_length > 0.0f) ? std::sqrt(sq_xyz_length) : std::abs(delta_pos[E]);
|
return (sq_xyz_length > 0.0f) ? std::sqrt(sq_xyz_length) : std::abs(delta_pos[E]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1952,7 +1953,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
return delta_pos[X] == 0.0f && delta_pos[Y] == 0.0f && delta_pos[Z] == 0.0f && delta_pos[E] != 0.0f;
|
return delta_pos[X] == 0.0f && delta_pos[Y] == 0.0f && delta_pos[Z] == 0.0f && delta_pos[E] != 0.0f;
|
||||||
};
|
};
|
||||||
|
|
||||||
float distance = move_length(delta_pos);
|
float distance = (float)move_length(delta_pos);
|
||||||
assert(distance != 0.0f);
|
assert(distance != 0.0f);
|
||||||
float inv_distance = 1.0f / distance;
|
float inv_distance = 1.0f / distance;
|
||||||
|
|
||||||
@ -1991,7 +1992,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
block.feedrate_profile.cruise = min_feedrate_factor * curr.feedrate;
|
block.feedrate_profile.cruise = float(min_feedrate_factor * curr.feedrate);
|
||||||
|
|
||||||
if (min_feedrate_factor < 1.0f) {
|
if (min_feedrate_factor < 1.0f) {
|
||||||
for (unsigned char a = X; a <= E; ++a) {
|
for (unsigned char a = X; a <= E; ++a) {
|
||||||
@ -2039,8 +2040,8 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
|
|
||||||
for (unsigned char a = X; a <= E; ++a) {
|
for (unsigned char a = X; a <= E; ++a) {
|
||||||
// Limit an axis. We have to differentiate coasting from the reversal of an axis movement, or a full stop.
|
// Limit an axis. We have to differentiate coasting from the reversal of an axis movement, or a full stop.
|
||||||
float v_exit = prev.axis_feedrate[a];
|
double v_exit = prev.axis_feedrate[a];
|
||||||
float v_entry = curr.axis_feedrate[a];
|
double v_entry = curr.axis_feedrate[a];
|
||||||
|
|
||||||
if (prev_speed_larger)
|
if (prev_speed_larger)
|
||||||
v_exit *= smaller_speed_factor;
|
v_exit *= smaller_speed_factor;
|
||||||
@ -2051,7 +2052,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the jerk depending on whether the axis is coasting in the same direction or reversing a direction.
|
// Calculate the jerk depending on whether the axis is coasting in the same direction or reversing a direction.
|
||||||
float jerk =
|
double jerk =
|
||||||
(v_exit > v_entry) ?
|
(v_exit > v_entry) ?
|
||||||
(((v_entry > 0.0f) || (v_exit < 0.0f)) ?
|
(((v_entry > 0.0f) || (v_exit < 0.0f)) ?
|
||||||
// coasting
|
// coasting
|
||||||
@ -2066,8 +2067,8 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
std::max(-v_exit, v_entry));
|
std::max(-v_exit, v_entry));
|
||||||
|
|
||||||
float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||||
if (jerk > axis_max_jerk) {
|
if (float(jerk) > axis_max_jerk) {
|
||||||
v_factor *= axis_max_jerk / jerk;
|
v_factor *= axis_max_jerk / float(jerk);
|
||||||
limited = true;
|
limited = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2432,13 +2433,13 @@ void GCodeProcessor::process_M402(const GCodeReader::GCodeLine& line)
|
|||||||
float p = FLT_MAX;
|
float p = FLT_MAX;
|
||||||
for (unsigned char a = X; a <= Z; ++a) {
|
for (unsigned char a = X; a <= Z; ++a) {
|
||||||
if (has_xyz || line.has(a)) {
|
if (has_xyz || line.has(a)) {
|
||||||
p = m_cached_position.position[a];
|
p = float(m_cached_position.position[a]);
|
||||||
if (p != FLT_MAX)
|
if (p != FLT_MAX)
|
||||||
m_start_position[a] = p;
|
m_start_position[a] = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p = m_cached_position.position[E];
|
p = float(m_cached_position.position[E]);
|
||||||
if (p != FLT_MAX)
|
if (p != FLT_MAX)
|
||||||
m_start_position[E] = p;
|
m_start_position[E] = p;
|
||||||
|
|
||||||
@ -2529,8 +2530,8 @@ void GCodeProcessor::store_move_vertex(EMoveType type)
|
|||||||
m_extrusion_role,
|
m_extrusion_role,
|
||||||
m_extruder_id,
|
m_extruder_id,
|
||||||
m_cp_color.current,
|
m_cp_color.current,
|
||||||
Vec3f(m_end_position[X], m_end_position[Y], m_end_position[Z]) + m_extruder_offsets[m_extruder_id],
|
Vec3f(float(m_end_position[X]), float(m_end_position[Y]), float(m_end_position[Z])) + m_extruder_offsets[m_extruder_id],
|
||||||
m_end_position[E] - m_start_position[E],
|
float(m_end_position[E] - m_start_position[E]),
|
||||||
m_feedrate,
|
m_feedrate,
|
||||||
m_width,
|
m_width,
|
||||||
m_height,
|
m_height,
|
||||||
|
@ -422,7 +422,7 @@ namespace Slic3r {
|
|||||||
unsigned char m_extruder_id;
|
unsigned char m_extruder_id;
|
||||||
ExtruderColors m_extruder_colors;
|
ExtruderColors m_extruder_colors;
|
||||||
std::vector<float> m_filament_diameters;
|
std::vector<float> m_filament_diameters;
|
||||||
float m_extruded_last_z;
|
double m_extruded_last_z;
|
||||||
unsigned int m_g1_line_id;
|
unsigned int m_g1_line_id;
|
||||||
unsigned int m_layer_id;
|
unsigned int m_layer_id;
|
||||||
CpColor m_cp_color;
|
CpColor m_cp_color;
|
||||||
|
@ -5956,9 +5956,9 @@ bool DynamicPrintConfig::value_changed(const t_config_option_key& opt_key, const
|
|||||||
ConfigOptionFloatOrPercent* width_option = this->option<ConfigOptionFloatOrPercent>(opt_key);
|
ConfigOptionFloatOrPercent* width_option = this->option<ConfigOptionFloatOrPercent>(opt_key);
|
||||||
if (layer_height_option && width_option && nozzle_diameter_option) {
|
if (layer_height_option && width_option && nozzle_diameter_option) {
|
||||||
//compute spacing with current height and change the width
|
//compute spacing with current height and change the width
|
||||||
double max_nozzle_diameter = 0;
|
float max_nozzle_diameter = 0;
|
||||||
for (double dmr : nozzle_diameter_option->values)
|
for (double dmr : nozzle_diameter_option->values)
|
||||||
max_nozzle_diameter = std::max(max_nozzle_diameter, dmr);
|
max_nozzle_diameter = std::max(max_nozzle_diameter, (float)dmr);
|
||||||
ConfigOptionFloatOrPercent* spacing_option = nullptr;
|
ConfigOptionFloatOrPercent* spacing_option = nullptr;
|
||||||
try {
|
try {
|
||||||
if (opt_key == "extrusion_width") {
|
if (opt_key == "extrusion_width") {
|
||||||
|
@ -1334,33 +1334,33 @@ void MainFrame::init_menubar_as_editor()
|
|||||||
#else
|
#else
|
||||||
wxString hotkey_delete = "Del";
|
wxString hotkey_delete = "Del";
|
||||||
#endif
|
#endif
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Select all") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + "A",
|
append_menu_item(editMenu, wxID_ANY, _L("&Select all") + "\t" + GUI::shortkey_ctrl_prefix() + "A",
|
||||||
_L("Selects all objects"), [this](wxCommandEvent&) { m_plater->select_all(); },
|
_L("Selects all objects"), [this](wxCommandEvent&) { m_plater->select_all(); },
|
||||||
"", nullptr, [this](){return can_select(); }, this);
|
"", nullptr, [this](){return can_select(); }, this);
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("D&eselect all") + "\t" + "Esc",
|
append_menu_item(editMenu, wxID_ANY, _L("D&eselect all") + sep + "Esc",
|
||||||
_L("Deselects all objects"), [this](wxCommandEvent&) { m_plater->deselect_all(); },
|
_L("Deselects all objects"), [this](wxCommandEvent&) { m_plater->deselect_all(); },
|
||||||
"", nullptr, [this](){return can_deselect(); }, this);
|
"", nullptr, [this](){return can_deselect(); }, this);
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Delete selected") + "\t" + hotkey_delete,
|
append_menu_item(editMenu, wxID_ANY, _L("&Delete selected") + "\t" + hotkey_delete,
|
||||||
_L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); },
|
_L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); },
|
||||||
"remove_menu", nullptr, [this](){return can_delete(); }, this);
|
"remove_menu", nullptr, [this](){return can_delete(); }, this);
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("Delete &all") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + hotkey_delete,
|
append_menu_item(editMenu, wxID_ANY, _L("Delete &all") + "\t" + GUI::shortkey_ctrl_prefix() + hotkey_delete,
|
||||||
_L("Deletes all objects"), [this](wxCommandEvent&) { m_plater->reset_with_confirm(); },
|
_L("Deletes all objects"), [this](wxCommandEvent&) { m_plater->reset_with_confirm(); },
|
||||||
"delete_all_menu", nullptr, [this](){return can_delete_all(); }, this);
|
"delete_all_menu", nullptr, [this](){return can_delete_all(); }, this);
|
||||||
|
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Undo") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + "Z",
|
append_menu_item(editMenu, wxID_ANY, _L("&Undo") + "\t" + GUI::shortkey_ctrl_prefix() + "Z",
|
||||||
_L("Undo"), [this](wxCommandEvent&) { m_plater->undo(); },
|
_L("Undo"), [this](wxCommandEvent&) { m_plater->undo(); },
|
||||||
"undo_menu", nullptr, [this](){return m_plater->can_undo(); }, this);
|
"undo_menu", nullptr, [this](){return m_plater->can_undo(); }, this);
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Redo") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + "Y",
|
append_menu_item(editMenu, wxID_ANY, _L("&Redo") + "\t" + GUI::shortkey_ctrl_prefix() + "Y",
|
||||||
_L("Redo"), [this](wxCommandEvent&) { m_plater->redo(); },
|
_L("Redo"), [this](wxCommandEvent&) { m_plater->redo(); },
|
||||||
"redo_menu", nullptr, [this](){return m_plater->can_redo(); }, this);
|
"redo_menu", nullptr, [this](){return m_plater->can_redo(); }, this);
|
||||||
|
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Copy") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + "C",
|
append_menu_item(editMenu, wxID_ANY, _L("&Copy") + "\t" + GUI::shortkey_ctrl_prefix() + "C",
|
||||||
_L("Copy selection to clipboard"), [this](wxCommandEvent&) { m_plater->copy_selection_to_clipboard(); },
|
_L("Copy selection to clipboard"), [this](wxCommandEvent&) { m_plater->copy_selection_to_clipboard(); },
|
||||||
"copy_menu", nullptr, [this](){return m_plater->can_copy_to_clipboard(); }, this);
|
"copy_menu", nullptr, [this](){return m_plater->can_copy_to_clipboard(); }, this);
|
||||||
append_menu_item(editMenu, wxID_ANY, _L("&Paste") + "\t" + GUI::shortkey_ctrl_prefix() + sep_space + "V",
|
append_menu_item(editMenu, wxID_ANY, _L("&Paste") + "\t" + GUI::shortkey_ctrl_prefix() + "V",
|
||||||
_L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); },
|
_L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); },
|
||||||
"paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
|
"paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
|
||||||
|
|
||||||
@ -1922,38 +1922,43 @@ void MainFrame::select_tab(Tab* tab)
|
|||||||
MainFrame::ETabType MainFrame::selected_tab() const
|
MainFrame::ETabType MainFrame::selected_tab() const
|
||||||
{
|
{
|
||||||
if (m_layout == ESettingsLayout::Old) {
|
if (m_layout == ESettingsLayout::Old) {
|
||||||
if (m_tabpanel->GetSelection() == 0)
|
if (m_tabpanel->GetSelection() == 0) {
|
||||||
if (m_plater->is_view3D_shown())
|
if (m_plater->is_view3D_shown()) {
|
||||||
return ETabType::Plater3D;
|
return ETabType::Plater3D;
|
||||||
else
|
} else {
|
||||||
return ETabType::PlaterGcode;
|
|
||||||
else
|
|
||||||
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
|
|
||||||
}
|
|
||||||
else if (m_layout == ESettingsLayout::Tabs) {
|
|
||||||
if (m_tabpanel->GetSelection() < 3)
|
|
||||||
return ETabType((uint8_t)ETabType::Plater3D + m_tabpanel->GetSelection());
|
|
||||||
else
|
|
||||||
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 3);
|
|
||||||
}
|
|
||||||
else if (m_layout == ESettingsLayout::Hidden) {
|
|
||||||
if (!m_main_sizer->IsShown(m_tabpanel)) {
|
|
||||||
if (m_plater->is_view3D_shown())
|
|
||||||
return ETabType::Plater3D;
|
|
||||||
else
|
|
||||||
return ETabType::PlaterGcode;
|
return ETabType::PlaterGcode;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
|
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
|
||||||
}
|
}
|
||||||
}
|
} else if (m_layout == ESettingsLayout::Tabs) {
|
||||||
else if (m_layout == ESettingsLayout::Dlg) {
|
if (m_tabpanel->GetSelection() < 3) {
|
||||||
|
return ETabType((uint8_t)ETabType::Plater3D + m_tabpanel->GetSelection());
|
||||||
|
} else {
|
||||||
|
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 3);
|
||||||
|
}
|
||||||
|
} else if (m_layout == ESettingsLayout::Hidden) {
|
||||||
if (!m_main_sizer->IsShown(m_tabpanel)) {
|
if (!m_main_sizer->IsShown(m_tabpanel)) {
|
||||||
if (m_plater->is_view3D_shown())
|
if (m_plater->is_view3D_shown()) {
|
||||||
return ETabType::Plater3D;
|
return ETabType::Plater3D;
|
||||||
else
|
} else {
|
||||||
return ETabType::PlaterGcode;
|
return ETabType::PlaterGcode;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
|
||||||
|
}
|
||||||
|
} else if (m_layout == ESettingsLayout::Dlg) {
|
||||||
|
if (!m_main_sizer->IsShown(m_tabpanel)) {
|
||||||
|
if (m_plater->is_view3D_shown()) {
|
||||||
|
return ETabType::Plater3D;
|
||||||
|
} else {
|
||||||
|
return ETabType::PlaterGcode;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ETabType::Plater3D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ETabType::Plater3D;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFrame::select_tab(ETabType tab /* = Any*/, bool keep_tab_type)
|
void MainFrame::select_tab(ETabType tab /* = Any*/, bool keep_tab_type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user