Expand description
bhtune-driver — the extensibility seam.
Defines a single async Driver trait abstracting all tag I/O (read/write/
browse/search) so bhtune-core’s tuning engine never knows what it is talking to. Three
implementations exist:
opcda: the primary driver for v1 (OpcDaDriver), over theopcda-bridgecrates.io dependency (Windows OPC DA via a network gateway — no COM/DCOM dependency in this process). Also home toget_opcda_gateway_info,check_gateway_compatibility, andlist_opcda_servers, standalone pre-connection functions for gateway diagnostics, gateway protocol compatibility checks, and OPC DA server discovery (see those functions’ doc comments for why they aren’tDriver/OpcDaDrivermethods).simulator: an in-process FOPDT (first-order-plus-dead-time) process model (SimulatorDriver), used for fully automated E2E tests on CI (no Windows, no Kepware, no external process) and as a demo mode. Also home toVirtualPid, a standalone PID controller for closed-loop validation/demos.replay: feeds a recorded golden-master trace (ReplayDriver) back through the engine, for regression validation — see that module’s doc comment for why this complements, rather than duplicates, the pure-engine parity test inbhtune-core.
OpcUaDriver and ModbusDriver are roadmap items
(see docs/roadmap.md) that can slot in without requiring changes to bhtune-core.
driver— theDrivertrait itself.types— the plain data types (TagId,TagValue,TagWrite,WriteOutcome, browse-page, capability, and search types) that cross the trait boundary.error— the crate’s error type,DriverError.opcda—OpcDaDriver, the OPC DA implementation, gateway diagnostics, gateway compatibility checks (OpcDaGatewayCompatibility), andlist_opcda_servers.simulator—SimulatorDriver,FopdtProcess/FopdtConfig, andVirtualPid/VirtualPidConfig.replay—ReplayDriver,ReplaySample, andRecordedWrite.
Re-exports§
pub use driver::Driver;pub use error::DriverError;pub use error::DriverResult;pub use opcda::DEFAULT_INDEX_SEARCH_MAX_RESULTS;pub use opcda::DEFAULT_PAGE_SIZE;pub use opcda::DEFAULT_SEARCH_MAX_RESULTS;pub use opcda::OpcDaCompatibilitySource;pub use opcda::OpcDaCompatibilityStatus;pub use opcda::OpcDaDriver;pub use opcda::OpcDaFeatureCompatibility;pub use opcda::OpcDaFeatureCompatibilityStatus;pub use opcda::OpcDaGatewayCompatibility;pub use opcda::OpcDaGatewayFeature;pub use opcda::OpcDaGatewayFeatureSupport;pub use opcda::OpcDaGatewayInfo;pub use opcda::OpcDaProtocolRange;pub use opcda::check_gateway_compatibility;pub use opcda::close_opcda_browse_session;pub use opcda::get_opcda_gateway_info;pub use opcda::list_opcda_servers;pub use readonly::ReadOnlyDriver;pub use replay::RecordedWrite;pub use replay::ReplayDriver;pub use replay::ReplaySample;pub use replay::ReplayTraceExhausted;pub use simulator::FopdtConfig;pub use simulator::FopdtProcess;pub use simulator::SimulatorDriver;pub use simulator::VirtualPid;pub use simulator::VirtualPidConfig;pub use types::BrowseBreadcrumb;pub use types::BrowseNode;pub use types::BrowseNodeKind;pub use types::BrowsePage;pub use types::BrowsePageRequest;pub use types::BrowseSource;pub use types::DriverCapabilities;pub use types::IndexSchedulerDiagnostics;pub use types::IndexedSearchMatch;pub use types::IndexedSearchProgress;pub use types::NamespaceOrganization;pub use types::Quality;pub use types::SearchCompleted;pub use types::SearchEvent;pub use types::SearchIndexControlAction;pub use types::SearchIndexRequest;pub use types::SearchIndexResponse;pub use types::SearchIndexState;pub use types::SearchIndexStatus;pub use types::SearchMatch;pub use types::SearchMatchMode;pub use types::SearchProgress;pub use types::SearchRequest;pub use types::TagId;pub use types::TagValue;pub use types::TagWrite;pub use types::WriteOutcome;
Modules§
- driver
- The
Drivertrait: bhtune’s single seam for all tag I/O. - error
- Errors a
crate::Drivermethod can fail with. - opcda
OpcDaDriver: the primaryDriverimplementation, talking to a DCS/PLC’s OPC DA server through theopcda-bridgegateway’s gRPC API.- readonly
- A driver adapter that forwards reads but never forwards writes.
- replay
ReplayDriver: feeds a previously captured golden-master trace back through theDrivertrait, tick by tick, instead of a live OPC DA connection or the in-process FOPDT simulator.- simulator
SimulatorDriver: an in-process FOPDT (first-order-plus-dead-time) process model, served through theDrivertrait, for fully automated E2E tests (no Windows, no Kepware, no external process) and demo mode.- types
- Plain data types moved across the
crate::Drivertrait boundary.