Changeset 10540
- Timestamp:
- 05/03/11 18:26:51 (14 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/MainWindow.cc
r10528 r10540 10 10 11 11 using namespace std; 12 13 namespace Dim 14 { 15 static bool SendCommand(const char *command) 16 { 17 return DimClient::sendCommand(command, NULL, 0); 18 } 19 20 template<typename T> 21 static bool SendCommand(const char *command, const T &t) 22 { 23 return DimClient::sendCommand(command, (void*)&t, sizeof(t)); 24 } 25 } 12 26 13 27 MainWindow::MainWindow(QWidget *p) : QMainWindow(p) … … 67 81 } 68 82 83 69 84 void MainWindow::on_fShutdown_clicked() 70 85 { 71 Dim Client::sendCommand("DIS_DNS/KILL_SERVERS", NULL, 0);86 Dim::SendCommand("DIS_DNS/KILL_SERVERS"); 72 87 } 73 88 … … 75 90 void MainWindow::on_fShutdownAll_clicked() 76 91 { 77 Dim Client::sendCommand("DIS_DNS/KILL_SERVERS", NULL, 0);78 Dim Client::sendCommand("DIS_DNS/EXIT", 1);92 Dim::SendCommand("DIS_DNS/KILL_SERVERS"); 93 Dim::SendCommand("DIS_DNS/EXIT", int(1)); 79 94 } 80 95 … … 106 121 } 107 122 123 void MainWindow::on_fThresholdVal_valueChanged(int v) 124 { 125 fThresholdVolt->setValue(2500./4095*v); 126 127 const int32_t d[2] = { fThresholdIdx->value(), v }; 128 Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", d); 129 } 130 108 131 109 132 void MainWindow::on_fChatSend_clicked() 110 133 { 111 if (Dim Client::sendCommand("CHAT/MSG", fChatMessage->displayText().toStdString().c_str()))134 if (Dim::SendCommand("CHAT/MSG", fChatMessage->displayText().constData())) 112 135 fChatMessage->clear(); 113 136 } … … 138 161 { 139 162 if (checked) 140 Dim Client::sendCommand("FTM_CONTROL/PING", NULL, 0);163 Dim::SendCommand("FTM_CONTROL/PING"); 141 164 } -
trunk/FACT++/gui/MainWindow.h
r10528 r10540 78 78 79 79 // Tab: Rates 80 void on_fThresholdVal_valueChanged(int v) { fThresholdVolt->setValue(2500./4095*v); }80 void on_fThresholdVal_valueChanged(int v); 81 81 virtual void on_fThresholdIdx_valueChanged(int) { } 82 82
Note:
See TracChangeset
for help on using the changeset viewer.