mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-20 01:12:09 +00:00
feat: Filament Track Switch (H2-series O2L-FTS) support
The Filament Track Switch (H2-series accessory, product code O2L-FTS) feeds every AMS to both extruders through a two-track switch. Port full support across the device layer, project config, and GUI. Device / config: - Model the switch-aware AMS binding (the set of extruders an AMS can feed and which input track A/B feeds it), switch readiness, the O2L-FTS firmware module, and the fun2 capability bit for checking a slice against installed hardware. - Register has_filament_switcher and enable_filament_dynamic_map as project config that persists with the project and restores from a saved 3mf, and force both back to false on every project/printer/CLI load path. Live device sync is the only thing that sets them true. GUI: - Sidebar sync activates the switch from live device state, attributes each AMS to the extruder its input track feeds, shows a floating status icon (ready / not-calibrated), and surfaces a one-time tip / not-calibrated warning. - Send dialog gains a non-blocking slice-vs-hardware mismatch warning and a blocking error when a slice needs dynamic nozzle mapping but the switch is missing or not set up. - AMS load/unload guards, AMS-view routing glyph + un-calibrated banner + hidden external-spool road, and mapping-popup external-spool lockout. - Filament pickers collapse the per-extruder split into a single deduplicated "AMS filaments" group with a smart-assign toggle when the switch is ready. - Firmware-upgrade panel lists the O2L-FTS accessory and its version. - Device-provided filament-change steps (ams.cfs) drive the change-step display when firmware sends them, including the three switch steps. - "Load current filament" asks which extruder to feed via a FeedDirectionDialog when the switch is calibrated. Inert without the accessory: every path is gated on the switch being installed (MQTT aux bit 29, default off) or ready, both project flags default false, and the per-extruder AMS attribution is byte-identical, so AMS state, the send/load UI, and sliced g-code are unchanged for every printer that does not report a Filament Track Switch.
This commit is contained in:
@@ -1593,6 +1593,58 @@ bool SelectMachineDialog::use_dynamic_nozzle_map() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::slicing_with_fila_switch() const
|
||||
{
|
||||
if (use_dynamic_nozzle_map())
|
||||
return true;
|
||||
|
||||
if (m_print_type == FROM_NORMAL) {
|
||||
auto has_filament_switcher = wxGetApp().preset_bundle->project_config.option<ConfigOptionBool>("has_filament_switcher");
|
||||
if (has_filament_switcher)
|
||||
return has_filament_switcher->value;
|
||||
} else if (m_print_type == FROM_SDCARD_VIEW) {
|
||||
if (m_required_data_plate_data_list.size() > (size_t) m_print_plate_idx) {
|
||||
auto has_filament_switcher = m_required_data_plate_data_list[m_print_plate_idx]->config.option<ConfigOptionBool>("has_filament_switcher");
|
||||
if (has_filament_switcher)
|
||||
return has_filament_switcher->value;
|
||||
}
|
||||
auto has_filament_switcher = m_required_data_config.option<ConfigOptionBool>("has_filament_switcher");
|
||||
if (has_filament_switcher)
|
||||
return has_filament_switcher->value;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::CheckErrorDynamicSwitchNozzle(MachineObject* obj_)
|
||||
{
|
||||
if (!obj_)
|
||||
return false;
|
||||
|
||||
// Advisory only (does not block Send): the file was sliced for a switch state that doesn't
|
||||
// match the installed hardware, so grouping/flush may be suboptimal. Only on firmware that
|
||||
// reports it can check this.
|
||||
if (obj_->is_support_check_track_switch_match_slice_printer && slicing_with_fila_switch() != obj_->GetFilaSwitch()->IsInstalled()) {
|
||||
show_status(PrintDialogStatus::PrintStatusFilaSwitcherSlicingNotMatch,
|
||||
{_L("The Filament Track Switch installed on the printer does not match the slicing file. Please re-slice to avoid print quality issues.")});
|
||||
}
|
||||
|
||||
// The blocking checks below only matter for dynamic nozzle mapping, which requires a switch.
|
||||
if (!use_dynamic_nozzle_map())
|
||||
return true;
|
||||
|
||||
if (!obj_->GetFilaSwitch()->IsInstalled()) {
|
||||
show_status(PrintDialogStatus::PrintStatusFilaSwitcherError, {_L("This print requires a Filament Track Switch. Please install it first.")});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!obj_->GetFilaSwitch()->IsReady()) {
|
||||
show_status(PrintDialogStatus::PrintStatusFilaSwitcherError, {_L("The Filament Track Switch has not been setup. Please setup it first.")});
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SelectMachineDialog::clear_nozzle_mapping()
|
||||
{
|
||||
m_nozzle_mapping_result.clear();
|
||||
@@ -2010,6 +2062,14 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
// Extra-waste warning: allow Send.
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusFilaSwitcherError) {
|
||||
// Missing or un-set-up switch required by the slice: block Send.
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
} else if (status == PrintDialogStatus::PrintStatusFilaSwitcherSlicingNotMatch) {
|
||||
// Advisory slicing/hardware mismatch: allow Send.
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(true);
|
||||
}
|
||||
|
||||
/*enter perpare mode*/
|
||||
@@ -3795,6 +3855,10 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
||||
}
|
||||
}
|
||||
|
||||
// Filament Track Switch: warn on a slicing/hardware mismatch, and block Send when dynamic
|
||||
// nozzle mapping needs a switch that isn't installed or set up. No-op for printers without one.
|
||||
if (!CheckErrorDynamicSwitchNozzle(obj_)) return;
|
||||
|
||||
// Rack print-dispatch nozzle mapping (dynamic V1): request/await the printer's mapping and block
|
||||
// Send while it computes. No-op for non-rack printers.
|
||||
if (!CheckErrorSyncNozzleMappingResultV1(obj_)) return;
|
||||
|
||||
Reference in New Issue
Block a user