src/EditEquipment.cpp

changeset 527
84091b9cb800
parent 462
1654ff5446c7
--- a/src/EditEquipment.cpp	Sat Jun 01 21:10:54 2024 +0200
+++ b/src/EditEquipment.cpp	Sat Jun 08 15:54:30 2024 +0200
@@ -67,6 +67,8 @@
 	ui->chiller_lossEdit->setValue(query.value("chiller_loss").toDouble());
         ui->chiller_volumeEdit->setValue(query.value("chiller_volume").toDouble());
 	ui->chiller_lpmEdit->setValue(query.value("chiller_lpm").toDouble());
+	ui->HLT_volumeEdit->setValue(query.value("HLT_volume").toDouble());
+	ui->HLT_deadspaceEdit->setValue(query.value("HLT_deadspace").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.
@@ -101,6 +103,8 @@
 	ui->chiller_lossEdit->setValue(0);
 	ui->chiller_volumeEdit->setValue(0.5);
 	ui->chiller_lpmEdit->setValue(0);
+	ui->HLT_volumeEdit->setValue(20);
+	ui->HLT_deadspaceEdit->setValue(2);
 	inuse = 0;
     }
     /* Block select no chiller used */
@@ -131,6 +135,8 @@
     connect(ui->chiller_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
     connect(ui->chiller_lpmEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
     connect(ui->chiller_lossEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->HLT_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
+    connect(ui->HLT_deadspaceEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
 
     calcBatchVolume();
     ui->saveButton->setEnabled(false);
@@ -190,7 +196,8 @@
 		"notes=:notes, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
 		"kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
 		"efficiency=:efficiency, chiller_type=:chiller_type, chiller_to79=:chiller_to79, "
-		"chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss");
+		"chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss, "
+		"HLT_volume=:HLT_volume, HLT_deadspace=:HLT_deadspace");
 	if (this->recno == -1) {
 	    sql.append(", uuid=:uuid");
 	} else {
@@ -222,6 +229,8 @@
 	query.bindValue(":chiller_volume", QString("%1").arg(ui->chiller_volumeEdit->value(), 3, 'f', 2, '0'));
 	query.bindValue(":chiller_lpm", QString("%1").arg(ui->chiller_lpmEdit->value(), 3, 'f', 2, '0'));
 	query.bindValue(":chiller_loss", QString("%1").arg(ui->chiller_lossEdit->value(), 3, 'f', 2, '0'));
+	query.bindValue(":HLT_volume", QString("%1").arg(ui->HLT_volumeEdit->value(), 2, 'f', 1, '0'));
+	query.bindValue(":HLT_deadspace", QString("%1").arg(ui->HLT_deadspaceEdit->value(), 2, 'f', 1, '0'));
 
 	if (this->recno == -1) {
             query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
@@ -259,7 +268,8 @@
                 "notes=:notes, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
                 "kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
                 "efficiency=:efficiency, chiller_type=:chiller_type, chiller_to79=:chiller_to79, "
-                "chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss, uuid=:uuid");
+                "chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss, "
+		"HLT_volume=:HLT_volume, HLT_deadspace=:HLT_deadspace, uuid=:uuid");
 
     query.bindValue(":name", ui->nameEdit->text() + " [copy]");
     query.bindValue(":boil_size", QString("%1").arg(ui->boil_sizeEdit->value(), 2, 'f', 1, '0'));
@@ -287,6 +297,8 @@
     query.bindValue(":chiller_volume", QString("%1").arg(ui->chiller_volumeEdit->value(), 3, 'f', 2, '0'));
     query.bindValue(":chiller_lpm", QString("%1").arg(ui->chiller_lpmEdit->value(), 3, 'f', 2, '0'));
     query.bindValue(":chiller_loss", QString("%1").arg(ui->chiller_lossEdit->value(), 3, 'f', 2, '0'));
+    query.bindValue(":HLT_volume", QString("%1").arg(ui->HLT_volumeEdit->value(), 2, 'f', 1, '0'));
+    query.bindValue(":HLT_deadspace", QString("%1").arg(ui->HLT_deadspaceEdit->value(), 2, 'f', 1, '0'));
     query.exec();
     if (query.lastError().isValid()) {
 	qWarning() << "EditEquipment" << query.lastError();

mercurial