calc_hsm.CalcHsm Class Reference

Calc state machine. More...

Inheritance diagram for calc_hsm.CalcHsm:

simplehsm.SimpleHsm

List of all members.

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.


Detailed Description

Calc state machine.

Member Function Documentation

def calc_hsm.CalcHsm.__init__ (   self,
  entry 
)

Calc state machine constructor.

Parameters:
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.

Parameters:
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.

Parameters:
operand1 The first operand
operand2 The second operand
operator_ The operator (+, -, *, /) to use
Returns:
The result of the function

def calc_hsm.CalcHsm.error (   self,
  state_event 
)

The 'error' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
on() (the parent state)

def calc_hsm.CalcHsm.frac1 (   self,
  state_event 
)

The 'frac1' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand1() (the parent state)

def calc_hsm.CalcHsm.frac2 (   self,
  state_event 
)

The 'frac2' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand2() (the parent state)

def calc_hsm.CalcHsm.int1 (   self,
  state_event 
)

The 'int1' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand1() (the parent state)

def calc_hsm.CalcHsm.int2 (   self,
  state_event 
)

The 'int2' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand2() (the parent state)

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.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.negated2 (   self,
  state_event 
)

The 'negated2' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.on (   self,
  state_event 
)

The 'on' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
Always NULL as this is the top level state function

def calc_hsm.CalcHsm.opEntered (   self,
  state_event 
)

The 'opEntered' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.operand1 (   self,
  state_event 
)

The 'operand1' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.operand2 (   self,
  state_event 
)

The 'operand2' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.ready (   self,
  state_event 
)

The 'ready' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise on() (the parent state)

def calc_hsm.CalcHsm.result (   self,
  state_event 
)

The 'result' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
ready() (the parent state)

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.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand1() (the parent state)

def calc_hsm.CalcHsm.zero2 (   self,
  state_event 
)

The 'zero2' state functon.

Parameters:
signal The signal to handle
param The accompaning parameter
Returns:
NULL if the signal is handled otherwise operand2() (the parent state)


Member Data Documentation

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.


The documentation for this class was generated from the following file:

Generated on Thu Feb 4 09:29:18 2010 for simplehsm(python) by  doxygen 1.5.9