Proxy controller component aggregating multiple device controllers.
CDeviceControllerProxyComp implements the Proxy Pattern to aggregate multiple IDeviceController instances into a unified interface. It provides seamless access to devices from different controllers through a single entry point.
This component is essential for systems with multiple device types managed by different controllers, enabling:
- Unified device enumeration across all controllers
- Automatic routing of operations to appropriate controller
- Aggregated device type and instance lists
- Centralized state tracking
- Automatic periodic enumeration
- Key Features:
- Multi-Controller Aggregation: Manages multiple IDeviceController instances
- Automatic Enumeration: Configurable periodic enumeration (default: 5 seconds)
- Smart Routing: Routes device operations to correct underlying controller
- Unified Device List: Combines devices from all controllers
- State Aggregation: Unified state provider across all controllers
- Change Tracking: Multi-model dispatcher for tracking all controller changes
- Component Structure:
- The component exposes multiple sub-elements:
- DeviceTypeList: Collection of all supported device types from all controllers
- DeviceList: Aggregated list of devices from all controllers (ICollectionInfo)
- DeviceStateProvider: Unified state provider (IDeviceStateProvider)
- OverriddenDeviceInfo: Collection of custom names/descriptions
- Configuration:
- DeviceControllers: Multi-reference to IDeviceController instances to aggregate
- EnableEnumerationControl: Enable automatic enumeration (default: false)
- EnumerationInterval: Time between enumeration cycles in seconds (default: 5, 0 = continuous)
- Enumeration Control:
- When enabled, the proxy automatically:
- Enumerates all controllers periodically
- Updates aggregated device lists
- Handles enumeration failures gracefully
- Respects the configured interval
- Usage Pattern:
pProxy->AddDeviceController(pController1);
pProxy->AddDeviceController(pController2);
pProxy->SetEnumerationControl(true);
pProxy->SetEnumerationInterval(5);
const ICollectionInfo& allDevices = pProxy->GetDeviceInstanceList();
DeviceAccessorPtr pAccessor = pProxy->OpenDevice(deviceId, nullptr);
Proxy controller component aggregating multiple device controllers.
Common interface for controlling devices.
- Thread Safety:
- Inherits thread safety from CMultiModelDispatcherBase
- Uses Qt timer for periodic enumeration (thread-safe signal/slot)
- Controller operations are delegated with proper synchronization
- See also
- IDeviceController
-
CDeviceControllerCompBase
-
imod::CMultiModelDispatcherBase
Definition at line 100 of file CDeviceControllerProxyComp.h.