Mercurial > hg > orthanc-stone
diff Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApp.js @ 1388:240531afdd2d
Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 28 Apr 2020 08:57:39 +0200 |
parents | c0e4eb14c912 |
children | 27e0a00bd3e8 |
line wrap: on
line diff
--- a/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApp.js Mon Apr 27 16:49:03 2020 +0200 +++ b/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApp.js Tue Apr 28 08:57:39 2020 +0200 @@ -9,35 +9,35 @@ WasmModuleWrapper.prototype.Setup = function(Module) { this._InitializeViewport = Module.cwrap('InitializeViewport', null, [ 'string' ]); - this._LoadOrthanc = Module.cwrap('LoadOrthanc', null, [ 'string', 'int' ]); - this._LoadDicomWeb = Module.cwrap('LoadDicomWeb', null, [ 'string', 'string', 'string', 'string', 'int' ]); + this._LoadFromOrthanc = Module.cwrap('LoadFromOrthanc', null, [ 'string', 'int' ]); + this._LoadFromDicomWeb = Module.cwrap('LoadFromDicomWeb', null, [ 'string', 'string', 'string', 'string', 'int' ]); }; WasmModuleWrapper.prototype.InitializeViewport = function(canvasId) { this._InitializeViewport(canvasId); }; -WasmModuleWrapper.prototype.LoadOrthanc = function(instance, frame) { - this._LoadOrthanc(instance, frame); +WasmModuleWrapper.prototype.LoadFromOrthanc = function(instance, frame) { + this._LoadFromOrthanc(instance, frame); }; -WasmModuleWrapper.prototype.LoadDicomWeb = function(server, studyInstanceUid, seriesInstanceUid, sopInstanceUid, frame) { - this._LoadDicomWeb(server, studyInstanceUid, seriesInstanceUid, sopInstanceUid, frame); +WasmModuleWrapper.prototype.LoadFromDicomWeb = function(server, studyInstanceUid, seriesInstanceUid, sopInstanceUid, frame) { + this._LoadFromDicomWeb(server, studyInstanceUid, seriesInstanceUid, sopInstanceUid, frame); }; -var moduleWrapper = new WasmModuleWrapper(); +var wasmModuleWrapper = new WasmModuleWrapper(); $(document).ready(function() { - window.addEventListener('StoneInitialized', function() { - stone.Setup(Module); - console.warn('Native Stone properly intialized'); + window.addEventListener('WasmModuleInitialized', function() { + wasmModuleWrapper.Setup(Module); + console.warn('Native C++ module initialized'); - stone.InitializeViewport('viewport'); + wasmModuleWrapper.InitializeViewport('viewport'); }); window.addEventListener('StoneException', function() { - alert('Exception caught in Stone'); + alert('Exception caught in C++ code'); }); var scriptSource; @@ -75,15 +75,6 @@ $('#orthancLoad').click(function() { - stone.LoadOrthanc($('#orthancInstance').val(), + wasmModuleWrapper.LoadFromOrthanc($('#orthancInstance').val(), $('#orthancFrame').val()); }); - - -$('#dicomWebLoad').click(function() { - stone.LoadDicomWeb($('#dicomWebServer').val(), - $('#dicomWebStudy').val(), - $('#dicomWebSeries').val(), - $('#dicomWebInstance').val(), - $('#dicomWebFrame').val()); -});