comparison OrthancServer/LuaScripting.cpp @ 1436:0a3e3be59094

uncoupling of SignalChange for Lua scripts
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Jun 2015 17:19:26 +0200
parents 6406f5493d92
children 02f5a3f5c0a0
comparison
equal deleted inserted replaced
1435:6406f5493d92 1436:0a3e3be59094
278 throw OrthancException(ErrorCode_InternalError); 278 throw OrthancException(ErrorCode_InternalError);
279 } 279 }
280 280
281 281
282 Json::Value tags; 282 Json::Value tags;
283 //if (context_.GetIndex().LookupResource(tags, change.GetPublicId(), change.GetResourceType())) 283 if (context_.GetIndex().LookupResource(tags, change.GetPublicId(), change.GetResourceType()))
284 { 284 {
285 boost::mutex::scoped_lock lock(mutex_); 285 boost::mutex::scoped_lock lock(mutex_);
286 286
287 if (lua_.IsExistingFunction(name)) 287 if (lua_.IsExistingFunction(name))
288 { 288 {
289 InitializeJob(); 289 InitializeJob();
290 290
291 LuaFunctionCall call(lua_, name); 291 LuaFunctionCall call(lua_, name);
292 call.PushString(change.GetPublicId()); 292 call.PushString(change.GetPublicId());
293 call.PushJson(tags); 293 call.PushJson(tags["MainDicomTags"]);
294 call.Execute(); 294 call.Execute();
295 295
296 SubmitJob(std::string("Lua script: ") + name); 296 SubmitJob(std::string("Lua script: ") + name);
297 } 297 }
298 } 298 }