Tue, 31 Jan 2023 11:10:14 +0100
Added valid flag to the inventory_yeastpack table. Initial false and after record edit set to true. This should prevent the use possible wrong values.
#ifndef _MAINWINDOW_H #define _MAINWINDOW_H #include "RecipesTree.h" #include "InventorySuppliers.h" #include "InventoryFermentables.h" #include "InventoryHops.h" #include "InventoryYeasts.h" #include "InventoryYeastPacks.h" #include "InventoryMiscs.h" #include "InventoryWaters.h" #include "InventoryEquipments.h" #include "ProdInprod.h" #include "ProdOnName.h" #include "ProdOnCode.h" #include "ProdOnDate.h" #include "ProdOnTree.h" #include "ProfileWaters.h" #include "ProfileMashs.h" #include "ProfileStyles.h" #include "ProfileFerments.h" #include "MonNodes.h" #include "MonFermenters.h" #include "MonCO2meters.h" #include "MoniSpindels.h" #include "ImportXML.h" #include "ImportBrew.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> #include <QChart> #include <QValueAxis> #include <QDateTimeAxis> #include <QLineSeries> #include <QSplineSeries> #include <QChartView> #include <QAreaSeries> using namespace QtCharts; 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; 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; InventoryYeastPacks *InventoryYeastPacksWindow; InventoryMiscs *InventoryMiscsWindow; InventoryWaters *InventoryWatersWindow; InventoryEquipments *InventoryEquipmentsWindow; ProdInprod *ProdInprodWindow; ProdOnName *ProdOnNameWindow; ProdOnCode *ProdOnCodeWindow; ProdOnDate *ProdOnDateWindow; ProdOnTree *ProdOnTreeWindow; ProfileWaters *ProfileWatersWindow; ProfileMashs *ProfileMashsWindow; ProfileStyles *ProfileStylesWindow; ProfileFerments *ProfileFermentsWindow; MonNodes *MonNodesWindow; MonFermenters *MonFermentersWindow; MonCO2meters *MonCO2metersWindow; MoniSpindels *MoniSpindelsWindow; ImportXML *ImportXMLWindow; ImportBrew *ImportBrewWindow; Setup *SetupWindow; signals: void updateNodes(QString); void updateFermenters(QString); void updateCO2meters(QString); void updateiSpindels(QString); private slots: void on_actionImport_XML_triggered(); void on_actionImport_Brew_triggered(); void on_actionExit_triggered(); void on_actionMon_Nodes_triggered(); void on_actionMon_Fermenters_triggered(); void on_actionMon_CO2meters_triggered(); void on_actionMon_iSpindels_triggered(); void on_actionProd_inprod_triggered(); void on_actionRep_Production_triggered(); void on_actionRep_Efficiency_triggered(); void on_actionRep_Fermentation_triggered(); void on_actionOn_Name_triggered(); void on_actionOn_Code_triggered(); void on_actionOn_Date_triggered(); void on_actionOn_Tree_triggered(); void on_actionRecipes_triggered(); void on_actionSuppliers_triggered(); void on_actionFermentables_triggered(); void on_actionHops_triggered(); void on_actionYeasts_triggered(); void on_actionYeastPacks_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 fromImportXML(); void fromImportBrew(); void fromMonNodes(); void fromMonFermenters(); void fromMonCO2meters(); void fromMoniSpindels(); void fromRecipesTree(); void fromInventorySuppliers(); void fromInventoryFermentables(); void fromInventoryHops(); void fromInventoryYeasts(); void fromInventoryYeastPacks(); void fromInventoryMiscs(); void fromInventoryWaters(); void fromInventoryEquipments(); void fromProdInprod(); void fromProdOnName(); void fromProdOnCode(); void fromProdOnDate(); void fromProdOnTree(); void fromProfileWaters(); void fromProfileMashs(); void fromProfileStyles(); void fromProfileFerments(); void fromSetup(); void windowTitle(QString); void statusMsg(QString); private: Ui::MainWindow *ui; /** * @brief Load profile_setup record and set global variables. */ void loadSetup(); /** * @brief Do database updates. */ void updateDataBase(); /** * @brief Do database maintenance. */ void maintDataBase(); /** * @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. * Settings in $HOME/.config/mbse/bmsapp.ini */ void readsettings(); /** * @brief Write or update the user settings for the MySQL connection. */ void writesettings(); }; #endif