FIX: the load filament steps shown fault
jira: [STUDIO-9684] Change-Id: Ic238993302156788200482ed34e3092b9ab94dfd
This commit is contained in:
parent
0ab64d0cce
commit
f8b4949353
|
@ -3594,7 +3594,9 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
home_flag = jj["home_flag"].get<int>();
|
||||
parse_status(home_flag);
|
||||
}
|
||||
if (jj.contains("hw_switch_state")) {
|
||||
|
||||
/*the param is invalid in np for Yeshu*/
|
||||
if (!check_enable_np(jj) && jj.contains("hw_switch_state")) {
|
||||
hw_switch_state = jj["hw_switch_state"].get<int>();
|
||||
m_extder_data.extders[MAIN_NOZZLE_ID].ext_has_filament = hw_switch_state;
|
||||
}
|
||||
|
@ -5568,6 +5570,17 @@ NozzleFlowType MachineObject::get_nozzle_flow_type(int extruder_id) const
|
|||
return NozzleFlowType::NONE_FLOWTYPE;
|
||||
}
|
||||
|
||||
const Extder& MachineObject::get_current_extruder() const
|
||||
{
|
||||
if (m_extder_data.extders.size() <= m_extder_data.current_extder_id)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "get_current_extruder() failed";
|
||||
return Extder();
|
||||
}
|
||||
|
||||
return m_extder_data.extders[m_extder_data.current_extder_id];
|
||||
}
|
||||
|
||||
void MachineObject::converse_to_duct(bool is_suppt_part_fun, bool is_suppt_aux_fun, bool is_suppt_cham_fun)
|
||||
{
|
||||
m_air_duct_data.modes.clear();
|
||||
|
@ -5728,7 +5741,7 @@ AmsTray MachineObject::parse_vt_tray(json vtray)
|
|||
return vt_tray;
|
||||
}
|
||||
|
||||
bool MachineObject::check_enable_np(json print) const
|
||||
bool MachineObject::check_enable_np(const json& print) const
|
||||
{
|
||||
if (print.contains("cfg") && print.contains("fun") && print.contains("aux") && print.contains("stat"))
|
||||
{
|
||||
|
|
|
@ -744,6 +744,7 @@ public:
|
|||
/*extruder*/
|
||||
[[nodiscard]] bool is_nozzle_flow_type_supported() const { return is_enable_np; };
|
||||
[[nodiscard]] NozzleFlowType get_nozzle_flow_type(int extruder_id) const;
|
||||
[[nodiscard]] const Extder& get_current_extruder() const;
|
||||
|
||||
//new fan data
|
||||
AirDuctData m_air_duct_data;
|
||||
|
@ -1215,7 +1216,7 @@ public:
|
|||
AmsTray parse_vt_tray(json vtray);
|
||||
|
||||
/*for parse new info*/
|
||||
bool check_enable_np(json print) const;
|
||||
bool check_enable_np(const json& print) const;
|
||||
void parse_new_info(json print);
|
||||
bool is_nozzle_data_invalid();
|
||||
int get_flag_bits(std::string str, int start, int count = 1);
|
||||
|
|
|
@ -1889,6 +1889,8 @@ void StatusBasePanel::show_filament_load_group(bool show)
|
|||
m_img_filament_loading->SetBitmap(create_scaled_bitmap("filament_load_fold", this, 24));
|
||||
}
|
||||
m_scale_panel->Show(show);
|
||||
m_filament_step->SetupSteps(obj->get_current_extruder().ext_has_filament);
|
||||
|
||||
m_show_filament_group = show;
|
||||
Layout();
|
||||
Fit();
|
||||
|
@ -3085,7 +3087,7 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
}
|
||||
|
||||
if (ams_loading_state) {
|
||||
update_filament_step();
|
||||
update_load_with_temp();
|
||||
m_filament_step->updateID(std::atoi(obj->m_ams_id.c_str()), std::atoi(obj->m_tray_id.c_str()));
|
||||
|
||||
bool busy_for_vt_loading = false;
|
||||
|
@ -3886,9 +3888,8 @@ void StatusPanel::on_ams_load(SimpleEvent &event)
|
|||
on_ams_load_curr();
|
||||
}
|
||||
|
||||
void StatusPanel::update_filament_step()
|
||||
void StatusPanel::update_load_with_temp()
|
||||
{
|
||||
m_filament_step->UpdateStepCtrl(obj->is_filament_at_extruder());
|
||||
if (!obj->is_filament_at_extruder()) {
|
||||
m_is_load_with_temp = true;
|
||||
}
|
||||
|
@ -3904,7 +3905,7 @@ void StatusPanel::on_ams_load_curr()
|
|||
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
|
||||
|
||||
|
||||
update_filament_step();
|
||||
update_load_with_temp();
|
||||
//virtual tray
|
||||
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_MAIN_ID)) == 0) {
|
||||
int old_temp = -1;
|
||||
|
|
|
@ -644,7 +644,7 @@ protected:
|
|||
|
||||
/* extruder apis */
|
||||
void on_ams_load(SimpleEvent &event);
|
||||
void update_filament_step();
|
||||
void update_load_with_temp();
|
||||
void on_ams_load_curr();
|
||||
void on_ams_load_vams(wxCommandEvent& event);
|
||||
void on_ams_switch(SimpleEvent &event);
|
||||
|
|
|
@ -124,7 +124,7 @@ void FilamentLoad::SetFilamentStep(FilamentStep item_idx, FilamentStepType f_typ
|
|||
step_control->SetSlotInformation(slot_info);
|
||||
}
|
||||
|
||||
void FilamentLoad::UpdateStepCtrl(bool has_fila_to_switch) {
|
||||
void FilamentLoad::SetupSteps(bool has_fila_to_switch) {
|
||||
m_filament_load_steps->DeleteAllItems();
|
||||
m_filament_unload_steps->DeleteAllItems();
|
||||
m_filament_vt_load_steps->DeleteAllItems();
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
void SetFilamentStep(FilamentStep item_idx, FilamentStepType f_type);
|
||||
void ShowFilamentTip(bool hasams = true);
|
||||
|
||||
void UpdateStepCtrl(bool is_extrusion_exist);
|
||||
void SetupSteps(bool is_extrusion_exist);
|
||||
|
||||
void show_nofilament_mode(bool show);
|
||||
void updateID(int ams_id, int slot_id) { m_ams_id = ams_id; m_slot_id = slot_id; };
|
||||
|
|
Loading…
Reference in New Issue