Re: a standard for diagram document format




- Each object (shape instance) should have global properties (for the entire sheet) and individual properties (for overwriting properties per object), maybe both can be done with a CSS file.
Maybe, yes, huh?

Imagine this situation:

I make an electronic circuit schematic and have simulation script.
The electronic circuit requires some user input like buttons, potentiometers (adjustments),  and not much more.
When simulating (that is, the script controls the diagram), i clic on an electronic button shape to activate some device, like a LED (a light), then the script has to change the color of the background property of the circle child of the single LED shape.
Example of code:

obj = DOM_get_object_by_id( "id_led_to_turn_on" )
shape_obj = DOM_get_childs_by_class( obj, "led_state" )
DOM_set_property( shape_obj , "background" , "#AA0000" )

Where led_state is an SVG circle. And after simulating:

DOM_reset_property( shape_obj , "background" )

So, led_state (an SVG circle) will have a default background color indicating maybe an OFF state (black or gray), and when it turns on, the simulator asigns the color depending on the kind of LED. That would be one example.

Another could be placing multiple integrated circuits with a global and default color.
Then if i dont like this color i can change it for all the shapes using it in a global properties dialog.

I am being descriptive ?, i think not...

 


- Shapes should have some on-mouse-over and on-clic events support, for any script to use it.
You trying to implement diagrams in DOM?

No, i am not trying anything yet, but i want to start an electronic IDE project some day and i would require a widget like the DIA one.

And the Document Object Model fits perfectly i think to manipulate the diagram with scripts.
Almost all standards uses some kind of DOM. Like, HTML, XML, ODT,...
But the important part of this is separating the diagram from the styles and content.and maybe the connections (there are lots of ""standards"" definning connections between objects in electronics).

This would be a DIA-DOM where, shapes could be saved as XML, styles as CSS, contents (text, pictures, ...) as another xml or file and connections as possibly another file, or inside the same shape.



Why you ask? Is it a bad idea?

 


- Shapes should have some functionality to have a real word measured size, a fixed scale. (It could be just a property).

Tricky. If you don't have the font, then as soon as you edit the text it ends up a very different size.

Oh, you are right.
But is a must do. Some shapes can not be scaled, like the PCB ones.

I think that most other programs just dont care about fonts, if the user doesnt have the used font, the it is changed back to a global default and maybe show a warnning.

But for the limited cases in may not be prioritary.

 

-Lars

*) Yes to the purpose, the actual implementation may differ. I would probably pick Zip over tar.gz for avoiding having to scan it all.


Cheers.
Diego
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]