gCodeVisualizer can be enabled as a feature in config now (enabled by

default)
This commit is contained in:
Alex Ustyantsev committed 2013-02-03 12:04:41 +03:00
1 parent a5518f7877
commit e49669430b
5 files changed
+18 -6

No files matched your search

+2 -1
View File
@@ -28,7 +28,8 @@ def index():
"index.html",
webcamStream=settings().get("webcam", "stream"),
enableTimelapse=(settings().get("webcam", "snapshot") is not None and settings().get("webcam", "ffmpeg") is not None),
enableEstimations=(settings().getBoolean("feature", "analyzeGcode"))
enableEstimations=(settings().getBoolean("feature", "analyzeGcode")),
gCodeVisualizer=settings().get("feature", "gCodeVisualizer")
)
#~~ Printer state
+2 -1
View File
@@ -39,7 +39,8 @@ old_default_settings = {
"timelapse_tmp": None
},
"feature": {
"analyzeGcode": True
"analyzeGcode": True,
"gCodeVisualizer": True
},
}
@@ -109,7 +109,7 @@ GCODE.gCodeReader = (function(){
lines = reader.target.result.split(/\n/);
reader.target.result = null;
prepareGCode();
worker.postMessage({
"cmd":"parseGCode",
"msg":{
+12 -2
View File
@@ -812,6 +812,12 @@ function GcodeViewModel() {
self.loadedFilename = undefined;
self.status = 'idle';
self.enabled = false;
self.initialize = function(){
self.enabled = true;
GCODE.ui.initHandlers();
}
self.loadFile = function(filename){
if(self.status == 'idle'){
@@ -849,6 +855,8 @@ function GcodeViewModel() {
}
self._processData = function(data) {
if(!self.enabled)return;
if(self.loadedFilename == data.job.filename){
var cmdIndex = GCODE.gCodeReader.getLinesCmdIndex(data.progress.progress);
if(cmdIndex){
@@ -1056,8 +1064,10 @@ $(function() {
if (webcamElement) {
ko.applyBindings(webcamViewModel, document.getElementById("webcam"));
}
GCODE.ui.initHandlers();
var gCodeVisualizerElement = document.getElementById("tab2d");
if(gCodeVisualizerElement){
gcodeViewModel.initialize();
}
//~~ startup commands
connectionViewModel.requestData();
+1 -1
View File
@@ -128,7 +128,7 @@
<ul class="nav nav-tabs" id="tabs">
<li class="active"><a href="#temp" data-toggle="tab">Temperature</a></li>
<li><a href="#controls" data-toggle="tab">Controls</a></li>
<li><a href="#tab2d" data-toggle="tab">GCode Viewer</a></li>
{% if gCodeVisualizer %}<li><a href="#tab2d" data-toggle="tab">GCode Viewer</a></li>{% endif %}
<!--<li><a href="#speed" data-toggle="tab">Speed</a></li>-->
<li><a href="#term" data-toggle="tab">Terminal</a></li>
{% if webcamStream %}<li><a href="#webcam" data-toggle="tab">Webcam</a></li>{% endif %}