mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
ENH: support E3D nozzle flow type
Jira: [STUDIO-13934] Change-Id: I3818c3881e8a926209f2bac321550f3c7a1a9f0d (cherry picked from commit 5bb1c2e66ad5bddfcba6898d9bc330217e912e48)
This commit is contained in:
@@ -62,6 +62,7 @@ static void s_parse_nozzle_type(const std::string& nozzle_type_str, DevNozzle& n
|
|||||||
|
|
||||||
void DevNozzleSystemParser::ParseV1_0(const nlohmann::json& nozzletype_json,
|
void DevNozzleSystemParser::ParseV1_0(const nlohmann::json& nozzletype_json,
|
||||||
const nlohmann::json& diameter_json,
|
const nlohmann::json& diameter_json,
|
||||||
|
const int& nozzle_flow_type,
|
||||||
DevNozzleSystem* system)
|
DevNozzleSystem* system)
|
||||||
{
|
{
|
||||||
//Since both the old and new protocols push data.
|
//Since both the old and new protocols push data.
|
||||||
@@ -98,6 +99,17 @@ void DevNozzleSystemParser::ParseV1_0(const nlohmann::json& nozzletype_json,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
if (nozzle_flow_type != -1) {
|
||||||
|
// 0: BBL S_FLOW; 1:E3D H_FLOW (only P)
|
||||||
|
if (nozzle_flow_type == 1) {
|
||||||
|
nozzle.m_nozzle_flow = NozzleFlowType::H_FLOW;
|
||||||
|
} else {
|
||||||
|
nozzle.m_nozzle_flow = NozzleFlowType::S_FLOW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
system->m_nozzles[nozzle.m_nozzle_id] = nozzle;
|
system->m_nozzles[nozzle.m_nozzle_id] = nozzle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Slic3r
|
|||||||
class DevNozzleSystemParser
|
class DevNozzleSystemParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void ParseV1_0(const nlohmann::json& nozzletype_json, const nlohmann::json& diameter_json, DevNozzleSystem* system);
|
static void ParseV1_0(const nlohmann::json& nozzletype_json, const nlohmann::json& diameter_json, const int& nozzle_flow_type, DevNozzleSystem* system);
|
||||||
static void ParseV2_0(const json& nozzle_json, DevNozzleSystem* system);
|
static void ParseV2_0(const json& nozzle_json, DevNozzleSystem* system);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -3272,7 +3272,14 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
|
|||||||
|
|
||||||
if (jj.contains("nozzle_diameter") && jj.contains("nozzle_type"))
|
if (jj.contains("nozzle_diameter") && jj.contains("nozzle_type"))
|
||||||
{
|
{
|
||||||
DevNozzleSystemParser::ParseV1_0(jj["nozzle_type"], jj["nozzle_diameter"], m_nozzle_system);
|
int nozzle_flow_type = -1;
|
||||||
|
|
||||||
|
if(jj.contains("flag3")){
|
||||||
|
int flag3 = jj["flag3"].get<int>();
|
||||||
|
nozzle_flow_type = get_flag_bits(flag3, 10, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
DevNozzleSystemParser::ParseV1_0(jj["nozzle_type"], jj["nozzle_diameter"], nozzle_flow_type, m_nozzle_system);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user