Exemple #1
0
 public EventId(Ssz.Utils.DataAccess.EventId eventId)
 {
     SourceElementId = eventId.SourceElementId;
     if (eventId.MultiplexedAlarmContainer is not null)
     {
         MultiplexedAlarmContainer = new TypeId(eventId.MultiplexedAlarmContainer);
     }
     if (eventId.Conditions is not null)
     {
         Conditions.Add(eventId.Conditions.Select(t => new TypeId(t)));
     }
     OccurrenceId = eventId.OccurrenceId;
     if (eventId.TimeLastActiveUtc is not null)
     {
         TimeLastActive = Ssz.DataGrpc.Client.DateTimeHelper.ConvertToTimestamp(eventId.TimeLastActiveUtc.Value);
     }
 }
Exemple #2
0
 public EventId(Ssz.Utils.DataAccess.EventId eventId)
 {
     SourceId = new InstanceId("", "", eventId.SourceElementId);
     if (eventId.MultiplexedAlarmContainer is not null)
     {
         MultiplexedAlarmContainer = new TypeId(eventId.MultiplexedAlarmContainer);
     }
     if (eventId.Conditions is not null)
     {
         Condition = new List <TypeId>(eventId.Conditions.Select(t => new TypeId(t)));
     }
     OccurrenceId = eventId.OccurrenceId;
     if (eventId.TimeLastActiveUtc is not null)
     {
         TimeLastActive = eventId.TimeLastActiveUtc.Value;
     }
 }
Exemple #3
0
        public Ssz.Utils.DataAccess.EventId ToEventId()
        {
            var eventId = new Ssz.Utils.DataAccess.EventId();

            eventId.SourceElementId = SourceElementId;
            if (MultiplexedAlarmContainer is not null)
            {
                eventId.MultiplexedAlarmContainer = MultiplexedAlarmContainer.ToTypeId();
            }
            if (Conditions.Count > 0)
            {
                eventId.Conditions = Conditions.Select(t => t.ToTypeId()).ToList();
            }
            eventId.OccurrenceId = OccurrenceId;
            if (OptionalTimeLastActiveCase == OptionalTimeLastActiveOneofCase.TimeLastActive)
            {
                eventId.TimeLastActiveUtc = TimeLastActive.ToDateTime();
            }
            return(eventId);
        }
Exemple #4
0
        public Ssz.Utils.DataAccess.EventId ToEventId()
        {
            var eventId = new Ssz.Utils.DataAccess.EventId();

            eventId.SourceElementId = SourceId is not null ? SourceId.LocalId ?? "" : "";
            if (MultiplexedAlarmContainer is not null)
            {
                eventId.MultiplexedAlarmContainer = MultiplexedAlarmContainer.ToTypeId();
            }
            if (Condition is not null)
            {
                eventId.Conditions = Condition.Select(t => t.ToTypeId()).ToList();
            }
            eventId.OccurrenceId = OccurrenceId ?? "";
            if (TimeLastActive is not null)
            {
                eventId.TimeLastActiveUtc = TimeLastActive.Value;
            }
            return(eventId);
        }