Mon, 11 Apr 2022 20:45:22 +0200
Blocked hop table edit. Implemented add and delete hop rows. Started the ui of the water tab.
#ifndef _MAINWINDOW_H #define _MAINWINDOW_H #include "RecipesTree.h" #include "InventorySuppliers.h" #include "InventoryFermentables.h" #include "InventoryHops.h" #include "InventoryYeasts.h" #include "InventoryMiscs.h" #include "InventoryWaters.h" #include "InventoryEquipments.h" #include "ProfileWaters.h" #include "ProfileMashs.h" #include "ProfileStyles.h" #include "ProfileFerments.h" #include "Setup.h" #include <QMainWindow> #include <QStandardItemModel> #include <QMenu> #include <QToolButton> #include <QApplication> #include <QDateTime> #include <QDebug> #include <QDir> // #include <QDomDocument> #include <QFile> #include <QList> #include <QMetaProperty> #include <QObject> #include <QSettings> #include <QString> #include <QTextStream> #include <QTranslator> #include <QtSql> #include <QUuid> #include <QStyle> #include <QPlainTextEdit> #include <QMessageBox> #include <QLabel> #include <QImage> #include <QImageReader> #include <QImageWriter> #include <QColorSpace> #include <QGraphicsView> #include <QFileDialog> #include <QXmlStreamReader> #include <QXmlStreamWriter> #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> #include <QMap> #include <QPrinter> #include <QWidget> #include <QWebSocket> typedef struct IniMySQL { QString host; ///< MySQL host QString port; ///< MySQL port QString name; ///< MySQL database QString user; ///< MySQL username QString pass; ///< MySQL password QString charset; ///< MySQL character encoding } IniMySQL; static IniMySQL dbProd; static IniMySQL dbDev; typedef struct IniWS { QString host; ///< MQTT host QString port; ///< MQTT port } IniWS; static IniWS wsProd; static IniWS wsDev; static QString my_brewery_name = "No-name"; static double my_factor_mashhop = -30; static double my_factor_fwh = 10; static double my_factor_pellet = 10; static double my_factor_plug = 2; static double my_factor_wethop = -82; static double my_factor_cryohop = 100; static int my_ibu_method = 0; static int my_color_method = 0; static double my_brix_correction = 1.04; static double my_grain_absorbtion = 1.01; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(bool useDevelopOption, bool startConfigOption, QWidget *parent = 0); ~MainWindow(); // Keep pointers to new windows. RecipesTree *RecipesTreeWindow; InventorySuppliers *InventorySuppliersWindow; InventoryFermentables *InventoryFermentablesWindow; InventoryHops *InventoryHopsWindow; InventoryYeasts *InventoryYeastsWindow; InventoryMiscs *InventoryMiscsWindow; InventoryWaters *InventoryWatersWindow; InventoryEquipments *InventoryEquipmentsWindow; ProfileWaters *ProfileWatersWindow; ProfileMashs *ProfileMashsWindow; ProfileStyles *ProfileStylesWindow; ProfileFerments *ProfileFermentsWindow; Setup *SetupWindow; private slots: void on_actionExit_triggered(); void on_actionRecipes_triggered(); void on_actionSuppliers_triggered(); void on_actionFermentables_triggered(); void on_actionHops_triggered(); void on_actionYeasts_triggered(); void on_actionMiscs_triggered(); void on_actionWaters_triggered(); void on_actionEquipments_triggered(); void on_actionSupplies_list_triggered(); void on_actionYeast_bank_triggered(); void on_actionWater_profiles_triggered(); void on_actionMash_profiles_triggered(); void on_actionStyles_profiles_triggered(); void on_actionFerments_profiles_triggered(); void on_actionSetup_triggered(); void on_actionAbout_triggered(); public slots: void fromRecipesTree(); void fromInventorySuppliers(); void fromInventoryFermentables(); void fromInventoryHops(); void fromInventoryYeasts(); void fromInventoryMiscs(); void fromInventoryWaters(); void fromInventoryEquipments(); void fromProfileWaters(); void fromProfileMashs(); void fromProfileStyles(); void fromProfileFerments(); void fromSetup(); void windowTitle(QString); void statusMsg(QString); private: Ui::MainWindow *ui; QWebSocket *webSocket; /** * @brief Open Websocket connection. * @param develop Is true if connect to develop server, else production. * @return Returns true if succes. */ bool openWS(bool develop); void wsConnected(); void wsClosed(); void wsTextMessageReceived(QString message); /** * @brief Read user settings for the MySQL connection. */ void readsettings(); /** * @brief Write or update the user settings for the MySQL connection. */ void writesettings(); }; #endif