2022-04-07 22:21:23 +00:00
|
|
|
#include "component_display.h"
|
|
|
|
#include "schema_display.h"
|
|
|
|
|
|
|
|
namespace display {
|
|
|
|
|
|
|
|
Schema::Schema()
|
|
|
|
{
|
|
|
|
this->setScene(&scene);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-08 22:51:47 +00:00
|
|
|
void Schema::setSchema(domain::Schema* _schema)
|
2022-04-07 22:21:23 +00:00
|
|
|
{
|
|
|
|
scene.clear();
|
2022-05-08 22:51:47 +00:00
|
|
|
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) {
|
2022-05-08 22:51:47 +00:00
|
|
|
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) {
|
2022-05-08 22:51:47 +00:00
|
|
|
if(instance->bus.getDisplay().has_value()) {
|
|
|
|
scene.addItem(new display::BusGroup(instance));
|
|
|
|
}
|
2022-04-07 22:21:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace display
|