private void CreateAlarm(string deviceId, string siteId, Alarm.Type alarmType, Alarm.AlarmSubtype subtype, Alarm.Gravity alarmGravity, string shortDescription, string description) { Alarm alarm = new Alarm() { Id = $"{deviceId}-{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}", DeviceId = deviceId, SiteId = siteId, IsActive = true, AlarmType = alarmType, AlarmGravity = alarmGravity, OccuredAt = DateTime.UtcNow, ShortDescription = shortDescription, Description = description, Subtype = subtype }; deviceRepository.AddAlarm(deviceId, alarm); }
public Alarm CreateAlarm(string deviceId, string siteId, Alarm.Type alarmType, Alarm.Gravity alarmGravity, string shortDescription, string description, DateTime?start, DateTime?end) { Alarm alarm = new Alarm() { Id = $"{deviceId}-alarm{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}", DeviceId = deviceId, SiteId = siteId, IsActive = true, AlarmType = alarmType, AlarmGravity = alarmGravity, OccuredAt = DateTime.UtcNow, ShortDescription = shortDescription, Description = description, Start = start, End = end }; deviceRepository.AddAlarm(deviceId, alarm); return(alarm); }
public void AddAlarm(string deviceId, Alarm alarm) { deviceRepository.AddAlarm(deviceId, alarm); }