ENH:synchronize the status of AMS and printers
Change-Id: Ied38fbee8d78a984df9d7a46d3f69b54fea7fef2
This commit is contained in:
parent
cb2f6dd772
commit
1eb96b6979
|
@ -2042,7 +2042,12 @@ void StatusPanel::update_ams(MachineObject *obj)
|
||||||
}
|
}
|
||||||
} else if (obj->ams_status_sub == 0x05) {
|
} else if (obj->ams_status_sub == 0x05) {
|
||||||
if (!obj->is_ams_unload()) {
|
if (!obj->is_ams_unload()) {
|
||||||
m_ams_control->SetFilamentStep(FilamentStep::STEP_PUSH_NEW_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
if(m_is_load_with_temp){
|
||||||
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_CUT_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
||||||
|
}else{
|
||||||
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_PUSH_NEW_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ams_control->SetFilamentStep(FilamentStep::STEP_PUSH_NEW_FILAMENT, FilamentStepType::STEP_TYPE_UNLOAD);
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_PUSH_NEW_FILAMENT, FilamentStepType::STEP_TYPE_UNLOAD);
|
||||||
|
@ -2056,7 +2061,11 @@ void StatusPanel::update_ams(MachineObject *obj)
|
||||||
}
|
}
|
||||||
} else if (obj->ams_status_sub == 0x07) {
|
} else if (obj->ams_status_sub == 0x07) {
|
||||||
if (!obj->is_ams_unload()) {
|
if (!obj->is_ams_unload()) {
|
||||||
m_ams_control->SetFilamentStep(FilamentStep::STEP_PURGE_OLD_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
if (m_is_load_with_temp) {
|
||||||
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_PULL_CURR_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
||||||
|
}else{
|
||||||
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_PURGE_OLD_FILAMENT, FilamentStepType::STEP_TYPE_LOAD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ams_control->SetFilamentStep(FilamentStep::STEP_PURGE_OLD_FILAMENT, FilamentStepType::STEP_TYPE_UNLOAD);
|
m_ams_control->SetFilamentStep(FilamentStep::STEP_PURGE_OLD_FILAMENT, FilamentStepType::STEP_TYPE_UNLOAD);
|
||||||
|
@ -2144,23 +2153,23 @@ void StatusPanel::update_ams_control_state(bool is_support_virtual_tray, bool is
|
||||||
enable[ACTION_BTN_UNLOAD] = false;
|
enable[ACTION_BTN_UNLOAD] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
|
if (obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
|
||||||
enable[ACTION_BTN_LOAD] = false;
|
enable[ACTION_BTN_LOAD] = false;
|
||||||
enable[ACTION_BTN_UNLOAD] = false;
|
enable[ACTION_BTN_UNLOAD] = false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
// select current
|
// select current
|
||||||
if (is_curr_tray_selected) {
|
if (is_curr_tray_selected) {
|
||||||
enable[ACTION_BTN_LOAD] = false;
|
enable[ACTION_BTN_LOAD] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (!obj->is_filament_at_extruder()) {
|
if (!obj->is_filament_at_extruder()) {
|
||||||
enable[ACTION_BTN_UNLOAD] = false;
|
enable[ACTION_BTN_UNLOAD] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->m_tray_now == "255") {
|
// if (obj->m_tray_now == "255") {
|
||||||
enable[ACTION_BTN_UNLOAD] = false;
|
// enable[ACTION_BTN_UNLOAD] = false;
|
||||||
}*/
|
// }
|
||||||
|
|
||||||
m_ams_control->SetActionState(enable);
|
m_ams_control->SetActionState(enable);
|
||||||
}
|
}
|
||||||
|
@ -2587,6 +2596,14 @@ void StatusPanel::on_ams_load_curr()
|
||||||
std::string curr_ams_id = m_ams_control->GetCurentAms();
|
std::string curr_ams_id = m_ams_control->GetCurentAms();
|
||||||
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
|
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
|
||||||
|
|
||||||
|
m_ams_control->UpdateStepCtrl(obj->is_filament_at_extruder());
|
||||||
|
if(!obj->is_filament_at_extruder()){
|
||||||
|
m_is_load_with_temp = true;
|
||||||
|
}else{
|
||||||
|
m_is_load_with_temp = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//virtual tray
|
//virtual tray
|
||||||
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||||
/*if (con_load_dlg == nullptr) {
|
/*if (con_load_dlg == nullptr) {
|
||||||
|
|
|
@ -290,6 +290,7 @@ protected:
|
||||||
int m_last_timelapse = -1;
|
int m_last_timelapse = -1;
|
||||||
int m_last_extrusion = -1;
|
int m_last_extrusion = -1;
|
||||||
int m_last_vcamera = -1;
|
int m_last_vcamera = -1;
|
||||||
|
bool m_is_load_with_temp = false;
|
||||||
|
|
||||||
wxWebRequest web_request;
|
wxWebRequest web_request;
|
||||||
bool bed_temp_input = false;
|
bool bed_temp_input = false;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
namespace Slic3r { namespace GUI {
|
namespace Slic3r { namespace GUI {
|
||||||
|
|
||||||
static const int LOAD_STEP_COUNT = 5;
|
static const int LOAD_STEP_COUNT = 5;
|
||||||
|
static const int LOAD_WITH_TEMP_STEP_COUNT = 3;
|
||||||
static const int UNLOAD_STEP_COUNT = 3;
|
static const int UNLOAD_STEP_COUNT = 3;
|
||||||
static const int VT_LOAD_STEP_COUNT = 4;
|
static const int VT_LOAD_STEP_COUNT = 4;
|
||||||
|
|
||||||
|
@ -2197,7 +2198,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
||||||
AddPage(m_amswin, wxEmptyString, false);
|
AddPage(m_amswin, wxEmptyString, false);
|
||||||
AddPage(m_simplebook_calibration, wxEmptyString, false);
|
AddPage(m_simplebook_calibration, wxEmptyString, false);
|
||||||
|
|
||||||
UpdateStepCtrl();
|
UpdateStepCtrl(false);
|
||||||
|
|
||||||
m_button_extrusion_cali->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_extrusion_cali), NULL, this);
|
m_button_extrusion_cali->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_extrusion_cali), NULL, this);
|
||||||
m_button_extruder_feed->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_load), NULL, this);
|
m_button_extruder_feed->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_load), NULL, this);
|
||||||
|
@ -2403,15 +2404,35 @@ void AMSControl::msw_rescale()
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMSControl::UpdateStepCtrl()
|
void AMSControl::UpdateStepCtrl(bool is_extrusion)
|
||||||
{
|
{
|
||||||
wxString FILAMENT_LOAD_STEP_STRING[LOAD_STEP_COUNT] = {
|
m_filament_load_step->DeleteAllItems();
|
||||||
_L("Heat the nozzle"),
|
m_filament_unload_step->DeleteAllItems();
|
||||||
_L("Cut filament"),
|
m_filament_vt_load_step->DeleteAllItems();
|
||||||
_L("Pull back current filament"),
|
|
||||||
_L("Push new filament into extruder"),
|
if(is_extrusion){
|
||||||
_L("Purge old filament"),
|
wxString FILAMENT_LOAD_STEP_STRING[LOAD_STEP_COUNT] = {
|
||||||
};
|
_L("Heat the nozzle"),
|
||||||
|
_L("Cut filament"),
|
||||||
|
_L("Pull back current filament"),
|
||||||
|
_L("Push new filament into extruder"),
|
||||||
|
_L("Purge old filament"),
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int i = 0; i < LOAD_STEP_COUNT; i++) {
|
||||||
|
m_filament_load_step->AppendItem(FILAMENT_LOAD_STEP_STRING[i]);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
wxString FILAMENT_LOAD_STEP_STRING[LOAD_WITH_TEMP_STEP_COUNT] = {
|
||||||
|
_L("Heat the nozzle"),
|
||||||
|
_L("Push new filament into extruder"),
|
||||||
|
_L("Purge old filament"),
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int i = 0; i < LOAD_WITH_TEMP_STEP_COUNT; i++) {
|
||||||
|
m_filament_load_step->AppendItem(FILAMENT_LOAD_STEP_STRING[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxString VT_TRAY_LOAD_STEP_STRING[VT_LOAD_STEP_COUNT] = {
|
wxString VT_TRAY_LOAD_STEP_STRING[VT_LOAD_STEP_COUNT] = {
|
||||||
_L("Heat the nozzle"),
|
_L("Heat the nozzle"),
|
||||||
|
@ -2426,9 +2447,9 @@ void AMSControl::UpdateStepCtrl()
|
||||||
_L("Pull back current filament")
|
_L("Pull back current filament")
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < LOAD_STEP_COUNT; i++) {
|
// for (int i = 0; i < LOAD_STEP_COUNT; i++) {
|
||||||
m_filament_load_step->AppendItem(FILAMENT_LOAD_STEP_STRING[i]);
|
// m_filament_load_step->AppendItem(FILAMENT_LOAD_STEP_STRING[i]);
|
||||||
}
|
// }
|
||||||
for (int i = 0; i < UNLOAD_STEP_COUNT; i++) {
|
for (int i = 0; i < UNLOAD_STEP_COUNT; i++) {
|
||||||
m_filament_unload_step->AppendItem(FILAMENT_UNLOAD_STEP_STRING[i]);
|
m_filament_unload_step->AppendItem(FILAMENT_UNLOAD_STEP_STRING[i]);
|
||||||
}
|
}
|
||||||
|
@ -2687,7 +2708,7 @@ void AMSControl::SwitchAms(std::string ams_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMSControl::SetFilamentStep(int item_idx, FilamentStepType f_type)
|
void AMSControl::SetFilamentStep(int item_idx, FilamentStepType f_type, bool is_extrusion_exist)
|
||||||
{
|
{
|
||||||
if (item_idx == FilamentStep::STEP_IDLE) {
|
if (item_idx == FilamentStep::STEP_IDLE) {
|
||||||
m_simplebook_right->SetSelection(0);
|
m_simplebook_right->SetSelection(0);
|
||||||
|
|
|
@ -588,11 +588,11 @@ public:
|
||||||
void PlayRridLoading(wxString amsid, wxString canid);
|
void PlayRridLoading(wxString amsid, wxString canid);
|
||||||
void StopRridLoading(wxString amsid, wxString canid);
|
void StopRridLoading(wxString amsid, wxString canid);
|
||||||
|
|
||||||
void SetFilamentStep(int item_idx, FilamentStepType f_type);
|
void SetFilamentStep(int item_idx, FilamentStepType f_type, bool is_extrusion_exist = false);
|
||||||
void ShowFilamentTip(bool hasams = true);
|
void ShowFilamentTip(bool hasams = true);
|
||||||
|
|
||||||
void SetHumidity(std::string amsid, int humidity);
|
void SetHumidity(std::string amsid, int humidity);
|
||||||
void UpdateStepCtrl();
|
void UpdateStepCtrl(bool is_extrusion_exist);
|
||||||
void CreateAms();
|
void CreateAms();
|
||||||
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool has_extrusion_cali = true, bool is_reset = false);
|
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool has_extrusion_cali = true, bool is_reset = false);
|
||||||
void AddAms(AMSinfo info, bool refresh = true);
|
void AddAms(AMSinfo info, bool refresh = true);
|
||||||
|
|
Loading…
Reference in New Issue