At first I thought I would need a database like sqlite, but instead I came up with a way to store the data in a flat file that is extremely quick to parse in a shell. For graphics, we can generate an SVG directly from the shell. Here is the basic idea:
each object (task) gets its own line containing all possible properties as space separated variables:
TASK="start project" DURATION="0" PREDECESSORS="" SUCCESSORS="" ...
Using variables instead of separators will produce large files, but they will compress extremely well (duplicate data normally goes down to 1 byte per occurrence) and can be processed quite easily and much more quickly than parsing separated data and it is easier to maintain, since you don't have to look up positions and can't miscount.
Code: Select all
while read LINE || [ "$LINE" ]; do
eval $LINE
[ "$TASK" == "$1" ] && update_entry $@ || echo $LINE
done < $DATAFILE
Once the critical path is calculated, we can then generate our gantt chart and/or successor/predecessor views using SVG data. I've experimented with this before, and drawing, text, rectangles and lines is pretty straight-forward.
here is the basic structure for SVG
Code: Select all
<svg>
<rect width="200" height="20" x="4" y="4" style="fill:#0000ff;" id="rect1" />
<text x="11" y="17" id="text1" xml:space="preserve">START Project</text>
<line x1="204" y1="12" x2="254" y2="12" style="stroke: black;"/>
</svg>
NOTE: If I start working on this, I won't have a lot of time to work on other puppy stuff ... so I ask, is this something worth pursuing? If so which interface is preffered? What features are desired?