Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions kiln-controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def handle_status():
log.info("websocket (status) closed")


@app.get('/log')
def handle_log():
log.info("/log command received")
if hasattr(oven,'pid'):
if hasattr(oven.pid,'pidstats'):
return json.dumps(ovenWatcher.lastlog())


def get_profiles():
try:
profile_files = os.listdir(profile_path)
Expand Down
3 changes: 3 additions & 0 deletions lib/ovenWatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def run(self):
self.notify_all(oven_state)
time.sleep(self.oven.time_step)

def lastlog(self):
return self.last_log

def lastlog_subset(self,maxpts=50):
'''send about maxpts from lastlog by skipping unwanted data'''
totalpts = len(self.last_log)
Expand Down
30 changes: 29 additions & 1 deletion public/assets/js/picoreflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ function getOptions()
color: 'rgba(216, 211, 197, 0.55)',
borderWidth: 1,
labelMargin: 10,
mouseActiveRadius: 50
mouseActiveRadius: 50,
hoverable: true
},

legend:
Expand Down Expand Up @@ -487,6 +488,33 @@ $(document).ready(function()
// });
};

$("<div id='tooltip'></div>").css({
position: "absolute",
display: "none",
border: "1px solid #fdd",
padding: "2px",
"background-color": "#fee",
opacity: 0.80
}).appendTo("body");

$("#graph_container").bind("plothover", function (event, pos, item) {
if (!pos.x || !pos.y) {
return;
}

if (item) {
const x = item.datapoint[0]
const y = item.datapoint[1].toFixed(0);

$("#tooltip").html(item.series.label + " at " +
new Date(x * 1000).toISOString().substring(11, 16) + " = " + y + "º" + temp_scale_display)
.css({top: item.pageY+5, left: item.pageX+5})
.fadeIn(200);
} else {
$("#tooltip").stop().hide();
}
})

ws_status.onclose = function()
{
$.bootstrapGrowl("<span class=\"glyphicon glyphicon-exclamation-sign\"></span> <b>ERROR 1:</b><br/>Status Websocket not available", {
Expand Down