# HG changeset patch # User Michiel Broek # Date 1675354468 -3600 # Node ID 83b5c2b3c414e964ea9d79c555890080696310d6 # Parent ebf7ef31da35da3bc7651fe0bc3e461165c7143f Database upgrade will let the yeastpack cells at 0. Disabled some debug messages needed for development. Updated yeastpack editor tooltips. diff -r ebf7ef31da35 -r 83b5c2b3c414 src/MainWindow.cpp --- a/src/MainWindow.cpp Thu Feb 02 15:50:15 2023 +0100 +++ b/src/MainWindow.cpp Thu Feb 02 17:14:28 2023 +0100 @@ -164,7 +164,7 @@ */ void MainWindow::updateDataBase() { - QSqlQuery query1, query2, query3, query4; + QSqlQuery query1, query2, query4; int count = 0; bool added_packs = false; @@ -204,20 +204,12 @@ if (! query2.first()) { qDebug() << " add yeastpack" << query1.value("laboratory").toString() << query1.value("form").toInt(); - query3.prepare("SELECT record,cells FROM inventory_yeasts WHERE laboratory=:laboratory AND form=:form"); - query3.bindValue(":laboratory", query1.value("laboratory").toString()); - query3.bindValue(":form", query1.value("form").toInt()); - query3.exec(); - query3.first(); - /* Should succeed */ - query4.prepare("INSERT INTO inventory_yeastpack SET uuid=:uuid, laboratory=:laboratory, " - "form=:form, package=:package, cells=:cells, viability=:viability, max=:max"); + "form=:form, package=:package, viability=:viability, max=:max"); query4.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36)); query4.bindValue(":laboratory", query1.value("laboratory").toString()); query4.bindValue(":form", query1.value("form").toInt()); query4.bindValue(":package", g_yeast_forms[query1.value("form").toInt()]); - query4.bindValue(":cells", query3.value("cells").toDouble()); switch (query1.value("form").toInt()) { case YEAST_FORMS_LIQUID: query4.bindValue(":viability", 0.80); query4.bindValue(":max", 97); diff -r ebf7ef31da35 -r 83b5c2b3c414 src/database/db_product.cpp --- a/src/database/db_product.cpp Thu Feb 02 15:50:15 2023 +0100 +++ b/src/database/db_product.cpp Thu Feb 02 17:14:28 2023 +0100 @@ -434,7 +434,7 @@ } else if (yeasts.isArray()) { for (int i = 0; i < yeasts.array().size(); i++) { QJsonObject obj = yeasts.array().at(i).toObject(); - qDebug() << "yeasts_Json" << i << obj; +// qDebug() << "yeasts_Json" << i << obj; Yeasts y; /* First some defaults for newer fields. */ y.tolerance = y.harvest_time = y.pitch_temperature = y.zymocide = 0; @@ -446,7 +446,7 @@ /* Clear Yeast Package data */ y.yp_uuid = QString(); y.yp_package = QString(); - y.yp_cells = obj["y_cells"].toDouble(); + y.yp_cells = 0; y.yp_viability = 0.99; y.yp_max = 100; y.yp_size = 0.01; @@ -512,7 +512,7 @@ * Yeast Pack. */ if (obj.contains("y_package") && obj["y_package"].isObject()) { - qDebug() << "y_package object present"; +// qDebug() << "y_package object present"; QJsonObject package = obj.value("y_package").toObject(); qDebug() << "yeasts_Json package" << i << package; y.yp_uuid = package["uuid"].toString(); @@ -521,8 +521,6 @@ y.yp_viability = package["viability"].toDouble(); y.yp_max = package["max"].toInt(); y.yp_size = package["size"].toDouble(); - } else { - qDebug() << "y_package not present"; } prod->yeasts.append(y); @@ -995,7 +993,7 @@ obj.insert("y_sg_hi", round(prod->yeasts.at(i).sg_hi * 1000) / 1000); obj.insert("y_cost", round(prod->yeasts.at(i).cost * 1000) / 1000); if (! product->yeasts.at(i).yp_uuid.isNull() && (product->yeasts.at(i).yp_uuid.length() == 36)) { - qDebug() << "yeasts_Json append package"; +// qDebug() << "yeasts_Json append package"; QJsonObject package; package.insert("uuid", prod->yeasts.at(i).yp_uuid); package.insert("package", prod->yeasts.at(i).yp_package); diff -r ebf7ef31da35 -r 83b5c2b3c414 translations/bmsapp_en.ts --- a/translations/bmsapp_en.ts Thu Feb 02 15:50:15 2023 +0100 +++ b/translations/bmsapp_en.ts Thu Feb 02 17:14:28 2023 +0100 @@ -4366,7 +4366,7 @@ - + Use at: @@ -4380,7 +4380,7 @@ - + In stock: @@ -4522,8 +4522,8 @@ - - + + Amount in gr: @@ -4562,8 +4562,8 @@ - - + + Amount in ml: @@ -4574,13 +4574,13 @@ - + Primary - + Secondary @@ -4741,39 +4741,39 @@ - - + + Total packs: - + Yeast name: - - + + Laboratory: - + Select yeast: - + Select package: - + Tertiary - + Bottle @@ -8467,48 +8467,65 @@ - + + If set this will override the yeast cells setting. +Use with great care! + + + + Viability: - + + The viability after one month. + + + + Package size: - + + The contents size of one package. + + + + xx - + Used in yeasts: - + Max viability: - + For most 100% is good, some liquid yeast start at 97% - - + + % - - The yeast health after 6 months. - - - - + + The yeast health after six months since production. +This is a calculated from the Viability and Max values. + + + + 6 months health: @@ -8523,7 +8540,7 @@ - + Clone @@ -12314,8 +12331,8 @@ - - + + Database error @@ -12328,8 +12345,8 @@ - - + + MySQL error: %1 %2 %3 diff -r ebf7ef31da35 -r 83b5c2b3c414 translations/bmsapp_nl.ts --- a/translations/bmsapp_nl.ts Thu Feb 02 15:50:15 2023 +0100 +++ b/translations/bmsapp_nl.ts Thu Feb 02 17:14:28 2023 +0100 @@ -4882,7 +4882,7 @@ - + Use at: Toevoegen bij: @@ -4896,7 +4896,7 @@ - + In stock: In voorraad: @@ -5038,8 +5038,8 @@ - - + + Amount in gr: Gewicht in gr: @@ -5097,8 +5097,8 @@ - - + + Amount in ml: Hoeveelheid in ml: @@ -5109,13 +5109,13 @@ - + Primary Hoofdgisting - + Secondary Nagisting/lagering @@ -5276,39 +5276,39 @@ Verwijder gist - - + + Total packs: Aantal pakken: - + Yeast name: Gist naam: - - + + Laboratory: Laboratorium: - + Select yeast: Kies gist: - + Select package: - + Tertiary Lageren - + Bottle Bottelen @@ -9238,48 +9238,65 @@ - + + If set this will override the yeast cells setting. +Use with great care! + + + + Viability: - + + The viability after one month. + + + + Package size: - + + The contents size of one package. + + + + xx - + Used in yeasts: - + Max viability: - + For most 100% is good, some liquid yeast start at 97% - - + + % % - - The yeast health after 6 months. + + The yeast health after six months since production. +This is a calculated from the Viability and Max values. - + 6 months health: @@ -9297,7 +9314,7 @@ Miljard cellen/gram: - + Clone Kloon @@ -13967,8 +13984,8 @@ - - + + Database error Database fout @@ -13981,8 +13998,8 @@ - - + + MySQL error: %1 %2 %3 diff -r ebf7ef31da35 -r 83b5c2b3c414 ui/EditYeastPack.ui --- a/ui/EditYeastPack.ui Thu Feb 02 15:50:15 2023 +0100 +++ b/ui/EditYeastPack.ui Thu Feb 02 17:14:28 2023 +0100 @@ -229,6 +229,10 @@ 24 + + If set this will override the yeast cells setting. +Use with great care! + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -284,6 +288,9 @@ 24 + + The viability after one month. + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -325,6 +332,9 @@ 24 + + The contents size of one package. + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -442,7 +452,8 @@ - The yeast health after 6 months. + The yeast health after six months since production. +This is a calculated from the Viability and Max values. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter