ENH:the "distance" var should init to 0 in the release environment of Mac
jira: STUDIO-10967 Change-Id: I85b1e87dc80846f50c3bd29c7aa05f89c39d17de
This commit is contained in:
parent
2ccc72f16e
commit
4b368cb2ec
|
@ -38,15 +38,15 @@ enum MappingResult {
|
|||
|
||||
struct FilamentInfo
|
||||
{
|
||||
int id; // filament id = extruder id, start with 0.
|
||||
int id{0}; // filament id = extruder id, start with 0.
|
||||
std::string type;
|
||||
std::string color;
|
||||
std::string filament_id;
|
||||
std::string brand;
|
||||
float used_m;
|
||||
float used_g;
|
||||
int tray_id; // start with 0
|
||||
float distance;
|
||||
float used_m{0.f};
|
||||
float used_g{0.f};
|
||||
int tray_id{0}; // start with 0
|
||||
float distance{0.f};
|
||||
int ctype = 0;
|
||||
std::vector<std::string> colors = std::vector<std::string>();
|
||||
int mapping_result = 0;
|
||||
|
|
|
@ -1091,6 +1091,7 @@ int MachineObject::ams_filament_mapping(
|
|||
min_val = distance_map[i][j].distance;
|
||||
picked_src_idx = i;
|
||||
picked_tar_idx = j;
|
||||
tray_filaments[picked_tar_idx].distance = min_val;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -1102,6 +1103,7 @@ int MachineObject::ams_filament_mapping(
|
|||
min_val = distance_map[i][j].distance;
|
||||
picked_src_idx = i;
|
||||
picked_tar_idx = j;
|
||||
tray_filaments[picked_tar_idx].distance = min_val;
|
||||
}
|
||||
else if (min_val == distance_map[i][j].distance&& filaments[picked_src_idx].filament_id!= tray_filaments[picked_tar_idx].filament_id && filaments[i].filament_id == tray_filaments[j].filament_id) {
|
||||
|
||||
|
|
|
@ -1230,7 +1230,7 @@ void SyncAmsInfoDialog::sync_ams_mapping_result(std::vector<FilamentInfo> &resul
|
|||
{
|
||||
m_back_ams_mapping_result = result;
|
||||
if (result.empty()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams_mapping result is empty";
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "ams_mapping result is empty";
|
||||
for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
|
||||
wxString ams_id = "Ext";
|
||||
wxColour ams_col = wxColour(0xCE, 0xCE, 0xCE);
|
||||
|
@ -1239,7 +1239,7 @@ void SyncAmsInfoDialog::sync_ams_mapping_result(std::vector<FilamentInfo> &resul
|
|||
return;
|
||||
}
|
||||
for (auto f = result.begin(); f != result.end(); f++) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams_mapping f id = " << f->id << ", tray_id = " << f->tray_id << ", color = " << f->color << ", type = " << f->type;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "ams_mapping f id = " << f->id << ", tray_id = " << f->tray_id << ", color = " << f->color << ", type = " << f->type;
|
||||
|
||||
MaterialHash::iterator iter = m_materialList.begin();
|
||||
while (iter != m_materialList.end()) {
|
||||
|
@ -1285,7 +1285,7 @@ void SyncAmsInfoDialog::sync_ams_mapping_result(std::vector<FilamentInfo> &resul
|
|||
bool SyncAmsInfoDialog::do_ams_mapping(MachineObject *obj_)
|
||||
{
|
||||
if (!obj_) return false;
|
||||
BOOST_LOG_TRIVIAL(trace) << "SyncAmsInfoDialog:begin do_ams_mapping result";
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " begin do_ams_mapping result";
|
||||
obj_->get_ams_colors(m_cur_colors_in_thumbnail);
|
||||
// try color and type mapping
|
||||
|
||||
|
@ -1383,6 +1383,7 @@ void SyncAmsInfoDialog::show_thumbnail_page()
|
|||
|
||||
bool SyncAmsInfoDialog::get_ams_mapping_result(std::string &mapping_array_str, std::string &mapping_array_str2, std::string &ams_mapping_info)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "m_ams_mapping_result.size:" << m_ams_mapping_result.empty();
|
||||
if (m_ams_mapping_result.empty())
|
||||
return false;
|
||||
|
||||
|
@ -1396,8 +1397,10 @@ bool SyncAmsInfoDialog::get_ams_mapping_result(std::string &mapping_array_str, s
|
|||
}
|
||||
|
||||
if (invalid_count == m_ams_mapping_result.size()) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "invalid_count == m_ams_mapping_result.size()";
|
||||
return false;
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "check mapping_v0_json";
|
||||
json mapping_v0_json = json::array();
|
||||
json mapping_v1_json = json::array();
|
||||
json mapping_info_json = json::array();
|
||||
|
@ -1463,6 +1466,7 @@ bool SyncAmsInfoDialog::get_ams_mapping_result(std::string &mapping_array_str, s
|
|||
mapping_array_str2 = mapping_v1_json.dump();
|
||||
|
||||
ams_mapping_info = mapping_info_json.dump();
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "mapping_array_str:" << mapping_array_str;
|
||||
return valid_mapping_result;
|
||||
}
|
||||
return true;
|
||||
|
@ -2238,7 +2242,7 @@ void SyncAmsInfoDialog::on_set_finish_mapping(wxCommandEvent &evt)
|
|||
m_ams_mapping_result[i].ams_id = selection_data_arr[6].ToStdString();
|
||||
m_ams_mapping_result[i].slot_id = selection_data_arr[7].ToStdString();
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(trace) << "The ams mapping result: id is " << m_ams_mapping_result[i].id << "tray_id is " << m_ams_mapping_result[i].tray_id;
|
||||
BOOST_LOG_TRIVIAL(info) << "The ams mapping result: id is " << m_ams_mapping_result[i].id << "tray_id is " << m_ams_mapping_result[i].tray_id;
|
||||
}
|
||||
|
||||
MaterialHash::iterator iter = m_materialList.begin();
|
||||
|
@ -3471,7 +3475,7 @@ void SyncAmsInfoDialog::update_lan_machine_list()
|
|||
if (!dev) return;
|
||||
auto m_free_machine_list = dev->get_local_machine_list();
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "SelectMachinePopup update_other_devices start";
|
||||
BOOST_LOG_TRIVIAL(info) << "SelectMachinePopup update_other_devices start";
|
||||
|
||||
for (auto &elem : m_free_machine_list) {
|
||||
MachineObject *mobj = elem.second;
|
||||
|
@ -3492,7 +3496,7 @@ void SyncAmsInfoDialog::update_lan_machine_list()
|
|||
std::map<std::string, MachineObject *> option_list;
|
||||
}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(trace) << "SyncAmsInfoDialog update_lan_devices end";
|
||||
BOOST_LOG_TRIVIAL(info) << "SyncAmsInfoDialog update_lan_devices end";
|
||||
}
|
||||
|
||||
std::string SyncAmsInfoDialog::get_print_status_info(PrintDialogStatus status)
|
||||
|
|
Loading…
Reference in New Issue