Skip to content

Commit

Permalink
Display layer progress (#97)
Browse files Browse the repository at this point in the history
* Update scripts

* Update API Endpoint (needs testing)

* Fixed API call
  • Loading branch information
UnchartedBull authored Sep 23, 2019
1 parent e44928b commit 23e7ecf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@
"output": "package"
},
"linux": {
"target": [
{
"target": "deb",
"arch": [
"armv7l",
"arm64"
]
}
],
"target": [{
"target": "deb",
"arch": [
"armv7l",
"arm64"
]
}],
"category": "Utility"
}
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-no-autostart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ release=$(curl -s "https://api.github.com/repos/UnchartedBull/OctoDash/releases/
dependencies="libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 libuuid1 libappindicator3-1 libsecret-1-0 gir1.2-gnomekeyring-1.0"

echo "Installing OctoPrint Plugins"
~/OctoPrint/venv/bin/pip install -q "https://github.com/UnchartedBull/OctoPrint-DisplayLayerProgress/archive/master.zip"
~/OctoPrint/venv/bin/pip install -q "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip"
if [[ $* == *--ptg* ]]
then
~/OctoPrint/venv/bin/pip install -q "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip"
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ release=$(curl -s "https://api.github.com/repos/UnchartedBull/OctoDash/releases/
dependencies="libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 libuuid1 libappindicator3-1 libsecret-1-0 gir1.2-gnomekeyring-1.0"

echo "Installing OctoPrint Plugins"
~/OctoPrint/venv/bin/pip install -q "https://github.com/UnchartedBull/OctoPrint-DisplayLayerProgress/archive/master.zip"
~/OctoPrint/venv/bin/pip install -q "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip"
if [[ $* == *--ptg* ]]
then
~/OctoPrint/venv/bin/pip install -q "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip"
Expand Down
1 change: 1 addition & 0 deletions src/app/files/files.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 3 additions & 3 deletions src/app/layer-progress/layer-progress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export class LayerProgressService {
if (this.httpRequest) {
this.httpRequest.unsubscribe();
}
this.httpRequest = this.http.get(this.configService.getURL('plugin/DisplayLayerProgress'),
this.httpRequest = this.http.get(this.configService.getURL('plugin/DisplayLayerProgress/values').replace('/api', ''),
this.configService.getHTTPHeaders()).subscribe(
(data: OctoprintLayerProgressAPI) => {
observer.next({
current: data.layer.current === '-' ? 0 : data.layer.current,
total: data.layer.total === '-' ? 0 : data.layer.total,
current: data.layer.current === '-' ? 0 : data.layer.current + 1,
total: data.layer.total === '-' ? 0 : data.layer.total + 1,
fanSpeed: data.fanSpeed === '-' ? 0 : data.fanSpeed === 'Off' ? 0 : data.fanSpeed.replace('%', '')
});
}, (error: HttpErrorResponse) => {
Expand Down

0 comments on commit 23e7ecf

Please sign in to comment.