Added inventory equipment table and editor.

Sun, 27 Feb 2022 20:45:41 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 27 Feb 2022 20:45:41 +0100
changeset 30
0fec6a1abd13
parent 29
76846c99f827
child 31
ab17a56a47dd

Added inventory equipment table and editor.

CMakeLists.txt file | annotate | diff | comparison | revisions
src/EditEquipment.cpp file | annotate | diff | comparison | revisions
src/EditEquipment.h file | annotate | diff | comparison | revisions
src/InventoryEquipments.cpp file | annotate | diff | comparison | revisions
src/InventoryEquipments.h file | annotate | diff | comparison | revisions
src/MainWindow.cpp file | annotate | diff | comparison | revisions
src/MainWindow.h file | annotate | diff | comparison | revisions
ui/EditEquipment.ui file | annotate | diff | comparison | revisions
ui/InventoryEquipments.ui file | annotate | diff | comparison | revisions
ui/MainWindow.ui file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sat Feb 26 16:34:20 2022 +0100
+++ b/CMakeLists.txt	Sun Feb 27 20:45:41 2022 +0100
@@ -110,6 +110,8 @@
     ${SRCDIR}/EditMisc.cpp
     ${SRCDIR}/InventoryWaters.cpp
     ${SRCDIR}/EditWater.cpp
+    ${SRCDIR}/InventoryEquipments.cpp
+    ${SRCDIR}/EditEquipment.cpp
     ${SRCDIR}/Setup.cpp
     ${SRCDIR}/Utils.cpp
     ${SRCDIR}/MainWindow.cpp
@@ -132,6 +134,8 @@
     ${SRCDIR}/EditMisc.h
     ${SRCDIR}/InventoryWaters.h
     ${SRCDIR}/EditWater.h
+    ${SRCDIR}/InventoryEquipments.h
+    ${SRCDIR}/EditEquipment.h
     ${SRCDIR}/Setup.h
     ${SRCDIR}/Utils.h
     ${SRCDIR}/MainWindow.h
@@ -152,6 +156,9 @@
     ${UIDIR}/InventoryMiscs.ui
     ${UIDIR}/EditMisc.ui
     ${UIDIR}/InventoryWaters.ui
+    ${UIDIR}/EditWater.ui
+    ${UIDIR}/InventoryEquipments.ui
+    ${UIDIR}/EditEquipment.ui
     ${UIDIR}/Setup.ui
     ${UIDIR}/MainWindow.ui
 )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/EditEquipment.cpp	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,314 @@
+/**
+ * EditEquipment.cpp is part of bmsapp.
+ *
+ * bmsapp is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * bmsapp is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "EditEquipment.h"
+#include "../ui/ui_EditEquipment.h"
+#include "bmsapp.h"
+
+
+EditEquipment::EditEquipment(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditEquipment)
+{
+    QSqlQuery query, query2;
+
+    qDebug() << "EditEquipment record:" << id;
+    ui->setupUi(this);
+    this->recno = id;
+
+    WindowTitle();
+    
+    ui->tun_materialEdit->addItem(tr("Stainless Steel"));
+    ui->tun_materialEdit->addItem(tr("Aluminium"));
+    ui->tun_materialEdit->addItem(tr("Plastics"));
+    ui->tun_materialEdit->addItem(tr("Copper"));
+
+    if (id >= 0) {
+	query.prepare("SELECT * FROM inventory_equipments WHERE record = :recno");
+	query.bindValue(":recno", id);
+	query.exec();
+	query.next();
+
+	ui->nameEdit->setText(query.value(1).toString());
+	ui->boil_sizeEdit->setValue(query.value(2).toDouble());
+	ui->batch_sizeEdit->setValue(query.value(3).toDouble());
+	ui->tun_volumeEdit->setValue(query.value(4).toDouble());
+	ui->tun_weightEdit->setValue(query.value(5).toDouble());
+	ui->tun_specific_heatEdit->setValue(query.value(6).toDouble());
+	ui->tun_materialEdit->setCurrentIndex(query.value(7).toInt());
+	ui->tun_heightEdit->setValue(query.value(8).toDouble() * 100.0);
+	ui->top_up_waterEdit->setValue(query.value(9).toDouble());
+	ui->chiller_lossEdit->setValue(query.value(10).toDouble());
+	ui->evap_rateEdit->setValue(query.value(11).toDouble());
+	ui->boil_timeEdit->setValue(query.value(12).toDouble());
+	ui->calcboilEdit->setChecked(query.value(13).toInt() ? true:false);
+	ui->top_up_kettleEdit->setValue(query.value(14).toDouble());
+	ui->hopfactorEdit->setValue(query.value(15).toDouble());
+	ui->notesEdit->setPlainText(query.value(16).toString());
+	ui->lauter_volumeEdit->setValue(query.value(17).toDouble());
+	ui->lauter_heightEdit->setValue(query.value(18).toDouble() * 100.0);
+	ui->lauter_deadspaceEdit->setValue(query.value(19).toDouble());
+	ui->kettle_volumeEdit->setValue(query.value(20).toDouble());
+	ui->kettle_heightEdit->setValue(query.value(21).toDouble() * 100.0);
+	ui->mash_volumeEdit->setValue(query.value(22).toDouble());
+	ui->mash_maxEdit->setValue(query.value(23).toDouble());
+	ui->efficiencyEdit->setValue(query.value(24).toDouble());
+	/*
+	 * Now we have loaded this record, check if this equipment is
+	 * being used by a product. If so, make the name field read-only.
+	 */
+	query2.prepare("SELECT eq_name FROM products WHERE eq_name=:name");
+	query2.bindValue(":name", query.value(1).toString());
+	query2.exec();
+	inuse = query2.size();
+	qDebug() << "in use" << inuse;
+	ui->nameEdit->setReadOnly(inuse > 0);
+    } else {
+	/* Set some defaults */
+	ui->boil_sizeEdit->setValue(18);
+	ui->batch_sizeEdit->setValue(15.3);
+	ui->tun_volumeEdit->setValue(20);
+	ui->tun_weightEdit->setValue(2);
+	ui->tun_specific_heatEdit->setValue(0.11);
+	ui->tun_materialEdit->setCurrentIndex(0);
+	ui->tun_heightEdit->setValue(20);
+	ui->top_up_waterEdit->setValue(0);
+	ui->chiller_lossEdit->setValue(0.5);
+	ui->evap_rateEdit->setValue(1.8);
+	ui->boil_timeEdit->setValue(90);
+	ui->calcboilEdit->setChecked(true);
+	ui->top_up_kettleEdit->setValue(0);
+	ui->hopfactorEdit->setValue(100);
+	ui->lauter_volumeEdit->setValue(20);
+	ui->lauter_heightEdit->setValue(20);
+	ui->lauter_deadspaceEdit->setValue(0.5);
+	ui->kettle_volumeEdit->setValue(20);
+	ui->kettle_heightEdit->setValue(20);
+	ui->mash_volumeEdit->setValue(18);
+	ui->mash_maxEdit->setValue(6);
+	ui->efficiencyEdit->setValue(75);
+	inuse = 0;
+    }
+    connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->boil_sizeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->batch_sizeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->tun_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->tun_weightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->tun_materialEdit, &QComboBox::currentTextChanged, this, &EditEquipment::material_changed);   
+    connect(ui->tun_heightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->top_up_waterEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->chiller_lossEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->evap_rateEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->boil_timeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->calcboilEdit, &QCheckBox::stateChanged, this, &EditEquipment::is_changed);
+    connect(ui->top_up_kettleEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->hopfactorEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed()));
+    connect(ui->lauter_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->lauter_heightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->lauter_deadspaceEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->kettle_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->kettle_heightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->mash_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->mash_maxEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->efficiencyEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+
+    calcBatchVolume();
+    ui->saveButton->setEnabled(false);
+    ui->deleteButton->setEnabled((inuse == 0 && id >= 0) ? true:false);
+}
+
+
+EditEquipment::~EditEquipment()
+{
+    qDebug() << "EditEquipment done";
+    delete ui;
+    emit entry_changed();
+}
+
+
+/*
+ * Window header, mark any change with '**'
+ */
+void EditEquipment::WindowTitle()
+{
+    QString txt;
+
+    if (this->recno < 0) {
+	txt = QString(tr("BMSapp - Add new equipment"));
+    } else {
+	txt = QString(tr("BMSapp - Edit equipment %1").arg(this->recno));
+    }
+
+    if (this->textIsChanged) {
+	txt.append((QString(" **")));
+    }
+    setWindowTitle(txt);
+}
+
+
+void EditEquipment::on_saveButton_clicked()
+{
+    QSqlQuery query;
+
+    /* If there are errors in the form, show a message and do "return;" */
+    if (ui->nameEdit->text().length() < 2) {
+	QMessageBox::warning(this, tr("Edit Equipment"), tr("Name empty or too short."));
+	return;
+    }
+
+    if (this->textIsChanged) {
+    	if (this->recno == -1) {
+    	    query.prepare("INSERT INTO inventory_equipments SET name=:name, boil_size=:boil_size, "
+		"batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, "
+		"tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, "
+		"top_up_water=:top_up_water, trub_chiller_loss=:chiller_loss, evap_rate=:evap_rate, "
+		"boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, "
+		"hop_utilization=:hopfactor, notes=:notes, lauter_volume=:lauter_volume, "
+		"lauter_height=:lauter_height, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
+		"kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
+		"efficiency=:efficiency, uuid=:uuid");
+    	} else {
+	    query.prepare("UPDATE inventory_equipments SET name=:name, boil_size=:boil_size, "
+		"batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, "
+                "tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, "
+                "top_up_water=:top_up_water, trub_chiller_loss=:chiller_loss, evap_rate=:evap_rate, "
+                "boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, "
+                "hop_utilization=:hopfactor, notes=:notes, lauter_volume=:lauter_volume, "
+                "lauter_height=:lauter_height, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
+		"kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
+                "efficiency=:efficiency WHERE record=:recno");
+    	}
+	query.bindValue(":name", ui->nameEdit->text());
+	query.bindValue(":boil_size", QString("%1").arg(ui->boil_sizeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":batch_size", QString("%1").arg(ui->batch_sizeEdit->value(), 3, 'f', 2, '0'));
+	query.bindValue(":tun_volume", QString("%1").arg(ui->tun_volumeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":tun_weight", QString("%1").arg(ui->tun_weightEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":tun_specific_heat", QString("%1").arg(ui->tun_specific_heatEdit->value(), 4, 'f', 3, '0'));
+	query.bindValue(":tun_material", ui->tun_materialEdit->currentIndex());
+	query.bindValue(":tun_height", QString("%1").arg(ui->tun_heightEdit->value() / 100, 4, 'f', 3, '0'));
+	query.bindValue(":top_up_water", QString("%1").arg(ui->top_up_waterEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":chiller_loss", QString("%1").arg(ui->chiller_lossEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":evap_rate", QString("%1").arg(ui->evap_rateEdit->value(), 3, 'f', 2, '0'));
+	query.bindValue(":boil_time", QString("%1").arg(ui->boil_timeEdit->value(), 1, 'f', 0, '0'));
+	query.bindValue(":calcboil", ui->calcboilEdit->isChecked() ? 1:0);
+	query.bindValue(":top_up_kettle", QString("%1").arg(ui->top_up_kettleEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":hopfactor", QString("%1").arg(ui->hopfactorEdit->value(), 1, 'f', 0, '0'));
+	query.bindValue(":notes", ui->notesEdit->toPlainText());
+	query.bindValue(":lauter_volume", QString("%1").arg(ui->lauter_volumeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":lauter_height", QString("%1").arg(ui->lauter_heightEdit->value() / 100, 4, 'f', 3, '0'));
+	query.bindValue(":lauter_deadspace", QString("%1").arg(ui->lauter_deadspaceEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":kettle_volume", QString("%1").arg(ui->kettle_volumeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":kettle_height", QString("%1").arg(ui->kettle_heightEdit->value() / 100, 4, 'f', 3, '0'));
+	query.bindValue(":mash_volume", QString("%1").arg(ui->mash_volumeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":mash_max", QString("%1").arg(ui->mash_maxEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":efficiency", QString("%1").arg(ui->efficiencyEdit->value(), 2, 'f', 1, '0'));
+	if (this->recno == -1) {
+            query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
+        } else {
+            query.bindValue(":recno", this->recno);
+        }
+	query.exec();
+	if (query.lastError().isValid()) {
+	    qDebug() << "EditEquipment" << query.lastError();
+	    QMessageBox::warning(this, tr("Database error"),
+                        tr("MySQL error: %1\n%2\n%3")
+                        .arg(query.lastError().nativeErrorCode())
+                        .arg(query.lastError().driverText())
+                        .arg(query.lastError().databaseText()));
+	} else {
+	    qDebug() << "EditEquipment Saved";
+	}
+    }
+
+    ui->saveButton->setEnabled(false);
+    this->textIsChanged = false;
+    WindowTitle();
+}
+
+
+void EditEquipment::on_deleteButton_clicked()
+{
+    QSqlQuery query;
+
+    query.prepare("DELETE FROM inventory_equipments WHERE record = :recno");
+    query.bindValue(":recno", this->recno);
+    query.exec();
+    if (query.lastError().isValid()) {
+	qDebug() << "EditEquipment" << query.lastError();
+	QMessageBox::warning(this, tr("Database error"),
+                        tr("MySQL error: %1\n%2\n%3")
+                        .arg(query.lastError().nativeErrorCode())
+                        .arg(query.lastError().driverText())
+                        .arg(query.lastError().databaseText()));
+    } else {
+	qDebug() << "EditEquipment Deleted" << this->recno;
+    }
+
+    this->close();
+    this->setResult(1);
+}
+
+
+void EditEquipment::calcBatchVolume()
+{
+    double batch = ui->boil_sizeEdit->value() - (ui->evap_rateEdit->value() * ui->boil_timeEdit->value() / 60) + ui->top_up_kettleEdit->value();
+    double fermenter = round(((batch / 1.04) + ui->top_up_waterEdit->value() - ui->chiller_lossEdit->value()) * 100) / 100.0;
+    batch = round(batch * 100) / 100.0;
+    ui->batch_sizeEdit->setValue(batch);
+    ui->vol_fermenterEdit->setValue(fermenter);
+}
+
+
+void EditEquipment::is_changed()
+{
+    calcBatchVolume();
+    ui->saveButton->setEnabled(true);
+    ui->deleteButton->setEnabled((inuse == 0 && this->recno >= 0) ? true:false);
+    this->textIsChanged = true;
+    WindowTitle();
+}
+
+
+void EditEquipment::material_changed()
+{
+    switch (ui->tun_materialEdit->currentIndex()) {
+	case 0:	ui->tun_specific_heatEdit->setValue(0.11);	break;
+	case 1:	ui->tun_specific_heatEdit->setValue(0.22);	break;
+	case 2:	ui->tun_specific_heatEdit->setValue(0.46);	break;
+	case 3:	ui->tun_specific_heatEdit->setValue(0.092);	break;
+    }
+    is_changed();
+}
+
+
+void EditEquipment::on_quitButton_clicked()
+{
+    if (this->textIsChanged) {
+	int rc = QMessageBox::warning(this, tr("Equipment changed"), tr("This equipment has been modified\n Save changes?"),
+                                QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
+        switch (rc) {
+            case QMessageBox::Save:
+                        on_saveButton_clicked();
+                        break;  /* Saved and then Quit */
+            case QMessageBox::Discard:
+                        break;  /* Quit without Save */
+            case QMessageBox::Cancel:
+                        return; /* Return to the editor page */
+        }
+    }
+
+    this->close();
+    this->setResult(1);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/EditEquipment.h	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,38 @@
+#ifndef _EDITEQUIP_H
+#define _EDITEQUIP_H
+
+#include <QDialog>
+
+
+namespace Ui {
+class EditEquipment;
+}
+
+class EditEquipment : public QDialog
+{
+    Q_OBJECT
+
+signals:
+    void entry_changed();
+
+public:
+    explicit EditEquipment(int id, QWidget *parent = 0);
+    ~EditEquipment();
+
+private slots:
+    void on_saveButton_clicked();
+    void on_quitButton_clicked();
+    void on_deleteButton_clicked();
+    void is_changed();
+    void material_changed();
+
+private:
+    Ui::EditEquipment *ui;
+    int recno, inuse;
+    bool textIsChanged = false;
+
+    void WindowTitle();
+    void calcBatchVolume();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/InventoryEquipments.cpp	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,130 @@
+/**
+ * InventoryEquipments.cpp is part of bmsapp.
+ *
+ * bmsapp is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * bmsapp is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "InventoryEquipments.h"
+#include "EditEquipment.h"
+#include "../ui/ui_InventoryEquipments.h"
+#include "config.h"
+#include "bmsapp.h"
+
+
+InventoryEquipments::InventoryEquipments(QWidget *parent) : QDialog(parent), ui(new Ui::InventoryEquipments)
+{
+    qDebug() << "InventoryEquipments start";
+
+    ui->setupUi(this);
+    emit refreshTable();
+
+    setWindowTitle( QString("BMSapp - %1 - Inventory Equipments").arg(VERSIONSTRING) );
+}
+
+
+void InventoryEquipments::refreshTable()
+{
+    QString w;
+
+    qDebug() << "InventoryEquipments reload";
+
+    QSqlQuery query("SELECT * FROM inventory_equipments ORDER BY name");
+    const QStringList labels({tr("Name"), tr("Boil volume"), tr("Batch size"), tr("Notes"), tr("Edit")});
+    const QStringList types({tr("Bittering"), tr("Aroma"), tr("Both")});
+    const QStringList form({tr("Pellet"), tr("Plug"), tr("Leaf"), tr("Leaf Wet"), tr("Cryo")});
+
+    ui->tableEquipments->setColumnCount(5);
+    ui->tableEquipments->setColumnWidth(0, 180);	/* Name		*/
+    ui->tableEquipments->setColumnWidth(1,  80);	/* Boil volume	*/
+    ui->tableEquipments->setColumnWidth(2,  80);	/* Batch size	*/
+    ui->tableEquipments->setColumnWidth(3, 680);	/* Notes	*/
+    ui->tableEquipments->setColumnWidth(4,  80);	/* Edit button	*/
+    ui->tableEquipments->setRowCount(query.size());
+    ui->tableEquipments->setHorizontalHeaderLabels(labels);
+    ui->tableEquipments->verticalHeader()->hide();
+    ui->tableEquipments->setFixedSize(1100 + 24, 640);	/* Even if this is too large, it works */
+
+    QTableWidgetItem *rightitem = new QTableWidgetItem();
+    rightitem->setTextAlignment(Qt::AlignRight);
+
+    query.first();
+    for (int ridx = 0 ; ridx < query.size() ; ridx++ ) {
+	ui->tableEquipments->setItem(ridx, 0, new QTableWidgetItem(query.value(1).toString()));	/* Name */
+	w = QString("%1 L").arg(query.value(2).toDouble(), 2, 'f', 1, '0' );			/* Boil volume */
+	QTableWidgetItem *item = new QTableWidgetItem(w);
+        item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
+        ui->tableEquipments->setItem(ridx, 1, item);
+	w = QString("%1 L").arg(query.value(3).toDouble(), 2, 'f', 1, '0' );			/* Batch size */
+        item = new QTableWidgetItem(w);
+        item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
+        ui->tableEquipments->setItem(ridx, 2, item);
+	ui->tableEquipments->setItem(ridx, 3, new QTableWidgetItem(query.value(16).toString()));	/* Notes */
+
+	/* Add the Edit button */
+	QWidget* pWidget = new QWidget();
+	QPushButton* btn_edit = new QPushButton();
+	btn_edit->setObjectName(QString("%1").arg(query.value(0).toString()));	/* Send record with the button */
+	btn_edit->setText(tr("Edit"));
+	connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked()));
+	QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
+	pLayout->addWidget(btn_edit);
+	pLayout->setContentsMargins(5, 0, 5, 0);
+	pWidget->setLayout(pLayout);
+	ui->tableEquipments->setCellWidget(ridx, 4, pWidget);
+	query.next();
+    }
+
+    setWindowTitle( QString("BMSapp - %1 - Inventory Equipments").arg(VERSIONSTRING) );
+}
+
+
+InventoryEquipments::~InventoryEquipments()
+{
+    qDebug() << "InventoryEquipments done";
+    delete ui;
+}
+
+
+void InventoryEquipments::edit(int recno)
+{
+    qDebug() << "InventoryEquipments edit:" << recno;
+
+    EditEquipment dialog(recno, this);
+    /* Signal from editor if a refresh is needed */
+    connect(&dialog, SIGNAL(entry_changed()), this, SLOT(refreshTable()));
+    dialog.setModal(true);
+    dialog.exec();
+}
+
+
+void InventoryEquipments::on_editButton_clicked()
+{
+    QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
+    int recno = pb->objectName().toInt();
+    qDebug() << Q_FUNC_INFO << recno;
+    edit(recno);
+}
+
+
+void InventoryEquipments::on_insertButton_clicked()
+{
+    qDebug() << Q_FUNC_INFO;
+    edit(-1);
+}
+
+
+void InventoryEquipments::on_quitButton_clicked()
+{
+    emit firstWindow();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/InventoryEquipments.h	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,32 @@
+#ifndef _INVENTORYEQUIPS_H
+#define _INVENTORYEQUIPS_H
+
+#include <QDialog>
+
+namespace Ui {
+class InventoryEquipments;
+}
+
+class InventoryEquipments : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit InventoryEquipments(QWidget *parent = nullptr);
+    ~InventoryEquipments();
+
+signals:
+    void firstWindow();
+
+private slots:
+    void on_quitButton_clicked();
+    void on_insertButton_clicked();
+    void on_editButton_clicked();
+    void refreshTable(void);
+
+private:
+    Ui::InventoryEquipments *ui;
+    void edit(int recno);
+};
+
+#endif
--- a/src/MainWindow.cpp	Sat Feb 26 16:34:20 2022 +0100
+++ b/src/MainWindow.cpp	Sun Feb 27 20:45:41 2022 +0100
@@ -22,6 +22,7 @@
 #include "InventoryYeasts.h"
 #include "InventoryMiscs.h"
 #include "InventoryWaters.h"
+#include "InventoryEquipments.h"
 #include "Setup.h"
 #include "../ui/ui_MainWindow.h"
 #include "config.h"
@@ -164,6 +165,24 @@
 }
 
 
+void MainWindow::fromInventoryEquipments()
+{
+    qDebug() << Q_FUNC_INFO;
+    delete InventoryEquipmentsWindow;
+    this->show();
+}
+
+
+void MainWindow::on_actionEquipments_triggered()
+{
+    qDebug() << Q_FUNC_INFO;
+    InventoryEquipmentsWindow = new InventoryEquipments(this);
+    QObject::connect(InventoryEquipmentsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryEquipments()));
+    this->hide();    // Close the main window
+    InventoryEquipmentsWindow->show();  // Show a second window
+}
+
+
 void MainWindow::fromSetup()
 {
     qDebug() << Q_FUNC_INFO;
--- a/src/MainWindow.h	Sat Feb 26 16:34:20 2022 +0100
+++ b/src/MainWindow.h	Sun Feb 27 20:45:41 2022 +0100
@@ -7,6 +7,7 @@
 #include "InventoryYeasts.h"
 #include "InventoryMiscs.h"
 #include "InventoryWaters.h"
+#include "InventoryEquipments.h"
 #include "Setup.h"
 
 #include <QMainWindow>
@@ -34,6 +35,7 @@
     void on_actionYeasts_triggered();
     void on_actionMiscs_triggered();
     void on_actionWaters_triggered();
+    void on_actionEquipments_triggered();
     void on_actionSetup_triggered();
     void on_actionAbout_triggered();
 
@@ -44,6 +46,7 @@
     void fromInventoryYeasts();
     void fromInventoryMiscs();
     void fromInventoryWaters();
+    void fromInventoryEquipments();
     void fromSetup();
 
 private:
@@ -56,6 +59,7 @@
     InventoryYeasts *InventoryYeastsWindow;
     InventoryMiscs *InventoryMiscsWindow;
     InventoryWaters *InventoryWatersWindow;
+    InventoryEquipments *InventoryEquipmentsWindow;
     Setup *SetupWindow;
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/EditEquipment.ui	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,1226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>EditEquipment</class>
+ <widget class="QDialog" name="EditEquipment">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1024</width>
+    <height>597</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QWidget" name="topWidget" native="true">
+     <widget class="QLabel" name="nameLabel">
+      <property name="geometry">
+       <rect>
+        <x>40</x>
+        <y>10</y>
+        <width>91</width>
+        <height>20</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Name:</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+      </property>
+     </widget>
+     <widget class="QLabel" name="notesLabel">
+      <property name="geometry">
+       <rect>
+        <x>40</x>
+        <y>40</y>
+        <width>91</width>
+        <height>20</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Notes:</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+      </property>
+     </widget>
+     <widget class="QLineEdit" name="nameEdit">
+      <property name="geometry">
+       <rect>
+        <x>140</x>
+        <y>10</y>
+        <width>511</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="maxLength">
+       <number>128</number>
+      </property>
+      <property name="placeholderText">
+       <string>Name of this equipment</string>
+      </property>
+     </widget>
+     <widget class="QPlainTextEdit" name="notesEdit">
+      <property name="geometry">
+       <rect>
+        <x>140</x>
+        <y>40</y>
+        <width>791</width>
+        <height>61</height>
+       </rect>
+      </property>
+      <property name="placeholderText">
+       <string>Notes and usage tips.</string>
+      </property>
+     </widget>
+     <widget class="QPushButton" name="quitButton">
+      <property name="geometry">
+       <rect>
+        <x>70</x>
+        <y>550</y>
+        <width>80</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="text">
+       <string>Quit</string>
+      </property>
+      <property name="icon">
+       <iconset>
+        <normaloff>:icons/silk/door_out.png</normaloff>:icons/silk/door_out.png</iconset>
+      </property>
+     </widget>
+     <widget class="QPushButton" name="saveButton">
+      <property name="enabled">
+       <bool>false</bool>
+      </property>
+      <property name="geometry">
+       <rect>
+        <x>850</x>
+        <y>550</y>
+        <width>80</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Save</string>
+      </property>
+      <property name="icon">
+       <iconset>
+        <normaloff>:icons/silk/disk.png</normaloff>:icons/silk/disk.png</iconset>
+      </property>
+     </widget>
+     <widget class="QPushButton" name="deleteButton">
+      <property name="enabled">
+       <bool>false</bool>
+      </property>
+      <property name="geometry">
+       <rect>
+        <x>463</x>
+        <y>550</y>
+        <width>80</width>
+        <height>23</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Delete</string>
+      </property>
+      <property name="icon">
+       <iconset>
+        <normaloff>:icons/silk/delete.png</normaloff>:icons/silk/delete.png</iconset>
+      </property>
+     </widget>
+     <widget class="QLabel" name="calcboilLabel">
+      <property name="geometry">
+       <rect>
+        <x>720</x>
+        <y>10</y>
+        <width>141</width>
+        <height>16</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Calculate boil volume:</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+      </property>
+     </widget>
+     <widget class="QCheckBox" name="calcboilEdit">
+      <property name="geometry">
+       <rect>
+        <x>870</x>
+        <y>10</y>
+        <width>85</width>
+        <height>21</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>Yes</string>
+      </property>
+     </widget>
+     <widget class="QGroupBox" name="mashGroup">
+      <property name="geometry">
+       <rect>
+        <x>70</x>
+        <y>110</y>
+        <width>401</width>
+        <height>251</height>
+       </rect>
+      </property>
+      <property name="title">
+       <string>Mashing</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <property name="flat">
+       <bool>true</bool>
+      </property>
+      <widget class="QDoubleSpinBox" name="tun_volumeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>30</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QLabel" name="tun_volumeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>30</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Tun volume L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="tun_heightLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>60</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Tun height cm:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="tun_weightLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>90</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Tun weight kg:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="tun_materialLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>120</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Tun material:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="tun_specific_heatLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>150</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Tun specific heat:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="mash_volumeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>180</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Mash water L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="mash_maxLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>210</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Maximum malts kg:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="tun_heightEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>60</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="tun_weightEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>90</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.100000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="tun_specific_heatEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>150</y>
+         <width>71</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="frame">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="readOnly">
+        <bool>true</bool>
+       </property>
+       <property name="buttonSymbols">
+        <enum>QAbstractSpinBox::NoButtons</enum>
+       </property>
+       <property name="accelerated">
+        <bool>false</bool>
+       </property>
+       <property name="decimals">
+        <number>3</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.010000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="mash_volumeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>180</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="mash_maxEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>210</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QComboBox" name="tun_materialEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>120</y>
+         <width>121</width>
+         <height>23</height>
+        </rect>
+       </property>
+      </widget>
+     </widget>
+     <widget class="QGroupBox" name="lauterGroup">
+      <property name="geometry">
+       <rect>
+        <x>70</x>
+        <y>370</y>
+        <width>401</width>
+        <height>161</height>
+       </rect>
+      </property>
+      <property name="title">
+       <string>Lautering</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <widget class="QLabel" name="lauter_volumeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>30</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Lauter volume L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="lauter_heightLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>60</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Lauter height cm:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="lauter_deadspaceLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>90</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Lauter deadspace L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="efficiencyLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>120</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Brewhouse efficiency %:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="lauter_volumeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>30</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="lauter_heightEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>60</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="lauter_deadspaceEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>90</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.100000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="efficiencyEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>120</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+     </widget>
+     <widget class="QGroupBox" name="boilGroup">
+      <property name="geometry">
+       <rect>
+        <x>530</x>
+        <y>110</y>
+        <width>401</width>
+        <height>281</height>
+       </rect>
+      </property>
+      <property name="title">
+       <string>Boiling</string>
+      </property>
+      <widget class="QLabel" name="kettle_volumeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>30</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Kettle volume L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="kettle_volumeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>30</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QLabel" name="kettle_heightLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>60</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Kettle heigh cmt:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="kettle_heightEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>60</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QLabel" name="boil_sizeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>90</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Boil size L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="boil_sizeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>90</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.500000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QLabel" name="evap_rateLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>120</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Evaporation L/hour:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="boil_timeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>150</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Boil time minutes:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="top_up_kettleLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>180</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Top up kettle L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="hopfactorLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>210</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Hop utilization %:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="batch_sizeLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>240</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Batch size L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="evap_rateEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>120</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>2</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.010000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="boil_timeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>150</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <double>1440.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>1.000000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="top_up_kettleEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>180</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.100000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="hopfactorEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>210</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="toolTip">
+        <string>100% for small breweries, higher for large breweries.</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <double>200.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>1.000000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="batch_sizeEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>240</y>
+         <width>107</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="readOnly">
+        <bool>true</bool>
+       </property>
+       <property name="buttonSymbols">
+        <enum>QAbstractSpinBox::NoButtons</enum>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>2</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.010000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+     </widget>
+     <widget class="QGroupBox" name="chillGroup">
+      <property name="geometry">
+       <rect>
+        <x>530</x>
+        <y>400</y>
+        <width>401</width>
+        <height>131</height>
+       </rect>
+      </property>
+      <property name="title">
+       <string>Chilling</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <widget class="QLabel" name="chiller_lossLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>30</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Trub chiller loss L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="chiller_lossEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>30</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.100000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QLabel" name="top_up_waterLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>60</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Extra water in fermenter L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QLabel" name="vol_fermenterLabel">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>90</y>
+         <width>181</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="text">
+        <string>Volume in fermenter L:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="top_up_waterEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>60</y>
+         <width>121</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.100000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+      <widget class="QDoubleSpinBox" name="vol_fermenterEdit">
+       <property name="geometry">
+        <rect>
+         <x>200</x>
+         <y>90</y>
+         <width>107</width>
+         <height>24</height>
+        </rect>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="readOnly">
+        <bool>true</bool>
+       </property>
+       <property name="buttonSymbols">
+        <enum>QAbstractSpinBox::NoButtons</enum>
+       </property>
+       <property name="accelerated">
+        <bool>true</bool>
+       </property>
+       <property name="decimals">
+        <number>2</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="singleStep">
+        <double>0.010000000000000</double>
+       </property>
+       <property name="stepType">
+        <enum>QAbstractSpinBox::DefaultStepType</enum>
+       </property>
+      </widget>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>nameEdit</tabstop>
+  <tabstop>notesEdit</tabstop>
+  <tabstop>tun_volumeEdit</tabstop>
+  <tabstop>quitButton</tabstop>
+  <tabstop>deleteButton</tabstop>
+  <tabstop>saveButton</tabstop>
+ </tabstops>
+ <resources>
+  <include location="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc"/>
+ </resources>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/InventoryEquipments.ui	Sun Feb 27 20:45:41 2022 +0100
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>InventoryEquipments</class>
+ <widget class="QDialog" name="InventoryEquipments">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1280</width>
+    <height>640</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QTableWidget" name="tableEquipments">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+     <property name="flat">
+      <bool>false</bool>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <property name="spacing">
+       <number>6</number>
+      </property>
+      <property name="leftMargin">
+       <number>0</number>
+      </property>
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <property name="rightMargin">
+       <number>0</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
+      <item alignment="Qt::AlignLeft">
+       <widget class="QPushButton" name="quitButton">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>80</width>
+          <height>24</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Quit</string>
+        </property>
+        <property name="icon">
+         <iconset resource="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc">
+          <normaloff>:icons/silk/door_out.png</normaloff>:icons/silk/door_out.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="exportButton">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>80</width>
+          <height>24</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Export</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="importButton">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>80</width>
+          <height>24</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Import</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="insertButton">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>80</width>
+          <height>24</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>New</string>
+        </property>
+        <property name="icon">
+         <iconset resource="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc">
+          <normaloff>:icons/silk/table_row_insert.png</normaloff>:icons/silk/table_row_insert.png</iconset>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc"/>
+ </resources>
+ <connections/>
+</ui>
--- a/ui/MainWindow.ui	Sat Feb 26 16:34:20 2022 +0100
+++ b/ui/MainWindow.ui	Sun Feb 27 20:45:41 2022 +0100
@@ -254,7 +254,7 @@
   </action>
   <action name="actionEquipments">
    <property name="enabled">
-    <bool>false</bool>
+    <bool>true</bool>
    </property>
    <property name="icon">
     <iconset>

mercurial