本文整理汇总了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()
示例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
}
}
示例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
示例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)
示例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
示例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
示例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
示例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)
示例9: __init__
# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
def __init__(self):
'''
Constructor
'''
Sensor.__init__(self)
示例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"}}
示例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.
示例12: __init__
# 需要导入模块: from sensor import Sensor [as 别名]
# 或者: from sensor.Sensor import __init__ [as 别名]
def __init__(self, datasource):
Sensor.__init__(self, datasource)
示例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
示例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()
示例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)