changeset 1920:05f0327d26c8

added logs in app.js
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Mar 2022 16:57:41 +0100
parents ed4831e08961
children 3b2445574705
files Applications/StoneWebViewer/WebApplication/app.js
diffstat 1 files changed, 21 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Mon Mar 21 15:50:29 2022 +0100
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Mon Mar 21 16:57:41 2022 +0100
@@ -186,21 +186,24 @@
       var seriesInstanceUid = newVal.series.tags[SERIES_INSTANCE_UID];
       stone.SpeedUpFetchSeriesMetadata(studyInstanceUid, seriesInstanceUid);
 
-      if ((newVal.series.type == stone.ThumbnailType.IMAGE ||
-           newVal.series.type == stone.ThumbnailType.NO_PREVIEW) &&
-          newVal.series.complete) {
-        this.status = 'ready';
-
-        var that = this;
-        Vue.nextTick(function() {
-          if (newVal.virtualSeriesId !== undefined &&
-              newVal.virtualSeriesId.length > 0) {
-            stone.LoadVirtualSeriesInViewport(that.canvasId, newVal.virtualSeriesId);
-          }
-          else {
-            stone.LoadSeriesInViewport(that.canvasId, seriesInstanceUid);
-          }
-        });
+      if (newVal.series.type == stone.ThumbnailType.IMAGE ||
+          newVal.series.type == stone.ThumbnailType.NO_PREVIEW) {
+        if (newVal.series.complete) {
+          this.status = 'ready';
+          
+          var that = this;
+          Vue.nextTick(function() {
+            if (newVal.virtualSeriesId !== undefined &&
+                newVal.virtualSeriesId.length > 0) {
+              stone.LoadVirtualSeriesInViewport(that.canvasId, newVal.virtualSeriesId);
+            }
+            else {
+              stone.LoadSeriesInViewport(that.canvasId, seriesInstanceUid);
+            }
+          });
+        } else {
+          console.warn('Series is incomplete: ' + seriesInstanceUid);
+        }
       }
       else if (newVal.series.type == stone.ThumbnailType.PDF) {
         if (newVal.series.complete) {
@@ -249,6 +252,9 @@
           console.warn('Videos are not supported by the Stone Web viewer alone yet, the Orthanc REST API is needed');
         }
       }
+      else {
+        console.error('Unable to handle this series: ' + seriesInstanceUid);
+      }
     }
   },
   mounted: function() {