ENH: update humidity display for AMS-1

JIRA: [STUDIO-13195]
Change-Id: I7abcdf821b7ead2cf4a8605ecd95011e74f5dc6b
(cherry picked from commit 1c1d34ff7e3fea4492ba07e238ca171e28eb0a3b)
This commit is contained in:
xin.zhang
2025-07-18 11:42:25 +08:00
committed by Noisyfox
parent 2d215d75d2
commit 0721078177
15 changed files with 103 additions and 78 deletions

View File

@@ -280,16 +280,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
uiAmsHumidityInfo *info = (uiAmsHumidityInfo *) evt.GetClientData();
if (info)
{
if (info->humidity_percent >= 0)
{
m_percent_humidity_dry_popup->Update(info);
wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x - m_percent_humidity_dry_popup->GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
m_percent_humidity_dry_popup->Move(popup_pos);
m_percent_humidity_dry_popup->ShowModal();
}
else
if (info->ams_type == AMSModel::GENERIC_AMS)
{
wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x - m_Humidity_tip_popup.GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
@@ -299,6 +290,15 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
if (humidity_value > 0 && humidity_value <= 5) { m_Humidity_tip_popup.set_humidity_level(humidity_value); }
m_Humidity_tip_popup.Popup();
}
else
{
m_percent_humidity_dry_popup->Update(info);
wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x - m_percent_humidity_dry_popup->GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
m_percent_humidity_dry_popup->Move(popup_pos);
m_percent_humidity_dry_popup->ShowModal();
}
}
delete info;
@@ -532,6 +532,8 @@ void AMSControl::msw_rescale()
m_percent_humidity_dry_popup->msw_rescale();
}
m_Humidity_tip_popup.msw_rescale();
Layout();
Refresh();
}