ENH: use json to store filament & nozzle info

1.Use json to store nozzle hrc
2.Use json to store filament temp type

jira: STUDIO-3488

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I8eb226e26352a41418f4e46d8cda403dc22ecff4
(cherry picked from commit 62a71d5b1947474d3d86be9015551c1007c89702)
This commit is contained in:
xun.zhang 2023-09-01 10:26:53 +08:00 committed by Lane.Wei
parent 9ce3487b20
commit 96abc3209a
7 changed files with 128 additions and 30 deletions

View file

@ -64,12 +64,6 @@ const std::vector<std::string> GCodeProcessor::Reserved_Tags = {
const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START";
const std::string GCodeProcessor::Flush_End_Tag = " FLUSH_END";
const std::map<NozzleType,int> GCodeProcessor::Nozzle_Type_To_HRC={
{NozzleType::ntStainlessSteel,20},
{NozzleType::ntHardenedSteel,55},
{NozzleType::ntBrass,2},
{NozzleType::ntUndefine,0}
};
const float GCodeProcessor::Wipe_Width = 0.05f;
const float GCodeProcessor::Wipe_Height = 0.05f;
@ -4315,7 +4309,7 @@ void GCodeProcessor::update_slice_warnings()
warning.params.clear();
warning.level=1;
int nozzle_hrc = Nozzle_Type_To_HRC.find(m_result.nozzle_type)->second;
int nozzle_hrc = Print::get_hrc_by_nozzle_type(m_result.nozzle_type);
if (nozzle_hrc!=0) {
for (size_t i = 0; i < used_extruders.size(); i++) {
int HRC=0;