添加native.api源码;临时处理run_simulation中iot数据库name的判断

This commit is contained in:
2026-03-03 09:47:13 +08:00
parent 1d662f973a
commit e7a3aec02f
203 changed files with 9470 additions and 6 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ import logging
from typing import Any
sys.path.append("..")
from api import project
from api import inp_out
from app.native.api import project
from app.native.api import inp_out
def _verify_platform():
+7 -2
View File
@@ -1233,9 +1233,14 @@ def run_simulation(
# print(node_result)
# 存储
starttime = time.time()
# 临时处理输入的name问题,后续需要优化,需要传递/获取iot数据库的名字
if name.find("_") != -1:
db_name = name.split("_")[2]
else:
db_name = name
if simulation_type.upper() == "REALTIME":
TimescaleInternalStorage.store_realtime_simulation(
node_result, link_result, modify_pattern_start_time, db_name=name
node_result, link_result, modify_pattern_start_time, db_name=db_name
)
elif simulation_type.upper() == "EXTENDED":
TimescaleInternalStorage.store_scheme_simulation(
@@ -1245,7 +1250,7 @@ def run_simulation(
link_result,
modify_pattern_start_time,
num_periods_result,
db_name=name,
db_name=db_name,
)
endtime = time.time()
logging.info("store time: %f", endtime - starttime)