private void RemoveSingleAlarmMemory(int connectionID, AlarmDataModel alarm) { List <AlarmDataModel> modelsToDelete = _alarmsData[connectionID].Where(x => x.Identity == alarm.Identity).ToList(); foreach (var item in modelsToDelete) { _alarmsData[connectionID].Remove(item); } }
private AlarmDataModel CreateAlarmMemoryModel(S7AlarmDefinition alarm) { AlarmDataModel alarmDef = new AlarmDataModel() { Identity = alarm.Identity, AlarmOccured = false, AlarmAcknowledged = false, SMSsent = false, }; return(alarmDef); }
private void AddAllAlarmsToDictionary(int connectionID, List <S7AlarmDefinition> alarms) { List <AlarmDataModel> listToAdd = new List <AlarmDataModel>(); foreach (var item in alarms) { AlarmDataModel alarmDef = CreateAlarmMemoryModel(item); listToAdd.Add(alarmDef); } _alarmsData.Add(connectionID, listToAdd); }
private void AddSingleAlarmMemory(int connectionID, S7AlarmDefinition alarm) { AlarmDataModel alarmDef = CreateAlarmMemoryModel(alarm); _alarmsData[connectionID].Add(alarmDef); }