将 from app.services.tjnetwork import * 改为显式导入
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
get_control,
|
||||||
|
get_control_schema,
|
||||||
|
get_rule,
|
||||||
|
get_rule_schema,
|
||||||
|
set_control,
|
||||||
|
set_rule,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_curve,
|
||||||
|
delete_curve,
|
||||||
|
get_curve,
|
||||||
|
get_curve_schema,
|
||||||
|
get_curves,
|
||||||
|
is_curve,
|
||||||
|
set_curve,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
get_energy,
|
||||||
|
get_energy_schema,
|
||||||
|
get_option_v3,
|
||||||
|
get_option_v3_schema,
|
||||||
|
get_pump_energy,
|
||||||
|
get_pump_energy_schema,
|
||||||
|
get_time,
|
||||||
|
get_time_schema,
|
||||||
|
set_energy,
|
||||||
|
set_option_v3,
|
||||||
|
set_pump_energy,
|
||||||
|
set_time,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_pattern,
|
||||||
|
delete_pattern,
|
||||||
|
get_pattern,
|
||||||
|
get_pattern_schema,
|
||||||
|
get_patterns,
|
||||||
|
is_pattern,
|
||||||
|
set_pattern,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,34 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_mixing,
|
||||||
|
add_source,
|
||||||
|
api,
|
||||||
|
delete_mixing,
|
||||||
|
delete_source,
|
||||||
|
get_emitter,
|
||||||
|
get_emitter_schema,
|
||||||
|
get_mixing,
|
||||||
|
get_mixing_schema,
|
||||||
|
get_pipe_reaction,
|
||||||
|
get_pipe_reaction_schema,
|
||||||
|
get_quality,
|
||||||
|
get_quality_schema,
|
||||||
|
get_reaction,
|
||||||
|
get_reaction_schema,
|
||||||
|
get_source,
|
||||||
|
get_source_schema,
|
||||||
|
get_tank_reaction,
|
||||||
|
get_tank_reaction_schema,
|
||||||
|
set_emitter,
|
||||||
|
set_pipe_reaction,
|
||||||
|
set_quality,
|
||||||
|
set_reaction,
|
||||||
|
set_source,
|
||||||
|
set_tank_reaction,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,24 @@
|
|||||||
from fastapi import APIRouter, Request, Response
|
from fastapi import APIRouter, Request, Response
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_label,
|
||||||
|
add_vertex,
|
||||||
|
delete_label,
|
||||||
|
delete_vertex,
|
||||||
|
get_all_vertex_links,
|
||||||
|
get_all_vertices,
|
||||||
|
get_backdrop,
|
||||||
|
get_backdrop_schema,
|
||||||
|
get_label,
|
||||||
|
get_label_schema,
|
||||||
|
get_vertex,
|
||||||
|
get_vertex_schema,
|
||||||
|
set_backdrop,
|
||||||
|
set_label,
|
||||||
|
set_vertex,
|
||||||
|
)
|
||||||
from fastapi.responses import PlainTextResponse
|
from fastapi.responses import PlainTextResponse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
calculate_demand_to_network,
|
||||||
|
calculate_demand_to_nodes,
|
||||||
|
calculate_demand_to_region,
|
||||||
|
get_demand,
|
||||||
|
get_demand_schema,
|
||||||
|
set_demand,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,42 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
delete_junction,
|
||||||
|
delete_pipe,
|
||||||
|
delete_pump,
|
||||||
|
delete_reservoir,
|
||||||
|
delete_tank,
|
||||||
|
delete_valve,
|
||||||
|
get_all_scada_info,
|
||||||
|
get_element_properties,
|
||||||
|
get_element_properties_with_type,
|
||||||
|
get_element_type,
|
||||||
|
get_element_type_value,
|
||||||
|
get_link_properties,
|
||||||
|
get_link_type,
|
||||||
|
get_links,
|
||||||
|
get_node_links,
|
||||||
|
get_node_properties,
|
||||||
|
get_node_type,
|
||||||
|
get_nodes,
|
||||||
|
get_scada_info,
|
||||||
|
get_status,
|
||||||
|
get_status_schema,
|
||||||
|
get_title,
|
||||||
|
get_title_schema,
|
||||||
|
is_junction,
|
||||||
|
is_link,
|
||||||
|
is_node,
|
||||||
|
is_pipe,
|
||||||
|
is_pump,
|
||||||
|
is_reservoir,
|
||||||
|
is_tank,
|
||||||
|
is_valve,
|
||||||
|
set_status,
|
||||||
|
set_title,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request, Depends
|
from fastapi import APIRouter, Request, Depends
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
get_all_scada_info,
|
||||||
|
get_major_node_coords,
|
||||||
|
get_major_pipe_nodes,
|
||||||
|
get_network_in_extent,
|
||||||
|
get_network_link_nodes,
|
||||||
|
get_network_node_coords,
|
||||||
|
get_node_coord,
|
||||||
|
)
|
||||||
from app.auth.dependencies import get_current_user as verify_token
|
from app.auth.dependencies import get_current_user as verify_token
|
||||||
from app.infra.cache.redis_client import redis_client, encode_datetime, decode_datetime
|
from app.infra.cache.redis_client import redis_client, encode_datetime, decode_datetime
|
||||||
import msgpack
|
import msgpack
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_junction,
|
||||||
|
delete_junction,
|
||||||
|
get_all_junctions,
|
||||||
|
get_junction,
|
||||||
|
get_junction_schema,
|
||||||
|
set_junction,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
PIPE_STATUS_OPEN,
|
||||||
|
add_pipe,
|
||||||
|
delete_pipe,
|
||||||
|
get_all_pipes,
|
||||||
|
get_pipe,
|
||||||
|
get_pipe_schema,
|
||||||
|
set_pipe,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_pump,
|
||||||
|
delete_pump,
|
||||||
|
get_all_pumps,
|
||||||
|
get_pump,
|
||||||
|
get_pump_schema,
|
||||||
|
set_pump,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,42 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_district_metering_area,
|
||||||
|
add_region,
|
||||||
|
add_service_area,
|
||||||
|
add_virtual_district,
|
||||||
|
calculate_district_metering_area_for_network,
|
||||||
|
calculate_district_metering_area_for_nodes,
|
||||||
|
calculate_district_metering_area_for_region,
|
||||||
|
calculate_service_area,
|
||||||
|
calculate_virtual_district,
|
||||||
|
delete_district_metering_area,
|
||||||
|
delete_region,
|
||||||
|
delete_service_area,
|
||||||
|
delete_virtual_district,
|
||||||
|
generate_district_metering_area,
|
||||||
|
generate_service_area,
|
||||||
|
generate_sub_district_metering_area,
|
||||||
|
generate_virtual_district,
|
||||||
|
get_all_district_metering_area_ids,
|
||||||
|
get_all_district_metering_areas,
|
||||||
|
get_all_service_areas,
|
||||||
|
get_all_virtual_districts,
|
||||||
|
get_district_metering_area,
|
||||||
|
get_district_metering_area_schema,
|
||||||
|
get_region,
|
||||||
|
get_region_schema,
|
||||||
|
get_service_area,
|
||||||
|
get_service_area_schema,
|
||||||
|
get_virtual_district,
|
||||||
|
get_virtual_district_schema,
|
||||||
|
set_district_metering_area,
|
||||||
|
set_region,
|
||||||
|
set_service_area,
|
||||||
|
set_virtual_district,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_reservoir,
|
||||||
|
delete_reservoir,
|
||||||
|
get_all_reservoirs,
|
||||||
|
get_reservoir,
|
||||||
|
get_reservoir_schema,
|
||||||
|
set_reservoir,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
get_tag,
|
||||||
|
get_tag_schema,
|
||||||
|
get_tags,
|
||||||
|
set_tag,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
add_tank,
|
||||||
|
delete_tank,
|
||||||
|
get_all_tanks,
|
||||||
|
get_tank,
|
||||||
|
get_tank_schema,
|
||||||
|
set_tank,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
VALVES_TYPE_PRV,
|
||||||
|
add_valve,
|
||||||
|
delete_valve,
|
||||||
|
get_all_valves,
|
||||||
|
get_valve,
|
||||||
|
get_valve_schema,
|
||||||
|
set_valve,
|
||||||
|
)
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from typing import Any, List, Dict, Union
|
from typing import Any, List, Dict, Union
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import Any, get_all_users, get_user, get_user_schema
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from dateutil import parser
|
|||||||
import psycopg
|
import psycopg
|
||||||
import time
|
import time
|
||||||
import app.services.simulation as simulation
|
import app.services.simulation as simulation
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import close_project, get_time, is_project_open, open_project
|
||||||
import schedule
|
import schedule
|
||||||
import threading
|
import threading
|
||||||
import app.services.globals as globals
|
import app.services.globals as globals
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
ChangeSet,
|
||||||
|
get_demand,
|
||||||
|
get_option,
|
||||||
|
get_pattern,
|
||||||
|
get_pump,
|
||||||
|
get_reservoir,
|
||||||
|
get_status,
|
||||||
|
get_tank,
|
||||||
|
get_time,
|
||||||
|
open_project,
|
||||||
|
read_all,
|
||||||
|
run_project,
|
||||||
|
set_demand,
|
||||||
|
set_pattern,
|
||||||
|
set_status,
|
||||||
|
set_tank,
|
||||||
|
set_time,
|
||||||
|
)
|
||||||
|
|
||||||
# from get_real_status import *
|
# from get_real_status import *
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|||||||
@@ -6,7 +6,16 @@ import pytz
|
|||||||
|
|
||||||
from app.algorithms.simulation.runner import run_simulation_ex
|
from app.algorithms.simulation.runner import run_simulation_ex
|
||||||
from app.infra.epanet.epanet import Output
|
from app.infra.epanet.epanet import Output
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
close_project,
|
||||||
|
copy_project,
|
||||||
|
delete_project,
|
||||||
|
get_pipe,
|
||||||
|
get_tank,
|
||||||
|
have_project,
|
||||||
|
is_project_open,
|
||||||
|
open_project,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import clean_project, delete_project
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
clean_project()
|
clean_project()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import copy_project, have_project
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argc = len(sys.argv)
|
argc = len(sys.argv)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import read_inp
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import read_inp
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import delete_project
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import list_project, read_inp
|
||||||
read_inp("beibeizone","beibeizone.inp")
|
read_inp("beibeizone","beibeizone.inp")
|
||||||
#open_project('beibeizone')
|
#open_project('beibeizone')
|
||||||
#generate_service_area("beibeizone",0.00001)
|
#generate_service_area("beibeizone",0.00001)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import calculate_service_area, open_project, read_inp
|
||||||
|
|
||||||
p = 'dev'
|
p = 'dev'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import dump_inp
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import api, get_all_service_area_ids, open_project
|
||||||
from get_realValue import *
|
from get_realValue import *
|
||||||
from get_hist_data import *
|
from get_hist_data import *
|
||||||
import datetime
|
import datetime
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from app.services.tjnetwork import *
|
|
||||||
from get_realValue import *
|
from get_realValue import *
|
||||||
def get_current_total_Q():
|
def get_current_total_Q():
|
||||||
ids=['3489']
|
ids=['3489']
|
||||||
|
|||||||
+261
-1
@@ -51,7 +51,267 @@ import app.services.project_info as project_info
|
|||||||
from app.infra.db.timescaledb.database import db as tsdb
|
from app.infra.db.timescaledb.database import db as tsdb
|
||||||
from app.infra.db.postgresql.database import db as pgdb
|
from app.infra.db.postgresql.database import db as pgdb
|
||||||
from app.algorithms.online_Analysis import *
|
from app.algorithms.online_Analysis import *
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
Any,
|
||||||
|
ChangeSet,
|
||||||
|
PIPE_STATUS_OPEN,
|
||||||
|
VALVES_TYPE_PRV,
|
||||||
|
add_curve,
|
||||||
|
add_district_metering_area,
|
||||||
|
add_junction,
|
||||||
|
add_label,
|
||||||
|
add_mixing,
|
||||||
|
add_pattern,
|
||||||
|
add_pipe,
|
||||||
|
add_pump,
|
||||||
|
add_region,
|
||||||
|
add_reservoir,
|
||||||
|
add_scada_device,
|
||||||
|
add_scada_device_data,
|
||||||
|
add_scada_element,
|
||||||
|
add_service_area,
|
||||||
|
add_source,
|
||||||
|
add_tank,
|
||||||
|
add_valve,
|
||||||
|
add_vertex,
|
||||||
|
add_virtual_district,
|
||||||
|
api,
|
||||||
|
calculate_demand_to_network,
|
||||||
|
calculate_demand_to_nodes,
|
||||||
|
calculate_demand_to_region,
|
||||||
|
calculate_district_metering_area_for_network,
|
||||||
|
calculate_district_metering_area_for_nodes,
|
||||||
|
calculate_district_metering_area_for_region,
|
||||||
|
calculate_service_area,
|
||||||
|
calculate_virtual_district,
|
||||||
|
clean_scada_device,
|
||||||
|
clean_scada_device_data,
|
||||||
|
clean_scada_element,
|
||||||
|
close_project,
|
||||||
|
convert_inp_v3_to_v2,
|
||||||
|
copy_project,
|
||||||
|
create_project,
|
||||||
|
delete_curve,
|
||||||
|
delete_district_metering_area,
|
||||||
|
delete_junction,
|
||||||
|
delete_label,
|
||||||
|
delete_mixing,
|
||||||
|
delete_pattern,
|
||||||
|
delete_pipe,
|
||||||
|
delete_project,
|
||||||
|
delete_pump,
|
||||||
|
delete_region,
|
||||||
|
delete_reservoir,
|
||||||
|
delete_scada_device,
|
||||||
|
delete_scada_device_data,
|
||||||
|
delete_scada_element,
|
||||||
|
delete_service_area,
|
||||||
|
delete_source,
|
||||||
|
delete_tank,
|
||||||
|
delete_valve,
|
||||||
|
delete_virtual_district,
|
||||||
|
dump_inp,
|
||||||
|
dump_output,
|
||||||
|
execute_batch_command,
|
||||||
|
execute_batch_commands,
|
||||||
|
execute_redo,
|
||||||
|
execute_undo,
|
||||||
|
export_inp,
|
||||||
|
generate_district_metering_area,
|
||||||
|
generate_service_area,
|
||||||
|
generate_sub_district_metering_area,
|
||||||
|
generate_virtual_district,
|
||||||
|
get_all_burst_locate_results,
|
||||||
|
get_all_district_metering_area_ids,
|
||||||
|
get_all_district_metering_areas,
|
||||||
|
get_all_extension_data,
|
||||||
|
get_all_extension_data_keys,
|
||||||
|
get_all_junctions,
|
||||||
|
get_all_pipes,
|
||||||
|
get_all_pumps,
|
||||||
|
get_all_reservoirs,
|
||||||
|
get_all_scada_device_ids,
|
||||||
|
get_all_scada_devices,
|
||||||
|
get_all_scada_elements,
|
||||||
|
get_all_scada_info,
|
||||||
|
get_all_schemes,
|
||||||
|
get_all_sensor_placements,
|
||||||
|
get_all_service_areas,
|
||||||
|
get_all_tanks,
|
||||||
|
get_all_users,
|
||||||
|
get_all_valves,
|
||||||
|
get_all_vertex_links,
|
||||||
|
get_all_vertices,
|
||||||
|
get_all_virtual_districts,
|
||||||
|
get_backdrop,
|
||||||
|
get_backdrop_schema,
|
||||||
|
get_control,
|
||||||
|
get_control_schema,
|
||||||
|
get_current_operation,
|
||||||
|
get_curve,
|
||||||
|
get_curve_schema,
|
||||||
|
get_curves,
|
||||||
|
get_demand,
|
||||||
|
get_demand_schema,
|
||||||
|
get_district_metering_area,
|
||||||
|
get_district_metering_area_schema,
|
||||||
|
get_element_properties,
|
||||||
|
get_element_properties_with_type,
|
||||||
|
get_element_type,
|
||||||
|
get_element_type_value,
|
||||||
|
get_emitter,
|
||||||
|
get_emitter_schema,
|
||||||
|
get_energy,
|
||||||
|
get_energy_schema,
|
||||||
|
get_extension_data,
|
||||||
|
get_junction,
|
||||||
|
get_junction_schema,
|
||||||
|
get_label,
|
||||||
|
get_label_schema,
|
||||||
|
get_link_properties,
|
||||||
|
get_link_type,
|
||||||
|
get_links,
|
||||||
|
get_major_node_coords,
|
||||||
|
get_major_pipe_nodes,
|
||||||
|
get_mixing,
|
||||||
|
get_mixing_schema,
|
||||||
|
get_network_link_nodes,
|
||||||
|
get_network_node_coords,
|
||||||
|
get_network_pipe_risk_probability_now,
|
||||||
|
get_node_coord,
|
||||||
|
get_node_links,
|
||||||
|
get_node_properties,
|
||||||
|
get_node_type,
|
||||||
|
get_nodes,
|
||||||
|
get_option_v3,
|
||||||
|
get_option_v3_schema,
|
||||||
|
get_pattern,
|
||||||
|
get_pattern_schema,
|
||||||
|
get_patterns,
|
||||||
|
get_pipe,
|
||||||
|
get_pipe_reaction,
|
||||||
|
get_pipe_reaction_schema,
|
||||||
|
get_pipe_risk_probability,
|
||||||
|
get_pipe_risk_probability_geometries,
|
||||||
|
get_pipe_risk_probability_now,
|
||||||
|
get_pipe_schema,
|
||||||
|
get_pipes_risk_probability,
|
||||||
|
get_pump,
|
||||||
|
get_pump_energy,
|
||||||
|
get_pump_energy_schema,
|
||||||
|
get_pump_schema,
|
||||||
|
get_quality,
|
||||||
|
get_quality_schema,
|
||||||
|
get_reaction,
|
||||||
|
get_reaction_schema,
|
||||||
|
get_region,
|
||||||
|
get_region_schema,
|
||||||
|
get_reservoir,
|
||||||
|
get_reservoir_schema,
|
||||||
|
get_restore_operation,
|
||||||
|
get_rule,
|
||||||
|
get_rule_schema,
|
||||||
|
get_scada_device,
|
||||||
|
get_scada_device_data,
|
||||||
|
get_scada_device_data_schema,
|
||||||
|
get_scada_device_schema,
|
||||||
|
get_scada_element,
|
||||||
|
get_scada_element_schema,
|
||||||
|
get_scada_info,
|
||||||
|
get_scada_info_schema,
|
||||||
|
get_scheme,
|
||||||
|
get_scheme_schema,
|
||||||
|
get_service_area,
|
||||||
|
get_service_area_schema,
|
||||||
|
get_source,
|
||||||
|
get_source_schema,
|
||||||
|
get_status,
|
||||||
|
get_status_schema,
|
||||||
|
get_tag,
|
||||||
|
get_tag_schema,
|
||||||
|
get_tags,
|
||||||
|
get_tank,
|
||||||
|
get_tank_reaction,
|
||||||
|
get_tank_reaction_schema,
|
||||||
|
get_tank_schema,
|
||||||
|
get_time,
|
||||||
|
get_time_schema,
|
||||||
|
get_title,
|
||||||
|
get_title_schema,
|
||||||
|
get_user,
|
||||||
|
get_user_schema,
|
||||||
|
get_valve,
|
||||||
|
get_valve_schema,
|
||||||
|
get_vertex,
|
||||||
|
get_vertex_schema,
|
||||||
|
get_virtual_district,
|
||||||
|
get_virtual_district_schema,
|
||||||
|
have_project,
|
||||||
|
have_snapshot,
|
||||||
|
have_snapshot_for_current_operation,
|
||||||
|
have_snapshot_for_operation,
|
||||||
|
import_inp,
|
||||||
|
is_curve,
|
||||||
|
is_junction,
|
||||||
|
is_link,
|
||||||
|
is_node,
|
||||||
|
is_pattern,
|
||||||
|
is_pipe,
|
||||||
|
is_project_open,
|
||||||
|
is_pump,
|
||||||
|
is_reservoir,
|
||||||
|
is_tank,
|
||||||
|
is_valve,
|
||||||
|
list_project,
|
||||||
|
list_snapshot,
|
||||||
|
open_project,
|
||||||
|
pick_operation,
|
||||||
|
pick_snapshot,
|
||||||
|
read_inp,
|
||||||
|
run_inp,
|
||||||
|
run_project,
|
||||||
|
run_project_return_dict,
|
||||||
|
set_backdrop,
|
||||||
|
set_control,
|
||||||
|
set_curve,
|
||||||
|
set_demand,
|
||||||
|
set_district_metering_area,
|
||||||
|
set_emitter,
|
||||||
|
set_energy,
|
||||||
|
set_extension_data,
|
||||||
|
set_junction,
|
||||||
|
set_label,
|
||||||
|
set_option_v3,
|
||||||
|
set_pattern,
|
||||||
|
set_pipe,
|
||||||
|
set_pipe_reaction,
|
||||||
|
set_pump,
|
||||||
|
set_pump_energy,
|
||||||
|
set_quality,
|
||||||
|
set_reaction,
|
||||||
|
set_region,
|
||||||
|
set_reservoir,
|
||||||
|
set_restore_operation,
|
||||||
|
set_rule,
|
||||||
|
set_scada_device,
|
||||||
|
set_scada_device_data,
|
||||||
|
set_scada_element,
|
||||||
|
set_service_area,
|
||||||
|
set_source,
|
||||||
|
set_status,
|
||||||
|
set_tag,
|
||||||
|
set_tank,
|
||||||
|
set_tank_reaction,
|
||||||
|
set_time,
|
||||||
|
set_title,
|
||||||
|
set_valve,
|
||||||
|
set_vertex,
|
||||||
|
set_virtual_district,
|
||||||
|
sync_with_server,
|
||||||
|
take_snapshot,
|
||||||
|
take_snapshot_for_current_operation,
|
||||||
|
take_snapshot_for_operation,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
JUNCTION = 0
|
JUNCTION = 0
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
import os
|
import os
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
ChangeSet,
|
||||||
|
OPTION_DEMAND_MODEL_PDA,
|
||||||
|
OPTION_QUALITY_CHEMICAL,
|
||||||
|
SOURCE_TYPE_CONCEN,
|
||||||
|
add_pattern,
|
||||||
|
add_source,
|
||||||
|
close_project,
|
||||||
|
copy_project,
|
||||||
|
delete_project,
|
||||||
|
dump_inp,
|
||||||
|
get_demand,
|
||||||
|
get_emitter,
|
||||||
|
get_node_links,
|
||||||
|
get_option,
|
||||||
|
get_pattern,
|
||||||
|
get_pipe,
|
||||||
|
get_source,
|
||||||
|
get_tank,
|
||||||
|
get_time,
|
||||||
|
have_project,
|
||||||
|
is_junction,
|
||||||
|
is_project_open,
|
||||||
|
open_project,
|
||||||
|
read_inp,
|
||||||
|
set_demand,
|
||||||
|
set_emitter,
|
||||||
|
set_option,
|
||||||
|
set_source,
|
||||||
|
set_time,
|
||||||
|
)
|
||||||
from app.native.wndb.project import copy_project
|
from app.native.wndb.project import copy_project
|
||||||
from app.algorithms.simulation.runner import run_simulation_ex, from_clock_to_seconds_2
|
from app.algorithms.simulation.runner import run_simulation_ex, from_clock_to_seconds_2
|
||||||
from math import sqrt, pi
|
from math import sqrt, pi
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import open_project
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
open_project('szh')
|
open_project('szh')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import close_project, open_project, restore
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import close_project, list_project, open_project, restore
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
for p in list_project():
|
for p in list_project():
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import open_project
|
||||||
from get_current_status import *
|
from get_current_status import *
|
||||||
|
|
||||||
def run_simulation(cur_datetime:str=None)->str:
|
def run_simulation(cur_datetime:str=None)->str:
|
||||||
|
|||||||
+249
-1
@@ -1,6 +1,254 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import random
|
import random
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
API_ADD,
|
||||||
|
API_DELETE,
|
||||||
|
API_UPDATE,
|
||||||
|
CURVE,
|
||||||
|
CURVE_TYPE_EFFICIENCY,
|
||||||
|
CURVE_TYPE_PUMP,
|
||||||
|
ChangeSet,
|
||||||
|
JUNCTION,
|
||||||
|
LINK_STATUS_OPEN,
|
||||||
|
MIXING_MODEL_2COMP,
|
||||||
|
MIXING_MODEL_MIXED,
|
||||||
|
OPTION_DEMAND_MODEL_DDA,
|
||||||
|
OPTION_DEMAND_MODEL_PDA,
|
||||||
|
OPTION_HEADLOSS_DW,
|
||||||
|
OPTION_HEADLOSS_HW,
|
||||||
|
OPTION_PRESSURE_KPA,
|
||||||
|
OPTION_PRESSURE_METERS,
|
||||||
|
OPTION_PRESSURE_PSI,
|
||||||
|
OPTION_QUALITY_NONE,
|
||||||
|
OPTION_QUALITY_TRACE,
|
||||||
|
OPTION_UNBALANCED_CONTINUE,
|
||||||
|
OPTION_UNBALANCED_STOP,
|
||||||
|
OPTION_UNITS_GPM,
|
||||||
|
OPTION_UNITS_LPS,
|
||||||
|
OPTION_V3_DEMAND_MODEL_CONSTRAINED,
|
||||||
|
OPTION_V3_DEMAND_MODEL_FIXED,
|
||||||
|
OPTION_V3_DEMAND_MODEL_LOGISTIC,
|
||||||
|
OPTION_V3_DEMAND_MODEL_POWER,
|
||||||
|
OPTION_V3_FLOW_UNITS_GPM,
|
||||||
|
OPTION_V3_FLOW_UNITS_LPS,
|
||||||
|
OPTION_V3_HEADLOSS_MODEL_DW,
|
||||||
|
OPTION_V3_HEADLOSS_MODEL_HW,
|
||||||
|
OPTION_V3_IF_UNBALANCED_CONTINUE,
|
||||||
|
OPTION_V3_IF_UNBALANCED_STOP,
|
||||||
|
OPTION_V3_LEAKAGE_MODEL_NONE,
|
||||||
|
OPTION_V3_LEAKAGE_MODEL_POWER,
|
||||||
|
OPTION_V3_PRESSURE_UNITS_KPA,
|
||||||
|
OPTION_V3_PRESSURE_UNITS_METERS,
|
||||||
|
OPTION_V3_PRESSURE_UNITS_PSI,
|
||||||
|
OPTION_V3_QUALITY_MODEL_CHEMICAL,
|
||||||
|
OPTION_V3_QUALITY_MODEL_NONE,
|
||||||
|
OPTION_V3_QUALITY_MODEL_TRACE,
|
||||||
|
OPTION_V3_QUALITY_UNITS_HRS,
|
||||||
|
OPTION_V3_QUALITY_UNITS_MGL,
|
||||||
|
OPTION_V3_STEP_SIZING_FULL,
|
||||||
|
OPTION_V3_STEP_SIZING_RELAXATION,
|
||||||
|
OVERFLOW_NO,
|
||||||
|
OVERFLOW_YES,
|
||||||
|
PATTERN,
|
||||||
|
PIPE,
|
||||||
|
PIPE_STATUS_CLOSED,
|
||||||
|
PIPE_STATUS_OPEN,
|
||||||
|
PUMP,
|
||||||
|
RESERVOIR,
|
||||||
|
SCADA_DEVICE_TYPE_FLOW,
|
||||||
|
SCADA_DEVICE_TYPE_PRESSURE,
|
||||||
|
SCADA_ELEMENT_STATUS_OFFLINE,
|
||||||
|
SCADA_ELEMENT_STATUS_ONLINE,
|
||||||
|
SCADA_MODEL_TYPE_JUNCTION,
|
||||||
|
SCADA_MODEL_TYPE_PIPE,
|
||||||
|
SOURCE_TYPE_CONCEN,
|
||||||
|
SOURCE_TYPE_FLOWPACED,
|
||||||
|
TAG_TYPE_LINK,
|
||||||
|
TAG_TYPE_NODE,
|
||||||
|
TANK,
|
||||||
|
TIME_STATISTIC_AVERAGED,
|
||||||
|
TIME_STATISTIC_NONE,
|
||||||
|
VALVE,
|
||||||
|
VALVES_TYPE_FCV,
|
||||||
|
VALVES_TYPE_GPV,
|
||||||
|
add_curve,
|
||||||
|
add_district_metering_area,
|
||||||
|
add_junction,
|
||||||
|
add_label,
|
||||||
|
add_mixing,
|
||||||
|
add_pattern,
|
||||||
|
add_pipe,
|
||||||
|
add_pump,
|
||||||
|
add_region,
|
||||||
|
add_reservoir,
|
||||||
|
add_scada_device,
|
||||||
|
add_scada_device_data,
|
||||||
|
add_scada_element,
|
||||||
|
add_service_area,
|
||||||
|
add_source,
|
||||||
|
add_tank,
|
||||||
|
add_valve,
|
||||||
|
add_virtual_district,
|
||||||
|
calculate_boundary,
|
||||||
|
calculate_convex_hull,
|
||||||
|
calculate_demand_to_network,
|
||||||
|
calculate_demand_to_nodes,
|
||||||
|
calculate_demand_to_region,
|
||||||
|
calculate_district_metering_area_for_network,
|
||||||
|
calculate_district_metering_area_for_nodes,
|
||||||
|
calculate_district_metering_area_for_region,
|
||||||
|
calculate_service_area,
|
||||||
|
calculate_virtual_district,
|
||||||
|
clean_scada_device,
|
||||||
|
clean_scada_device_data,
|
||||||
|
clean_scada_element,
|
||||||
|
close_project,
|
||||||
|
create_project,
|
||||||
|
delete_curve,
|
||||||
|
delete_district_metering_area,
|
||||||
|
delete_junction,
|
||||||
|
delete_label,
|
||||||
|
delete_mixing,
|
||||||
|
delete_pattern,
|
||||||
|
delete_pipe,
|
||||||
|
delete_project,
|
||||||
|
delete_pump,
|
||||||
|
delete_region,
|
||||||
|
delete_reservoir,
|
||||||
|
delete_scada_device,
|
||||||
|
delete_scada_device_data,
|
||||||
|
delete_scada_element,
|
||||||
|
delete_service_area,
|
||||||
|
delete_source,
|
||||||
|
delete_tank,
|
||||||
|
delete_valve,
|
||||||
|
delete_virtual_district,
|
||||||
|
execute_batch_command,
|
||||||
|
execute_batch_commands,
|
||||||
|
execute_redo,
|
||||||
|
execute_undo,
|
||||||
|
generate_district_metering_area,
|
||||||
|
generate_service_area,
|
||||||
|
generate_sub_district_metering_area,
|
||||||
|
generate_virtual_district,
|
||||||
|
get_all_district_metering_area_ids,
|
||||||
|
get_all_extension_data,
|
||||||
|
get_all_extension_data_keys,
|
||||||
|
get_all_scada_device_ids,
|
||||||
|
get_all_scada_element_ids,
|
||||||
|
get_all_service_area_ids,
|
||||||
|
get_all_service_areas,
|
||||||
|
get_all_virtual_district_ids,
|
||||||
|
get_all_virtual_districts,
|
||||||
|
get_backdrop,
|
||||||
|
get_control,
|
||||||
|
get_current_operation,
|
||||||
|
get_curve,
|
||||||
|
get_demand,
|
||||||
|
get_district_metering_area,
|
||||||
|
get_emitter,
|
||||||
|
get_energy,
|
||||||
|
get_extension_data,
|
||||||
|
get_junction,
|
||||||
|
get_label,
|
||||||
|
get_links,
|
||||||
|
get_links_on_region_boundary,
|
||||||
|
get_mixing,
|
||||||
|
get_node_links,
|
||||||
|
get_nodes,
|
||||||
|
get_nodes_in_boundary,
|
||||||
|
get_nodes_in_region,
|
||||||
|
get_operation_by_snapshot,
|
||||||
|
get_option,
|
||||||
|
get_option_v3,
|
||||||
|
get_pattern,
|
||||||
|
get_pipe,
|
||||||
|
get_pipe_reaction,
|
||||||
|
get_pump,
|
||||||
|
get_pump_energy,
|
||||||
|
get_quality,
|
||||||
|
get_reaction,
|
||||||
|
get_region,
|
||||||
|
get_reservoir,
|
||||||
|
get_restore_operation,
|
||||||
|
get_rule,
|
||||||
|
get_scada_device,
|
||||||
|
get_scada_device_data,
|
||||||
|
get_scada_element,
|
||||||
|
get_service_area,
|
||||||
|
get_snapshot_by_operation,
|
||||||
|
get_source,
|
||||||
|
get_status,
|
||||||
|
get_tag,
|
||||||
|
get_tags,
|
||||||
|
get_tank,
|
||||||
|
get_tank_reaction,
|
||||||
|
get_time,
|
||||||
|
get_title,
|
||||||
|
get_valve,
|
||||||
|
get_vertex,
|
||||||
|
get_virtual_district,
|
||||||
|
have_project,
|
||||||
|
inflate_boundary,
|
||||||
|
inflate_region,
|
||||||
|
is_curve,
|
||||||
|
is_junction,
|
||||||
|
is_link,
|
||||||
|
is_node,
|
||||||
|
is_pattern,
|
||||||
|
is_pipe,
|
||||||
|
is_project_open,
|
||||||
|
is_pump,
|
||||||
|
is_reservoir,
|
||||||
|
is_tank,
|
||||||
|
is_valve,
|
||||||
|
open_project,
|
||||||
|
pick_operation,
|
||||||
|
pick_snapshot,
|
||||||
|
read_all,
|
||||||
|
read_inp,
|
||||||
|
set_backdrop,
|
||||||
|
set_control,
|
||||||
|
set_curve,
|
||||||
|
set_demand,
|
||||||
|
set_district_metering_area,
|
||||||
|
set_emitter,
|
||||||
|
set_energy,
|
||||||
|
set_extension_data,
|
||||||
|
set_junction,
|
||||||
|
set_label,
|
||||||
|
set_mixing,
|
||||||
|
set_option,
|
||||||
|
set_option_v3,
|
||||||
|
set_pattern,
|
||||||
|
set_pipe,
|
||||||
|
set_pipe_reaction,
|
||||||
|
set_pump,
|
||||||
|
set_pump_energy,
|
||||||
|
set_quality,
|
||||||
|
set_reaction,
|
||||||
|
set_region,
|
||||||
|
set_reservoir,
|
||||||
|
set_rule,
|
||||||
|
set_scada_device,
|
||||||
|
set_scada_device_data,
|
||||||
|
set_scada_element,
|
||||||
|
set_service_area,
|
||||||
|
set_source,
|
||||||
|
set_status,
|
||||||
|
set_tag,
|
||||||
|
set_tank,
|
||||||
|
set_tank_reaction,
|
||||||
|
set_time,
|
||||||
|
set_title,
|
||||||
|
set_valve,
|
||||||
|
set_vertex,
|
||||||
|
set_virtual_district,
|
||||||
|
sync_with_server,
|
||||||
|
take_snapshot,
|
||||||
|
update_snapshot_for_current_operation,
|
||||||
|
write,
|
||||||
|
)
|
||||||
|
|
||||||
class TestApi:
|
class TestApi:
|
||||||
def enter(self, p):
|
def enter(self, p):
|
||||||
|
|||||||
Reference in New Issue
Block a user