src/EditProduct.cpp

changeset 202
49ec4fdee5a6
parent 198
904591820c3d
child 204
decbf82ae9a5
equal deleted inserted replaced
201:b8232133a12d 202:49ec4fdee5a6
608 m.step_temp = obj["step_temp"].toDouble(); 608 m.step_temp = obj["step_temp"].toDouble();
609 m.step_time = obj["step_time"].toDouble(); 609 m.step_time = obj["step_time"].toDouble();
610 m.ramp_time = obj["ramp_time"].toDouble(); 610 m.ramp_time = obj["ramp_time"].toDouble();
611 m.end_temp = obj["end_temp"].toDouble(); 611 m.end_temp = obj["end_temp"].toDouble();
612 m.step_wg_ratio = obj["step_wg_ratio"].toDouble(); 612 m.step_wg_ratio = obj["step_wg_ratio"].toDouble();
613 m.step_ph = obj["step_ph"].toDouble();
614 m.step_sg = obj["step_sg"].toDouble();
613 product->mashs.append(m); 615 product->mashs.append(m);
614 } 616 }
615 } 617 }
616 } else { 618 } else {
617 qDebug() << "empty mashs"; 619 qDebug() << "empty mashs";
1103 ui->ok_pmptLabel->setVisible(false); 1105 ui->ok_pmptLabel->setVisible(false);
1104 ui->ok_pmptIcon->setVisible(false); 1106 ui->ok_pmptIcon->setVisible(false);
1105 return; 1107 return;
1106 } 1108 }
1107 1109
1108 qDebug() << "calcSupplies() f:" << product->fermentables_ok << "h:" << product->hops_ok << "m:" << product->miscs_ok /*<< "y:" << product->yeasts_ok << "w:" << product->waters_ok*/; 1110 qDebug() << "calcSupplies() f:" << product->fermentables_ok << "h:" << product->hops_ok << "m:" << product->miscs_ok << "y:" << product->yeasts_ok /*<< "w:" << product->waters_ok*/;
1109 if (product->fermentables_ok && product->hops_ok && product->miscs_ok /*&& product->yeasts_ok && product->waters_ok */) { 1111 if (product->fermentables_ok && product->hops_ok && product->miscs_ok && product->yeasts_ok /*&& product->waters_ok */) {
1110 ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/tick.png"))); 1112 ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/tick.png")));
1111 } else { 1113 } else {
1112 ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/cancel.png"))); 1114 ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/cancel.png")));
1113 } 1115 }
1114 } 1116 }
1668 obj.insert("step_temp", round(product->mashs.at(i).step_temp * 100) / 100); 1670 obj.insert("step_temp", round(product->mashs.at(i).step_temp * 100) / 100);
1669 obj.insert("step_time", round(product->mashs.at(i).step_time * 100) / 100); 1671 obj.insert("step_time", round(product->mashs.at(i).step_time * 100) / 100);
1670 obj.insert("ramp_time", round(product->mashs.at(i).ramp_time * 100) / 100); 1672 obj.insert("ramp_time", round(product->mashs.at(i).ramp_time * 100) / 100);
1671 obj.insert("end_temp", round(product->mashs.at(i).end_temp * 100) / 100); 1673 obj.insert("end_temp", round(product->mashs.at(i).end_temp * 100) / 100);
1672 obj.insert("step_wg_ratio", round(product->mashs.at(i).step_wg_ratio * 100) / 100); 1674 obj.insert("step_wg_ratio", round(product->mashs.at(i).step_wg_ratio * 100) / 100);
1675 obj.insert("step_ph", round(product->mashs.at(i).step_ph * 100) / 100);
1676 obj.insert("step_sg", round(product->mashs.at(i).step_sg * 10000) / 10000);
1673 qDebug() << "mashs_Json" << i << obj; 1677 qDebug() << "mashs_Json" << i << obj;
1674 array.append(obj); /* Append this object */ 1678 array.append(obj); /* Append this object */
1675 } 1679 }
1676 QJsonDocument doc; 1680 QJsonDocument doc;
1677 doc.setArray(array); 1681 doc.setArray(array);

mercurial