Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Classes | Namespaces | Macros | Enumerations
app_workspace.h File Reference
#include <memory>
#include <string>
#include <chrono>
#include <thread>
#include <hx711/common.h>
#include "user_workspace.h"
#include "keyboard.h"
#include "rfid_reader.h"
#include "screen_manager.h"
#include "spidev_lib++.h"
#include "db_driver.h"
#include "custom_hx711.h"
#include "imgui.h"
#include <map>

Go to the source code of this file.

Classes

struct  app_workspace_ns::kb_input_state
 Structure holding the values of keyboard input mode and input type. More...
 
struct  app_workspace_ns::spi_config
 Structure holding SPI device and SPI config which is a library structure "spi_config_t". More...
 
struct  app_workspace_ns::hx711_config
 Structure hodling the configuration of hx711 controller. More...
 
struct  app_config
 Structure that holds the values of the application configuration file. More...
 
class  app_workspace
 One of the most importat classes in the whole project. Holds variables that define the state of the application and also provides logic for some of the variables held there. For example the hx711 controller is held and used from this class. More...
 

Namespaces

 app_workspace_ns
 This namespace holds structures and enums used in app_workspace class.
 

Macros

#define DEF_BUFF_SIZE_TINY   16
 
#define DEF_BUFF_SIZE_V_SMALL   32
 
#define DEF_BUFF_SIZE_SMALL   64
 
#define DEF_BUFF_SIZE   128
 
#define DEF_BUFF_SIZE_BIG   256
 
#define DEF_BUFF_SIZE_LARGE   512
 
#define DEF_BUFF_SIZE_HUGE   1024
 
#define DEF_BUFF_SIZE_EXTRA   2048
 
#define S2_MIN_SAMPLES_IN   50
 
#define S2_MAX_SAMPLES_IN   5000
 
#define S2_MIN_TIMEOUT_IN   1
 
#define S2_MAX_TIMEOUT_IN   60
 
#define S3_MIN_FILTER_NUMBER   0
 
#define S6_MIN_SAMPLES_IN   10
 
#define S6_MAX_SAMPLES_IN   1000
 
#define UNIT_SEL_CNT   3
 
#define S2_MEASURE_OTPS_CNT   2
 
#define S3_FILTER_OPT_CNT   2
 
#define S6_UNIT_SEL_CNT   2
 
#define S6_ROLE_CNT   3
 
#define S6_MONTH_CNT   12
 
#define DAY_MIN   1
 
#define DAY_MAX   31
 
#define YEAR_MIN   1900
 
#define HX_CONT_MAX_CONSEC_FAIL_FI   5
 
#define HX_CONT_MAX_CONSEC_FAIL_FM   5
 
#define HX_CONT_SAMPLES   5000
 
#define HX_TEST_CONST_IT_COUNT   5
 
#define HX_TEST_INC_IT_COUNT   5
 
#define HX_TEST_SAMP_COUNT   160
 
#define HX_TEST_TIME_COUNT   2
 
#define S5_TO_S6_CALIBRATION   0
 
#define S5_TO_S6_USERADD   1
 
#define S5_TO_S6_HX_TEST_SAMPLES   2
 
#define S5_TO_S6_HX_TEST_TIMEOUT   3
 
#define S5_TO_S6_KB_DELAY_TEST   4
 
#define S5_CALIBRATION_APPLIED   0
 
#define S5_USER_CREATED   1
 
#define S5_FINISHED_KB_DELAYS   2
 

Enumerations

enum  app_workspace_ns::kb_input_mode { app_workspace_ns::NAVIGATION , app_workspace_ns::INPUT }
 Enum holding options of keyboard input mode. More...
 
enum  app_workspace_ns::kb_input_type { app_workspace_ns::NONE , app_workspace_ns::INT , app_workspace_ns::FLOAT , app_workspace_ns::TEXT }
 Enum holding options of keyboard INPUT mode types. More...
 
enum  app_workspace_ns::font_size { app_workspace_ns::SMALL_FONT = 12 , app_workspace_ns::NORMAL_FONT = 24 , app_workspace_ns::BIG_FONT = 48 }
 This enum defines sizes of corresponding fonts. E.g.: SMALL_FONT is 12px. More...
 

Macro Definition Documentation

◆ DAY_MAX

#define DAY_MAX   31

Definition at line 45 of file app_workspace.h.

◆ DAY_MIN

#define DAY_MIN   1

Definition at line 44 of file app_workspace.h.

◆ DEF_BUFF_SIZE

#define DEF_BUFF_SIZE   128

Definition at line 23 of file app_workspace.h.

◆ DEF_BUFF_SIZE_BIG

#define DEF_BUFF_SIZE_BIG   256

Definition at line 24 of file app_workspace.h.

◆ DEF_BUFF_SIZE_EXTRA

#define DEF_BUFF_SIZE_EXTRA   2048

Definition at line 27 of file app_workspace.h.

◆ DEF_BUFF_SIZE_HUGE

#define DEF_BUFF_SIZE_HUGE   1024

Definition at line 26 of file app_workspace.h.

◆ DEF_BUFF_SIZE_LARGE

#define DEF_BUFF_SIZE_LARGE   512

Definition at line 25 of file app_workspace.h.

◆ DEF_BUFF_SIZE_SMALL

#define DEF_BUFF_SIZE_SMALL   64

Definition at line 22 of file app_workspace.h.

◆ DEF_BUFF_SIZE_TINY

#define DEF_BUFF_SIZE_TINY   16

Definition at line 20 of file app_workspace.h.

◆ DEF_BUFF_SIZE_V_SMALL

#define DEF_BUFF_SIZE_V_SMALL   32

Definition at line 21 of file app_workspace.h.

◆ HX_CONT_MAX_CONSEC_FAIL_FI

#define HX_CONT_MAX_CONSEC_FAIL_FI   5

Definition at line 48 of file app_workspace.h.

◆ HX_CONT_MAX_CONSEC_FAIL_FM

#define HX_CONT_MAX_CONSEC_FAIL_FM   5

Definition at line 49 of file app_workspace.h.

◆ HX_CONT_SAMPLES

#define HX_CONT_SAMPLES   5000

Definition at line 50 of file app_workspace.h.

◆ HX_TEST_CONST_IT_COUNT

#define HX_TEST_CONST_IT_COUNT   5

Definition at line 52 of file app_workspace.h.

◆ HX_TEST_INC_IT_COUNT

#define HX_TEST_INC_IT_COUNT   5

Definition at line 53 of file app_workspace.h.

◆ HX_TEST_SAMP_COUNT

#define HX_TEST_SAMP_COUNT   160

Definition at line 54 of file app_workspace.h.

◆ HX_TEST_TIME_COUNT

#define HX_TEST_TIME_COUNT   2

Definition at line 55 of file app_workspace.h.

◆ S2_MAX_SAMPLES_IN

#define S2_MAX_SAMPLES_IN   5000

Definition at line 30 of file app_workspace.h.

◆ S2_MAX_TIMEOUT_IN

#define S2_MAX_TIMEOUT_IN   60

Definition at line 32 of file app_workspace.h.

◆ S2_MEASURE_OTPS_CNT

#define S2_MEASURE_OTPS_CNT   2

Definition at line 38 of file app_workspace.h.

◆ S2_MIN_SAMPLES_IN

#define S2_MIN_SAMPLES_IN   50

Definition at line 29 of file app_workspace.h.

◆ S2_MIN_TIMEOUT_IN

#define S2_MIN_TIMEOUT_IN   1

Definition at line 31 of file app_workspace.h.

◆ S3_FILTER_OPT_CNT

#define S3_FILTER_OPT_CNT   2

Definition at line 39 of file app_workspace.h.

◆ S3_MIN_FILTER_NUMBER

#define S3_MIN_FILTER_NUMBER   0

Definition at line 33 of file app_workspace.h.

◆ S5_CALIBRATION_APPLIED

#define S5_CALIBRATION_APPLIED   0

Definition at line 63 of file app_workspace.h.

◆ S5_FINISHED_KB_DELAYS

#define S5_FINISHED_KB_DELAYS   2

Definition at line 65 of file app_workspace.h.

◆ S5_TO_S6_CALIBRATION

#define S5_TO_S6_CALIBRATION   0

Definition at line 57 of file app_workspace.h.

◆ S5_TO_S6_HX_TEST_SAMPLES

#define S5_TO_S6_HX_TEST_SAMPLES   2

Definition at line 59 of file app_workspace.h.

◆ S5_TO_S6_HX_TEST_TIMEOUT

#define S5_TO_S6_HX_TEST_TIMEOUT   3

Definition at line 60 of file app_workspace.h.

◆ S5_TO_S6_KB_DELAY_TEST

#define S5_TO_S6_KB_DELAY_TEST   4

Definition at line 61 of file app_workspace.h.

◆ S5_TO_S6_USERADD

#define S5_TO_S6_USERADD   1

Definition at line 58 of file app_workspace.h.

◆ S5_USER_CREATED

#define S5_USER_CREATED   1

Definition at line 64 of file app_workspace.h.

◆ S6_MAX_SAMPLES_IN

#define S6_MAX_SAMPLES_IN   1000

Definition at line 35 of file app_workspace.h.

◆ S6_MIN_SAMPLES_IN

#define S6_MIN_SAMPLES_IN   10

Definition at line 34 of file app_workspace.h.

◆ S6_MONTH_CNT

#define S6_MONTH_CNT   12

Definition at line 42 of file app_workspace.h.

◆ S6_ROLE_CNT

#define S6_ROLE_CNT   3

Definition at line 41 of file app_workspace.h.

◆ S6_UNIT_SEL_CNT

#define S6_UNIT_SEL_CNT   2

Definition at line 40 of file app_workspace.h.

◆ UNIT_SEL_CNT

#define UNIT_SEL_CNT   3

Definition at line 37 of file app_workspace.h.

◆ YEAR_MIN

#define YEAR_MIN   1900

Definition at line 46 of file app_workspace.h.