add comment

This commit is contained in:
2025-07-11 22:06:45 +02:00
parent 0022d0e326
commit b1ce9061b1
8 changed files with 212 additions and 591 deletions

View File

@@ -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