mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-12 18:39:02 +08:00
ENH: update air condition control
jira: [STUDIO-11373] Change-Id: Ib25952165ec5489ef51ec7f5472fb319b0328ffc
This commit is contained in:
parent
1352cff314
commit
307c83bb84
@ -6234,8 +6234,8 @@ void MachineObject::parse_new_info(json print)
|
||||
auto list = airduct["modeList"].get<std::vector<json>>();
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
// only show 2 mode
|
||||
if (i >= 2) { break; }
|
||||
// only show 2 mode for o
|
||||
if (is_series_o() && i >= 2) { break; }
|
||||
|
||||
json mode_json = list[i];
|
||||
AirMode mode;
|
||||
@ -6253,7 +6253,7 @@ void MachineObject::parse_new_info(json print)
|
||||
}
|
||||
}
|
||||
|
||||
m_air_duct_data.modes.push_back(mode);
|
||||
m_air_duct_data.modes[mode.id] = mode;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ struct AirParts
|
||||
struct AirDuctData
|
||||
{
|
||||
int curren_mode{ 0 };
|
||||
std::vector<AirMode> modes;
|
||||
std::unordered_map<int, AirMode> modes;
|
||||
std::vector<AirParts> parts;
|
||||
};
|
||||
|
||||
|
@ -683,17 +683,18 @@ void FanControlPopupNew::CreateDuct()
|
||||
//fan or door
|
||||
UpdateParts(m_data.curren_mode);
|
||||
|
||||
if (m_data.modes.empty()) {
|
||||
//m_button_refresh->Hide();
|
||||
return;
|
||||
}
|
||||
size_t mode_size = m_data.modes.size();
|
||||
for (auto i = 0; i < mode_size; i++) {
|
||||
wxString text = wxString::Format("%s", radio_btn_name[AIR_DUCT(m_data.modes[i].id)]);
|
||||
SendModeSwitchButton *radio_btn = new SendModeSwitchButton(this, text, m_data.curren_mode == m_data.modes[i].id);
|
||||
auto iter = m_data.modes.begin();
|
||||
while (iter != m_data.modes.end()) {
|
||||
|
||||
int mode_id = iter->second.id;
|
||||
const wxString& text = wxString::Format("%s", radio_btn_name[AIR_DUCT(mode_id)]);
|
||||
if (text.empty()) { BOOST_LOG_TRIVIAL(error) << "FanControlPopupNew::CreateDuct: radio_btn_name is empty";}
|
||||
|
||||
SendModeSwitchButton *radio_btn = new SendModeSwitchButton(this, text, m_data.curren_mode == mode_id);
|
||||
radio_btn->Bind(wxEVT_LEFT_DOWN, &FanControlPopupNew::on_mode_changed, this);
|
||||
m_mode_switch_btn_list.emplace_back(radio_btn);
|
||||
m_radio_btn_sizer->Add(radio_btn, wxALL, FromDIP(5));
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user