RoboAide
Project to improve a DIY robotic arm used for mobility assistance
Drawer.py
Go to the documentation of this file.
1 class Drawer:
2  """
3  Class for drawers
4  """
5  def __init__(self, mainwindow, name=""):
6  # True = open
7  # False = closed
8  self.mainwindow = mainwindow
9  self.name = name
10  self.state = False
11 
12  def open(self):
13  """
14  Send command to open the drawer
15  """
16  self.state = True
17  self.mainwindow.sendMessage('a')
18  print("opening " + self.name)
19 
20  def close(self):
21  """
22  Send command to close the drawer
23  """
24  self.state = False
25  self.mainwindow.sendMessage('a')
26  print("closing " + self.name)
27 
28  def getState(self):
29  """
30  Getter for the state of the drawer (open/closed)
31  """
32  return self.state
33 
34  def setState(self, state):
35  """
36  Setter for the state of the drawer (open/closed)
37  """
38  self.state = state
def getState(self)
Definition: Drawer.py:28
def setState(self, state)
Definition: Drawer.py:34
def close(self)
Definition: Drawer.py:20
def open(self)
Definition: Drawer.py:12
def __init__(self, mainwindow, name="")
Definition: Drawer.py:5