Exemplo n.º 1
0
        protected LogDetailsPageModel(BatNodeLog batLog)
        {
            EditLogCommand = new RelayCommand(() => _navigationService.EditLog(BatLog));

            BatLog = batLog;
            _batCalls = new List<BatCall>();

            FrequencyRange = new Range<uint>(0, 100);
            FrequencyRange.PropertyChanged += async (s, e) => await UpdateBins();

            IntensityRange = new Range<uint>(0, 1024);
            IntensityRange.PropertyChanged += async (s, e) => await UpdateBins();

            DurationRange = new Range<uint>(0, 100);
            DurationRange.PropertyChanged += async (s, e) => await UpdateBins();

            TimeRange = new Range<uint>(0, 100);
            TimeRange.PropertyChanged += async (s, e) => await UpdateBins();

			//BUG!
            Func<BatCall, bool> filter = c => IntensityRange.Contains(c.MaxPower) && FrequencyRange.Contains(c.MaxFrequency) && DurationRange.Contains(c.Duration / 1000) && TimeRange.Contains(c.StartTimeMs);
            FreqBins = new UintBinCollection(100, b => (uint)b.MaxFrequency, filter);
            IntensityBins = new UintBinCollection(200, b => (uint)b.MaxPower, filter);
            CallDurationBins = new UintBinCollection(100, b => b.Duration / 1000, filter);
            TimeBins = new TimeCallBinCollection(200, batLog.LogStart, filter);
        }
Exemplo n.º 2
0
        public BatLogViewModel(BatNodeLog batNodeLog)
        {
            FrequencyRange = new Range<int>(0, 100);
            IntensityRange = new Range<int>(0, 1024);

            _batNodeLog = batNodeLog;
            _bins = new TimeCallBinCollection(300, batNodeLog.LogStart, c => true);
        }