Public Member Functions | |
def | __init__ |
Calc state machine constructor. | |
def | Zero |
Clear the textbox input and replace with a '0' string also reset the negative variable. | |
def | Negate |
Clear the textbox input and replace with a '-0' string also set the negative variable. | |
def | append |
Append a character to the textbox input, if the clear_on_next variable is set then clear the textbox first. | |
def | calc |
Calculate the result of a function. | |
def | on |
The 'on' state functon. | |
def | ready |
The 'ready' state functon. | |
def | result |
The 'result' state functon. | |
def | begin |
def | negated1 |
The 'negated1' state functon. | |
def | operand1 |
The 'operand1' state functon. | |
def | zero1 |
The 'zero1' state functon. | |
def | int1 |
The 'int1' state functon. | |
def | frac1 |
The 'frac1' state functon. | |
def | error |
The 'error' state functon. | |
def | opEntered |
The 'opEntered' state functon. | |
def | negated2 |
The 'negated2' state functon. | |
def | operand2 |
The 'operand2' state functon. | |
def | zero2 |
The 'zero2' state functon. | |
def | int2 |
The 'int2' state functon. | |
def | frac2 |
The 'frac2' state functon. | |
Static Public Attributes | |
entry = None | |
The Tkinter text entry widget. | |
clear_on_next = False | |
If this flag is set we clear the textbox and replace text with new character on the next signal. | |
negative = False | |
If this flag is set the current operand will be negative. |
def calc_hsm.CalcHsm.__init__ | ( | self, | ||
entry | ||||
) |
Calc state machine constructor.
entry | TheTkinter text entry widget that the calc state machine will use |
def calc_hsm.CalcHsm.append | ( | self, | ||
c | ||||
) |
Append a character to the textbox input, if the clear_on_next variable is set then clear the textbox first.
c | The character to insert |
def calc_hsm.CalcHsm.begin | ( | self, | ||
state_event | ||||
) |
def calc_hsm.CalcHsm.calc | ( | self, | ||
operand1, | ||||
operand2, | ||||
operator_ | ||||
) |
Calculate the result of a function.
operand1 | The first operand | |
operand2 | The second operand | |
operator_ | The operator (+, -, *, /) to use |
def calc_hsm.CalcHsm.error | ( | self, | ||
state_event | ||||
) |
The 'error' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.frac1 | ( | self, | ||
state_event | ||||
) |
The 'frac1' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.frac2 | ( | self, | ||
state_event | ||||
) |
The 'frac2' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.int1 | ( | self, | ||
state_event | ||||
) |
The 'int1' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.int2 | ( | self, | ||
state_event | ||||
) |
The 'int2' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.Negate | ( | self | ) |
Clear the textbox input and replace with a '-0' string also set the negative variable.
def calc_hsm.CalcHsm.negated1 | ( | self, | ||
state_event | ||||
) |
The 'negated1' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.negated2 | ( | self, | ||
state_event | ||||
) |
The 'negated2' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.on | ( | self, | ||
state_event | ||||
) |
The 'on' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.opEntered | ( | self, | ||
state_event | ||||
) |
The 'opEntered' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.operand1 | ( | self, | ||
state_event | ||||
) |
The 'operand1' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.operand2 | ( | self, | ||
state_event | ||||
) |
The 'operand2' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.ready | ( | self, | ||
state_event | ||||
) |
The 'ready' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.result | ( | self, | ||
state_event | ||||
) |
The 'result' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.Zero | ( | self | ) |
Clear the textbox input and replace with a '0' string also reset the negative variable.
def calc_hsm.CalcHsm.zero1 | ( | self, | ||
state_event | ||||
) |
The 'zero1' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
def calc_hsm.CalcHsm.zero2 | ( | self, | ||
state_event | ||||
) |
The 'zero2' state functon.
signal | The signal to handle | |
param | The accompaning parameter |
calc_hsm.CalcHsm.clear_on_next = False [static] |
If this flag is set we clear the textbox and replace text with new character on the next signal.
calc_hsm.CalcHsm.entry = None [static] |
The Tkinter text entry widget.
calc_hsm.CalcHsm.negative = False [static] |
If this flag is set the current operand will be negative.