本文整理汇总了C++中OptionalSpace::thermalZone方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionalSpace::thermalZone方法的具体用法?C++ OptionalSpace::thermalZone怎么用?C++ OptionalSpace::thermalZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionalSpace
的用法示例。
在下文中一共展示了OptionalSpace::thermalZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translateDaylightingControls
OptionalModelObject ReverseTranslator::translateDaylightingControls( const WorkspaceObject & workspaceObject )
{
if( workspaceObject.iddObject().type() != IddObjectType::Daylighting_Controls ){
LOG(Error, "WorkspaceObject is not IddObjectType: Daylighting:Controls");
return boost::none;
}
DaylightingControl daylightingControl(m_model);
OptionalThermalZone thermalZone;
OptionalSpace space;
OptionalWorkspaceObject target = workspaceObject.getTarget(Daylighting_ControlsFields::ZoneName);
if (target){
OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
if (modelObject){
if (modelObject->optionalCast<Space>()){
space = modelObject->cast<Space>();
thermalZone = space->thermalZone();
}
}
}
if (space){
daylightingControl.setSpace(*space);
}
if (thermalZone){
thermalZone->setPrimaryDaylightingControl(daylightingControl);
}
OptionalDouble d = workspaceObject.getDouble(Daylighting_ControlsFields::XCoordinateofFirstReferencePoint);
if (d){
daylightingControl.setPositionXCoordinate(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::YCoordinateofFirstReferencePoint);
if (d){
daylightingControl.setPositionYCoordinate(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::ZCoordinateofFirstReferencePoint);
if (d){
daylightingControl.setPositionZCoordinate(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::FractionofZoneControlledbyFirstReferencePoint);
if (d && thermalZone){
thermalZone->setFractionofZoneControlledbyPrimaryDaylightingControl(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::IlluminanceSetpointatFirstReferencePoint);
if (d){
daylightingControl.setIlluminanceSetpoint(*d);
}
OptionalInt i = workspaceObject.getInt(Daylighting_ControlsFields::LightingControlType);
if (i){
switch (*i){
case 1:
daylightingControl.setLightingControlType("Continuous");
break;
case 2:
daylightingControl.setLightingControlType("Stepped");
break;
case 3:
daylightingControl.setLightingControlType("Continuous/Off");
break;
default:
;
}
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::GlareCalculationAzimuthAngleofViewDirectionClockwisefromZoneyAxis);
if (d){
daylightingControl.setThetaRotationAroundYAxis( -degToRad(*d) );
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::MaximumAllowableDiscomfortGlareIndex);
if (d){
daylightingControl.setMaximumAllowableDiscomfortGlareIndex(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::MinimumInputPowerFractionforContinuousDimmingControl);
if (d){
daylightingControl.setMinimumInputPowerFractionforContinuousDimmingControl(*d);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::MinimumLightOutputFractionforContinuousDimmingControl);
if (d){
daylightingControl.setMinimumLightOutputFractionforContinuousDimmingControl(*d);
}
i = workspaceObject.getInt(Daylighting_ControlsFields::NumberofSteppedControlSteps);
if (i){
daylightingControl.setNumberofSteppedControlSteps(*i);
}
d = workspaceObject.getDouble(Daylighting_ControlsFields::ProbabilityLightingwillbeResetWhenNeededinManualSteppedControl);
if (d){
daylightingControl.setProbabilityLightingwillbeResetWhenNeededinManualSteppedControl(*d);
//.........这里部分代码省略.........
示例2: translateAirLoopHVAC
//.........这里部分代码省略.........
// ZoneHVAC:Baseboard:RadiantConvective:Electric
// ZoneHVAC:Baseboard:RadiantConvective:Water
// ZoneHVAC:Baseboard:RadiantConvective:Steam
// ZoneHVAC:Baseboard:Convective:Electric
// ZoneHVAC:Baseboard:Convective:Water
// ZoneHVAC:HighTemperatureRadiant
// ZoneHVAC:LowTemperatureRadiant:VariableFlow
// ZoneHVAC:LowTemperatureRadiant:ConstantFlow
// ZoneHVAC:LowTemperatureRadiant:Electric
// ZoneHVAC:Dehumidifier:DX
// ZoneHVAC:IdealLoadsAirSystem
// Fan:ZoneExhaust
// WaterHeater:HeatPump
//
if( zoneEquipmentName )
{
if( istringEqual(optionalString.get(),"AirTerminal:SingleDuct:Uncontrolled") )
{
_airTerminal = _workspace.getObjectByTypeAndName(IddObjectType::AirTerminal_SingleDuct_Uncontrolled,zoneEquipmentName.get());
break;
}
else if( istringEqual(optionalString.get(),"ZoneHVAC:AirDistributionUnit") )
{
boost::optional<WorkspaceObject> _airDistributionUnit =
_workspace.getObjectByTypeAndName(IddObjectType::ZoneHVAC_AirDistributionUnit,zoneEquipmentName.get());
if( _airDistributionUnit )
{
boost::optional<std::string> airUnitName;
boost::optional<std::string> airUnitType;
airUnitType = _airDistributionUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalObjectType);
airUnitName = _airDistributionUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalName);
if( airUnitName && airUnitType )
{
_airTerminal = _workspace.getObjectByTypeAndName(IddObjectType(airUnitType.get()),airUnitName.get());
}
}
break;
}
}
}
OptionalModelObject airTerminalModelObject;
OptionalSpace space;
OptionalStraightComponent straightComponent;
OptionalThermalZone thermalZone;
if( _airTerminal )
{
airTerminalModelObject = translateAndMapWorkspaceObject( _airTerminal.get() );
}
if( _zone )
{
if( OptionalModelObject mo = translateAndMapWorkspaceObject( _zone.get() ) )
{
space = mo->optionalCast<Space>();
}
}
if( space )
{
thermalZone = space->thermalZone();
}
if( airTerminalModelObject )
{
straightComponent = airTerminalModelObject->optionalCast<StraightComponent>();
}
bool success = false;
if( straightComponent && thermalZone )
{
success = airLoopHVAC.addBranchForZone(thermalZone.get(),straightComponent.get());
}
else if( thermalZone )
{
Model m;
success = airLoopHVAC.addBranchForZone(thermalZone.get(),boost::none);
}
if( success )
{
if( inletAirNodeName ) { thermalZone->inletPortList().airLoopHVACModelObject()->cast<Node>().setName(inletAirNodeName.get()); }
if( returnAirNodeName ) { thermalZone->returnAirModelObject()->cast<Node>().setName(returnAirNodeName.get()); }
}
}
}
}
}
}
return airLoopHVAC;
}