eeucalyptus / eeDA_legacy

Electronic Design Aid
Apache License 2.0
1 stars 0 forks source link

Add representation properties to various schematics element classes #15

Open eeucalyptus opened 7 years ago

eeucalyptus commented 7 years ago

The schematics elements should know about their representation. Representation is an integral part of the elements. It should also be customizable, therefore they have to be saved. This means that the elements need those attributes in the schematics files. It would be inconsequent if these properties were not saved in the elements themselves.

To be more precise, I'll add some examples:

Those properties/attributes should be added to all element classes.

Musicted commented 7 years ago

What about giving wires, polygons, etc. a style dictionary? Something like self.style = { 'width' : 5.0, 'color' : eeDAcolor.WHATEVER }

eeucalyptus commented 7 years ago

I actually don't see the reason for doing this? An argument for this would be to split functional and representative information. But some of these informations don't fit into a single category. While color is obviously just a representative property. But the line width will also be used for selection, which is clearly both - functional and representative. And even if the style would be encapsulated in an extra hierarchy level, why not use classes? All elements are processed depending on their type anyway. So a lookup like this would not give an advantage. And if so, we could just use duck typing as well