本文整理汇总了C++中IdfExtensibleGroup::setUnsigned方法的典型用法代码示例。如果您正苦于以下问题:C++ IdfExtensibleGroup::setUnsigned方法的具体用法?C++ IdfExtensibleGroup::setUnsigned怎么用?C++ IdfExtensibleGroup::setUnsigned使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdfExtensibleGroup
的用法示例。
在下文中一共展示了IdfExtensibleGroup::setUnsigned方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startDate
boost::optional<IdfObject> ForwardTranslator::translateScheduleYear( ScheduleYear & modelObject )
{
IdfObject scheduleYear = createRegisterAndNameIdfObject(openstudio::IddObjectType::Schedule_Year,
modelObject);
std::vector<ScheduleWeek> scheduleWeeks = modelObject.scheduleWeeks();
std::vector<openstudio::Date> dates = modelObject.dates();
unsigned N = scheduleWeeks.size();
if( N != dates.size() )
{
LOG(Error,"Could not translate " << modelObject.briefDescription() << ", because the number of week schedules does not match the number of dates.");
return boost::none;
}
boost::optional<ScheduleTypeLimits> scheduleTypeLimits = modelObject.scheduleTypeLimits();
if (scheduleTypeLimits){
boost::optional<IdfObject> idfScheduleTypeLimits = translateAndMapModelObject(*scheduleTypeLimits);
if (idfScheduleTypeLimits){
scheduleYear.setString(Schedule_YearFields::ScheduleTypeLimitsName, idfScheduleTypeLimits->name().get());
}
}
openstudio::Date startDate(MonthOfYear::Jan, 1);
scheduleYear.clearExtensibleGroups();
for (unsigned i = 0; i < N; ++i){
IdfExtensibleGroup group = scheduleYear.pushExtensibleGroup();
boost::optional<IdfObject> idfScheduleWeek = translateAndMapModelObject(scheduleWeeks[i]);
if (idfScheduleWeek){
group.setString(Schedule_YearExtensibleFields::Schedule_WeekName, idfScheduleWeek->name().get());
}
group.setInt(Schedule_YearExtensibleFields::StartMonth, startDate.monthOfYear().value());
group.setUnsigned(Schedule_YearExtensibleFields::StartDay, startDate.dayOfMonth());
group.setInt(Schedule_YearExtensibleFields::EndMonth, dates[i].monthOfYear().value());
group.setUnsigned(Schedule_YearExtensibleFields::EndDay, dates[i].dayOfMonth());
startDate = dates[i] + openstudio::Time(1,0,0);
}
return scheduleYear;
}
示例2: idfObject
boost::optional<IdfObject> ForwardTranslator::translateZoneHVACEquipmentList( ZoneHVACEquipmentList & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
std::vector<ModelObject> objects = modelObject.equipment();
if (objects.empty()){
// do not write out this object
return boost::none;
}
IdfObject idfObject(IddObjectType::ZoneHVAC_EquipmentList);
// Name
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
for( std::vector<ModelObject>::iterator it = objects.begin();
it != objects.end();
it++ )
{
unsigned coolingPriority = modelObject.coolingPriority(*it);
unsigned heatingPriority = modelObject.heatingPriority(*it);
boost::optional<IdfObject> _equipment = translateAndMapModelObject(*it);
if( _equipment )
{
IdfExtensibleGroup eg = idfObject.pushExtensibleGroup();
eg.setString(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentObjectType,_equipment->iddObject().name());
eg.setString(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentName,_equipment->name().get());
eg.setUnsigned(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentCoolingSequence,coolingPriority);
eg.setUnsigned(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentHeatingorNoLoadSequence,heatingPriority);
}
}
m_idfObjects.push_back(idfObject);
return idfObject;
}
示例3: idfObject
boost::optional<IdfObject> ForwardTranslator::translateZoneHVACEquipmentList( ZoneHVACEquipmentList & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
std::vector<ModelObject> objects = modelObject.equipment();
if (objects.empty()){
// do not write out this object
return boost::none;
}
std::vector<ModelObject> coolingVector = modelObject.equipmentInCoolingOrder();
std::vector<ModelObject> heatingVector = modelObject.equipmentInHeatingOrder();
std::vector<ModelObject> airChillers;
std::vector<ModelObject> stdEquipment;
for( const auto & elem : objects )
{
if (boost::optional<RefrigerationAirChiller> airChiller = elem.optionalCast<RefrigerationAirChiller>()) {
airChillers.push_back(airChiller.get());
} else {
stdEquipment.push_back(elem);
}
}
boost::optional<RefrigerationAirChiller> airChiller;
std::map<ModelObject, unsigned> coolingMap;
unsigned chillerSetCoolingPriority = 0;
unsigned priority = 1;
int airChillerOffset = -1;
for( const auto & elem : coolingVector )
{
if (airChillers.size() > 0 && (airChiller = elem.optionalCast<RefrigerationAirChiller>()) )
{
if (chillerSetCoolingPriority == 0) {
chillerSetCoolingPriority = priority;
}
airChillerOffset++;
}
else {
coolingMap.insert ( std::pair<ModelObject,unsigned>(elem, ((airChillerOffset > 0) ? (priority - airChillerOffset) : priority) ) );
}
priority++;
}
std::map<ModelObject, unsigned> heatingMap;
unsigned chillerSetHeatingPriority = 0;
priority = 1;
airChillerOffset = -1;
for( const auto & elem : heatingVector )
{
if (airChillers.size() > 0 && (airChiller= elem.optionalCast<RefrigerationAirChiller>()) )
{
if (chillerSetHeatingPriority == 0) {
chillerSetHeatingPriority = priority;
}
airChillerOffset++;
}
else {
heatingMap.insert ( std::pair<ModelObject,unsigned>(elem, ((airChillerOffset > 0) ? (priority - airChillerOffset) : priority) ) );
}
priority++;
}
IdfObject idfObject(IddObjectType::ZoneHVAC_EquipmentList);
// Name
std::string name;
s = modelObject.thermalZone().name();
if(s)
{
name = s.get() + " Equipment List";
idfObject.setName(name);
}
for( auto & elem : stdEquipment )
{
unsigned coolingPriority = coolingMap[elem];
unsigned heatingPriority = heatingMap[elem];
boost::optional<IdfObject> _equipment = translateAndMapModelObject(elem);
if( _equipment && (! elem.optionalCast<ZoneVentilationDesignFlowRate>()) )
{
IdfExtensibleGroup eg = idfObject.pushExtensibleGroup();
eg.setString(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentObjectType,_equipment->iddObject().name());
eg.setString(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentName,_equipment->name().get());
eg.setUnsigned(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentCoolingSequence,coolingPriority);
eg.setUnsigned(ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentHeatingorNoLoadSequence,heatingPriority);
}
}
if (!airChillers.empty()) {
// ZoneHVAC:RefrigerationChillerSet
// Name
IdfObject _chillerSet(IddObjectType::ZoneHVAC_RefrigerationChillerSet);
//.........这里部分代码省略.........