mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 20:28:08 -06:00
ENH: do not show the functions if it is not supported
Change-Id: Iaee9c756f40fd26c376160e9cda305bee88d713b Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
eaf7f87abb
commit
55b6bc5563
5 changed files with 69 additions and 4 deletions
|
@ -200,6 +200,11 @@ void AMSSetting::create()
|
||||||
m_panel_img->Layout();
|
m_panel_img->Layout();
|
||||||
m_sizer_img->Fit(m_panel_img);
|
m_sizer_img->Fit(m_panel_img);
|
||||||
|
|
||||||
|
m_sizer_remain_block = new wxBoxSizer(wxVERTICAL);
|
||||||
|
m_sizer_remain_block->Add(m_sizer_remain, 0, wxEXPAND | wxTOP, FromDIP(8));
|
||||||
|
m_sizer_remain_block->Add(0, 0, 0, wxTOP, 8);
|
||||||
|
m_sizer_remain_block->Add(m_sizer_remain_tip, 0, wxLEFT, 18);
|
||||||
|
m_sizer_remain_block->Add(0, 0, 0, wxTOP, 15);
|
||||||
|
|
||||||
m_sizerl_body->Add(m_sizer_Insert_material, 0, wxEXPAND, 0);
|
m_sizerl_body->Add(m_sizer_Insert_material, 0, wxEXPAND, 0);
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
||||||
|
@ -209,10 +214,7 @@ void AMSSetting::create()
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
||||||
m_sizerl_body->Add(m_sizer_starting_tip, 0, wxLEFT, 18);
|
m_sizerl_body->Add(m_sizer_starting_tip, 0, wxLEFT, 18);
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 15);
|
m_sizerl_body->Add(0, 0, 0, wxTOP, 15);
|
||||||
m_sizerl_body->Add(m_sizer_remain, 0, wxEXPAND | wxTOP, FromDIP(8));
|
m_sizerl_body->Add(m_sizer_remain_block, 0, wxEXPAND, 0);
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
|
||||||
m_sizerl_body->Add(m_sizer_remain_tip, 0, wxLEFT, 18);
|
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 15);
|
|
||||||
m_sizerl_body->Add(m_sizer_switch_filament, 0, wxEXPAND | wxTOP, FromDIP(8));
|
m_sizerl_body->Add(m_sizer_switch_filament, 0, wxEXPAND | wxTOP, FromDIP(8));
|
||||||
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
m_sizerl_body->Add(0, 0, 0, wxTOP, 8);
|
||||||
m_sizerl_body->Add(m_sizer_switch_filament_tip, 0, wxLEFT, 18);
|
m_sizerl_body->Add(m_sizer_switch_filament_tip, 0, wxLEFT, 18);
|
||||||
|
@ -231,6 +233,17 @@ void AMSSetting::create()
|
||||||
|
|
||||||
this->Centre(wxBOTH);
|
this->Centre(wxBOTH);
|
||||||
wxGetApp().UpdateDlgDarkUI(this);
|
wxGetApp().UpdateDlgDarkUI(this);
|
||||||
|
|
||||||
|
Bind(wxEVT_SHOW, [this](auto& e) {
|
||||||
|
if (this->IsShown()) {
|
||||||
|
if (ams_support_remain) {
|
||||||
|
m_sizer_remain_block->Show(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_sizer_remain_block->Show(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMSSetting::update_insert_material_read_mode(bool selected)
|
void AMSSetting::update_insert_material_read_mode(bool selected)
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
wxString append_title(wxString text);
|
wxString append_title(wxString text);
|
||||||
wxStaticText *append_text(wxString text);
|
wxStaticText *append_text(wxString text);
|
||||||
MachineObject *obj{nullptr};
|
MachineObject *obj{nullptr};
|
||||||
|
bool ams_support_remain{false};
|
||||||
int ams_id { 0 };
|
int ams_id { 0 };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -72,6 +73,7 @@ protected:
|
||||||
wxBoxSizer *m_sizer_starting_tip_inline;
|
wxBoxSizer *m_sizer_starting_tip_inline;
|
||||||
wxBoxSizer *m_sizer_remain_inline;
|
wxBoxSizer *m_sizer_remain_inline;
|
||||||
wxBoxSizer *m_sizer_switch_filament_inline;
|
wxBoxSizer *m_sizer_switch_filament_inline;
|
||||||
|
wxBoxSizer *m_sizer_remain_block;
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace Slic3r::GUI
|
}} // namespace Slic3r::GUI
|
||||||
|
|
|
@ -1259,6 +1259,29 @@ bool MachineObject::is_recording()
|
||||||
return camera_recording;
|
return camera_recording;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MachineObject::parse_version_func()
|
||||||
|
{
|
||||||
|
auto ota_version = module_vers.find("ota");
|
||||||
|
if (printer_type == "BL-P001" ||
|
||||||
|
printer_type == "BL-P002") {
|
||||||
|
if (ota_version != module_vers.end()) {
|
||||||
|
if (ota_version->second.sw_ver.compare("01.01.01.00") <= 0) {
|
||||||
|
ams_support_remain = false;
|
||||||
|
ams_support_auto_switch_filament_flag = false;
|
||||||
|
is_xcam_buildplate_supported = false;
|
||||||
|
xcam_support_recovery_step_loss = false;
|
||||||
|
is_support_send_to_sdcard = false;
|
||||||
|
} else {
|
||||||
|
ams_support_remain = true;
|
||||||
|
ams_support_auto_switch_filament_flag = true;
|
||||||
|
is_xcam_buildplate_supported = true;
|
||||||
|
xcam_support_recovery_step_loss = true;
|
||||||
|
is_support_send_to_sdcard = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int MachineObject::command_get_version(bool with_retry)
|
int MachineObject::command_get_version(bool with_retry)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(info) << "command_get_version";
|
BOOST_LOG_TRIVIAL(info) << "command_get_version";
|
||||||
|
@ -1990,9 +2013,15 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
||||||
func_name = "FUNC_AI_MONITORING";
|
func_name = "FUNC_AI_MONITORING";
|
||||||
break;
|
break;
|
||||||
case FUNC_BUILDPLATE_MARKER_DETECT:
|
case FUNC_BUILDPLATE_MARKER_DETECT:
|
||||||
|
parse_version_func();
|
||||||
|
if (!is_xcam_buildplate_supported)
|
||||||
|
return false;
|
||||||
func_name = "FUNC_BUILDPLATE_MARKER_DETECT";
|
func_name = "FUNC_BUILDPLATE_MARKER_DETECT";
|
||||||
break;
|
break;
|
||||||
case FUNC_AUTO_RECOVERY_STEP_LOSS:
|
case FUNC_AUTO_RECOVERY_STEP_LOSS:
|
||||||
|
parse_version_func();
|
||||||
|
if (!xcam_support_recovery_step_loss)
|
||||||
|
return false;
|
||||||
func_name = "FUNC_AUTO_RECOVERY_STEP_LOSS";
|
func_name = "FUNC_AUTO_RECOVERY_STEP_LOSS";
|
||||||
break;
|
break;
|
||||||
case FUNC_FLOW_CALIBRATION:
|
case FUNC_FLOW_CALIBRATION:
|
||||||
|
@ -2026,9 +2055,15 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
||||||
func_name = "FUNC_ALTER_RESOLUTION";
|
func_name = "FUNC_ALTER_RESOLUTION";
|
||||||
break;
|
break;
|
||||||
case FUNC_SEND_TO_SDCARD:
|
case FUNC_SEND_TO_SDCARD:
|
||||||
|
parse_version_func();
|
||||||
|
if (!is_support_send_to_sdcard)
|
||||||
|
return false;
|
||||||
func_name = "FUNC_SEND_TO_SDCARD";
|
func_name = "FUNC_SEND_TO_SDCARD";
|
||||||
break;
|
break;
|
||||||
case FUNC_AUTO_SWITCH_FILAMENT:
|
case FUNC_AUTO_SWITCH_FILAMENT:
|
||||||
|
parse_version_func();
|
||||||
|
if (!ams_support_auto_switch_filament_flag)
|
||||||
|
return false;
|
||||||
func_name = "FUNC_AUTO_SWITCH_FILAMENT";
|
func_name = "FUNC_AUTO_SWITCH_FILAMENT";
|
||||||
break;
|
break;
|
||||||
case FUNC_VIRTUAL_CAMERA:
|
case FUNC_VIRTUAL_CAMERA:
|
||||||
|
@ -2615,6 +2650,9 @@ int MachineObject::parse_json(std::string payload)
|
||||||
else {
|
else {
|
||||||
if (jj["xcam"].contains("buildplate_marker_detector")) {
|
if (jj["xcam"].contains("buildplate_marker_detector")) {
|
||||||
xcam_buildplate_marker_detector = jj["xcam"]["buildplate_marker_detector"].get<bool>();
|
xcam_buildplate_marker_detector = jj["xcam"]["buildplate_marker_detector"].get<bool>();
|
||||||
|
is_xcam_buildplate_supported = true;
|
||||||
|
} else {
|
||||||
|
is_xcam_buildplate_supported = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2874,6 +2912,8 @@ int MachineObject::parse_json(std::string payload)
|
||||||
}
|
}
|
||||||
if (tray_it->contains("remain")) {
|
if (tray_it->contains("remain")) {
|
||||||
curr_tray->remain = (*tray_it)["remain"].get<int>();
|
curr_tray->remain = (*tray_it)["remain"].get<int>();
|
||||||
|
} else {
|
||||||
|
curr_tray->remain = -1;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!ams_id.empty() && !curr_tray->id.empty()) {
|
if (!ams_id.empty() && !curr_tray->id.empty()) {
|
||||||
|
@ -3021,6 +3061,7 @@ int MachineObject::parse_json(std::string payload)
|
||||||
ver_info.hw_ver = (*it)["hw_ver"].get<std::string>();
|
ver_info.hw_ver = (*it)["hw_ver"].get<std::string>();
|
||||||
module_vers.emplace(ver_info.name, ver_info);
|
module_vers.emplace(ver_info.name, ver_info);
|
||||||
}
|
}
|
||||||
|
parse_version_func();
|
||||||
bool get_version_result = true;
|
bool get_version_result = true;
|
||||||
if (j["info"].contains("result"))
|
if (j["info"].contains("result"))
|
||||||
if (j["info"]["result"].get<std::string>() == "fail")
|
if (j["info"]["result"].get<std::string>() == "fail")
|
||||||
|
|
|
@ -423,8 +423,10 @@ public:
|
||||||
bool ams_insert_flag { false };
|
bool ams_insert_flag { false };
|
||||||
bool ams_power_on_flag { false };
|
bool ams_power_on_flag { false };
|
||||||
bool ams_calibrate_remain_flag { false };
|
bool ams_calibrate_remain_flag { false };
|
||||||
|
bool ams_support_auto_switch_filament_flag { true };
|
||||||
bool ams_auto_switch_filament_flag { false };
|
bool ams_auto_switch_filament_flag { false };
|
||||||
bool ams_support_use_ams { false };
|
bool ams_support_use_ams { false };
|
||||||
|
bool ams_support_remain { true };
|
||||||
int ams_humidity;
|
int ams_humidity;
|
||||||
int ams_user_setting_hold_count = 0;
|
int ams_user_setting_hold_count = 0;
|
||||||
AmsStatusMain ams_status_main;
|
AmsStatusMain ams_status_main;
|
||||||
|
@ -579,8 +581,10 @@ public:
|
||||||
bool xcam_ai_monitoring{ false };
|
bool xcam_ai_monitoring{ false };
|
||||||
int xcam_ai_monitoring_hold_count = 0;
|
int xcam_ai_monitoring_hold_count = 0;
|
||||||
std::string xcam_ai_monitoring_sensitivity;
|
std::string xcam_ai_monitoring_sensitivity;
|
||||||
|
bool is_xcam_buildplate_supported { true };
|
||||||
bool xcam_buildplate_marker_detector{ false };
|
bool xcam_buildplate_marker_detector{ false };
|
||||||
int xcam_buildplate_marker_hold_count = 0;
|
int xcam_buildplate_marker_hold_count = 0;
|
||||||
|
bool xcam_support_recovery_step_loss { true };
|
||||||
bool xcam_auto_recovery_step_loss{ false };
|
bool xcam_auto_recovery_step_loss{ false };
|
||||||
int xcam_auto_recovery_hold_count = 0;
|
int xcam_auto_recovery_hold_count = 0;
|
||||||
int ams_print_option_count = 0;
|
int ams_print_option_count = 0;
|
||||||
|
@ -588,6 +592,7 @@ public:
|
||||||
/* sdcard */
|
/* sdcard */
|
||||||
MachineObject::SdcardState sdcard_state { NO_SDCARD };
|
MachineObject::SdcardState sdcard_state { NO_SDCARD };
|
||||||
MachineObject::SdcardState get_sdcard_state();
|
MachineObject::SdcardState get_sdcard_state();
|
||||||
|
bool is_support_send_to_sdcard { true };
|
||||||
|
|
||||||
/* HMS */
|
/* HMS */
|
||||||
std::vector<HMSItem> hms_list;
|
std::vector<HMSItem> hms_list;
|
||||||
|
@ -622,6 +627,8 @@ public:
|
||||||
|
|
||||||
MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip);
|
MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip);
|
||||||
~MachineObject();
|
~MachineObject();
|
||||||
|
|
||||||
|
void parse_version_func();
|
||||||
/* command commands */
|
/* command commands */
|
||||||
int command_get_version(bool with_retry = true);
|
int command_get_version(bool with_retry = true);
|
||||||
int command_request_push_all();
|
int command_request_push_all();
|
||||||
|
|
|
@ -1807,6 +1807,7 @@ void StatusPanel::update_ams(MachineObject *obj)
|
||||||
// update obj in sub dlg
|
// update obj in sub dlg
|
||||||
if (m_ams_setting_dlg) {
|
if (m_ams_setting_dlg) {
|
||||||
m_ams_setting_dlg->obj = obj;
|
m_ams_setting_dlg->obj = obj;
|
||||||
|
|
||||||
if (obj && m_ams_setting_dlg->IsShown()) {
|
if (obj && m_ams_setting_dlg->IsShown()) {
|
||||||
m_ams_setting_dlg->update_insert_material_read_mode(obj->ams_insert_flag);
|
m_ams_setting_dlg->update_insert_material_read_mode(obj->ams_insert_flag);
|
||||||
m_ams_setting_dlg->update_starting_read_mode(obj->ams_power_on_flag);
|
m_ams_setting_dlg->update_starting_read_mode(obj->ams_power_on_flag);
|
||||||
|
@ -2445,6 +2446,7 @@ void StatusPanel::on_ams_setting_click(SimpleEvent &event)
|
||||||
try {
|
try {
|
||||||
int ams_id_int = atoi(ams_id.c_str());
|
int ams_id_int = atoi(ams_id.c_str());
|
||||||
m_ams_setting_dlg->ams_id = ams_id_int;
|
m_ams_setting_dlg->ams_id = ams_id_int;
|
||||||
|
m_ams_setting_dlg->ams_support_remain = obj->ams_support_remain;
|
||||||
m_ams_setting_dlg->Show();
|
m_ams_setting_dlg->Show();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
;
|
;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue