From ebc874413991fbc3d07493ece55f88f23e437af6 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 14 May 2014 20:06:02 +0100 Subject: NT bugs cleaned and variable array type functional --- NT/src/rendercontext.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'NT/src/rendercontext.cpp') diff --git a/NT/src/rendercontext.cpp b/NT/src/rendercontext.cpp index 77a7701..217a05a 100644 --- a/NT/src/rendercontext.cpp +++ b/NT/src/rendercontext.cpp @@ -74,24 +74,27 @@ string Render_context::text_render(string node_id){ } } else { - p=graph.get_node(id); + p=graph.get_node(node_id); if (!p){ - logger.error("text_render: node '"+id+"' not found"); + logger.error("text_render: node '"+node_id+"' not found"); return ""; } } Node_type* s=(dynamic_cast*>(p)); if (!s) { - logger.error("text_render: node '"+id+"' is not a text node"); + logger.error("text_render: node '"+node_id+"' is not a text node"); return ""; } string st=""; for (double t=0;t<10.0;t+=0.765){ Frame_parameters f=Frame_parameters(t,25.0,10.0,640,360); - st+=(dynamic_cast*>(p))->get_output(f)+"\n"; + st+=toString(t)+":"+(dynamic_cast*>(p))->get_output(f)+","; } return st; } +bool Render_context::video_render(std::string output_filename,std::string node_id=""){ + return true; +} void Render_context::session_command(const Session_command& command,xmlIO& XML,HTTPResponse::HTTPStatus& status){ string s; @@ -259,6 +262,30 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H status=HTTPResponse::HTTP_OK; } } + if (command.commands[1]=="text") { + if (command.method=="GET") { + if(state==IDLE){ + string text_node=command.body; + if (text_node!=""){ + XML.addValue("data",text_render(text_node)); + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Text node not specified"); + } + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Session busy"); + XML.addValue("error","Session busy"); + } + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Bad request"); + XML.addValue("error","Bad request"); + } + } /* if (command.commands[1]=="signal") { if (command.method=="GET") { //generate xml from 1st signal output -- cgit v1.2.3