405 Documentation  9.0
lab01.Conditions Class Reference

Class to keep track of vending machine conditions to instruct master mind. More...

Public Member Functions

def __init__ (self, state=0, last_key='', disp_next='', soda_selected='', balance=0, price=0, err_flag=0, disp_flag=0, soda_flag=0, balance_flag=0, change_flag=0, welcome_flag=0, key_pressed_flag=0, wait_for_key_flag=0, reset_flag=0 ##)
 
def formatBalance (self)
 Formats balance. More...
 
def formatPrice (self)
 Formats price. More...
 

Public Attributes

 state
 
 last_key
 
 disp_next
 
 soda_selected
 
 balance
 
 price
 
 err_flag
 
 disp_flag
 
 soda_flag
 
 balance_flag
 
 change_flag
 
 welcome_flag
 
 key_pressed_flag
 
 wait_for_key_flag
 
 reset_flag
 

Detailed Description

Class to keep track of vending machine conditions to instruct master mind.

Constructor & Destructor Documentation

◆ __init__()

def lab01.Conditions.__init__ (   self,
  state = 0,
  last_key = '',
  disp_next = '',
  soda_selected = '',
  balance = 0,
  price = 0,
  err_flag = 0,
  disp_flag = 0,
  soda_flag = 0,
  balance_flag = 0,
  change_flag = 0,
  welcome_flag = 0,
  key_pressed_flag = 0,
  wait_for_key_flag = 0,
  reset_flag = 0          ## 
)
Parameters
statecurrent state in fsm
last_keylast key pressed
disp_nextnext thing to print to display
soda_selectedname of soda selected
balancecurrent balance
priceprice of selected soda
err_flag[1/0] error raised
disp_flag[1/0] new thing to display
soda_flag[1/0] a soda has been selected
balance_flag[1/0] balance is suffient
change_flag[1/0] change to be dispensed
welcome_flag[1/0] display welcome message
key_pressed_flag[1/0] a key has been pressed
wait_for_key_flag[1/0] need to wait for key press
reset_flag[1/0] ok to reset conditions

Member Function Documentation

◆ formatBalance()

def lab01.Conditions.formatBalance (   self)

Formats balance.

Format balance from cents to dollar amount string

◆ formatPrice()

def lab01.Conditions.formatPrice (   self)

Formats price.

Format price from cents to dollar amount string


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