Mercurial > hg > orthanc-stone
diff Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp @ 1714:a878e807cd96
configuration option "DicomCacheSize", warning if cache should be larger
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Nov 2020 17:57:10 +0100 |
parents | aec45e0b2528 |
children | 391c798e4dae |
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Mon Nov 30 17:09:46 2020 +0100 +++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Mon Nov 30 17:57:10 2020 +0100 @@ -2922,6 +2922,29 @@ EMSCRIPTEN_KEEPALIVE + void SetDicomCacheSize(int sizeMB) + { + try + { + if (sizeMB == 0) + { + LOG(WARNING) << "The DICOM cache is disabled"; + } + else + { + LOG(INFO) << "The DICOM cache size is set to " << sizeMB << "MB"; + } + + if (sizeMB >= 0) + { + context_->SetDicomCacheSize(sizeMB * 1024 * 1024); + } + } + EXTERN_CATCH_EXCEPTIONS; + } + + + EMSCRIPTEN_KEEPALIVE void FetchAllStudies() { try