You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature idea: auto-generate cabinet placement thumbnails from manufacturer/reference info
#602
Physically laying out a cabinet/panel (as opposed to drawing the schematic) means placing a small representative block for every device that needs a slot — sized/labeled by manufacturer and reference. Today there's no shortcut from "I've entered this device's manufacturer + reference on the schematic" to "here's a placeable block for it" — a user has to hand-author a placement symbol from scratch for every distinct device, even though the schematic element they're placing already carries the exact information (manufacturer, reference) that block needs to show.
What exists today — closer than it looks
ElementData::Type already has a dedicated Thumbnail value (elementdata.h:40-50, = 64), fully wired through the same machinery as ordinary elements: it's a selectable base type in the element editor (ui->m_base_type_cb->addItem(tr("Vignette"), ElementData::Thumbnail), elementpropertieseditorwidget.cpp:187), gets its own ElementInfoWidget for editing info fields exactly like a Simple element (elementpropertieswidget.cpp:293), and resolves dynamic text (%{manufacturer}, %{manufacturer_reference}, etc.) through the same path as Simple elements (dynamicelementtextitem.cpp:274). In other words, the "new item type" this request describes already exists — ElementData::Thumbnail is exactly a lightweight placement block, distinct from a full schematic symbol. What's missing isn't the type, it's automated creation and filing of instances of it.
The manufacturer/reference fields this feature would key off are already standard element-info keys: ELMT_MANUFACTURER / ELMT_MANUFACTURER_REF (qetinformation.h:42-43), already filled in on ordinary schematic elements today.
The "special folder in the embedded collection" half already has the exact primitives needed: QETProject::embeddedElementCollection() (qetproject.cpp:335) returns the project's XmlElementCollection, which already exposes createDir(path, name, name_list) to make a new folder and addElementDefinition(dir_path, elmt_name, xml_definition) to drop a new element definition into it (xmlelementcollection.h:60-64) — the same calls the collection-management UI itself uses for copy/paste and drag-drop within the panel. Anything filed there through these calls shows up in the elements panel like any other embedded element, already drag-and-droppable onto a diagram with zero new UI plumbing.
ElementsLocation::xml() gives the raw <definition> XML for an existing element — the natural thing to clone as a starting point for a synthesized thumbnail definition, rather than building one from nothing.
Proposed scope
On an element that has both manufacturer and reference filled in, add an action ("Generate cabinet thumbnail" or similar) that synthesizes a minimal Thumbnail-type .elmt definition — a plain labeled block showing manufacturer + reference via dynamic text — and writes it into a dedicated folder (e.g. "Cabinet thumbnails") under the project's embed:// collection via createDir() + addElementDefinition().
Dedup by manufacturer+reference before creating: check elementsNames() on that folder first, so placing the same device on ten schematic elements doesn't pile up ten redundant thumbnails.
No new drag-and-drop mechanism needed — embedded-collection elements are already draggable from the panel onto any diagram today.
Related, not proposed here
The synthesized block's size would default to something arbitrary rather than the device's true physical footprint, since QET has no existing info field for physical width/height/depth (checked qetinformation.h — nothing tracks real-world dimensions today). Adding such a field so thumbnails could be generated at true scale is a natural follow-up, but a separate piece of scope from the generate-and-file workflow proposed here.
Happy to build this if the scope above sounds right.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
Physically laying out a cabinet/panel (as opposed to drawing the schematic) means placing a small representative block for every device that needs a slot — sized/labeled by manufacturer and reference. Today there's no shortcut from "I've entered this device's manufacturer + reference on the schematic" to "here's a placeable block for it" — a user has to hand-author a placement symbol from scratch for every distinct device, even though the schematic element they're placing already carries the exact information (manufacturer, reference) that block needs to show.
What exists today — closer than it looks
ElementData::Typealready has a dedicatedThumbnailvalue (elementdata.h:40-50,= 64), fully wired through the same machinery as ordinary elements: it's a selectable base type in the element editor (ui->m_base_type_cb->addItem(tr("Vignette"), ElementData::Thumbnail),elementpropertieseditorwidget.cpp:187), gets its ownElementInfoWidgetfor editing info fields exactly like aSimpleelement (elementpropertieswidget.cpp:293), and resolves dynamic text (%{manufacturer},%{manufacturer_reference}, etc.) through the same path asSimpleelements (dynamicelementtextitem.cpp:274). In other words, the "new item type" this request describes already exists —ElementData::Thumbnailis exactly a lightweight placement block, distinct from a full schematic symbol. What's missing isn't the type, it's automated creation and filing of instances of it.ELMT_MANUFACTURER/ELMT_MANUFACTURER_REF(qetinformation.h:42-43), already filled in on ordinary schematic elements today.QETProject::embeddedElementCollection()(qetproject.cpp:335) returns the project'sXmlElementCollection, which already exposescreateDir(path, name, name_list)to make a new folder andaddElementDefinition(dir_path, elmt_name, xml_definition)to drop a new element definition into it (xmlelementcollection.h:60-64) — the same calls the collection-management UI itself uses for copy/paste and drag-drop within the panel. Anything filed there through these calls shows up in the elements panel like any other embedded element, already drag-and-droppable onto a diagram with zero new UI plumbing.ElementsLocation::xml()gives the raw<definition>XML for an existing element — the natural thing to clone as a starting point for a synthesized thumbnail definition, rather than building one from nothing.Proposed scope
Thumbnail-type.elmtdefinition — a plain labeled block showing manufacturer + reference via dynamic text — and writes it into a dedicated folder (e.g. "Cabinet thumbnails") under the project'sembed://collection viacreateDir()+addElementDefinition().elementsNames()on that folder first, so placing the same device on ten schematic elements doesn't pile up ten redundant thumbnails.Related, not proposed here
The synthesized block's size would default to something arbitrary rather than the device's true physical footprint, since QET has no existing info field for physical width/height/depth (checked
qetinformation.h— nothing tracks real-world dimensions today). Adding such a field so thumbnails could be generated at true scale is a natural follow-up, but a separate piece of scope from the generate-and-file workflow proposed here.Happy to build this if the scope above sounds right.
All reactions