def setUp(self): #Setting up resources from common self.pUtil = PersistenceUtil.PersistenceUtil() self.multiActuatorAdapterTest = MultiActuatorAdapter.MultiActuatorAdapter( ) self.tempSensorAdapterTaskTest = TempSensorAdapterTask.TempSensorAdapterTask( 1, 1, self.pUtil) self.multiSensorAdapterTest = MultiSensorAdapter.MultiSensorAdapter( 1, 1)
def __init__(self, loop_param=10, sleep_param=1): ''' Constructor Initializing both the sensor tasks and a data manager. ''' self.loop = loop_param self.sleep = sleep_param self.pUtil = PersistenceUtil.PersistenceUtil() self.TempSensor = TempSensorAdapterTask.TempSensorAdapterTask( loop_param, sleep_param, self.pUtil)
def __init__(self, loop_param = 10, sleep_param = 1): ''' Constructor Initializing both the sensor tasks and a data manager. ''' #Defining loop and sleep time self.loop = loop_param self.sleep = sleep_param #Defining CoAP Clients self.coAPClient = CoAPClientConnector.CoAPClientConnector() #Defining PersistenceUtil self.pUtil = PersistenceUtil.PersistenceUtil() #Creating Task self.TempSensor = TempSensorAdapterTask.TempSensorAdapterTask(loop_param, sleep_param, self.pUtil, self.coAPClient)
def setUp(self): #Instance for persistenceUtil self.pUtil = PersistenceUtil.PersistenceUtil() self.pUtil.enableThreads = False #ActuatorData instance filled with data self.actuatorData = ActuatorData.ActuatorData() self.actuatorData.setName("TestActuator") self.actuatorData.setCommand("TestCommand") self.actuatorData.setValue("TestValue") #SensorData instance filled with data self.sensorData = SensorData.SensorData() self.sensorData.setName("TestSensor") self.sensorData.addValue(10) #Creating a variable to avoid running this pipeline in cloud if path.exists("config/ConnectedDevicesConfig.props"): self.pipelineAvoid = False else: self.pipelineAvoid = True
def setUp(self): #Setting up resources from common #Creating PersistenceUtil object self.pUtil = PersistenceUtil.PersistenceUtil() #Instances from Module06 self.mqttTest = MqttClientConnector.MqttClientConnector() self.multiActuatorAdapterTest = MultiActuatorAdapter.MultiActuatorAdapter( ) self.tempSensorAdapterTaskTest = TempSensorAdapterTask.TempSensorAdapterTask( 1, 1, self.pUtil, self.mqttTest) self.multiSensorAdapterTest = MultiSensorAdapter.MultiSensorAdapter( 1, 1) #SensorData object self.sensorData = SensorData.SensorData() self.sensorData.addValue(10) self.sensorData.setName("TESTNAME") #ActuatorData object self.actuatorData = ActuatorData.ActuatorData() self.actuatorData.setCommand("TESTCOMMAND") self.actuatorData.setValue("TESTVALUE") self.actuatorData.setName("TESTNAME")