BUGFIX: Skipping running/commit signals caused bugs in graphviz output.

This commit is contained in:
Cas Cremers 2011-01-21 17:40:10 +01:00
parent fa8440c8e5
commit fda39f7eab

View File

@ -1454,9 +1454,8 @@ drawRegularRuns (const System sys)
Roledef rd; Roledef rd;
int index; int index;
int prevnode; int prevnode;
int firstnode;
prevnode = 0;
index = 0;
rd = sys->runs[run].start; rd = sys->runs[run].start;
// Regular run // Regular run
@ -1476,8 +1475,13 @@ drawRegularRuns (const System sys)
setRunColorBuf (sys, run, colorbuf); setRunColorBuf (sys, run, colorbuf);
// Display the respective events // Display the respective events
while (index < sys->runs[run].length) prevnode = 0;
firstnode = true;
for (index = 0; index < sys->runs[run].length; index++)
{ {
/*
* invariant: prevnode has been drawn OR firstnode is true
*/
if (!isEventIgnored (sys, run, index)) if (!isEventIgnored (sys, run, index))
{ {
// Print node itself // Print node itself
@ -1504,9 +1508,9 @@ drawRegularRuns (const System sys)
eprintf (";\n"); eprintf (";\n");
// Print binding to previous node // Print binding to previous node
if (index > sys->runs[run].firstReal) if (firstnode == false)
{ {
// index > 0 // not the first node
eprintf ("\t\t"); eprintf ("\t\t");
node (sys, run, prevnode); node (sys, run, prevnode);
eprintf (" -> "); eprintf (" -> ");
@ -1514,67 +1518,32 @@ drawRegularRuns (const System sys)
eprintf (" [style=\"bold\", weight=\"%s\"]", eprintf (" [style=\"bold\", weight=\"%s\"]",
RUNWEIGHT); RUNWEIGHT);
eprintf (";\n"); eprintf (";\n");
prevnode = index;
} }
else else
{ {
// index <= firstReal // firstnode
if (index == sys->runs[run].firstReal) if (!switches.clusters)
{ {
// index == firstReal // Draw the first box (HEADER)
Roledef rd; eprintf ("\t\ts%i [label=\"{ ", run);
int send_before_read;
int done;
// Determine if it is an active role or note
/**
*@todo note that this will probably become a standard function call for role.h
*/
rd =
roledef_shift (sys->runs[run].start,
sys->runs[run].firstReal);
done = 0;
send_before_read = 0;
while (!done && rd != NULL)
{
if (rd->type == READ)
{
done = 1;
}
if (rd->type == SEND)
{
done = 1;
send_before_read = 1;
}
rd = rd->next;
}
if (!switches.clusters)
{
// Draw the first box (HEADER)
// This used to be drawn only if done && send_before_read, now we always draw it.
eprintf ("\t\ts%i [label=\"{ ", run);
printRunExplanation (sys, run, "\\l", "|");
// close up
eprintf ("}\", shape=record");
eprintf
(",style=filled,fillcolor=\"%s\"",
colorbuf + 8);
eprintf ("];\n");
eprintf ("\t\ts%i -> ", run);
node (sys, run, index);
eprintf
(" [style=bold, weight=\"%s\"];\n",
RUNWEIGHT);
prevnode = index;
}
printRunExplanation (sys, run, "\\l", "|");
// close up
eprintf ("}\", shape=record");
eprintf
(",style=filled,fillcolor=\"%s\"",
colorbuf + 8);
eprintf ("];\n");
eprintf ("\t\ts%i -> ", run);
node (sys, run, index);
eprintf
(" [style=bold, weight=\"%s\"];\n",
RUNWEIGHT);
} }
firstnode = false;
} }
prevnode = index;
} }
index++;
rd = rd->next; rd = rd->next;
} }