NEW: Add buried point information
JIRA: NONE 1.Add buried points for tool usage duration 2.Add different_setting_to_system buried point in Cloud printing 3.Add right click menu type buried point 4.Add device control operation page buried points 5.Add usage of parameter area 6.Add workflow include duration, is makerworld and file type 7.Add daily tips url and user guide url Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com> Change-Id: Ibd41c07e6885645c260b85af7a3b7bb55f10d6d6
This commit is contained in:
parent
8d9ae9eb3a
commit
65ea5561f4
|
@ -84,6 +84,12 @@ void DailyTipsDataRenderer::open_wiki() const
|
|||
if (!m_data.wiki_url.empty())
|
||||
{
|
||||
wxGetApp().open_browser_with_warning_dialog(m_data.wiki_url);
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
json j;
|
||||
j["dayil_tips"] = m_data.wiki_url;
|
||||
agent->track_event("dayil_tips", j.dump());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2984,7 +2984,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||
|
||||
//BBS: add orient deactivate logic
|
||||
if (keyCode == WXK_ESCAPE
|
||||
&& (_deactivate_arrange_menu() || _deactivate_orient_menu()))
|
||||
&& (_deactivate_arrange_menu() || _deactivate_orient_menu() || _deactivate_layersediting_menu()))
|
||||
return;
|
||||
|
||||
if (m_gizmos.on_char(evt))
|
||||
|
@ -6242,6 +6242,7 @@ bool GLCanvas3D::_init_main_toolbar()
|
|||
return res;
|
||||
};
|
||||
item.enabling_callback = []()->bool { return wxGetApp().plater()->can_layers_editing(); };
|
||||
item.left.toggable = true;
|
||||
if (!m_main_toolbar.add_item(item))
|
||||
return false;
|
||||
|
||||
|
@ -7802,6 +7803,27 @@ void GLCanvas3D::_render_return_toolbar() const
|
|||
wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_3D));
|
||||
const_cast<GLGizmosManager*>(&m_gizmos)->reset_all_states();
|
||||
wxGetApp().plater()->get_view3D_canvas3D()->get_gizmos_manager().reset_all_states();
|
||||
{
|
||||
GLCanvas3D* view_3d = wxGetApp().plater()->get_view3D_canvas3D();
|
||||
GLToolbarItem* assembly_item = view_3d->m_assemble_view_toolbar.get_item("assembly_view");
|
||||
std::chrono::system_clock::time_point end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> duration = std::chrono::duration_cast<std::chrono::duration<double>>(end - assembly_item->get_start_time_point());
|
||||
float times = duration.count();
|
||||
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
std::string name = assembly_item->get_name() + "_duration";
|
||||
std::string value = "";
|
||||
float existing_time = 0;
|
||||
|
||||
agent->track_get_property(name, value);
|
||||
if (value != "") {
|
||||
existing_time = std::stof(value);
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " tool name:" << name << " duration: " << times + existing_time;
|
||||
agent->track_update_property(name, std::to_string(times + existing_time));
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar(1);
|
||||
|
|
|
@ -96,6 +96,39 @@ GLToolbarItem::GLToolbarItem(GLToolbarItem::EType type, const GLToolbarItem::Dat
|
|||
render_left_pos = 0.0f;
|
||||
}
|
||||
|
||||
void GLToolbarItem::set_state(EState state)
|
||||
{
|
||||
if (m_data.name == "arrange" || m_data.name == "layersediting" || m_data.name == "assembly_view") {
|
||||
if (m_state == Hover && state == HoverPressed) {
|
||||
start = std::chrono::system_clock::now();
|
||||
}
|
||||
else if ((m_state == HoverPressed && state == Hover) ||
|
||||
(m_state == Pressed && state == Normal) ||
|
||||
(m_state == HoverPressed && state == Normal)) {
|
||||
if (m_data.name != "assembly_view") {
|
||||
std::chrono::system_clock::time_point end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> duration = std::chrono::duration_cast<std::chrono::duration<double>>(end - start);
|
||||
float times = duration.count();
|
||||
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
std::string name = m_data.name + "_duration";
|
||||
std::string value = "";
|
||||
float existing_time = 0;
|
||||
|
||||
agent->track_get_property(name, value);
|
||||
if (value != "") {
|
||||
existing_time = std::stof(value);
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " tool name:" << name << " duration: " << times + existing_time;
|
||||
agent->track_update_property(name, std::to_string(times + existing_time));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_state = state;
|
||||
}
|
||||
|
||||
bool GLToolbarItem::update_visibility()
|
||||
{
|
||||
bool visible = m_data.visibility_callback();
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
|
||||
#include "GLTexture.hpp"
|
||||
#include "Event.hpp"
|
||||
|
@ -57,7 +58,6 @@ wxDECLARE_EVENT(EVT_GLVIEWTOOLBAR_PREVIEW, SimpleEvent);
|
|||
wxDECLARE_EVENT(EVT_GLVIEWTOOLBAR_ASSEMBLE, SimpleEvent);
|
||||
|
||||
|
||||
|
||||
class GLToolbarItem
|
||||
{
|
||||
public:
|
||||
|
@ -172,14 +172,19 @@ private:
|
|||
Data m_data;
|
||||
EActionType m_last_action_type;
|
||||
EHighlightState m_highlight_state;
|
||||
std::chrono::system_clock::time_point start;
|
||||
|
||||
public:
|
||||
|
||||
// remember left position for rendering menu
|
||||
mutable float render_left_pos;
|
||||
|
||||
std::chrono::system_clock::time_point get_start_time_point() const { return start; }
|
||||
|
||||
GLToolbarItem(EType type, const Data& data);
|
||||
|
||||
EState get_state() const { return m_state; }
|
||||
void set_state(EState state) { m_state = state; }
|
||||
void set_state(EState state);
|
||||
|
||||
EHighlightState get_highlight() const { return m_highlight_state; }
|
||||
void set_highlight(EHighlightState state) { m_highlight_state = state; }
|
||||
|
|
|
@ -3964,6 +3964,11 @@ std::string GUI_App::handle_web_request(std::string cmd)
|
|||
boost::optional<std::string> path = data_node.get_optional<std::string>("url");
|
||||
if (path.has_value()) {
|
||||
wxLaunchDefaultBrowser(path.value());
|
||||
if (m_agent) {
|
||||
json j;
|
||||
j["user_guide"] = path.value();
|
||||
m_agent->track_event("user_guide", j.dump());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1294,6 +1294,10 @@ void MenuFactory::update()
|
|||
|
||||
wxMenu* MenuFactory::default_menu()
|
||||
{
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("default_menu", std::to_string(++default_menu_count));
|
||||
}
|
||||
return &m_default_menu;
|
||||
}
|
||||
|
||||
|
@ -1303,6 +1307,10 @@ wxMenu* MenuFactory::object_menu()
|
|||
append_menu_items_flush_options(&m_object_menu);
|
||||
append_menu_item_invalidate_cut_info(&m_object_menu);
|
||||
append_menu_item_change_filament(&m_object_menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("object_menu", std::to_string(++object_menu_count));
|
||||
}
|
||||
return &m_object_menu;
|
||||
}
|
||||
|
||||
|
@ -1311,7 +1319,10 @@ wxMenu* MenuFactory::sla_object_menu()
|
|||
append_menu_items_convert_unit(&m_sla_object_menu);
|
||||
append_menu_item_settings(&m_sla_object_menu);
|
||||
//update_menu_items_instance_manipulation(mtObjectSLA);
|
||||
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("sla_object_menu", std::to_string(++sla_obj_menu_count));
|
||||
}
|
||||
return &m_sla_object_menu;
|
||||
}
|
||||
|
||||
|
@ -1320,16 +1331,28 @@ wxMenu* MenuFactory::part_menu()
|
|||
append_menu_items_convert_unit(&m_part_menu);
|
||||
append_menu_item_change_filament(&m_part_menu);
|
||||
append_menu_item_per_object_settings(&m_part_menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("part_menu", std::to_string(++part_menu_count));
|
||||
}
|
||||
return &m_part_menu;
|
||||
}
|
||||
|
||||
wxMenu* MenuFactory::instance_menu()
|
||||
{
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("instance_menu", std::to_string(++instance_menu_count));
|
||||
}
|
||||
return &m_instance_menu;
|
||||
}
|
||||
|
||||
wxMenu* MenuFactory::layer_menu()
|
||||
{
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("layer_menu", std::to_string(++layer_menu_count));
|
||||
}
|
||||
MenuWithSeparators* menu = new MenuWithSeparators();
|
||||
append_menu_item_settings(menu);
|
||||
|
||||
|
@ -1392,6 +1415,11 @@ wxMenu* MenuFactory::multi_selection_menu()
|
|||
[]() { return plater()->can_split(true); }, m_parent);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("multi_selection_menu", std::to_string(++multi_selection_menu_count));
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
@ -1412,6 +1440,10 @@ wxMenu* MenuFactory::assemble_multi_selection_menu()
|
|||
append_menu_item_delete(menu);
|
||||
menu->AppendSeparator();
|
||||
append_menu_item_change_extruder(menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("asseble_mulit_selection_menu", std::to_string(++assemble_mulit_selection_menu_count));
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
@ -1421,6 +1453,10 @@ wxMenu* MenuFactory::plate_menu()
|
|||
{
|
||||
append_menu_item_locked(&m_plate_menu);
|
||||
append_menu_item_plate_name(&m_plate_menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("plate_menu", std::to_string(++plate_menu_count));
|
||||
}
|
||||
return &m_plate_menu;
|
||||
}
|
||||
|
||||
|
@ -1441,6 +1477,10 @@ wxMenu* MenuFactory::assemble_object_menu()
|
|||
append_menu_item_change_extruder(menu);
|
||||
//// Enter per object parameters
|
||||
//append_menu_item_per_object_settings(menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("assemble_object_menu", std::to_string(++assemble_object_menu_ocunt));
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
@ -1455,6 +1495,10 @@ wxMenu* MenuFactory::assemble_part_menu()
|
|||
|
||||
append_menu_item_change_extruder(menu);
|
||||
//append_menu_item_per_object_settings(menu);
|
||||
{
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_update_property("assemble_part_menu", std::to_string(++assemble_part_menu_count));
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,6 +94,17 @@ private:
|
|||
MenuWithSeparators m_assemble_object_menu;
|
||||
MenuWithSeparators m_assemble_part_menu;
|
||||
|
||||
int object_menu_count{ 0 };
|
||||
int part_menu_count{ 0 };
|
||||
int sla_obj_menu_count{ 0 };
|
||||
int default_menu_count{ 0 };
|
||||
int instance_menu_count{ 0 };
|
||||
int plate_menu_count{ 0 };
|
||||
int layer_menu_count{ 0 };
|
||||
int multi_selection_menu_count{ 0 };
|
||||
int assemble_object_menu_ocunt{ 0 };
|
||||
int assemble_part_menu_count{ 0 };
|
||||
int assemble_mulit_selection_menu_count{ 0 };
|
||||
|
||||
// Removed/Prepended Items according to the view mode
|
||||
std::array<wxMenuItem*, mtCount> items_increase;
|
||||
|
|
|
@ -225,6 +225,7 @@ protected:
|
|||
virtual void on_save(cereal::BinaryOutputArchive &ar) const override;
|
||||
virtual void data_changed(bool is_serializing) override;
|
||||
virtual std::string on_get_name() const;
|
||||
virtual std::string on_get_name_str() override { return "Cut"; }
|
||||
virtual void on_set_state();
|
||||
virtual bool on_is_activable() const;
|
||||
virtual CommonGizmosDataID on_get_requirements() const override;
|
||||
|
|
|
@ -166,6 +166,38 @@ GLGizmoBase::GLGizmoBase(GLCanvas3D& parent, const std::string& icon_filename, u
|
|||
m_cylinder.init_from(its_make_cylinder(1., 1., 2 * PI / 24.));
|
||||
}
|
||||
|
||||
void GLGizmoBase::set_state(EState state)
|
||||
{
|
||||
std::string name = on_get_name_str();
|
||||
if (name != "") {
|
||||
if (m_state == Off && state == On) {
|
||||
start = std::chrono::system_clock::now();
|
||||
}
|
||||
else if (m_state == On && state == Off) {
|
||||
std::chrono::system_clock::time_point end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> duration = std::chrono::duration_cast<std::chrono::duration<double>>(end - start);
|
||||
float times = duration.count();
|
||||
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
std::string full_name = name + "_duration";
|
||||
std::string value = "";
|
||||
float existing_time = 0;
|
||||
|
||||
agent->track_get_property(full_name, value);
|
||||
if (value != "") {
|
||||
existing_time = std::stof(value);
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " tool name:" << full_name << " duration: " << times + existing_time;
|
||||
agent->track_update_property(full_name, std::to_string(times + existing_time));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_state = state;
|
||||
on_set_state();
|
||||
}
|
||||
|
||||
void GLGizmoBase::set_icon_filename(const std::string &filename) {
|
||||
m_icon_filename = filename;
|
||||
}
|
||||
|
|
|
@ -128,6 +128,8 @@ protected:
|
|||
|
||||
bool m_is_dark_mode = false;
|
||||
|
||||
std::chrono::system_clock::time_point start;
|
||||
|
||||
public:
|
||||
GLGizmoBase(GLCanvas3D& parent,
|
||||
const std::string& icon_filename,
|
||||
|
@ -145,8 +147,7 @@ public:
|
|||
void set_group_id(int id) { m_group_id = id; }
|
||||
|
||||
EState get_state() const { return m_state; }
|
||||
void set_state(EState state) { m_state = state; on_set_state(); }
|
||||
|
||||
void set_state(EState state);
|
||||
int get_shortcut_key() const { return m_shortcut_key; }
|
||||
|
||||
const std::string& get_icon_filename() const { return m_icon_filename; }
|
||||
|
@ -195,7 +196,6 @@ public:
|
|||
/// </summary>
|
||||
virtual void data_changed(bool is_serializing){};
|
||||
int get_count() { return ++count; }
|
||||
std::string get_gizmo_name() { return on_get_name(); }
|
||||
|
||||
protected:
|
||||
float last_input_window_width = 0;
|
||||
|
@ -203,6 +203,7 @@ protected:
|
|||
virtual void on_load(cereal::BinaryInputArchive& ar) {}
|
||||
virtual void on_save(cereal::BinaryOutputArchive& ar) const {}
|
||||
virtual std::string on_get_name() const = 0;
|
||||
virtual std::string on_get_name_str() { return ""; }
|
||||
virtual void on_set_state() {}
|
||||
virtual void on_set_hover_id() {}
|
||||
virtual bool on_is_activable() const { return true; }
|
||||
|
|
|
@ -19,6 +19,7 @@ protected:
|
|||
void on_render_for_picking() override {}
|
||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Face recognition"; }
|
||||
void on_set_state() override;
|
||||
bool on_is_activable() const override;
|
||||
CommonGizmosDataID on_get_requirements() const override;
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
protected:
|
||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Supports Painting"; }
|
||||
|
||||
// BBS
|
||||
void render_triangles(const Selection& selection) const override;
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Lay on face"; }
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_render() override;
|
||||
|
|
|
@ -97,6 +97,7 @@ protected:
|
|||
virtual CommonGizmosDataID on_get_requirements() const override;
|
||||
|
||||
std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Hollow and drill"; }
|
||||
bool on_is_activable() const override;
|
||||
bool on_is_selectable() const override;
|
||||
void on_load(cereal::BinaryInputArchive& ar) override;
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Mesh Boolean"; }
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_render() override;
|
||||
virtual void on_render_for_picking() override {}
|
||||
|
|
|
@ -95,6 +95,7 @@ protected:
|
|||
|
||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Color Painting"; }
|
||||
void show_tooltip_information(float caption_max, float x, float y);
|
||||
bool on_is_selectable() const override;
|
||||
bool on_is_activable() const override;
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Move"; }
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_stop_dragging() override;
|
||||
|
|
|
@ -114,6 +114,7 @@ public:
|
|||
protected:
|
||||
bool on_init() override;
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Rotate"; }
|
||||
void on_set_state() override
|
||||
{
|
||||
for (GLGizmoRotate& g : m_gizmos)
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Scale"; }
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_update(const UpdateData& data) override;
|
||||
|
|
|
@ -22,6 +22,7 @@ protected:
|
|||
wchar_t m_current_tool = 0;
|
||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "Seam painting"; }
|
||||
PainterGizmoType get_painter_type() const override;
|
||||
|
||||
void render_triangles(const Selection &selection) const override;
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Simplify"; }
|
||||
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual bool on_is_selectable() const override { return false; }
|
||||
|
|
|
@ -136,6 +136,7 @@ protected:
|
|||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
|
||||
std::string on_get_name() const override;
|
||||
std::string on_get_name_str() override { return "SLA Support Points"; }
|
||||
bool on_is_activable() const override;
|
||||
bool on_is_selectable() const override;
|
||||
virtual CommonGizmosDataID on_get_requirements() const override;
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual std::string on_get_name_str() override { return "Text shape"; }
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_render() override;
|
||||
virtual void on_render_for_picking() override;
|
||||
|
|
|
@ -529,6 +529,104 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||
j["assembly_view"] = value;
|
||||
|
||||
agent->track_event("key_func", j.dump());
|
||||
|
||||
j.clear();
|
||||
value = "";
|
||||
agent->track_get_property("arrange_duration", value);
|
||||
j["auto_arrange"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("layersediting_duration", value);
|
||||
j["custom_height"] = value;
|
||||
|
||||
value = "";
|
||||
agent->track_get_property("Move_duration", value);
|
||||
j["move"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Rotate_duration", value);
|
||||
j["rotate"] = value;
|
||||
agent->track_get_property("Scale_duration", value);
|
||||
j["scale"] = value;
|
||||
agent->track_get_property("Lay on face_duration", value);
|
||||
j["flatten"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Cut_duration", value);
|
||||
j["cut"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Mesh Boolean_duration", value);
|
||||
j["mesh_boolean"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Supports Painting_duration", value);
|
||||
j["custom_support"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Seam painting_duration", value);
|
||||
j["custom_seam"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Text shape_duration", value);
|
||||
j["text_shape"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Color Painting_duration", value);
|
||||
j["color_painting"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("assembly_view_duration", value);
|
||||
j["assembly_view"] = value;
|
||||
|
||||
agent->track_event("key_func_duration", j.dump());
|
||||
|
||||
j.clear();
|
||||
value = "";
|
||||
agent->track_get_property("default_menu", value);
|
||||
j["default_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("object_menu", value);
|
||||
j["object_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("sla_object_menu", value);
|
||||
j["sla_object_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("part_menu", value);
|
||||
j["part_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("instance_menu", value);
|
||||
j["instance_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("layer_menu", value);
|
||||
j["layer_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("multi_selection_menu", value);
|
||||
j["multi_selection_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("plate_menu", value);
|
||||
j["plate_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("assemble_object_menu", value);
|
||||
j["assemble_object_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("assemble_part_menu", value);
|
||||
j["assemble_part_menu"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("assemble_mulit_selection_menu", value);
|
||||
j["assemble_mulit_selection_menu"] = value;
|
||||
value = "";
|
||||
agent->track_event("menu_click", j.dump());
|
||||
|
||||
j.clear();
|
||||
value = "";
|
||||
agent->track_get_property("select_device_page", value);
|
||||
j["device_page"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Status", value);
|
||||
j["status"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("MicroSD Card", value);
|
||||
j["MicroSD_card"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("Update", value);
|
||||
j["update"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("HMS", value);
|
||||
j["HMS"] = value;
|
||||
value = "";
|
||||
agent->track_event("device_ctrl", j.dump());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1070,6 +1168,9 @@ void MainFrame::init_tabpanel()
|
|||
// m_param_panel->OnActivate();
|
||||
else if (panel == m_monitor) {
|
||||
//monitor
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent)
|
||||
agent->track_update_property("select_device_page", std::to_string(++select_device_page_count));
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
if (sel == tp3DEditor) {
|
||||
|
|
|
@ -393,6 +393,8 @@ public:
|
|||
void update_side_button_style();
|
||||
void update_slice_print_status(SlicePrintEventType event, bool can_slice = true, bool can_print = true);
|
||||
|
||||
int select_device_page_count{ 0 };
|
||||
|
||||
#ifdef __APPLE__
|
||||
std::unique_ptr<wxTaskBarIcon> m_taskbar_icon;
|
||||
#endif // __APPLE__
|
||||
|
|
|
@ -171,6 +171,26 @@ MonitorPanel::~MonitorPanel()
|
|||
m_media_file_panel->SwitchStorage(title == _L("SD Card"));
|
||||
}
|
||||
page->SetFocus();
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " select :" << m_tabpanel->GetPageText(m_tabpanel->GetSelection());
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
std::string name = m_tabpanel->GetPageText(m_tabpanel->GetSelection()).ToStdString();
|
||||
if (name != "") {
|
||||
std::string value = "";
|
||||
agent->track_get_property(name, value);
|
||||
int count = 0;
|
||||
if (value != "") {
|
||||
try {
|
||||
count = std::stoi(value);
|
||||
}
|
||||
catch (...) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << __LINE__ << " String to integer error!";
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
agent->track_update_property(name, std::to_string(++count));
|
||||
}
|
||||
}
|
||||
}, m_tabpanel->GetId());
|
||||
|
||||
//m_status_add_machine_panel = new AddMachinePanel(m_tabpanel);
|
||||
|
|
|
@ -3002,6 +3002,39 @@ void PartPlate::print() const
|
|||
return;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> PartPlate::get_diff_object_setting()
|
||||
{
|
||||
std::map<std::string, std::string> out;
|
||||
for (auto it = obj_to_instance_set.cbegin(); it != obj_to_instance_set.cend(); ++it) {
|
||||
const ModelConfigObject& different_object_config = m_model->objects[it->first]->config;
|
||||
for (auto iter = different_object_config.cbegin(); iter != different_object_config.cend(); ++iter) {
|
||||
std::string config_name = iter->first;
|
||||
std::string config_value = iter->second->serialize();
|
||||
if (out.find(config_name) == out.end()) {
|
||||
out[config_name] = config_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> PartPlate::get_diff_plate_setting()
|
||||
{
|
||||
std::map<std::string, std::string> out;
|
||||
for (auto it = m_config.cbegin(); it != m_config.cend(); ++it) {
|
||||
std::string diff_config_name = it->first;
|
||||
std::string diff_config_value;
|
||||
if (diff_config_name == "first_layer_print_sequence") {
|
||||
diff_config_value = "cutomize";
|
||||
}
|
||||
else {
|
||||
diff_config_value = it->second->serialize();
|
||||
}
|
||||
out[diff_config_name] = diff_config_value;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/* PartPlate List related functions*/
|
||||
PartPlateList::PartPlateList(int width, int depth, int height, Plater* platerObj, Model* modelObj, PrinterTechnology tech)
|
||||
:m_plate_width(width), m_plate_depth(depth), m_plate_height(height), m_plater(platerObj), m_model(modelObj), printer_technology(tech),
|
||||
|
|
|
@ -482,6 +482,9 @@ public:
|
|||
|
||||
void print() const;
|
||||
|
||||
std::map<std::string, std::string> get_diff_object_setting();
|
||||
std::map<std::string, std::string> get_diff_plate_setting();
|
||||
|
||||
friend class cereal::access;
|
||||
friend class UndoRedo::StackImpl;
|
||||
|
||||
|
|
|
@ -2039,6 +2039,7 @@ struct Plater::priv
|
|||
bool m_need_update{false};
|
||||
//BBS: add popup object table logic
|
||||
//ObjectTableDialog* m_popup_table{ nullptr };
|
||||
std::chrono::system_clock::time_point start;
|
||||
|
||||
#if ENABLE_ENVIRONMENT_MAP
|
||||
GLTexture environment_texture;
|
||||
|
@ -4082,6 +4083,31 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
if (msg.ShowModal() == wxID_YES) {}
|
||||
}
|
||||
}
|
||||
std::chrono::system_clock::time_point default_time;
|
||||
if (start == default_time) {
|
||||
start = std::chrono::system_clock::now();
|
||||
}
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent) {
|
||||
if (!input_files.empty()) {
|
||||
auto path = input_files.front();
|
||||
std::string extension = path.extension().string();
|
||||
|
||||
std::string value = "";
|
||||
agent->track_get_property("file_type", value);
|
||||
if (value == "") {
|
||||
value = extension;
|
||||
agent->track_update_property("file_type", value);
|
||||
}
|
||||
|
||||
if (model.model_info == nullptr) {
|
||||
agent->track_update_property("is_mw", "false");
|
||||
}
|
||||
else {
|
||||
agent->track_update_property("is_mw", "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj_idxs;
|
||||
}
|
||||
|
||||
|
@ -8142,9 +8168,90 @@ void Plater::priv::record_start_print_preset(std::string action) {
|
|||
j["process_preset"] = print_preset.config.opt_string("inherits");
|
||||
}
|
||||
|
||||
json j_system;
|
||||
if (background_process.fff_print()) {
|
||||
const DynamicPrintConfig& full_config = background_process.fff_print()->full_print_config();
|
||||
if (full_config.has("different_settings_to_system")) {
|
||||
std::vector<std::string> different_values = full_config.option<ConfigOptionStrings>("different_settings_to_system")->values;
|
||||
std::vector<std::string> values;
|
||||
boost::split(values, different_values.front(), boost::is_any_of(";"));
|
||||
for (int i = 0; i < values.size(); ++i) {
|
||||
std::string str = values[i];
|
||||
const ConfigOption* config = full_config.option(str);
|
||||
j_system[str] = config->serialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
j["global_diff"] = j_system;
|
||||
|
||||
PartPlate* curr_plate = partplate_list.get_curr_plate();
|
||||
|
||||
json j_object;
|
||||
if (action == "print_plate") {
|
||||
std::map<std::string, std::string> modify_object_setting = curr_plate->get_diff_object_setting();
|
||||
for (auto it = modify_object_setting.cbegin(); it != modify_object_setting.cend(); ++it) {
|
||||
j_object[it->first] = it->second;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < model.objects.size(); ++i) {
|
||||
const ModelConfigObject& diff_object_config = model.objects[i]->config;
|
||||
for (auto it = diff_object_config.cbegin(); it != diff_object_config.cend(); ++it) {
|
||||
std::string config_name = it->first;
|
||||
std::string config_value = it->second->serialize();
|
||||
if (j_object.find(config_name) == j_object.end()) {
|
||||
j_object[config_name] = config_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
j["object_diff"] = j_object;
|
||||
|
||||
json j_plate;
|
||||
if (action == "print_plate") {
|
||||
std::map<std::string, std::string> diff_plate_setting = curr_plate->get_diff_plate_setting();
|
||||
for (auto it = diff_plate_setting.cbegin(); it != diff_plate_setting.cend(); ++it) {
|
||||
j_plate["plate_" + std::to_string(curr_plate->get_index())][it->first] = it->second;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < plate_count; ++i) {
|
||||
std::string key = "plate_" + std::to_string(i);
|
||||
DynamicPrintConfig* diff_plate_config = partplate_list.get_plate(i)->config();
|
||||
for (auto it = diff_plate_config->cbegin(); it != diff_plate_config->cend(); ++it) {
|
||||
std::string diff_config_name = it->first;
|
||||
std::string diff_config_value;
|
||||
if (diff_config_name == "first_layer_print_sequence") {
|
||||
diff_config_value = "cutomize";
|
||||
}
|
||||
else {
|
||||
diff_config_value = it->second->serialize();
|
||||
}
|
||||
j_plate[key][diff_config_name] = diff_config_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
j["plate_diff"] = j_plate;
|
||||
|
||||
json j_workflow_debug;
|
||||
std::chrono::system_clock::time_point end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> duration = std::chrono::duration_cast<std::chrono::duration<double>>(end - start);
|
||||
float times = duration.count();
|
||||
j_workflow_debug["duration"] = times;
|
||||
|
||||
j["record_event"] = action;
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent) agent->track_event("user_start_print", j.dump());
|
||||
if (agent) {
|
||||
std::string value = "";
|
||||
agent->track_get_property("file_type", value);
|
||||
j_workflow_debug["file_type"] = value;
|
||||
value = "";
|
||||
agent->track_get_property("is_mw", value);
|
||||
j_workflow_debug["is_mw"] = value;
|
||||
|
||||
agent->track_event("user_start_print", j.dump());
|
||||
agent->track_event("workflow_debug", j_workflow_debug.dump());
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
return;
|
||||
|
@ -11318,8 +11425,10 @@ void Plater::record_slice_preset(std::string action)
|
|||
|
||||
j["record_event"] = action;
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent)
|
||||
if (agent) {
|
||||
agent->track_event("slice_completed", j.dump());
|
||||
agent->track_update_property("different_settings_to_system", j["different_set_to_system"]);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue