当前位置: 首页>>代码示例>>C++>>正文


C++ Equipment::trubChillerLoss_l方法代码示例

本文整理汇总了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" );
}
开发者ID:JulianVolodia,项目名称:brewtarget,代码行数:69,代码来源:Testing.cpp


注:本文中的Equipment::trubChillerLoss_l方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。