mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 12:21:50 +03:00
update src
This commit is contained in:
@@ -22,6 +22,7 @@ DeviceItem::DeviceItem(wxWindow* parent, MachineObject* obj)
|
||||
obj_->dev_name = obj->dev_name;
|
||||
obj_->dev_url = obj->dev_url;
|
||||
obj_->dev_ip = obj->dev_ip;
|
||||
obj_->dev_apikey = obj->dev_apikey; //y70
|
||||
sync_state();
|
||||
Bind(EVT_MULTI_REFRESH, &DeviceItem::on_refresh, this);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ void PhysicalPrinterDialog::OnOK(wxMouseEvent& event)
|
||||
}
|
||||
for (auto exit_host : m_exit_host)
|
||||
{
|
||||
if (exit_host.find(ip) != std::string::npos)
|
||||
if (exit_host == ip)
|
||||
{
|
||||
MessageDialog msg_wingow(nullptr, _L("A device with the same host (IP or URL) already exists, please re-enter."), "", wxICON_WARNING | wxOK);
|
||||
msg_wingow.ShowModal();
|
||||
|
||||
@@ -5945,32 +5945,32 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||
show_info(q, _L("The 3mf is not from QIDI Tech, load geometry data only."), _L("Load 3mf"));
|
||||
}
|
||||
//w18
|
||||
else if (load_config && (file_version.maj() != app_version.maj())) {
|
||||
// version mismatch, only load geometries
|
||||
load_config = false;
|
||||
if (!load_model) {
|
||||
// only load config case, return directly
|
||||
show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
||||
q->skip_thumbnail_invalid = false;
|
||||
return empty_result;
|
||||
}
|
||||
load_old_project = true;
|
||||
// select view to 3D
|
||||
q->select_view_3D("3D");
|
||||
// select plate 0 as default
|
||||
q->select_plate(0);
|
||||
if (load_type != LoadType::LoadGeometry) {
|
||||
if (en_3mf_file_type == En3mfType::From_QDS)
|
||||
show_info(q, _L("Due to the lower version of QIDI Studio, this 3mf file cannot be fully loaded. Please update QIDI Studio to the latest version"), _L("Load 3mf"));
|
||||
else
|
||||
show_info(q, _L("The 3mf is not from QIDI Tech, load geometry data only."), _L("Load 3mf"));
|
||||
}
|
||||
for (ModelObject *model_object : model.objects) {
|
||||
model_object->config.reset();
|
||||
// Is there any modifier or advanced config data?
|
||||
for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||
}
|
||||
}
|
||||
// else if (load_config && (file_version.maj() != app_version.maj())) {
|
||||
// // version mismatch, only load geometries
|
||||
// load_config = false;
|
||||
// if (!load_model) {
|
||||
// // only load config case, return directly
|
||||
// show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
||||
// q->skip_thumbnail_invalid = false;
|
||||
// return empty_result;
|
||||
// }
|
||||
// load_old_project = true;
|
||||
// // select view to 3D
|
||||
// q->select_view_3D("3D");
|
||||
// // select plate 0 as default
|
||||
// q->select_plate(0);
|
||||
// if (load_type != LoadType::LoadGeometry) {
|
||||
// if (en_3mf_file_type == En3mfType::From_QDS)
|
||||
// show_info(q, _L("Due to the lower version of QIDI Studio, this 3mf file cannot be fully loaded. Please update QIDI Studio to the latest version"), _L("Load 3mf"));
|
||||
// else
|
||||
// show_info(q, _L("The 3mf is not from QIDI Tech, load geometry data only."), _L("Load 3mf"));
|
||||
// }
|
||||
// for (ModelObject *model_object : model.objects) {
|
||||
// model_object->config.reset();
|
||||
// // Is there any modifier or advanced config data?
|
||||
// for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||
// }
|
||||
// }
|
||||
//y54
|
||||
// // else if (load_config && (file_version > app_version)) {
|
||||
// Semver cloud_ver;
|
||||
@@ -12704,7 +12704,7 @@ void Plater::_calib_pa_line(const Calib_Params& params)
|
||||
tab_print->load_config(new_config);
|
||||
tab_printer->load_config(new_config);
|
||||
GizmoObjectManipulation& giz_obj_manip = p->view3D->get_canvas3d()->get_gizmos_manager().get_object_manipulation();
|
||||
giz_obj_manip.set_uniform_scaling(true);
|
||||
giz_obj_manip.set_uniform_scaling(false);
|
||||
giz_obj_manip.on_change("position", 0, plate_center.x() - 50);
|
||||
giz_obj_manip.set_uniform_scaling(false);
|
||||
giz_obj_manip.on_change("size", 0, 25);
|
||||
@@ -12941,7 +12941,7 @@ void Plater::_calib_pa_pattern(const Calib_Params ¶ms)
|
||||
tab_printer->load_config(new_config);
|
||||
|
||||
GizmoObjectManipulation& giz_obj_manip = p->view3D->get_canvas3d()->get_gizmos_manager().get_object_manipulation();
|
||||
giz_obj_manip.set_uniform_scaling(true);
|
||||
giz_obj_manip.set_uniform_scaling(false);
|
||||
giz_obj_manip.on_change("position", 0, plate_center.x() - 31);
|
||||
giz_obj_manip.set_uniform_scaling(false);
|
||||
giz_obj_manip.on_change("size", 0, 25);
|
||||
|
||||
@@ -3601,10 +3601,8 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
|
||||
has_box_machine = true;
|
||||
}
|
||||
|
||||
//y68 y69
|
||||
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
|
||||
std::string machine_preset = preset_bundle.printers.get_edited_preset().get_printer_type(&preset_bundle);
|
||||
if(!machine_preset.empty() && machine_preset != select_machine_type && !selection_name.empty())
|
||||
//y68 //y70
|
||||
if(!preset_typename_normalized.empty() && preset_typename_normalized.find(NormalizeVendor(select_machine_type)) == std::string::npos && !selection_name.empty())
|
||||
{
|
||||
show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter);
|
||||
has_box_machine = false;
|
||||
|
||||
@@ -1888,7 +1888,8 @@ void SendMultiMachinePage::ThreadWorker() {
|
||||
if (m_stopThread)
|
||||
break;
|
||||
MachineObject* temp_obj = device.second->get_obj();
|
||||
temp_obj->ams_exist_bits = qidi.get_box_state(msg, temp_obj->dev_url) ? 1 : 0;
|
||||
//y70
|
||||
temp_obj->ams_exist_bits = qidi.get_box_state(msg, temp_obj->dev_url, temp_obj->dev_apikey) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3286,6 +3286,7 @@ GetBoxInfoDialog::GetBoxInfoDialog(Plater* plater)
|
||||
m_comboBox_printer->SetValue("");
|
||||
m_comboBox_printer->Clear();
|
||||
m_printer_ip.clear();
|
||||
m_printer_api_key.clear(); //y70
|
||||
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
|
||||
PhysicalPrinterCollection& ph_printers = preset_bundle.physical_printers;
|
||||
std::string preset_typename = NormalizeVendor(preset_bundle.printers.get_edited_preset().get_printer_type(&preset_bundle));
|
||||
@@ -3296,6 +3297,8 @@ GetBoxInfoDialog::GetBoxInfoDialog(Plater* plater)
|
||||
if (preset_typename.find(NormalizeVendor(printer_preset)) != std::string::npos) {
|
||||
m_comboBox_printer->Append(from_u8(printer_name));
|
||||
m_printer_ip.push_back((it->config.opt_string("print_host")));
|
||||
//y70
|
||||
m_printer_api_key.push_back((it->config.opt_string("printhost_apikey")));
|
||||
}
|
||||
}
|
||||
m_comboBox_printer->SetSelection(0);
|
||||
@@ -3399,18 +3402,24 @@ void GetBoxInfoDialog::synchronization(wxCommandEvent &event)
|
||||
int selected_idx = m_comboBox_printer->GetSelection();
|
||||
std::string printer_ip = m_printer_ip[selected_idx];
|
||||
|
||||
//y70
|
||||
std::string api_key = "";
|
||||
if(!m_printer_api_key.empty())
|
||||
api_key = m_printer_api_key[selected_idx];
|
||||
|
||||
QIDINetwork qidi;
|
||||
wxString msg = "";
|
||||
bool has_box = qidi.get_box_state(msg, printer_ip);
|
||||
bool has_box = qidi.get_box_state(msg, printer_ip, api_key); //y70
|
||||
if (!has_box) {
|
||||
WarningDialog(this, _L("This Printer has not connect the box, please check.")).ShowModal();
|
||||
}
|
||||
else {
|
||||
//y70
|
||||
//Get Box_info
|
||||
GUI::Box_info filament_info;
|
||||
filament_info = qidi.get_box_info(msg, printer_ip);
|
||||
filament_info = qidi.get_box_info(msg, printer_ip, api_key);
|
||||
m_plater->current_box_info = filament_info;
|
||||
qidi.get_color_filament_str(msg, filament_info, printer_ip);
|
||||
qidi.get_color_filament_str(msg, filament_info, printer_ip, api_key);
|
||||
generate_filament_id(filament_info);
|
||||
update_filament_info(filament_info);
|
||||
wxGetApp().plater()->sidebar().box_list_printer_ip = printer_ip;
|
||||
|
||||
@@ -390,6 +390,7 @@ public:
|
||||
|
||||
|
||||
std::vector<std::string> m_printer_ip;
|
||||
std::vector<std::string> m_printer_api_key;
|
||||
|
||||
private:
|
||||
Plater* m_plater{ nullptr };
|
||||
|
||||
Reference in New Issue
Block a user