Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
access-node
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LuFG VR VIS
VR-Group
In Situ Pipeline
access-node
Commits
92c0a9ce
Commit
92c0a9ce
authored
5 years ago
by
Jan Müller
Browse files
Options
Downloads
Patches
Plain Diff
Edit nest table desing
parent
23cde5d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Feature/add arbor support
Pipeline
#163334
failed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
access_node/__main__.py
+1
-1
1 addition, 1 deletion
access_node/__main__.py
access_node/controllers/nest_controller.py
+8
-10
8 additions, 10 deletions
access_node/controllers/nest_controller.py
with
9 additions
and
11 deletions
access_node/__main__.py
+
1
−
1
View file @
92c0a9ce
...
...
@@ -31,7 +31,7 @@ def SetupNestTables(postgres_username, postgres_password, port):
cur
.
execute
(
'''
CREATE TABLE MULTIMETERS (
MULTIMETER_ID INT PRIMARY KEY NOT NULL UNIQUE,
ATTRIBUTE CHAR(50) );
'''
)
ATTRIBUTE
VAR
CHAR(50) );
'''
)
cur
.
execute
(
'''
CREATE TABLE GIDS (
GID INT PRIMARY KEY NOT NULL UNIQUE,
...
...
This diff is collapsed.
Click to expand it.
access_node/controllers/nest_controller.py
+
8
−
10
View file @
92c0a9ce
...
...
@@ -48,8 +48,8 @@ def nest_get_gids_in_population(population_id): # noqa: E501
:rtype: List[int]
"""
con
=
connect_to_database
()
cur
=
con
.
cursor
()
cur
.
execute
(
"
SELECT GID FROM GIDS WHERE GIDS.POPULATION_ID =
"
+
str
(
population_id
))
gids
=
[
i
[
0
]
for
i
in
cur
.
fetchall
()]
...
...
@@ -68,21 +68,19 @@ def nest_get_multimeter_info(): # noqa: E501
con
=
connect_to_database
()
cur
=
con
.
cursor
()
cur
.
execute
(
"
SELECT MULTIMETER_ID FROM MULTIMETERS
"
)
mult_ids
=
cur
.
fetchall
()
ur
.
execute
(
"
SELECT * FROM MULTIMETERS;
"
)
attributes
=
np
.
array
(
cur
.
fetchall
())
cur
.
execute
(
"
SELECT regexp_replace(ATTRIBUTE,
'
\s+$
'
,
''
) FROM (SELECT * FROM MULTIMETERS) AS MULT_INFO;
"
)
attributes
=
cur
.
fetchall
()
gids
=
[]
for
id
in
mult_ids
:
for
id
in
attributes
[:,
0
]
:
cur
.
execute
(
"
SELECT GID FROM MULT_PER_GID WHERE MULTIMETER_ID = %s
"
,
(
id
,))
gids
.
append
([
i
[
0
]
for
i
in
cur
.
fetchall
()])
mult_info
=
[]
for
i
in
range
(
len
(
mult_id
s
)):
mult_info
.
append
({
"
id
"
:
mult_id
s
[
i
][
0
],
"
attributes
"
:
attributes
[
i
][
0
],
for
i
in
range
(
len
(
attribute
s
)):
mult_info
.
append
({
"
id
"
:
attribute
s
[
i
][
0
],
"
attributes
"
:
attributes
[
i
][
1
],
"
gids
"
:
gids
[
i
]})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment