1 #ifndef SIGNALLEVELMONITORWINDOW_H
2 #define SIGNALLEVELMONITORWINDOW_H
5 #include <QGraphicsScene>
6 #include <QJsonDocument>
10 class SignalLevelMonitorWindow
;
13 class SignalLevelMonitorWindow
: public QDialog
18 explicit SignalLevelMonitorWindow(HidThread
&thread
, QWidget
*parent
= nullptr);
19 ~SignalLevelMonitorWindow();
20 void loadLayout(QString name
);
23 void paintEvent(QPaintEvent
*event
);
26 void on_layoutSel_activated(const QString
&arg1
);
27 void on_keyboardName(std::string name
);
28 void on_signallevel(std::vector
<uint16_t>);
29 void on_reportMonitorError(std::string error_message
);
31 void on_SignalLevelMonitorWindow_finished(int result
);
32 void ShowContextMenu(const QPoint
&pos
);
35 Ui::SignalLevelMonitorWindow
*ui
;
38 const struct kbd_def
*keyboard
;
39 const struct lay_def
*current_layout
;
41 std::vector
<std::vector
<uint16_t>> signal_level
;
42 std::vector
<std::vector
<uint16_t>> min_signal_level
;
43 std::vector
<std::vector
<uint16_t>> max_signal_level
;
44 QColor
getColor(uint16_t value
, uint16_t mins
, uint16_t maxs
);
45 void displaySquare(int x
, int y
, int w
, int h
, unsigned int col
, unsigned int row
, uint16_t mins
, uint16_t maxs
, QPainter
&painter
);
46 void updateCurrentLayout();
47 void setMinimumSizeUnits(unsigned int width_units_times_8
, unsigned int height_units_times_8
);
49 unsigned int keyboard_width_uis_times_8
;
50 unsigned int keyboard_height_uis_times_8
;
51 static constexpr double MIN_HORIZONTAL_SCALE
= 32;
52 static constexpr double MIN_VERTICAL_SCALE
= 42;
53 static const int HORIZONTAL_MARGIN
= 10;
54 static const int VERTICAL_MARGIN
= 10;
57 #endif // SIGNALLEVELMONITORWINDOW_H