Re: add attributes?



Steffen Macke wrote:
Hi,

Now to get a slightly manageable UI.  any clue how many hours of work it
would take to do something like I am looking for?

Try to describe the UI you are looking for in as much detail as possible. I just
read all the mails again and it's not clear to me what is missing.

2 parts:

1. Define new attributes.
For now (and forever is OK with me) this can just be a .conf file like so:
# ~/.dia/attributes.conf
Description char(90)
PartNo char(20)
Order int

2. Set attribute values on objects. These 3 attributes would now be part of the Property Sheet. (perhaps they should be called "Custom Properties" ?)
see attached png.

Then run PyDia List Generation,  output:
1, "Firewire Cable 4m/4m", "1030103", 10
2, "DVSwitch laptop", "dv67", 3
3, "Firewire Cable 6m/4m", "1030105", 7
4, "vga scan converter", "TwinPact100", 2

Or whatever the python csv module spits out. The 1,2,3,4 is not a counter, but the unique ID that Dia uses. (I am assuming it exists, and I am assuming it is easy to include in the export.)

Things others might enjoy, but I have no need for now:
in addition to name/type, options to have name/data rendered as part of the diagram:
Description char(90) n y
PartNo char(20) y y
Order int n n

This would cause the following text to be hung off the object:

Firewire Cable 4m/4m
PartNo: 1030103

Notice "Description" is not shown, just "Firewire Cable 4m/4m", and neither "order" or "10" is shown at all.

But this sounds like a huge time sink, mainly coming up with a way to position the text away from other objects, either automatically or another UI to allow the user to define the position.

(the reason I went down this path was to show where it lead, in hopes that what I need happens sooner.)



Regarding additional attributes: Would it be possible to add them from the code?
E.g. if the export finds object x named y, it knows that description z
should be added
to the list.

I can do that with the resulting export. the export itself should stay very simple, otherwise it needs some way of being configured, and documented, etc.


It might help if you would attach the list that should come out of
your sample diagram.

(see above)


In addition: Is plain text ok or would you prefer e.g. a HTML table to
open the as a spreadsheet?

csv or xml would be my 2 choices.  whatever makes the .py code the simplest.


Should the export list repeated items in separate line or add a count column?

For this PyCon video task, I need 2 things:
1. Assembly Instructions: step by step guide of how to setup the system:

1) dv67 dvswitch laptop on back table, plugged in
2) twinpact on back table, plugged in
3) vga cable from presenter into twinpac (rgb in)
4) ... (see http://spreadsheets.google.com/ccc?key=pIfz0wOzPtW2vRdor3fgERg&hl=en assembly tab)

2. parts list of everything I need. in this case, consolidating and counting would be handy. (see budget tab) But this is something I can take care of myself; I don't think it's a good idea to try to make Dia do it.

For #1 Assembly Instructions I don't think I would include that text in the .dia, but use the part number on both (.dia and Instructions) to double check that everything was accounted for - Each .dia object needs an instruction, each instruction needs a .dia object.

For the Deluxe Version: generate a description that includes the descriptions of the objects a line connects:

These 3 objects:
"DVSwitch laptop", "dv67", 3
"Firewire Cable 6m/4m", "1030105", 7
"vga scan converter", "TwinPact100", 2

and some template string: "from %(end1)s to %(end2)s"

Would generate this: "from presenter to twinpac"

I think this can be split into two parts: A) dia, B) external.

A) dia part would add 2 things to the export:
Object ID - I am sure dia object have some unique ID.  use that.
Connected Objects - list of Object ID's that are attached. For lines, it would be the ID's of the end points, for other things, blank.
example:
"1", "", "DVSwitch laptop", "dv67", 3
"2", "1,3", "Firewire Cable 6m/4m", "1030105", 7
"3", "", "vga scan converter", "TwinPact100", 2

For "other things" I considered having stuff besides blank, but it would be redundant, and might make it harder to process. blank/not makes it easy to tell if it is a line or not.

B) The external part would be up to the user: spreadsheet, .py, whatever.

Hopefully it is clear what I need and what would be nice, but I would not want if it causes what I need to be delayed. PyCon is March 25, so after that I don't need anything. I am working on this project now, so the sooner .dia can make my live easier, the better.

Carl K



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