/// <summary> /// Returns the hashcode for a node /// </summary> public static int GetHashCode(this OpcNodeModel model) { var hash = new HashCode(); hash.Add(model.Id); hash.Add(model.DisplayName); hash.Add(model.DataSetFieldId); hash.Add(model.ExpandedNodeId); hash.Add(model.GetNormalizedPublishingInterval()); hash.Add(model.GetNormalizedSamplingInterval()); hash.Add(model.GetNormalizedHeartbeatInterval()); hash.Add(model.SkipFirst); hash.Add(model.QueueSize); return(hash.ToHashCode()); }
/// <summary> /// Retrieves the timespan flavor of a node's SamplingInterval /// </summary> public static TimeSpan?GetNormalizedSamplingInterval( this OpcNodeModel model, TimeSpan?defaultSamplingTimespan = null) { return(model.OpcSamplingIntervalTimespan .GetTimeSpanFromMiliseconds(model.OpcSamplingInterval, defaultSamplingTimespan)); }
/// <summary> /// Retrieves the timespan flavor of a node's HeartbeatInterval /// </summary> /// <returns></returns> public static TimeSpan?GetNormalizedHeartbeatInterval( this OpcNodeModel model, TimeSpan?defaultHeatbeatTimespan = null) { return(model.HeartbeatIntervalTimespan .GetTimeSpanFromSeconds(model.HeartbeatInterval, defaultHeatbeatTimespan)); }