comparison OrthancServer/main.cpp @ 397:941ea46e9e26 lua-scripting

lua filter of new instances
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 May 2013 16:34:00 +0200
parents 9784f19f7e1b
children 2d269089078f
comparison
equal deleted inserted replaced
394:9784f19f7e1b 397:941ea46e9e26
63 const Json::Value& dicomJson, 63 const Json::Value& dicomJson,
64 const std::string& remoteAet) 64 const std::string& remoteAet)
65 { 65 {
66 if (dicomFile.size() > 0) 66 if (dicomFile.size() > 0)
67 { 67 {
68 LuaContext& lua = server_.GetLuaContext(); 68 server_.Store(&dicomFile[0], dicomFile.size(), dicomSummary, dicomJson, remoteAet);
69 // TODO : Is existing trigger ?
70 LuaFunctionCall call(lua, "NewInstanceFilter");
71 call.PushJSON(dicomJson);
72 call.PushString(remoteAet);
73
74 if (call.ExecutePredicate())
75 {
76 server_.Store(&dicomFile[0], dicomFile.size(), dicomSummary, dicomJson, remoteAet);
77 }
78 else
79 {
80 LOG(WARNING) << "An instance has been discarded by a filter";
81 }
82 } 69 }
83 } 70 }
84 }; 71 };
85 72
86 73