Commit 073bfe4b authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

new trace page

parent 1da12a12
......@@ -3,3 +3,4 @@ trace_dumpdiff
trace_fft
trace_list
trace_view
trace2file
/*
Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2007, 2008, 2011, 2013
Copyright Jeroen Vreeken (jeroen@vreeken.net), 2014
Copyright Stichting C.A. Muller Radioastronomiestation, 2007, 2008, 2011
This program is free software: you can redistribute it and/or modify
......@@ -123,6 +123,11 @@ int main(int argc, char **argv)
trace_packet_write_fd(fd_file, pkt);
trace_packet_put(pkt);
pkt = trace_packet_new();
trace_packet_type_set(pkt, trace->type);
trace_packet_write_fd(fd_file, pkt);
trace_packet_put(pkt);
trace->handler_read = trace_handler_read;
printf("Wait for data and dump to file\n");
......
......@@ -30,3 +30,4 @@ command.cgi
shell.cgi
status.cgi
trace.cgi
traces/*
......@@ -23,3 +23,19 @@ screen -S console -X screen -t console_manual console_manual
screen -S console -X screen -t console_sattracker console_sattracker
screen -S console -X screen -t console_weather console_weather
screen -S console -X screen -t console_httpd console_httpd
TR=`ls traces/*trace`
for tr in $TR; do
echo $tr
mv -f ${tr}.4 ${tr}.5
mv -f ${tr}.3 ${tr}.4
mv -f ${tr}.2 ${tr}.3
mv -f ${tr}.1 ${tr}.2
mv -f ${tr} ${tr}.1
done
screen -S console -X screen -t trace_az_pos ../../common/trace/trace2file localhost 10000 Azimuth_Position traces/Azimuth_Position.trace 250
screen -S console -X screen -t trace_az_pos ../../common/trace/trace2file localhost 10000 Elevation_Position traces/Elevation_Position.trace 250
screen -S console -X screen -t trace_az_pos ../../common/trace/trace2file localhost 10000 Azimuth_Speed traces/Azimuth_Speed.trace 250
screen -S console -X screen -t trace_az_pos ../../common/trace/trace2file localhost 10000 Elevation_Speed_Right traces/Elevation_Speed_Right.trace 250
screen -S console -X screen -t trace_az_pos ../../common/trace/trace2file localhost 10000 Elevation_Speed_Left traces/Elevation_Speed_Left.trace 250
......@@ -105,6 +105,9 @@
<td>
<a href="log/" target="_blank">Logs</a>
</td>
<td>
<a href="trace.html" target="_blank">Trace</a>
</td>
<td align="center">
<b>
<a href="help.html" target="_blank">Help</a>
......@@ -122,7 +125,7 @@
</body>
<script src="load.js" type="text/javascript"></script>
<script src="js/load.js" type="application/javascript"></script>
<script type="text/javascript">
......@@ -148,23 +151,23 @@
*/
/* 'includes' */
eval(load("dt_ui.js"));
eval(load("trace.js"));
eval(load("azel.js"));
eval(load("j2000.js"));
eval(load("status.js"));
eval(load("manual.js"));
eval(load("sun.js"));
eval(load("moon.js"));
eval(load("sat.js"));
eval(load("dt_view.js"));
eval(load("authorization.js"));
eval(load("utils.js"));
eval(load("offset.js"));
eval(load("model.js"));
eval(load("dt_websocket.js"));
eval(load("log.js"));
eval(load("dt_status.js"));
eval(load("js/dt_ui.js"));
eval(load("js/trace.js"));
eval(load("js/azel.js"));
eval(load("js/j2000.js"));
eval(load("js/status.js"));
eval(load("js/manual.js"));
eval(load("js/sun.js"));
eval(load("js/moon.js"));
eval(load("js/sat.js"));
eval(load("js/dt_view.js"));
eval(load("js/authorization.js"));
eval(load("js/utils.js"));
eval(load("js/offset.js"));
eval(load("js/model.js"));
eval(load("js/dt_websocket.js"));
eval(load("js/log.js"));
eval(load("js/dt_status.js"));
new dt_websocket("ws://"+ window.location.host +"/dt");
......
../js/
\ No newline at end of file
......@@ -73,15 +73,15 @@
<script src="load.js"></script>
<script src="js/load.js"></script>
<script type="text/javascript">
<script type="application/javascript">
eval(load("dt_ui.js"));
eval(load("dt_websocket.js"));
eval(load("trace.js"));
eval(load("utils.js"));
eval(load("status.js"));
eval(load("js/dt_ui.js"));
eval(load("js/dt_websocket.js"));
eval(load("js/trace.js"));
eval(load("js/utils.js"));
eval(load("js/status.js"));
new dt_websocket("ws://"+ window.location.host +"/dt");
......
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>
Trace
</title>
</head>
<body background="achtergrond.jpg">
<div id="trace_win"></div>
</head>
<body>
<div id="graphdiv"></div>
</body>
<script src="js/load.js" type="application/javascript"></script>
<script src="js/trace.js" type="application/javascript"></script>
<script src="js/dt_ui.js" type="application/javascript"></script>
<script src="js/dygraph-combined.js" type="application/javascript"></script>
<script type="application/javascript">
var tw = new dt_ui_window("trace_win");
tw.title_set("Trace");
var graph = new dt_ui_element("trace_win_graph");
var tsel = new dt_ui_select("trace_win_select");
tw.add([ graph, tsel ]);
graph.width_set(700);
graph.height_set(350);
tw.align_vertical([ tsel, graph ]);
var traces_url = "/traces/";
var traces_index = load(traces_url, true);
var traces_links = traces_index.split("href=");
var i;
traces_links.shift();
for (i = 0; i < traces_links.length; i++)
traces_links[i] = traces_links[i].match("'.*'")[0];
for (i = 0; i < traces_links.length; i++)
traces_links[i] = traces_links[i].substring(1, traces_links[i].length - 1);
function load_trace(tracename)
{
load_bin(tracename, function(buf) {
var ts = new trace_stream();
var got_time = false;
var trace_data = new Array();
ts.handler_value = function(ts, value) {
var td = new trace_value();
td.set(value);
trace_data.push(td);
}
ts.rx(buf);
ts.handle();
var i;
for (i = 0; i < trace_data.length; i++) {
if (!got_time && trace_data[i].t.sec > 100000) {
var newt = new timespec();
newt.set(trace_data[i].t);
var j;
for (j = i -1; j >= 0; j--) {
newt.sub(ts.interval);
trace_data[j].t.set(newt);
}
got_time = true;
}
}
var graph_data = new Array();
for (i = 0; i < trace_data.length; i++) {
console.log(i+": " + trace_data[i].t.sec + "." +
trace_data[i].t.nsec + " " + trace_data[i].value);
var td = new Array();
td.push(new Date(trace_data[i].t.ms_get()));
td.push(trace_data[i].value);
graph_data.push(td);
}
g = new Dygraph(
graph.element,
graph_data,
{ labels: [ "x", ts.name ] }
);
});
}
var i;
for (i = 0; i < traces_links.length; i++) {
tsel.option_add(traces_links[i], load_trace, traces_url + traces_links[i]);
}
</script>
</html>
../console/traces
\ No newline at end of file
......@@ -24,9 +24,9 @@ var authorization_loaded;
if (!authorization_loaded) {
authorization_loaded = true;
eval(load("dt_ui.js"));
eval(load("status.js"));
eval(load("dt_websocket.js"));
eval(load("js/dt_ui.js"));
eval(load("js/status.js"));
eval(load("js/dt_websocket.js"));
function authorization_tracker(name, ui_element, ind_element)
{
......
......@@ -34,9 +34,9 @@ var azel_loaded;
if (!azel_loaded) {
azel_loaded = true;
eval(load("utils.js"));
eval(load("dt_websocket.js"));
eval(load("dt_ui.js"));
eval(load("js/utils.js"));
eval(load("js/dt_websocket.js"));
eval(load("js/dt_ui.js"));
......
......@@ -36,7 +36,7 @@ dt_ui_color_indicator_red = "#ff0000";
dt_ui_padding_height_window = 10;
dt_ui_padding_width_window = 10;
eval(load("trace.js"));
eval(load("js/trace.js"));
function strip_px(pos)
{
......
This diff is collapsed.
......@@ -29,8 +29,8 @@ j2000_loaded = true;
Communication with the tracker
*/
eval(load("dt_ui.js"));
eval(load("status.js"));
eval(load("js/dt_ui.js"));
eval(load("js/status.js"));
function j2000_command (url, ident)
{
......
......@@ -23,8 +23,8 @@ var log_loaded;
if (!log_loaded) {
log_loaded = true;
eval(load("dt_ui.js"));
eval(load("status.js"));
eval(load("js/dt_ui.js"));
eval(load("js/status.js"));
function log(element_name) {
var log_this = this;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment