Skip to content

Commit

Permalink
v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sco01 committed Oct 2, 2019
1 parent 020b186 commit b8fb2c6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A dashboard tab for Octoprint that displays the most relevant info regarding the
* Printer profile, Connection status, Printer Status
* Hotend temp(s), Bed Temp, Chamber Temp, Fan speed
* Printed file, Progress
* Layer Duration Graph
* Estimated total time, ETA, Time left, Time since print started
* Current layer, Total layers
* Current height, Total height
Expand All @@ -32,22 +33,25 @@ A dashboard tab for Octoprint that displays the most relevant info regarding the
For release notes and release history, please visit the [wiki](https://github.com/StefanCohen/OctoPrint-Dashboard/wiki).

## Known limitations
* Translations to other languages are not supported yet.
* Translations to other languages is not supported yet.
* The CPU-temp will likely only work on a Raspberry Pi.
* Disk Usage will likely only work on Linux deratives.
* Testing limited to desktop browsers: Safari, Chrome and Firefox
* UI testing is limited to latest versions of desktop browsers: Safari, Chrome and Firefox
* Plugin testing is limited to latest verson of OctoPi on RPi3b and 3b+

## Dependencies

This plugin depends on [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to be installed. DisplayLayerProgress provides GCode analysis for the Fan, Layer, Height and Layer Average stats. Only the events from DisplayLayerProgress are used by the Dashboard plugin so you may disable "Navigationbar" and "Printer Display" in the DisplayLayerProgress plugin settings if you want to see them in the UI.
This plugin depends on [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to be installed. DisplayLayerProgress provides GCode analysis for the Fan, Layer, Height and Layer Average stats. Only the backend events from DisplayLayerProgress are used by the Dashboard plugin so you may disable "Navigationbar" and "Printer Display" in the DisplayLayerProgress plugin settings if you don't want to see them in the UI.

The dashboard uses the time estimates provided by PrintTimeGenius if it is installed but it is not required.

## Credits

* Inspired by OctoDash: https://github.com/UnchartedBull/OctoDash/
* Icons from: http://www.iconninja.com
* Github Contributors: Andy Harrison (wizard04wsu), Doug Hoyt (doughoyt), (j7126)
* Context Menus: https://github.com/nescalante/knockout.contextmenu [license](https://github.com/nescalante/knockout.contextmenu/blob/master/LICENSE)
* Chartist chart framework: https://gionkunz.github.io/chartist-js/ [license](https://github.com/gionkunz/chartist-js/blob/master/LICENSE-WTFPL)
* Github Contributors: Andy Harrison (wizard04wsu), Doug Hoyt (doughoyt), (j7126), Olli (OllisGit)

## Setup

Expand All @@ -57,20 +61,6 @@ Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wik

## Configuration

* Two progress gauge types can be configured in the plugin settings: Bar & Circle (default). The Bar gauge can be useful if you have multiple hotends or a heated chamber.
* For more configuration help, please visit the [wiki](https://github.com/StefanCohen/OctoPrint-Dashboard/wiki).

For users of Themeify:

"fas fa-tachometer-alt" is a suitable icon for Custom Tab-icons

For custom styles:

| Selector | CSS-Rule |
|-------------------|----------|
| .dashboardLarge | color |
| .dashboardSmall | color |
| .dashboardGauge | stroke |
| svg text | fill |
* For configuration help, please visit the [wiki](https://github.com/StefanCohen/OctoPrint-Dashboard/wiki).

![Screenshot](https://github.com/StefanCohen/OctoPrint-Dashboard/blob/master/screenshot-theme2.png)
6 changes: 5 additions & 1 deletion octoprint_dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class DashboardPlugin(octoprint.plugin.SettingsPlugin,
virtual_memory_percent = 0
disk_usage = 0
layer_times = []
layer_labels = []

def psUtilGetStats(self):
thermal = psutil.sensors_temperatures(fahrenheit=False)
Expand All @@ -41,7 +42,8 @@ def send_notifications(self):
diskUsagePercent=str(self.disk_usage),
cpuTemp=str(self.cpu_temp),
extrudedFilament=str(self.extruded_filament),
layerTimes=str(self.layer_times)))
layerTimes=str(self.layer_times),
layerLabels=str(self.layer_labels)))



Expand All @@ -51,6 +53,7 @@ def on_event(self, event, payload):

if int(payload.get('lastLayerDurationInSeconds')) > 0:
self.layer_times.append(payload.get('lastLayerDurationInSeconds'))
self.layer_labels.append(int(payload.get('currentLayer')) - 1)

self._plugin_manager.send_plugin_message(self._identifier, dict(totalLayer=payload.get('totalLayer'),
currentLayer=payload.get('currentLayer'),
Expand All @@ -68,6 +71,7 @@ def on_event(self, event, payload):
if event == "PrintStarted":
self._logger.info("Print Started: " + payload.get("name", ""))
del self.layer_times[:]
del self.layer_labels[:]

if event == Events.FILE_SELECTED:
self._logger.info("File Selected: " + payload.get("file", ""))
Expand Down
40 changes: 27 additions & 13 deletions octoprint_dashboard/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ $(function () {
if (data.diskUsagePercent) { self.diskUsagePercent(data.diskUsagePercent); }
if (data.cpuTemp) { self.cpuTemp(data.cpuTemp); }
if (data.extrudedFilament) { self.extrudedFilament(data.extrudedFilament); }
if (data.layerTimes) { self.renderChart(data.layerTimes); }
if (data.layerTimes && data.layerLabels) { self.renderChart(data.layerTimes, data.layerLabels); }
}
};

Expand Down Expand Up @@ -302,22 +302,29 @@ $(function () {
else return "Disconnected";
};

self.renderChart = function (layerTimes) {

console.log(layerTimes);
self.renderChart = function (layerTimes, layerLabels) {
//console.log(layerTimes);
//console.log(layerLabels);

//create a prototype multi-dimensional array
var data = {
series: [
[]
]
labels: [],
series: [
[]
]
};

//Prep the data
var values = JSON.parse(layerTimes);

var labels = JSON.parse(layerLabels);
for (var i = 0; i < values.length; i += 1){
data.series[0].push(values[i])
}
for (var i = 0; i < labels.length; i += 1){
data.labels.push(labels[i])
}

//Chart Options
var options = {
onlyInteger: true,
showPoint: false,
Expand All @@ -327,11 +334,18 @@ $(function () {
width: '100%',
height: '150px',
axisX: {
showGrid: false,
showLabel: false
}
};

showGrid: false,
showLabel: true,
labelInterpolationFnc: function skipLabels(value, index, labels) {
if(labels.length > 50) {
return index % 4 === 0 ? value : null;
} else {
return value;
}
}
}
};
//TODO: Create the chart on onStartupComplete and use the update method instead of re-drawing the entire chart for every event.
var chart = new Chartist.Line('.ct-chart', data, options );
};

Expand Down

0 comments on commit b8fb2c6

Please sign in to comment.