6 #ifndef APP_STATE_MODEL__
7 #define APP_STATE_MODEL__
9 #include <ArduinoJson.h>
24 float current_limit = 8.0f;
25 bool relay_ref_active =
false;
26 bool relay_dut_active =
false;
27 float temp_1 = 150.0f;
28 float temp_2 = 150.0f;
29 float temp_1_limit = 50.0f;
30 float temp_2_limit = 50.0f;
31 bool fan_active =
true;
33 bool fan_override =
false;
34 bool drv_supply_active =
true;
35 bool drv_disabled =
false;
37 bool hw_overtemp =
true;
55 static constexpr
size_t _key_strings_size =
sizeof(
56 "setpoint_throttling_enabled"
64 "frequency_changerate"
89 static constexpr
size_t _json_objects_size = JSON_OBJECT_SIZE(31);
91 static constexpr
size_t I_AM_SCARED_MARGIN = 50;
92 static constexpr
size_t json_buf_len = _json_objects_size
108 bool setpoint_throttling_enabled =
true;
114 float frequency_min = constants.frequency_min;
115 float frequency_max = constants.frequency_max;
117 float frequency_target = 100.0e3f;
118 float frequency_increment = 500.0f;
119 float duty_min = 0.0f;
120 float duty_max = 0.8f;
121 float duty_target = 0.0f;
122 float duty_increment = 0.05f;
124 bool hw_oc_fault_present =
true;
126 bool hw_oc_fault_occurred =
true;
128 uint32_t oneshot_power_pulse_length_ms = 1;
Application, network and hardware settings, constants and preset configuration.
Driver for the MCPWM hardware modules on the Espressif ESP32 SoC for generating a Phase-Shift-PWM wav...
Constant / compile-time config values go here!
Definition: app_config.hpp:131
Application state containing data and settings model.
Definition: app_state_model.hpp:50
bool deserialize_settings(const char *buf, size_t buf_len)
Restore application runtime configurable settings from json string in buffer back into this instance.
Definition: app_state_model.cpp:90
size_t serialize_full_state(char *buf, size_t buf_len)
Serialize application runtime state and configurable settings into buffer as a JSON string.
Definition: app_state_model.cpp:18
bool restore_from_file(const char *filename)
Restore application runtime configurable settings from SPIFFs file back into this instance.
Definition: app_state_model.cpp:151
bool save_to_file(const char *filename)
Write application runtime configurable settings to SPIFFs file as a JSON string.
Definition: app_state_model.cpp:132
Definition: app_state_model.hpp:23
WiFi network configuration structure with default values.
Definition: app_config.hpp:34