mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-12 02:09:04 +08:00
FIX: fix crash and blank page while cancel printing at 75 percent
jira: [STUDIO-11861] Change-Id: I142df41ade73558849183fd245163cb5a7367f9c
This commit is contained in:
parent
1586835c59
commit
ddf4e9bc9f
@ -722,17 +722,7 @@ MachineObject::~MachineObject()
|
|||||||
model_task = nullptr;
|
model_task = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_slice_info_thread) {
|
free_slice_info();
|
||||||
if (get_slice_info_thread->joinable()) {
|
|
||||||
get_slice_info_thread->join();
|
|
||||||
get_slice_info_thread = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (slice_info) {
|
|
||||||
delete slice_info;
|
|
||||||
slice_info = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto it = amsList.begin(); it != amsList.end(); it++) {
|
for (auto it = amsList.begin(); it != amsList.end(); it++) {
|
||||||
for (auto tray_it = it->second->trayList.begin(); tray_it != it->second->trayList.end(); tray_it++) {
|
for (auto tray_it = it->second->trayList.begin(); tray_it != it->second->trayList.end(); tray_it++) {
|
||||||
@ -5545,10 +5535,6 @@ void MachineObject::set_modeltask(BBLModelTask* task)
|
|||||||
model_task = task;
|
model_task = task;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MachineObject::set_slice_info(BBLSliceInfo *info) {
|
|
||||||
slice_info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MachineObject::update_model_task()
|
void MachineObject::update_model_task()
|
||||||
{
|
{
|
||||||
if (request_model_result > 10) return;
|
if (request_model_result > 10) return;
|
||||||
@ -5646,6 +5632,27 @@ void MachineObject::update_model_task()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MachineObject::free_slice_info()
|
||||||
|
{
|
||||||
|
if (get_slice_info_thread)
|
||||||
|
{
|
||||||
|
if (get_slice_info_thread->joinable())
|
||||||
|
{
|
||||||
|
get_slice_info_thread->interrupt();
|
||||||
|
get_slice_info_thread->join();
|
||||||
|
}
|
||||||
|
|
||||||
|
delete get_slice_info_thread;
|
||||||
|
get_slice_info_thread = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (slice_info)
|
||||||
|
{
|
||||||
|
delete slice_info;
|
||||||
|
slice_info = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MachineObject::update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx)
|
void MachineObject::update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx)
|
||||||
{
|
{
|
||||||
if (!m_agent) return;
|
if (!m_agent) return;
|
||||||
@ -5671,6 +5678,8 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil
|
|||||||
int plate_index = -1;
|
int plate_index = -1;
|
||||||
|
|
||||||
if (!m_agent) return;
|
if (!m_agent) return;
|
||||||
|
if (!slice_info) return;
|
||||||
|
if (get_slice_info_thread->interruption_requested()) { return;}
|
||||||
|
|
||||||
if (plate_idx >= 0) {
|
if (plate_idx >= 0) {
|
||||||
plate_index = plate_idx;
|
plate_index = plate_idx;
|
||||||
|
@ -1302,8 +1302,10 @@ public:
|
|||||||
BBLSubTask* get_subtask();
|
BBLSubTask* get_subtask();
|
||||||
BBLModelTask* get_modeltask();
|
BBLModelTask* get_modeltask();
|
||||||
void set_modeltask(BBLModelTask* task);
|
void set_modeltask(BBLModelTask* task);
|
||||||
void set_slice_info(BBLSliceInfo *info);
|
|
||||||
void update_model_task();
|
void update_model_task();
|
||||||
|
|
||||||
|
void free_slice_info();
|
||||||
void update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx);
|
void update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx);
|
||||||
|
|
||||||
bool m_firmware_valid { false };
|
bool m_firmware_valid { false };
|
||||||
|
@ -2811,8 +2811,7 @@ void SelectMachineDialog::on_print_job_cancel(wxCommandEvent &evt)
|
|||||||
BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
|
BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
|
||||||
if (m_print_job && m_print_job->get_print_stage() == PrintingStageFinished)
|
if (m_print_job && m_print_job->get_print_stage() == PrintingStageFinished)
|
||||||
{
|
{
|
||||||
MessageDialog dlg(this, _L("As the print job has been successfully sent, the cancellation will not bring the print job to a halt. If you need to terminate this job, please stop it in 'Device' page."), _L("Info"), wxYES);
|
wxGetApp().show_dialog(_L("As the print job has been successfully sent, the cancellation will not bring the print job to a halt. If you need to terminate this job, please stop it in 'Device' page."));
|
||||||
dlg.ShowModal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EnableEditing(true);
|
EnableEditing(true);
|
||||||
|
@ -3790,7 +3790,7 @@ void StatusPanel::update_cloud_subtask(MachineObject *obj)
|
|||||||
|
|
||||||
if (is_task_changed(obj)) {
|
if (is_task_changed(obj)) {
|
||||||
obj->set_modeltask(nullptr);
|
obj->set_modeltask(nullptr);
|
||||||
obj->set_slice_info(nullptr);
|
obj->free_slice_info();
|
||||||
reset_printing_values();
|
reset_printing_values();
|
||||||
BOOST_LOG_TRIVIAL(info) << "monitor: change to sub task id = " << obj->subtask_->task_id;
|
BOOST_LOG_TRIVIAL(info) << "monitor: change to sub task id = " << obj->subtask_->task_id;
|
||||||
if (web_request.IsOk() && web_request.GetState() == wxWebRequest::State_Active) {
|
if (web_request.IsOk() && web_request.GetState() == wxWebRequest::State_Active) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user