keep up with master...tick graph display changes

This commit is contained in:
jbruce 2022-11-15 11:03:16 -05:00
parent 22b663f648
commit 748253244f
2 changed files with 29 additions and 15 deletions

View File

@ -130,7 +130,7 @@ sim_R_ho_air = 0.05 # K/W " with internal air circulation
# be in that scale.
temp_scale = "f" # c = Celsius | f = Fahrenheit - Unit to display
time_scale_slope = "h" # s = Seconds | m = Minutes | h = Hours - Slope displayed in temp_scale per time_scale_slope
time_scale_profile = "m" # s = Seconds | m = Minutes | h = Hours - Enter and view target time in time_scale_profile
time_scale_profile = "h" # s = Seconds | m = Minutes | h = Hours - Enter and view target time in time_scale_profile
# emergency shutoff the profile if this temp is reached or exceeded.
# This just shuts off the profile. If your SSR is working, your kiln will

View File

@ -188,23 +188,24 @@ function hazardTemp(){
}
}
function timeTickFormatter(val)
function timeTickFormatter(val,axis)
{
if (val < 1800)
{
return val;
}
else
{
var hours = Math.floor(val / (3600));
var div_min = val % (3600);
var minutes = Math.floor(div_min / 60);
// hours
if(axis.max>3600) {
//var hours = Math.floor(val / (3600));
//return hours;
return Math.floor(val/3600);
}
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
// minutes
if(axis.max<=3600) {
return Math.floor(val/60);
}
return hours+":"+minutes;
}
// seconds
if(axis.max<=60) {
return val;
}
}
function runTask()
@ -366,6 +367,18 @@ function saveProfile()
leaveEditMode();
}
function get_tick_size() {
switch(time_scale_profile){
case "s":
return 1;
case "m":
return 60;
case "h":
return 3600;
}
return 3600;
}
function getOptions()
{
@ -395,6 +408,7 @@ function getOptions()
min: 0,
tickColor: 'rgba(216, 211, 197, 0.2)',
tickFormatter: timeTickFormatter,
tickSize: get_tick_size(),
font:
{
size: 14,