summaryrefslogtreecommitdiff
path: root/rotord/src/rotord.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-08-16 14:29:23 +0100
committerTim Redfern <tim@eclectronics.org>2013-08-16 14:29:23 +0100
commit10f50e4a6b8cbe83cf8c9bee238afe93a5958053 (patch)
treef0ca9b48ca702878f6c7d2b5492acaace7df5038 /rotord/src/rotord.cpp
parent1af93fbfe4c8cfa214331d2d96327637ffe749bf (diff)
finished render log
Diffstat (limited to 'rotord/src/rotord.cpp')
-rwxr-xr-xrotord/src/rotord.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp
index 33031e7..6130cfc 100755
--- a/rotord/src/rotord.cpp
+++ b/rotord/src/rotord.cpp
@@ -108,6 +108,42 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
status=HTTPResponse::HTTP_OK;
}
}
+ else if (command[0]=="listrenders") {
+ XML.pushTag("rotor");
+ if (request.getMethod()=="GET") {
+ int i=0;
+ for (auto r: renders){
+ XML.addTag("render");
+ XML.addAttribute("render","ID",r.first,i);
+ bool context_found=false;
+ for (auto& task: manager.taskList()) {
+ if(task->name()==r.second) {
+ Render_status status=((Poco::AutoPtr<Rotor::Render_context>)task)->get_render_status(r.first);
+ //cerr<<"render "<<r.first<<" found, context "<<r.second<<", status: "<<status.status<<endl;
+ switch (status.status) {
+ case RENDERING:
+ XML.addAttribute("render","status","rendering",i);
+ XML.addAttribute("render","progress",status.progress,i);
+ break;
+ case RENDER_READY:
+ XML.addAttribute("render","status","render complete",i);
+ break;
+ case FAILED:
+ XML.addAttribute("render","status","render failed",i);
+ break;
+ case NOT_FOUND:
+ XML.addAttribute("render","status","error - not found",i);
+ break;
+ }
+ context_found=true;
+ }
+ }
+ if (!context_found) XML.addAttribute("render","status","context unavailable",i);
+ i++;
+ }
+ status=HTTPResponse::HTTP_OK;
+ }
+ }
else if (command[0]=="exit") {
logger.information("exiting");
exit(0);
@@ -154,6 +190,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
((Poco::AutoPtr<Rotor::Render_context>)task)->session_command(SC,XML,status);
if (XML.tagExists("render_id")){
//cerr<<"render started: "<<SC.uid<<" in context: "<<command[0]<<endl;
+ renders[SC.uid]=command[0];
}
}
}