89d37f85c8bae9d535931b1414eb7fe6fab8adf2,Software/Python/easygopigo3.py,DistanceSensor,__init__,#DistanceSensor#Any#Any#Any#,2396

Before Change


            raise

        try:
            distance_sensor.DistanceSensor.__init__(self)
        except Exception as e:
            print(e)
            raise IOError("Distance Sensor not found")

        self.mutex = None
        if use_mutex is True:
            self.mutex = Mutex()

        self.set_descriptor("Distance Sensor")

    // Returns the values in cms

After Change


    All imports are done internally so it"s done on a as needed basis only
        as in many cases the DHT sensor is not connected.
    """
    def __init__(self, port="SERIAL",gpg=None, sensor_type=0):
        try:
            Sensor.__init__(self,port,"INPUT",gpg)
        except:
            raise

        try:
            import threading

            self.sensor_type = sensor_type

            // here we keep the temperature values after removing outliers
            self.filtered_temperature = []

            // here we keep the filtered humidity values after removing the outliers
            self.filtered_humidity = []

            // we are using an event so we can close the thread as soon as KeyboardInterrupt is raised
            self.event = threading.Event()
            if self.sensor_type == 0:
                self.set_descriptor("Blue DHT Sensor")
            else:
                self.set_descriptor("White DHT Sensor")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: DexterInd/GoPiGo3
Commit Name: 89d37f85c8bae9d535931b1414eb7fe6fab8adf2
Time: 2017-08-14
Author: robert.lucian.chiriac@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DistanceSensor
Method Name: __init__


Project Name: DexterInd/GoPiGo3
Commit Name: 89d37f85c8bae9d535931b1414eb7fe6fab8adf2
Time: 2017-08-14
Author: robert.lucian.chiriac@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DistanceSensor
Method Name: __init__


Project Name: DexterInd/GoPiGo3
Commit Name: b2e3d2222fdff00374c4a4b03beef09a79f01cbc
Time: 2017-08-18
Author: robert.lucian.chiriac@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DistanceSensor
Method Name: __init__


Project Name: matplotlib/matplotlib
Commit Name: e897855f0db3c4cd9b77e6508d3feb1b4441a363
Time: 2017-10-30
Author: anntzer.lee@gmail.com
File Name: examples/user_interfaces/embedding_in_qt_sgskip.py
Class Name: ApplicationWindow
Method Name: __init__