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
23cde5d7
Commit
23cde5d7
authored
5 years ago
by
Jan Müller
Browse files
Options
Downloads
Patches
Plain Diff
Add missing implementations for Arbor controller
parent
76f126f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Feature/add arbor support
Pipeline
#163331
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
+10
-6
10 additions, 6 deletions
access_node/__main__.py
access_node/controllers/arbor_controller.py
+19
-7
19 additions, 7 deletions
access_node/controllers/arbor_controller.py
with
29 additions
and
13 deletions
access_node/__main__.py
+
10
−
6
View file @
23cde5d7
...
...
@@ -76,19 +76,23 @@ def SetupArborTables(postgres_username, postgres_password, port):
FOREIGN KEY (CELL_ID) REFERENCES CELLS (CELL_ID),
);
'''
)
cur
.
execute
(
'''
CREATE TABLE ATTRIBUTES (
ATTRIBUTE_ID INT PRIMARY KEY NOT NULL UNIQUE,
NAME VARCHAR(50) NOT NULL,
);
'''
)
cur
.
execute
(
'''
CREATE TABLE PROBES (
PROBE_ID INT PRIMARY KEY NOT NULL UNIQUE,
CELL_ID INT NOT NULL,
SEGMENT_ID INT NOT NULL,
POSITION FLOAT,
NODE_ID INT,
ATTRIBUTE_ID INT NOT NULL,
NODE_ID INT,
FOREIGN KEY (NODE_ID) REFERENCES ARBOR_SIMULATION_NODES (NODE_ID),
FOREIGN KEY (CELL_ID) REFERENCES CELLS (CELL_ID));
'''
)
FOREIGN KEY (CELL_ID) REFERENCES CELLS (CELL_ID),
FOREIGN KEY (ATTRIBUTE_ID) REFERENCES ATTRIBUTES (ATTRIBUTE_ID));
'''
)
cur
.
execute
(
'''
CREATE TABLE ATTRIBUTES (
ATTRIBUTE_ID INT PRIMARY KEY NOT NULL UNIQUE,
NAME VARCHAR(50) NOT NULL,
);
'''
)
con
.
commit
()
con
.
close
()
...
...
This diff is collapsed.
Click to expand it.
access_node/controllers/arbor_controller.py
+
19
−
7
View file @
23cde5d7
...
...
@@ -157,15 +157,27 @@ def arbor_get_probes(attribute=None): # noqa: E501
con
=
connect_to_database
()
cur
=
con
.
cursor
()
# TODO Multiple Attributes per Probe possible? - Complete this
if
attribute
==
None
:
cur
.
execute
(
"
SELECT PROBE_ID, CELL_ID, SEGMENT_ID, POSITION FROM PROBES
"
)
cur
.
execute
(
'''
SELECT
PROBES.PROBE_ID,
PROBES.CELL_ID,
PROBES.SEGMENT_ID,
PROBES.POSITION,
FROM PROBES
'''
)
else
:
cur
.
execute
(
'''
SELECT
PROBES.PROBE_ID,
PROBES.CELL_ID,
PROBES.SEGMENT_ID,
PROBES.POSITION,
FROM PROBES INNER JOIN ATTRIBUTES
ON PROBES.ATTRIBUTE_ID = ATTRIBUTES.ATTRIBUTE_ID
WHERE ATTRIBUTES.NAME = %s
'''
,
(
attribute
,))
probes
=
np
.
array
(
cur
.
fetchall
())
con
.
close
()
return
return
[
Probe
(
*
probe
)
for
probe
in
probes
]
def
arbor_get_simulation_time_info
():
# noqa: E501
...
...
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