mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 23:01:22 -06:00
ENH:optimize ams settings and virtual tray
1. separate virtual tray and extrustion calibrations 2. only when confirming will the disabled materials be checked 3. uptimize ams style Change-Id: Ie435555d0cad45fbc0cb1bf7e1706985ec1aaa78
This commit is contained in:
parent
4c6623848d
commit
f06b214c30
8 changed files with 89 additions and 59 deletions
|
@ -757,16 +757,25 @@ void AMSLib::render(wxDC &dc)
|
|||
}
|
||||
|
||||
//draw k&n
|
||||
if (m_show_kn) {
|
||||
wxString str_k = wxString::Format("K %1.3f", m_info.k);
|
||||
wxString str_n = wxString::Format("N %1.3f", m_info.n);
|
||||
dc.SetFont(::Label::Body_11);
|
||||
auto tsize = dc.GetMultiLineTextExtent(str_k);
|
||||
auto pot_k = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9) + tsize.y);
|
||||
dc.DrawText(str_k, pot_k);
|
||||
|
||||
//auto pot_n = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(18) + tsize.y * 2);
|
||||
//dc.DrawText(str_n, pot_n);
|
||||
if (m_obj && m_obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (m_show_kn){
|
||||
wxString str_k = wxString::Format("K %1.3f", m_info.k);
|
||||
wxString str_n = wxString::Format("N %1.3f", m_info.n);
|
||||
dc.SetFont(::Label::Body_11);
|
||||
auto tsize = dc.GetMultiLineTextExtent(str_k);
|
||||
auto pot_k = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9) + tsize.y);
|
||||
dc.DrawText(str_k, pot_k);
|
||||
}
|
||||
}
|
||||
else if(m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL){
|
||||
if (m_show_kn) {
|
||||
wxString str_k = wxString::Format("K %1.3f", m_info.k);
|
||||
wxString str_n = wxString::Format("N %1.3f", m_info.n);
|
||||
dc.SetFont(::Label::Body_11);
|
||||
auto tsize = dc.GetMultiLineTextExtent(str_k);
|
||||
auto pot_k = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9) + tsize.y);
|
||||
dc.DrawText(str_k, pot_k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -939,6 +948,12 @@ void AMSLib::doRender(wxDC &dc)
|
|||
|
||||
void AMSLib::Update(Caninfo info, bool refresh)
|
||||
{
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return;
|
||||
if (dev->get_selected_machine() && dev->get_selected_machine() != m_obj) {
|
||||
m_obj = dev->get_selected_machine();
|
||||
}
|
||||
|
||||
m_info = info;
|
||||
Layout();
|
||||
if (refresh) Refresh();
|
||||
|
@ -2250,6 +2265,7 @@ void AMSControl::init_scaled_buttons()
|
|||
}
|
||||
|
||||
std::string AMSControl::GetCurentAms() { return m_current_ams; }
|
||||
std::string AMSControl::GetCurentShowAms() { return m_current_show_ams; }
|
||||
|
||||
std::string AMSControl::GetCurrentCan(std::string amsid)
|
||||
{
|
||||
|
@ -2497,11 +2513,12 @@ void AMSControl::Reset()
|
|||
m_current_senect = "";
|
||||
}
|
||||
|
||||
void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool support_vt_load)
|
||||
void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali, bool support_vt_load)
|
||||
{
|
||||
show_vams(support_virtual_tray);
|
||||
m_sizer_ams_tips->Show(support_virtual_tray);
|
||||
if (!support_virtual_tray)
|
||||
|
||||
if (!support_extrustion_cali)
|
||||
m_button_extrusion_cali->Hide();
|
||||
else {
|
||||
m_button_extrusion_cali->Show();
|
||||
|
|
|
@ -284,6 +284,7 @@ public:
|
|||
public:
|
||||
wxColour GetLibColour();
|
||||
Caninfo m_info;
|
||||
MachineObject* m_obj = {nullptr};
|
||||
int m_can_index;
|
||||
void Update(Caninfo info, bool refresh = true);
|
||||
void UnableSelected() { m_unable_selected = true; };
|
||||
|
@ -571,6 +572,7 @@ protected:
|
|||
std::string m_last_tray_id;
|
||||
public:
|
||||
std::string GetCurentAms();
|
||||
std::string GetCurentShowAms();
|
||||
std::string GetCurrentCan(std::string amsid);
|
||||
wxColour GetCanColour(std::string amsid, std::string canid);
|
||||
|
||||
|
@ -610,7 +612,7 @@ public:
|
|||
void on_clibration_cancel_click(wxMouseEvent &event);
|
||||
void Reset();
|
||||
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_vt_load = false);
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali, bool support_vt_load = false);
|
||||
void show_vams(bool show);
|
||||
void show_vams_kn_value(bool show);
|
||||
void update_vams_kn_value(AmsTray tray);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue