@@ -4742,6 +4742,81 @@ Descriptor::Properties DbScanListDescriptor::getDBProperties(
47424742
47434743// ////////////////////////////////////////////////
47444744
4745+ DbScanPartitionDescriptor::DbScanPartitionDescriptor (odb::dbDatabase* db)
4746+ : BaseDbDescriptor<odb::dbScanPartition>(db)
4747+ {
4748+ }
4749+
4750+ std::string DbScanPartitionDescriptor::getName (std::any object) const
4751+ {
4752+ auto scan_partition = getObject (object);
4753+ return scan_partition->getName ();
4754+ }
4755+
4756+ std::string DbScanPartitionDescriptor::getTypeName () const
4757+ {
4758+ return " Scan Partition" ;
4759+ }
4760+
4761+ bool DbScanPartitionDescriptor::getBBox (std::any object, odb::Rect& bbox) const
4762+ {
4763+ auto scan_partition = getObject (object);
4764+ auto * scan_list_descriptor = Gui::get ()->getDescriptor <odb::dbScanList*>();
4765+ bbox.mergeInit ();
4766+
4767+ for (auto * scan_list : scan_partition->getScanLists ()) {
4768+ odb::Rect scan_list_bbox;
4769+ if (scan_list_descriptor->getBBox (scan_list, scan_list_bbox)) {
4770+ bbox.merge (scan_list_bbox);
4771+ }
4772+ }
4773+
4774+ return !bbox.isInverted ();
4775+ }
4776+
4777+ void DbScanPartitionDescriptor::highlight (std::any object,
4778+ Painter& painter) const
4779+ {
4780+ auto scan_partition = getObject (object);
4781+
4782+ for (auto * scan_list : scan_partition->getScanLists ()) {
4783+ auto * scan_list_descriptor = Gui::get ()->getDescriptor <odb::dbScanList*>();
4784+ scan_list_descriptor->highlight (scan_list, painter);
4785+ }
4786+ }
4787+
4788+ bool DbScanPartitionDescriptor::getAllObjects (SelectionSet& objects) const
4789+ {
4790+ auto * block = db_->getChip ()->getBlock ();
4791+ auto * db_dft = block->getDft ();
4792+
4793+ for (auto * scan_chain : db_dft->getScanChains ()) {
4794+ for (auto * scan_partition : scan_chain->getScanPartitions ()) {
4795+ objects.insert (makeSelected (scan_partition));
4796+ }
4797+ }
4798+
4799+ return true ;
4800+ }
4801+
4802+ Descriptor::Properties DbScanPartitionDescriptor::getDBProperties (
4803+ odb::dbScanPartition* scan_partition) const
4804+ {
4805+ Properties props;
4806+
4807+ auto gui = Gui::get ();
4808+
4809+ SelectionSet scan_lists;
4810+ for (odb::dbScanList* scan_list : scan_partition->getScanLists ()) {
4811+ scan_lists.insert (gui->makeSelected (scan_list));
4812+ }
4813+ props.push_back ({" Scan Lists" , scan_lists});
4814+
4815+ return props;
4816+ }
4817+
4818+ // ////////////////////////////////////////////////
4819+
47454820DbBoxDescriptor::DbBoxDescriptor (odb::dbDatabase* db)
47464821 : BaseDbDescriptor<odb::dbBox>(db)
47474822{
0 commit comments