style refactor
This commit is contained in:
+18
-18
@@ -5,38 +5,38 @@
|
||||
#include <string>
|
||||
#include <libserialport.h>
|
||||
|
||||
struct SerialPortInfo {
|
||||
std::string port_name;
|
||||
std::string description;
|
||||
};
|
||||
|
||||
class ConnectionWindow {
|
||||
public:
|
||||
ConnectionWindow();
|
||||
~ConnectionWindow();
|
||||
|
||||
void Initialize();
|
||||
void Render(bool* p_open);
|
||||
void initialize();
|
||||
void render(bool* p_open);
|
||||
|
||||
bool IsConnected() const { return is_connected; }
|
||||
struct sp_port* GetActivePort() const { return active_port; }
|
||||
bool isConnected() const { return connected; }
|
||||
struct sp_port* getActivePort() const { return activePort; }
|
||||
|
||||
void ForceLogMessage(const std::string& msg);
|
||||
std::string& GetSharedLog() { return tx_log; }
|
||||
void forceLogMessage(const std::string& msg);
|
||||
std::string& getSharedLog() { return txLog; }
|
||||
|
||||
private:
|
||||
void RefreshPorts();
|
||||
void refreshPorts();
|
||||
|
||||
struct SerialPortInfo {
|
||||
std::string portName;
|
||||
std::string description;
|
||||
};
|
||||
|
||||
std::vector<SerialPortInfo> ports;
|
||||
int selected_port_idx;
|
||||
int selectedPortIdx;
|
||||
|
||||
// Новые переменные для выпадающего списка Baud Rate
|
||||
std::vector<int> baud_rates;
|
||||
int selected_baud_idx;
|
||||
std::vector<int> baudRates;
|
||||
int selectedBaudIdx;
|
||||
|
||||
bool is_connected;
|
||||
struct sp_port* active_port;
|
||||
std::string tx_log;
|
||||
bool connected;
|
||||
struct sp_port* activePort;
|
||||
std::string txLog;
|
||||
};
|
||||
|
||||
#endif // SERIAL_SAMPLE_CONNECTIONWINDOW_H
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ public:
|
||||
LogWindow() = default;
|
||||
~LogWindow() = default;
|
||||
|
||||
void Render(bool* p_open, ConnectionWindow& conn_win);
|
||||
void render(bool* paramOpen, ConnectionWindow& connectionWindow);
|
||||
};
|
||||
|
||||
#endif // SERIAL_SAMPLE_LOGWINDOW_H
|
||||
|
||||
@@ -12,11 +12,11 @@ public:
|
||||
PayloadWindow();
|
||||
~PayloadWindow() = default;
|
||||
|
||||
void Render(bool* p_open, ConnectionWindow& conn_win);
|
||||
void render(bool* p_open, ConnectionWindow& connectionWindow);
|
||||
|
||||
private:
|
||||
void SendHexPayload(const std::string& hex_str, ConnectionWindow& conn_win);
|
||||
char hex_input_buffer[256];
|
||||
void sendHexPayload(const std::string& hexString, ConnectionWindow& connectionWindow);
|
||||
char hexInputBuffer[256];
|
||||
};
|
||||
|
||||
#endif // SERIAL_SAMPLE_PAYLOADWINDOW_H
|
||||
|
||||
+12
-12
@@ -11,24 +11,24 @@ public:
|
||||
SerialApp();
|
||||
~SerialApp() = default;
|
||||
|
||||
void Initialize();
|
||||
void RenderUI();
|
||||
void initialize();
|
||||
void renderUI();
|
||||
|
||||
bool ShouldClose() const { return should_close; }
|
||||
bool isClosing() const { return shouldClose; }
|
||||
|
||||
private:
|
||||
void RenderMainMenuBar();
|
||||
bool LoadTheme(const std::string& filepath); // Метод парсинга файла темы
|
||||
void renderMainMenuBar();
|
||||
bool loadTheme(const std::string& filepath); // Метод парсинга файла темы
|
||||
|
||||
bool show_connection_window = true;
|
||||
bool show_payload_window = true;
|
||||
bool show_log_window = true;
|
||||
bool showConnectionWindow = true;
|
||||
bool showPayloadWindow = true;
|
||||
bool showLogWindow = true;
|
||||
|
||||
bool should_close;
|
||||
bool shouldClose;
|
||||
|
||||
ConnectionWindow connection_window;
|
||||
PayloadWindow payload_window;
|
||||
LogWindow log_window;
|
||||
ConnectionWindow connectionWindow;
|
||||
PayloadWindow payloadWindow;
|
||||
LogWindow logWindow;
|
||||
};
|
||||
|
||||
#endif // SERIAL_SAMPLE_SERIALAPP_H
|
||||
|
||||
Reference in New Issue
Block a user