本文整理汇总了C++中LOG_AND_THROW函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_AND_THROW函数的具体用法?C++ LOG_AND_THROW怎么用?C++ LOG_AND_THROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOG_AND_THROW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: optionalCoolingCapacityModifierCurveFunctionofFlowFraction
Curve CoilCoolingDXVariableRefrigerantFlow_Impl::coolingCapacityModifierCurveFunctionofFlowFraction() const {
boost::optional<Curve> value = optionalCoolingCapacityModifierCurveFunctionofFlowFraction();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Cooling Capacity Modifier Curve Functionof Flow Fraction attached.");
}
return value.get();
}
示例2: getDouble
double RefractionExtinctionGlazing_Impl::thermalTransmittance() const {
OptionalDouble od = getDouble(OS_WindowMaterial_Glazing_RefractionExtinctionMethodFields::InfraredTransmittanceatNormalIncidence,true);
if (!od) {
LOG_AND_THROW("Thermal transmittance not yet defined for " << briefDescription() << ".");
}
return *od;
}
示例3: optionalDefrostSchedule
Schedule RefrigerationAirChiller_Impl::defrostSchedule() const {
boost::optional<Schedule> value = optionalDefrostSchedule();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Defrost Schedule attached.");
}
return value.get();
}
示例4: optionalHeatExchanger
AirToAirComponent CoilSystemCoolingWaterHeatExchangerAssisted_Impl::heatExchanger() const {
boost::optional<AirToAirComponent> value = optionalHeatExchanger();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Heat Exchanger attached.");
}
return value.get();
}
示例5: optionalApplicabilitySchedule
Schedule AvailabilityManagerNightVentilation_Impl::applicabilitySchedule() const {
boost::optional<Schedule> value = optionalApplicabilitySchedule();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Applicability Schedule attached.");
}
return value.get();
}
示例6: LOG_AND_THROW
Quantity& Quantity::operator+=(const Quantity& rQuantity) {
if (this == &rQuantity) {
m_value *= 2.0;
return *this;
}
if (m_units != rQuantity.m_units) {
LOG_AND_THROW("Cannot add quantities with different units.");
}
if (scale() != rQuantity.scale()) {
Quantity wRQuantity(rQuantity);
wRQuantity.setScale(scale().exponent);
m_value += wRQuantity.value();
}
else {
m_value += rQuantity.value();
}
if (isTemperature() && rQuantity.isTemperature()) {
if (!isAbsolute() && rQuantity.isAbsolute()) {
setAsAbsolute();
}
}
return *this;
}
示例7: LOG_AND_THROW
void OSDoubleEdit2::completeBind() {
// only let one of autosize/autocalculate
if ((m_isAutosized && m_isAutocalculated) ||
(m_isAutosized && m_autocalculate) ||
(m_isAutocalculated && m_autosize))
{
LOG_AND_THROW("A field can only be autosized or autocalculated, it cannot be both.");
}
setEnabled(true);
bool isConnected = false;
isConnected = connect( this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()) );
OS_ASSERT(isConnected);
isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onChange()),
this,SLOT(onModelObjectChange()) );
OS_ASSERT(isConnected);
isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onRemoveFromWorkspace(Handle)),
this,SLOT(onModelObjectRemove(Handle)) );
OS_ASSERT(isConnected);
refreshTextAndLabel();
}
示例8: StraightComponent
AirTerminalSingleDuctParallelPIUReheat::AirTerminalSingleDuctParallelPIUReheat( const Model& model,
Schedule & schedule,
HVACComponent & fan,
HVACComponent & reheatCoil )
: StraightComponent(AirTerminalSingleDuctParallelPIUReheat::iddObjectType(),model)
{
OS_ASSERT(getImpl<detail::AirTerminalSingleDuctParallelPIUReheat_Impl>());
bool test = setAvailabilitySchedule(schedule);
if (!test) {
remove();
LOG_AND_THROW("Could not construct " << briefDescription() << ", because could not set its "
<< "availability schedule to " << schedule.briefDescription() << ".");
}
setFan(fan);
setReheatCoil(reheatCoil);
autosizeMaximumHotWaterorSteamFlowRate();
setMinimumHotWaterorSteamFlowRate(0.0);
setConvergenceTolerance(0.001);
autosizeMaximumPrimaryAirFlowRate();
autosizeMaximumSecondaryAirFlowRate();
autosizeMinimumPrimaryAirFlowFraction();
autosizeFanOnFlowFraction();
}
示例9: LOG_AND_THROW
std::string OSArgument::valueAsString() const
{
if (!hasValue()) {
LOG_AND_THROW("Argument " << name() << " has no value.");
}
return printQVariant(m_value);
}
示例10: optionalChillerHeaterModulesControlSchedule
Schedule CentralHeatPumpSystemModule_Impl::chillerHeaterModulesControlSchedule() const {
boost::optional<Schedule> value = optionalChillerHeaterModulesControlSchedule();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Chiller Heater Modules Control Schedule attached.");
}
return value.get();
}
示例11: ZoneHVACComponent
ZoneHVACLowTemperatureRadiantElectric::ZoneHVACLowTemperatureRadiantElectric(const Model& model, Schedule & availabilitySchedule, Schedule & heatingTemperatureSchedule)
: ZoneHVACComponent(ZoneHVACLowTemperatureRadiantElectric::iddObjectType(),model)
{
OS_ASSERT(getImpl<detail::ZoneHVACLowTemperatureRadiantElectric_Impl>());
bool ok = setAvailabilitySchedule(availabilitySchedule);
if (!ok)
{
//remove();
LOG_AND_THROW("Unable to set " << briefDescription() << "'s availability schedule to "
<< availabilitySchedule.briefDescription() << ".");
}
ok = setHeatingSetpointTemperatureSchedule(heatingTemperatureSchedule);
if (!ok)
{
//remove();
//LOG_AND_THROW("Unable to set " << briefDescription() << "'s heating temperature schedule to "
// << schedule.briefDescription() << ".");
}
resetRadiantSurfaceType();
autosizeMaximumElectricalPowertoPanel();
setTemperatureControlType("MeanAirTemperature");
setHeatingThrottlingRange(2.0);
//setString(OS_ZoneHVAC_LowTemperatureRadiant_ElectricFields::HeatingSetpointTemperatureScheduleName,"");
}
示例12: optionalChillerHeaterModulesPerformanceComponent
ChillerHeaterPerformanceElectricEIR CentralHeatPumpSystemModule_Impl::chillerHeaterModulesPerformanceComponent() const {
boost::optional<ChillerHeaterPerformanceElectricEIR> value = optionalChillerHeaterModulesPerformanceComponent();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Chiller Heater Modules Performance Component attached.");
}
return value.get();
}
示例13: molecularWeight
double GasMixture_Impl::getThermalConductivity(double temperature) const {
double molecularWeight(0.0); // cumulative sum of fraction * molecular weight
double result(0.0); // cumulative sum of conductivity * fraction * molecular weight
for (unsigned i = 0, n = numGases(); i < n; ++i) {
std::string type = getGasType(i);
double fraction = getGasFraction(i);
double weight(0.0);
std::vector<double> coeffs;
if (openstudio::istringEqual(type,"Air")) {
weight = FenestrationMaterial::airMolecularWeight();
coeffs = FenestrationMaterial::airThermalConductivityCoefficients();
}
else if (openstudio::istringEqual(type,"Argon")) {
weight = FenestrationMaterial::argonMolecularWeight();
coeffs = FenestrationMaterial::argonThermalConductivityCoefficients();
}
else if (openstudio::istringEqual(type,"Krypton")) {
weight = FenestrationMaterial::kryptonMolecularWeight();
coeffs = FenestrationMaterial::kryptonThermalConductivityCoefficients();
}
else if (openstudio::istringEqual(type,"Xenon")) {
weight = FenestrationMaterial::xenonMolecularWeight();
coeffs = FenestrationMaterial::xenonThermalConductivityCoefficients();
}
else {
LOG_AND_THROW("Unknown gasType listed in " << briefDescription() << ".");
}
molecularWeight += weight*fraction;
result += (coeffs[0] + (coeffs[1] * temperature) + (coeffs[2] * ::pow(temperature,2.0))) * fraction * weight;
}
result /= molecularWeight;
return result;
}
示例14: optionalAvailabilitySchedule
Schedule CoilCoolingDXVariableRefrigerantFlow_Impl::availabilitySchedule() const {
boost::optional<Schedule> value = optionalAvailabilitySchedule();
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
}
return value.get();
}
示例15: LOG_AND_THROW
Schedule ZoneMixing_Impl::schedule() const {
boost::optional<Schedule> value = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_ZoneMixingFields::ScheduleName);
if (!value) {
LOG_AND_THROW(briefDescription() << " does not have an Schedule attached.");
}
return value.get();
}