#include <Machine.h>
Inheritance diagram for Machine::
Public Slots | |
void | updateCanvasSize (int, int, double) |
Updates the canvas size with a new point. More... | |
void | updateCanvasSize (int, int) |
Updates the canvas size. More... | |
Signals | |
void | newCanvasSize (int, int) |
Emited when the canvas size needs to be set to a new value. | |
Public Methods | |
Machine (QObject *parent=NULL, const char *name=0) | |
Constructor. | |
Machine (QObject *name, const QString, QString, int type, int, QString, int, QString, int, QString, QFont, QFont, int) | |
Constructor. More... | |
~Machine () | |
Destructor. | |
GState * | getInitialState () |
Returns initial state of the machine. | |
void | setInitialState (GState *s) |
Sets the initial state of the machine to s. | |
GITransition * | getInitialTransition () |
Returns the initial transition. | |
void | setInitialTransition (GITransition *t) |
Sets the initial transition. | |
void | attachInitialTransition () |
Attaches initial transition graphically to the initial state. | |
GState * | getPhantomState () |
Returns the phantom state. More... | |
void | setPhantomState (GState *s) |
Sets the phantom state. | |
QList< GState > & | getSList () |
Returns the state list. | |
QString | getName () |
Returns the name of the machine. | |
void | setName (const QString n) |
Sets the name of the machine. | |
QString | getVersion () |
Returns the version of the machine. | |
void | setVersion (QString v) |
Sets the version of the machine. | |
int | getType () |
Returns the type of the machine. 0: Binary / 1: ASCII. | |
void | setType (int t) |
Sets the type of the machine to t. | |
int | getNumBits () |
Returns the number of bits used to code the state. | |
void | setNumBits (int) |
Sets the number of bits. | |
int | getNumInputs () |
Returns the number of input bits. | |
void | setNumInputs (int) |
Sets the number of input bits. | |
int | getNumOutputs () |
Returns the number of output bits. | |
void | setNumOutputs (int) |
Sets the number of output bits. | |
QFont & | getSFont () |
Returns the font used to draw the state names. | |
void | setSFont (const QFont &f) |
Sets the font used to draw the state names. | |
QFont & | getTFont () |
Returns the font used to draw the transition conditions. | |
void | setTFont (const QFont &f) |
Sets the font used to draw the transition conditions. | |
int | getArrowType () |
Returns the arrow type (0: unfilled, 1: filled). | |
void | setArrowType (int t) |
Sets the arrow type (0: unfilled, 1: filled). | |
void | setProject (Project *p) |
Returns a pointer to the current project. | |
Project * | getProject () |
Returns a pointer to the project. | |
int | countStates () |
Returns the number of states in the machine. | |
int | getNewCode () |
Returns a new state code (as integer value). | |
bool | addState (const QString, QString, int, double, double, int, double, QPen, bool endstate, bool withundo=TRUE) |
Adds a new state to the machine. More... | |
bool | addState (GState *, bool withundo=TRUE) |
Adds a state to the machine. More... | |
GState * | getState (QPoint, double) |
Returns the state which lies on (near to) the point at the scale scale. | |
GObject * | getObject (QPoint p, double scale, int &type) |
Returns the graphical object which lies on a point. More... | |
void | removeState (GState *) |
Removes state s from the machine. | |
GState * | getState (int) |
Returns the state with the code code. | |
QList< GState > | getEndStates () |
Returns a list of end states of this machine. | |
void | getCanvasSize (int &w, int &h) |
Returns current canvas size. | |
void | setCanvasSize (int, int) |
Sets the canvas (scroll view) size to x, y. | |
void | calcCanvasSize () |
Calculates the canvas size according to the states and transitions in the machine. | |
int | getNumStates () |
Returns the number of states in the machine. | |
void | setMooreOutputNames (int, QString) |
Completes the moore output names string. More... | |
QString | getMooreOutputNames (QString separator=",") |
Returns the moore output names separated by separator. | |
void | setMealyInputNames (int, QString) |
Completes the mealy input names. More... | |
QString | getMealyInputNames (QString separator=",") |
Returns the mealy input names separated by separator. | |
void | setMealyOutputNames (int, QString) |
Completes the mealy output names. More... | |
QString | getMealyOutputNames (QString separator=",") |
Returns the mealy output names separated by separator. | |
QStringList | getMooreOutputList () |
Returns the list of moore output names. | |
void | setMooreOutputList (QStringList l) |
Sets the list of moore output names. | |
QStringList | getInputNameList () |
Returns the list of input names. | |
void | setInputNameList (QStringList l) |
Sets the list of input names. | |
QStringList | getOutputNameList () |
Returns the list of output names. | |
void | setOutputNameList (QStringList l) |
Sets the list of output names. | |
void | checkIntegrity (ICheck *) |
Checks the integrity of the machine and displays the results in a dialog. | |
void | getEventList (QList< IOInfo > *) |
Returns a list of all events covered by a transition of the machine. | |
Static Public Methods | |
void | replaceChar (QString &s, QChar c1, QChar c2) |
Replaces in string s all occurences of c1 with c2. | |
Private Attributes | |
Project * | project |
Pointer to the project this machine belongs to. | |
QString | name |
Name of the machine. | |
QString | version |
Version of the machine. | |
int | type |
Type: 0: Binary / 1: ASCII. | |
int | num_bits |
Number of bits to code the states. | |
int | num_input |
Number of bits for the input conditions. | |
int | num_output |
Number of bits for the outputs. | |
QStringList | input_names |
Names of the input bits. | |
QStringList | output_names |
Names of the output bits. | |
QStringList | output_names_moore |
Names of the moore outputs (state coding). | |
QFont | state_font |
Font for the state name. | |
QFont | transition_font |
Font for the transition. | |
int | arrow_type |
Arrow type: 0: line arrow / 1: solid arrow. | |
QList< GState > | state_list |
List of states. | |
GState * | initial_state |
Pointer to the start state (initial state). | |
GState * | phantom_state |
Phantom state. | |
GITransition * | initial_transition |
Start transition (initial transition). | |
QSize | canvas_size |
Size of the drawing area. |
|
Constructor.
|
|
Adds a state to the machine.
|
|
Adds a new state to the machine.
|
|
Returns the graphical object which lies on a point. The type of the object will be stored in type.
|
|
Returns the phantom state. A phantom state is the state containing all the transitions which have no starting states. |
|
Completes the mealy input names.
|
|
Completes the mealy output names.
|
|
Completes the moore output names string. Output names that are not given are named "s_out" + the bit number
|
|
Updates the canvas size. The coordinates are already transformed into scale factor 1.0 |
|
Updates the canvas size with a new point. If the point with the coordinates x and y at the scale scale lies outside the current scroll view, the size will be adjusted accordingly |