-
Notifications
You must be signed in to change notification settings - Fork 6
/
computerview.h
63 lines (51 loc) · 1.73 KB
/
computerview.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef COMPUTERVIEW_H
#define COMPUTERVIEW_H
#include <Wt/WContainerWidget>
#include <Wt/WString>
#include <boost/signals2.hpp>
class ComputerView : public Wt::WContainerWidget
{
private:
Wt::WApplication *app;
Wt::WString _computerName;
bool _ledStatus;
bool _powerStatus;
bool _atxStatus;
Wt::WPushButton *_btn_atx_force_off;
Wt::WPushButton *_btn_atx_force_on;
Wt::WPushButton *_btn_atx_reset;
Wt::WPushButton *_btn_pw_switch_press;
Wt::WPushButton *_btn_pw_switch_force_off;
Wt::WImage *_img_led;
Wt::WText *_ping_txt;
Wt::WTextArea *_logs_edit;
std::shared_ptr<Wt::WFileResource> _ico_led_on_file;
std::shared_ptr<Wt::WFileResource> _ico_led_off_file;
std::shared_ptr<Wt::WFileResource> _ico_ping_file;
std::shared_ptr<Wt::WFileResource> _ico_atx_pwr_file;
std::shared_ptr<Wt::WFileResource> _ico_pwr_switch_file;
void btn_atx_force_off_clicked();
void btn_atx_force_on_clicked();
void btn_atx_reset_clicked();
void btn_pw_switch_press_clicked();
void btn_pw_switch_force_off_clicked();
Wt::WFileResource *getImg(const Wt::WString &name);
void setPowerLedStatus(bool status);
public:
ComputerView(Wt::WApplication *app,
const Wt::WString &computerName,
bool writeAccess,
Wt::WContainerWidget *parent = NULL);
Wt::WString computerName() const { return _computerName; };
/* slots */
void powerLedStatusChanged(bool status);
void consoleDataAdded(const Wt::WString &data);
void setPingDelay(double delay);
/* signals */
boost::signals2::signal<void ()> sig_atxForceOff;
boost::signals2::signal<void ()> sig_atxForceOn;
boost::signals2::signal<void ()> sig_atxReset;
boost::signals2::signal<void ()> sig_pwSwitchPress;
boost::signals2::signal<void ()> sig_pwSwitchForceOff;
};
#endif // COMPUTERVIEW_H