mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-31 11:50:33 -07:00
FIX: update the time shown; keep the val update while popup
jira: [STUDIO-9268] Change-Id: I0b743ddb0ae479f9baad6239f68861a199681cda (cherry picked from commit e1bc737d1cbc1dcf79ceecf9ed301a4a02590d5a)
This commit is contained in:
parent
502cee88ee
commit
87c0719b32
4 changed files with 29 additions and 2 deletions
|
|
@ -211,7 +211,7 @@ void uiAmsPercentHumidityDryPopup::DrawGridArea(wxDC &dc, wxPoint start_p)
|
|||
}
|
||||
else if (header == _L("Left Time"))
|
||||
{
|
||||
const wxString &time_str = wxString::Format(_L("%d Hours"), m_left_dry_time);
|
||||
const wxString &time_str = wxString::Format(_L("%d : %d"), m_left_dry_time / 60, m_left_dry_time % 60);
|
||||
dc.DrawText(time_str, left, start_p.y + row_height);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace Slic3r { namespace GUI {
|
|||
|
||||
struct uiAmsHumidityInfo
|
||||
{
|
||||
std::string ams_id;
|
||||
int humidity_level = -1;
|
||||
int humidity_percent = -1;
|
||||
float current_temperature;
|
||||
|
|
@ -35,7 +36,9 @@ public:
|
|||
~uiAmsPercentHumidityDryPopup() = default;
|
||||
|
||||
public:
|
||||
void Update(uiAmsHumidityInfo *info) { Update(info->humidity_level, info->humidity_percent, info->left_dry_time, info->current_temperature); };
|
||||
void Update(uiAmsHumidityInfo *info) { m_ams_id = info->ams_id; Update(info->humidity_level, info->humidity_percent, info->left_dry_time, info->current_temperature); };
|
||||
|
||||
std::string get_owner_ams_id() const { return m_ams_id; }
|
||||
|
||||
virtual void OnDismiss() wxOVERRIDE {};
|
||||
virtual bool ProcessLeftDown(wxMouseEvent &event) wxOVERRIDE { return true;};
|
||||
|
|
@ -52,6 +55,9 @@ private:
|
|||
void DrawGridArea(wxDC &dc, wxPoint start_p);
|
||||
|
||||
private:
|
||||
/*owner ams id*/
|
||||
std::string m_ams_id;
|
||||
|
||||
int m_humidity_level = 0;
|
||||
int m_humidity_percent = 0;
|
||||
int m_left_dry_time = 0;
|
||||
|
|
|
|||
|
|
@ -1066,6 +1066,26 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool is_reset)
|
|||
if (m_ams_model == AMSModel::EXT_AMS && !m_vams_lib->is_selected()) {
|
||||
m_vams_lib->OnSelected();
|
||||
}
|
||||
|
||||
/*update humidity popup*/
|
||||
if (m_percent_humidity_dry_popup->IsShown())
|
||||
{
|
||||
string target_id = m_percent_humidity_dry_popup->get_owner_ams_id();
|
||||
for (const auto& the_info : info)
|
||||
{
|
||||
if (target_id == the_info.ams_id)
|
||||
{
|
||||
uiAmsHumidityInfo humidity_info;
|
||||
humidity_info.ams_id = the_info.ams_id;
|
||||
humidity_info.humidity_level = the_info.ams_humidity;
|
||||
humidity_info.humidity_percent = the_info.humidity_raw;
|
||||
humidity_info.left_dry_time = the_info.left_dray_time;
|
||||
humidity_info.current_temperature = the_info.current_temperature;
|
||||
m_percent_humidity_dry_popup->Update(&humidity_info);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AMSControl::AddAmsItems(AMSinfo info)
|
||||
|
|
|
|||
|
|
@ -2202,6 +2202,7 @@ AMSHumidity::AMSHumidity(wxWindow* parent, wxWindowID id, AMSinfo info, const wx
|
|||
wxCommandEvent show_event(EVT_AMS_SHOW_HUMIDITY_TIPS);
|
||||
|
||||
uiAmsHumidityInfo *info = new uiAmsHumidityInfo;
|
||||
info->ams_id = m_amsinfo.ams_id;
|
||||
info->humidity_level = m_amsinfo.ams_humidity;
|
||||
info->humidity_percent = m_amsinfo.humidity_raw;
|
||||
info->left_dry_time = m_amsinfo.left_dray_time;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue