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

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

Collaboration diagram for Slic3r::DevLamp:

Public Types

enum  LIGHT_EFFECT { LIGHT_EFFECT_ON , LIGHT_EFFECT_OFF , LIGHT_EFFECT_FLASHING , LIGHT_EFFECT_UNKOWN }

Public Member Functions

 DevLamp (MachineObject *obj)
void SetChamberLight (const std::string &status)
void SetChamberLight (LIGHT_EFFECT effect)
bool IsChamberLightOn () const
void SetLampCloseRecheck (bool enable)
bool HasLampCloseRecheck () const
void CtrlSetChamberLight (LIGHT_EFFECT effect)

Private Member Functions

int command_set_chamber_light (LIGHT_EFFECT effect, int on_time=500, int off_time=500, int loops=1, int interval=1000)
int command_set_chamber_light2 (LIGHT_EFFECT effect, int on_time=500, int off_time=500, int loops=1, int interval=1000)

Private Attributes

MachineObject * m_owner = nullptr
bool m_lamp_close_recheck = false
LIGHT_EFFECT m_chamber_light = LIGHT_EFFECT_UNKOWN

Detailed Description

Member Enumeration Documentation

◆ LIGHT_EFFECT

Enumerator
LIGHT_EFFECT_ON 
LIGHT_EFFECT_OFF 
LIGHT_EFFECT_FLASHING 
LIGHT_EFFECT_UNKOWN 
16 {
21 };
@ LIGHT_EFFECT_OFF
Definition DevLamp.h:18
@ LIGHT_EFFECT_UNKOWN
Definition DevLamp.h:20
@ LIGHT_EFFECT_ON
Definition DevLamp.h:17
@ LIGHT_EFFECT_FLASHING
Definition DevLamp.h:19

Constructor & Destructor Documentation

◆ DevLamp()

Slic3r::DevLamp::DevLamp ( MachineObject * obj)
inline
12: m_owner(obj) {};
MachineObject * m_owner
Definition DevLamp.h:39

References m_owner.

Member Function Documentation

◆ command_set_chamber_light()

int Slic3r::DevLamp::command_set_chamber_light ( LIGHT_EFFECT effect,
int on_time = 500,
int off_time = 500,
int loops = 1,
int interval = 1000 )
private
38{
39 json j;
40 j["system"]["command"] = "ledctrl";
41 j["system"]["led_node"] = "chamber_light";
42 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
43 j["system"]["led_mode"] = _light_effect_str(effect);
44 j["system"]["led_on_time"] = on_time;
45 j["system"]["led_off_time"] = off_time;
46 j["system"]["loop_times"] = loops;
47 j["system"]["interval_time"] = interval;
48 return m_owner->publish_json(j);
49}
static int m_sequence_id
Definition DeviceManager.hpp:197
nlohmann::json json
Definition AssembleList.cpp:42
static std::string _light_effect_str(DevLamp::LIGHT_EFFECT effect)
Definition DevLampCtrl.cpp:14

References Slic3r::_light_effect_str(), m_owner, and Slic3r::MachineObject::m_sequence_id.

Referenced by CtrlSetChamberLight().

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

◆ command_set_chamber_light2()

int Slic3r::DevLamp::command_set_chamber_light2 ( LIGHT_EFFECT effect,
int on_time = 500,
int off_time = 500,
int loops = 1,
int interval = 1000 )
private
52{
53 json j;
54 j["system"]["command"] = "ledctrl";
55 j["system"]["led_node"] = "chamber_light2";
56 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
57 j["system"]["led_mode"] = _light_effect_str(effect);
58 j["system"]["led_on_time"] = on_time;
59 j["system"]["led_off_time"] = off_time;
60 j["system"]["loop_times"] = loops;
61 j["system"]["interval_time"] = interval;
62 return m_owner->publish_json(j);
63}

References Slic3r::_light_effect_str(), m_owner, and Slic3r::MachineObject::m_sequence_id.

Referenced by CtrlSetChamberLight().

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

◆ CtrlSetChamberLight()

void Slic3r::DevLamp::CtrlSetChamberLight ( LIGHT_EFFECT effect)
31{
32 // copied from others, TODO CHECK
35}
int command_set_chamber_light(LIGHT_EFFECT effect, int on_time=500, int off_time=500, int loops=1, int interval=1000)
Definition DevLampCtrl.cpp:37
int command_set_chamber_light2(LIGHT_EFFECT effect, int on_time=500, int off_time=500, int loops=1, int interval=1000)
Definition DevLampCtrl.cpp:51

References command_set_chamber_light(), and command_set_chamber_light2().

Here is the call graph for this function:

◆ HasLampCloseRecheck()

bool Slic3r::DevLamp::HasLampCloseRecheck ( ) const
inline
29{ return m_lamp_close_recheck; }
bool m_lamp_close_recheck
Definition DevLamp.h:41

References m_lamp_close_recheck.

◆ IsChamberLightOn()

bool Slic3r::DevLamp::IsChamberLightOn ( ) const
inline
LIGHT_EFFECT m_chamber_light
Definition DevLamp.h:42

References LIGHT_EFFECT_FLASHING, LIGHT_EFFECT_ON, and m_chamber_light.

◆ SetChamberLight() [1/2]

void Slic3r::DevLamp::SetChamberLight ( const std::string & status)
17{
19}
static Slic3r::DevLamp::LIGHT_EFFECT _light_effect_parse(std::string effect_str)
Definition DevLamp.cpp:4

References _light_effect_parse(), and m_chamber_light.

Here is the call graph for this function:

◆ SetChamberLight() [2/2]

void Slic3r::DevLamp::SetChamberLight ( LIGHT_EFFECT effect)
inline
25{ m_chamber_light = effect; }

References m_chamber_light.

◆ SetLampCloseRecheck()

void Slic3r::DevLamp::SetLampCloseRecheck ( bool enable)
inline
28{ m_lamp_close_recheck = enable;};

References m_lamp_close_recheck.

Member Data Documentation

◆ m_chamber_light

LIGHT_EFFECT Slic3r::DevLamp::m_chamber_light = LIGHT_EFFECT_UNKOWN
private

◆ m_lamp_close_recheck

bool Slic3r::DevLamp::m_lamp_close_recheck = false
private

◆ m_owner

MachineObject* Slic3r::DevLamp::m_owner = nullptr
private

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