From c1a5759220097d124c9f4c53123d0c6ba6ce37d7 Mon Sep 17 00:00:00 2001 From: xinzish <32566857+xinzish@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:23:02 +0800 Subject: [PATCH] read Region sections in inp --- demo.py | 2 +- get_current_total_Q.py | 6 ++++++ script/sql/create/0.base.sql | 8 ++++++++ script/sql/drop/0.base.sql | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/demo.py b/demo.py index 6c152fc..fcc56eb 100644 --- a/demo.py +++ b/demo.py @@ -1,4 +1,4 @@ from tjnetwork import * - +read_inp("testDMA","testWDA.inp") print(list_project()) diff --git a/get_current_total_Q.py b/get_current_total_Q.py index e69de29..69c4bad 100644 --- a/get_current_total_Q.py +++ b/get_current_total_Q.py @@ -0,0 +1,6 @@ +from tjnetwork import * +from get_realValue import * +def get_current_total_Q(): + ids=['3489'] + total_q=get_realValue(ids) + return total_q diff --git a/script/sql/create/0.base.sql b/script/sql/create/0.base.sql index 255d95b..75d70d7 100644 --- a/script/sql/create/0.base.sql +++ b/script/sql/create/0.base.sql @@ -4,6 +4,8 @@ create type _link_type as enum ('pipe', 'pump', 'valve'); create type _curve_type as enum ('PUMP', 'EFFICIENCY', 'VOLUME', 'HEADLOSS'); +create type _region_type as enum ('DISTRIBUTION', 'DMA', 'SA', 'PMA','VA'); + create table _node ( id varchar(32) primary key @@ -26,3 +28,9 @@ create table _pattern ( id varchar(32) primary key ); + +create table _region +( + id varchar(32) primary key +, type _region_type not null +); \ No newline at end of file diff --git a/script/sql/drop/0.base.sql b/script/sql/drop/0.base.sql index e76a8ad..d208534 100644 --- a/script/sql/drop/0.base.sql +++ b/script/sql/drop/0.base.sql @@ -1,3 +1,5 @@ +drop table if exists _region; + drop table if exists _pattern; drop table if exists _curve;