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

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

Collaboration diagram for Slic3r::DevChamber:

Public Member Functions

bool HasChamber () const
bool SupportChamberTempDisplay () const
bool SupportChamberEdit () const
int GetChamberTempEditMin () const
int GetChamberTempEditMax () const
int GetChamberTempSwitchHeat () const
float GetChamberTemp () const
float GetChamberTempTarget () const
void ParseChamber (const nlohmann::json &print_json)
void ParseChamberV1_0 (const nlohmann::json &print_json)
void ParseChamberV2_0 (const nlohmann::json &print_json)
int CtrlSetChamberTemp (int temp)

Static Public Member Functions

static std::shared_ptr< DevChamber > Create (MachineObject *obj)

Protected Member Functions

 DevChamber (MachineObject *obj)

Private Attributes

float m_temp = 0.0f
float m_temp_target = 0.0f
MachineObject * m_owner = nullptr

Detailed Description

Constructor & Destructor Documentation

◆ DevChamber()

Slic3r::DevChamber::DevChamber ( MachineObject * obj)
inlineprotected
36: m_owner(obj) {}
MachineObject * m_owner
Definition DevChamber.h:41

References m_owner.

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ Create()

std::shared_ptr< DevChamber > Slic3r::DevChamber::Create ( MachineObject * obj)
inlinestatic
12{ return std::shared_ptr<DevChamber>( new DevChamber(obj)); }
DevChamber(MachineObject *obj)
Definition DevChamber.h:36

References DevChamber().

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

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

◆ CtrlSetChamberTemp()

int Slic3r::DevChamber::CtrlSetChamberTemp ( int temp)
11{
12 json j;
13 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
14 j["print"]["command"] = "set_ctt";
15 j["print"]["ctt_val"] = temp;
16
17 return m_owner->publish_json(j, 1);
18}
static int m_sequence_id
Definition DeviceManager.hpp:197
nlohmann::json json
Definition AssembleList.cpp:42

References m_owner, and Slic3r::MachineObject::m_sequence_id.

◆ GetChamberTemp()

float Slic3r::DevChamber::GetChamberTemp ( ) const
inline
22{ return m_temp; };
float m_temp
Definition DevChamber.h:39

References m_temp.

◆ GetChamberTempEditMax()

int Slic3r::DevChamber::GetChamberTempEditMax ( ) const
21{ return m_owner->GetConfig()->GetChamberTempEditMax(); }

References m_owner.

◆ GetChamberTempEditMin()

int Slic3r::DevChamber::GetChamberTempEditMin ( ) const
19{ return m_owner->GetConfig()->GetChamberTempEditMin(); }

References m_owner.

◆ GetChamberTempSwitchHeat()

int Slic3r::DevChamber::GetChamberTempSwitchHeat ( ) const
23{ return m_owner->GetConfig()->GetChamberTempSwitchHeat(); }

References m_owner.

◆ GetChamberTempTarget()

float Slic3r::DevChamber::GetChamberTempTarget ( ) const
inline
23{ return m_temp_target; };
float m_temp_target
Definition DevChamber.h:40

References m_temp_target.

◆ HasChamber()

bool Slic3r::DevChamber::HasChamber ( ) const
13{ return m_owner->GetConfig()->HasChamber(); }

References m_owner.

◆ ParseChamber()

void Slic3r::DevChamber::ParseChamber ( const nlohmann::json & print_json)
26{
27 ParseChamberV1_0(print_json);
28 ParseChamberV2_0(print_json);
29}
void ParseChamberV2_0(const nlohmann::json &print_json)
Definition DevChamber.cpp:37
void ParseChamberV1_0(const nlohmann::json &print_json)
Definition DevChamber.cpp:31

References ParseChamberV1_0(), and ParseChamberV2_0().

Here is the call graph for this function:

◆ ParseChamberV1_0()

void Slic3r::DevChamber::ParseChamberV1_0 ( const nlohmann::json & print_json)
32{
33 DevJsonValParser::ParseVal(print_json, "chamber_temper", m_temp);
34 DevJsonValParser::ParseVal(print_json, "ctt", m_temp_target);
35}
static void ParseVal(const nlohmann::json &j, const std::string &key, T &val)
Definition DevUtil.h:76

References m_temp, m_temp_target, and Slic3r::DevJsonValParser::ParseVal().

Referenced by ParseChamber().

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

◆ ParseChamberV2_0()

void Slic3r::DevChamber::ParseChamberV2_0 ( const nlohmann::json & print_json)
38{
39 if (print_json.contains("device")) {
40 const json &device_jj = print_json["device"];
41 if (device_jj.contains("ctc")) {
42 const json &ctc = device_jj["ctc"];
43 int state = DevUtil::get_flag_bits(ctc["state"].get<int>(), 0, 4);
44 if (ctc.contains("info")) {
45 const json &info = ctc["info"];
46 m_temp = DevUtil::get_flag_bits(info["temp"].get<int>(), 0, 16);
47 m_temp_target = DevUtil::get_flag_bits(info["temp"].get<int>(), 16, 16);
48 }
49 }
50 }
51}
static int get_flag_bits(std::string str, int start, int count=1)
Definition DevUtil.cpp:18

References Slic3r::DevUtil::get_flag_bits(), m_temp, and m_temp_target.

Referenced by ParseChamber().

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

◆ SupportChamberEdit()

bool Slic3r::DevChamber::SupportChamberEdit ( ) const
17{ return m_owner->GetConfig()->SupportChamberEdit(); }

References m_owner.

◆ SupportChamberTempDisplay()

bool Slic3r::DevChamber::SupportChamberTempDisplay ( ) const
15{ return m_owner->GetConfig()->SupportChamberTempDisplay();}

References m_owner.

Member Data Documentation

◆ m_owner

◆ m_temp

float Slic3r::DevChamber::m_temp = 0.0f
private

◆ m_temp_target

float Slic3r::DevChamber::m_temp_target = 0.0f
private

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceCore/DevChamber.h
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceCore/DevChamber.cpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceCore/DevChamberCtrl.cpp