How sharkbia/ptz-control-system works
PTZ 云台控制系统 provides a GUI for configuring communications and controlling a pan-tilt head. The main workflow initializes GS-232B and Pelco-D connections, receives and parses GS-232B commands, translates angle queries or settings into Pelco-D packets, and returns responses; the UI also exposes manual controls and logs. The tree and excerpts support this control path and serial/TCP/UDP transports. UI configuration, persistence, and some capabilities are documented or visible only in partial excerpts, so their internal wiring is shown only where supported.
Main entry points: controller.py Control system · main_window.py Main window · interfaces.py GS-232B transport · protocols.py Pelco-D protocol
Components 15
GUI and configuration
- Application entry
main.py - Main window
ui/main_window.py - Device settings
ui/main_window.py - Saved configuration
- Log display
ui/main_window.py
Command control
- Control system
core/controller.py - GS-232B parsing
core/protocols.py - Command dispatch
core/controller.py - Angle control
core/controller.py - Pelco-D protocol
core/protocols.py
Hardware communications
- GS-232B transport
hardware/interfaces.py - Serial/TCP/UDP
hardware/interfaces.py
Other components
- Operator
- GS-232B client
- PTZ head
Connections 21
- Operator → Main window: operates
- Application entry → Main window: launches
- Main window → Device settings: configures
- Device settings → Saved configuration: saves/loads
- Main window → Control system: starts/stops
- Main window → Control system: manual angle
- Control system → GS-232B transport: creates
- Control system → Pelco-D protocol: constructs
- GS-232B transport → Serial/TCP/UDP: uses
- Pelco-D protocol → Serial/TCP/UDP: uses
- GS-232B client → GS-232B transport: sends commands
- GS-232B transport → Control system: receives bytes
- Control system → GS-232B parsing: parses bytes
- Control system → Command dispatch: dispatches commands
- Command dispatch → Angle control: handles angles
- Angle control → Pelco-D protocol: queries/sets angles
- Pelco-D protocol → Serial/TCP/UDP: sends packets
- Serial/TCP/UDP → PTZ head: communicates
- Control system → GS-232B transport: sends responses
- Control system → Log display: logs messages
- Serial/TCP/UDP → Log display: logs errors