mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-27 01:58:36 -07:00
Line type by default for single extruder single material (#11397)
* line type by default single extruder * Defautl to color print if use multicolor * Update condition for setting view type in GCodeViewer * Refine default view type selection in GCodeViewer Improves logic for selecting the default view type based on nozzle and filament preset counts. Now selects 'Summary' for multiple nozzles, 'ColorPrint' for single nozzle with multiple filaments, and 'FeatureType' otherwise. * Refactor multimaterial detection in GCodeViewer Introduced a 'multimaterial' boolean to clarify logic for detecting multiple filament presets. This improves readability and maintains consistent behavior when setting the view type based on extruder and filament count.
This commit is contained in:
parent
ad7fe3785a
commit
29f4e66715
1 changed files with 11 additions and 3 deletions
|
|
@ -870,15 +870,23 @@ void GCodeViewer::init(ConfigOptionMode mode, PresetBundle* preset_bundle)
|
|||
|
||||
if (preset_bundle)
|
||||
m_nozzle_nums = preset_bundle->get_printer_extruder_count();
|
||||
bool multimaterial = preset_bundle->filament_presets.empty() ? 0 : preset_bundle->filament_presets.size() > 1;
|
||||
|
||||
// set to color print by default if use multi extruders
|
||||
if (m_nozzle_nums > 1) {
|
||||
m_view_type_sel = std::distance(view_type_items.begin(),std::find(view_type_items.begin(), view_type_items.end(), EViewType::Summary));
|
||||
m_view_type_sel = std::distance(view_type_items.begin(),
|
||||
std::find(view_type_items.begin(), view_type_items.end(), EViewType::Summary));
|
||||
set_view_type(EViewType::Summary);
|
||||
} else {
|
||||
m_view_type_sel = std::distance(view_type_items.begin(),std::find(view_type_items.begin(), view_type_items.end(), EViewType::ColorPrint));
|
||||
} else if (multimaterial) {
|
||||
m_view_type_sel = std::distance(view_type_items.begin(),
|
||||
std::find(view_type_items.begin(), view_type_items.end(), EViewType::ColorPrint));
|
||||
set_view_type(EViewType::ColorPrint);
|
||||
} else {
|
||||
m_view_type_sel = std::distance(view_type_items.begin(),
|
||||
std::find(view_type_items.begin(), view_type_items.end(), EViewType::FeatureType));
|
||||
set_view_type(EViewType::FeatureType);
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue