def addSampleLogEntry(log_name, ws, start_time, extra_time_shift): number_of_times = 10 for i in range(0, number_of_times): val = random.randrange(0, 10, 1) date = DateAndTime(start_time) date += int(i*1e9) date += int(extra_time_shift*1e9) AddTimeSeriesLog(ws, Name=log_name, Time=date.__str__().strip(), Value=val)
def addSampleLogEntry(self, log_name, ws, start_time, extra_time_shift): number_of_times = 10 for i in range(0, number_of_times): val = random.randrange(0, 10, 1) date = DateAndTime(start_time) date += int(i*1e9) date += int(extra_time_shift*1e9) AddTimeSeriesLog(ws, Name=log_name, Time=date.__str__().strip(), Value=val)
def add_log(ws, number_of_times, log_name, start_time): alg_log = AlgorithmManager.create("AddTimeSeriesLog") alg_log.initialize() alg_log.setChild(True) alg_log.setProperty("Workspace", ws) alg_log.setProperty("Name", log_name) # Add the data if log_name == "good_frames": convert_to_type = int else: convert_to_type = float for i in range(0, number_of_times): date = DateAndTime(start_time) date += int(i*1e9) # Add nanoseconds alg_log.setProperty("Time", date.__str__().strip()) alg_log.setProperty("Value", convert_to_type(i)) alg_log.execute() return alg_log.getProperty("Workspace").value
def add_log(ws, number_of_times, log_name, start_time): alg_log = AlgorithmManager.create("AddTimeSeriesLog") alg_log.initialize() alg_log.setChild(True) alg_log.setProperty("Workspace", ws) alg_log.setProperty("Name", log_name) # Add the data if log_name == "good_frames": convert_to_type = int else: convert_to_type = float for i in range(0, number_of_times): date = DateAndTime(start_time) date += int(i * 1e9) # Add nanoseconds alg_log.setProperty("Time", date.__str__().strip()) alg_log.setProperty("Value", convert_to_type(i)) alg_log.execute() return alg_log.getProperty("Workspace").value