Skip to content

Commit

Permalink
Finalize Settings menu (#413)
Browse files Browse the repository at this point in the history
* Add warning if config isn't saved

* update sample config

* new config structure

* New config schema / interface

* Use new config and redo Initial Config Screen

* Finished General Settings

* Update fileSorting Config

* Include first OctoDash Settings

* Finish OctoDash Settings

* Plugins settings

* Hide settings by default

* Add version information to settings

* Update sample.config.json to reflect actual config
  • Loading branch information
UnchartedBull committed Feb 10, 2020
1 parent df224fc commit 87657e0
Show file tree
Hide file tree
Showing 17 changed files with 772 additions and 185 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function createWindow() {
window.setFullScreen(true)
}

setTimeout(sendVersionInfo, 42 * 1000);
setTimeout(sendVersionInfo, 30 * 1000);
activateScreenSleepListener();

window.on('closed', () => {
Expand Down
128 changes: 86 additions & 42 deletions sample.config.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,95 @@
{
"octoprint": {
"url": "http://localhost:5000/api/",
"accessToken": "INSERT API KEY HERE",
"apiInterval": 15000
},
"printer": {
"name": "NAME HERE",
"xySpeed": 100,
"zSpeed": 5
},
"filament": {
"thickness": 0,
"density": 0
},
"octodash": {
"touchscreen": true,
"temperatureSensor": null,
"customActions": [{
"icon": "home",
"command": "G28",
"color": "#dcdde1"
"config": {
"octoprint": {
"accessToken": "INSERT API KEY HERE",
"url": "http://localhost:5000/api/"
},
"printer": {
"name": "NAME HERE",
"xySpeed": 100,
"zSpeed": 5
},
"filament": {
"density": 0,
"thickness": 0,
"feedLength": 470,
"feedSpeed": 100
},
"plugins": {
"displayLayerProgress": {
"enabled": true
},
{
"icon": "ruler-vertical",
"command": "G29",
"color": "#44bd32"
"enclosure": {
"enabled": true,
"ambientSensorID": null,
"filament1SensorID": null,
"filament2SensorID": null
},
{
"icon": "fire-alt",
"command": "M140 S50; M104 S185",
"color": "#e1b12c"
"filamentManager": {
"enabled": true
},
{
"icon": "snowflake",
"command": "M140 S0; M104 S0",
"color": "#0097e6"
"preheatButton": {
"enabled": true
},
{
"icon": "redo-alt",
"command": "[!RELOAD]",
"color": "#7f8fa6"
"printTimeGenius": {
"enabled": true
},
{
"icon": "skull",
"command": "[!KILL]",
"color": "#e84118"
"psuControl": {
"enabled": true,
"turnOnPSUWhenExitingSleep": false
}
]
},
"octodash": {
"customActions": [{
"icon": "home",
"command": "G28",
"color": "#dcdde1",
"confirm": false,
"exit": false
},
{
"icon": "ruler-vertical",
"command": "G29",
"color": "#44bd32",
"confirm": false,
"exit": false
},
{
"icon": "fire-alt",
"command": "M140 S50; M104 S185",
"color": "#e1b12c",
"confirm": false,
"exit": true
},
{
"icon": "snowflake",
"command": "M140 S0; M104 S0",
"color": "#0097e6",
"confirm": false,
"exit": true
},
{
"icon": "redo-alt",
"command": "[!RELOAD]",
"color": "#7f8fa6",
"confirm": true,
"exit": false
},
{
"icon": "skull",
"command": "[!KILL]",
"color": "#e84118",
"confirm": true,
"exit": false
}
],
"fileSorting": {
"attribute": "name",
"order": "asc"
},
"pollingInterval": 2000,
"touchscreen": true,
"turnScreenOffWhileSleeping": false
}
}
}
5 changes: 4 additions & 1 deletion src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class AppService {
// If the errors can be automatically fixed return true here
public autoFixError(): boolean {
const config = this.configService.getCurrentConfig();
config.octodash.temperatureSensor.ambient = 1;
this.configService.saveConfig(config);
this.configService.updateConfig();
return false;
Expand All @@ -53,6 +52,10 @@ export class AppService {
setTimeout(this.checkUpdate.bind(this), 21.6 * 1000000);
}

public getVersion(): string {
return this.version;
}

public turnDisplayOff(): void {
if (this.ipc) {
this.ipc.send('screenSleep', '');
Expand Down
Loading

0 comments on commit 87657e0

Please sign in to comment.