Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Oct 10, 2024
1 parent f0f892e commit 810224f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/alfalfa/AlfalfaActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ namespace alfalfa {
}

bool AlfalfaActuator::acceptsObjectType(const IddObjectType& idd_type) {
return idd_type.value() == IddObjectType::OS_EnergyManagementSystem_Actuator ||
idd_type.value() == IddObjectType::EnergyManagementSystem_Actuator;
return idd_type.value() == IddObjectType::OS_EnergyManagementSystem_Actuator
|| idd_type.value() == IddObjectType::EnergyManagementSystem_Actuator;
}
} // namespace alfalfa
} // namespace openstudio
4 changes: 2 additions & 2 deletions src/alfalfa/AlfalfaGlobalVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ namespace alfalfa {
}

bool AlfalfaGlobalVariable::acceptsObjectType(const IddObjectType& idd_type) {
return idd_type.value() == IddObjectType::OS_EnergyManagementSystem_GlobalVariable ||
idd_type.value() == IddObjectType::EnergyManagementSystem_GlobalVariable;
return idd_type.value() == IddObjectType::OS_EnergyManagementSystem_GlobalVariable
|| idd_type.value() == IddObjectType::EnergyManagementSystem_GlobalVariable;
}
} // namespace alfalfa
} // namespace openstudio
2 changes: 1 addition & 1 deletion src/alfalfa/AlfalfaJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace alfalfa {

boost::optional<AlfalfaComponent> component;
try {
if(AlfalfaActuator::acceptsObjectType(idd_type)) {
if (AlfalfaActuator::acceptsObjectType(idd_type)) {
component = AlfalfaActuator(idf_object);
} else if (AlfalfaMeter::acceptsObjectType(idd_type)) {
component = AlfalfaMeter(idf_object);
Expand Down
3 changes: 1 addition & 2 deletions src/alfalfa/AlfalfaMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ namespace alfalfa {
}

bool AlfalfaMeter::acceptsObjectType(const IddObjectType& idd_type) {
return idd_type.value() == IddObjectType::OS_Output_Meter ||
idd_type.value() == IddObjectType::Output_Meter;
return idd_type.value() == IddObjectType::OS_Output_Meter || idd_type.value() == IddObjectType::Output_Meter;
}

} // namespace alfalfa
Expand Down
7 changes: 3 additions & 4 deletions src/alfalfa/AlfalfaOutputVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ namespace alfalfa {
}

bool AlfalfaOutputVariable::acceptsObjectType(const IddObjectType& idd_type) {
return idd_type.value() == IddObjectType::OS_Output_Variable ||
idd_type.value() == IddObjectType::Output_Variable ||
idd_type.value() == IddObjectType::EnergyManagementSystem_OutputVariable ||
idd_type.value() == IddObjectType::OS_EnergyManagementSystem_OutputVariable;
return idd_type.value() == IddObjectType::OS_Output_Variable || idd_type.value() == IddObjectType::Output_Variable
|| idd_type.value() == IddObjectType::EnergyManagementSystem_OutputVariable
|| idd_type.value() == IddObjectType::OS_EnergyManagementSystem_OutputVariable;
}

} // namespace alfalfa
Expand Down
48 changes: 24 additions & 24 deletions src/alfalfa/test/AlfalfaJSON_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ TEST(AlfalfaJSON, basic_export) {
AlfalfaJSON alfalfa;
AlfalfaPoint constant = alfalfa.exposeConstant(17, "hello").get();


// Check that point has output of type "Constant"
ASSERT_TRUE(constant.output().is_initialized());
EXPECT_EQ(constant.output().get().typeName(), "Constant");
Expand Down Expand Up @@ -303,29 +302,30 @@ TEST(AlfalfaJSON, point_exceptions_logging) {
ASSERT_EQ(ss.logMessages().size(), 0);
}

class InputComponent : public ComponentBase {
public:
InputComponent() = default;
ComponentCapability capability() const override {
return ComponentCapability::Input;
}

openstudio::alfalfa::ComponentType type() const override {
return openstudio::alfalfa::ComponentType::Constant;
}

std::unique_ptr<ComponentBase> clone() const override {
return std::make_unique<InputComponent>(*this);
}

std::string deriveName() const override {
return "";
}

Json::Value toJSON() const override {
Json::Value parameters;
return parameters;
}
class InputComponent : public ComponentBase
{
public:
InputComponent() = default;
ComponentCapability capability() const override {
return ComponentCapability::Input;
}

openstudio::alfalfa::ComponentType type() const override {
return openstudio::alfalfa::ComponentType::Constant;
}

std::unique_ptr<ComponentBase> clone() const override {
return std::make_unique<InputComponent>(*this);
}

std::string deriveName() const override {
return "";
}

Json::Value toJSON() const override {
Json::Value parameters;
return parameters;
}
};

TEST(AlfalfaJSON, point_component_exceptions) {
Expand Down

0 comments on commit 810224f

Please sign in to comment.