def __set_config(self, config):
     database_config = config["database"]
     self.database = Database(host=database_config["host"],
                              user=database_config["user"],
                              password=database_config["password"],
                              database=database_config["database"])
     self.app_name = config["app_name"]
Beispiel #2
0
                    "avg": load[5],
                    "max": load[6],
                    "min": load[7],
                    "total": load[5] * loadfator
                },
                "voltage": {
                    "avg": load[8],
                    "max": load[9],
                    "min": load[10]
                }
            }
        }


if __name__ == "__main__":
    database = Database.get_instance()

    port = config.get('usb')[0]
    tracer_service = TracerService(serialclient=None, port=port)
    tracer_service.sync_rtc()
    print tracer_service.read_value('Battery Capacity')
#    tracer_service.write_value('Battery Capacity', 60)
#    print tracer_service.read_value('Battery Capacity')

#    chargeEquipmentService = ChargeEquipmentService(tracer_service=tracer_service, database=database)
#    chargeEquipmentService.database.create()
#    chargeEquipList = chargeEquipmentService.find_by_model('Tracer4210A')
#    chargeEquip = chargeEquipList[0]

#    samplingService = SampleService(tracer_service=tracer_service, database=database)
#    print samplingService.get_sample()