本文整理汇总了C++中OptionalModelObject类的典型用法代码示例。如果您正苦于以下问题:C++ OptionalModelObject类的具体用法?C++ OptionalModelObject怎么用?C++ OptionalModelObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OptionalModelObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: idfObject
boost::optional<IdfObject> ForwardTranslator::translateDistrictCooling( DistrictCooling& modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
boost::optional<double> value;
IdfObject idfObject(IddObjectType::DistrictCooling);
m_idfObjects.push_back(idfObject);
///////////////////////////////////////////////////////////////////////////
// Field: Name ////////////////////////////////////////////////////////////
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// Inlet Node Name ////////////////////////////////////////////////////
temp = modelObject.inletModelObject();
if(temp)
{
s = temp->name();
if(s)
{
idfObject.setString(openstudio::DistrictCoolingFields::ChilledWaterInletNodeName,*s);
}
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// Outlet Node Name ///////////////////////////////////////////////////
temp = modelObject.outletModelObject();
if(temp)
{
s = temp->name();
if(s)
{
idfObject.setString(openstudio::DistrictCoolingFields::ChilledWaterOutletNodeName,*s);
}
}
///
////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//Nominal Capacity ///////////////////////////////////////////////////
if( (value = modelObject.nominalCapacity()) )
{
idfObject.setDouble(DistrictCoolingFields::NominalCapacity,value.get());
}
//
////////////////////////////////////////////////////////////////////////
return boost::optional<IdfObject>(idfObject);
}
示例2: LOG
OptionalModelObject ReverseTranslator::translateScheduleCompact( const WorkspaceObject & workspaceObject )
{
if( workspaceObject.iddObject().type() != IddObjectType::Schedule_Compact )
{
LOG(Error, "WorkspaceObject is not IddObjectType: Schedule:Compact");
return boost::none;
}
ScheduleCompact scheduleCompact(m_model);
OptionalWorkspaceObject target = workspaceObject.getTarget(Schedule_CompactFields::ScheduleTypeLimitsName);
if (target){
OptionalModelObject scheduleTypeLimits = translateAndMapWorkspaceObject(*target);
if (scheduleTypeLimits){
scheduleCompact.setPointer(OS_Schedule_CompactFields::ScheduleTypeLimitsName, scheduleTypeLimits->handle());
}
}
if (OptionalString os = workspaceObject.name()) {
scheduleCompact.setName(*os);
}
for (const IdfExtensibleGroup& eg : workspaceObject.extensibleGroups()) {
scheduleCompact.pushExtensibleGroup(eg.fields());
}
return scheduleCompact;
}
示例3: LOG
OptionalModelObject ReverseTranslator::translateScheduleDayHourly(const WorkspaceObject & workspaceObject){
if (workspaceObject.iddObject().type() != IddObjectType::Schedule_Day_Hourly){
LOG(Error, "WorkspaceObject is not IddObjectType: Schedule:Day:Hourly");
return boost::none;
}
// create the schedule
ScheduleDay scheduleDay(m_model);
OptionalString s = workspaceObject.name();
if (s){
scheduleDay.setName(*s);
}
OptionalWorkspaceObject target = workspaceObject.getTarget(Schedule_Day_HourlyFields::ScheduleTypeLimitsName);
if (target){
OptionalModelObject scheduleTypeLimits = translateAndMapWorkspaceObject(*target);
if (scheduleTypeLimits){
scheduleDay.setPointer(OS_Schedule_DayFields::ScheduleTypeLimitsName, scheduleTypeLimits->handle());
}
}
for(unsigned i = 0; i < 24; ++i){
OptionalDouble d = workspaceObject.getDouble(Schedule_Day_HourlyFields::Hour1 + i, true);
if (d){
scheduleDay.addValue(openstudio::Time(0,i+1,0,0), *d);
}
}
return scheduleDay;
}
示例4: coilSystemCoolingDXIdf
boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXTwoStageWithHumidityControlMode( model::CoilCoolingDXTwoStageWithHumidityControlMode & modelObject )
{
IdfObject coilSystemCoolingDXIdf(IddObjectType::CoilSystem_Cooling_DX);
m_idfObjects.push_back(coilSystemCoolingDXIdf);
boost::optional<IdfObject> oIdfObject = translateCoilCoolingDXTwoStageWithHumidityControlModeWithoutUnitary(modelObject);
if( ! oIdfObject ) { return boost::none; }
IdfObject idfObject = oIdfObject.get();
OptionalString s;
s = modelObject.name();
if( s )
{
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::CoolingCoilObjectType,idfObject.iddObject().name());
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::CoolingCoilName,*s);
coilSystemCoolingDXIdf.setName(*s + " CoilSystem");
}
if( auto sched = modelObject.availabilitySchedule() ) {
if( auto _sched = translateAndMapModelObject(sched.get()) ) {
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::AvailabilityScheduleName,_sched->name().get());
}
}
OptionalModelObject omo = modelObject.inletModelObject();
if( omo )
{
translateAndMapModelObject(*omo);
s = omo->name();
if(s)
{
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemInletNodeName,*s);
}
}
omo= modelObject.outletModelObject();
if( omo )
{
translateAndMapModelObject(*omo);
s = omo->name();
if(s)
{
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemOutletNodeName,*s);
coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemSensorNodeName,*s);
}
}
return coilSystemCoolingDXIdf;
}
开发者ID:urbanengr,项目名称:OpenStudio,代码行数:56,代码来源:ForwardTranslateCoilCoolingDXTwoStageWithHumidityControlMode.cpp
示例5: idfObject
boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACZoneSplitter( AirLoopHVACZoneSplitter & modelObject )
{
OptionalModelObject temp;
OptionalString optS;
std::string s;
IdfObject idfObject(openstudio::IddObjectType::AirLoopHVAC_ZoneSplitter);
m_idfObjects.push_back(idfObject);
///////////////////////////////////////////////////////////////////////////
// Field: Name ////////////////////////////////////////////////////////////
s = modelObject.name().get();
idfObject.setName(s);
///////////////////////////////////////////////////////////////////////////
// Field: Inlet Node Name /////////////////////////////////////////////////
temp = modelObject.inletModelObject();
if(temp)
{
optS = temp->name();
if(optS)
{
idfObject.setString(openstudio::AirLoopHVAC_ZoneSplitterFields::InletNodeName,*optS);
}
}
///////////////////////////////////////////////////////////////////////////
// Field: Outlet 1-N Node Name //////////////////////////////////////////////
std::vector<ModelObject> outletModelObjects = modelObject.outletModelObjects();
int i = 2;
for( const auto & outletModelObject : outletModelObjects )
{
if( OptionalAirTerminalSingleDuctUncontrolled airTerminal =
outletModelObject.optionalCast<AirTerminalSingleDuctUncontrolled>() )
{
temp = airTerminal->outletModelObject();
if(temp)
{
optS = temp->name().get();
if(optS)
idfObject.setString(i,*optS);
}
}
else
{
s = outletModelObject.name().get();
idfObject.setString(i,s);
}
i++;
}
return boost::optional<IdfObject>(idfObject);
}
示例6: idfObject
boost::optional<IdfObject> ForwardTranslator::translatePipeAdiabatic( PipeAdiabatic& modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
IdfObject idfObject(IddObjectType::Pipe_Adiabatic);
m_idfObjects.push_back(idfObject);
///////////////////////////////////////////////////////////////////////////
// Field: Name ////////////////////////////////////////////////////////////
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// Inlet Node Name ////////////////////////////////////////////////////
temp = modelObject.inletModelObject();
if(temp)
{
s = temp->name();
if(s)
{
idfObject.setString(openstudio::Pipe_AdiabaticFields::InletNodeName,*s);
}
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// Outlet Node Name ///////////////////////////////////////////////////
temp = modelObject.outletModelObject();
if(temp)
{
s = temp->name();
if(s)
{
idfObject.setString(openstudio::Pipe_AdiabaticFields::OutletNodeName,*s);
}
}
///
////////////////////////////////////////////////////////////////////////
return boost::optional<IdfObject>(idfObject);
}
示例7: idfObject
boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACZoneMixer( AirLoopHVACZoneMixer & modelObject )
{
std::string s;
OptionalString optS;
OptionalModelObject temp;
IdfObject idfObject(openstudio::IddObjectType::AirLoopHVAC_ZoneMixer);
m_idfObjects.push_back(idfObject);
///////////////////////////////////////////////////////////////////////////
// Field: Name ////////////////////////////////////////////////////////////
s = modelObject.name().get();
idfObject.setName(s);
////////////////////////////////////////////////////////////////////////////
// Field: Outlet Node Name /////////////////////////////////////////////////
temp = modelObject.outletModelObject();
if(temp)
{
optS = temp->name();
if(optS)
idfObject.setString(openstudio::AirLoopHVAC_ZoneMixerFields::OutletNodeName,*optS);
}
///////////////////////////////////////////////////////////////////////////
// Field: Inlet 1-N Node Name ///////////////////////////////////////////////
std::vector<ModelObject> inletModelObjects = modelObject.inletModelObjects();
int i = 2;
for( std::vector<ModelObject>::iterator it = inletModelObjects.begin();
it < inletModelObjects.end();
++it )
{
optS = it->name();
if(optS)
{
idfObject.setString(i,*optS);
}
i++;
}
return boost::optional<IdfObject>(idfObject);
}
示例8: LOG
OptionalModelObject ReverseTranslator::translateScheduleConstant( const WorkspaceObject & workspaceObject )
{
if( workspaceObject.iddObject().type() != IddObjectType::Schedule_Constant )
{
LOG(Error, "WorkspaceObject is not IddObjectType: Schedule:Constant");
return boost::none;
}
ScheduleConstant scheduleConstant(m_model);
boost::optional<WorkspaceObject> target = workspaceObject.getTarget(Schedule_ConstantFields::ScheduleTypeLimitsName);
if (target){
OptionalModelObject scheduleTypeLimits = translateAndMapWorkspaceObject(*target);
if (scheduleTypeLimits) {
scheduleConstant.setPointer(OS_Schedule_ConstantFields::ScheduleTypeLimitsName, scheduleTypeLimits->handle());
}
}
if (OptionalDouble val = workspaceObject.getDouble(Schedule_ConstantFields::HourlyValue)) {
scheduleConstant.setValue(*val);
}
return scheduleConstant;
}
示例9: if
boost::optional<IdfObject> ForwardTranslator::translateHumidifierSteamElectric( HumidifierSteamElectric & modelObject )
{
OptionalDouble d;
OptionalModelObject temp;
// Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Humidifier_Steam_Electric, modelObject);
// Availability Schedule Name
if( (temp = modelObject.availabilitySchedule()) )
{
if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(temp.get()) )
{
idfObject.setString(Humidifier_Steam_ElectricFields::AvailabilityScheduleName,_schedule->name().get());
}
}
// Rated Capacity
if( modelObject.isRatedCapacityAutosized() ) {
idfObject.setString(Humidifier_Steam_ElectricFields::RatedCapacity,"Autosize");
} if( (d = modelObject.ratedCapacity()) ) {
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedCapacity,d.get());
}
// Rated Power
if( (d = modelObject.ratedPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedPower,d.get());
}
else if( modelObject.isRatedPowerAutosized() )
{
idfObject.setString(Humidifier_Steam_ElectricFields::RatedPower,"Autosize");
}
// Rated Fan Power
if( (d = modelObject.ratedFanPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedFanPower,d.get());
}
// Standby Power
if( (d = modelObject.standbyPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::StandbyPower,d.get());
}
// Air Inlet Node Name
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(Humidifier_Steam_ElectricFields::AirInletNodeName,temp->name().get());
}
// Air Outlet Node Name
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(Humidifier_Steam_ElectricFields::AirOutletNodeName,temp->name().get());
}
// Water Storage Tank Name
// not currently used
return idfObject;
}
示例10: createRegisterAndNameIdfObject
boost::optional<IdfObject> ForwardTranslator::translateRefrigerationCondenserWaterCooled( RefrigerationCondenserWaterCooled & modelObject )
{
OptionalModelObject temp;
OptionalString optS;
boost::optional<std::string> s;
boost::optional<double> d;
// Name
IdfObject waterCooled = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_Condenser_WaterCooled, modelObject);
// Rated Effective Total Heat Rejection Rate
d = modelObject.ratedEffectiveTotalHeatRejectionRate();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedEffectiveTotalHeatRejectionRate,d.get());
}
// Rated Condensing Temperature
d = modelObject.ratedCondensingTemperature();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedCondensingTemperature,d.get());
}
// Rated Subcooling Temperature Difference
d = modelObject.ratedSubcoolingTemperatureDifference();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedSubcoolingTemperatureDifference,d.get());
}
// Rated Water Inlet Temperature
d = modelObject.ratedWaterInletTemperature();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedWaterInletTemperature,d.get());
}
// Water Inlet Node Name
if( (temp = modelObject.inletModelObject()) )
{
if(temp->name())
{
waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterInletNodeName,temp->name().get());
}
}
// Water Outlet Node Name
if( (temp = modelObject.outletModelObject()) )
{
if(temp->name())
{
waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterOutletNodeName,temp->name().get());
}
}
// Water-Cooled Loop Flow Type
s = modelObject.waterCooledLoopFlowType();
if (s) {
waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterCooledLoopFlowType,s.get());
}
// Water Outlet Temperature Schedule Name
boost::optional<Schedule> waterOutletTemperatureSchedule = modelObject.waterOutletTemperatureSchedule();
if( waterOutletTemperatureSchedule )
{
boost::optional<IdfObject> _waterOutletTemperatureSchedule = translateAndMapModelObject(waterOutletTemperatureSchedule.get());
if( _waterOutletTemperatureSchedule && _waterOutletTemperatureSchedule->name() )
{
waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterOutletTemperatureScheduleName,_waterOutletTemperatureSchedule->name().get());
}
}
// Water Design Flow Rate
d = modelObject.waterDesignFlowRate();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterDesignFlowRate,d.get());
}
// Water Maximum Flow Rate
d = modelObject.waterMaximumFlowRate();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMaximumFlowRate,d.get());
}
// Water Maximum Water Outlet Temperature
d = modelObject.waterMaximumWaterOutletTemperature();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMaximumWaterOutletTemperature,d.get());
}
// Water Minimum Water Inlet Temperature
d = modelObject.waterMinimumWaterInletTemperature();
if (d) {
waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMinimumWaterInletTemperature,d.get());
}
// End-Use Subcategory
s = modelObject.endUseSubcategory();
if (s) {
waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::EndUseSubcategory,s.get());
//.........这里部分代码省略.........
示例11: createRegisterAndNameIdfObject
boost::optional<IdfObject> ForwardTranslator::translateFanOnOff( FanOnOff & modelObject )
{
//setup boost optionals to use to store get method returns
boost::optional<std::string> s;
boost::optional<double> value;
boost::optional<Node> node;
OptionalModelObject mo;
// Make sure the modelObject gets ut into the map, and the new idfObject gets put into the final file.
// Also sets the idfObjects name
IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::Fan_OnOff,modelObject);
// Model Name
std::string baseName = modelObject.name().get();
// A3 ,Field Availability Schedule Name
Schedule availabilitySchedule = modelObject.availabilitySchedule();
translateAndMapModelObject(availabilitySchedule);
s = availabilitySchedule.name();
if(s)
{
idfObject.setString(Fan_OnOffFields::AvailabilityScheduleName,*s);
}
// N1 ,Field Fan Efficiency
value = modelObject.fanEfficiency();
if( value )
{
idfObject.setDouble(Fan_OnOffFields::FanEfficiency,*value);
}
// N2 Pressure Rise
value = modelObject.pressureRise();
if( value )
{
idfObject.setDouble(Fan_OnOffFields::PressureRise,*value);
}
// N3, Field Maximum Flow Rate
value = modelObject.maximumFlowRate();
if( value )
{
idfObject.setDouble(Fan_OnOffFields::MaximumFlowRate,*value);
}
else
{
idfObject.setString(Fan_OnOffFields::MaximumFlowRate,"Autosize");
}
// N4, Field Motor Efficiency
value = modelObject.motorEfficiency();
if( value )
{
idfObject.setDouble(Fan_OnOffFields::MotorEfficiency,*value);
}
// N5, Field Motor In Airstream Fraction
value = modelObject.motorInAirstreamFraction();
if( value )
{
idfObject.setDouble(Fan_OnOffFields::MotorInAirstreamFraction,*value);
}
// A4 Air Inlet Node Name
mo = modelObject.inletModelObject();
if(mo)
{
s = mo->name();
if(s)
{
idfObject.setString(openstudio::Fan_OnOffFields::AirInletNodeName,*s);
}
}
// A5 , Field Air Outlet Node Name
mo = modelObject.outletModelObject();
if(mo)
{
s = mo->name();
if(s)
{
idfObject.setString(openstudio::Fan_OnOffFields::AirOutletNodeName,*s);
}
//.........这里部分代码省略.........
示例12: idfObject
boost::optional<IdfObject> ForwardTranslator::translateCoolingTowerVariableSpeed( CoolingTowerVariableSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
IdfObject idfObject(IddObjectType::CoolingTower_VariableSpeed);
m_idfObjects.push_back(idfObject);
// Name
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::WaterOutletNodeName,temp->name().get());
}
// ModelType
if( s = modelObject.modelType() )
{
idfObject.setString(CoolingTower_VariableSpeedFields::ModelType,s.get());
}
// ModelCoefficient
if( boost::optional<ModelObject> mo = modelObject.modelCoefficient() )
{
if( boost::optional<IdfObject> _mo = translateAndMapModelObject(mo.get()) )
{
idfObject.setString(CoolingTower_VariableSpeedFields::ModelCoefficientName,_mo->name().get());
}
}
// DesignInletAirWetBulbTemperature
if( d = modelObject.designInletAirWetBulbTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignInletAirWetBulbTemperature,d.get());
}
// DesignApproachTemperature
if( d = modelObject.designApproachTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignApproachTemperature,d.get());
}
// DesignRangeTemperature
if( d = modelObject.designRangeTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignRangeTemperature,d.get());
}
// DesignWaterFlowRate
if( (d = modelObject.designWaterFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_VariableSpeedFields::DesignWaterFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::DesignWaterFlowRate,"Autosize");
}
// DesignAirFlowRate
if( (d = modelObject.designAirFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_VariableSpeedFields::DesignAirFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::DesignAirFlowRate,"Autosize");
}
// DesignFanPower
if( d = modelObject.designFanPower() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignFanPower,d.get());
}
//.........这里部分代码省略.........
示例13: if
boost::optional<IdfObject> ForwardTranslator::translateEvaporativeFluidCoolerTwoSpeed( EvaporativeFluidCoolerTwoSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
//Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::EvaporativeFluidCooler_TwoSpeed, modelObject);
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp) {
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp) {
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterOutletNodeName,temp->name().get());
}
// HighFanSpeedAirFlowRate
if( modelObject.isHighFanSpeedAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,"Autosize");
}
else if( (d = modelObject.highFanSpeedAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,d.get());
}
// HighFanSpeedFanPower
if( modelObject.isHighFanSpeedFanPowerAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,"Autosize");
}
else if( (d = modelObject.highFanSpeedFanPower()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,d.get());
}
// LowFanSpeedAirFlowRate
if( modelObject.isLowFanSpeedAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,"Autocalculate");
}
else if( (d = modelObject.lowFanSpeedAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,d.get());
}
// LowFanSpeedAirFlowRateSizingFactor
if( (d = modelObject.lowFanSpeedAirFlowRateSizingFactor()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRateSizingFactor,d.get());
}
// LowFanSpeedFanPower
if( modelObject.isLowFanSpeedFanPowerAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,"Autocalculate");
}
else if( (d = modelObject.lowFanSpeedFanPower()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,d.get());
}
// LowFanSpeedFanPowerSizingFactor
if( (d = modelObject.lowFanSpeedFanPowerSizingFactor()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPowerSizingFactor,d.get());
}
// DesignSprayWaterFlowRate
if( (d = modelObject.designSprayWaterFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignSprayWaterFlowRate,d.get());
}
// PerformanceInputMethod
if( (s = modelObject.performanceInputMethod()) )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::PerformanceInputMethod,s.get());
}
// OutdoorAirInletNodeName
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::OutdoorAirInletNodeName,"");
// HeatRejectionCapacityandNominalCapacitySizingRatio
if( (d = modelObject.heatRejectionCapacityandNominalCapacitySizingRatio()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HeatRejectionCapacityandNominalCapacitySizingRatio,d.get());
}
// HighSpeedStandardDesignCapacity
if( (d = modelObject.highSpeedStandardDesignCapacity()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighSpeedStandardDesignCapacity,d.get());
}
//.........这里部分代码省略.........
示例14: idfObject
boost::optional<IdfObject> ForwardTranslator::translateFanVariableVolume( FanVariableVolume& modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
// Create a new IddObjectType::Fan_VariableVolume
IdfObject idfObject(IddObjectType::Fan_VariableVolume);
m_idfObjects.push_back(idfObject);
// Field: Name ////////////////////////////////////////////////////////////
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
// AvailabilityScheduleName
if( boost::optional<model::AirLoopHVAC> airLoopHVAC = modelObject.airLoopHVAC() )
{
Schedule sched = airLoopHVAC->availabilitySchedule();
boost::optional<IdfObject> schedIdf = translateAndMapModelObject(sched);
if( schedIdf )
{
idfObject.setString(Fan_VariableVolumeFields::AvailabilityScheduleName,schedIdf->name().get());
}
}
else
{
Schedule sched = modelObject.availabilitySchedule();
translateAndMapModelObject(sched);
idfObject.setString(Fan_VariableVolumeFields::AvailabilityScheduleName,sched.name().get());
}
// Fan Efficiency /////////////////////////////////////////////////////////
idfObject.setDouble(openstudio::Fan_VariableVolumeFields::FanTotalEfficiency,modelObject.fanEfficiency());
// Pressure Rise //////////////////////////////////////////////////////////
idfObject.setDouble(openstudio::Fan_VariableVolumeFields::PressureRise,modelObject.pressureRise());
// Maximum Flow Rate //////////////////////////////////////////////////////
if( modelObject.isMaximumFlowRateAutosized() )
{
idfObject.setString(openstudio::Fan_VariableVolumeFields::MaximumFlowRate,"AutoSize");
}
else if( (d = modelObject.maximumFlowRate()) )
{
idfObject.setDouble(openstudio::Fan_VariableVolumeFields::MaximumFlowRate,d.get());
}
// FanPowerMinimumFlowRateInputMethod
if( (s = modelObject.fanPowerMinimumFlowRateInputMethod()) )
{
idfObject.setString(Fan_VariableVolumeFields::FanPowerMinimumFlowRateInputMethod,s.get());
}
// FanPowerMinimumFlowFraction
if( (d = modelObject.fanPowerMinimumFlowFraction()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerMinimumFlowFraction,d.get());
}
// FanPowerMinimumAirFlowRate
if( (d = modelObject.fanPowerMinimumAirFlowRate()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerMinimumAirFlowRate,d.get());
}
// Motor Efficiency ///////////////////////////////////////////////////////
idfObject.setDouble(openstudio::Fan_VariableVolumeFields::MotorEfficiency,modelObject.motorEfficiency());
// FanPowerCoefficient1
if( (d = modelObject.fanPowerCoefficient1()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient1,d.get());
}
// FanPowerCoefficient2
if( (d = modelObject.fanPowerCoefficient2()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient2,d.get());
}
// FanPowerCoefficient3
if( (d = modelObject.fanPowerCoefficient3()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient3,d.get());
}
// FanPowerCoefficient4
if( (d = modelObject.fanPowerCoefficient4()) )
{
idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient4,d.get());
//.........这里部分代码省略.........
示例15: LOG
OptionalModelObject ReverseTranslator::translateZoneHVACIdealLoadsAirSystem( const WorkspaceObject & workspaceObject )
{
if( workspaceObject.iddObject().type() != IddObjectType::ZoneHVAC_IdealLoadsAirSystem ) {
LOG(Error, "WorkspaceObject is not IddObjectType: ZoneHVAC:IdealLoadsAirSystem");
return boost::none;
}
ZoneHVACIdealLoadsAirSystem zoneHVACIdealLoadsAirSystem(m_model);
// name
boost::optional<std::string> s = workspaceObject.name();
if(s){
zoneHVACIdealLoadsAirSystem.setName(*s);
}
// availability schedule
OptionalWorkspaceObject target = workspaceObject.getTarget(ZoneHVAC_IdealLoadsAirSystemFields::AvailabilityScheduleName);
if (target){
OptionalModelObject availabilitySchedule = translateAndMapWorkspaceObject(*target);
if (availabilitySchedule){
zoneHVACIdealLoadsAirSystem.setPointer(OS_ZoneHVAC_IdealLoadsAirSystemFields::AvailabilityScheduleName, availabilitySchedule->handle());
}
}
// skip inlet and outlet node names - that should be done by the zone HVAC object translator
// maximum heating supply air temperature
OptionalDouble d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumHeatingSupplyAirTemperature);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumHeatingSupplyAirTemperature(*d);
}
// minimum cooling supply air temperature
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MinimumCoolingSupplyAirTemperature);
if (d){
zoneHVACIdealLoadsAirSystem.setMinimumCoolingSupplyAirTemperature(*d);
}
// maximum heating supply air humidity ratio
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumHeatingSupplyAirHumidityRatio);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumHeatingSupplyAirHumidityRatio(*d);
}
// minimum cooling supply air humidity ratio
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MinimumCoolingSupplyAirHumidityRatio);
if (d){
zoneHVACIdealLoadsAirSystem.setMinimumCoolingSupplyAirHumidityRatio(*d);
}
// heating limit
s = workspaceObject.getString(ZoneHVAC_IdealLoadsAirSystemFields::HeatingLimit);
if (s){
zoneHVACIdealLoadsAirSystem.setHeatingLimit(*s);
}
// maximum heating air flow rate
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumHeatingAirFlowRate);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumHeatingAirFlowRate(*d);
}
// maximum sensible heating capacity
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumSensibleHeatingCapacity);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumSensibleHeatingCapacity(*d);
}
// cooling limit
s = workspaceObject.getString(ZoneHVAC_IdealLoadsAirSystemFields::CoolingLimit);
if (s){
zoneHVACIdealLoadsAirSystem.setCoolingLimit(*s);
}
// maximum cooling airflow rate
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumCoolingAirFlowRate);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumCoolingAirFlowRate(*d);
}
// maximum total cooling capacity
d = workspaceObject.getDouble(ZoneHVAC_IdealLoadsAirSystemFields::MaximumTotalCoolingCapacity);
if (d){
zoneHVACIdealLoadsAirSystem.setMaximumTotalCoolingCapacity(*d);
}
// heating availability schedule
target = workspaceObject.getTarget(ZoneHVAC_IdealLoadsAirSystemFields::HeatingAvailabilityScheduleName);
if (target){
OptionalModelObject heatingAvailabilitySchedule = translateAndMapWorkspaceObject(*target);
if (heatingAvailabilitySchedule){
zoneHVACIdealLoadsAirSystem.setPointer(OS_ZoneHVAC_IdealLoadsAirSystemFields::HeatingAvailabilityScheduleName, heatingAvailabilitySchedule->handle());
}
}
// cooling availability schedule
target = workspaceObject.getTarget(ZoneHVAC_IdealLoadsAirSystemFields::CoolingAvailabilityScheduleName);
if (target){
OptionalModelObject coolingAvailabilitySchedule = translateAndMapWorkspaceObject(*target);
if (coolingAvailabilitySchedule){
//.........这里部分代码省略.........