How lsiswin/industrialdaq works
Purpose and entry points
IndustrialDAQ is a .NET 8 desktop SCADA/HMI terminal: it acquires industrial device tags, processes and persists them, evaluates alarms, and presents monitoring/configuration workflows in a WPF client. The production entry point is the Prism/MVVM WPF application at src/IndustrialDAQ.UI/App.xaml and src/IndustrialDAQ.UI/App.xaml.cs; its shell is src/IndustrialDAQ.UI/MainWindow.xaml. A console harness exists at sandbox/IndustrialDAQ.ConsoleTest/Program.cs.
Domain contracts and configuration
IndustrialDAQ.Core defines the cross-layer device/tag/alarm contracts, protocol abstractions, and configuration loading. Device configuration and tag values establish the acquisition payload boundary: src/IndustrialDAQ.Core/Models/DeviceConfig.cs, src/IndustrialDAQ.Core/Models/TagPoint.cs, and src/IndustrialDAQ.Core/Models/TagValue.cs. JSON configuration is loaded through src/IndustrialDAQ.Core/Configuration/DeviceConfigurationLoader.cs, with an example deployment configuration in config/production-line.json.
Protocol plugin boundary
Acquisition is decoupled from field protocols through IProtocolDriver and a driver factory: src/IndustrialDAQ.Core/Interfaces/IProtocolDriver.cs and src/IndustrialDAQ.Infrastructure/DriverFactory.cs. Protocol implementations are separately compiled plugins: Plugins/Drivers.Modbus/ModbusTcpDriver.cs, Plugins/Drivers.OpcUA/OpcUaDriver.cs, and Plugins/Drivers.S7/S7Driver.cs. Material external connectivity includes Modbus TCP via NModbus; OPC UA and S7 are represented as extension drivers.
Acquisition and processing pipeline
AcquisitionHost owns background acquisition lifecycle and DeviceCollector polls configured devices: src/IndustrialDAQ.Acquisition/AcquisitionHost.cs, src/IndustrialDAQ.Acquisition/DeviceCollector.cs. Collected values pass into src/IndustrialDAQ.Processing/DataProcessor.cs, the processing boundary for transformations such as quality/debouncing/deadband behavior described by the system. Configuration changes are intended to reload channels without restarting the client.
Real-time, history, and trends
Storage separates current values from durable records. src/IndustrialDAQ.Storage/RealTimeStore.cs is the live-data boundary; src/IndustrialDAQ.Storage/HistoryWriter.cs writes historical data, with alarm history through src/IndustrialDAQ.Storage/AlarmHistoryRepository.cs. Trend computation/cache/store are isolated in src/IndustrialDAQ.Trend/TrendEngine.cs, src/IndustrialDAQ.Trend/TrendCache.cs, and src/IndustrialDAQ.Trend/TrendDataStore.cs. SQLite/EF-style infrastructure is centered on src/IndustrialDAQ.Infrastructure/DaqDbContext.cs.
Alarm lifecycle
Alarm definitions are domain-managed by src/IndustrialDAQ.Core/Models/AlarmDefinitionService.cs. Runtime evaluation and state progression are staged: src/IndustrialDAQ.Alarm/RuleEngine/RuleEngineService.cs evaluates signals, src/IndustrialDAQ.Alarm/StateMachine/AlarmStateMachineService.cs applies transitions, and src/IndustrialDAQ.Alarm/Center/AlarmCenter.cs publishes/aggregates alarm-center events. This creates an explicit boundary between raw data, rule outcomes, state transitions, and UI-visible alarm records.
User-facing composition and governance
The UI consumes services through Prism DI, EventAggregator, and dialog/navigation patterns. Main operational screens are coordinated by src/IndustrialDAQ.UI/ViewModels/MainWindowViewModel.cs, src/IndustrialDAQ.UI/ViewModels/ProductionMonitorViewModel.cs, and src/IndustrialDAQ.UI/ViewModels/TrendViewModel.cs; LiveCharts/SkiaSharp renders trends. Tag writes and protected workflows should pass through authorization contracts in src/IndustrialDAQ.Core/Authorization/AuthorizationService.cs and UI authentication at src/IndustrialDAQ.UI/Services/AuthManager.cs. Themes are application resources at src/IndustrialDAQ.UI/Themes/DarkTheme.xaml and src/IndustrialDAQ.UI/Themes/LightTheme.xaml.
Main entry points: DataProcessor.cs Data processor · DeviceCollector.cs Device collector · DriverFactory.cs Driver factory · RealTimeStore.cs Live values
Components 23
Core contracts
Shared device, tag, alarm, and authorization boundaries.
- Device and tag contracts · Defines device configuration and acquired tag payloads.
src/IndustrialDAQ.Core/Models/DeviceConfig.cs - Configuration loader
src/IndustrialDAQ.Core/Configuration/DeviceConfigurationLoader.cs - Protocol driver contract
src/IndustrialDAQ.Core/Interfaces/IProtocolDriver.cs - Authorization · Guards tag writes and protected workflows.
src/IndustrialDAQ.Core/Authorization/AuthorizationService.cs - Alarm definitions
src/IndustrialDAQ.Core/Models/AlarmDefinitionService.cs
Acquisition
Protocol plugins and background device polling.
- Acquisition host · Owns acquisition lifecycle and reloads.
src/IndustrialDAQ.Acquisition/AcquisitionHost.cs - Device collector
src/IndustrialDAQ.Acquisition/DeviceCollector.cs - Driver factory
src/IndustrialDAQ.Infrastructure/DriverFactory.cs - Field protocol plugins · Modbus TCP uses NModbus; OPC UA and S7 are extension drivers.
Plugins/Drivers.Modbus/ModbusTcpDriver.cs
Data, trends & alarms
Processing, storage, trend, and alarm lifecycle.
- Data processor · Applies quality, debounce, and deadband transformations.
src/IndustrialDAQ.Processing/DataProcessor.cs - Live values
src/IndustrialDAQ.Storage/RealTimeStore.cs - Historical records
src/IndustrialDAQ.Storage/HistoryWriter.cs - DAQ database
src/IndustrialDAQ.Infrastructure/DaqDbContext.cs - Trend engine · Uses a dedicated cache and trend data store.
src/IndustrialDAQ.Trend/TrendEngine.cs - Alarm rule evaluation
src/IndustrialDAQ.Alarm/RuleEngine/RuleEngineService.cs - Alarm state transitions
src/IndustrialDAQ.Alarm/StateMachine/AlarmStateMachineService.cs - Alarm center · Publishes and aggregates UI-visible alarm events.
src/IndustrialDAQ.Alarm/Center/AlarmCenter.cs
WPF client
Prism-composed operational desktop experience.
- WPF application
src/IndustrialDAQ.UI/App.xaml - Main shell
src/IndustrialDAQ.UI/MainWindow.xaml - Operations coordinator
src/IndustrialDAQ.UI/ViewModels/MainWindowViewModel.cs - Production monitor
src/IndustrialDAQ.UI/ViewModels/ProductionMonitorViewModel.cs - Trend screen · Renders trends with LiveCharts/SkiaSharp.
src/IndustrialDAQ.UI/ViewModels/TrendViewModel.cs - UI authentication
src/IndustrialDAQ.UI/Services/AuthManager.cs
Connections 24
- WPF application → Main shell: starts
- Main shell → Operations coordinator: binds
- Operations coordinator → Production monitor: coordinates
- Operations coordinator → Trend screen: navigates to
- UI authentication → Authorization: uses
- Configuration loader → Device and tag contracts: loads device config
- Acquisition host → Configuration loader: reloads configuration
- Acquisition host → Device collector: manages
- Device collector → Driver factory: selects driver
- Driver factory → Protocol driver contract: implements contract
- Driver factory → Field protocol plugins: creates
- Device collector → Data processor: collected tag values
- Data processor → Live values: current values
- Data processor → Historical records: processed records
- Historical records → DAQ database: persists
- Live values → Trend engine: live trend input
- Trend engine → DAQ database: reads historical data
- Trend engine → Trend screen: trend data
- Data processor → Alarm rule evaluation: processed signals
- Alarm definitions → Alarm rule evaluation: alarm rules
- Alarm rule evaluation → Alarm state transitions: rule outcomes
- Alarm state transitions → Alarm center: alarm events
- Alarm center → Production monitor: publishes alarms
- Live values → Production monitor: live tags