# hallvaeb/automation-p3-pipe-routing architecture

> Architecture diagram of the GitHub repository hallvaeb/automation-p3-pipe-routing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hallvaeb/automation-p3-pipe-routing
- Repository: https://github.com/hallvaeb/automation-p3-pipe-routing

## Overview

This repository is a pipe-routing design generator for Aker Solutions. A user selects a predefined equipment scenario and email in the interface; the controller builds the environment, equipment, and pipe inputs, generates routes, writes a DFA design, and optionally emails it. Routing is split between route sequencing and per-route geometry, then converted into straight and elbow elements. The DFA builder uses templates and generated identifiers to assemble the design. The README gives little implementation detail; the workflow and component links here are based on the sampled source, while the template-based DFA output is also evident from the tree.

Main entry points: [`controller/Controller.py`](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/Controller.py) (Workflow controller), [`controller/DFABuilder.py`](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/DFABuilder.py) (DFA assembly), [`UserInterface.py`](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/UserInterface.py) (User interface), [`controller/EmailHandler.py`](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/EmailHandler.py) (Email delivery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_ui["User interface<br/>[UserInterface.py]"]
  node_parameters["Preset scenarios"]
  node_controller["Workflow controller<br/>[Controller.py]"]
end

subgraph group_domain["Routing Domain"]
  node_environment["Environment model<br/>[Environment.py]"]
  node_equipment["Equipment model<br/>[Equipment.py]"]
  node_pipe["Pipe specification<br/>[Pipe.py]"]
  node_pathgenerator["Route sequencing<br/>[PathGenerator.py]"]
  node_path["Route geometry<br/>[Path.py]"]
  node_pipeelement["Pipe elements<br/>[PipeElement.py]"]
end

subgraph group_generation["Design Generation"]
  node_idgenerator["ID generation<br/>[IDGenerator.py]"]
  node_dfabuilder["DFA assembly<br/>[DFABuilder.py]"]
  node_templates["DFA templates"]
  node_design["Generated DFA"]
end

subgraph group_delivery["Output Delivery"]
  node_emailhandler["Email delivery<br/>[EmailHandler.py]"]
  node_smtp["SMTP email service"]
end

node_user(("User"))

node_user -->|"starts"| node_ui
node_ui -->|"requests scenario"| node_parameters
node_ui -->|"submits inputs"| node_controller
node_parameters -->|"returns parameters"| node_controller
node_controller -->|"constructs"| node_environment
node_controller -->|"constructs"| node_equipment
node_controller -->|"constructs"| node_pipe
node_controller -->|"generates routes"| node_pathgenerator
node_pathgenerator -->|"creates routes"| node_path
node_path -->|"creates elements"| node_pipeelement
node_pipeelement -->|"requests IDs"| node_idgenerator
node_controller -->|"builds design"| node_dfabuilder
node_dfabuilder -->|"requests IDs"| node_idgenerator
node_dfabuilder -->|"reads templates"| node_templates
node_dfabuilder -->|"writes DFA"| node_design
node_controller -->|"sends design"| node_emailhandler
node_emailhandler -->|"reads attachment"| node_design
node_emailhandler -->|"sends email"| node_smtp

click node_ui "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/UserInterface.py"
click node_parameters "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/inputOutput/ParameterContainer.py"
click node_controller "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/Controller.py"
click node_environment "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Environment.py"
click node_equipment "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Equipment.py"
click node_pipe "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Pipe.py"
click node_pathgenerator "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/PathGenerator.py"
click node_path "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Path.py"
click node_pipeelement "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/PipeElement.py"
click node_idgenerator "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/IDGenerator.py"
click node_dfabuilder "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/DFABuilder.py"
click node_templates "https://github.com/hallvaeb/automation-p3-pipe-routing/tree/master/inputOutput/templates"
click node_design "https://github.com/hallvaeb/automation-p3-pipe-routing/tree/master/inputOutput"
click node_emailhandler "https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/EmailHandler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_parameters,node_controller,node_user toneBlue
class node_environment,node_equipment,node_pipe,node_pathgenerator,node_path,node_pipeelement toneAmber
class node_idgenerator,node_dfabuilder,node_templates,node_design toneMint
class node_emailhandler,node_smtp toneRose
```

## Components

### User Entry

- [User interface](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/UserInterface.py): `UserInterface.py`
- [Preset scenarios](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/inputOutput/ParameterContainer.py): `inputOutput/ParameterContainer.py`
- [Workflow controller](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/Controller.py): `controller/Controller.py`

### Routing Domain

- [Environment model](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Environment.py): `model/Environment.py`
- [Equipment model](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Equipment.py): `model/Equipment.py`
- [Pipe specification](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Pipe.py): `model/Pipe.py`
- [Route sequencing](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/PathGenerator.py): `controller/PathGenerator.py`
- [Route geometry](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/Path.py): `model/Path.py`
- [Pipe elements](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/model/PipeElement.py): `model/PipeElement.py`

### Design Generation

- [ID generation](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/IDGenerator.py): `controller/IDGenerator.py`
- [DFA assembly](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/DFABuilder.py): `controller/DFABuilder.py`
- [DFA templates](https://github.com/hallvaeb/automation-p3-pipe-routing/tree/master/inputOutput/templates): `inputOutput/templates`
- [Generated DFA](https://github.com/hallvaeb/automation-p3-pipe-routing/tree/master/inputOutput): `inputOutput`

### Output Delivery

- [Email delivery](https://github.com/hallvaeb/automation-p3-pipe-routing/blob/master/controller/EmailHandler.py): `controller/EmailHandler.py`
- **SMTP email service**

### Other components

- **User**

## Connections

- User → User interface: starts
- User interface → Preset scenarios: requests scenario
- User interface → Workflow controller: submits inputs
- Preset scenarios → Workflow controller: returns parameters
- Workflow controller → Environment model: constructs
- Workflow controller → Equipment model: constructs
- Workflow controller → Pipe specification: constructs
- Workflow controller → Route sequencing: generates routes
- Route sequencing → Route geometry: creates routes
- Route geometry → Pipe elements: creates elements
- Pipe elements → ID generation: requests IDs
- Workflow controller → DFA assembly: builds design
- DFA assembly → ID generation: requests IDs
- DFA assembly → DFA templates: reads templates
- DFA assembly → Generated DFA: writes DFA
- Workflow controller → Email delivery: sends design
- Email delivery → Generated DFA: reads attachment
- Email delivery → SMTP email service: sends email
