plcviz/lib.rs
1//! plcviz - PLC code visualization library
2//!
3//! Generate SVG diagrams from L5X (Rockwell) and PLCopen XML (IEC 61131-3) files
4//! using layout-rs for professional graph layout and custom SVG generation for
5//! clean, valid output.
6//!
7//! # Supported Formats
8//!
9//! - **L5X**: Rockwell Automation (ControlLogix, CompactLogix, Studio 5000)
10//! - **PLCopen**: IEC 61131-3 TC6 XML (Siemens, CODESYS, Beckhoff, B&R, Beremiz)
11//!
12//! # Graph Types
13//!
14//! - **Structure**: Containment hierarchy (Controller/Project → Programs/POUs → Routines)
15//! - **CallGraph**: Execution flow (Routine → Routine via JSR/function calls)
16//! - **DataFlow**: Tag relationships (L5X) or DataType dependencies (PLCopen)
17//! - **Combined**: Both structure and calls
18//!
19//! # CLI Usage
20//!
21//! ```text
22//! plcviz [OPTIONS] <FILE>
23//!
24//! Arguments:
25//! <FILE> L5X or PLCopen XML file to visualize
26//!
27//! Options:
28//! -t, --type <TYPE> Graph type: structure, call, dataflow, combined [default: structure]
29//! -a, --aois Include AOIs in the graph (L5X only)
30//! -h, --help Print help
31//! ```
32//!
33//! # Examples
34//!
35//! ```bash
36//! # Generate structure graph from L5X
37//! plcviz project.L5X > graph.svg
38//!
39//! # Generate call graph from PLCopen
40//! plcviz -t call project.xml > calls.svg
41//!
42//! # Generate combined graph with AOIs
43//! plcviz -t combined -a project.L5X > combined.svg
44//! ```
45
46pub mod config;
47pub mod graph;
48pub mod svg;
49pub mod plcopen_graph;
50
51// Re-export main types
52pub use config::{GraphType, VizConfig, ElementFilter, NodeStyle, NodeStyles};
53pub use graph::{L5xGraph, L5xNode, L5xNodeType, L5xEdge};
54pub use plcopen_graph::{PlcopenGraphBuilder, PlcopenGraphType};