1#ifndef IV_SRC_CACHE_STRUCTS_HPP_
2#define IV_SRC_CACHE_STRUCTS_HPP_
5#include "third_party/JSON.hpp"
7using JSON = nlohmann::json;
24 [[nodiscard]] std::string_view
getValue()
const
32 static constexpr std::string_view
value {
"value"};
33 static constexpr std::string_view
timestamp {
"timestamp"};
66 static constexpr std::string_view
generalKey {
"general"};
69 static constexpr std::string_view
language {
"language"};
77 static constexpr std::string_view
gatewayIp {
"gatewayIp"};
78 static constexpr std::string_view
gatewayPort {
"gatewayPort"};
79 static constexpr std::string_view
stationPort {
"stationPort"};
83 static constexpr std::string_view
askUnitInfo {
"askUnitInfo"};
133 static constexpr std::string_view
valveKey {
"valve"};
nlohmann::json JSON
Definition structs.hpp:7
Definition EditDiamarCache.cpp:7
uint64_t timestamp
Definition types.hpp:21
eLanguage
Definition enums.hpp:37
Definition structs.hpp:157
std::optional< iv::types::control::damper::damperDescription > lastDamperDescription
Definition structs.hpp:159
std::optional< iv::types::logic::customBlockId > lastGeneratedLibraryId
Definition structs.hpp:158
Definition structs.hpp:142
static constexpr std::string_view damperKey
Definition structs.hpp:143
Definition structs.hpp:140
static constexpr std::string_view lastDamperDescription
Definition structs.hpp:147
static constexpr std::string_view lastGeneratedLibrary
Definition structs.hpp:146
Definition structs.hpp:125
static constexpr std::string_view controlsEditorKey
Definition structs.hpp:126
Definition structs.hpp:132
static constexpr std::string_view valveKey
Definition structs.hpp:133
Definition structs.hpp:130
static constexpr std::string_view lastGeneratedLibrary
Definition structs.hpp:136
Definition structs.hpp:123
Definition structs.hpp:152
std::optional< iv::types::logic::customBlockId > lastGeneratedLibraryId
Definition structs.hpp:153
Controls editor cache.
Definition structs.hpp:117
ValveEditor valveEditor
Definition structs.hpp:162
void write(JSON &cacheJSON) const
Write controls editor cache to JSON.
Definition structs.cpp:169
DamperEditor damperEditor
Definition structs.hpp:163
void read(const JSON &cacheJSON)
Read controls editor cache from JSON.
Definition structs.cpp:199
Definition structs.hpp:89
static constexpr std::string_view fileOpeningKey
Definition structs.hpp:90
Definition structs.hpp:87
static constexpr std::string_view lastDirectoriesOpened
Definition structs.hpp:93
static constexpr std::string_view lastProjectOpened
Definition structs.hpp:92
Definition structs.hpp:65
static constexpr std::string_view generalKey
Definition structs.hpp:66
Definition structs.hpp:74
static constexpr std::string_view startCommsKey
Definition structs.hpp:75
Definition structs.hpp:72
static constexpr std::string_view askUnitInfo
Definition structs.hpp:83
static constexpr std::string_view socketCanInterface
Definition structs.hpp:81
static constexpr std::string_view stationDataIp
Definition structs.hpp:80
static constexpr std::string_view gatewayIp
Definition structs.hpp:77
static constexpr std::string_view stationPort
Definition structs.hpp:79
static constexpr std::string_view ixxatSerialNumber
Definition structs.hpp:82
static constexpr std::string_view gatewayPort
Definition structs.hpp:78
Definition structs.hpp:63
static constexpr std::string_view language
Definition structs.hpp:69
General cache.
Definition structs.hpp:45
std::optional< iv::types::ipAddress > gatewayIp
Definition structs.hpp:99
iv::eLanguage language
Definition structs.hpp:97
std::optional< bool > askUnitInfo
Definition structs.hpp:103
std::optional< std::string > socketCanInterface
Definition structs.hpp:105
std::optional< iv::types::ipAddress > stationDataIp
Definition structs.hpp:102
std::optional< std::string > ixxatSerialNumber
Definition structs.hpp:106
void addLastDirectoryOpened(const StringWithTimestamp &directory)
Definition structs.cpp:136
void write(JSON &cacheJSON) const
Write cache to JSON.
Definition structs.cpp:32
std::optional< std::string > lastProjectOpened
Definition structs.hpp:108
std::optional< iv::types::ipPort > gatewayPort
Definition structs.hpp:100
std::optional< iv::types::ipPort > stationPort
Definition structs.hpp:101
std::optional< std::vector< StringWithTimestamp > > lastDirectoriesOpened
Definition structs.hpp:109
void read(const JSON &cacheJSON)
Read cache from JSON.
Definition structs.cpp:65
Definition structs.hpp:197
static constexpr std::string_view exportImportChannelsKey
Definition structs.hpp:198
Definition structs.hpp:195
static constexpr std::string_view lastDirectoryExportedTo
Definition structs.hpp:201
static constexpr std::string_view lastImportedFile
Definition structs.hpp:202
Definition structs.hpp:190
static constexpr std::string_view specificProjectKey
Definition structs.hpp:191
Definition structs.hpp:208
static constexpr std::string_view lastSelectedUnitKey
Definition structs.hpp:209
Definition structs.hpp:206
Definition structs.hpp:188
Specific project cache.
Definition structs.hpp:171
std::optional< std::string > lastDirectoryExportedTo
Definition structs.hpp:214
ControlsEditor controlsEditor
Definition structs.hpp:217
SpecificProjectCache()=default
void read(const JSON &cacheJSON)
Read cache from JSON.
Definition structs.cpp:247
void write(JSON &cacheJSON) const
Write cache to JSON.
Definition structs.cpp:237
std::optional< iv::types::unitId > lastSelectedUnitId
Definition structs.hpp:216
std::optional< std::string > lastImportedFile
Definition structs.hpp:215
Definition structs.hpp:31
static constexpr std::string_view value
Definition structs.hpp:32
static constexpr std::string_view timestamp
Definition structs.hpp:33
Definition structs.hpp:13
std::string value
Definition structs.hpp:36
StringWithTimestamp(const JSON &cacheJSON)
Definition structs.cpp:10
std::string_view getValue() const
Definition structs.hpp:24
JSON toJSON() const
Definition structs.cpp:23
StringWithTimestamp(std::string value, iv::types::timestamp timestamp)
Definition structs.hpp:17
iv::types::timestamp timestamp
Definition structs.hpp:37