Compare commits

..
Author SHA1 Message Date
Ian Chua b73e9df4f4 test: update profiles for ota update 2026-09-25 14:29:48 +08:00
7 changed files with 209 additions and 421 deletions
+9 -9
View File
@@ -62,19 +62,19 @@ jobs:
for branch in "${branches[@]}"; do for branch in "${branches[@]}"; do
echo "::group::$branch" echo "::group::$branch"
# Use this workflow's own last successful run as the checkpoint. A # post_merge_profiles.yml's own run history, not this workflow's: this
# successful post_merge_profiles.yml run may record an OFL merge as # workflow only ever runs against main (schedule, or workflow_dispatch
# pending without publishing OFL, so its history must not advance # --ref main), so its head branch never varies - filtering ITS history
# this scan's checkpoint. Keep the branch filter aligned with the # by $branch would never match anything except main. post_merge_profiles.yml
# branch being inspected so each branch has its own checkpoint. # genuinely runs per-branch (this dispatch below sets --ref "$branch"),
# A failed daily run naturally gets retried from the previous # so its history is the real per-branch checkpoint. It also means a
# successful daily checkpoint; a branch with no prior run is # failed publish naturally gets retried tomorrow: the checkpoint only
# treated as changed below. # advances on a run that actually succeeded.
# --method GET is required, not cosmetic: gh api defaults to POST # --method GET is required, not cosmetic: gh api defaults to POST
# whenever -f fields are present unless a method is given # whenever -f fields are present unless a method is given
# explicitly, and POST on this list-runs endpoint 404s - confirmed # explicitly, and POST on this list-runs endpoint 404s - confirmed
# on real Actions infrastructure, not just reasoned about. # on real Actions infrastructure, not just reasoned about.
since="$(gh api --method GET "repos/${{ github.repository }}/actions/workflows/ofl-ota-cronjob.yml/runs" \ since="$(gh api --method GET "repos/${{ github.repository }}/actions/workflows/post_merge_profiles.yml/runs" \
-f status=success -f branch="$branch" -f per_page=1 \ -f status=success -f branch="$branch" -f per_page=1 \
--jq '.workflow_runs[0].run_started_at // empty')" --jq '.workflow_runs[0].run_started_at // empty')"
+18 -34
View File
@@ -9,8 +9,6 @@
#include "libslic3r/libslic3r.h" #include "libslic3r/libslic3r.h"
#include "libslic3r/Utils.hpp" #include "libslic3r/Utils.hpp"
#include <slic3r/GUI/DeviceCore/DevDefs.h>
#include <slic3r/GUI/GUI_App.hpp>
namespace Slic3r namespace Slic3r
{ {
@@ -153,48 +151,34 @@ DevFirmwareVersionInfo DevNozzle::GetFirmwareInfo() const
int DevNozzle::GetLogicExtruderId() const int DevNozzle::GetLogicExtruderId() const
{ {
int total_ext_count = GetTotalExtruderCount(); int total_ext_count = GetTotalExtruderCount();
if (total_ext_count == 1) {
if (GUI::wxGetApp().preset_bundle->is_bbl_vendor()) {
if (total_ext_count == 1) {
return LOGIC_UNIQUE_EXTRUDER_ID;
} else if (total_ext_count == 2) {
if (AtLeftExtruder()) {
return LOGIC_L_EXTRUDER_ID;
} else if (AtRightExtruder()) {
return LOGIC_R_EXTRUDER_ID;
}
}
assert(0);
return LOGIC_UNIQUE_EXTRUDER_ID; return LOGIC_UNIQUE_EXTRUDER_ID;
} else if (total_ext_count == 2) {
if (AtLeftExtruder()) {
return LOGIC_L_EXTRUDER_ID;
} else if (AtRightExtruder()) {
return LOGIC_R_EXTRUDER_ID;
}
} }
// For some reason, BBL's logical extruder ID is inverted: assert(0);
// physical extruder id = 0 (MAIN_EXTRUDER_ID) vs logical extruder id = 1 (LOGIC_R_EXTRUDER_ID) return LOGIC_UNIQUE_EXTRUDER_ID;
// Likely because logical id reads from left to right (left = 0, right = 1)
// For generic N extruders, this inversion does not apply.
if (IsOnRack()) return INVALID_EXTRUDER_ID;
return m_nozzle_id;
} }
int DevNozzle::GetExtruderId() const int DevNozzle::GetExtruderId() const
{ {
if (GUI::wxGetApp().preset_bundle->is_bbl_vendor()) { int total_ext_count = GetTotalExtruderCount();
int total_ext_count = GetTotalExtruderCount(); if (total_ext_count == 1) {
if (total_ext_count == 1) {
return MAIN_EXTRUDER_ID;
} else if (total_ext_count == 2) {
if (AtRightExtruder()) {
return MAIN_EXTRUDER_ID;
} else if (AtLeftExtruder()) {
return DEPUTY_EXTRUDER_ID;
}
}
return MAIN_EXTRUDER_ID; return MAIN_EXTRUDER_ID;
} else if (total_ext_count == 2) {
if (AtRightExtruder()) {
return MAIN_EXTRUDER_ID;
} else if (AtLeftExtruder()) {
return DEPUTY_EXTRUDER_ID;
}
} }
return m_nozzle_id; return MAIN_EXTRUDER_ID;
} }
bool DevNozzle::AtLeftExtruder() const bool DevNozzle::AtLeftExtruder() const
+12 -17
View File
@@ -1199,24 +1199,19 @@ int MachineObject::get_bed_temperature_limit()
bool MachineObject::is_filament_installed() bool MachineObject::is_filament_installed()
{ {
// if (m_extder_system->GetTotalExtderCount() > 0) { if (m_extder_system->GetTotalExtderCount() > 0) {
// // right//or single // right//or single
// auto ext = m_extder_system->m_extders[MAIN_EXTRUDER_ID]; auto ext = m_extder_system->m_extders[MAIN_EXTRUDER_ID];
// if (ext.m_ext_has_filament) { if (ext.m_ext_has_filament) {
// return true;
// }
// }
// /*left*/
// if (m_extder_system->GetTotalExtderCount() > 1) {
// auto ext = m_extder_system->m_extders[DEPUTY_EXTRUDER_ID];
// if (ext.m_ext_has_filament) {
// return true;
// }
// }
for (auto& ext : m_extder_system->m_extders) {
if (ext.m_ext_has_filament)
return true; return true;
}
}
/*left*/
if (m_extder_system->GetTotalExtderCount() > 1) {
auto ext = m_extder_system->m_extders[DEPUTY_EXTRUDER_ID];
if (ext.m_ext_has_filament) {
return true;
}
} }
return false; return false;
} }
+168 -345
View File
@@ -1875,25 +1875,13 @@ wxBoxSizer *StatusBasePanel::create_misc_control(wxWindow *parent)
void StatusBasePanel::reset_temp_misc_control() void StatusBasePanel::reset_temp_misc_control()
{ {
// reset temp string // reset temp string
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->SetIconNormal();
m_tempCtrl_nozzle->SetIconNormal(); m_tempCtrl_nozzle->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_nozzle->SetLabel(TEMP_BLANK_STR); m_tempCtrl_nozzle->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_nozzle->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_nozzle_deputy->SetIconNormal(); m_tempCtrl_nozzle_deputy->SetIconNormal();
m_tempCtrl_nozzle_deputy->SetLabel(TEMP_BLANK_STR); m_tempCtrl_nozzle_deputy->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_nozzle_deputy->GetTextCtrl()->SetValue(TEMP_BLANK_STR); m_tempCtrl_nozzle_deputy->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_nozzle->Enable(true);
m_tempCtrl_nozzle_deputy->Enable(true);
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles) {
tempCtrl->SetIconNormal();
tempCtrl->SetLabel(TEMP_BLANK_STR);
tempCtrl->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
tempCtrl->Enable(true);
}
}
m_tempCtrl_bed->SetIconNormal(); m_tempCtrl_bed->SetIconNormal();
m_tempCtrl_bed->SetLabel(TEMP_BLANK_STR); m_tempCtrl_bed->SetLabel(TEMP_BLANK_STR);
@@ -1903,6 +1891,8 @@ void StatusBasePanel::reset_temp_misc_control()
m_tempCtrl_chamber->SetLabel(TEMP_BLANK_STR); m_tempCtrl_chamber->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_chamber->GetTextCtrl()->SetValue(TEMP_BLANK_STR); m_tempCtrl_chamber->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_nozzle->Enable(true);
m_tempCtrl_nozzle_deputy->Enable(true);
m_tempCtrl_chamber->Enable(true); m_tempCtrl_chamber->Enable(true);
m_tempCtrl_bed->Enable(true); m_tempCtrl_bed->Enable(true);
@@ -2473,26 +2463,12 @@ void StatusPanel::wire_controls()
if (id == m_tempCtrl_bed->GetType()) { if (id == m_tempCtrl_bed->GetType()) {
on_set_bed_temp(); on_set_bed_temp();
} else if (id == m_tempCtrl_nozzle->GetType()) { } else if (id == m_tempCtrl_nozzle->GetType()) {
// NOTE: this check assumes any future m_tempCtrl_nozzles population constructs those if (e.GetString() == wxString::Format("%d", MAIN_EXTRUDER_ID)) {
// TempInput widgets with the same "type" id as m_tempCtrl_nozzle (as m_tempCtrl_nozzle_deputy on_set_nozzle_temp(MAIN_EXTRUDER_ID);
// already does today), so their events route into this branch too. } else if (e.GetString() == wxString::Format("%d", DEPUTY_EXTRUDER_ID)) {
if (wxGetApp().preset_bundle->is_bbl_vendor()) { on_set_nozzle_temp(DEPUTY_EXTRUDER_ID);
if (e.GetString() == wxString::Format("%d", MAIN_EXTRUDER_ID)) {
on_set_nozzle_temp(MAIN_EXTRUDER_ID);
} else if (e.GetString() == wxString::Format("%d", DEPUTY_EXTRUDER_ID)) {
on_set_nozzle_temp(DEPUTY_EXTRUDER_ID);
} else {
on_set_nozzle_temp(UNIQUE_EXTRUDER_ID);//there is only one nozzle
}
} else { } else {
// N-extruder widgets all share TEMP_OF_NORMAL_TYPE, so e.GetString() can't on_set_nozzle_temp(UNIQUE_EXTRUDER_ID);//there is only one nozzle
// disambiguate them; identify the one that fired by object identity instead.
for (size_t i = 0; i < m_tempCtrl_nozzles.size(); ++i) {
if (m_tempCtrl_nozzles[i] == e.GetEventObject()) {
on_set_nozzle_temp((int)i);
break;
}
}
} }
} else if (id == m_tempCtrl_chamber->GetType()) { } else if (id == m_tempCtrl_chamber->GetType()) {
if (!m_tempCtrl_chamber->IsOnChanging()) { if (!m_tempCtrl_chamber->IsOnChanging()) {
@@ -2517,17 +2493,10 @@ void StatusPanel::wire_controls()
m_setting_button->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(StatusPanel::on_camera_enter), NULL, this); m_setting_button->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(StatusPanel::on_camera_enter), NULL, this);
m_tempCtrl_bed->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_kill_focus), NULL, this); m_tempCtrl_bed->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_kill_focus), NULL, this);
m_tempCtrl_bed->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_set_focus), NULL, this); m_tempCtrl_bed->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_set_focus), NULL, this);
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this); m_tempCtrl_nozzle->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
m_tempCtrl_nozzle->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this); m_tempCtrl_nozzle_deputy->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle_deputy->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this); m_tempCtrl_nozzle_deputy->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
m_tempCtrl_nozzle_deputy->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles) {
tempCtrl->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
tempCtrl->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
}
}
m_tempCtrl_chamber->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_kill_focus), NULL, this); m_tempCtrl_chamber->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_kill_focus), NULL, this);
m_tempCtrl_chamber->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_set_focus), NULL, this); m_tempCtrl_chamber->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_set_focus), NULL, this);
m_switch_lamp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_lamp_switch), NULL, this); m_switch_lamp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_lamp_switch), NULL, this);
@@ -2588,19 +2557,11 @@ StatusPanel::~StatusPanel()
m_setting_button->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(StatusPanel::on_camera_enter), NULL, this); m_setting_button->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(StatusPanel::on_camera_enter), NULL, this);
m_tempCtrl_bed->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_kill_focus), NULL, this); m_tempCtrl_bed->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_kill_focus), NULL, this);
m_tempCtrl_bed->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_set_focus), NULL, this); m_tempCtrl_bed->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_set_focus), NULL, this);
m_tempCtrl_nozzle->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle_deputy->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this); m_tempCtrl_nozzle_deputy->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
m_tempCtrl_nozzle->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
m_tempCtrl_nozzle_deputy->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle_deputy->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles) {
tempCtrl->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
tempCtrl->Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
}
}
m_switch_lamp->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_lamp_switch), NULL, this); m_switch_lamp->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_lamp_switch), NULL, this);
/*m_switch_nozzle_fan->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_nozzle_fan_switch), NULL, this); /*m_switch_nozzle_fan->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_nozzle_fan_switch), NULL, this);
@@ -3070,14 +3031,8 @@ void StatusPanel::show_printing_status(bool ctrl_area, bool temp_area)
} }
if (!temp_area) { if (!temp_area) {
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->Enable(false);
m_tempCtrl_nozzle->Enable(false); m_tempCtrl_nozzle_deputy->Enable(false);
m_tempCtrl_nozzle_deputy->Enable(false);
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles)
tempCtrl->Enable(false);
}
m_tempCtrl_bed->Enable(false); m_tempCtrl_bed->Enable(false);
m_tempCtrl_chamber->Enable(false); m_tempCtrl_chamber->Enable(false);
m_switch_speed->Enable(false); m_switch_speed->Enable(false);
@@ -3088,14 +3043,8 @@ void StatusPanel::show_printing_status(bool ctrl_area, bool temp_area)
m_switch_cham_fan->Enable(false);*/ m_switch_cham_fan->Enable(false);*/
m_switch_fan->Enable(false); m_switch_fan->Enable(false);
} else { } else {
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->Enable();
m_tempCtrl_nozzle->Enable(); m_tempCtrl_nozzle_deputy->Enable();
m_tempCtrl_nozzle_deputy->Enable();
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles)
tempCtrl->Enable();
}
m_tempCtrl_bed->Enable(); m_tempCtrl_bed->Enable();
m_tempCtrl_chamber->Enable(); m_tempCtrl_chamber->Enable();
m_switch_speed->Enable(); m_switch_speed->Enable();
@@ -3124,18 +3073,11 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
m_tempCtrl_bed->SetMaxTemp(limit); m_tempCtrl_bed->SetMaxTemp(limit);
if (obj->nozzle_temp_range.size() >= 2) { if (obj->nozzle_temp_range.size() >= 2) {
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->SetMinTemp(obj->nozzle_temp_range[0]);
m_tempCtrl_nozzle->SetMinTemp(obj->nozzle_temp_range[0]); m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_temp_range[1]);
m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_temp_range[1]);
m_tempCtrl_nozzle_deputy->SetMinTemp(obj->nozzle_temp_range[0]); m_tempCtrl_nozzle_deputy->SetMinTemp(obj->nozzle_temp_range[0]);
m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_temp_range[1]); m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_temp_range[1]);
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles) {
tempCtrl->SetMinTemp(obj->nozzle_temp_range[0]);
tempCtrl->SetMaxTemp(obj->nozzle_temp_range[1]);
}
}
} }
// update temprature if not input temp target // update temprature if not input temp target
@@ -3153,118 +3095,76 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
bool to_update_layout = false; bool to_update_layout = false;
int nozzle_num = obj->GetExtderSystem()->GetTotalExtderCount(); int nozzle_num = obj->GetExtderSystem()->GetTotalExtderCount();
if (nozzle_num == 1)
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
if (nozzle_num == 1)
{
m_tempCtrl_nozzle->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(MAIN_EXTRUDER_ID));
m_tempCtrl_nozzle->SetCurrType(TEMP_OF_NORMAL_TYPE);
m_tempCtrl_nozzle_deputy->SetCurrType(TEMP_OF_NORMAL_TYPE);
m_tempCtrl_nozzle_deputy->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_nozzle_deputy->Hide();
if (m_tempCtrl_nozzle->GetMinSize() != TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON)
{
to_update_layout = true;
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON);
}
}
else if (nozzle_num == 2)
{
m_tempCtrl_nozzle->SetCurrType(TEMP_OF_MAIN_NOZZLE_TYPE);
m_tempCtrl_nozzle->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(MAIN_EXTRUDER_ID));
m_tempCtrl_nozzle->Show();
m_tempCtrl_nozzle_deputy->SetCurrType(TEMP_OF_DEPUTY_NOZZLE_TYPE);
m_tempCtrl_nozzle_deputy->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(DEPUTY_EXTRUDER_ID));
m_tempCtrl_nozzle_deputy->Show();
if (m_tempCtrl_nozzle->GetMinSize() != TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON)
{
to_update_layout = true;
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON);
}
}
}
else
{ {
m_tempCtrl_nozzle->Hide(); m_tempCtrl_nozzle->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(MAIN_EXTRUDER_ID));
m_tempCtrl_nozzle->SetCurrType(TEMP_OF_NORMAL_TYPE);
m_tempCtrl_nozzle_deputy->SetCurrType(TEMP_OF_NORMAL_TYPE);
m_tempCtrl_nozzle_deputy->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_nozzle_deputy->Hide(); m_tempCtrl_nozzle_deputy->Hide();
for (size_t i = 0; i < m_tempCtrl_nozzles.size(); ++i) if (m_tempCtrl_nozzle->GetMinSize() != TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON)
{ {
m_tempCtrl_nozzles[i]->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent((int)i)); to_update_layout = true;
m_tempCtrl_nozzles[i]->SetCurrType(TEMP_OF_NORMAL_TYPE); m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON);
m_tempCtrl_nozzles[i]->Show(); }
}
else if (nozzle_num == 2)
{
m_tempCtrl_nozzle->SetCurrType(TEMP_OF_MAIN_NOZZLE_TYPE);
m_tempCtrl_nozzle->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(MAIN_EXTRUDER_ID));
m_tempCtrl_nozzle->Show();
m_tempCtrl_nozzle_deputy->SetCurrType(TEMP_OF_DEPUTY_NOZZLE_TYPE);
m_tempCtrl_nozzle_deputy->SetCurrTemp(obj->GetExtderSystem()->GetNozzleTempCurrent(DEPUTY_EXTRUDER_ID));
m_tempCtrl_nozzle_deputy->Show();
if (m_tempCtrl_nozzle->GetMinSize() != TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON)
{
to_update_layout = true;
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON);
} }
} }
if (wxGetApp().preset_bundle->is_bbl_vendor()) { if (m_temp_nozzle_timeout > 0) {
if (m_temp_nozzle_timeout > 0) { m_temp_nozzle_timeout--;
m_temp_nozzle_timeout--; } else {
} else { if (!nozzle_temp_input) {
if (!nozzle_temp_input) { auto main_extder = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID);
auto main_extder = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID); if (main_extder)
if (main_extder) {
m_tempCtrl_nozzle->SetTagTemp(main_extder->GetTargetTemp());
m_tempCtrl_nozzle->SetCurrTemp((int)main_extder->GetCurrentTemp());
if (main_extder->GetTargetTemp() - main_extder->GetCurrentTemp() > TEMP_THRESHOLD_VAL)
{ {
m_tempCtrl_nozzle->SetTagTemp(main_extder->GetTargetTemp()); m_tempCtrl_nozzle->SetIconActive();
m_tempCtrl_nozzle->SetCurrTemp((int)main_extder->GetCurrentTemp()); }
if (main_extder->GetTargetTemp() - main_extder->GetCurrentTemp() > TEMP_THRESHOLD_VAL) else
{ {
m_tempCtrl_nozzle->SetIconActive(); m_tempCtrl_nozzle->SetIconNormal();
}
else
{
m_tempCtrl_nozzle->SetIconNormal();
}
} }
} }
} }
}
if (m_temp_nozzle_deputy_timeout > 0) { if (m_temp_nozzle_deputy_timeout > 0) {
m_temp_nozzle_deputy_timeout--; m_temp_nozzle_deputy_timeout--;
}
else {
if (!nozzle_temp_input && nozzle_num >= 2) {
auto deputy_extder = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID);
if (deputy_extder)
{
m_tempCtrl_nozzle_deputy->SetTagTemp(deputy_extder->GetTargetTemp());
m_tempCtrl_nozzle_deputy->SetCurrTemp((int)deputy_extder->GetCurrentTemp());
if (deputy_extder->GetTargetTemp() - deputy_extder->GetCurrentTemp() > TEMP_THRESHOLD_VAL)
{
m_tempCtrl_nozzle_deputy->SetIconActive();
}
else
{
m_tempCtrl_nozzle_deputy->SetIconNormal();
}
}
}
}
} }
else { else {
assert(m_temp_nozzle_timeouts.size() == m_tempCtrl_nozzles.size()); if (!nozzle_temp_input && nozzle_num >= 2) {
for (size_t i = 0; i < m_temp_nozzle_timeouts.size(); ++i) { auto deputy_extder = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID);
if (m_temp_nozzle_timeouts[i] > 0) { if (deputy_extder)
m_temp_nozzle_timeouts[i]--; {
} else { m_tempCtrl_nozzle_deputy->SetTagTemp(deputy_extder->GetTargetTemp());
if (!nozzle_temp_input) { m_tempCtrl_nozzle_deputy->SetCurrTemp((int)deputy_extder->GetCurrentTemp());
auto extder = obj->GetExtderSystem()->GetExtderById(i); if (deputy_extder->GetTargetTemp() - deputy_extder->GetCurrentTemp() > TEMP_THRESHOLD_VAL)
if (extder) {
{ m_tempCtrl_nozzle_deputy->SetIconActive();
m_tempCtrl_nozzles[i]->SetTagTemp(extder->GetTargetTemp()); }
m_tempCtrl_nozzles[i]->SetCurrTemp((int)extder->GetCurrentTemp()); else
if (extder->GetTargetTemp() - extder->GetCurrentTemp() > TEMP_THRESHOLD_VAL) {
{ m_tempCtrl_nozzle_deputy->SetIconNormal();
m_tempCtrl_nozzles[i]->SetIconActive();
}
else
{
m_tempCtrl_nozzles[i]->SetIconNormal();
}
}
} }
} }
} }
@@ -3337,15 +3237,10 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
/*extder*/ /*extder*/
auto extder_system = obj->GetExtderSystem(); auto extder_system = obj->GetExtderSystem();
m_nozzle_num = extder_system->GetTotalExtderCount(); m_nozzle_num = extder_system->GetTotalExtderCount();
// m_extruderImage/m_extruder_book only have dedicated pages for 1 and 2 nozzles (see int select_index = m_nozzle_num - 1;
// create_extruder_control()); 3+ reuses the 2-nozzle page and style, which is a cosmetic
// fallback only (ExtruderImage::doRender's own "m_nozzle_num >= 2" branch already draws the
// same two-icon graphic for any count >= 2) -- this just avoids indexing past the vector's end.
int display_num = m_nozzle_num < (int)m_extruderImage.size() ? m_nozzle_num : (int)m_extruderImage.size();
int select_index = display_num - 1;
if (m_nozzle_num >= 2) { if (m_nozzle_num >= 2) {
m_extruder_book->SetSelection(display_num); m_extruder_book->SetSelection(m_nozzle_num);
/*style*/ /*style*/
m_nozzle_btn_panel->Show(); m_nozzle_btn_panel->Show();
@@ -3391,7 +3286,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
} }
} else { } else {
m_nozzle_btn_panel->Hide(); m_nozzle_btn_panel->Hide();
m_extruder_book->SetSelection(display_num); m_extruder_book->SetSelection(m_nozzle_num);
m_extruderImage[select_index]->setExtruderCount(m_nozzle_num); m_extruderImage[select_index]->setExtruderCount(m_nozzle_num);
if (extder_system->GetTotalExtderSize() > 0) if (extder_system->GetTotalExtderSize() > 0)
@@ -3578,50 +3473,34 @@ void StatusPanel::update_ams(MachineObject *obj)
// m_ams_control->SetExtruder(obj->is_filament_at_extruder(), obj->m_extder_data.extders[MAIN_NOZZLE_ID].snow.ams_id, obj->m_extder_data.extders[MAIN_NOZZLE_ID].snow.slot_id); // m_ams_control->SetExtruder(obj->is_filament_at_extruder(), obj->m_extder_data.extders[MAIN_NOZZLE_ID].snow.ams_id, obj->m_extder_data.extders[MAIN_NOZZLE_ID].snow.slot_id);
//} else { //} else {
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
/*right*/ /*right*/
if (obj->GetExtderSystem()->GetTotalExtderCount() > 0) { if (obj->GetExtderSystem()->GetTotalExtderCount() > 0) {
auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID); auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID);
if (ext->HasFilamentInExt()) { if (ext->HasFilamentInExt()) {
if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) { if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3); m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else { } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE); m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), MAIN_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id); } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), MAIN_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id);
}
/*left*/ /*left*/
if (obj->GetExtderSystem()->GetTotalExtderCount() > 1) { if (obj->GetExtderSystem()->GetTotalExtderCount() > 1) {
auto ext = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID); auto ext = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID);
if (ext->HasFilamentInExt()) { if (ext->HasFilamentInExt()) {
if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) { if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3); m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else { } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE); m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), DEPUTY_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id); } else {
} m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
} else {
/*all extruders, in id order*/
for (const auto& ext : obj->GetExtderSystem()->GetExtruders()) {
if (ext.HasFilamentInExt()) {
if (ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
}
m_ams_control->SetExtruder(ext.HasFilamentInExt(), ext.GetExtId(), ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), DEPUTY_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id);
} }
update_filament_loading_panel(obj); update_filament_loading_panel(obj);
@@ -4306,48 +4185,33 @@ void StatusPanel::on_set_nozzle_temp(int nozzle_id)
try { try {
long nozzle_temp; long nozzle_temp;
if (wxGetApp().preset_bundle->is_bbl_vendor()) { if (nozzle_id == MAIN_EXTRUDER_ID) {
if (nozzle_id == MAIN_EXTRUDER_ID) { wxString str = m_tempCtrl_nozzle->GetTextCtrl()->GetValue();
wxString str = m_tempCtrl_nozzle->GetTextCtrl()->GetValue(); if (str.ToLong(&nozzle_temp) && obj) {
if (str.ToLong(&nozzle_temp) && obj) { set_hold_count(m_temp_nozzle_timeout);
set_hold_count(m_temp_nozzle_timeout); if (nozzle_temp > m_tempCtrl_nozzle->get_max_temp()) {
if (nozzle_temp > m_tempCtrl_nozzle->get_max_temp()) { nozzle_temp = m_tempCtrl_nozzle->get_max_temp();
nozzle_temp = m_tempCtrl_nozzle->get_max_temp(); m_tempCtrl_nozzle->SetTagTemp(wxString::Format("%d", nozzle_temp));
m_tempCtrl_nozzle->SetTagTemp(wxString::Format("%d", nozzle_temp)); m_tempCtrl_nozzle->Warning(false);
m_tempCtrl_nozzle->Warning(false);
}
if (m_tempCtrl_nozzle->GetCurrType() == TempInputType::TEMP_OF_NORMAL_TYPE) {
obj->command_set_nozzle(nozzle_temp);
} else {
obj->command_set_nozzle_new(MAIN_EXTRUDER_ID, nozzle_temp);
}
} }
} if (m_tempCtrl_nozzle->GetCurrType() == TempInputType::TEMP_OF_NORMAL_TYPE) {
obj->command_set_nozzle(nozzle_temp);
if (nozzle_id == DEPUTY_EXTRUDER_ID) { } else {
wxString str = m_tempCtrl_nozzle_deputy->GetTextCtrl()->GetValue(); obj->command_set_nozzle_new(MAIN_EXTRUDER_ID, nozzle_temp);
if (str.ToLong(&nozzle_temp) && obj) {
set_hold_count(m_temp_nozzle_deputy_timeout);
if (nozzle_temp > m_tempCtrl_nozzle_deputy->get_max_temp()) {
nozzle_temp = m_tempCtrl_nozzle_deputy->get_max_temp();
m_tempCtrl_nozzle_deputy->SetTagTemp(wxString::Format("%d", nozzle_temp));
m_tempCtrl_nozzle_deputy->Warning(false);
}
obj->command_set_nozzle_new(DEPUTY_EXTRUDER_ID, nozzle_temp);
} }
} }
} }
else if (nozzle_id >= 0 && nozzle_id < (int)m_tempCtrl_nozzles.size()) {
assert(m_tempCtrl_nozzles.size() == m_temp_nozzle_timeouts.size()); if (nozzle_id == DEPUTY_EXTRUDER_ID) {
wxString str = m_tempCtrl_nozzles[nozzle_id]->GetTextCtrl()->GetValue(); wxString str = m_tempCtrl_nozzle_deputy->GetTextCtrl()->GetValue();
if (str.ToLong(&nozzle_temp) && obj) { if (str.ToLong(&nozzle_temp) && obj) {
set_hold_count(m_temp_nozzle_timeouts[nozzle_id]); set_hold_count(m_temp_nozzle_deputy_timeout);
if (nozzle_temp > m_tempCtrl_nozzles[nozzle_id]->get_max_temp()) { if (nozzle_temp > m_tempCtrl_nozzle_deputy->get_max_temp()) {
nozzle_temp = m_tempCtrl_nozzles[nozzle_id]->get_max_temp(); nozzle_temp = m_tempCtrl_nozzle_deputy->get_max_temp();
m_tempCtrl_nozzles[nozzle_id]->SetTagTemp(wxString::Format("%d", nozzle_temp)); m_tempCtrl_nozzle_deputy->SetTagTemp(wxString::Format("%d", nozzle_temp));
m_tempCtrl_nozzles[nozzle_id]->Warning(false); m_tempCtrl_nozzle_deputy->Warning(false);
} }
obj->command_set_nozzle_new(nozzle_id, nozzle_temp); obj->command_set_nozzle_new(DEPUTY_EXTRUDER_ID, nozzle_temp);
} }
} }
} catch (...) { } catch (...) {
@@ -4431,44 +4295,26 @@ void StatusPanel::on_ams_load_curr()
return; return;
} }
// Filament Track Switch is calibrated: the load can go to either/any extruder, so ask // Filament Track Switch is calibrated: the load can go to either extruder, so ask the
// the user which. Record each extruder's currently-loaded slot so the dialog can grey // user which. Record each extruder's currently-loaded slot so the dialog can grey out a
// out a side that already holds this filament. // side that already holds this filament.
// NOTE: FeedDirectionDialog/SetExtruderMapping (Widgets/AMSItem.{hpp,cpp}) take the real std::vector<std::pair<std::string, std::string>> extruderSlots(2, {"", ""});
// extruder count in the non-BBL path now, but that class's own internals haven't been if (auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID); ext.has_value())
// audited for N > 2 -- this only fixes what's local to StatusPanel.cpp. {
int extruder_count; if (ext->HasFilamentInExt())
std::vector<std::pair<std::string, std::string>> extruderSlots;
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
extruder_count = 2;
extruderSlots.assign(2, {"", ""});
if (auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID); ext.has_value())
{ {
if (ext->HasFilamentInExt()) extruderSlots[MAIN_EXTRUDER_ID] = {ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id};
{
extruderSlots[MAIN_EXTRUDER_ID] = {ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id};
}
} }
if (auto ext = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID); ext.has_value()) }
if (auto ext = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID); ext.has_value())
{
if (ext->HasFilamentInExt())
{ {
if (ext->HasFilamentInExt()) extruderSlots[DEPUTY_EXTRUDER_ID] = {ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id};
{
extruderSlots[DEPUTY_EXTRUDER_ID] = {ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id};
}
}
} else {
extruder_count = obj->GetExtderSystem()->GetTotalExtderCount();
extruderSlots.assign(extruder_count, {"", ""});
for (const auto& ext : obj->GetExtderSystem()->GetExtruders())
{
if (ext.HasFilamentInExt())
{
extruderSlots[ext.GetExtId()] = {ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id};
}
} }
} }
FeedDirectionDialog dialog(nullptr, extruder_count, obj->printer_type); FeedDirectionDialog dialog(nullptr, 2, obj->printer_type);
dialog.SetExtruderMapping(obj, curr_ams_id, curr_can_id, extruderSlots); dialog.SetExtruderMapping(obj, curr_ams_id, curr_can_id, extruderSlots);
auto rtn = dialog.ShowModal(); auto rtn = dialog.ShowModal();
@@ -4570,50 +4416,34 @@ void StatusPanel::on_ams_switch(SimpleEvent &event)
{ {
if(obj){ if(obj){
if (wxGetApp().preset_bundle->is_bbl_vendor()) { /*right*/
/*right*/ if (obj->GetExtderSystem()->GetTotalExtderCount() > 0) {
if (obj->GetExtderSystem()->GetTotalExtderCount() > 0) { auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID);
auto ext = obj->GetExtderSystem()->GetExtderById(MAIN_EXTRUDER_ID); if (ext->HasFilamentInExt()) {
if (ext->HasFilamentInExt()) { if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) { m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else { } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE); m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), MAIN_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id); } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), MAIN_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id);
}
/*left*/ /*left*/
if (obj->GetExtderSystem()->GetTotalExtderCount() > 1) { if (obj->GetExtderSystem()->GetTotalExtderCount() > 1) {
auto ext = obj->GetExtderSystem()->GetExtderById(DEPUTY_EXTRUDER_ID); auto ext = obj->GetExtderSystem()->GetExtruders()[DEPUTY_EXTRUDER_ID];
if (ext->HasFilamentInExt()) { if (ext.HasFilamentInExt()) {
if (ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext->GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) { if (ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3); m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else { } else {
m_ams_control->SetAmsStep(ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE); m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
} }
m_ams_control->SetExtruder(ext->HasFilamentInExt(), DEPUTY_EXTRUDER_ID, ext->GetSlotNow().ams_id, ext->GetSlotNow().slot_id); } else {
} m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
} else {
/*all extruders, in id order*/
for (const auto& ext : obj->GetExtderSystem()->GetExtruders()) {
if (ext.HasFilamentInExt()) {
if (ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ext.GetSlotNow().ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, "0", AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3);
} else {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_LOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2);
}
} else {
m_ams_control->SetAmsStep(ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id, AMSPassRoadType::AMS_ROAD_TYPE_UNLOAD, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
}
m_ams_control->SetExtruder(ext.HasFilamentInExt(), ext.GetExtId(), ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id);
} }
m_ams_control->SetExtruder(ext.HasFilamentInExt(), DEPUTY_EXTRUDER_ID, ext.GetSlotNow().ams_id, ext.GetSlotNow().slot_id);
} }
} }
} }
@@ -5539,17 +5369,10 @@ void StatusPanel::msw_rescale()
m_bpButton_xy->Rescale(); m_bpButton_xy->Rescale();
auto size = TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON; auto size = TEMP_CTRL_MIN_SIZE_ALIGN_ONE_ICON;
if (obj && obj->GetExtderSystem()->GetTotalExtderCount() >= 2) size = TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON; if (obj && obj->GetExtderSystem()->GetTotalExtderCount() >= 2) size = TEMP_CTRL_MIN_SIZE_ALIGN_TWO_ICON;
if (wxGetApp().preset_bundle->is_bbl_vendor()) { m_tempCtrl_nozzle->SetMinSize(size);
m_tempCtrl_nozzle->SetMinSize(size); m_tempCtrl_nozzle->Rescale();
m_tempCtrl_nozzle->Rescale(); m_tempCtrl_nozzle_deputy->SetMinSize(size);
m_tempCtrl_nozzle_deputy->SetMinSize(size); m_tempCtrl_nozzle_deputy->Rescale();
m_tempCtrl_nozzle_deputy->Rescale();
} else {
for (auto& tempCtrl : m_tempCtrl_nozzles) {
tempCtrl->SetMinSize(size);
tempCtrl->Rescale();
}
}
m_line_nozzle->SetSize(wxSize(-1, FromDIP(1))); m_line_nozzle->SetSize(wxSize(-1, FromDIP(1)));
m_tempCtrl_bed->SetMinSize(size); m_tempCtrl_bed->SetMinSize(size);
m_tempCtrl_bed->Rescale(); m_tempCtrl_bed->Rescale();
-4
View File
@@ -482,10 +482,6 @@ protected:
int m_temp_nozzle_timeout{ 0 }; int m_temp_nozzle_timeout{ 0 };
TempInput* m_tempCtrl_nozzle_deputy; TempInput* m_tempCtrl_nozzle_deputy;
int m_temp_nozzle_deputy_timeout{ 0 }; int m_temp_nozzle_deputy_timeout{ 0 };
std::vector<TempInput*> m_tempCtrl_nozzles;
std::vector<int> m_temp_nozzle_timeouts;
TempInput * m_tempCtrl_bed; TempInput * m_tempCtrl_bed;
int m_temp_bed_timeout {0}; int m_temp_bed_timeout {0};
TempInput * m_tempCtrl_chamber; TempInput * m_tempCtrl_chamber;
+3 -10
View File
@@ -837,21 +837,14 @@ void MultiNozzleStatusTable::UpdateRackInfo(std::weak_ptr<DevNozzleRack> rack)
bool has_right = false; bool has_right = false;
for (auto& elem : nozzles_in_extruder) { for (auto& elem : nozzles_in_extruder) {
auto& nozzle = elem.second; auto& nozzle = elem.second;
int extruder_id = nozzle.AtLeftExtruder() ? 0 : 1;
int extruder_id{}; if (nozzle.AtRightExtruder())
if (wxGetApp().preset_bundle->is_bbl_vendor()) { has_right = true;
extruder_id = nozzle.AtLeftExtruder() ? 0 : 1;
if (nozzle.AtRightExtruder())
has_right = true;
}
else
extruder_id = nozzle.GetExtruderId();
NozzleVolumeType volume_type = DevNozzle::ToNozzleVolumeType(nozzle.m_nozzle_flow); NozzleVolumeType volume_type = DevNozzle::ToNozzleVolumeType(nozzle.m_nozzle_flow);
m_badge->SetExtruderInfo(extruder_id, format_diameter_to_str(nozzle.GetNozzleDiameter()), volume_type); m_badge->SetExtruderInfo(extruder_id, format_diameter_to_str(nozzle.GetNozzleDiameter()), volume_type);
} }
// TODO: Update for N extruders
m_badge->SetExtruderValid(has_right); m_badge->SetExtruderValid(has_right);
} }
} }
-3
View File
@@ -170,9 +170,6 @@ void TempInput::SetFinish()
wxCommandEvent event(wxCUSTOMEVT_SET_TEMP_FINISH); wxCommandEvent event(wxCUSTOMEVT_SET_TEMP_FINISH);
event.SetInt(temp_type); event.SetInt(temp_type);
event.SetString(wxString::Format("%d", m_input_type)); event.SetString(wxString::Format("%d", m_input_type));
// N-extruder temp controls all share TEMP_OF_NORMAL_TYPE, so the string payload above can't
// tell them apart; carry widget identity so the listener can find which one fired.
event.SetEventObject(this);
wxPostEvent(this->GetParent(), event); wxPostEvent(this->GetParent(), event);
} }