Пример #1
0
    def eventProcessing1(self):

        for n in SensorController.getAvailableNodes():
            #print n,Loop.getEntriesFromId(n).count()
            if SensorController.getEntriesFromId(n).count() >= frame_length:

                data = check(n, frame_length)
                (points, cur) = SAX.convertToSax(phrase_length,symbol_count, data)
                #print n, cur[0]
                lookupTable = SAX.createLookup(symbol_count,points)
                #print SAX.convertSaxBackToContinious(phrase_length, symbol_count, data)
               # print SAX.saxDistance(cur[0],"aaaddddddd",frame_length,lookupTable,phrase_length,symbol_count),n
                if SAX.saxDistance(cur[0],"aaaddddddd",frame_length,lookupTable,phrase_length,symbol_count) < 2:
                 #   print "something happening at sensor "+str(n)
                    thereIsMovementIn(n)
Пример #2
0
    def eventProcessing1(self):

        for n in SensorController.getAvailableNodes():
            #print n,Loop.getEntriesFromId(n).count()
            if SensorController.getEntriesFromId(n).count() >= frame_length:

                data = check(n, frame_length)
                (points, cur) = SAX.convertToSax(phrase_length, symbol_count,
                                                 data)
                #print n, cur[0]
                lookupTable = SAX.createLookup(symbol_count, points)
                #print SAX.convertSaxBackToContinious(phrase_length, symbol_count, data)
                # print SAX.saxDistance(cur[0],"aaaddddddd",frame_length,lookupTable,phrase_length,symbol_count),n
                if SAX.saxDistance(cur[0], "aaaddddddd", frame_length,
                                   lookupTable, phrase_length,
                                   symbol_count) < 2:
                    #   print "something happening at sensor "+str(n)
                    thereIsMovementIn(n)
Пример #3
0
 def run(self):
     while not self.event.is_set():
         for n in SensorController.getAvailableNodes():
             self.eventProcessing1()
         self.event.wait(self.number_of_seconds_to_wait)
Пример #4
0
 def run(self):
     while not self.event.is_set():
         for n in SensorController.getAvailableNodes():
             self.eventProcessing1()
         self.event.wait(self.number_of_seconds_to_wait)