protobuf server

This commit is contained in:
Ivan I. Ovchinnikov
2026-07-28 20:46:41 +03:00
parent 5a702fe0f8
commit 8c4d40b66a
11 changed files with 150 additions and 56 deletions
+11 -4
View File
@@ -19,7 +19,9 @@ void SerialApp::initialize() {
// Вспомогательная функция перевода HEX строки (например, "282a36ff") в ImVec4
static ImVec4 HexToImVec4(const std::string& hex_str) {
if (hex_str.length() < 8) return ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
if (hex_str.length() < 8) {
return {1.0f, 1.0f, 1.0f, 1.0f};
}
unsigned int r, g, b, a;
std::stringstream ss;
@@ -28,7 +30,12 @@ static ImVec4 HexToImVec4(const std::string& hex_str) {
ss << std::hex << hex_str.substr(4, 2); ss >> b; ss.clear();
ss << std::hex << hex_str.substr(6, 2); ss >> a;
return ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
return {
static_cast<float>(r) / 255.0f,
static_cast<float>(g) / 255.0f,
static_cast<float>(b) / 255.0f,
static_cast<float>(a) / 255.0f
};
}
bool SerialApp::loadTheme(const std::string& filepath) {
@@ -82,7 +89,7 @@ bool SerialApp::loadTheme(const std::string& filepath) {
// Читаем HEX цвета
std::string hex_val;
ss >> hex_val;
if (color_map.find(key) != color_map.end()) {
if (color_map.contains(key)) {
style.Colors[color_map[key]] = HexToImVec4(hex_val);
}
} else {
@@ -110,7 +117,7 @@ void SerialApp::renderUI() {
payloadWindow.render(&showPayloadWindow, connectionWindow);
}
if (showLogWindow) {
logWindow.render(&showLogWindow, connectionWindow);
LogWindow::render(&showLogWindow, connectionWindow);
}
}