add comment
This commit is contained in:
@@ -5,6 +5,18 @@ import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
async def get_nodes_type(cfg: object, tool: str, unit: str, pool) -> tuple:
|
||||
"""Recupera le informazioni sui nodi (tipo, canali, input) per un dato strumento e unità.
|
||||
|
||||
Args:
|
||||
cfg (object): L'oggetto di configurazione.
|
||||
tool (str): Il nome dello strumento.
|
||||
unit (str): Il nome dell'unità.
|
||||
pool: Il pool di connessioni al database.
|
||||
|
||||
Returns:
|
||||
tuple: Una tupla contenente quattro liste: canali, tipi, ain, din.
|
||||
Se non vengono trovati risultati, restituisce (None, None, None, None).
|
||||
"""
|
||||
|
||||
async with pool.acquire() as conn:
|
||||
async with conn.cursor(aiomysql.DictCursor) as cur:
|
||||
@@ -32,5 +44,3 @@ async def get_nodes_type(cfg: object, tool: str, unit: str, pool) -> tuple:
|
||||
ains.append(row['ain'])
|
||||
dins.append(row['din'])
|
||||
return channels, types, ains, dins
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user