schema_editor/comdel/display/schema_display.cpp

29 lines
620 B
C++
Raw Normal View History

2022-04-07 22:21:23 +00:00
#include "component_display.h"
#include "schema_display.h"
namespace display {
Schema::Schema()
{
this->setScene(&scene);
}
void Schema::setSchema(domain::Schema* _schema)
2022-04-07 22:21:23 +00:00
{
scene.clear();
this->schema = _schema;
2022-04-18 09:41:02 +00:00
if(schema != nullptr) {
2022-05-07 11:20:09 +00:00
for(auto &instance: schema->componentInstances) {
scene.addItem(new display::ComponentGroup(instance));
2022-04-07 22:21:23 +00:00
}
2022-05-07 11:20:09 +00:00
for(auto &instance: schema->busInstances) {
if(instance->bus.getDisplay().has_value()) {
scene.addItem(new display::BusGroup(instance));
}
2022-04-07 22:21:23 +00:00
}
}
}
} // namespace display