diff --git a/access_node/__main__.py b/access_node/__main__.py index 4336dd4c8fa02907a49eede1bdec67672149b3d3..0fcc2f6166dd2afeb94d9bee93e55c6deb5a46b7 100644 --- a/access_node/__main__.py +++ b/access_node/__main__.py @@ -12,7 +12,7 @@ import requests import psycopg2 -def SetupDB(postgres_username, postgres_password, port): +def SetupNestDB(postgres_username, postgres_password, port): con = psycopg2.connect(database="postgres", user=postgres_username, password=postgres_password, host="database", port=str(port)) print("Database connection opened successfully!") @@ -54,7 +54,7 @@ def SetupDB(postgres_username, postgres_password, port): def main(): # Connect to the Database and initalize basic Table structure - SetupDB('postgres', 'docker', 5432) + SetupNestDB('postgres', 'docker', 5432) # get info node with open('access_node//info_node.json', 'r') as f: diff --git a/access_node/controllers/nest_controller.py b/access_node/controllers/nest_controller.py index 428de81b6b0fd846d8c59bb7c1f55b7d19e59a2f..f53a4ab5f638a7f419536c058e0766ec57aee757 100644 --- a/access_node/controllers/nest_controller.py +++ b/access_node/controllers/nest_controller.py @@ -228,9 +228,12 @@ def nest_get_simulation_time_info(): # noqa: E501 password="docker", host="database", port="5432") cur = con.cursor() - cur.execute("SELECT MAX(CURRENT_SIM_TIME) FROM SIMULATION_NODES") - time = cur.fetchall()[0][0] - return time + cur.execute("SELECT MIN(CURRENT_SIM_TIME) FROM SIMULATION_NODES") + current_time = cur.fetchall()[0][0] + + # TODO Add Start and End time when available + time_info = SimulationTimeInfo(current=current_time) + return time_info def nest_get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501