FIX: [4670] Cloud disabled rating interface, displaying error prompt
Jira: STUDIO-4670 Change-Id: Ie571fd042010d5972aaef76063a52b67ef7ccb6a
This commit is contained in:
parent
94c12b11f6
commit
e7b6615a5f
|
@ -4590,6 +4590,7 @@ void MachineObject::update_model_task()
|
||||||
request_model_result++;
|
request_model_result++;
|
||||||
BOOST_LOG_TRIVIAL(info) << "request times: " << request_model_result << " http code: " << http_code;
|
BOOST_LOG_TRIVIAL(info) << "request times: " << request_model_result << " http code: " << http_code;
|
||||||
rating_info = new RatingInfo();
|
rating_info = new RatingInfo();
|
||||||
|
rating_info->http_code = http_code;
|
||||||
if (0 == res && 200 == http_code) {
|
if (0 == res && 200 == http_code) {
|
||||||
try {
|
try {
|
||||||
json rating_json = json::parse(rating_result);
|
json rating_json = json::parse(rating_result);
|
||||||
|
|
|
@ -133,6 +133,7 @@ enum ManualPaCaliMethod {
|
||||||
|
|
||||||
struct RatingInfo {
|
struct RatingInfo {
|
||||||
bool request_successful;
|
bool request_successful;
|
||||||
|
int http_code;
|
||||||
int rating_id;
|
int rating_id;
|
||||||
int start_count;
|
int start_count;
|
||||||
bool success_printed;
|
bool success_printed;
|
||||||
|
|
|
@ -2759,6 +2759,7 @@ void StatusPanel::update_subtask(MachineObject *obj)
|
||||||
} else if (obj->is_in_printing() || obj->print_status == "FINISH") {
|
} else if (obj->is_in_printing() || obj->print_status == "FINISH") {
|
||||||
if (obj->is_in_prepare() || obj->print_status == "SLICING") {
|
if (obj->is_in_prepare() || obj->print_status == "SLICING") {
|
||||||
m_project_task_panel->market_scoring_hide();
|
m_project_task_panel->market_scoring_hide();
|
||||||
|
m_project_task_panel->get_request_failed_panel()->Hide();
|
||||||
m_project_task_panel->enable_abort_button(false);
|
m_project_task_panel->enable_abort_button(false);
|
||||||
m_project_task_panel->enable_pause_resume_button(false, "pause_disable");
|
m_project_task_panel->enable_pause_resume_button(false, "pause_disable");
|
||||||
wxString prepare_text;
|
wxString prepare_text;
|
||||||
|
@ -2828,8 +2829,13 @@ void StatusPanel::update_subtask(MachineObject *obj)
|
||||||
m_project_task_panel->market_scoring_show();
|
m_project_task_panel->market_scoring_show();
|
||||||
} else if (obj && obj->rating_info && !obj->rating_info->request_successful) {
|
} else if (obj && obj->rating_info && !obj->rating_info->request_successful) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "model mall result request failed";
|
BOOST_LOG_TRIVIAL(info) << "model mall result request failed";
|
||||||
m_project_task_panel->get_market_retry_buttom()->Enable(!obj->get_model_mall_result_need_retry);
|
if (403 != obj->rating_info->http_code) {
|
||||||
m_project_task_panel->get_request_failed_panel()->Show();
|
BOOST_LOG_TRIVIAL(info) << "Request need retry";
|
||||||
|
m_project_task_panel->get_market_retry_buttom()->Enable(!obj->get_model_mall_result_need_retry);
|
||||||
|
m_project_task_panel->get_request_failed_panel()->Show();
|
||||||
|
} else {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "Request rejected";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_project_task_panel->market_scoring_hide();
|
m_project_task_panel->market_scoring_hide();
|
||||||
|
@ -2940,6 +2946,7 @@ void StatusPanel::reset_printing_values()
|
||||||
|
|
||||||
|
|
||||||
m_project_task_panel->market_scoring_hide();
|
m_project_task_panel->market_scoring_hide();
|
||||||
|
m_project_task_panel->get_request_failed_panel()->Hide();
|
||||||
update_basic_print_data(false);
|
update_basic_print_data(false);
|
||||||
m_project_task_panel->update_left_time(NA_STR);
|
m_project_task_panel->update_left_time(NA_STR);
|
||||||
m_project_task_panel->update_layers_num(true, wxString::Format(_L("Layer: %s"), NA_STR));
|
m_project_task_panel->update_layers_num(true, wxString::Format(_L("Layer: %s"), NA_STR));
|
||||||
|
|
Loading…
Reference in New Issue