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 tolist_opcda_servers, a standalone pre-connection function for OPC DA server discovery (see that function’s doc comment for why it isn’t aDriver/OpcDaDrivermethod).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,core-replay-harness’s pure-engine parity proof.
OpcUaDriver and ModbusDriver are roadmap items (see AGENTS.md) that should slot in
later without requiring any 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, 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::OpcDaDriver;pub use opcda::close_opcda_browse_session;pub use opcda::list_opcda_servers;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.- 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.