-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from equinor/story175069ExtendXLSTMappingBLuep…
…rint Extend XSLT mappings to handle NOAKADEXPI Blueprint dexpi
- Loading branch information
Showing
8 changed files
with
473 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Program Overview | ||
|
||
## Overview of XSLT Stylesheet for SVG Conversion | ||
|
||
This document outlines the components of the XSLT stylesheet designed to transform XML data from NOAKADexpi into a graphical SVG format. Specific templates within the stylesheet are responsible for various aspects of the SVG output. | ||
|
||
### SVG Structure and Design | ||
|
||
- **Base SVG Output (`/PlantModel` Template)**: This template is responsible for generating the foundational SVG structure, including setting the `width` and `viewBox` attributes based on the XML input. | ||
|
||
### Dynamic Visual Elements | ||
|
||
- **Matching piping linesTemplate**: This template draws SVG paths for elements like `CenterLine`, applying styles such as dashed lines to denote information flows. | ||
- **Positioning and Transformations**: It calculates the correct positioning and rotation for SVG elements. | ||
- **Template for PipingNetworkSystem**: Manages the creation of text labels on the lines, and its text orientation. | ||
- **Shape Catalog Template**: defines SVG symbols. It locates the appropriate `_Origo.svg` file based on the `shapeValue` and then processes text elements, passing their values as arguments to populate text fields within the Symbol SVG. Before appyling another template to the symbols. | ||
- **Style-Based Exclusions (`Style-Based Filtering` Section)**: Elements with specific stroke or fill colors are excluded from the output, which is a deliberate filtering process to manage the visual output when showing the symbols. | ||
- **Direct Element Copying (`Generic Copying` Section)**: To ensure all SVG elements not explicitly matched by other templates are included in the output, a generic copying process is employed. | ||
|
||
|
||
### Special Considerations and Notes | ||
|
||
- **Symbol Library Location**: The symbol library repo must be located in a adjacent folder to SSI-DEXPI-TEMP for the stylesheet to function correctly. | ||
- **Shape Exclusions and Fallbacks**: | ||
- The `BORDER_A1_Origo.svg` file does not exist, necessitating an `if` check to handle its absence. | ||
- Since `PV001A_Origo.svg` is also missing, an empty SVG text element was created as a placeholder. | ||
|
||
|
||
### Known Issues and Limitations | ||
- Not all nozzles are present in the provided data. | ||
|
||
|
||
|
||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Running the NOAKADEXPI Program | ||
|
||
This guide will help you run the NOAKADEXPI program that converts DEPI XML files to SVG format using the DEXPI2SVG tool. | ||
|
||
## Prerequisites | ||
|
||
Before you start, ensure that you have the following repository structure on your local machine: | ||
|
||
- `NOAKADEXPI` repository located adjacent to the `SSI_DEXPI_TEMP` repository. | ||
|
||
## Steps to Run the Program | ||
|
||
1. **Navigate to the Tool Directory** | ||
|
||
Open a command prompt or terminal window and navigate to the `Client/boundaries/Dexpi2svg` directory within the `NOAKADEXPI` repository. | ||
|
||
2. **Run the Conversion Command** | ||
|
||
Use the following command to convert your DEPI XML file to SVG format: | ||
|
||
```sh | ||
dotnet run "<path-to-your-xml-file>" "<path-to-your-xslt-file>" > output.svg | ||
``` | ||
|
||
Replace `<path-to-your-xml-file>` with the generic path to your DEPI XML file and `<path-to-your-xslt-file>` with the generic path to your XSLT file. | ||
|
||
3. **Addressing Missing Symbol Error** | ||
|
||
If you encounter an error about a missing symbol `PV001A_Origio.svg`, you will need to create it by following these steps: | ||
|
||
a. Create a new file inside the `NOAKADEXPI/SYMBOL/Origo` directory. | ||
|
||
b. Paste the following SVG content into the new file: | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | ||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" | ||
width="277.791mm" height="93.6551mm" viewBox="-64.8125 -10.8125 65.625 22.125"> | ||
<defs vector-effect="non-scaling-stroke" /> | ||
<g> | ||
</g> | ||
</svg> | ||
``` | ||
|
||
Name this file `PV001A_Origio.svg`. | ||
|
||
4. **Integrate the SVG Output** | ||
|
||
Once you have the `output.svg` file, you can integrate it into your `dexpi.html` file: | ||
|
||
a. Copy the full contents of `output.svg`. | ||
|
||
b. Paste the copied SVG content into `dexpi.html` after the line `<?xml version='1.0' encoding='UTF-8'?>`. | ||
|
||
Ensure that the end of your `dexpi.html` file only contains the following lines: | ||
|
||
```html | ||
<script src="script.js" crossorigin="anonymous"></script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
5. **View the Result** | ||
|
||
Open `dexpi.html` in a web browser to view the SVG representation of your DEPI XML file. You should now be able to click on the components within the SVG as intended. | ||
If you want to be able to create boundaries you must use RDFox aswell, to manage this see the README in client/boundaries. |
Oops, something went wrong.