Revert "Periodservice cycles"

This commit is contained in:
Manfred Karrer 2018-04-09 12:59:51 -05:00 committed by GitHub
parent 7cf9935f29
commit 89f3841cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,12 @@
language: java
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
notifications:
slack:
on_success: change

View File

@ -141,13 +141,12 @@ public class ProposalDashboardView extends ActivatableView<GridPane, Void> {
private void onChainHeightChanged(int height) {
phaseBarsItems.forEach(item -> {
int startBlock = periodService.getFirstBlockOfPhase(periodService.getCycle(height), item.getPhase());
int endBlock = periodService.getLastBlockOfPhase(periodService.getCycle(height), item.getPhase());
int startBlock = periodService.getAbsoluteStartBlockOfPhase(height, item.getPhase());
int endBlock = periodService.getAbsoluteEndBlockOfPhase(height, item.getPhase());
item.setStartAndEnd(startBlock, endBlock);
double progress = 0;
if (height >= startBlock && height <= endBlock) {
progress = (double) (height - startBlock + 1) /
(double) periodService.getCycle(height).getPhaseDuration(item.getPhase());
progress = (double) (height - startBlock + 1) / (double) item.getPhase().getDurationInBlocks();
} else if (height < startBlock) {
progress = 0;
} else if (height > endBlock) {