private async Task <List <DensityInfo> > GetDataFromApi(CancellationToken token) { var scaleInfo = _scaler.GetCurrentScaleInfo(); var groupInterval = scaleInfo.CurrentWidth / IMAGE_WIDTH; return(await _densityApi.GetDensityInfoAsync(scaleInfo.CurrentStart, scaleInfo.CurrentStop, groupInterval, token)); }
public void Setup() { _densityApi = new DensityApi(_logger, _provider); var globalStart = _provider.GetGlobalStartTick(); var globalStop = _provider.GetGlobalStopTick(); var newLength = (long)((globalStop - globalStart) * 0.6); var middle = (globalStop - globalStart) / 2; _requestedStart = middle - newLength / 4; _requestedStop = middle + newLength / 4; _currentGroupInterval = newLength / RequestedSize; _currentInfo = _densityApi.GetDensityInfoAsync(middle - newLength / 2, middle + newLength / 2, _currentGroupInterval, CancellationToken.None).Result; }
public async Task GetDensityInfo() { await _densityApi.GetDensityInfoAsync(_requestedStart, _requestedStop, (_requestedStop - _requestedStart) / RequestedSize, CancellationToken.None); }