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;
int index;
int prevnode;
int firstnode;
prevnode = 0;
index = 0;
rd = sys->runs[run].start;
// Regular run
@ -1476,8 +1475,13 @@ drawRegularRuns (const System sys)
setRunColorBuf (sys, run, colorbuf);
// 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))
{
// Print node itself
@ -1504,9 +1508,9 @@ drawRegularRuns (const System sys)
eprintf (";\n");
// Print binding to previous node
if (index > sys->runs[run].firstReal)
if (firstnode == false)
{
// index > 0
// not the first node
eprintf ("\t\t");
node (sys, run, prevnode);
eprintf (" -> ");
@ -1514,45 +1518,13 @@ drawRegularRuns (const System sys)
eprintf (" [style=\"bold\", weight=\"%s\"]",
RUNWEIGHT);
eprintf (";\n");
prevnode = index;
}
else
{
// index <= firstReal
if (index == sys->runs[run].firstReal)
{
// index == firstReal
Roledef rd;
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;
}
// firstnode
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", "|");
@ -1567,14 +1539,11 @@ drawRegularRuns (const System sys)
eprintf
(" [style=bold, weight=\"%s\"];\n",
RUNWEIGHT);
}
firstnode = false;
}
prevnode = index;
}
}
}
}
index++;
rd = rd->next;
}