FIX: update the time shown; keep the val update while popup
jira: [STUDIO-9268] Change-Id: I0b743ddb0ae479f9baad6239f68861a199681cda
This commit is contained in:
parent
3845b8ff66
commit
e1bc737d1c
|
@ -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;
|
||||
|
|
|
@ -3460,7 +3460,25 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> ams_info, std::vector<AMSinfo>ex
|
|||
}*/
|
||||
}
|
||||
|
||||
|
||||
/*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 : ams_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::AddAmsPreview(AMSinfo info, AMSModel type)
|
||||
|
|
|
@ -2794,6 +2794,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…
Reference in New Issue