psu-ng: Move analyze for PSUManager to cpp file
The analyze member function of the PSUManager class is a bit lengthy,
and will have more code added in later commits. Moving it from the
header file to the source file.
Also making the namespace a one liner, since multi-line naming not
really needed (at this time).
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Ieb8c3343837ae6b5a633dcdb827f3c180156e4f1
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 83fddd4..0fcd566 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -4,11 +4,7 @@
using namespace phosphor::logging;
-namespace phosphor
-{
-namespace power
-{
-namespace manager
+namespace phosphor::power::manager
{
PSUManager::PSUManager(sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
@@ -129,6 +125,34 @@
}
}
-} // namespace manager
-} // namespace power
-} // namespace phosphor
+void PSUManager::analyze()
+{
+ for (auto& psu : psus)
+ {
+ psu->analyze();
+ }
+
+ for (auto& psu : psus)
+ {
+ // TODO: Fault priorities #918
+ if (!faultLogged && psu->isFaulted())
+ {
+ if (psu->hasInputFault())
+ {
+ // TODO: Create error log
+ }
+
+ if (psu->hasMFRFault())
+ {
+ // TODO: Create error log
+ }
+
+ if (psu->hasVINUVFault())
+ {
+ // TODO: Create error log
+ }
+ }
+ }
+}
+
+} // namespace phosphor::power::manager