Update beckhoff x sottoscrizione cambio stati esplicito in override

This commit is contained in:
Samuele Locatelli
2021-11-05 15:50:59 +01:00
parent 16d59b3f99
commit 88c5cd4534
2 changed files with 9 additions and 8 deletions
+3 -3
View File
@@ -54,14 +54,14 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
#region Protected Methods
private void AdsCli_ValueChanged(TcAdsClient sender, string key, string value)
protected void AdsCli_ValueChanged(TcAdsClient sender, string key, string value)
{
lg.Info($"Monitored Value changed | sender: {sender} | key: {key} | value: {value}");
}
#endregion Private Methods
#endregion Protected Methods
#region Public Methods
+6 -5
View File
@@ -60,21 +60,21 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
#region Protected Methods
private void AdsCli_CountChanged(TcAdsClient sender, int newCount)
protected void AdsCli_CountChanged(TcAdsClient sender, int newCount)
{
contapezziPLC = newCount;
lg.Info($"Nuova lettura contapezzi | contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
private void AdsCli_StatusChanged(TcAdsClient sender, int newStatus)
protected void AdsCli_StatusChanged(TcAdsClient sender, int newStatus)
{
currStatus = newStatus;
lg.Info($"Status changed: {newStatus}");
}
#endregion Private Methods
#endregion Protected Methods
#region Public Methods
@@ -282,13 +282,14 @@ namespace IOB_WIN_NEXT
}
}
public virtual void setEventHandler()
public override void setEventHandler()
{
base.setEventHandler();
if (AdsCli != null)
{
AdsCli.StatusChanged += AdsCli_StatusChanged;
AdsCli.CountChanged += AdsCli_CountChanged;
AdsCli.ValueChanged += AdsCli_ValueChanged;
}
}