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 | | |||
179 | /** | 180 | /** | ||
180 | * @brief Toggle disable state of dangerous docks | 181 | * @brief Toggle disable state of dangerous docks | ||
181 | * Command, Sd Card, Movement, Temperature Controls and Printing docks | 182 | * Command, Sd Card, Movement, Temperature Controls and Printing docks | ||
182 | * @param disabled: True if items are disabled. | 183 | * @param disabled: True if items are disabled. | ||
183 | */ | 184 | */ | ||
184 | void setDangeriousDocksDisabled(bool disabled); | 185 | void setDangeriousDocksDisabled(bool disabled); | ||
185 | /** | | |||
186 | * @brief Show the about dialog | | |||
187 | */ | | |||
188 | void about(); | | |||
189 | 186 | | |||
190 | /** | 187 | /** | ||
191 | * @brief List Files on the sd card. | 188 | * @brief List Files on the sd card. | ||
192 | */ | 189 | */ | ||
193 | void getSdList(); | 190 | void getSdList(); | ||
194 | 191 | | |||
195 | /** | 192 | /** | ||
196 | * @brief Sd Card Delete file clicked | 193 | * @brief Sd Card Delete file clicked | ||
197 | */ | 194 | */ | ||
198 | void sdDelPBClicked(); | 195 | void sdDelPBClicked(); | ||
199 | 196 | | |||
200 | private: | 197 | private: | ||
201 | Ui::MainWindow *ui; | | |||
202 | AtCore *core; | 198 | AtCore *core; | ||
203 | QTemporaryFile *logFile; | 199 | QTemporaryFile *logFile; | ||
204 | QTime *printTime; | 200 | QTime *printTime; | ||
205 | QTimer *printTimer; | 201 | QTimer *printTimer; | ||
206 | // Define max number of fans | 202 | // Define max number of fans | ||
207 | static int fanCount; | 203 | static int fanCount; | ||
208 | 204 | | |||
209 | void closeEvent(QCloseEvent *event) override; | 205 | void closeEvent(QCloseEvent *event) override; | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
283 | * @brief Populate comboboxes | 279 | * @brief Populate comboboxes | ||
284 | */ | 280 | */ | ||
285 | void populateCBs(); | 281 | void populateCBs(); | ||
286 | 282 | | |||
287 | /** | 283 | /** | ||
288 | * @brief Gui Changes for when sd card mount status has changed. | 284 | * @brief Gui Changes for when sd card mount status has changed. | ||
289 | */ | 285 | */ | ||
290 | void sdChanged(bool mounted); | 286 | void sdChanged(bool mounted); | ||
287 | | ||||
288 | //UI Functions | ||||
289 | | ||||
290 | /** | ||||
291 | * @brief Create The Menubar | ||||
292 | */ | ||||
293 | void initMenu(); | ||||
294 | | ||||
295 | /** | ||||
296 | * @brief Create StatusBar | ||||
297 | */ | ||||
298 | void initStatusBar(); | ||||
299 | | ||||
300 | /** | ||||
301 | * @brief Create Main Widgets. | ||||
302 | */ | ||||
303 | void initWidgets(); | ||||
304 | | ||||
305 | //Private GUI Items | ||||
306 | //menuView is global to allow for docks to be added / removed. | ||||
307 | 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… | |||||
308 | //Status Bar Items | ||||
309 | QLabel *lblState = nullptr; | ||||
310 | QLabel *lblSd = nullptr; | ||||
311 | QWidget *printProgressWidget = nullptr; | ||||
312 | QProgressBar *printingProgress = nullptr; | ||||
313 | QLabel *lblTime = nullptr; | ||||
314 | QLabel *lblTimeLeft = nullptr; | ||||
315 | //Docks | ||||
316 | void makeLogDock(); | ||||
317 | QDockWidget *logDock = nullptr; | ||||
318 | QPlainTextEdit *textLog = nullptr; | ||||
319 | | ||||
320 | void makeTempTimelineDock(); | ||||
321 | QDockWidget *tempTimelineDock = nullptr; | ||||
322 | PlotWidget *plotWidget = nullptr; | ||||
323 | | ||||
324 | void makeCommandDock(); | ||||
325 | QDockWidget *printDock = nullptr; | ||||
326 | QDockWidget *commandDock = nullptr; | ||||
327 | QLineEdit *lineCommand = nullptr; | ||||
328 | QLineEdit *lineMessage = nullptr; | ||||
329 | | ||||
330 | void makePrintDock(); | ||||
331 | QPushButton *buttonPrint = nullptr; | ||||
332 | QLineEdit *linePostPause = nullptr; | ||||
333 | QSpinBox *sbFlowRate = nullptr; | ||||
334 | QSpinBox *sbPrintSpeed = nullptr; | ||||
335 | | ||||
336 | void makeConnectDock(); | ||||
337 | QDockWidget *connectDock = nullptr; | ||||
338 | QComboBox *comboPort = nullptr; | ||||
339 | QComboBox *comboBAUD = nullptr; | ||||
340 | QComboBox *comboPlugin = nullptr; | ||||
341 | QPushButton *buttonConnect = nullptr; | ||||
342 | | ||||
343 | void makeMoveDock(); | ||||
344 | QDockWidget *moveDock = nullptr; | ||||
345 | QComboBox *comboMoveAxis = nullptr; | ||||
346 | QDoubleSpinBox *sbMoveAxis = nullptr; | ||||
347 | | ||||
348 | void makeTempControlsDock(); | ||||
349 | QDockWidget *tempControlsDock = nullptr; | ||||
350 | QCheckBox *checkAndWait = nullptr; | ||||
351 | QSpinBox *sbBedTemp = nullptr; | ||||
352 | QComboBox *comboExtruderSelect; | ||||
353 | QSpinBox *sbExtruderTemp; | ||||
354 | QComboBox *comboFanSelect; | ||||
355 | QSpinBox *sbFanSpeed; | ||||
356 | | ||||
357 | void makeSdDock(); | ||||
358 | QDockWidget *sdDock = nullptr; | ||||
359 | QListWidget *listSdFiles = nullptr; | ||||
291 | }; | 360 | }; |
use m_variable for private variables.