From 298a4cb64a9aa46e71d2725e49001bf8437b14f3 Mon Sep 17 00:00:00 2001 From: 13339479676 Date: Sat, 29 Jan 2022 10:16:13 +0800 Subject: [PATCH] v05 update --- utils/plot.py | 42 +++++++++++++++++++++++++++++++++++------- v05.md | 1 + 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/utils/plot.py b/utils/plot.py index f403608..900d6a9 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -30,6 +30,7 @@ TimesNesRoman = font_manager.FontProperties( def createLineChart(frames_y, date_list, time_list): chart_startTime = time.time() # 作图开始时间 + # -----------作图开始----------- # 画布尺寸 plt.figure(figsize=(8, 4)) # 线型 @@ -63,6 +64,8 @@ def createLineChart(frames_y, date_list, time_list): # 保存图像 plt.savefig(f'{ROOT_PATH}/date_frames_chart.png', dpi=300, bbox_inches='tight') + + # -----------作图结束----------- chart_endTime = time.time() # 作图开始时间 chart_totalTime = chart_endTime - chart_startTime # 作图用时 print( @@ -86,21 +89,46 @@ def csv2list(csv_path): return d_list, t_list, frames_list -def aaa(date_list, time_list): +def index_date(date_list): tmp_date = date_list[0] # 首个日期 i_d_list = [] - i_d_list.append([0, tmp_date]) + # i_d_list.append([0, tmp_date]) + i_d_list.append(0) for i in range(len(date_list)): if (tmp_date != date_list[i]): - i_d_list.append([i, date_list[i]]) + # i_d_list.append([i, date_list[i]]) + i_d_list.append(i) tmp_date = date_list[i] print(i_d_list) + return i_d_list + +# def date_time_frames_split(csv_path="../date_time_frames.csv"): +# f = open(csv_path, 'r') # 读取csv +# f_list = csv.reader(f) # 转成csv +# for item in f_list: +# print(item) + + + # d_list = [] # 日期列表 + # t_list = [] # 时间列表 + # frames_list = [] # 时间列表 + + # tmp_date = date_list[0] # 首个日期 + # i_d_list = [] + # i_d_list.append([0, tmp_date]) + + # for i in range(len(date_list)): + # if (tmp_date != date_list[i]): + # i_d_list.append([i, date_list[i]]) + # tmp_date = date_list[i] + # print(i_d_list) + # return i_d_list if __name__ == '__main__': date_list, time_list, frames_list = csv2list("../date_time_frames.csv") - # print(date_list) - # print(time_list) - # print(frames_list) - aaa(date_list, time_list) + index_date(date_list) + # createLineChart(frames_list, date_list, time_list) # 创建日期-帧数图 + + # date_time_frames_split() diff --git a/v05.md b/v05.md index 4458563..c3db3b4 100644 --- a/v05.md +++ b/v05.md @@ -24,6 +24,7 @@ - 优化日志时间记录 - 优化README外观 - 修复摄像头连接异常情况下的程序问题 +- 优化部分markdown文件外观