Scripts/src/thermalraw.py
def update(self):
        """
            Read from device if it's open and update the out and signs
            array

            The class runs this program in a thread for continuous updates
        """
        # loop while flag is false
        while(not self.__stop):
            # if the device is closed break from loop
            if self.dev.closed:
                print("Cannot read from device! Device closed!")
                return
            else:
                # read data
                self.data = self.dev.read(self.__size)
                # if this is the first time then just update the last frame
                # as a copy of the current frame
                if not self.__last:
                    self.__last = self.data.copy()
                    continue
                else:
                    # iterate over current data and last frame
                    for ii,ll,dd in zip(range(self.__size),self.__last,self.data):
                        # calculate difference
                        diff = dd-ll
                        # set sign and update output matrix
                        if diff == 0:
                            self.out[ii] = EventData(0)
                            self.signs[ii] = 0
                        elif diff>0:
                            self.out[ii] = EventData(1)
                            self.signs[ii] = 1
                        elif diff<0:
                            self.out[ii] = EventData(-1)
                            self.signs[ii] = -1
                        # update last frame
                        self.__last = self.data.copy()

            Read from device if it's open and update the out and signs
            array

            The class runs this program in a thread for continuous updates
        
Read from device if it's open and update the out and signs
array

The class runs this program in a thread for continuous updates
Read from device if it ' s open and update the out and signs array The class runs this program in a thread for continuous updates
def update(self):
        while(not self.__stop):
            if self.dev.closed:
                print("Cannot read from device! Device closed!")
                return
            else:
                self.data = self.dev.read(self.__size)
                if not self.__last:
                    self.__last = self.data.copy()
                    continue
                else:
                    for ii,ll,dd in zip(range(self.__size),self.__last,self.data):
                        diff = dd-ll
                        if diff == 0:
                            self.out[ii] = EventData(0)
                            self.signs[ii] = 0
                        elif diff>0:
                            self.out[ii] = EventData(1)
                            self.signs[ii] = 1
                        elif diff<0:
                            self.out[ii] = EventData(-1)
                            self.signs[ii] = -1
                        self.__last = self.data.copy()
def update ( self ) : while ( not self . __stop ) : if self . dev . closed : print ( "Cannot read from device! Device closed!" ) return else : self . data = self . dev . read ( self . __size ) if not self . __last : self . __last = self . data . copy ( ) continue else : for ii , ll , dd in zip ( range ( self . __size ) , self . __last , self . data ) : diff = dd - ll if diff == 0 : self . out [ ii ] = EventData ( 0 ) self . signs [ ii ] = 0 elif diff > 0 : self . out [ ii ] = EventData ( 1 ) self . signs [ ii ] = 1 elif diff < 0 : self . out [ ii ] = EventData ( - 1 ) self . signs [ ii ] = - 1 self . __last = self . data . copy ( )
Read from device if it's open and update the out and signs
array
Read from device if it ' s open and update the out and signs array
"""
            Read from device if it's open and update the out and signs
            array

            The class runs this program in a thread for continuous updates
        """ # loop while flag is false # if the device is closed break from loop # read data # if this is the first time then just update the last frame # as a copy of the current frame # iterate over current data and last frame # calculate difference # set sign and update output matrix # update last frame
self