本文整理汇总了C++中Equipment::trubChillerLoss_l方法的典型用法代码示例。如果您正苦于以下问题:C++ Equipment::trubChillerLoss_l方法的具体用法?C++ Equipment::trubChillerLoss_l怎么用?C++ Equipment::trubChillerLoss_l使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Equipment
的用法示例。
在下文中一共展示了Equipment::trubChillerLoss_l方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postBoilLossOgTest
void Testing::postBoilLossOgTest()
{
double const grain_kg = 5.0;
Recipe* recNoLoss = Database::instance().newRecipe();
Recipe* recLoss = Database::instance().newRecipe();
Equipment* eNoLoss = equipFiveGalNoLoss;
Equipment* eLoss = Database::instance().newEquipment(eNoLoss);
// Only difference between the recipes:
// - 2 L of post-boil loss
// - 2 L extra of boil size (to hit the same batch size)
eLoss->setTrubChillerLoss_l(2.0);
eLoss->setBoilSize_l(eNoLoss->boilSize_l() + eLoss->trubChillerLoss_l());
// Basic recipe parameters
recNoLoss->setName("TestRecipe_noLoss");
recNoLoss->setBatchSize_l(eNoLoss->batchSize_l());
recNoLoss->setBoilSize_l(eNoLoss->boilSize_l());
recNoLoss->setEfficiency_pct(70.0);
recLoss->setName("TestRecipe_loss");
recLoss->setBatchSize_l(eLoss->batchSize_l());
recLoss->setBoilSize_l(eLoss->boilSize_l());
recLoss->setEfficiency_pct(70.0);
double mashWaterNoLoss_l = recNoLoss->boilSize_l()
+ eNoLoss->grainAbsorption_LKg() * grain_kg
;
double mashWaterLoss_l = recLoss->boilSize_l()
+ eLoss->grainAbsorption_LKg() * grain_kg
;
// Add equipment
Database::instance().addToRecipe(recNoLoss, eNoLoss);
Database::instance().addToRecipe(recLoss, eLoss);
// Add grain
twoRow->setAmount_kg(grain_kg);
Database::instance().addToRecipe(recNoLoss, twoRow);
Database::instance().addToRecipe(recLoss, twoRow);
// Single conversion, no sparge
Mash* singleConversion = Database::instance().newMash();
singleConversion->setName("Single Conversion");
singleConversion->setGrainTemp_c(20.0);
singleConversion->setSpargeTemp_c(80.0);
MashStep* singleConversion_convert = Database::instance().newMashStep(singleConversion);
singleConversion_convert->setName("Conversion");
singleConversion_convert->setType(MashStep::Infusion);
// Infusion for recNoLoss
singleConversion_convert->setInfuseAmount_l(mashWaterNoLoss_l);
Database::instance().addToRecipe(recNoLoss, singleConversion);
// Infusion for recLoss
singleConversion_convert->setInfuseAmount_l(mashWaterLoss_l);
Database::instance().addToRecipe(recLoss, singleConversion);
// Verify we hit the right boil/final volumes (that the test is sane)
QVERIFY2( fuzzyComp(recNoLoss->boilVolume_l(), recNoLoss->boilSize_l(), 0.1), "Wrong boil volume calculation (recNoLoss)" );
QVERIFY2( fuzzyComp(recLoss->boilVolume_l(), recLoss->boilSize_l(), 0.1), "Wrong boil volume calculation (recLoss)" );
QVERIFY2( fuzzyComp(recNoLoss->finalVolume_l(), recNoLoss->batchSize_l(), 0.1), "Wrong final volume calculation (recNoLoss)" );
QVERIFY2( fuzzyComp(recLoss->finalVolume_l(), recLoss->batchSize_l(), 0.1), "Wrong final volume calculation (recLoss)" );
// The OG calc itself is verified in recipeCalcTest_*(), so just verify that
// the two OGs are the same
QVERIFY2( fuzzyComp(recLoss->og(), recNoLoss->og(), 0.002), "OG of recipe with post-boil loss is different from no-loss recipe" );
}