Changeset View
Changeset View
Standalone View
Standalone View
testclient/mainwindow.h
Show All 20 Lines | 1 | /* AtCore Test Client | |||
---|---|---|---|---|---|
21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | */ | 22 | */ | ||
23 | #pragma once | 23 | #pragma once | ||
24 | 24 | | |||
25 | #include <QTemporaryFile> | 25 | #include <QTemporaryFile> | ||
26 | #include <QMainWindow> | 26 | #include <QMainWindow> | ||
27 | #include <QSerialPort> | 27 | #include <QSerialPort> | ||
28 | 28 | | |||
29 | #include "ui_mainwindow.h" | | |||
30 | #include "atcore.h" | 29 | #include "atcore.h" | ||
30 | #include "widgets/plotwidget.h" | ||||
31 | 31 | | |||
32 | class SerialLayer; | 32 | class SerialLayer; | ||
33 | 33 | | |||
34 | class MainWindow: public QMainWindow | 34 | class MainWindow: public QMainWindow | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | 37 | | |||
38 | public: | 38 | public: | ||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 65 | private slots: | |||
168 | 168 | | |||
169 | /** | 169 | /** | ||
170 | * @brief Update the print Time | 170 | * @brief Update the print Time | ||
171 | */ | 171 | */ | ||
172 | void updatePrintTime(); | 172 | void updatePrintTime(); | ||
173 | 173 | | |||
174 | /** | 174 | /** | ||
175 | * @brief show/hide dock titlebars | 175 | * @brief show/hide dock titlebars | ||
176 | * @param checked: True if shown | ||||
176 | */ | 177 | */ | ||
177 | void toggleDockTitles(); | 178 | void toggleDockTitles(bool checked); | ||
178 | | ||||
179 | /** | | |||
180 | * @brief Show the about dialog | | |||
181 | */ | | |||
182 | void about(); | | |||
183 | 179 | | |||
184 | /** | 180 | /** | ||
185 | * @brief List Files on the sd card. | 181 | * @brief List Files on the sd card. | ||
186 | */ | 182 | */ | ||
187 | void getSdList(); | 183 | void getSdList(); | ||
188 | 184 | | |||
189 | /** | 185 | /** | ||
190 | * @brief Sd Card Delete file clicked | 186 | * @brief Sd Card Delete file clicked | ||
191 | */ | 187 | */ | ||
192 | void sdDelPBClicked(); | 188 | void sdDelPBClicked(); | ||
193 | 189 | | |||
194 | private: | 190 | private: | ||
195 | Ui::MainWindow *ui; | | |||
196 | AtCore *core; | 191 | AtCore *core; | ||
197 | QTemporaryFile *logFile; | 192 | QTemporaryFile *logFile; | ||
198 | QTime *printTime; | 193 | QTime *printTime; | ||
199 | QTimer *printTimer; | 194 | QTimer *printTimer; | ||
200 | // Define max number of fans | 195 | // Define max number of fans | ||
201 | static int fanCount; | 196 | static int fanCount; | ||
202 | 197 | | |||
203 | void closeEvent(QCloseEvent *event) override; | 198 | void closeEvent(QCloseEvent *event) override; | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
277 | * @brief Populate comboboxes | 272 | * @brief Populate comboboxes | ||
278 | */ | 273 | */ | ||
279 | void populateCBs(); | 274 | void populateCBs(); | ||
280 | 275 | | |||
281 | /** | 276 | /** | ||
282 | * @brief Gui Changes for when sd card mount status has changed. | 277 | * @brief Gui Changes for when sd card mount status has changed. | ||
283 | */ | 278 | */ | ||
284 | void sdChanged(bool mounted); | 279 | void sdChanged(bool mounted); | ||
280 | | ||||
281 | //UI Functions | ||||
282 | | ||||
283 | /** | ||||
284 | * @brief Create The Menubar | ||||
285 | */ | ||||
286 | void initMenu(); | ||||
287 | | ||||
288 | /** | ||||
289 | * @brief Create StatusBar | ||||
290 | */ | ||||
291 | void initStatusBar(); | ||||
292 | | ||||
293 | /** | ||||
294 | * @brief Create Main Widgets. | ||||
295 | */ | ||||
296 | void initWidgets(); | ||||
297 | | ||||
298 | //Private GUI Items | ||||
299 | //menuView is global to allow for docks to be added / removed. | ||||
300 | QMenu *menuView = nullptr; | ||||
laysrodrigues: use m_variable for private variables. | |||||
rizzitello: AtCore does not use this anywhere in the code base. | |||||
My Reasoning on this is as follows.
rizzitello: My Reasoning on this is as follows.
1. Not currently used in any AtCore objects.
2. Not part… | |||||
301 | //Status Bar Items | ||||
302 | QLabel *lblState = nullptr; | ||||
303 | QLabel *lblSd = nullptr; | ||||
304 | QWidget *printProgressWidget = nullptr; | ||||
305 | QProgressBar *printingProgress = nullptr; | ||||
306 | QLabel *lblTime = nullptr; | ||||
307 | QLabel *lblTimeLeft = nullptr; | ||||
308 | //Docks | ||||
309 | void makeLogDock(); | ||||
310 | QDockWidget *logDock = nullptr; | ||||
311 | QPlainTextEdit *textLog = nullptr; | ||||
312 | | ||||
313 | void makeTempTimelineDock(); | ||||
314 | QDockWidget *tempTimelineDock = nullptr; | ||||
315 | PlotWidget *plotWidget = nullptr; | ||||
316 | | ||||
317 | void makeCommandDock(); | ||||
318 | QDockWidget *printDock = nullptr; | ||||
319 | QDockWidget *commandDock = nullptr; | ||||
320 | QLineEdit *lineCommand = nullptr; | ||||
321 | QLineEdit *lineMessage = nullptr; | ||||
322 | | ||||
323 | void makePrintDock(); | ||||
324 | QPushButton *buttonPrint = nullptr; | ||||
325 | QLineEdit *linePostPause = nullptr; | ||||
326 | QSpinBox *sbFlowRate = nullptr; | ||||
327 | QSpinBox *sbPrintSpeed = nullptr; | ||||
328 | | ||||
329 | void makeConnectDock(); | ||||
330 | QDockWidget *connectDock = nullptr; | ||||
331 | QComboBox *comboPort = nullptr; | ||||
332 | QComboBox *comboBAUD = nullptr; | ||||
333 | QComboBox *comboPlugin = nullptr; | ||||
334 | QPushButton *buttonConnect = nullptr; | ||||
335 | | ||||
336 | void makeMoveDock(); | ||||
337 | QDockWidget *moveDock = nullptr; | ||||
338 | QComboBox *comboMoveAxis = nullptr; | ||||
339 | QDoubleSpinBox *sbMoveAxis = nullptr; | ||||
340 | | ||||
341 | void makeTempControlsDock(); | ||||
342 | QDockWidget *tempControlsDock = nullptr; | ||||
343 | QCheckBox *checkAndWait = nullptr; | ||||
344 | QSpinBox *sbBedTemp = nullptr; | ||||
345 | QComboBox *comboExtruderSelect; | ||||
346 | QSpinBox *sbExtruderTemp; | ||||
347 | QComboBox *comboFanSelect; | ||||
348 | QSpinBox *sbFanSpeed; | ||||
349 | | ||||
350 | void makeSdDock(); | ||||
351 | QDockWidget *sdDock = nullptr; | ||||
352 | QListWidget *listSdFiles = nullptr; | ||||
285 | }; | 353 | }; |
use m_variable for private variables.