diff --git a/drawpipe.py b/drawpipe.py new file mode 100644 index 0000000..6cc9199 --- /dev/null +++ b/drawpipe.py @@ -0,0 +1,23 @@ +import json +import matplotlib.pyplot as plt + +def draw_pipe(): + # 读取json文件 + with open(r'C:\Users\dingsu\Desktop\links_coordinates.json', 'r') as f: + pipe_data = json.load(f) + + # 创建一个空列表来存储所有点的坐标 + + # 将两个点连接成一条线,然后每条线都绘制出来 + for item in pipe_data: + x1 = item[0][0] + y1 = item[0][1] + x2 = item[1][0] + y2 = item[1][1] + + plt.plot([x1, x2], [y1, y2], 'r-') + + plt.show() + +if __name__ == "__main__": + draw_pipe() diff --git a/main.py b/main.py index 79b02a6..dbfc572 100644 --- a/main.py +++ b/main.py @@ -2540,7 +2540,6 @@ async def fastapi_query_all_scada_records_by_date(querydate: str): return loaded_dict logger.info(f"query from influxdb") - result_dict = influxdb_api.query_all_SCADA_records_by_date(query_date=querydate) # 今天的不要去缓存