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

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

Public Member Functions

std::string get_long_error_code () const
HMSMessageLevel get_level () const
void set_read ()
bool has_read () const

Protected Member Functions

bool parse_hms_info (unsigned attr, unsigned code)

Private Attributes

ModuleID m_module_id
unsigned m_module_num
unsigned m_part_id
unsigned m_reserved
HMSMessageLevel m_msg_level = HMS_UNKNOWN
int m_msg_code = 0
bool m_already_read = false

Friends

void DevHMS::ParseHMSItems (const nlohmann::json &hms_json)

Detailed Description

Member Function Documentation

◆ get_level()

HMSMessageLevel Slic3r::DevHMSItem::get_level ( ) const
inline
66{ return m_msg_level; }
HMSMessageLevel m_msg_level
Definition DevHMS.h:80

References m_msg_level.

◆ get_long_error_code()

std::string Slic3r::DevHMSItem::get_long_error_code ( ) const
37{
38 char buf[64];
39 // Orca: HMS long-error-code format excludes the reserved byte and keys the Orca HMS wiki lookups
40 ::sprintf(buf, "%02X%02X%02X00000%1X%04X",
41 this->m_module_id,
42 this->m_module_num,
43 this->m_part_id,
44 (int)this->m_msg_level,
45 this->m_msg_code);
46 return std::string(buf);
47}
int m_msg_code
Definition DevHMS.h:81
ModuleID m_module_id
Definition DevHMS.h:76
unsigned m_module_num
Definition DevHMS.h:77
unsigned m_part_id
Definition DevHMS.h:78

References m_module_id, m_module_num, m_msg_code, m_msg_level, and m_part_id.

Referenced by Slic3r::GUI::HMSPanel::append_hms_panel().

Here is the caller graph for this function:

◆ has_read()

bool Slic3r::DevHMSItem::has_read ( ) const
inline
69{ return m_already_read; };
bool m_already_read
Definition DevHMS.h:82

References m_already_read.

◆ parse_hms_info()

bool Slic3r::DevHMSItem::parse_hms_info ( unsigned attr,
unsigned code )
protected
15{
16 bool result = true;
17 unsigned int model_id_int = (attr >> 24) & 0xFF;
18 this->m_module_id = (ModuleID)model_id_int;
19 this->m_module_num = (attr >> 16) & 0xFF;
20 this->m_part_id = (attr >> 8) & 0xFF;
21 this->m_reserved = (attr >> 0) & 0xFF;
22 unsigned msg_level_int = code >> 16;
23 if (msg_level_int < (unsigned)HMS_MSG_LEVEL_MAX)
24 {
25 this->m_msg_level = (HMSMessageLevel)msg_level_int;
26 }
27 else
28 {
30 }
31
32 this->m_msg_code = code & 0xFFFF;
33 return result;
34}
unsigned m_reserved
Definition DevHMS.h:79
ModuleID
Definition DevHMS.h:42
HMSMessageLevel
Definition DevHMS.h:32
@ HMS_UNKNOWN
Definition DevHMS.h:33
@ HMS_MSG_LEVEL_MAX
Definition DevHMS.h:38

References Slic3r::HMS_MSG_LEVEL_MAX, Slic3r::HMS_UNKNOWN, m_module_id, m_module_num, m_msg_code, m_msg_level, m_part_id, and m_reserved.

Referenced by Slic3r::DevHMS::ParseHMSItems().

Here is the caller graph for this function:

◆ set_read()

void Slic3r::DevHMSItem::set_read ( )
inline
68{ m_already_read = true; };

References m_already_read.

◆ DevHMS::ParseHMSItems

void DevHMS::ParseHMSItems ( const nlohmann::json & hms_json)
friend

Member Data Documentation

◆ m_already_read

bool Slic3r::DevHMSItem::m_already_read = false
private

Referenced by has_read(), and set_read().

◆ m_module_id

ModuleID Slic3r::DevHMSItem::m_module_id
private

◆ m_module_num

unsigned Slic3r::DevHMSItem::m_module_num
private

◆ m_msg_code

int Slic3r::DevHMSItem::m_msg_code = 0
private

◆ m_msg_level

HMSMessageLevel Slic3r::DevHMSItem::m_msg_level = HMS_UNKNOWN
private

◆ m_part_id

unsigned Slic3r::DevHMSItem::m_part_id
private

◆ m_reserved

unsigned Slic3r::DevHMSItem::m_reserved
private

Referenced by parse_hms_info().


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