OHIF-26: StudyLoadingListener :: progress bar config (ui)

This commit is contained in:
Leonardo Campos 2017-04-26 21:31:07 -03:00
parent b862b9c8b5
commit 4055655c7a
4 changed files with 30 additions and 4 deletions

View File

@ -163,6 +163,11 @@ export const UISettings = new SimpleSchema({
type: Number, type: Number,
label: 'Number of days to be used on Study List date filter', label: 'Number of days to be used on Study List date filter',
min: 1 min: 1
},
showStackLoadingProgressBar: {
type: Boolean,
label: 'Show a progress bar closest to the thumbnail showing how much the stack has loaded',
defaultValue: true
} }
}); });

View File

@ -7,5 +7,10 @@
<div class="imageThumbnailErrorLoadingIndicator thumbnailLoadingIndicator"> <div class="imageThumbnailErrorLoadingIndicator thumbnailLoadingIndicator">
<p>Error</p> <p>Error</p>
</div> </div>
{{#if showStackLoadingProgressBar}}
<div class="imageThumbnailProgressBar">
<div class="imageThumbnailProgressBarInner" style="width:{{stackPercentComplete}}%"></div>
</div>
{{/if}}
</div> </div>
</template> </template>

View File

@ -97,7 +97,7 @@ Template.imageThumbnail.onDestroyed(() => {
}); });
Template.imageThumbnail.helpers({ Template.imageThumbnail.helpers({
// Executed every time the image loading progress is changed // Executed every time the thumbnail image loading progress is changed
percentComplete() { percentComplete() {
const instance = Template.instance(); const instance = Template.instance();
@ -113,14 +113,18 @@ Template.imageThumbnail.helpers({
} }
}, },
// Return how much the displaySet has already been loaded (%) // Return how much the stack has already loaded
stackPercentComplete() { stackPercentComplete() {
const instance = Template.instance(); const instance = Template.instance();
const stack = instance.data.thumbnail.stack; const stack = instance.data.thumbnail.stack;
const displaySetInstanceUid = stack.displaySetInstanceUid; const displaySetInstanceUid = stack.displaySetInstanceUid;
const progress = Session.get('DisplaySetProgress:' + displaySetInstanceUid); const progress = Session.get('DisplaySetProgress:' + displaySetInstanceUid);
const percentComplete = parseFloat(progress ? progress.percentComplete : 0) * 100; const percentComplete = progress && progress.percentComplete;
return percentComplete.toFixed(2); return percentComplete;
},
showStackLoadingProgressBar() {
return OHIF.uiSettings.showStackLoadingProgressBar;
} }
}); });

View File

@ -47,3 +47,15 @@
p p
text-align: center text-align: center
font-size: 10pt font-size: 10pt
.imageThumbnailProgressBar
position: relative
width: 100%
height: 3px
top: -5px
.imageThumbnailProgressBarInner
height: 100%
width: 0
border-radius: 5px
theme('background-color', '$activeColor')