diff --git a/public/assets/css/picoreflow.css b/public/assets/css/picoreflow.css index ec4b2b6..4920d2a 100644 --- a/public/assets/css/picoreflow.css +++ b/public/assets/css/picoreflow.css @@ -66,6 +66,7 @@ box-shadow: 0 0 1.1em 0 rgba(0,0,0,0.35),inset 0 0 9px 2px #000; position: relative; top: -3px; width: 200px; + height: 35px; } .progress { @@ -103,3 +104,9 @@ box-shadow: 0 0 1.1em 0 rgba(0,0,0,0.35),inset 0 0 9px 2px #000; .modal-body .table { margin-bottom: 0; } + +.select2-container .select2-choice { + height: 30px; + margin-top: 4px; + +} diff --git a/public/index.html b/public/index.html index d3669e1..dcff58d 100644 --- a/public/index.html +++ b/public/index.html @@ -46,34 +46,31 @@ -
- - - - @@ -141,9 +138,13 @@ function abortTask() { function enterEditMode() { //$('#e2').hide(); + state="EDIT" $('#saveas').show(); $('#e2').select2('container').hide(); - $('#main_nav').hide(); + $('#main_nav').slideUp(); + $('#nav_start').hide(); + $('#btn_edit').hide(); + $('#btn_exit').show(); $('#form_profile_name').attr('value', profiles[selected_profile].name); graph.series[0].options.marker.enabled=true; graph.series[0].options.draggableX=true; @@ -151,6 +152,20 @@ function enterEditMode() { graph.render(); } +function leaveEditMode() { + state="IDLE"; + $('#saveas').hide(); + $('#e2').select2('container').show(); + $('#main_nav').slideDown(); + $('#nav_start').show(); + $('#btn_edit').show(); + $('#btn_exit').hide(); + graph.series[0].options.marker.enabled=false; + graph.series[0].options.draggableX=false; + graph.series[0].options.draggableY=false; + ws_storage.send('GET'); + graph.render(); +} function saveProfile() { name = $('#form_profile_name').val(); @@ -171,6 +186,10 @@ function saveProfile() { ws_storage.send(put_cmd); console.log('came to this: ' + put_cmd); + + selected_profile_name = name; + + leaveEditMode(); } @@ -179,6 +198,7 @@ var state = "IDLE"; var graph; var profiles = []; var selected_profile = 0; +var selected_profile_name = "leadfree"; var host = "ws://" + window.location.hostname + ":8080"; @@ -237,21 +257,21 @@ ws_storage.onopen = function() var profile = profiles[i]; console.log(profile.name); $('#e2').append(''); + + if (profile.name == selected_profile_name) + { + console.log('Matchiemazvhie'); + selected_profile = i; + $('#e2').select2('val', i); + update_profile(i); + } + } - $('#e2').select2('val', '0'); - update_profile(0); } - - console.log('Requesting stored profiles'); - ws_storage.send('GET'); - - - - } @@ -577,7 +597,12 @@ $(function() { ws_status.onmessage = function(e) { x = JSON.parse(e.data); + + if(state!="EDIT") + { state = x.state; + } + $('#state').html(state); updateProgress(parseInt(parseFloat(x.runtime)/parseFloat(x.totaltime)*100)); @@ -597,6 +622,9 @@ $(function() { //console.log (e.data); //console.log('Percent finished:' + perc); + if(state!="EDIT") + { + if(state=="RUNNING") { $("#nav_start").hide(); @@ -615,7 +643,8 @@ $(function() { { $("#nav_start").show(); $("#nav_stop").hide(); - } + } + } } @@ -666,12 +695,13 @@ $(function() { cursor: 'resize', point: { events: { + /* drag: function (e) { $('#drag').html('Dragging ' + this.series.name + ', ' + this.category + ' to ' + Highcharts.numberFormat(e.newY, 0) + ''); }, drop: function () { $('#drop').html('In ' + this.series.name + ', ' + this.category + ' was set to ' + Highcharts.numberFormat(this.y, 0) + ''); - } + }*/ } }, stickyTracking: false diff --git a/storage/profiles/lead.json b/storage/profiles/lead.json index 77b368c..7d0599a 100644 --- a/storage/profiles/lead.json +++ b/storage/profiles/lead.json @@ -1 +1 @@ -{"data": [[0, 20], [60, 100], [168.38263665594855, 120.9375], [225.7138263665595, 176.25]], "type": "profile", "name": "lead"} \ No newline at end of file +{"data": [[0, 20], [60, 100], [180.7938551407944, 82.5], [225.7138263665595, 176.25]], "type": "profile", "name": "lead"} \ No newline at end of file diff --git a/storage/profiles/leadfree.json b/storage/profiles/leadfree.json index 0a33b73..55d64aa 100644 --- a/storage/profiles/leadfree.json +++ b/storage/profiles/leadfree.json @@ -1,5 +1 @@ -{ - "type" : "profile", - "name" : "leadfree", - "data" : [[0,20],[60,100],[100,200],[300,0]] -} +{"data": [[0, 20], [65.34931269433135, 138.43750000000003], [179.18059299191376, 165.62500000000003], [300, 0]], "type": "profile", "name": "leadfree"} \ No newline at end of file