Ejemplo n.º 1
0
def drawScene():

    window = GraphWin("Android", 500, 500)
    window.setCoords(0, 0, 1, 1)
    androidNo1 = Android(window, "green", 0.25, 0.5, 1.2, 0.001)
    androidNo2 = Android(window, "red", 0.75, 0.5, 1.2, 0.001)

    return window, androidNo1, androidNo2
    def __init__(self):
        #Connect to Arduino, Algo and Android
        self.arduino = Arduino()
        self.algorithm = Algorithm()
        self.android = Android()

        self.manager = Manager()
        self.MDF_LIST = self.manager.list([0])
        self.IMAGE_LIST = self.manager.list()

        #Messages from various modules are placed in this queue before being read
        self.message_queue = self.manager.Queue()

        #Messages to android are placed in this queue
        self.to_android_message_queue = self.manager.Queue()

        self.read_arduino_process = Process(target=self._read_arduino)
        self.read_algorithm_process = Process(target=self._read_algorithm)
        self.read_android_process = Process(target=self._read_android)

        self.write_process = Process(target=self._write_target)
        self.write_android_process = Process(target=self._write_android)
        print('Multi Process initialized')

        self.dropped_connection = Value('i', 0)

        #For image rec
        self.image_process = Process(target=self._process_pic)

        #Pictures taken by RPICAM put in this queue to avoid sending all at once
        self.image_queue = self.manager.Queue()