Merge branch 'maintenance' of github.com:foosel/OctoPrint into dev/permission
This commit is contained in:
commit
01e557a689
2 files changed
+17
-8
No files matched your search
@@ -235,6 +235,9 @@ $(function() {
|
||||
if (lastData.hasOwnProperty("tool" + i)) {
|
||||
tools[i]["actual"](lastData["tool" + i].actual);
|
||||
tools[i]["target"](lastData["tool" + i].target);
|
||||
} else {
|
||||
tools[i]["actual"](0);
|
||||
tools[i]["target"](0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,19 +321,25 @@ $(function() {
|
||||
var plotInfo = self._getPlotInfo();
|
||||
if (plotInfo === undefined) return;
|
||||
|
||||
// update the data
|
||||
self.plot.setData(plotInfo.data);
|
||||
self.plot.getAxes().yaxis.max = Math.max(Math.max.apply(null, plotInfo.max) * 1.1, 310);
|
||||
self.updateLegend(self._replaceLegendLabel);
|
||||
self.plot.draw();
|
||||
var newMax = Math.max(Math.max.apply(null, plotInfo.max) * 1.1, 310);
|
||||
if (newMax !== self.plot.getAxes().yaxis.max) {
|
||||
// re-init (because flot apparently has NO way to change the max value of an axes :/)
|
||||
self._initializePlot(true, plotInfo);
|
||||
} else {
|
||||
// update the data
|
||||
self.plot.setData(plotInfo.data);
|
||||
self.plot.setupGrid();
|
||||
self.updateLegend(self._replaceLegendLabel);
|
||||
self.plot.draw();
|
||||
}
|
||||
};
|
||||
|
||||
self._initializePlot = function(force) {
|
||||
self._initializePlot = function(force, plotInfo) {
|
||||
var graph = $("#temperature-graph");
|
||||
if (!graph.length) return; // no graph
|
||||
if (self.plot && !force) return; // already initialized
|
||||
|
||||
var plotInfo = self._getPlotInfo();
|
||||
plotInfo = plotInfo || self._getPlotInfo();
|
||||
if (plotInfo === undefined) return;
|
||||
|
||||
// we don't have a plot yet, we need to set stuff up
|
||||
|
||||
@@ -2605,7 +2605,7 @@ class MachineCom(object):
|
||||
if not match and support_r:
|
||||
match = regexes_parameters["floatR"].search(cmd)
|
||||
|
||||
if match:
|
||||
if match and self.last_temperature.tools.get(toolNum) is not None:
|
||||
try:
|
||||
target = float(match.group("value"))
|
||||
self.last_temperature.set_tool(toolNum, target=target)
|
||||
|
||||
Reference in new issue
Block a user