Delete leftovers from printer_type implementation.

This commit is contained in:
David Kocik 2024-04-24 15:39:30 +02:00
parent ffeb068452
commit cb80309535
3 changed files with 2 additions and 71 deletions

View File

@ -303,26 +303,6 @@ bool UserAccount::on_connect_uiid_map_success(const std::string& data, AppConfig
return on_connect_printers_success(data, app_config, out_printers_changed);
}
std::string UserAccount::get_model_from_json(const std::string& message) const
{
std::string out;
try {
std::stringstream ss(message);
pt::ptree ptree;
pt::read_json(ss, ptree);
std::string printer_type = parse_tree_for_param(ptree, "printer_type");
if (auto pair = printer_type_and_name_table.find(printer_type); pair != printer_type_and_name_table.end()) {
out = pair->second;
}
//assert(!out.empty());
}
catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error) << "Could not parse prusaconnect message. " << e.what();
}
return out;
}
std::string UserAccount::get_nozzle_from_json(const std::string& message) const
{
std::string out;
@ -379,7 +359,7 @@ void UserAccount::fill_supported_printer_models_from_json(const std::string& jso
}
pt::ptree out = parse_tree_for_subtree(ptree, "supported_printer_models");
if (out.empty()) {
BOOST_LOG_TRIVIAL(error) << "Failed to find compatible_printer_type in printer detail.";
BOOST_LOG_TRIVIAL(error) << "Failed to find supported_printer_models in printer detail.";
return;
}
for (const auto& sub : out) {
@ -468,18 +448,4 @@ void UserAccount::fill_material_from_json(const std::string& json, std::vector<s
}
}
std::string UserAccount::get_printer_type_from_name(const std::string& printer_name) const
{
for (const auto& pair : printer_type_and_name_table) {
if (pair.second == printer_name) {
return pair.first;
}
}
assert(true); // This assert means printer_type_and_name_table needs a update
return {};
}
}} // namespace slic3r::GUI

View File

@ -65,7 +65,6 @@ public:
boost::filesystem::path get_avatar_path(bool logged) const;
// standalone utility methods
std::string get_model_from_json(const std::string& message) const;
std::string get_nozzle_from_json(const std::string& message) const;
std::string get_keyword_from_json(const std::string& json, const std::string& keyword) const;
void fill_supported_printer_models_from_json(const std::string& json, std::vector<std::string>& result) const;
@ -73,7 +72,6 @@ public:
const std::map<std::string, ConnectPrinterState>& get_printer_state_table() const { return printer_state_table; }
std::string get_printer_type_from_name(const std::string& printer_name) const;
private:
void set_username(const std::string& username);
@ -86,39 +84,7 @@ private:
std::map<std::string, std::string> m_account_user_data;
std::string m_username;
size_t m_fail_counter { 0 };
std::string m_avatar_extension;
// first string is "printer_type" code from Connect edpoints
const std::map<std::string, std::string> printer_type_and_name_table = {
{"1.2.5", "MK2.5" },
{"1.2.6", "MK2.5S" },
{"1.3.0", "MK3" },
{"1.3.1", "MK3S" },
{"1.3.5", "MK3.5" },
{"1.3.9", "MK3.9" },
{"1.4.0", "MK4" },
{"2.1.0", "MINI" },
{"3.1.0", "XL" },
{"5.1.0", "SL1" },
{"5.1.1", "SL1S" },
// ysFIXME : needs to add Connect ids for next printers
/*{"0.0.0", "MK4IS" },
{"0.0.0", "MK3SMMU2S" },
{"0.0.0", "MK3MMU2" },
{"0.0.0", "MK2.5SMMU2S" },
{"0.0.0", "MK2.5MMU2" },
{"0.0.0", "MK2S" },
{"0.0.0", "MK2SMM" },
{"0.0.0", "SL1S" },*/
};
/* TODO:
4 1 0 iXL
6 2 0 Trilab DeltiQ 2
6 2 1 Trilab DelriQ 2 Plus
7 1 0 Trilab AzteQ
7 2 0 Trilab AzteQ Industrial
7 2 1 Trilab AzteQ Industrial Plus
*/
std::string m_avatar_extension;
const std::map<std::string, ConnectPrinterState> printer_state_table = {
{"OFFLINE" , ConnectPrinterState::CONNECT_PRINTER_OFFLINE},

View File

@ -758,7 +758,6 @@ void PrinterPickWebViewDialog::request_compatible_printers_SLA()
{
const Preset& selected_printer = wxGetApp().preset_bundle->printers.get_selected_preset();
const std::string printer_model_serialized = selected_printer.config.option("printer_model")->serialize();
//const std::string printer_type = wxGetApp().plater()->get_user_account()->get_printer_type_from_name(printer_model_serialized);
const Preset& selected_material = wxGetApp().preset_bundle->sla_materials.get_selected_preset();
const std::string material_type_serialized = selected_material.config.option("material_type")->serialize();
const std::string request = GUI::format(