Compare commits

..
17 Commits
Author SHA1 Message Date
Stefan Dej 707330e501 bugfix: add timestamp to gui.json for caching problems
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:17:58 +02:00
Stefan Dej 7a75f6f6cc bugfix: remove "move=1" before all axis are homed
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:05:39 +02:00
Stefan Dej 331c0a1e99 add mjpgstreamer to nginx in installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-02 22:36:12 +02:00
Stefan Dej 0c70bd5f23 update installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 21:20:55 +02:00
Stefan Dej bce591e16e update installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 21:20:16 +02:00
Stefan Dej d0d36470ba update loadingQGL to generic function
report klippy state in browser console log

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:41:33 +02:00
Stefan Dej 479f2245e3 bugfix: disable heater with value 0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:38:58 +02:00
Stefan Dej 706803ea5b update update-0.1.x.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:27:46 +02:00
Stefan Dej 1efe346cb0 add update-0.1.x.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 14:02:53 +02:00
Stefan Dej 20bad7d24c update installation.md and update-0.0.x.md to v0.1.1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 12:17:08 +02:00
Stefan Dej 8494a35adf bugfix: update notify_filelist_changed
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 01:07:37 +02:00
Stefan Dej 6766a266e8 feature: rename "Host restart" to "Host reboot"
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-07-31 17:05:42 +02:00
meteyou 75d6cce540 feature: add Z_TILT in ControlPanel.vue
feature: replace "_" in macro names in ControlPanel.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-07-31 15:26:16 +02:00
Stefan Dej e0e3150466 bugfix: babystepping on dashboard 2020-07-28 23:28:38 +02:00
Stefan Dej fcaebc4413 add gcode-thumbnails.md 2020-07-28 23:28:11 +02:00
Stefan Dej 37f1ffb04b feature: fine babystepping (0.01 steps) 2020-07-27 23:39:38 +02:00
Stefan Dej 1b501bb810 bugfix: sensor colors in temp chart 2020-07-27 23:01:02 +02:00
15 changed files with 258 additions and 110 deletions

No files matched your search

+3 -1
View File
@@ -1,6 +1,8 @@
# Overview
- [Installation](installation.md)
- [Update from 0.1.x to latest](update-0.1.x.md)
- [Update from 0.0.x to 0.1.x](update-0.0.x.md)
- [Macros](macros.md)
- [Slicer upload](slicer-upload.md)
- [Slicer upload](slicer-upload.md)
- [Gcode thumbnails (PrusaSlicer & SuperSlicer only)](gcode-thumbnails.md)
+11
View File
@@ -0,0 +1,11 @@
# Gcode-thumbnails with PrusaSlicer and SuperSlicer
Mainsail can display these thumbnails in the gcode filemanager. To enable the thumbnails,
open your slicer (PrusaSlicer or SuperSlicer) click on `Help > Show Configuration Folder`
and then inside the `printers` sub-folder you’ll find your printer profiles.
Open your desired printer profile in your favorite text editor and find the `thumbnails =`
section and add the resolutions `32x32,400x300`. Save the file and restart your slicer.
Now you should see a preview in the filemanager and if you will start a new job.
![Screenshot gcode thumbnail](images/screenshot-gcode-thumbnail.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

+40 -18
View File
@@ -5,35 +5,47 @@ may work, however they may need a custom install script.
**Please don't use a octopi image!!!**
Klipper should be installed prior to installing Moonraker. Please see
[Klipper's Documention](https://github.com/KevinOConnor/klipper/blob/master/docs/Installation.md)
for instructions on how to do this.
## Installing operation system image
It's recommend to use a clean Raspberry Pi OS 32-bit Lite (previosly called Raspbian)
image. You can download it [here](https://downloads.raspberrypi.org/raspios_lite_armhf_latest).
## Install Moonraker (API)
More information about the installtion of Raspberry Pi OS are
[here](https://www.raspberrypi.org/documentation/installation/installing-images/).
**If you have finished the installation and connected via ssh, you can continue.**
## Install Requirements
```
sudo apt update && sudo apt upgrade
sudo apt install git dfu-util
```
## Install Klipper
Moonraker is still in alpha development, and thus some of its dependencies
in Klipper have yet to be merged. Until this has been done it will be
necessary to add a remote and work off a developmental branch of Klipper
to correctly run Moonraker.
### Change Klipper branch
In this step, we install klipper and change to the development branch of Klipper.
```
cd ~
git clone https://github.com/KevinOConnor/klipper
cd ~/klipper
git remote add arksine https://github.com/Arksine/klipper.git
```
Now fetch and checkout:
```
git remote add arksine https://github.com/arksine/klipper
git fetch arksine
git checkout arksine/dev-moonraker-testing
git reset --hard arksine/dev-moonraker-testing
./scripts/install-octopi.sh
```
Note that you are now in a detached head state and you cannot pull. Any
time you want to update to the latest version of this branch you must
repeat the two commands above.
time you want to update to the latest version of this branch you have to
`git fetch arksine` and `git reset --hard arksine/dev-moonraker-testing`.
**Note that the above command is NOT part of the Moonraker install procedure.**
### Install Moonraker application
Now you can copy your `printer.cfg` in your home directory and restart klipper.
Please check the `klippy.log`, if Klipper starts correctly and then continue
the guide.
## Install Moonraker (API)
You can now install the Moonraker application:
```
cd ~
@@ -59,7 +71,7 @@ Edit your printer.cfg with nano ~/printer.cfg and add the following lines:
```
[moonraker]
trusted_clients:
192.168.1.0/24
192.168.1.0/24
```
We also need a `virtual_sdcard` for store the gcode files:
@@ -116,6 +128,12 @@ upstream apiserver {
server 127.0.0.1:7125;
}
upstream mjpgstreamer {
#edit your webcam port here
ip_hash;
server 127.0.0.1:8081;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
@@ -186,6 +204,10 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /webcam/ {
proxy_pass http://mjpgstreamer/;
}
}
```
@@ -209,7 +231,7 @@ Now we can install Mainsail (static httpdocs).
Now you can download the current mainsail static data
```
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.0/mainsail-beta-0.1.0.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
+1 -1
View File
@@ -43,5 +43,5 @@ Restart nginx with `sudo service nginx restart`
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.0/mainsail-beta-0.1.0.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
```
+24
View File
@@ -0,0 +1,24 @@
# Update from 0.1.x to latest
Updates after 0.1.x are easier than 0.0.x to 0.1.x.
## Update Moonraker
```
cd ~/moonraker
git pull
sudo service moonraker restart
```
## Update Klipper
```
cd ~/klipper
git fetch arksine
git checkout arksine/dev-moonraker-testing
sudo service klipper restart
```
## Update static files from Mainsail
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
```
+13 -7
View File
@@ -8,6 +8,7 @@
<v-col class="col-12 pb-0 text-center">
<div class="d-inline-block mx-2 my-1"><v-btn @click="doHome" :loading="loadingHomeAll" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'" class=""><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('quad_gantry_level')"><v-btn @click="doQGL" :loading="loadingQGL" color="primary">QGL</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('z_tilt')"><v-btn @click="doZtilt" :loading="loadingZTilt" color="primary">Z Tilt</v-btn></div>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
@@ -52,7 +53,7 @@
<v-row class="" v-if="getMacros.length > 0">
<v-col class="col-12 px-4 py-2 text-center">
<div v-for="(macro, index) in getMacros" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
<v-btn color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name }}</v-btn>
<v-btn color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name.replace("_", " ") }}</v-btn>
</div>
</v-col>
</v-row>
@@ -60,7 +61,7 @@
</template>
<script>
import { mapState, mapGetters, mapMutations } from 'vuex'
import { mapState, mapGetters } from 'vuex'
import Vue from "vue";
export default {
@@ -73,18 +74,16 @@
loadingHomeX: false,
loadingHomeY: false,
loadingHomeZ: false,
loadingQGL: false,
loadingZTilt: false,
}
},
computed: {
...mapState({
loadingQGL: state => state.socket.loadingQGL,
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.config,
loadings: state => state.loadings,
}),
...mapMutations([
'setLoadingQGL',
]),
...mapGetters([
'getMacros',
'is_printing'
@@ -113,9 +112,14 @@
},
doQGL() {
this.$store.commit('addGcodeResponse', "QUAD_GANTRY_LEVEL");
this.$store.commit('setLoadingQGL', true);
this.$store.commit('setLoading', { name: 'controlQGL' });
this.$socket.sendObj('post_printer_gcode_script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL");
},
doZtilt() {
this.$store.commit('addGcodeResponse', "Z_TILT_ADJUST");
this.$store.commit('setLoading', { name: 'controlZTilt' });
this.$socket.sendObj('post_printer_gcode_script', { script: "Z_TILT_ADJUST" }, "responseZTilt");
},
doSendMove(gcode) {
gcode = "G91" + "\n" +
"G1 " + gcode + " F6000" + "\n" +
@@ -134,6 +138,8 @@
this.loadingHomeX = loadings.includes('controlHomeX');
this.loadingHomeY = loadings.includes('controlHomeY');
this.loadingHomeZ = loadings.includes('controlHomeZ');
this.loadingQGL = loadings.includes('controlQGL');
this.loadingZTilt = loadings.includes('controlZTilt');
}
}
}
@@ -12,7 +12,7 @@
<div><v-btn :href="'http://'+hostname+':'+port+'/server/files/moonraker.log'" color="mt-3 primary"><v-icon class="mr-sm-2">mdi-download</v-icon>Moonraker Log</v-btn></div>
<div><v-btn @click="doRestart" :loading="loadingRestart" color="error" class="mt-3"><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn></div>
<div><v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FW <span class="d-none d-sm-block">Restart</span></v-btn></div>
<div><v-btn @click="doRebootHost" :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Host <span class="d-none d-sm-block">Restart</span></v-btn></div>
<div><v-btn @click="doRebootHost" :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Host <span class="d-none d-sm-block">Reboot</span></v-btn></div>
<div><v-btn @click="doShutdownHost" :loading="loadingShutdownHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-power</v-icon>Host <span class="d-none d-sm-block">Shutdown</span></v-btn></div>
</v-card-text>
</v-card>
+28 -5
View File
@@ -17,9 +17,15 @@
</v-col>
</v-row>
<v-row>
<v-col class="col-12 pt-0 text-center">
<v-btn @click="sendBabySteppingDown()" class="mx-2" :loading="loadingBabySteppingDown" ><v-icon class="mr-2">mdi-arrow-collapse-down</v-icon> -0.05mm</v-btn>
<v-btn @click="sendBabySteppingUp()" class="mx-2" :loading="loadingBabySteppingUp" ><v-icon class="mr-2">mdi-arrow-expand-up</v-icon> +0.05mm</v-btn>
<v-col class="col-12 pt-0 text-center d-flex flex-column align-center flex-sm-row justify-center">
<v-btn-toggle borderless no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
<v-btn @click="sendBabySteppingDownFine()" class="" :loading="loadingBabySteppingDownFine" ><v-icon class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
<v-btn @click="sendBabySteppingDown()" class="" :loading="loadingBabySteppingDown" >-0.05mm</v-btn>
</v-btn-toggle>
<v-btn-toggle borderless no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
<v-btn @click="sendBabySteppingUpFine()" class="" :loading="loadingBabySteppingUpFine" ><v-icon class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
<v-btn @click="sendBabySteppingUp()" class="" :loading="loadingBabySteppingUp" >+0.05mm</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
</v-card-text>
@@ -36,7 +42,9 @@
},
data: function() {
return {
loadingBabySteppingDownFine: false,
loadingBabySteppingDown: false,
loadingBabySteppingUpFine: false,
loadingBabySteppingUp: false,
}
},
@@ -47,17 +55,30 @@
printer_state: state => state.printer.idle_timeout.state,
printer_is_paused: state => state.printer.pause_resume.is_paused,
printer_is_printing: state => state.printer.virtual_sdcard.is_active,
homed_axis: state => state.printer.toolhead.homed_axes,
}),
},
methods: {
sendBabySteppingDownFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingDownFine' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDownFine");
},
sendBabySteppingDown() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05 MOVE=1";
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingDown' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingDown");
},
sendBabySteppingUpFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingUpFine' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingUpFine");
},
sendBabySteppingUp() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05 MOVE=1";
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingUp' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeBabySteppingUp");
@@ -65,7 +86,9 @@
},
watch: {
loadings: function(loadings) {
this.loadingBabySteppingDownFine = loadings.includes('babySteppingDownFine');
this.loadingBabySteppingDown = loadings.includes('babySteppingDown');
this.loadingBabySteppingUpFine = loadings.includes('babySteppingUpFine');
this.loadingBabySteppingUp = loadings.includes('babySteppingUp');
},
}
+1 -1
View File
@@ -40,7 +40,7 @@
if (this.max_temp !== undefined && this.value > this.max_temp) {
this.value = this.target;
Vue.$toast.error("Temperature too high for "+this.name+"! (max: "+this.max_temp+")");
} else if (this.min_temp !== undefined && this.value < this.min_temp && this.value !== 0) {
} else if (this.min_temp !== undefined && this.value < this.min_temp && parseFloat(this.value) !== 0) {
this.value = this.target;
Vue.$toast.error("Temperature too low for "+this.name+"! (min: "+this.min_temp+")");
} else this.$socket.sendObj('post_printer_gcode_script', {script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value});
+8 -10
View File
@@ -55,7 +55,7 @@
<v-btn color="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
</v-card-title>
<v-card-subtitle>
Current path: {{ this.currentPath }}
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}
</v-card-subtitle>
<v-card-text>
<v-text-field
@@ -231,7 +231,7 @@
import { mapState, mapGetters } from 'vuex';
import axios from 'axios';
import { findDirectory } from "../plugins/helpers";
import Vue from "vue";
/*import Vue from "vue";*/
export default {
data () {
@@ -335,12 +335,6 @@
).then((result) => {
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
toast.success("Upload of "+result.data.result+" successful!");
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
let filename = (this.currentPath+"/"+file.name).substring(7);
setTimeout(function() {
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: filename }, "getMetadata");
}, 1000);
})
.catch(() => {
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
@@ -435,7 +429,6 @@
'http://'+ this.hostname + ':' + this.port +'/server/files/'+filename
).then((result) => {
this.$toast.success(result.data.result+" successfully deleted.");
this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory');
}).catch(() => {
this.$toast.error("Error! Cannot delete file.");
});
@@ -538,9 +531,14 @@
e.preventDefault();
e.target.parentElement.style.backgroundColor = 'transparent';
let dest = "";
if (row.filename === '..') {
dest = this.currentPath.substring(0, this.currentPath.lastIndexOf("/") + 1)+this.draggingFile.item.filename;
} else dest = this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename;
this.$socket.sendObj('post_file_move', {
source: this.currentPath+"/"+this.draggingFile.item.filename,
dest: this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename,
dest: dest
}, 'getPostFileMove');
}
},
+44 -25
View File
@@ -32,11 +32,37 @@ export default {
break;
case 'notify_klippy_state_changed':
window.console.log('notify_klippy_state_changed');
window.console.log(data.params[0]);
commit('setKlippyStatus', data.params[0]);
break;
case 'notify_filelist_changed':
commit('setFileList', data.params[0].filelist);
switch(data.params[0].action) {
case 'added':
commit('setFileChangeAdded', data.params[0]);
break;
case 'removed':
commit('setFileChangeRemoved', data.params[0]);
break;
case 'file_move':
commit('setFileChangeFileMove', data.params[0]);
break;
case 'add_directory':
commit('setFileChangeAddDirectory', data.params[0]);
break;
case 'delete_directory':
commit('setFileChangeDeleteDirectory', data.params[0]);
break;
default:
window.console.error("Unknown filelist_changed action: "+data.params[0].action);
break;
}
break;
default:
@@ -48,7 +74,7 @@ export default {
getDirectoryRoot({ commit }, data) {
if (data.files && data.files.filter((file) => file.filename === "gui.json")) {
fetch('http://'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/gcodes/gui.json')
fetch('http://'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/gcodes/gui.json?time='+Date.now())
.then(res => res.json()).then(file => {
commit('setSettings', file);
});
@@ -81,8 +107,6 @@ export default {
version: data.version
});
commit('setKlippyStatus', 'ready');
Vue.prototype.$socket.sendObj('get_printer_objects_list', {}, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_objects_status', { heaters: [] }, 'getHeatersInfo');
Vue.prototype.$socket.sendObj('get_printer_objects_status', { configfile: ['config'] }, 'getPrinterConfig');
@@ -96,10 +120,9 @@ export default {
idle_timeout: [],
display_status: [],
});
Vue.prototype.$socket.sendObj('get_file_list', {}, 'getFileList');
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
} else if (data !== undefined && !data.is_ready) commit('setKlippyStatus', 'disconnect');
}
commit('setPrinterStatusDetails', data);
@@ -157,11 +180,6 @@ export default {
commit('setPrinterConfig', data);
},
getFileList({ commit }, data) {
commit('setFileList', data);
commit('removeLoading', 'loadingGcodeRefresh');
},
getDirectory({ commit }, data) {
commit('setDirectory', data);
commit('removeLoading', { name: 'loadingGcodeRefresh' });
@@ -179,11 +197,9 @@ export default {
if (data.error) {
Vue.$toast.error(data.error.message);
} else if (data.result === "ok") {
let currentPath = data.requestParams.path.substr(0, data.requestParams.path.lastIndexOf("/"));
let newPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
Vue.$toast.success("Successfully created "+newPath);
Vue.prototype.$socket.sendObj('get_directory', { path: currentPath }, 'getDirectory');
commit('voidMutation');
}
},
@@ -192,15 +208,10 @@ export default {
if (data.error) {
Vue.$toast.error(data.error.message);
} else if (data.result === "ok") {
let currentPath = data.requestParams.path.substr(0, data.requestParams.path.lastIndexOf("/"));
let delPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
Vue.$toast.success("Successfully deleted "+delPath);
//Vue.prototype.$socket.sendObj('get_directory', { path: currentPath }, 'getDirectory');
commit('removeDirFromFiletree', {
currentPath: currentPath,
delPathName: delPath
});
commit('voidMutation');
}
},
@@ -214,11 +225,7 @@ export default {
if (sourceDir === destDir) Vue.$toast.success("Successfully renamed "+filename);
else Vue.$toast.success("Successfully moved "+filename);
commit('renameMetadataFilename', {
source: data.requestParams.source,
dest: data.requestParams.dest
});
commit('voidMutation');
}
},
@@ -269,7 +276,11 @@ export default {
},
responseQGL({commit}) {
commit('setLoadingQGL', false);
commit('removeLoading', { name: 'controlQGL' });
},
responseZTilt({commit}) {
commit('removeLoading', { name: 'controlZTilt' });
},
responseRestart({commit}) {
@@ -293,10 +304,18 @@ export default {
commit('removeLoading', { name: 'extruderDetract' });
},
respondeBabySteppingDownFine({commit}) {
commit('removeLoading', { name: 'babySteppingDownFine' });
},
respondeBabySteppingDown({commit}) {
commit('removeLoading', { name: 'babySteppingDown' });
},
respondeBabySteppingUpFine({commit}) {
commit('removeLoading', { name: 'babySteppingUpFine' });
},
respondeBabySteppingUp({commit}) {
commit('removeLoading', { name: 'babySteppingUp' });
},
-1
View File
@@ -20,7 +20,6 @@ export default new Vuex.Store({
loadingEmergencyStop: false,
loadingPrintPause: false,
loadingPrintResume: false,
loadingQGL: false,
loadingRestart: false,
loadingRestartFirmware: false,
loadingRebootHost: false,
+83 -39
View File
@@ -139,7 +139,7 @@ export default {
}
// update target temp in temperature chart
if (index_target >= 0) {
if (index_target >= 0 && payload.value.target !== undefined) {
for (let i = 0; i < ticks; i++) state.temperaturChart.datasets[index_target].data.push(payload.value.target.toFixed(1));
}
@@ -158,7 +158,7 @@ export default {
switch (payload.name) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.datasets.length]; break;
default: color = colorArray[state.temperaturChart.datasets.filter(element => !element.label.endsWith("_target") && element.label !== "heater_bed" && element.label !== "chamber").length]; break;
}
let hidden = state.gui.dashboard.hiddenTempChart.indexOf(payload.name.toUpperCase()) >= 0 ? true : null;
@@ -215,29 +215,74 @@ export default {
if (data.configfile) Vue.set(state, 'config', data.configfile.config);
},
setFileList(state, data) {
state.files = [];
//window.console.log(data);
let array = Object.entries(data);
setFileChangeAdded(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/")).replace("/", "");
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
for (let [key, file] of array) {
if (file.filename !== "gui.json") {
state.files.push({
number: key,
filename: file.filename,
modified: Date.parse(file.modified),
size: file.size,
slicer: file.slicer,
filament_total: file.filament_total,
estimated_time: file.estimated_time,
layer_height: file.layer_height,
first_layer_height: file.first_layer_height,
object_height: file.object_height,
thumbnails : file.thumbnails ? file.thumbnails : [],
});
}
if (parent) {
parent.push({
isDirectory: false,
filename: filename,
modified: new Date(),
size: 0,
metadataPulled: false,
});
setTimeout(function() {
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.filename }, "getMetadata");
}, 500);
}
//state.files = data;
},
setFileChangeRemoved(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setFileChangeFileMove(state, data) {
let oldPath = data.prev_file.substr(0, data.prev_file.lastIndexOf("/") + 1);
let newPath = data.filename.substr(0, data.filename.lastIndexOf("/") + 1);
let filenameOld = data.prev_file.substr(data.prev_file.lastIndexOf("/")+1);
let filenameNew = data.filename.substr(data.filename.lastIndexOf("/")+1);
oldPath = findDirectory(state.filetree, (data.root+"/"+oldPath).split("/"));
let indexFile = oldPath.findIndex(element => element.filename === filenameOld);
if (indexFile >= 0 && oldPath[indexFile]) {
let file = oldPath.splice(indexFile, 1)[0];
file.filename = filenameNew;
newPath = findDirectory(state.filetree, (data.root+"/"+newPath).split("/"));
newPath.push(file);
}
},
setFileChangeAddDirectory(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/") + 1);
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
if (parent) {
parent.push({
isDirectory: true,
filename: filename,
modified: new Date(),
childrens: [],
});
}
},
setFileChangeDeleteDirectory(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setDirectory(state, data) {
@@ -311,6 +356,8 @@ export default {
slicer: data.slicer ? data.slicer : undefined,
thumbnails: data.thumbnails ? data.thumbnails : undefined,
metadataPulled: true,
modified: Date.parse(data.modified),
size: parseInt(data.size),
};
let newObject = Object.assign(path[index], newData);
@@ -351,14 +398,6 @@ export default {
}
},
removeDirFromFiletree(state, data) {
let currentPathArray = data.currentPath.split("/");
let currentPath = findDirectory(state.filetree, currentPathArray);
let index = currentPath.findIndex(element => element.filename === data.delPathName);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setHelpList(state, data) {
state.helplist = [];
@@ -404,17 +443,22 @@ export default {
},
setKlippyStatus(state, value) {
state.socket.klippy_state = value;
if (value === "disconnect") {
state.socket.is_ready = false;
state.socket.klippy_message = "";
} else if (value === "ready") Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
if (value !== undefined) {
state.socket.klippy_state = value;
if (value === "disconnect") {
state.socket.is_ready = false;
state.socket.klippy_message = "";
} else if (value === "ready") Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
}
},
setPrinterStatusDetails(state, data) {
state.socket.error_detected = data.error_detected;
state.socket.is_ready = data.is_ready;
state.socket.klippy_message = data.message;
if (data !== undefined && data.is_ready !== undefined) {
state.socket.error_detected = data.error_detected;
state.socket.is_ready = data.is_ready;
state.socket.klippy_message = data.message;
}
},
setLoadingGcodeUpload(state, value) {
+1 -1
View File
@@ -4,12 +4,12 @@ export const hostname = "voron250.local:8080";
export const colorArray = [
'#F44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#00BCD4',
'#009688',
'#E91E63',
];
export const colorHeaterBed = '#2196F3';