本文整理汇总了C++中IdfExtensibleGroup类的典型用法代码示例。如果您正苦于以下问题:C++ IdfExtensibleGroup类的具体用法?C++ IdfExtensibleGroup怎么用?C++ IdfExtensibleGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IdfExtensibleGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getExtensibleGroup
boost::optional<std::string> UtilityCost_Computation_Impl::computeStep(unsigned index) const {
IdfExtensibleGroup eg = getExtensibleGroup(index);
if (!eg.empty()) {
return eg.getString(OS_UtilityCost_ComputationExtensibleFields::ComputeStep,true);
}
return boost::none;
}
示例2: TEST_F
TEST_F(ModelFixture, ComponentWatcher_InComponent) {
// create Component. ComponentWatcher should work here too (since Component is Model)
Model model;
DesignDay designDay(model);
EXPECT_EQ(1u,model.numObjects());
Component designDayComponent = designDay.createComponent();
EXPECT_EQ(2u,designDayComponent.numObjects());
ComponentData cd = designDayComponent.componentData();
UUID versionUUID = cd.versionUUID();
designDay = designDayComponent.primaryObject().cast<DesignDay>();
// data changes ok--changes version
EXPECT_TRUE(designDay.setName("My Design Day"));
EXPECT_NE(versionUUID,cd.versionUUID());
versionUUID = cd.versionUUID();
// trying to assign contents results in refresh of contents
IdfExtensibleGroup eg = cd.getExtensibleGroup(0);
ASSERT_FALSE(eg.empty());
std::string originalValue = eg.getString(0).get();
EXPECT_FALSE(eg.setString(0,"Material"));
EXPECT_TRUE(cd.initialized());
EXPECT_EQ(2u,designDayComponent.numObjects());
EXPECT_EQ(originalValue,eg.getString(0).get());
}
示例3: supplyPathIdf
boost::optional<IdfObject> ForwardTranslator::createAirLoopHVACSupplyPath( const Node & demandInletNode )
{
boost::optional<IdfObject> supplyPathIdf;
if( auto t_airLoopHVAC = demandInletNode.airLoopHVAC() ) {
IdfObject supplyPathIdf(openstudio::IddObjectType::AirLoopHVAC_SupplyPath);
m_idfObjects.push_back(supplyPathIdf);
supplyPathIdf.setName(t_airLoopHVAC->name().get() + " " + demandInletNode.name().get() + " Supply Path");
supplyPathIdf.setString(openstudio::AirLoopHVAC_SupplyPathFields::SupplyAirPathInletNodeName,demandInletNode.name().get());
auto t_comps = t_airLoopHVAC->demandComponents(demandInletNode,t_airLoopHVAC->demandOutletNode());
auto splitters = subsetCastVector<model::AirLoopHVACZoneSplitter>(t_comps);
OS_ASSERT(splitters.size() == 1u);
boost::optional<IdfObject> _zoneSplitter = translateAndMapModelObject(splitters.front());
OS_ASSERT(_zoneSplitter);
IdfExtensibleGroup eg = supplyPathIdf.pushExtensibleGroup();
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType,_zoneSplitter->iddObject().name());
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName,_zoneSplitter->name().get());
std::vector<ModelObject> supplyPlenums = t_airLoopHVAC->demandComponents(demandInletNode,t_airLoopHVAC->demandOutletNode(),AirLoopHVACSupplyPlenum::iddObjectType());
for( auto & supplyPlenum : supplyPlenums )
{
eg = supplyPathIdf.pushExtensibleGroup();
boost::optional<IdfObject> _supplyPlenum = translateAndMapModelObject(supplyPlenum);
OS_ASSERT(_supplyPlenum);
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType,_supplyPlenum->iddObject().name());
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName,_supplyPlenum->name().get());
}
}
return supplyPathIdf;
}
示例4: getExtensibleGroup
boost::optional<std::string> UtilityCost_Charge_Block_Impl::blockCostPerUnitValueOrVariableName(unsigned index) const {
IdfExtensibleGroup eg = getExtensibleGroup(index);
if (!eg.empty()) {
return eg.getString(OS_UtilityCost_Charge_BlockExtensibleFields::BlockCostperUnitValueorVariableName,true);
}
return boost::none;
}
示例5: supplyPathIdf
boost::optional<IdfObject> ForwardTranslator::createAirLoopHVACSupplyPath( AirLoopHVAC & airLoopHVAC )
{
std::string s;
IdfObject supplyPathIdf(openstudio::IddObjectType::AirLoopHVAC_SupplyPath);
m_idfObjects.push_back(supplyPathIdf);
supplyPathIdf.setName(airLoopHVAC.name().get() + " Supply Path");
model::Node node = airLoopHVAC.demandInletNode();
supplyPathIdf.setString(openstudio::AirLoopHVAC_SupplyPathFields::SupplyAirPathInletNodeName,node.name().get());
model::AirLoopHVACZoneSplitter zoneSplitter = airLoopHVAC.zoneSplitter();
boost::optional<IdfObject> _zoneSplitter = translateAndMapModelObject(zoneSplitter);
OS_ASSERT(_zoneSplitter);
IdfExtensibleGroup eg = supplyPathIdf.pushExtensibleGroup();
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType,_zoneSplitter->iddObject().name());
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName,_zoneSplitter->name().get());
std::vector<ModelObject> supplyPlenums = airLoopHVAC.demandComponents(AirLoopHVACSupplyPlenum::iddObjectType());
for( std::vector<ModelObject>::iterator it = supplyPlenums.begin();
it != supplyPlenums.end();
it++ )
{
eg = supplyPathIdf.pushExtensibleGroup();
boost::optional<IdfObject> _supplyPlenum = translateAndMapModelObject(*it);
OS_ASSERT(_supplyPlenum);
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType,_supplyPlenum->iddObject().name());
eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName,_supplyPlenum->name().get());
}
return boost::optional<IdfObject>(supplyPathIdf);
}
示例6: OS_ASSERT
bool LayeredConstruction_Impl::insertLayer(unsigned layerIndex,
const Material& material)
{
OS_ASSERT(material.model() == model());
layerIndex = mf_clearNullLayers(layerIndex);
unsigned n = numLayers();
MaterialVector layers = this->layers();
MaterialVector::iterator layersBegin = layers.begin();
MaterialVector::iterator layersEnd = layers.end();
MaterialVector::iterator insertAtIt = layersBegin;
while ((static_cast<unsigned>(insertAtIt - layersBegin) < layerIndex) &&
(insertAtIt != layersEnd))
{ ++insertAtIt; }
layers.insert(insertAtIt, material);
OS_ASSERT(layers.size() == ++n);
if ((model().strictnessLevel() < StrictnessLevel::Final) ||
LayeredConstruction::layersAreValid(layers))
{
IdfExtensibleGroup idfGroup = insertExtensibleGroup(layerIndex,StringVector());
OS_ASSERT(!idfGroup.empty());
ModelExtensibleGroup group = idfGroup.cast<ModelExtensibleGroup>();
bool ok = group.setPointer(0,material.handle());
OS_ASSERT(ok);
return true;
}
return false;
}
示例7: getExtensibleGroup
boost::optional<double> LifeCycleCostUsePriceEscalation_Impl::yearEscalation(unsigned index) const
{
IdfExtensibleGroup eg = getExtensibleGroup(index);
if (!eg.empty()) {
return eg.getDouble(OS_LifeCycleCost_UsePriceEscalationExtensibleFields::YearEscalation,true);
}
return boost::none;
}
示例8: getExtensibleGroup
ClimateZone ClimateZones_Impl::getClimateZone(unsigned index) const {
IdfExtensibleGroup eg = getExtensibleGroup(index);
if (eg.empty()) {
std::shared_ptr<ClimateZones_Impl> p;
return ClimateZone(p,numFields());
}
return eg.cast<ClimateZone>();
}
示例9: getExtensibleGroup
boost::optional<std::string> PeopleDefinition_Impl::getThermalComfortModelType(int i) const {
OptionalString result;
if (i < numThermalComfortModelTypes()) {
IdfExtensibleGroup eg = getExtensibleGroup(i);
OS_ASSERT(!eg.empty());
result = eg.getString(OS_People_DefinitionExtensibleFields::ThermalComfortModelType,true);
}
return result;
}
示例10: pushExtensibleGroup
bool ComponentData_Impl::registerObject(const ModelObject& object) {
IdfExtensibleGroup eg = pushExtensibleGroup(StringVector());
bool result = !eg.empty();
if (result) {
ModelExtensibleGroup meg = eg.cast<ModelExtensibleGroup>();
result = result && meg.setPointer(OS_ComponentDataExtensibleFields::NameofObject,
object.handle());
}
return result;
}
示例11: createRegisterAndNameIdfObject
boost::optional<IdfObject> ForwardTranslator::translateScheduleDay( ScheduleDay & modelObject )
{
IdfObject scheduleDay = createRegisterAndNameIdfObject(openstudio::IddObjectType::Schedule_Day_Interval,
modelObject);
boost::optional<ScheduleTypeLimits> scheduleTypeLimits = modelObject.scheduleTypeLimits();
if (scheduleTypeLimits){
boost::optional<IdfObject> idfScheduleTypeLimits = translateAndMapModelObject(*scheduleTypeLimits);
if (idfScheduleTypeLimits){
scheduleDay.setString(Schedule_Day_IntervalFields::ScheduleTypeLimitsName, idfScheduleTypeLimits->name().get());
}
}
if (modelObject.interpolatetoTimestep()){
scheduleDay.setString(Schedule_Day_IntervalFields::InterpolatetoTimestep, "Yes");
}else{
scheduleDay.setString(Schedule_Day_IntervalFields::InterpolatetoTimestep, "No");
}
std::vector<double> values = modelObject.values();
std::vector<openstudio::Time> times = modelObject.times();
unsigned N = values.size();
OS_ASSERT(N == times.size());
scheduleDay.clearExtensibleGroups();
for (unsigned i = 0; i < N; ++i){
IdfExtensibleGroup group = scheduleDay.pushExtensibleGroup();
std::string hourPrefix;
std::string minutePrefix;
int hours = times[i].hours() + 24*times[i].days();
if (hours < 10){
hourPrefix = "0";
}
int minutes = times[i].minutes() + floor((times[i].seconds()/60.0) + 0.5);
if (minutes < 10){
minutePrefix = "0";
}
std::stringstream ss;
ss << hourPrefix << hours << ":" << minutePrefix << minutes;
group.setString(Schedule_Day_IntervalExtensibleFields::Time, ss.str());
group.setDouble(Schedule_Day_IntervalExtensibleFields::ValueUntilTime, values[i]);
}
return scheduleDay;
}
示例12: extensibleGroups
bool EnergyManagementSystemProgramCallingManager_Impl::setProgram(const EnergyManagementSystemProgram& program, unsigned index) {
//add program to {index} of vector of programs
bool result = false;
auto groups = extensibleGroups();
unsigned sizeOfGroup = numExtensibleGroups();
if (index <= sizeOfGroup) {
IdfExtensibleGroup idfGroup = insertExtensibleGroup(index, StringVector());
OS_ASSERT(!idfGroup.empty());
ModelExtensibleGroup group = idfGroup.cast<ModelExtensibleGroup>();
result = group.setPointer(0, program.handle());
}
return result;
}
示例13: numThermalComfortModelTypes
bool PeopleDefinition_Impl::setThermalComfortModelType(
int i, const std::string& thermalComfortModelType)
{
int n = numThermalComfortModelTypes();
if (i == n) {
return pushThermalComfortModelType(thermalComfortModelType);
}
if (i < n) {
IdfExtensibleGroup eg = getExtensibleGroup(i);
OS_ASSERT(!eg.empty());
return eg.setString(OS_People_DefinitionExtensibleFields::ThermalComfortModelType,
thermalComfortModelType);
}
return false;
}
示例14: 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;
}
示例15: pushExtensibleGroup
ClimateZone ClimateZones_Impl::appendClimateZone(const std::string& institution,
const std::string documentName,
unsigned year,
const std::string& value)
{
StringVector values;
values.push_back(institution);
values.push_back(documentName);
std::stringstream ss;
ss << year;
values.push_back(ss.str());
values.push_back(value);
IdfExtensibleGroup eg = pushExtensibleGroup(values);
if (eg.empty()) {
std::shared_ptr<ClimateZones_Impl> p;
return ClimateZone(p,numFields());
}
return eg.cast<ClimateZone>();
}