Exemple #1
0
    def run(self):
        #import globals
        global CUR_SAMPLE
        global TEST_RES
        global COL_COUNT
        global THRESHOLD
        global TOTAL_SAMPLES
                    
        while(CUR_SAMPLE < TOTAL_SAMPLES-1):
            
            while(WAIT == True):                #used when stop button is pressed
                time.sleep(0.01)                #wait
            if(END == True):            
                print("Resetting System")       #used when reset button is pressed
                robo_controls.drop()            #drop sample
                robo_controls.move_to_start()   #move to home
                break
            else:
                robo_controls.move_to_start()   #move to home
                robo_controls.pickup()          #pickup sample
                robo_controls.move_to_camera()  #move to camera
                print("Processing Sample " + str(CUR_SAMPLE))   #for debugging     
                COL_COUNT = deltaImageProcessor.AnalyzeSample(CUR_SAMPLE) #run analysis
                
                if(COL_COUNT < THRESHOLD):          #assign test result        
                    TEST_RES = "PASS"               #microbial count below threshold
                    robo_controls.move_to_passed()  #move sample to passed stack
                else:
                    TEST_RES = "FAIL"               #microbial count above threshold
                    robo_controls.move_to_failed()  #move sample to fail stack

                self.signals.next_samp.emit()   #send signal to grab the next sample
            
        self.signals.finished.emit()            # Done. All samples analyzed.
Exemple #2
0
    def run(self):

        THRESHOLD = self.threshold.value()  #threshold for pass/fail test
        TOTAL_SAMPLES = self.numberOfSamples.value(
        )  #total number of samples to be tested
        CUR_SAMPLE = 1  #current sample number                                                #colony count for current sample

        while (CUR_SAMPLE <= TOTAL_SAMPLES):
            print("Current Sample: " + str(CUR_SAMPLE))
            cur_samp_text = str(CUR_SAMPLE)
            self.sampleNumber.setText(
                cur_samp_text)  #update current sample on GUI
            self.sampleNumber.update()
            COL_COUNT = deltaImageProcessor.AnalyzeSample(
                CUR_SAMPLE)  #run analysis
            print("Current Count: " + str(COL_COUNT))
            col_text = str(COL_COUNT)
            self.colonyCount.setText(
                col_text)  #update colony count of curent sample
            self.colonyCount.update()
            time.sleep(.5)  #let gui update

            if (COL_COUNT < THRESHOLD):  #assign test result
                TEST_RES = "PASS"
            else:
                TEST_RES = "FAIL"

            CUR_SAMPLE += 1  #incerment cur_sample
            self.passFail.setText(TEST_RES)  #update TEST_RES text
            self.passFail.update()  #update GUI
    def run(self):
        global CUR_SAMPLE
        global TEST_RES
        global COL_COUNT
        global THRESHOLD
        global TOTAL_SAMPLES

        output_file = open(
            '/home/pi/Documents/deltaImageProcessor/Database/output.csv', 'w')
        data_writer = csv.writer(output_file,
                                 delimiter=',',
                                 quotechar='"',
                                 quoting=csv.QUOTE_MINIMAL)
        data_writer.writerow(
            ['Client Name', 'Sample Number', 'Colony Count', 'Test Result'])
        #while(CUR_SAMPLE+1 < TOTAL_SAMPLES):

        while (WAIT == True):
            time.sleep(0.01)
        if (END == True):
            print("Resetting System")
            robo_controls.drop()
            robo_controls.move_to_start()
            #break
        else:
            robo_controls.move_to_start()
            robo_controls.pickup()
            robo_controls.move_to_camera()
            robo_controls.drop()
            print("Processing Sample " + str(CUR_SAMPLE))
            COL_COUNT = analysis.AnalyzeSample(CUR_SAMPLE)  #run analysis

            robo_controls.pickup()

            if (COL_COUNT < THRESHOLD):  #assign test result
                TEST_RES = 'PASS'
                robo_controls.move_to_passed()
            else:
                TEST_RES = 'FAIL'
                robo_controls.move_to_failed()

            robo_controls.drop()

            data = [CLIENT_NAME, str(CUR_SAMPLE), str(COL_COUNT), TEST_RES]
            data_writer.writerow(data)

            self.signals.next_samp.emit()

        self.signals.finished.emit()  # Done
Exemple #4
0
    def run(self):
        global CUR_SAMPLE
        global TEST_RES
        global COL_COUNT
        global THRESHOLD
        global TOTAL_SAMPLES

        while (CUR_SAMPLE < TOTAL_SAMPLES - 1):

            while (WAIT == True):
                time.sleep(0.01)
            if (END == True):
                print("Resetting System")
                robo_controls.drop()
                robo_controls.move_to_start()
                break
            else:
                robo_controls.move_to_start()
                robo_controls.pickup()
                robo_controls.move_to_camera()
                robo_controls.drop()
                print("Processing Sample " + str(CUR_SAMPLE))
                COL_COUNT = deltaImageProcessor.AnalyzeSample(
                    CUR_SAMPLE)  #run analysis

                robo_controls.pickup()

                if (COL_COUNT < THRESHOLD):  #assign test result
                    TEST_RES = "PASS"
                    robo_controls.move_to_passed()
                else:
                    TEST_RES = "FAIL"
                    robo_controls.move_to_failed()

                robo_controls.drop()
                self.signals.next_samp.emit()

        self.signals.finished.emit()  # Done