-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDriver.cs
More file actions
26 lines (22 loc) · 745 Bytes
/
Driver.cs
File metadata and controls
26 lines (22 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
using Moryx.AbstractionLayer.Resources;
using Moryx.StateMachines;
namespace Moryx.AbstractionLayer.Drivers
{
/// <summary>
/// Base class for devices to reduce boilerplate code
/// </summary>
public abstract class Driver : Resource, IDriver, IStateContext
{
/// <inheritdoc />
public IDriverState CurrentState { get; private set; }
void IStateContext.SetState(IState state)
{
CurrentState = (IDriverState)state;
StateChanged?.Invoke(this, CurrentState);
}
/// <inheritdoc />
public event EventHandler<IDriverState> StateChanged;
}
}