# renny-l/swen383 architecture

> Architecture diagram of the GitHub repository renny-l/swen383, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/renny-l/swen383
- Repository: https://github.com/renny-l/swen383

## Overview

This is a small Java weather-station monitor: its entry points create a station, start periodic sampling, and present observer updates in either text or Swing form. The station owns temperature and pressure sensors, converts readings into display units, and notifies attached views. Sensor simulations, sampling/state management, and the two presentation options are the meaningful runtime layers. The README is empty; relationships below are supported by the provided source excerpts.

Main entry points: [`WeatherStation_Pressure.java`](https://github.com/renny-l/swen383/blob/main/WeatherStation_Pressure.java) (Weather station), [`TextUI_Pressure.java`](https://github.com/renny-l/swen383/blob/main/TextUI_Pressure.java) (Text monitor), [`SwingUI_Pressure.java`](https://github.com/renny-l/swen383/blob/main/SwingUI_Pressure.java) (Swing monitor), [`KelvinTempSensor.java`](https://github.com/renny-l/swen383/blob/main/KelvinTempSensor.java) (Temperature sensor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensors["Sensor simulations"]
  node_temp["Temperature sensor"]
  node_pressure["Pressure sensor<br/>[Barometer.java]"]
end

subgraph group_station["Sampling and conversion"]
  node_station["Weather station"]
end

subgraph group_views["Observer displays"]
  node_text["Text monitor"]
  node_swing["Swing monitor"]
end

node_user(("User"))

node_user -->|"starts"| node_text
node_user -->|"starts"| node_swing
node_text -->|"creates and starts"| node_station
node_swing -->|"creates and starts"| node_station
node_station -->|"reads"| node_temp
node_station -->|"reads"| node_pressure
node_station -->|"notifies"| node_text
node_station -->|"notifies"| node_swing
node_text -->|"retrieves converted readings"| node_station
node_swing -->|"retrieves converted readings"| node_station

click node_temp "https://github.com/renny-l/swen383/blob/main/KelvinTempSensor.java"
click node_pressure "https://github.com/renny-l/swen383/blob/main/Barometer.java"
click node_station "https://github.com/renny-l/swen383/blob/main/WeatherStation_Pressure.java"
click node_text "https://github.com/renny-l/swen383/blob/main/TextUI_Pressure.java"
click node_swing "https://github.com/renny-l/swen383/blob/main/SwingUI_Pressure.java"

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_temp,node_pressure,node_user toneBlue
class node_station toneAmber
class node_text,node_swing toneMint
```

## Components

### Sensor simulations

- [Temperature sensor](https://github.com/renny-l/swen383/blob/main/KelvinTempSensor.java): `KelvinTempSensor.java`
- [Pressure sensor](https://github.com/renny-l/swen383/blob/main/Barometer.java): `Barometer.java`

### Sampling and conversion

- [Weather station](https://github.com/renny-l/swen383/blob/main/WeatherStation_Pressure.java): `WeatherStation_Pressure.java`

### Observer displays

- [Text monitor](https://github.com/renny-l/swen383/blob/main/TextUI_Pressure.java): `TextUI_Pressure.java`
- [Swing monitor](https://github.com/renny-l/swen383/blob/main/SwingUI_Pressure.java): `SwingUI_Pressure.java`

### Other components

- **User**

## Connections

- User → Text monitor: starts (evidence: `TextUI_Pressure.java`)
- User → Swing monitor: starts (evidence: `SwingUI_Pressure.java`)
- Text monitor → Weather station: creates and starts (evidence: `TextUI_Pressure.java`)
- Swing monitor → Weather station: creates and starts (evidence: `SwingUI_Pressure.java`)
- Weather station → Temperature sensor: reads (evidence: `WeatherStation_Pressure.java`)
- Weather station → Pressure sensor: reads (evidence: `WeatherStation_Pressure.java`)
- Weather station → Text monitor: notifies (evidence: `TextUI_Pressure.java`)
- Weather station → Swing monitor: notifies (evidence: `SwingUI_Pressure.java`)
- Text monitor → Weather station: retrieves converted readings (evidence: `TextUI_Pressure.java`)
- Swing monitor → Weather station: retrieves converted readings (evidence: `SwingUI_Pressure.java`)
