Mercurial > hg > orthanc-stone
comparison Platforms/Wasm/wasm-application-runner.ts @ 719:633bb89d4a6e rtviewer19branch
Fixes to auxiliary parameters management
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 20 May 2019 19:55:13 +0200 |
parents | df7286320507 |
children |
comparison
equal
deleted
inserted
replaced
718:df7286320507 | 719:633bb89d4a6e |
---|---|
71 | 71 |
72 function _InitializeWasmApplication(orthancBaseUrl: string): void { | 72 function _InitializeWasmApplication(orthancBaseUrl: string): void { |
73 | 73 |
74 CreateWasmApplication(); | 74 CreateWasmApplication(); |
75 | 75 |
76 // transmit the API-specified parameters to the app before initializing it | 76 // parse uri and transmit the URI parameters to the app before initializing it |
77 for (let key in auxiliaryParameters) { | 77 let parameters = GetUriParameters(); |
78 if (auxiliaryParameters.hasOwnProperty(key)) { | 78 |
79 Logger.defaultLogger.debug( | 79 // merge params but give priority to URI parameters |
80 `About to call SetStartupParameter("${key}","${auxiliaryParameters[key]}")`); | 80 var resultingParams : Map<string,string>; |
81 SetStartupParameter(key, auxiliaryParameters[key]); | 81 |
82 if (auxiliaryParameters == null) { | |
83 resultingParams = new Map<string,string>(); | |
84 } else { | |
85 resultingParams = auxiliaryParameters; | |
86 } | |
87 | |
88 for (let key in parameters) { | |
89 if (parameters.hasOwnProperty(key)) { | |
90 resultingParams[key] = parameters[key] | |
82 } | 91 } |
83 } | 92 } |
84 | 93 |
85 // parse uri and transmit the URI parameters to the app before initializing it | 94 for (let key in resultingParams) { |
86 let parameters = GetUriParameters(); | 95 if (resultingParams.hasOwnProperty(key)) { |
87 | |
88 for (let key in parameters) { | |
89 if (parameters.hasOwnProperty(key)) { | |
90 Logger.defaultLogger.debug( | 96 Logger.defaultLogger.debug( |
91 `About to call SetStartupParameter("${key}","${parameters[key]}")`); | 97 `About to call SetStartupParameter("${key}","${resultingParams[key]}")`); |
92 SetStartupParameter(key, parameters[key]); | 98 SetStartupParameter(key, resultingParams[key]); |
93 } | 99 } |
94 } | 100 } |
95 | 101 |
96 StartWasmApplication(orthancBaseUrl); | 102 StartWasmApplication(orthancBaseUrl); |
97 | 103 |