Esempio n. 1
0
        private void CreateAvailableProfilesList()
        {
            _logger.Info($"Reading list of profiles from DB and creating list of available profiles.");

            //add item for no selection
            ListOfAvailableProfilesNames = new BindableCollection <string>
            {
                "-----"
            };

            //read alarm profiles from DB
            AlarmProfileReader            reader   = new AlarmProfileReader(_realProvider);
            List <AlarmProfileDefinition> profiles = reader.GetListOfAllProfiles();

            //add profiles to list
            foreach (var item in profiles)
            {
                ListOfAvailableProfilesNames.Add(item.ProfileName);
            }

            //select item passed in constructor
            if (ListOfAvailableProfilesNames.Where(x => x == AlarmProfileFIlter).Count() == 1)
            {
                SelectedProfileName = AlarmProfileFIlter;
            }
            else
            {
                SelectedProfileName = "-----";
            }
        }
        private void ReadRawProfiles()
        {
            //create reader instance (reader of alarm profiles)
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            //get full list of currently defined alarm urgency profiles
            _originalProfilesList = reader.GetListOfAllProfiles();
        }
Esempio n. 3
0
        public static BindableCollection <AlarmProfileComboBoxModel> GetListOfAlarmProfileModels(IRealmProvider realmProvider)
        {
            //outputList
            BindableCollection <AlarmProfileComboBoxModel> output = new BindableCollection <AlarmProfileComboBoxModel>();

            //read data
            AlarmProfileReader            reader       = new AlarmProfileReader(realmProvider);
            List <AlarmProfileDefinition> profilesList = reader.GetListOfAllProfiles();

            //assign new items to comboBox
            foreach (var item in profilesList)
            {
                output.Add(new AlarmProfileComboBoxModel()
                {
                    Identity = item.Identity,
                    Name     = item.ProfileName,
                });
            }

            return(output);
        }
Esempio n. 4
0
        private void ReadAllAlarmProfiles()
        {
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            _alarmProfilesList = reader.GetListOfAllProfiles();
        }
Esempio n. 5
0
        private List <AlarmProfileDefinition> GetProfilesDataFromDB()
        {
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            return(reader.GetListOfAllProfiles());
        }