First step to solve #5

pull/1/head
chrono 2014-11-26 00:05:37 +01:00
rodzic 0c71f57caa
commit d782185dad
1 zmienionych plików z 23 dodań i 3 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ var graph = [ 'profile', 'live'];
var points = []; var points = [];
var profiles = []; var profiles = [];
var selected_profile = 0; var selected_profile = 0;
var time_mode = 0;
var selected_profile_name = "leadfree"; var selected_profile_name = "leadfree";
var host = "ws://" + window.location.hostname + ":8080"; var host = "ws://" + window.location.hostname + ":8080";
@ -77,7 +78,7 @@ function updateProfileTable()
var color = ""; var color = "";
var html = '<h3>Profile Points</h3><div class="table-responsive" style="scroll: none"><table class="table table-striped">'; var html = '<h3>Profile Points</h3><div class="table-responsive" style="scroll: none"><table class="table table-striped">';
html += '<tr><th style="width: 50px">#</th><th>Target Time</th><th>Target Temperature</th><th>Slope in &deg;C/s</th><th></th></tr>'; html += '<tr><th style="width: 50px">#</th><th>Target Time</th><th>Target Temperature in °C</th><th>Slope in &deg;C/s</th><th></th></tr>';
for(var i=0; i<graph.profile.data.length;i++) for(var i=0; i<graph.profile.data.length;i++)
{ {
@ -101,7 +102,7 @@ function updateProfileTable()
//Link table to graph //Link table to graph
$(".form-control").change(function(e) $(".form-control").change(function(e)
{ {
var id = $(this)[0].id//e.currentTarget.attributes.id; var id = $(this)[0].id; //e.currentTarget.attributes.id
var value = parseInt($(this)[0].value); var value = parseInt($(this)[0].value);
var fields = id.split("-"); var fields = id.split("-");
var col = parseInt(fields[1]); var col = parseInt(fields[1]);
@ -113,6 +114,25 @@ function updateProfileTable()
}); });
} }
function timeTickFormatter(val)
{
if (val < 1800)
{
return val;
}
else
{
var hours = Math.floor(val / (3600));
var div_min = val % (3600);
var minutes = Math.floor(div_min / 60);
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
return hours+":"+minutes;
}
}
function runTask() function runTask()
{ {
var cmd = var cmd =
@ -301,9 +321,9 @@ function getOptions()
xaxis: xaxis:
{ {
//tickSize: 30,
min: 0, min: 0,
tickColor: 'rgba(216, 211, 197, 0.2)', tickColor: 'rgba(216, 211, 197, 0.2)',
tickFormatter: timeTickFormatter,
font: font:
{ {
size: 14, size: 14,