A WPF application targeting .NET Framework 4.7.2 for monitoring smart factory devices. It aggregates telemetry, exposes data via OPC UA and REST, publishes MQTT messages, and tracks device heartbeats.
- Device management and in-memory device store
- OPC UA server with custom node manager (
SmartFactoryNodeManager) exposing device data - OPC UA client window for browsing/reading values
- REST API with snapshot and Server-Sent Events streaming (
RestStreamingService) - MQTT telemetry publishing (
MqttTelemetryService) - UDP heartbeat listener/sender (
HeartbeatService) for online status checks - Basic login/session model (
LoginWindow,AppSession,User,UserRole) - Simple logging and alert models
- Start the WPF app. The OPC UA server and REST streaming service can be started from the main window or initialized via corresponding services.
- REST API default base prefix:
http://localhost:5005/
admin / admin123— Administrator roleoperator / operator123— Operator role
GET /api/devices— JSON snapshot of current devicesGET /api/devices/stream— text/event-stream (SSE) that emits device JSON every second
- Namespace URI:
urn:SmartFactoryDeviceMonitor - Address Space:
Objects/Devices/Device_{Id}with variables:Name,Status,Temperature,Voltage
- Server setup in
Services/Opc/SmartFactoryOpcServer.cs - Node manager in
Services/Opc/SmartFactoryNodeManager.cs
- UDP listener on port 50000 (
HeartbeatService) - Heartbeat message format:
HB|{deviceId} IsDeviceOnline(deviceId, timeout)checks last heartbeat timestamp
- Publishes telemetry from devices (
MqttTelemetryService). Configure broker settings in the service as needed.
Models/—Device,DeviceStatus,Alert,User,UserRoleServices/—DeviceService,LoggingService,HeartbeatService,RestStreamingService,OpcUaService,OpcUaClientService,Opc/SmartFactoryOpcServer,Opc/SmartFactoryNodeManager,MqttTelemetryServicePersistence/MainDatabase.cs— placeholder for data persistence- UI:
MainWindow,LoginWindow,OpcUaClientWindow,DeviceChartWindow