#!/usr/bin/env python3 """A complete GEM tool in ~25 lines. Run secs_gemd, then this. The fab host can poll ChamberPressure, receive ProcessStarted events, get alarms above the threshold, and START the tool — all SEMI plumbing handled by the daemon. """ import random import time from secsgem_client import Equipment eq = Equipment("localhost:50051") @eq.on("START") def start(cmd): print("host says START", cmd.params) eq.fire("ProcessStarted") eq.listen(background=True) while True: pressure = round(random.uniform(1.0, 3.0), 3) eq.set(ChamberPressure=pressure) if pressure > 2.9: eq.alarm("chiller_temp_high") else: eq.clear("chiller_temp_high") time.sleep(1)