mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	ENH:get printer error when binding error occurs
Change-Id: I492d48cacb341329e6981f9f2ddc180e30d2bd30
This commit is contained in:
		
							parent
							
								
									8060299515
								
							
						
					
					
						commit
						5631ea245e
					
				
					 2 changed files with 22 additions and 1 deletions
				
			
		|  | @ -489,12 +489,32 @@ wxString get_fail_reason(int code) | |||
|      this->Disconnect(EVT_BIND_UPDATE_MESSAGE, wxCommandEventHandler(BindMachineDialog::on_update_message), NULL, this); | ||||
|  } | ||||
| 
 | ||||
|  wxString BindMachineDialog::get_print_error(wxString str) | ||||
|  { | ||||
|      wxString extra; | ||||
|      try { | ||||
|          json j = json::parse(str.ToStdString()); | ||||
|          if (j.contains("err_code")) { | ||||
|              int error_code = j["err_code"].get<int>(); | ||||
|              extra = wxGetApp().get_hms_query()->query_print_error_msg(error_code); | ||||
|          } | ||||
|      } | ||||
|      catch (...) { | ||||
|          ; | ||||
|      } | ||||
| 
 | ||||
|      if (extra.empty()) | ||||
|          extra = str; | ||||
| 
 | ||||
|      return extra; | ||||
|  } | ||||
| 
 | ||||
|  void BindMachineDialog::show_bind_failed_info(bool show, int code, wxString description, wxString extra) | ||||
|  { | ||||
|      if (show) { | ||||
|          if (!m_sw_bind_failed_info->IsShown()) { | ||||
|              m_sw_bind_failed_info->Show(true); | ||||
| 
 | ||||
|              extra = get_print_error(extra.ToStdString()); | ||||
|              m_st_txt_error_code->SetLabelText(wxString::Format("%d", m_result_code)); | ||||
|              m_st_txt_error_desc->SetLabelText( wxGetApp().filter_string(m_result_info)); | ||||
|              m_st_txt_extra_info->SetLabelText( wxGetApp().filter_string(m_result_extra)); | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ public: | |||
|     void     on_show(wxShowEvent &event); | ||||
|     void     on_close(wxCloseEvent& event); | ||||
|     void     on_destroy(); | ||||
|     wxString get_print_error(wxString str); | ||||
| }; | ||||
| 
 | ||||
| class UnBindMachineDialog : public DPIDialog | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tao wang
						tao wang