""" Configuration for COM Port Test Writer """ import os from dotenv import load_dotenv load_dotenv() # COM Port Settings COM_PORT = os.getenv('COM_PORT', 'COM4') BAUD_RATE = int(os.getenv('BAUD_RATE', 9600)) TIMEOUT = int(os.getenv('TIMEOUT', 1)) # Test Data Settings WRITE_INTERVAL = float(os.getenv('WRITE_INTERVAL', 0.2)) # seconds between writes TEST_DATA_TYPE = os.getenv('TEST_DATA_TYPE', 'scales') # 'scales', 'counter', 'random' # Scales data - simulated weighing cycle: idle at 0, ramp up, hold stable, drop back EMPTY_MIN = int(os.getenv('EMPTY_MIN', 15000)) EMPTY_MAX = int(os.getenv('EMPTY_MAX', 22000)) FULL_MIN = int(os.getenv('FULL_MIN', 35000)) FULL_MAX = int(os.getenv('FULL_MAX', 45000)) IDLE_SECONDS = float(os.getenv('IDLE_SECONDS', 2.0)) # at 0 between trucks RAMP_SECONDS = float(os.getenv('RAMP_SECONDS', 1.5)) # 0 -> target STABLE_SECONDS = float(os.getenv('STABLE_SECONDS', 5.0)) # balanced at target DROP_SECONDS = float(os.getenv('DROP_SECONDS', 1.0)) # target -> 0 # Scale division (multi-interval): readings snap to DIVISION_SMALL below # DIVISION_THRESHOLD, DIVISION_LARGE at or above it. DIVISION_SMALL = int(os.getenv('DIVISION_SMALL', 20)) DIVISION_LARGE = int(os.getenv('DIVISION_LARGE', 50)) DIVISION_THRESHOLD = int(os.getenv('DIVISION_THRESHOLD', 40000)) # Application Settings DEBUG = os.getenv('DEBUG', 'True') == 'True'