Add drawpipe.py
This commit is contained in:
23
drawpipe.py
Normal file
23
drawpipe.py
Normal file
@@ -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()
|
||||||
1
main.py
1
main.py
@@ -2540,7 +2540,6 @@ async def fastapi_query_all_scada_records_by_date(querydate: str):
|
|||||||
return loaded_dict
|
return loaded_dict
|
||||||
|
|
||||||
logger.info(f"query from influxdb")
|
logger.info(f"query from influxdb")
|
||||||
|
|
||||||
result_dict = influxdb_api.query_all_SCADA_records_by_date(query_date=querydate)
|
result_dict = influxdb_api.query_all_SCADA_records_by_date(query_date=querydate)
|
||||||
|
|
||||||
# 今天的不要去缓存
|
# 今天的不要去缓存
|
||||||
|
|||||||
Reference in New Issue
Block a user