diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-05 14:10:55 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-05 14:10:55 +0000 |
| commit | 7ed9d7c6bdf4cce9c4dcd300a5f212f08c3661df (patch) | |
| tree | ba083c4c600784822459b4c8f654a6cc8e11bd2a | |
| parent | 5d8802e44adf01a1d8dd70dcbd5357d8641f37f9 (diff) | |
making plotting system
| -rwxr-xr-x | rotord/httplot | 24 | ||||
| -rw-r--r-- | rotord/src/graph.cpp | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/rotord/httplot b/rotord/httplot new file mode 100755 index 0000000..6b235f9 --- /dev/null +++ b/rotord/httplot @@ -0,0 +1,24 @@ +#!/usr/bin/python +import httplib +import argparse +parser = argparse.ArgumentParser() +parser.add_argument("method",default="GET",nargs='?') +parser.add_argument("path",default="/",nargs='?') +parser.add_argument("body",default="body",nargs='?') +parser.add_argument("ip",default="127.0.0.1:9000",nargs='?') +args=parser.parse_args() +connection = httplib.HTTPConnection(args.ip) +connection.request(args.method, args.path, args.body) +response= connection.getresponse().read() + +import xml.etree.ElementTree as ET +root = ET.fromstring(response) +signal= root.find("signal").text +output =signal.replace(",", "\n") +print output + +#print response +#connection = httplib.HTTPConnection('54.228.219.55:80') +#connection = httplib.HTTPConnection('127.0.0.1:9000') + + diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index a746e6b..fdbd4c8 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -36,7 +36,7 @@ bool Graph::signal_render(xmlIO &XML,const string &node,const float framerate) { for (float i=0;i<duration;i+=1.0f/framerate){ float s=(signal_output->get_output(Time_spec(i,framerate,duration))+1.0f)/10.0f; if (!fequal(sig,s)){ - val+=toString(i)+","+toString(s)+" "; + val+=toString(i)+" "+toString(s)+","; sig=s; } } |
