changeset 1666:1e6d3289b1ad

enable catching of exceptions in stone web viewer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2020 17:10:08 +0100
parents f62f685e0eb2
children 9584df157a9e
files Applications/Samples/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp OrthancStone/Sources/StoneEnumerations.h
diffstat 4 files changed, 3 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/WebAssembly/CMakeLists.txt	Thu Nov 19 15:39:30 2020 +0100
+++ b/Applications/Samples/WebAssembly/CMakeLists.txt	Thu Nov 19 17:10:08 2020 +0100
@@ -29,14 +29,13 @@
 # ---------------------------------------------------------------
 set(USE_WASM ON CACHE BOOL "")
 
-set(WASM_FLAGS "-s WASM=1 -s FETCH=1")
+set(WASM_FLAGS "-s WASM=1 -s FETCH=1 -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
   set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1")
 endif()
 
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1")
-set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456")  # 256MB + resize
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1")
 add_definitions(
--- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Thu Nov 19 15:39:30 2020 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Thu Nov 19 17:10:08 2020 +0100
@@ -29,14 +29,13 @@
 # ---------------------------------------------------------------
 set(USE_WASM ON CACHE BOOL "")
 
-set(WASM_FLAGS "${WASM_FLAGS} -s WASM=1 -s FETCH=1")
+set(WASM_FLAGS "${WASM_FLAGS} -s WASM=1 -s FETCH=1 -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
   set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1")
 endif()
 
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1")
-set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456")  # 256MB + resize
 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1")
 add_definitions(
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Thu Nov 19 15:39:30 2020 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Thu Nov 19 17:10:08 2020 +0100
@@ -1723,29 +1723,6 @@
     emscripten_set_keyup_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, this, false, OnKey);
 
     ResetDefaultWindowing();
-
-    /*{
-      std::unique_ptr<OrthancStone::IViewport::ILock> lock(viewport_->Lock());
-      std::unique_ptr<OrthancStone::PolylineSceneLayer> layer(new OrthancStone::PolylineSceneLayer);
-      OrthancStone::PolylineSceneLayer::Chain chain;
-      chain.push_back(OrthancStone::ScenePoint2D(-10, 0));
-      chain.push_back(OrthancStone::ScenePoint2D(10, 0));
-      layer->AddChain(chain, false, 255, 0, 0);
-      chain.clear();
-      chain.push_back(OrthancStone::ScenePoint2D(0, -10));
-      chain.push_back(OrthancStone::ScenePoint2D(0, 10));
-      layer->AddChain(chain, false, 255, 0, 0);
-      chain.clear();
-      chain.push_back(OrthancStone::ScenePoint2D(40, 30));
-      chain.push_back(OrthancStone::ScenePoint2D(40, 50));
-      layer->AddChain(chain, false, 255, 0, 0);
-      chain.clear();
-      chain.push_back(OrthancStone::ScenePoint2D(30, 40));
-      chain.push_back(OrthancStone::ScenePoint2D(50, 40));
-      layer->AddChain(chain, false, 255, 0, 0);
-      lock->GetController().GetScene().SetLayer(1000, layer.release());
-      lock->Invalidate();
-      }*/
   }
 
   static EM_BOOL OnKey(int eventType,
--- a/OrthancStone/Sources/StoneEnumerations.h	Thu Nov 19 15:39:30 2020 +0100
+++ b/OrthancStone/Sources/StoneEnumerations.h	Thu Nov 19 17:10:08 2020 +0100
@@ -119,7 +119,7 @@
 
   enum SeriesThumbnailType
   {
-    SeriesThumbnailType_NotLoaded = 1,  // The remote server cannot decode this image
+    SeriesThumbnailType_NotLoaded = 1,  // "SeriesThumbnailsLoader" has not information about this series yet
     SeriesThumbnailType_Unsupported = 2,  // The remote server cannot decode this image
     SeriesThumbnailType_Pdf = 3,
     SeriesThumbnailType_Video = 4,