MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / TEST_F

Function TEST_F

src/model/test/ExternalInterfaceActuator_GTest.cpp:29–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using std::string;
28
29TEST_F(ModelFixture, ExternalInterfaceActuator) {
30 Model model;
31
32 Building building = model.getUniqueModelObject<Building>();
33
34 ThermalZone zone1(model);
35 ThermalZone zone2(model);
36
37 // add fan
38 Schedule s = model.alwaysOnDiscreteSchedule();
39 FanConstantVolume fan(model, s);
40 FanConstantVolume fan2(model, s);
41
42 // add actuator
43 std::string fanControlType = "Fan Pressure Rise";
44 std::string ComponentType = "Fan";
45 ExternalInterfaceActuator fanActuator(fan, ComponentType, fanControlType);
46 EXPECT_EQ(fanControlType, fanActuator.actuatedComponentControlType());
47 EXPECT_EQ(ComponentType, fanActuator.actuatedComponentType());
48
49 std::string fanName = fan.name().get() + "Press Actuator";
50 fanActuator.setName(fanName);
51
52 fanActuator.setActuatedComponentControlType(fanControlType);
53
54 EXPECT_EQ(fan, fanActuator.actuatedComponentUnique());
55 EXPECT_EQ(fanControlType, fanActuator.actuatedComponentControlType());
56
57 fanActuator.setActuatedComponentType(ComponentType);
58 EXPECT_EQ(ComponentType, fanActuator.actuatedComponentType());
59
60 fanActuator.setActuatedComponentUnique(fan2);
61 EXPECT_EQ(fan2, fanActuator.actuatedComponentUnique());
62
63 EXPECT_FALSE(fanActuator.optionalInitialValue());
64 fanActuator.setOptionalInitialValue(1);
65 EXPECT_EQ(1.0, fanActuator.optionalInitialValue().get());
66 fanActuator.resetOptionalInitialValue();
67 EXPECT_FALSE(fanActuator.optionalInitialValue());
68
69 //add electric equipment actuator
70 ElectricEquipmentDefinition definition(model);
71 ElectricEquipment electricEquipment(definition);
72 ComponentType = "ElectricEquipment";
73 std::string equipControlType = "Electricity Rate";
74 ExternalInterfaceActuator equipActuator(electricEquipment, ComponentType, equipControlType);
75 EXPECT_EQ(equipControlType, equipActuator.actuatedComponentControlType());
76 EXPECT_EQ(ComponentType, equipActuator.actuatedComponentType());
77 //Check BCVTB
78 EXPECT_TRUE(equipActuator.exportToBCVTB());
79 EXPECT_TRUE(equipActuator.isExportToBCVTBDefaulted());
80 equipActuator.setExportToBCVTB(false);
81 EXPECT_FALSE(equipActuator.exportToBCVTB());
82 equipActuator.resetExportToBCVTB();
83 EXPECT_TRUE(equipActuator.exportToBCVTB());
84
85 std::string equipName = electricEquipment.name().get() + "power level Actuator";
86 equipActuator.setName(equipName);

Callers

nothing calls this directly

Calls 15

optionalInitialValueMethod · 0.80
actuatedComponentTypeMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected