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

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

Collaboration diagram for Slic3r::DevStatus:

Public Member Functions

 DevStatus (MachineObject *owner)
std::optional< DevJobState > GetJobState () const
void ParseStatus (const nlohmann::json &print_jj)

Private Attributes

MachineObject * m_owner = nullptr
std::optional< DevJobState > m_job_state

Detailed Description

Constructor & Destructor Documentation

◆ DevStatus()

Slic3r::DevStatus::DevStatus ( MachineObject * owner)
inline
28: m_owner(owner) {};
MachineObject * m_owner
Definition DevStatus.h:37

References m_owner.

Member Function Documentation

◆ GetJobState()

std::optional< DevJobState > Slic3r::DevStatus::GetJobState ( ) const
inline
31{ return m_job_state; }
std::optional< DevJobState > m_job_state
Definition DevStatus.h:38

References m_job_state.

◆ ParseStatus()

void Slic3r::DevStatus::ParseStatus ( const nlohmann::json & print_jj)
9{
10 try {
11 if (print_jj.contains("job")) {
12 const nlohmann::json& job_jj = print_jj.at("job");
13 if (job_jj.contains("job_state")) {
14 auto new_state = (DevJobState)job_jj.at("job_state").get<int>();
15 if (m_job_state != new_state) {
16 m_job_state = new_state;
17 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": job_state-> " << (int)new_state;
18 }
19
22 }
23 }
24 }
25 } catch (const std::exception& e) {
26#if BBL_RELEASE_TO_PUBLIC
27 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": get exception";
28#else
29 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": get exception=" << e.what();
30#endif
31 (void)e; // suppress C4101 when BBL_RELEASE_TO_PUBLIC
32 }
33}
DevJobState
Definition DevStatus.h:9
@ JobStateFinishing
Definition DevStatus.h:20
@ JobStateFinish
Definition DevStatus.h:18

References Slic3r::JobStateFinish, Slic3r::JobStateFinishing, and m_job_state.

Member Data Documentation

◆ m_job_state

std::optional<DevJobState> Slic3r::DevStatus::m_job_state
private

Referenced by GetJobState(), and ParseStatus().

◆ m_owner

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

Referenced by DevStatus().


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