Ejemplo n.º 1
0
class Log_Class:
    def __init__(self, reqObj):
        self.protocol = reqObj.protocol
        self.json = reqObj.json
        self.quantity = reqObj.quantity
        self.code = reqObj.code
        self.isLogging = reqObj.isLogging
        self.pin = reqObj.pin
        self.log_sensor()

    def log_sensor(self):
        if self.protocol == "adc":
            self.obj = Adc(self.json)
        #elif self.protocol == "uart":
        #self.obj = Uart(self.json);
        #elif self.protocol == "i2c":
        #self.obj = I2c(self.json);

    def stop(self):
        self.obj.stopRead()
Ejemplo n.º 2
0
class Log_Class:

	def __init__(self,reqObj):
		self.protocol = reqObj.protocol
		self.json = reqObj.json;
		self.quantity = reqObj.quantity
		self.code = reqObj.code
		self.isLogging = reqObj.isLogging
		self.pin = reqObj.pin
		self.log_sensor();
	
	def log_sensor(self):
		if self.protocol == "adc":
			self.obj = Adc(self.json);
		#elif self.protocol == "uart":
			#self.obj = Uart(self.json);
		#elif self.protocol == "i2c":
			#self.obj = I2c(self.json);
	
	def stop(self):
		self.obj.stopRead();
Ejemplo n.º 3
0
 def log_sensor(self):
     if self.protocol == "adc":
         self.obj = Adc(self.json)
Ejemplo n.º 4
0
	def log_sensor(self):
		if self.protocol == "adc":
			self.obj = Adc(self.json);