mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 11:11:23 +00:00
Added auto prop sending
- updated readme
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MewtocolNet.Logging;
|
||||
using MewtocolNet.RegisterAttributes;
|
||||
using MewtocolNet.Registers;
|
||||
|
||||
namespace MewtocolNet {
|
||||
@@ -194,6 +195,12 @@ namespace MewtocolNet {
|
||||
|
||||
}
|
||||
|
||||
internal void PropertyRegisterWasSet (string propName, object value) {
|
||||
|
||||
SetRegister(propName, value);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Register Adding
|
||||
|
||||
@@ -38,7 +38,9 @@ namespace MewtocolNet.RegisterAttributes
|
||||
/// <summary>
|
||||
/// Use this on the setter method of a property to enable automatic property register writing
|
||||
/// </summary>
|
||||
public static void AutoSetter<T> (object value, ref T privateField) {
|
||||
public void AutoSetter<T> (object value, ref T privateField, [CallerMemberName] string propName = null) {
|
||||
|
||||
PLCInterface.PropertyRegisterWasSet(propName, value);
|
||||
|
||||
if(value is IRegister reg) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user