mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-12 19:49:07 +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>>();
|
auto list = airduct["modeList"].get<std::vector<json>>();
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
// only show 2 mode
|
// only show 2 mode for o
|
||||||
if (i >= 2) { break; }
|
if (is_series_o() && i >= 2) { break; }
|
||||||
|
|
||||||
json mode_json = list[i];
|
json mode_json = list[i];
|
||||||
AirMode mode;
|
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
|
struct AirDuctData
|
||||||
{
|
{
|
||||||
int curren_mode{ 0 };
|
int curren_mode{ 0 };
|
||||||
std::vector<AirMode> modes;
|
std::unordered_map<int, AirMode> modes;
|
||||||
std::vector<AirParts> parts;
|
std::vector<AirParts> parts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -683,17 +683,18 @@ void FanControlPopupNew::CreateDuct()
|
|||||||
//fan or door
|
//fan or door
|
||||||
UpdateParts(m_data.curren_mode);
|
UpdateParts(m_data.curren_mode);
|
||||||
|
|
||||||
if (m_data.modes.empty()) {
|
auto iter = m_data.modes.begin();
|
||||||
//m_button_refresh->Hide();
|
while (iter != m_data.modes.end()) {
|
||||||
return;
|
|
||||||
}
|
int mode_id = iter->second.id;
|
||||||
size_t mode_size = m_data.modes.size();
|
const wxString& text = wxString::Format("%s", radio_btn_name[AIR_DUCT(mode_id)]);
|
||||||
for (auto i = 0; i < mode_size; i++) {
|
if (text.empty()) { BOOST_LOG_TRIVIAL(error) << "FanControlPopupNew::CreateDuct: radio_btn_name is empty";}
|
||||||
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);
|
SendModeSwitchButton *radio_btn = new SendModeSwitchButton(this, text, m_data.curren_mode == mode_id);
|
||||||
radio_btn->Bind(wxEVT_LEFT_DOWN, &FanControlPopupNew::on_mode_changed, this);
|
radio_btn->Bind(wxEVT_LEFT_DOWN, &FanControlPopupNew::on_mode_changed, this);
|
||||||
m_mode_switch_btn_list.emplace_back(radio_btn);
|
m_mode_switch_btn_list.emplace_back(radio_btn);
|
||||||
m_radio_btn_sizer->Add(radio_btn, wxALL, FromDIP(5));
|
m_radio_btn_sizer->Add(radio_btn, wxALL, FromDIP(5));
|
||||||
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user