当前位置: 首页>>代码示例>>Python>>正文


Python Sensor.__init__方法代码示例

本文整理汇总了Python中sensor.Sensor.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Sensor.__init__方法的具体用法?Python Sensor.__init__怎么用?Python Sensor.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sensor.Sensor的用法示例。


在下文中一共展示了Sensor.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self, sensorNode):
     """\brief Initializes the class
     \param sensorNode (\c SensorNode) A SensorNode object containing
     information to instantiate the class with
     """
     Sensor.__init__(self, sensorNode)
     self.__ipAddress = sensorNode.getInterfaces("infrastructure")[0].getIP()
开发者ID:benroeder,项目名称:HEN,代码行数:9,代码来源:sensatronics.py

示例2: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__( self ):
     self.streamID = "Environment"
     # Specify the STREAM-ID as it's specified in your stream definition on the SeaaS platform
     Sensor.__init__(self, self.streamID)
     # Copy/Paste from web portal
     # Call API to get LATEST stream information .....
     self.sensorValue[self.streamID] = {}
     #Override if it exists
     self.hasCCINdefinition = True
     
     self.stream_def["title"] = self.streamID
     self.stream_def["properties"] = {
                                     self.streamID: {
                                       "type": "object",
                                       "properties": {
                                         "temperature": {
                                           "type": "integer"
                                         },
                                         "humidity": {
                                           "type": "integer"
                                         },
                                         "airpressure": {
                                           "type": "integer"
                                         }
                                       },
                                       "additionalProperties": False
                                     }
                                   }
开发者ID:Enabling,项目名称:WiPy-LoPy,代码行数:30,代码来源:enco_sensor.py

示例3: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self):
     Sensor.__init__(self)
     self.have_serial = False
     try:
         self.ser = serial.Serial(port=self.PORT, baudrate=115200, timeout=1)
         self.have_serial = True
     except:
         pass
开发者ID:Vitalica,项目名称:bbb_vitalica,代码行数:10,代码来源:pulseox_sensor.py

示例4: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self, dataset, datadir='.'):
     """
     Initialization.
     :param dataset: Filename.
     :param datadir: Directory of the file default '.'
     """
     self.scans, width = self.load_data(datadir, dataset)
     Sensor.__init__(self, width, self.scan_rate_hz, self.viewangle, self.distance_no_detection_mm,
                     self.detectionMargin, self.offsetMillimeters)
开发者ID:RoamingSpirit,项目名称:SLAM,代码行数:11,代码来源:xtion.py

示例5: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
    def __init__(self):
        """@todo: to be defined1. """
        Sensor.__init__(self)
        self.have_sensor = False

        try:
            self.i2c = Adafruit_I2C(self.I2C_ADDRESS)
            self.have_sensor = True
        except:
            pass
开发者ID:Vitalica,项目名称:bbb_vitalica,代码行数:12,代码来源:temp_sensor.py

示例6: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
    def __init__(self, name, sensor_id, time_source, position_source, data_handlers):
        '''Constructor.'''
        Sensor.__init__(self, 'position', name, sensor_id, time_source, data_handlers)
        
        self.position_source = position_source
        
        self.stop_passing = False # If true then sensor will passing data to handlers.

        self.is_open = False # internally flag to keep track of whether or not sensor is open.
        
        self.last_utc_time = 0 # last position timestamp that was passed onto data handlers.

        self.max_closing_time = 3 # seconds
开发者ID:Phenomics-KSU,项目名称:pisc,代码行数:15,代码来源:position_passer.py

示例7: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
    def __init__(self, name, sensor_id, port, baud, time_source, data_handlers):
        '''Save properties for opening serial port later.'''
        Sensor.__init__(self, 'green_seeker', name, sensor_id, time_source, data_handlers)

        self.port = port
        self.baud = baud
        
        self.read_timeout = 2
               
        self.stop_reading = False # If true then sensor will stop reading data.
        self.connection = None
        
        self.max_closing_time = self.read_timeout + 1
开发者ID:Phenomics-KSU,项目名称:pisc,代码行数:15,代码来源:green_seeker.py

示例8: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
    def __init__(self):
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.connection = socket.socket()

        self.width = 0
        self.scan_rate_hz = 0
        self.viewangle = 0
        self.distance_no_detection_mm = 0
        self.detection_margin = 0
        self.offset_millimeters = 0

        self.initialize()

        Sensor.__init__(self, self.width, self.scan_rate_hz, self.viewangle,
                        self.distance_no_detection_mm, self.detection_margin, self.offset_millimeters)
开发者ID:RoamingSpirit,项目名称:SLAM,代码行数:17,代码来源:networksensor.py

示例9: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self):
     '''
     Constructor
     '''
     Sensor.__init__(self)
开发者ID:viniciustrindade,项目名称:libsensorPy,代码行数:7,代码来源:humiditySensor.py

示例10: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__( self, m2mContainerId,  streamName ):
     Sensor.__init__(self, streamName)
     self.m2mContainerId = m2mContainerId
     self.sensorValue["value"] = None
     self.stream_def["title"] = streamName
     self.stream_def["properties"]={"value":{"type":"boolean"}}
开发者ID:Enabling,项目名称:WiPy-LoPy,代码行数:8,代码来源:m2m_sensor_new.py

示例11: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self):
     """@todo: to be defined1. """
     Sensor.__init__(self)
     self.i = 0
     self.clip = 100.
开发者ID:Vitalica,项目名称:bbb_vitalica,代码行数:7,代码来源:vitalica.py

示例12: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self, datasource):
     Sensor.__init__(self, datasource)
开发者ID:gtagency,项目名称:localization-dummy,代码行数:4,代码来源:gps.py

示例13: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__( self ):
     streamName = self.__class__.__name__
     Sensor.__init__(self, streamName)
     self.hasCCINdefinition = True
     self.binaryMeterValue = None
开发者ID:Enabling,项目名称:WiPy-LoPy,代码行数:7,代码来源:purebinarysensor.py

示例14: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
	def __init__(self, logger=None):
                Sensor.__init__(self, self.name, logger)
		self.bmp = BMP085(0x77, 1)
		self.initSMBus()
开发者ID:jonathanbarton,项目名称:gomake-telemetry,代码行数:6,代码来源:barometer.py

示例15: __init__

# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
 def __init__(self, log = True):
     self.log = log #Whether information should be saved in a log file
     #if(log):
      #   self.out = open('log', 'w')
     self.sensor = nr.NeatoReader()
     Sensor.__init__(self, self.width, self.scan_rate_hz, self.viewangle, self.distance_no_detection_mm, self.detectionMargin, self.offsetMillimeters)
开发者ID:RoamingSpirit,项目名称:SLAM,代码行数:8,代码来源:Neato.py


注:本文中的sensor.Sensor.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。