kopia lustrzana https://github.com/botheredbybees/kilnController
client websocket cleanup
rodzic
3243e6a2c2
commit
a42e90fae9
|
@ -211,26 +211,48 @@ function updateProgress(percentage){
|
||||||
|
|
||||||
var host = "ws://" + window.location.hostname + ":8080";
|
var host = "ws://" + window.location.hostname + ":8080";
|
||||||
|
|
||||||
var s = new WebSocket(host+"/status");
|
|
||||||
var c = new WebSocket(host+"/control");
|
var c = new WebSocket(host+"/control");
|
||||||
var st = new WebSocket(host+"/storage");
|
|
||||||
|
|
||||||
var state = "IDLE";
|
|
||||||
var graph;
|
|
||||||
|
|
||||||
st.onmessage = function(e)
|
|
||||||
{
|
|
||||||
console.log('Storage MSG:' + e.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
var test = st.send('GET');
|
|
||||||
console.log('Requesting Profiles: ' +test);
|
|
||||||
|
|
||||||
c.onmessage = function(e)
|
c.onmessage = function(e)
|
||||||
{
|
{
|
||||||
console.log (e.data);
|
console.log (e.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var state = "IDLE";
|
||||||
|
var graph;
|
||||||
|
|
||||||
|
// Status Socket
|
||||||
|
|
||||||
|
var ws_status = new WebSocket(host+"/status");
|
||||||
|
|
||||||
|
ws_status.onopen = function()
|
||||||
|
{
|
||||||
|
console.log("Status Socket has been opened");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Storage Socket
|
||||||
|
|
||||||
|
var ws_storage = new WebSocket(host+"/storage");
|
||||||
|
|
||||||
|
ws_storage.onopen = function()
|
||||||
|
{
|
||||||
|
console.log("Storage Socket has been opened");
|
||||||
|
|
||||||
|
ws_storage.onmessage = function(e)
|
||||||
|
{
|
||||||
|
console.log('Storage MSG:' + e.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Requesting stored profiles');
|
||||||
|
|
||||||
|
ws_storage.send('GET');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#e2").select2({
|
$("#e2").select2({
|
||||||
placeholder: "Temperature Curve",
|
placeholder: "Temperature Curve",
|
||||||
|
@ -534,7 +556,7 @@ $(function() {
|
||||||
var series = this.series[1];
|
var series = this.series[1];
|
||||||
|
|
||||||
|
|
||||||
s.onmessage = function(e)
|
ws_status.onmessage = function(e)
|
||||||
{
|
{
|
||||||
x = JSON.parse(e.data);
|
x = JSON.parse(e.data);
|
||||||
state = x.state;
|
state = x.state;
|
||||||
|
@ -651,6 +673,8 @@ $(function() {
|
||||||
|
|
||||||
graph = new Highcharts.Chart(options);
|
graph = new Highcharts.Chart(options);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Ładowanie…
Reference in New Issue