def addHistory(self, ruleName, imageBytes=None, imageType=None): """ updates the action history table, blocking until all data is retrieved and stored """ """ returns true on successful update """ from Robots.robotFactory import Factory cob = Factory.getCurrentRobot() dao = DataAccess() dateNow = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') location = dao.getRobotByName(cob.name)['locationId'] historyId = dao.saveHistory(dateNow, ruleName, location) if (historyId > 0): dao.saveSensorHistory(historyId) if imageType == None: imageType = ActionHistory._defaultImageType if imageBytes == None: imageBytes = cob.getImage(retFormat=imageType) if imageBytes != None: dao.saveHistoryImage(historyId, imageBytes, imageType) return historyId > 0
def addHistory(self, ruleName, imageBytes=None, imageType=None): """ updates the action history table, blocking until all data is retrieved and stored """ """ returns true on successful update """ from Robots.robotFactory import Factory cob = Factory.getCurrentRobot() dao = DataAccess() dateNow = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") location = dao.getRobotByName(cob.name)["locationId"] historyId = dao.saveHistory(dateNow, ruleName, location) if historyId > 0: dao.saveSensorHistory(historyId) if imageType == None: imageType = ActionHistory._defaultImageType if imageBytes == None: imageBytes = cob.getImage(retFormat=imageType) if imageBytes != None: dao.saveHistoryImage(historyId, imageBytes, imageType) return historyId > 0
def addHistory(self, ruleName, imageBytes=None, imageType=None): cob = CareOBot() dao = DataAccess() dateNow = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') location = dao.getRobotByName(cob.name)['locationId'] historyId = dao.saveHistory(dateNow, ruleName, location) if(historyId > 0): dao.saveSensorHistory(historyId) if imageType == None: imageType = ActionHistory._defaultImageType if imageBytes == None: imageBytes = cob.getImage(retFormat=imageType) if imageBytes != None: dao.saveHistoryImage(historyId, imageBytes, imageType) return historyId > 0