Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion parseagle/schematic/bus.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@

namespace parseagle {

Bus::Bus(const DomElement& root)
Bus::Bus(const DomElement& root, QStringList* errors)
{
mName = root.getAttributeAsString("name");
foreach (const DomElement& child, root.getChilds()) {
if (child.getTagName() == "segment") {
mSegments.append(Segment(child, errors));
} else if (errors) {
errors->append("Unknown bus child: " + child.getTagName());
}
}
}

Bus::~Bus() noexcept
Expand Down
5 changes: 4 additions & 1 deletion parseagle/schematic/bus.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PARSEAGLE_BUS_H

#include <QtCore>
#include "segment.h"

namespace parseagle {

Expand All @@ -13,15 +14,17 @@ class Bus final

// Constructors / Destructor
Bus() = delete;
explicit Bus(const DomElement& root);
explicit Bus(const DomElement& root, QStringList* errors = nullptr);
~Bus() noexcept;

// Getters
const QString& getName() const noexcept {return mName;}
const QList<Segment>& getSegments() const noexcept {return mSegments;}


private:
QString mName;
QList<Segment> mSegments;
};

} // namespace parseagle
Expand Down
2 changes: 1 addition & 1 deletion parseagle/schematic/sheet.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Sheet::Sheet(const DomElement& root, QStringList* errors)
}
} else if (child.getTagName() == "busses") {
foreach (const DomElement& busChild, child.getChilds()) {
mBuses.append(Bus(busChild));
mBuses.append(Bus(busChild, errors));
}
} else if (child.getTagName() == "nets") {
foreach (const DomElement& netChild, child.getChilds()) {
Expand Down
Loading