Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private AlarmDataModel CreateAlarmMemoryModel(S7AlarmDefinition alarm)
        {
            AlarmDataModel alarmDef = new AlarmDataModel()
            {
                Identity          = alarm.Identity,
                AlarmOccured      = false,
                AlarmAcknowledged = false,
                SMSsent           = false,
            };

            return(alarmDef);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        private void AddSingleAlarmMemory(int connectionID, S7AlarmDefinition alarm)
        {
            AlarmDataModel alarmDef = CreateAlarmMemoryModel(alarm);

            _alarmsData[connectionID].Add(alarmDef);
        }