diff --git a/picoreflowd.py b/picoreflowd.py index 1927520..1292552 100644 --- a/picoreflowd.py +++ b/picoreflowd.py @@ -83,12 +83,12 @@ def handle_storage(): if not message: break log.debug("websocket (storage) received: %s"%message) - + try: msgdict = json.loads(message) except: msgdict = {} - + if message == "GET": log.info("GET command recived") wsock.send(get_profiles()) @@ -129,7 +129,7 @@ profile_path = os.path.join(script_dir,"storage","profiles") def get_profiles(): try : profile_files = os.listdir(profile_path) - except : + except : profile_files = [] profiles = [] for filename in profile_files: @@ -153,8 +153,8 @@ def save_profile(profile, force=False): def main(): ip = config.listening_ip port = config.listening_port - log.info("listening to %s:%d"%(ip,port)) - + log.info("listening on %s:%d"%(ip,port)) + server = WSGIServer((ip,port), app, handler_class=WebSocketHandler) server.serve_forever() diff --git a/public/assets/css/picoreflow.css b/public/assets/css/picoreflow.css index c2ff553..5a26c0e 100644 --- a/public/assets/css/picoreflow.css +++ b/public/assets/css/picoreflow.css @@ -1,11 +1,3 @@ -@font-face{ - font-family: "LCDN"; - src: url('/picoreflow/assets/fonts/LCDN.eot'); - src: local("LCD Normal"), - url('/picoreflow/assets/fonts/LCDN.woff') format("woff"), - url('/picoreflow/assets/fonts/LCDN.ttf') format("truetype"); -} - @font-face{ font-family: "Digi"; src: url('/picoreflow/assets/fonts/digital-7-webfont.eot'); @@ -15,11 +7,11 @@ } @font-face{ - font-family: "NoticeStd"; - src: url('/picoreflow/assets/fonts/noticestd-webfont.eot'); - src: local("NoticeStd Regular"), - url('/picoreflow/assets/fonts/noticestd-webfont.woff') format("woff"), - url('/picoreflow/assets/fonts/noticestd-webfont.ttf') format("truetype"); + font-family: "Tables"; + src: url('/picoreflow/assets/fonts/tables.eot'); + src: local("Tables"), + url('/picoreflow/assets/fonts/tables.woff') format("woff"), + url('/picoreflow/assets/fonts/tables.ttf') format("truetype"); } body { @@ -48,7 +40,6 @@ body { font-weight: normal; height: 45px; line-height: 45px; - width: 105px; vertical-align: middle; color: #d8d3c5; border-color: #000000; @@ -92,6 +83,7 @@ body { } .ds-num { + width: 105px; font-family: "Digi"; border-right: 1px solid #b9b6af; white-space: nowrap; @@ -123,17 +115,26 @@ body { .ds-led { margin: 0; - margin-top: 1px; - padding-top: 1px; - font-family: "NoticeStd"; - font-size: 32px; - font-weight: 400; - text-align: center; + font-family: "Tables"; + font-size: 38px; color: #1F1E1A; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - text-shadow: none; + text-shadow: 2px 2px 5px #000, -2px -2px 5px #000; +} + +.ds-trend { + top: 0; + text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.25), -1px -1px 0 rgba(0, 0, 0, 0.4); + color: rgb(233, 233, 233); + font-size: 20px; +} + +.ds-target { + color: #75890c; +} + +.ds-state { + border: none; + width: initial; } @@ -277,6 +278,10 @@ body { margin-top: 1px; } +.modal.fade.in { + top: 10%; +} + .alert { background-image: -webkit-gradient(linear,left 0,left 100%,from(#f5f5f5),to(#e8e8e8)); background-image: -webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%); @@ -316,3 +321,8 @@ body { .modal-body td { width: 50%; } + +.table-responsive { + overflow-x: hidden; + overflow-y: hidden; +} diff --git a/public/assets/fonts/LCDN.eot b/public/assets/fonts/LCDN.eot deleted file mode 100644 index 17a69a3..0000000 Binary files a/public/assets/fonts/LCDN.eot and /dev/null differ diff --git a/public/assets/fonts/LCDN.ttf b/public/assets/fonts/LCDN.ttf deleted file mode 100644 index 67c079c..0000000 Binary files a/public/assets/fonts/LCDN.ttf and /dev/null differ diff --git a/public/assets/fonts/LCDN.woff b/public/assets/fonts/LCDN.woff deleted file mode 100644 index 2c3a989..0000000 Binary files a/public/assets/fonts/LCDN.woff and /dev/null differ diff --git a/public/assets/fonts/noticestd-webfont.eot b/public/assets/fonts/noticestd-webfont.eot deleted file mode 100644 index ca5b1c2..0000000 Binary files a/public/assets/fonts/noticestd-webfont.eot and /dev/null differ diff --git a/public/assets/fonts/noticestd-webfont.svg b/public/assets/fonts/noticestd-webfont.svg deleted file mode 100644 index 154f722..0000000 --- a/public/assets/fonts/noticestd-webfont.svg +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/assets/fonts/noticestd-webfont.ttf b/public/assets/fonts/noticestd-webfont.ttf deleted file mode 100644 index 38004d1..0000000 Binary files a/public/assets/fonts/noticestd-webfont.ttf and /dev/null differ diff --git a/public/assets/fonts/noticestd-webfont.woff b/public/assets/fonts/noticestd-webfont.woff deleted file mode 100644 index e1e4532..0000000 Binary files a/public/assets/fonts/noticestd-webfont.woff and /dev/null differ diff --git a/public/assets/fonts/tables.eot b/public/assets/fonts/tables.eot new file mode 100644 index 0000000..25d33f6 Binary files /dev/null and b/public/assets/fonts/tables.eot differ diff --git a/public/assets/fonts/tables.ttf b/public/assets/fonts/tables.ttf new file mode 100644 index 0000000..8fe211c Binary files /dev/null and b/public/assets/fonts/tables.ttf differ diff --git a/public/assets/fonts/tables.woff b/public/assets/fonts/tables.woff new file mode 100644 index 0000000..7316d45 Binary files /dev/null and b/public/assets/fonts/tables.woff differ diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index 3b2eed6..3fd21e8 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -33,7 +33,7 @@ graph.live = }; -function update_profile(id) +function updateProfile(id) { selected_profile = id; job_time = parseInt(profiles[id].data[profiles[id].data.length-1][0]); @@ -48,6 +48,12 @@ function update_profile(id) graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ] , getOptions()); } +function deleteProfile() +{ + console.log("Delete profile:" + selected_profile_name); + // FIXME: Add cmd for socket communication to delete stored profile +} + function updateProgress(percentage) { @@ -68,7 +74,7 @@ function updateProfileTable() { var dps = 0; var slope = ""; - var color = []; + var color = ""; var html = '

Profile Points

'; html += ''; @@ -76,22 +82,22 @@ function updateProfileTable() for(var i=0; i=1) dps = Math.round( (graph.profile.data[i][1]-graph.profile.data[i-1][1])/(graph.profile.data[i][0]-graph.profile.data[i-1][0]) * 10) / 10; - if (dps > 0) { slope = "up"; color[0]="red"; color[1]="rgba(233, 28, 0, 0.54)"; } else - if (dps < 0) { slope = "down"; color[0]="blue"; color[1]="rgba(74, 159, 255, 0.54)"; dps *= -1; } else - if (dps == 0) { slope = "right"; color[0]="white"; color[1]="grey"; } + if (dps > 0) { slope = "up"; color="rgba(206, 5, 5, 1)"; } else + if (dps < 0) { slope = "down"; color="rgba(23, 108, 204, 1)"; dps *= -1; } else + if (dps == 0) { slope = "right"; color="grey"; } html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; } html += '
#Target TimeTarget TemperatureSlope in °C/s

' + i + '

 
'; $('#profile_table').html(html); - + //Link table to graph $(".form-control").change(function(e) { @@ -100,7 +106,7 @@ function updateProfileTable() var fields = id.split("-"); var col = parseInt(fields[1]); var row = parseInt(fields[2]); - + graph.profile.data[row][col] = value; graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ], getOptions()); updateProfileTable(); @@ -288,9 +294,9 @@ function getOptions() tickColor: 'rgba(216, 211, 197, 0.2)', font: { - size: 12, + size: 14, lineHeight: 14, weight: "normal", - family: "LCDN", + family: "Digi", variant: "small-caps", color: "rgba(216, 211, 197, 0.85)" } @@ -306,10 +312,10 @@ function getOptions() tickColor: 'rgba(216, 211, 197, 0.2)', font: { - size: 12, + size: 14, lineHeight: 14, weight: "normal", - family: "LCDN", + family: "Digi", variant: "small-caps", color: "rgba(216, 211, 197, 0.85)" } @@ -438,8 +444,8 @@ $(document).ready(function() eta = minutes+':'+ (seconds < 10 ? "0" : "") + seconds; updateProgress(parseFloat(x.runtime)/parseFloat(x.totaltime)*100); - $('#state_prg').html(parseInt(parseFloat(x.runtime)/parseFloat(x.totaltime)*100) + '%'); - $('#state_eta').html(eta); + $('#progressBar').html(parseInt(parseFloat(x.runtime)/parseFloat(x.totaltime)*100) + '%'); + $('#state').html(eta); $('#target_temp').html(parseInt(x.target)); } @@ -451,12 +457,13 @@ $(document).ready(function() } $('#act_temp').html(parseInt(x.temperature)); - $('#heat').css("background-color", (x.heat > 0.5 ? "rgba(233, 28, 0, 0.84)" : "rgba(46, 12, 12, 0.62") ); - $('#heat').css("box-shadow", (x.heat > 0.5 ? "0 0 5px 0 rgba(233, 28, 0, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em 0 rgba(0,0,0,0.75)") ); - $('#air').css("background-color", (x.air > 0.5 ? "rgba(240, 199, 67, 0.84)" : "rgba(46, 38, 12, 0.62)") ); - $('#air').css("box-shadow", (x.air > 0.5 ? "0 0 5px 0 rgba(240, 199, 67, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em 0 rgba(0,0,0,0.75)") ); - $('#cool').css("background-color", (x.cool > 0.5 ? "rgba(74, 159, 255, 0.84)" : "rgba(12, 28, 46, 0.62)") ); - $('#cool').css("box-shadow", (x.cool > 0.5 ? "0 0 5px 0 rgba(74, 159, 255, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em 0 rgba(0,0,0,0.75)") ); + $('#hazard').css("color", (x.temperature > 45 ? "rgb(255, 204, 0)" : "rgba(12, 12, 12, 0.62") ); + $('#heat').css("color", (x.heat > 0.5 ? "rgba(233, 28, 0, 0.84)" : "rgba(46, 12, 12, 0.62") ); + //$('#heat').css("text-shadow", (x.heat > 0.5 ? "0 0 5px rgba(233, 28, 0, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em rgba(0,0,0,0.75)") ); + $('#air').css("color", (x.air > 0.5 ? "rgba(255, 255, 255, 0.84)" : "rgba(46, 38, 12, 0.62)") ); + //$('#air').css("text-shadow", (x.air > 0.5 ? "0 0 5px rgba(240, 199, 67, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em rgba(0,0,0,0.75)") ); + $('#cool').css("color", (x.cool > 0.5 ? "rgba(74, 159, 255, 0.84)" : "rgba(12, 28, 46, 0.62)") ); + //$('#cool').css("text-shadow", (x.cool > 0.5 ? "0 0 5px rgba(74, 159, 255, 0.84), inset 0 0 5px 2px rgba(255,255,255,0.25)" : "0 0 1.1em rgba(0,0,0,0.75)") ); state_last = state; @@ -532,7 +539,7 @@ $(document).ready(function() { selected_profile = i; $('#e2').select2('val', i); - update_profile(i); + updateProfile(i); } } @@ -550,7 +557,7 @@ $(document).ready(function() $("#e2").on("change", function(e) { - update_profile(e.val); + updateProfile(e.val); }); } diff --git a/public/index.html b/public/index.html index 2b170fc..de58cd5 100644 --- a/public/index.html +++ b/public/index.html @@ -30,21 +30,21 @@
Real Temp
-
Target Temp
-
Progress
-
ETA
+
Target Temp
+
Status
25°C
-
---°C
-
---
-
--:--
-
- n - t - , +
---°C
+
+
+ I + [ + \ + l
+
@@ -89,7 +89,7 @@
- +
@@ -126,6 +126,25 @@
+