# thorstenb/ig-logger architecture

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

- Interactive diagram: https://gitdiagram.com/thorstenb/ig-logger
- Repository: https://github.com/thorstenb/ig-logger

## Overview

ig-logger is a C++ application that polls a local network of solar-energy devices, decodes current and historical readings, and persists or broadcasts results. The main loop drives LocalNet processing; LocalNet coordinates device communication, data decoding, and configured outputs. The tree and excerpts establish several of these links, but leave some subsystem wiring unseen, so uncertain connections are omitted. The empty README provides no additional capability claims.

Main entry points: [`clsLocalNet.c`](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNet.c) (Local Network), [`logig_main.c`](https://github.com/thorstenb/ig-logger/blob/master/logig_main.c) (Application Loop), [`clsData.h`](https://github.com/thorstenb/ig-logger/blob/master/clsData.h) (Data Types), [`clsLocalNetCurrentValues.c`](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetCurrentValues.c) (Current Values)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Control"]
  node_main["Application Loop<br/>[logig_main.c]"]
  node_watchdog["Watchdog<br/>[clsWatchdog.h]"]
  node_errors["Error Types<br/>[clsExcept.h]"]
  node_config["Location Config<br/>[clsConfig.h]"]
end

subgraph group_network["Device Network"]
  node_serial["Serial I/O<br/>[clsSerialIO.c]"]
  node_interface["IG Interface<br/>[clsInterface.c]"]
  node_localnet["Local Network<br/>[clsLocalNet.c]"]
  node_device_list["Device Discovery"]
  node_messages["IG Messages<br/>[clsMessage.c]"]
end

subgraph group_data["Data Processing"]
  node_data_types["Data Types<br/>[clsData.h]"]
  node_current["Current Values"]
  node_history["Historical Values"]
  node_history_interval["History Intervals"]
  node_datetime["Date and Time"]
  node_system_time["System Time<br/>[clsSystemTime.h]"]
end

subgraph group_outputs["Outputs and Alerts"]
  node_output_manager["Output Manager<br/>[clsOutputManager.h]"]
  node_sqlite[("SQLite Output<br/>[clsOutputManager.h]")]
  node_rrd["RRDTool Output<br/>[clsOutputManager.h]"]
  node_broadcast["Broadcast Server<br/>[clsBroadcast.c]"]
  node_logger_watch["Logger Watch<br/>[clsLoggerWatch.c]"]
end

node_operator(("Operator"))

node_operator -.->|"starts"| node_main
node_main -->|"processes"| node_localnet
node_main -->|"resets"| node_watchdog
node_localnet -->|"appends data"| node_output_manager
node_localnet -->|"decodes"| node_current
node_localnet -->|"queries"| node_history
node_localnet -->|"uses"| node_history_interval
node_localnet -->|"uses"| node_datetime
node_localnet -->|"reads"| node_config
node_localnet -.->|"uses"| node_interface
node_interface -.->|"uses"| node_serial
node_device_list -->|"posts messages"| node_interface
node_current -->|"sends readings"| node_broadcast
node_history -->|"resets"| node_watchdog
node_output_manager -->|"implements"| node_sqlite
node_output_manager -->|"implements"| node_rrd
node_localnet -.->|"uses"| node_data_types
node_data_types -->|"uses"| node_system_time
node_main -.->|"monitors"| node_logger_watch
node_main -->|"handles"| node_errors
node_history -.->|"produces readings"| node_data_types
node_current -.->|"produces readings"| node_data_types

click node_main "https://github.com/thorstenb/ig-logger/blob/master/logig_main.c"
click node_watchdog "https://github.com/thorstenb/ig-logger/blob/master/clsWatchdog.h"
click node_errors "https://github.com/thorstenb/ig-logger/blob/master/clsExcept.h"
click node_config "https://github.com/thorstenb/ig-logger/blob/master/clsConfig.h"
click node_serial "https://github.com/thorstenb/ig-logger/blob/master/clsSerialIO.c"
click node_interface "https://github.com/thorstenb/ig-logger/blob/master/clsInterface.c"
click node_localnet "https://github.com/thorstenb/ig-logger/blob/master/clsLocalNet.c"
click node_device_list "https://github.com/thorstenb/ig-logger/blob/master/clsDeviceListManager.c"
click node_messages "https://github.com/thorstenb/ig-logger/blob/master/clsMessage.c"
click node_data_types "https://github.com/thorstenb/ig-logger/blob/master/clsData.h"
click node_current "https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetCurrentValues.c"
click node_history "https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetHistoValues.c"
click node_history_interval "https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetHistoInterval.c"
click node_datetime "https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetDateTime.c"
click node_system_time "https://github.com/thorstenb/ig-logger/blob/master/clsSystemTime.h"
click node_output_manager "https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h"
click node_sqlite "https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h"
click node_rrd "https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h"
click node_broadcast "https://github.com/thorstenb/ig-logger/blob/master/clsBroadcast.c"
click node_logger_watch "https://github.com/thorstenb/ig-logger/blob/master/clsLoggerWatch.c"

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_main,node_watchdog,node_errors,node_config toneBlue
class node_serial,node_interface,node_localnet,node_device_list,node_messages toneAmber
class node_data_types,node_current,node_history,node_history_interval,node_datetime,node_system_time toneMint
class node_output_manager,node_sqlite,node_rrd,node_broadcast,node_logger_watch toneRose
class node_operator toneIndigo
```

## Components

### Runtime Control

- [Application Loop](https://github.com/thorstenb/ig-logger/blob/master/logig_main.c): `logig_main.c`
- [Watchdog](https://github.com/thorstenb/ig-logger/blob/master/clsWatchdog.h): `clsWatchdog.h`
- [Error Types](https://github.com/thorstenb/ig-logger/blob/master/clsExcept.h): `clsExcept.h`
- [Location Config](https://github.com/thorstenb/ig-logger/blob/master/clsConfig.h): `clsConfig.h`

### Device Network

- [Serial I/O](https://github.com/thorstenb/ig-logger/blob/master/clsSerialIO.c): `clsSerialIO.c`
- [IG Interface](https://github.com/thorstenb/ig-logger/blob/master/clsInterface.c): `clsInterface.c`
- [Local Network](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNet.c): `clsLocalNet.c`
- [Device Discovery](https://github.com/thorstenb/ig-logger/blob/master/clsDeviceListManager.c): `clsDeviceListManager.c`
- [IG Messages](https://github.com/thorstenb/ig-logger/blob/master/clsMessage.c): `clsMessage.c`

### Data Processing

- [Data Types](https://github.com/thorstenb/ig-logger/blob/master/clsData.h): `clsData.h`
- [Current Values](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetCurrentValues.c): `clsLocalNetCurrentValues.c`
- [Historical Values](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetHistoValues.c): `clsLocalNetHistoValues.c`
- [History Intervals](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetHistoInterval.c): `clsLocalNetHistoInterval.c`
- [Date and Time](https://github.com/thorstenb/ig-logger/blob/master/clsLocalNetDateTime.c): `clsLocalNetDateTime.c`
- [System Time](https://github.com/thorstenb/ig-logger/blob/master/clsSystemTime.h): `clsSystemTime.h`

### Outputs and Alerts

- [Output Manager](https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h): `clsOutputManager.h`
- [SQLite Output](https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h): `clsOutputManager.h`
- [RRDTool Output](https://github.com/thorstenb/ig-logger/blob/master/clsOutputManager.h): `clsOutputManager.h`
- [Broadcast Server](https://github.com/thorstenb/ig-logger/blob/master/clsBroadcast.c): `clsBroadcast.c`
- [Logger Watch](https://github.com/thorstenb/ig-logger/blob/master/clsLoggerWatch.c): `clsLoggerWatch.c`

### Other components

- **Operator**

## Connections

- Operator → Application Loop: starts
- Application Loop → Local Network: processes (evidence: `logig_main.c`)
- Application Loop → Watchdog: resets (evidence: `logig_main.c`)
- Local Network → Output Manager: appends data (evidence: `clsLocalNet.c`)
- Local Network → Current Values: decodes (evidence: `clsLocalNet.c`)
- Local Network → Historical Values: queries (evidence: `clsLocalNet.c`)
- Local Network → History Intervals: uses (evidence: `clsLocalNet.c`)
- Local Network → Date and Time: uses (evidence: `clsLocalNet.c`)
- Local Network → Location Config: reads (evidence: `clsLocalNet.c`)
- Local Network → IG Interface: uses
- IG Interface → Serial I/O: uses
- Device Discovery → IG Interface: posts messages (evidence: `clsDeviceListManager.c`)
- Current Values → Broadcast Server: sends readings (evidence: `clsLocalNetCurrentValues.c`)
- Historical Values → Watchdog: resets (evidence: `clsLocalNetHistoValues.c`)
- Output Manager → SQLite Output: implements (evidence: `clsOutputManager.h`)
- Output Manager → RRDTool Output: implements (evidence: `clsOutputManager.h`)
- Local Network → Data Types: uses
- Data Types → System Time: uses (evidence: `clsData.h`)
- Application Loop → Logger Watch: monitors
- Application Loop → Error Types: handles (evidence: `logig_main.c`)
- Historical Values → Data Types: produces readings
- Current Values → Data Types: produces readings
