ENH:check if waiting for sending to end is supported
Change-Id: I297778c0e0593bd23b0614c043a3e9878ba61947
This commit is contained in:
parent
af5c58574a
commit
66eb52c018
|
@ -3054,8 +3054,12 @@ int MachineObject::parse_json(std::string payload)
|
||||||
this->set_print_state(jj["gcode_state"].get<std::string>());
|
this->set_print_state(jj["gcode_state"].get<std::string>());
|
||||||
}
|
}
|
||||||
if (jj.contains("job_id")) {
|
if (jj.contains("job_id")) {
|
||||||
|
is_support_wait_sending_finish = true;
|
||||||
this->job_id_ = jj["job_id"].get<std::string>();
|
this->job_id_ = jj["job_id"].get<std::string>();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
is_support_wait_sending_finish = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (jj.contains("queue_number")) {
|
if (jj.contains("queue_number")) {
|
||||||
this->queue_number = jj["queue_number"].get<int>();
|
this->queue_number = jj["queue_number"].get<int>();
|
||||||
|
|
|
@ -729,6 +729,7 @@ public:
|
||||||
bool is_support_mqtt_alive {false};
|
bool is_support_mqtt_alive {false};
|
||||||
bool is_support_tunnel_mqtt{false};
|
bool is_support_tunnel_mqtt{false};
|
||||||
bool is_support_motor_noise_cali{false};
|
bool is_support_motor_noise_cali{false};
|
||||||
|
bool is_support_wait_sending_finish{false};
|
||||||
|
|
||||||
int nozzle_max_temperature = -1;
|
int nozzle_max_temperature = -1;
|
||||||
int bed_temperature_limit = -1;
|
int bed_temperature_limit = -1;
|
||||||
|
|
|
@ -397,6 +397,11 @@ void PrintJob::process()
|
||||||
|
|
||||||
auto wait_fn = [this, curr_percent, &obj](int state, std::string job_info) {
|
auto wait_fn = [this, curr_percent, &obj](int state, std::string job_info) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "print_job: get_job_info = " << job_info;
|
BOOST_LOG_TRIVIAL(info) << "print_job: get_job_info = " << job_info;
|
||||||
|
|
||||||
|
if (!obj->is_support_wait_sending_finish) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::string curr_job_id;
|
std::string curr_job_id;
|
||||||
json job_info_j;
|
json job_info_j;
|
||||||
try {
|
try {
|
||||||
|
@ -426,6 +431,7 @@ void PrintJob::process()
|
||||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(1000));
|
boost::this_thread::sleep_for(boost::chrono::milliseconds(1000));
|
||||||
}
|
}
|
||||||
this->update_status(curr_percent, _L("Print task sending times out."));
|
this->update_status(curr_percent, _L("Print task sending times out."));
|
||||||
|
m_plater->update_print_error_info(BAMBU_NETWORK_ERR_TIMEOUT, "Print task sending times out.", "");
|
||||||
BOOST_LOG_TRIVIAL(info) << "print_job: timeout, cancel the job" << obj->job_id_;
|
BOOST_LOG_TRIVIAL(info) << "print_job: timeout, cancel the job" << obj->job_id_;
|
||||||
/* handle tiemout */
|
/* handle tiemout */
|
||||||
obj->command_task_cancel(curr_job_id);
|
obj->command_task_cancel(curr_job_id);
|
||||||
|
|
Loading…
Reference in New Issue