예제 #1
0
 public static void SetDurationRange(DurationRange val)
 {
     try
     {
         Application.UserAppDataRegistry.SetValue("Duration Range", (int)val);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
        public static DurationRange GetDurationRange()
        {
            DurationRange val = DurationRange.Selected;

            try
            {
                object obj = Application.UserAppDataRegistry.GetValue("Duration Range");

                if (obj != null)
                {
                    val = (DurationRange)int.Parse(obj.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return(val);
        }
예제 #3
0
        public override async Task Initialize()
        {
            if (ParentViewModel != null)
            {
                IEnumerable <BatCall> batCalls = ParentViewModel.BatCalls;
                await Task.Run(() =>
                {
                    FreqBins.LoadBins(batCalls);
                    IntensityBins.LoadBins(batCalls);
                    CallDurationBins.LoadBins(batCalls);
                    TimeBins.LoadBins(batCalls);
                });

                FrequencyRange.Set(FreqBins.Range);
                IntensityRange.Set(IntensityBins.Range);
                DurationRange.Set(CallDurationBins.Range);
                TimeRange.Set(TimeBins.Range);


                Freq = new ObservableCollection <KeyValuePair <DateTime, uint> >(batCalls.Select(c => new KeyValuePair <DateTime, uint>(c.StartTime, c.MaxFrequency)));
                OnPropertyChanged(nameof(Freq));
                OnPropertyChanged(nameof(FilterText));
            }
        }
예제 #4
0
 public SubstanceLevelInfo(DurationRange duration, DoseRange dose)
 {
     Duration = duration;
     Dose     = dose;
 }
예제 #5
0
        public DurationForm()
        {
            InitializeComponent();

            try
            {
                // only set these 3 textboxes, don't read back this value
                textBoxDurationConstant.Text = (((double)ConfigForm.GetDurationConstant()) / 1000).ToString();
                textBoxDurationVariable.Text = (((double)ConfigForm.GetDurationVariable()) / 1000).ToString();
                textBoxDurationMin.Text      = (((double)ConfigForm.GetDurationMinimum()) / 1000).ToString();

                textBoxScale.Text = (((double)GetDurationScale()) / 1000).ToString();

                DurationRange       range  = GetDurationRange();
                DurationUpdate      update = GetDurationUpdate();
                DurationCalculation calc   = GetDurationCalculation();

                switch (range)
                {
                case DurationRange.Selected:
                    radioButtonSelcted.Checked = true;
                    break;

                case DurationRange.All:
                    radioButtonAll.Checked = true;
                    break;
                }

                switch (update)
                {
                case DurationUpdate.EmptyOnly:
                    radioButtonOnlyEmpty.Checked = true;
                    break;

                case DurationUpdate.OnlyIncrease:
                    radioButtonOnlyIncrease.Checked = true;
                    break;

                case DurationUpdate.SetToCalculated:
                    radioButtonAllInRange.Checked = true;
                    break;
                }

                switch (calc)
                {
                case DurationCalculation.Algorithm:
                    radioButtonUseAlgorithm.Checked = true;
                    break;

                case DurationCalculation.ScaleFactor:
                    radioButtonScaleFactor.Checked = true;
                    break;
                }

                UpdateUI();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }