NEW: add more track records
Change-Id: If82430f8b432f1a1d5a78cd6a63a16cf50d2bbaa Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
4893cebaa5
commit
43810bdac8
|
@ -382,6 +382,12 @@ void BBLTopbar::OnPublishClicked(wxAuiToolBarEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// record
|
||||||
|
json j;
|
||||||
|
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||||
|
if (agent)
|
||||||
|
agent->track_event("enter_model_mall", j.dump());
|
||||||
|
|
||||||
//no more check
|
//no more check
|
||||||
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
|
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
|
||||||
|
|
||||||
|
|
|
@ -4115,10 +4115,17 @@ void GUI_App::check_track_enable()
|
||||||
int major = 0, minor = 0, micro = 0;
|
int major = 0, minor = 0, micro = 0;
|
||||||
header_json["os"] = std::string(os_desc.ToUTF8());
|
header_json["os"] = std::string(os_desc.ToUTF8());
|
||||||
header_json["name"] = std::string(SLIC3R_APP_NAME);
|
header_json["name"] = std::string(SLIC3R_APP_NAME);
|
||||||
|
header_json["uuid"] = app_config->get("slicer_uuid");
|
||||||
if (m_agent) {
|
if (m_agent) {
|
||||||
m_agent->track_header(header_json.dump());
|
m_agent->track_header(header_json.dump());
|
||||||
m_agent->track_enable(true);
|
m_agent->track_enable(true);
|
||||||
}
|
}
|
||||||
|
/* record studio start event */
|
||||||
|
json j;
|
||||||
|
j["user_mode"] = this->get_mode_str();
|
||||||
|
if (m_agent) {
|
||||||
|
m_agent->track_event("studio_launch", j.dump());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5041,6 +5048,13 @@ ConfigOptionMode GUI_App::get_mode()
|
||||||
mode == "develop" ? comDevelop : comSimple;
|
mode == "develop" ? comDevelop : comSimple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GUI_App::get_mode_str()
|
||||||
|
{
|
||||||
|
if (!app_config->has("user_mode"))
|
||||||
|
return "simple";
|
||||||
|
return app_config->get("user_mode");
|
||||||
|
}
|
||||||
|
|
||||||
void GUI_App::save_mode(const /*ConfigOptionMode*/int mode)
|
void GUI_App::save_mode(const /*ConfigOptionMode*/int mode)
|
||||||
{
|
{
|
||||||
//BBS
|
//BBS
|
||||||
|
|
|
@ -464,6 +464,7 @@ public:
|
||||||
Tab* get_model_tab(bool part = false);
|
Tab* get_model_tab(bool part = false);
|
||||||
Tab* get_layer_tab();
|
Tab* get_layer_tab();
|
||||||
ConfigOptionMode get_mode();
|
ConfigOptionMode get_mode();
|
||||||
|
std::string get_mode_str();
|
||||||
void save_mode(const /*ConfigOptionMode*/int mode) ;
|
void save_mode(const /*ConfigOptionMode*/int mode) ;
|
||||||
void update_mode();
|
void update_mode();
|
||||||
void update_internal_development();
|
void update_internal_development();
|
||||||
|
|
|
@ -471,8 +471,9 @@ void PrintJob::process()
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
|
BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
wxGetApp().plater()->record_slice_preset("print");
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
|
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
|
||||||
wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
|
wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
|
||||||
if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
|
if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
|
||||||
|
|
|
@ -1995,6 +1995,11 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
json j;
|
||||||
|
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||||
|
if (agent)
|
||||||
|
agent->track_event("enter_model_mall", j.dump());
|
||||||
|
|
||||||
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
|
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
|
||||||
wxGetApp().open_publish_page_dialog();
|
wxGetApp().open_publish_page_dialog();
|
||||||
});
|
});
|
||||||
|
|
|
@ -9434,10 +9434,8 @@ void Plater::export_gcode(bool prefer_removable)
|
||||||
if (preset_bundle) {
|
if (preset_bundle) {
|
||||||
j["Gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
j["Gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkAgent *agent = wxGetApp().getAgent();
|
NetworkAgent *agent = wxGetApp().getAgent();
|
||||||
if (agent) agent->track_event("printer_export_Gcode", j.dump());
|
if (agent) agent->track_event("printer_export_gcode", j.dump());
|
||||||
|
|
||||||
} catch (...) {}
|
} catch (...) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10069,16 +10067,22 @@ void Plater::reslice()
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished, started slicing for plate %1%") % p->partplate_list.get_curr_plate_index();
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished, started slicing for plate %1%") % p->partplate_list.get_curr_plate_index();
|
||||||
|
|
||||||
|
record_slice_preset("slicing");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Plater::record_slice_preset(std::string action)
|
||||||
|
{
|
||||||
|
// record slice preset
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
json j;
|
json j;
|
||||||
auto printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset_with_vendor_profile().preset;
|
auto printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset_with_vendor_profile().preset;
|
||||||
if (printer_preset.is_system) {
|
if (printer_preset.is_system) {
|
||||||
j["printer_preset_name"] = printer_preset.name;
|
j["printer_preset_name"] = printer_preset.name;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
j["printer_preset_name"] = printer_preset.config.opt_string("inherits");
|
j["printer_preset_name"] = printer_preset.config.opt_string("inherits");
|
||||||
}
|
}
|
||||||
|
|
||||||
const t_config_enum_values* keys_map = print_config_def.get("curr_bed_type")->enum_keys_map;
|
const t_config_enum_values* keys_map = print_config_def.get("curr_bed_type")->enum_keys_map;
|
||||||
if (keys_map) {
|
if (keys_map) {
|
||||||
for (auto item : *keys_map) {
|
for (auto item : *keys_map) {
|
||||||
|
@ -10093,19 +10097,39 @@ void Plater::reslice()
|
||||||
auto filament_preset = wxGetApp().preset_bundle->filaments.find_preset(filament_presets[i]);
|
auto filament_preset = wxGetApp().preset_bundle->filaments.find_preset(filament_presets[i]);
|
||||||
if (filament_preset->is_system) {
|
if (filament_preset->is_system) {
|
||||||
j["filament_preset_" + std::to_string(i)] = filament_preset->name;
|
j["filament_preset_" + std::to_string(i)] = filament_preset->name;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
j["filament_preset_" + std::to_string(i)] = filament_preset->config.opt_string("inherits");
|
j["filament_preset_" + std::to_string(i)] = filament_preset->config.opt_string("inherits");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto print_preset = wxGetApp().preset_bundle->prints.get_edited_preset();
|
Preset& print_preset = wxGetApp().preset_bundle->prints.get_edited_preset();
|
||||||
if (print_preset.is_system) {
|
if (print_preset.is_system) {
|
||||||
j["print_preset"] = print_preset.name;
|
j["process_preset"] = print_preset.name;
|
||||||
} else {
|
}
|
||||||
j["print_preset"] = print_preset.config.opt_string("inherits");
|
else {
|
||||||
|
j["process_preset"] = print_preset.config.opt_string("inherits");
|
||||||
|
}
|
||||||
|
j["support_type"] = ConfigOptionEnum<SupportType>::get_enum_names().at(print_preset.config.opt_enum<SupportType>("support_type"));
|
||||||
|
j["sparse_infill_pattern"] = ConfigOptionEnum<InfillPattern>::get_enum_names().at(print_preset.config.opt_enum<InfillPattern>("sparse_infill_pattern"));
|
||||||
|
j["sparse_infill_density"] = print_preset.config.opt<ConfigOptionPercent>("sparse_infill_density")->value;
|
||||||
|
|
||||||
|
j["brim_type"] = ConfigOptionEnum<BrimType>::get_enum_names().at(print_preset.config.opt_enum<BrimType>("brim_type"));
|
||||||
|
j["user_mode"] = wxGetApp().get_mode_str();
|
||||||
|
|
||||||
|
if (p->background_process.fff_print()) {
|
||||||
|
const DynamicPrintConfig& full_config = p->background_process.fff_print()->full_print_config();
|
||||||
|
json values = json::array();
|
||||||
|
if (full_config.has("different_settings_to_system")) {
|
||||||
|
std::vector<std::string> different_values = full_config.option<ConfigOptionStrings>("different_settings_to_system")->values;
|
||||||
|
for (auto& item : different_values) {
|
||||||
|
values.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j["different_settings_to_system"] = values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
j["record_event"] = action;
|
||||||
NetworkAgent* agent = wxGetApp().getAgent();
|
NetworkAgent* agent = wxGetApp().getAgent();
|
||||||
if (agent)
|
if (agent)
|
||||||
agent->track_event("slice_completed", j.dump());
|
agent->track_event("slice_completed", j.dump());
|
||||||
|
@ -10114,7 +10138,6 @@ void Plater::reslice()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add project slicing related logic
|
//BBS: add project slicing related logic
|
||||||
|
@ -10249,7 +10272,7 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
|
||||||
|
|
||||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||||
if (preset_bundle) {
|
if (preset_bundle) {
|
||||||
j["Gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
j["gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physical_printer_config) {
|
if (physical_printer_config) {
|
||||||
|
|
|
@ -339,6 +339,7 @@ public:
|
||||||
bool has_toolpaths_to_export() const;
|
bool has_toolpaths_to_export() const;
|
||||||
void export_toolpaths_to_obj() const;
|
void export_toolpaths_to_obj() const;
|
||||||
void reslice();
|
void reslice();
|
||||||
|
void record_slice_preset(std::string action);
|
||||||
void reslice_SLA_supports(const ModelObject &object, bool postpone_error_messages = false);
|
void reslice_SLA_supports(const ModelObject &object, bool postpone_error_messages = false);
|
||||||
void reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages = false);
|
void reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages = false);
|
||||||
void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false);
|
void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false);
|
||||||
|
|
Loading…
Reference in New Issue