Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Public Member Functions | Public Attributes | List of all members
user_cont Class Reference

Class used as a container for user data, that are selected from database. (and also for insert, but not everything is used in that case) More...

#include <user_workspace.h>

Public Member Functions

 user_cont (unsigned long, uint8_t *, uint8_t, std::string, std::string, std::string, std::string, uint8_t, std::tm, std::tm, std::tm, std::tm)
 Construct a new user cont object through value parameters, but this isn't used. Originally inteded for testing purposes. More...
 
void log_user_to_debug ()
 

Public Attributes

unsigned long id
 
unsigned long measure_count
 
std::string rfid_serial
 
uint8_t rfid_serial_bin [10]
 
uint8_t rfid_ser_len
 
std::string username
 
std::string name
 
std::string lastname
 
std::string description
 
uint8_t role
 
std::tm reg_date
 
std::tm last_login_date
 
std::tm created_at_date
 
std::tm date_of_birth
 
std::vector< std::unique_ptr< measurement_header > > measur_headers
 

Detailed Description

Class used as a container for user data, that are selected from database. (and also for insert, but not everything is used in that case)

Definition at line 118 of file user_workspace.h.

Constructor & Destructor Documentation

◆ user_cont()

user_cont::user_cont ( unsigned long  id,
uint8_t *  rfid_ser_bin,
uint8_t  rfid_ser_len,
std::string  username,
std::string  name,
std::string  lastname,
std::string  description,
uint8_t  role,
std::tm  reg_date,
std::tm  last_login_date,
std::tm  created_at_date,
std::tm  date_of_birth 
)

Construct a new user cont object through value parameters, but this isn't used. Originally inteded for testing purposes.

Definition at line 256 of file user_workspace.cpp.

259 {
260  this->id = id;
261  this->username = username;
262  this->rfid_ser_len = rfid_ser_len < 10 ? rfid_ser_len : 10;
263  memcpy(this->rfid_serial_bin, rfid_ser_bin, this->rfid_ser_len);
264  this->name = name;
265  this->lastname = lastname;
266  this->description = description;
267  this->role = role;
268  this->reg_date = reg_date;
272 }
std::string lastname
uint8_t role
std::string username
unsigned long id
std::tm last_login_date
std::tm reg_date
std::tm date_of_birth
std::tm created_at_date
std::string description
uint8_t rfid_serial_bin[10]
std::string name
uint8_t rfid_ser_len

Member Function Documentation

◆ log_user_to_debug()

void user_cont::log_user_to_debug ( )

Prints user on debug level

Definition at line 274 of file user_workspace.cpp.

274  {
275  spdlog::debug("user_cont - User ID: {0}", this->id);
276  spdlog::debug("user_cont - User RFID: {0:x} {1:x} {2:x} {3:x} {4:x} {5:x} {6:x} {7:x} {8:x} {9:x}",
277  this->rfid_serial_bin[0], this->rfid_serial_bin[1], this->rfid_serial_bin[2], this->rfid_serial_bin[3],
278  this->rfid_serial_bin[4], this->rfid_serial_bin[5], this->rfid_serial_bin[6], this->rfid_serial_bin[7],
279  this->rfid_serial_bin[8], this->rfid_serial_bin[9]);
280  spdlog::debug("user_cont - User rfid_ser_len: {0}", this->rfid_ser_len);
281  spdlog::debug("user_cont - User username: {0}", this->username);
282  spdlog::debug("user_cont - User name: {0}", this->name);
283  spdlog::debug("user_cont - User lastname: {0}", this->lastname);
284  spdlog::debug("user_cont - User description: {0}", this->description);
285  spdlog::debug("user_cont - User role: {0}", this->role);
286 
287  char buf[64] = {0};
288  strftime(buf, 64, "%Y-%m-%d %H:%M:%S", &(this->reg_date));
289  spdlog::debug("user_cont - User reg_date: {0}", buf);
290  memset(buf, 0, 64);
291  strftime(buf, 64, "%Y-%m-%d %H:%M:%S", &(this->last_login_date));
292  spdlog::debug("user_cont - User last_login_date: {0}", buf);
293  memset(buf, 0, 64);
294  strftime(buf, 64, "%Y-%m-%d %H:%M:%S", &(this->created_at_date));
295  spdlog::debug("user_cont - User created_at_date: {0}", buf);
296  memset(buf, 0, 64);
297  strftime(buf, 64, "%Y-%m-%d %H:%M:%S", &(this->date_of_birth));
298  spdlog::debug("user_cont - User date_of_birth: {0}", buf);
299 }

Member Data Documentation

◆ created_at_date

std::tm user_cont::created_at_date

Definition at line 132 of file user_workspace.h.

◆ date_of_birth

std::tm user_cont::date_of_birth

Definition at line 133 of file user_workspace.h.

◆ description

std::string user_cont::description

Definition at line 128 of file user_workspace.h.

◆ id

unsigned long user_cont::id

Definition at line 120 of file user_workspace.h.

◆ last_login_date

std::tm user_cont::last_login_date

Definition at line 131 of file user_workspace.h.

◆ lastname

std::string user_cont::lastname

Definition at line 127 of file user_workspace.h.

◆ measur_headers

std::vector<std::unique_ptr<measurement_header> > user_cont::measur_headers

Vector of headers, that are displayed on screen 3 and user can select them

Definition at line 136 of file user_workspace.h.

◆ measure_count

unsigned long user_cont::measure_count

Definition at line 121 of file user_workspace.h.

◆ name

std::string user_cont::name

Definition at line 126 of file user_workspace.h.

◆ reg_date

std::tm user_cont::reg_date

Definition at line 130 of file user_workspace.h.

◆ rfid_ser_len

uint8_t user_cont::rfid_ser_len

Definition at line 124 of file user_workspace.h.

◆ rfid_serial

std::string user_cont::rfid_serial

Definition at line 122 of file user_workspace.h.

◆ rfid_serial_bin

uint8_t user_cont::rfid_serial_bin[10]

Definition at line 123 of file user_workspace.h.

◆ role

uint8_t user_cont::role

Definition at line 129 of file user_workspace.h.

◆ username

std::string user_cont::username

Definition at line 125 of file user_workspace.h.


The documentation for this class was generated from the following files: