14.02.2013 Views

A Graphical Petri Nets Simulator - Rochester Institute of Technology

A Graphical Petri Nets Simulator - Rochester Institute of Technology

A Graphical Petri Nets Simulator - Rochester Institute of Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Erasing a place<br />

Starting Conditions:<br />

The current editing mode is ERASE mode. The cursor is shaped like a<br />

pistol when located in user working area.<br />

Event :<br />

The user clicks the mouse button on one <strong>of</strong>the places <strong>of</strong>the net.<br />

Response :<br />

The main() calls read mouseO to get the current mouse location. It tests<br />

that location and finds out it is in the user working area, so it calls<br />

take action().<br />

The take actionO tests the current editing mode and finds it is ERASE<br />

mode.<br />

Take actionO calls sel segO to decide which instance in the plist is to be<br />

deleted.<br />

Take actionO calls the delete relateO to delete all the arcs related to the<br />

selected place from alist (the linked list <strong>of</strong> arcs).<br />

Take actionO calls erase icon() to delete the instance from the plist.<br />

Take actionO refresh the screen, causing<br />

related arcs disappear.<br />

-47-<br />

the selected place and its

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!