mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
ENH:popup msg for user when printing with unknown filaments
Change-Id: Ic1dfa9d70e7bd5ed0e4220b718e261ecf4ef64a8
This commit is contained in:
parent
64ae3c3a56
commit
06ac3f73a6
4 changed files with 94 additions and 20 deletions
|
@ -334,6 +334,48 @@ void AmsMapingPopup::update_ams_data(std::map<std::string, Ams*> amsList)
|
|||
Fit();
|
||||
}
|
||||
|
||||
std::vector<TrayData> AmsMapingPopup::parse_ams_mapping(std::map<std::string, Ams*> amsList)
|
||||
{
|
||||
std::vector<TrayData> m_tray_data;
|
||||
std::map<std::string, Ams *>::iterator ams_iter;
|
||||
|
||||
for (ams_iter = amsList.begin(); ams_iter != amsList.end(); ams_iter++) {
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams_mapping ams id " << ams_iter->first.c_str();
|
||||
|
||||
auto ams_indx = atoi(ams_iter->first.c_str());
|
||||
Ams* ams_group = ams_iter->second;
|
||||
std::vector<TrayData> tray_datas;
|
||||
std::map<std::string, AmsTray*>::iterator tray_iter;
|
||||
|
||||
for (tray_iter = ams_group->trayList.begin(); tray_iter != ams_group->trayList.end(); tray_iter++) {
|
||||
AmsTray* tray_data = tray_iter->second;
|
||||
TrayData td;
|
||||
|
||||
td.id = ams_indx * AMS_TOTAL_COUNT + atoi(tray_data->id.c_str());
|
||||
|
||||
if (!tray_data->is_exists) {
|
||||
td.type = EMPTY;
|
||||
}
|
||||
else {
|
||||
if (!tray_data->is_tray_info_ready()) {
|
||||
td.type = THIRD;
|
||||
}
|
||||
else {
|
||||
td.type = NORMAL;
|
||||
td.colour = AmsTray::decode_color(tray_data->color);
|
||||
td.name = tray_data->get_display_filament_type();
|
||||
td.filament_type = tray_data->get_filament_type();
|
||||
}
|
||||
}
|
||||
|
||||
m_tray_data.push_back(td);
|
||||
}
|
||||
}
|
||||
|
||||
return m_tray_data;
|
||||
}
|
||||
|
||||
void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data)
|
||||
{
|
||||
auto sizer_mapping_list = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue