OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::DevExtensionToolParser Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceCore/DevExtensionTool.h>

Static Public Member Functions

static void ParseV2_0 (const nlohmann::json &extension_tool_json, std::weak_ptr< DevExtensionTool > extension_tool)

Detailed Description

Member Function Documentation

◆ ParseV2_0()

void Slic3r::DevExtensionToolParser::ParseV2_0 ( const nlohmann::json & extension_tool_json,
std::weak_ptr< DevExtensionTool > extension_tool )
static
19{
20 if (auto ext_tool = extension_tool.lock())
21 {
22 DevJsonValParser::ParseVal(extension_tool_json, "mount_3d", ext_tool->m_mount_3dp, ext_tool->m_mount_3dp);
23 DevJsonValParser::ParseVal(extension_tool_json, "calib", ext_tool->m_calib, ext_tool->m_calib);
24
25 {
26 const std::string& type_str = DevJsonValParser::GetVal<std::string>(extension_tool_json, "type", "");
27 static std::map<std::string, DevExtensionTool::ToolType> s_type_map = {
31 };
32
33 auto iter = s_type_map.find(type_str);
34 iter != s_type_map.end() ? ext_tool->m_tool_type = iter->second : DevExtensionTool::TOOL_TYPE_EMPTY;
35 }
36 }
37}
@ TOOL_TYPE_LASER_LB00
Definition DevExtensionTool.h:56
@ TOOL_TYPE_FAN_F000
Definition DevExtensionTool.h:57
@ TOOL_TYPE_EMPTY
Definition DevExtensionTool.h:54
@ TOOL_TYPE_CUT_CP00
Definition DevExtensionTool.h:55
static void ParseVal(const nlohmann::json &j, const std::string &key, T &val)
Definition DevUtil.h:76
static T GetVal(const nlohmann::json &j, const std::string &key, const T &default_val=T())
Definition DevUtil.h:60

References Slic3r::DevJsonValParser::GetVal(), Slic3r::DevJsonValParser::ParseVal(), Slic3r::DevExtensionTool::TOOL_TYPE_CUT_CP00, Slic3r::DevExtensionTool::TOOL_TYPE_EMPTY, Slic3r::DevExtensionTool::TOOL_TYPE_FAN_F000, and Slic3r::DevExtensionTool::TOOL_TYPE_LASER_LB00.

Referenced by Slic3r::MachineObject::parse_new_info().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: