hitl_tester.test_cases.bms.test_ngi_sim

Activate and use the cell simulators to confirm the hardware is working.

 1"""
 2Activate and use the cell simulators to confirm the hardware is working.
 3"""
 4
 5from time import sleep
 6
 7import pytest
 8
 9from hitl_tester.modules.bms.bms_hw import BMSHardware
10from hitl_tester.modules.logger import logger
11
12bms_hardware = BMSHardware(pytest.flags)  # type: ignore[arg-type]
13bms_hardware.init()
14
15
16def test_cell_sim():
17    """Activate and measure cell properties."""
18    for cell in bms_hardware.cells.values():
19        logger.write_info_to_report(f"Setting cell voltage {cell.id}")
20        cell.volts = 3.8002
21        logger.write_info_to_report(f"Enabling cell {cell.id}")
22        cell.enable()
23    while True:
24        logger.write_info_to_report("Scanning")
25        for i, cell in bms_hardware.cells.items():
26            logger.write_info_to_report(f"Cell {i}: {cell.ohms}, {cell.volts}, {cell.amps}")
27        sleep(0.5)
def test_cell_sim():
17def test_cell_sim():
18    """Activate and measure cell properties."""
19    for cell in bms_hardware.cells.values():
20        logger.write_info_to_report(f"Setting cell voltage {cell.id}")
21        cell.volts = 3.8002
22        logger.write_info_to_report(f"Enabling cell {cell.id}")
23        cell.enable()
24    while True:
25        logger.write_info_to_report("Scanning")
26        for i, cell in bms_hardware.cells.items():
27            logger.write_info_to_report(f"Cell {i}: {cell.ohms}, {cell.volts}, {cell.amps}")
28        sleep(0.5)

Activate and measure cell properties.