Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlotWindowViewModel"/> class.
        /// </summary>
        public PlotWindowViewModel()
        {
            this.Plot = new ProfileGraphViewModel();

            using (var context = SimpleIoc.Default.GetInstanceWithoutCaching <SchedulerContext>())
            {
                var summarizer = new SchedulingSummarizer(context);

                this.allAuthors      = new ObservableCollection <string>(summarizer.GetAllTestAuthors());
                this.allPlatforms    = new ObservableCollection <string>(summarizer.GetAllTestedPlatforms());
                this.allProviders    = new ObservableCollection <string>(summarizer.GetAllTestedProviders());
                this.allAccelerators = new ObservableCollection <string>(Enum.GetNames(typeof(AESEncryptorProfile.AcceleratorType)));
                this.allClockSpeeds  = new ObservableCollection <int>(summarizer.GetAllClockSpeeds().OrderBy(x => x));
                this.allNumCores     = new ObservableCollection <int>(summarizer.GetAllNumCores().OrderBy(x => x));
                this.allProfiles     = new ObservableCollection <string>(Enum.GetNames(typeof(ProfileType)));

                this.aesAuthors     = new ObservableCollection <string>(summarizer.GetAESTestAuthors());
                this.aesPlatforms   = new ObservableCollection <string>(summarizer.GetAESTestedPlatforms());
                this.aesClockSpeeds = new ObservableCollection <int>(summarizer.GetAESClockSpeeds().OrderBy(x => x));
                this.aesNumCores    = new ObservableCollection <int>(summarizer.GetAESNumCores().OrderBy(x => x));

                this.compressionAuthors     = new ObservableCollection <string>(summarizer.GetCompressionTestAuthors());
                this.compressionPlatforms   = new ObservableCollection <string>(summarizer.GetCompressionTestedPlatforms());
                this.compressionClockSpeeds = new ObservableCollection <int>(summarizer.GetCompressionClockSpeeds().OrderBy(x => x));
                this.compressionNumCores    = new ObservableCollection <int>(summarizer.GetCompressionNumCores().OrderBy(x => x));

                this.Authors     = new ObservableCollection <string>();
                this.Platforms   = new ObservableCollection <string>();
                this.ClockSpeeds = new ObservableCollection <int>();
                this.NumCores    = new ObservableCollection <int>();

                this.allAuthors.ForEach(x => this.Authors.Add(x));
                this.allPlatforms.ForEach(x => this.Platforms.Add(x));
                this.allClockSpeeds.ForEach(x => this.ClockSpeeds.Add(x));
                this.allNumCores.ForEach(x => this.NumCores.Add(x));

                this.Providers    = new ObservableCollection <string>(this.allProviders);
                this.Accelerators = new ObservableCollection <string>(this.allAccelerators);
                this.Profiles     = new ObservableCollection <string>(this.allProfiles);
            }

            this.FilterSelectionChangedCommand = new RelayCommand <SelectedItemsChangedEventArgs>(this.DropdownSelectionChangedHandler);

            this.GeneratePlot();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DevicePickerViewModelCompression"/> class.
        /// </summary>
        public DevicePickerViewModelCompression()
            : base()
        {
            using (var context = SimpleIoc.Default.GetInstanceWithoutCaching <SchedulerContext>())
            {
                var summarizer        = new SchedulingSummarizer(context);
                var summarizedDevices = summarizer.SummarizeDeviceResults(context.CompressorProfiles);

                foreach (var device in summarizedDevices)
                {
                    var selectableDevice = new SelectableDevice(device)
                    {
                        IsSelected = true,
                    };

                    selectableDevice.PropertyChanged += this.Device_PropertyChanged;

                    this.Devices.Add(selectableDevice);
                }
            }
        }