diff --git a/docs/installation.md b/docs/installation.md index a74ed58e..3297e948 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -241,7 +241,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.2.0/mainsail-beta-0.2.0.zip && unzip mainsail.zip && rm mainsail.zip +wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.2/mainsail-beta-0.2.2.zip && unzip mainsail.zip && rm mainsail.zip ``` Now it should be possible to open the interface: `http:///`. diff --git a/docs/update.md b/docs/update.md index 9ee913a5..6ce32d89 100644 --- a/docs/update.md +++ b/docs/update.md @@ -7,7 +7,7 @@ git fetch git checkout origin/master ``` -Please check the location of the `printer.cfg` and the UDS in the `/etc/default/klipper` file. This +Please check the location of the `~/klipper_config/printer.cfg` and the UDS (`-a /tmp/klippy_uds`) in the `/etc/default/klipper` file. This should look like: ``` KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /tmp/klippy.log -a /tmp/klippy_uds" @@ -36,6 +36,6 @@ If you see a content like this ``` cd ~/mainsail rm -R ./* -wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.0/mainsail-beta-0.2.0.zip && unzip mainsail.zip && rm mainsail.zip +wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.2/mainsail-beta-0.2.2.zip && unzip mainsail.zip && rm mainsail.zip ``` Now it should be possible to open the interface: `http:///`. \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 21864a6d..4589c9da 100644 --- a/src/App.vue +++ b/src/App.vue @@ -76,7 +76,7 @@ - v0.2.0 + v0.2.2 - {{ version }} Made with heard by Logo - VoronDesign @@ -131,12 +131,11 @@ export default { methods: { emergencyStop: function() { this.$store.commit('setLoadingEmergencyStop', true); - this.$socket.sendObj('post_printer_emergency_stop', {}, 'setLoadingEmergencyStop'); + this.$socket.sendObj('printer.emergency_stop', {}, 'setLoadingEmergencyStop'); }, drawFavicon(val) { let favicon = document.getElementById('favicon'); - if (val === 0) favicon.href = "/favicon.ico"; - else { + if (val > 0 && val < 100) { let faviconSize = 64; let canvas = document.createElement('canvas'); @@ -175,7 +174,7 @@ export default { context.fill(); favicon.href = canvas.toDataURL('image/png'); - } + } else favicon.href = "/favicon.ico" } }, watch: { @@ -189,7 +188,7 @@ export default { }, current_file: { handler: function(newVal) { - this.$socket.sendObj("get_file_metadata", { filename: newVal }, "getMetadataCurrentFile"); + this.$socket.sendObj("server.files.metadata", { filename: newVal }, "getMetadataCurrentFile"); } }, config() { diff --git a/src/components/panels/ControlPanel.vue b/src/components/panels/ControlPanel.vue index 66b41f35..46009667 100644 --- a/src/components/panels/ControlPanel.vue +++ b/src/components/panels/ControlPanel.vue @@ -93,32 +93,32 @@ doHome() { this.$store.commit('addGcodeResponse', "G28"); this.$store.commit('setLoading', { name: 'controlHomeAll' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "G28" }, "responseHome"); + this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "responseHome"); }, doHomeX() { this.$store.commit('addGcodeResponse', "G28 X"); this.$store.commit('setLoading', { name: 'controlHomeX' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "G28 X" }, "responseHomeX"); + this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "responseHomeX"); }, doHomeY() { this.$store.commit('addGcodeResponse', "G28 Y"); this.$store.commit('setLoading', { name: 'controlHomeY' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "G28 Y" }, "responseHomeY"); + this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "responseHomeY"); }, doHomeZ() { this.$store.commit('addGcodeResponse', "G28 Z"); this.$store.commit('setLoading', { name: 'controlHomeZ' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "G28 Z" }, "responseHomeZ"); + this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "responseHomeZ"); }, doQGL() { this.$store.commit('addGcodeResponse', "QUAD_GANTRY_LEVEL"); this.$store.commit('setLoading', { name: 'controlQGL' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL"); + this.$socket.sendObj('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"); + this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "responseZTilt"); }, doSendMove(gcode) { gcode = "G91" + "\n" + @@ -129,7 +129,7 @@ }, doSend(gcode) { this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "sendGcode"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "sendGcode"); }, }, watch: { diff --git a/src/components/panels/ExtruderPanel.vue b/src/components/panels/ExtruderPanel.vue index 16bb9b05..add62a48 100644 --- a/src/components/panels/ExtruderPanel.vue +++ b/src/components/panels/ExtruderPanel.vue @@ -29,8 +29,8 @@ - mdi-arrow-up-bold Retract - mdi-arrow-down-bold Extrude + mdi-arrow-up-bold Retract + mdi-arrow-down-bold Extrude @@ -54,19 +54,15 @@ }, computed: { ...mapState({ - config: state => state.config, loadings: state => state.loadings, printer_state: state => state.printer.print_stats.state, + extruder: state => state.printer.extruder, + config: state => state.printer.configfile.config }), ...mapGetters([ 'getMacros', 'getCurrentExtruder', ]), - extruder: { - get: function() { - return this.$store.getters.getCurrentExtruder; - } - } }, methods: { setFeedAmount(value) { @@ -76,16 +72,16 @@ this.feedrate = value; }, sendRetract() { - let gcode = "M120\nM83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60)+"\nM121"; + let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60); this.$store.commit('setLoading', { name: 'extruderRetract' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeExtruderRetract"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderRetract"); }, sendDetract() { - let gcode = "M120\nM83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60)+"\nM121"; + let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60); this.$store.commit('setLoading', { name: 'extruderDetract' }); this.$store.commit('addGcodeResponse', gcode); - Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: gcode }, "respondeExtruderDetract"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderDetract"); }, }, watch: { @@ -95,4 +91,4 @@ }, } } - \ No newline at end of file + diff --git a/src/components/panels/KlippyStatePanel.vue b/src/components/panels/KlippyStatePanel.vue index 8062648e..c60fa120 100644 --- a/src/components/panels/KlippyStatePanel.vue +++ b/src/components/panels/KlippyStatePanel.vue @@ -43,11 +43,11 @@ doRestart() { this.$store.commit('setLoadingRestart', true); - this.$socket.sendObj('post_printer_restart', { }, "responseRestart"); + this.$socket.sendObj('printer.restart', { }, "responseRestart"); }, doRestartFirmware() { this.$store.commit('setLoadingRestartFirmware', true); - this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware"); + this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware"); }, }, } diff --git a/src/components/panels/Settings/ConfigFilesPanel.vue b/src/components/panels/Settings/ConfigFilesPanel.vue index c29f6250..aea54535 100644 --- a/src/components/panels/Settings/ConfigFilesPanel.vue +++ b/src/components/panels/Settings/ConfigFilesPanel.vue @@ -14,11 +14,10 @@ .config-editor-overlay div.v-card { position: relative; - padding-top: 64px !important; } .config-editor-overlay div.v-card header { - position: fixed; + position: sticky; top: 0; width: 100%; z-index: 1; @@ -81,11 +80,14 @@ + + mdi-file-document-edit-outline Edit file + mdi-cloud-download Download - mdi-pencil Rename + mdi-rename-box Rename mdi-delete Delete @@ -250,9 +252,9 @@ this.$store.commit('setLoading', { name: 'loadingConfigRefresh' }); if (this.currentPath === "") { - this.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory'); - this.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory'); - } else this.$socket.sendObj('get_directory', { path: this.currentPath.substring(1) }, 'getDirectory'); + this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'getDirectory'); + this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'getDirectory'); + } else this.$socket.sendObj('server.files.get_directory', { path: this.currentPath.substring(1) }, 'getDirectory'); }, formatDate(date) { let tmp2 = new Date(date); @@ -381,7 +383,7 @@ createFolderAction() { this.dialogCreateFolder.show = false; - this.$socket.sendObj('post_directory', { + this.$socket.sendObj('server.files.post_directory', { path: this.currentPath.substring(1)+"/"+this.dialogCreateFolder.name }, 'getPostDirectory'); }, @@ -415,7 +417,7 @@ }, renameFileAction() { this.dialogRenameFile.show = false; - this.$socket.sendObj('post_file_move', { + this.$socket.sendObj('server.files.move', { source: this.currentPath+"/"+this.dialogRenameFile.item.filename, dest: this.currentPath+"/"+this.dialogRenameFile.newName }, 'getPostFileMove'); @@ -431,7 +433,7 @@ }); }, deleteDirectoryAction: function() { - this.$socket.sendObj('delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory'); + this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory'); }, }, watch: { diff --git a/src/components/panels/Settings/EndstopPanel.vue b/src/components/panels/Settings/EndstopPanel.vue index 7fa8d673..3a981fa9 100644 --- a/src/components/panels/Settings/EndstopPanel.vue +++ b/src/components/panels/Settings/EndstopPanel.vue @@ -56,7 +56,7 @@ methods: { syncEndstops() { this.$store.commit('setLoadingEndstopStatus', true); - this.$socket.sendObj('get_printer_query_endstops_status', { }, "responseEndstopStatus"); + this.$socket.sendObj('printer.query_endstops.status', { }, "responseEndstopStatus"); }, getEndstops() { this.sortEndstops = {}; diff --git a/src/components/panels/Settings/SystemPanel.vue b/src/components/panels/Settings/SystemPanel.vue index 2932e232..bf8abbc1 100644 --- a/src/components/panels/Settings/SystemPanel.vue +++ b/src/components/panels/Settings/SystemPanel.vue @@ -8,12 +8,12 @@ -
mdi-downloadKlipper Log
-
mdi-downloadMoonraker Log
-
mdi-cachedRestart
-
mdi-cachedFW Restart
-
mdi-cachedHost Reboot
-
mdi-powerHost Shutdown
+
mdi-downloadKlipper Log
+
mdi-downloadMoonraker Log
+
mdi-cachedRestart
+
mdi-cachedFW Restart
+
mdi-cachedHost Reboot
+
mdi-powerHost Shutdown
@@ -53,7 +53,7 @@ state_message: 'RESTART' } }); - this.$socket.sendObj('post_printer_restart', { }, "responseRestart"); + this.$socket.sendObj('printer.restart', { }, "responseRestart"); }, doRestartFirmware() { this.$store.commit('setLoadingRestartFirmware', true); @@ -63,15 +63,15 @@ state_message: 'FIRMWARE RESTART' } }); - this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware"); + this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware"); }, doRebootHost() { this.$store.commit('setLoadingRebootHost', true); - this.$socket.sendObj('post_machine_reboot', { }); + this.$socket.sendObj('machine.reboot', { }); }, doShutdownHost() { this.$store.commit('setLoadingShutdownHost', true); - this.$socket.sendObj('post_machine_shutdown', { }); + this.$socket.sendObj('machine.shutdown', { }); }, } } diff --git a/src/components/panels/StatusPanel.vue b/src/components/panels/StatusPanel.vue index 3dbb7db5..16c0aa22 100644 --- a/src/components/panels/StatusPanel.vue +++ b/src/components/panels/StatusPanel.vue @@ -2,6 +2,10 @@ .vertical_align_center { margin: auto 0; } + + .statusPanel-image-preview { + width: 100%; + } @@ -159,23 +188,23 @@ methods: { btnPauseJob() { this.$store.commit('setLoading', { name: 'statusPrintPause' }); - this.$socket.sendObj('post_printer_print_pause', { }, 'respondPrintPause'); + this.$socket.sendObj('printer.print.pause', { }, 'respondPrintPause'); }, btnResumeJob() { this.$store.commit('setLoading', { name: 'statusPrintResume' }); - this.$socket.sendObj('post_printer_print_resume', { }, 'respondPrintResume'); + this.$socket.sendObj('printer.print.resume', { }, 'respondPrintResume'); }, btnCancelJob() { this.$store.commit('setLoading', { name: 'statusPrintCancel' }); - this.$socket.sendObj('post_printer_print_cancel', { }, 'respondPrintCancel'); + this.$socket.sendObj('printer.print.cancel', { }, 'respondPrintCancel'); }, btnClearJob() { this.$store.commit('setLoading', {name: 'statusPrintClear'}); - this.$socket.sendObj('post_printer_gcode_script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear'); + this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear'); }, btnReprintJob() { this.$store.commit('setLoading', {name: 'statusPrintReprint'}); - this.$socket.sendObj('post_printer_print_start', { filename: this.current_file }, 'respondPrintReprint'); + this.$socket.sendObj('printer.print.start', { filename: this.current_file }, 'respondPrintReprint'); }, formatTime(seconds) { let h = Math.floor(seconds / 3600); diff --git a/src/components/panels/ZOffsetPanel.vue b/src/components/panels/ZOffsetPanel.vue index f44cdd6f..388c93c4 100644 --- a/src/components/panels/ZOffsetPanel.vue +++ b/src/components/panels/ZOffsetPanel.vue @@ -13,7 +13,7 @@ -

Current Offset: {{ base_zpos.toFixed(2) }}mm

+

Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm

@@ -51,7 +51,7 @@ computed: { ...mapState({ loadings: state => state.loadings, - base_zpos: state => state.printer.gcode_move.base_zpos, + homing_origin: state => state.printer.gcode_move.homing_origin, printer_state: state => state.printer.print_stats.state, homed_axis: state => state.printer.toolhead.homed_axes, }), @@ -61,25 +61,25 @@ 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"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDownFine"); }, sendBabySteppingDown() { 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"); + Vue.prototype.$socket.sendObj('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"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUpFine"); }, sendBabySteppingUp() { 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"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUp"); }, }, watch: { diff --git a/src/inputs/SettingsRunoutSwitch.vue b/src/inputs/SettingsRunoutSwitch.vue index 2bbaf3f7..6581c821 100644 --- a/src/inputs/SettingsRunoutSwitch.vue +++ b/src/inputs/SettingsRunoutSwitch.vue @@ -43,7 +43,7 @@ methods: { changeSensor() { let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 1 : 0); - this.$socket.sendObj('post_printer_gcode_script', { script: gcode }); + this.$socket.sendObj('printer.gcode.script', { script: gcode }); } }, watch: { diff --git a/src/inputs/ToolInput.vue b/src/inputs/ToolInput.vue index c1c1402a..408a373c 100644 --- a/src/inputs/ToolInput.vue +++ b/src/inputs/ToolInput.vue @@ -43,7 +43,7 @@ } 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}); + } else this.$socket.sendObj('printer.gcode.script', {script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value}); } }, watch: { diff --git a/src/inputs/ToolSlider.vue b/src/inputs/ToolSlider.vue index ac3cafe8..94f13b78 100644 --- a/src/inputs/ToolSlider.vue +++ b/src/inputs/ToolSlider.vue @@ -74,7 +74,7 @@ }, methods: { sendCmd() { - this.$socket.sendObj('post_printer_gcode_script', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) }); + this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) }); }, decrement() { this.value--; diff --git a/src/pages/Console.vue b/src/pages/Console.vue index fa7ec1f1..69d663a0 100644 --- a/src/pages/Console.vue +++ b/src/pages/Console.vue @@ -128,7 +128,7 @@ doSend() { this.$store.commit('setLoading', { name: 'loadingSendGcode' }); this.$store.commit('addGcodeResponse', this.gcode); - Vue.prototype.$socket.sendObj('post_printer_gcode_script', { script: this.gcode }, "sendGcode"); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "sendGcode"); this.lastCommands.push(this.gcode); this.gcode = ""; this.lastCommandNumber = null; diff --git a/src/pages/Files.vue b/src/pages/Files.vue index 4f9d390c..0e8d294b 100644 --- a/src/pages/Files.vue +++ b/src/pages/Files.vue @@ -149,17 +149,17 @@ - + mdi-play Print start mdi-cloud-download Download - mdi-pencil Rename + mdi-rename-box Rename - mdi-pencil Rename + mdi-rename-box Rename mdi-delete Delete @@ -347,7 +347,7 @@ }, refreshFileList: function() { this.$store.commit('setLoading', { name: 'loadingGcodeRefresh' }); - this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory'); + this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory'); }, formatDate(date) { let tmp2 = new Date(date); @@ -403,7 +403,7 @@ let filename = (this.currentPath+"/"+this.contextMenu.item.filename); let link = document.createElement("a"); link.download = name; - link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + filename; + link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + encodeURIComponent(filename); document.body.appendChild(link); link.click(); document.body.removeChild(link); @@ -415,7 +415,7 @@ }, renameFileAction() { this.dialogRenameFile.show = false; - this.$socket.sendObj('post_file_move', { + this.$socket.sendObj('server.files.move', { source: this.currentPath+"/"+this.dialogRenameFile.item.filename, dest: this.currentPath+"/"+this.dialogRenameFile.newName }, 'getPostFileMove'); @@ -427,7 +427,7 @@ }, renameDirectoryAction() { this.dialogRenameDirectory.show = false; - this.$socket.sendObj('post_file_move', { + this.$socket.sendObj('server.files.move', { source: this.currentPath+"/"+this.dialogRenameDirectory.item.filename, dest: this.currentPath+"/"+this.dialogRenameDirectory.newName }, 'getPostFileMove'); @@ -435,7 +435,7 @@ removeFile() { let filename = (this.currentPath+"/"+this.contextMenu.item.filename); axios.delete( - 'http://'+ this.hostname + ':' + this.port +'/server/files/'+filename + 'http://'+ this.hostname + ':' + this.port +'/server/files/'+encodeURIComponent(filename) ).then((result) => { this.$toast.success(result.data.result+" successfully deleted."); }).catch(() => { @@ -449,11 +449,11 @@ createDirectoryAction: function() { if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(" ") === -1) { this.dialogCreateDirectory.show = false; - this.$socket.sendObj('post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'getPostDirectory'); + this.$socket.sendObj('server.files.post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'getPostDirectory'); } }, deleteDirectoryAction: function() { - this.$socket.sendObj('delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory'); + this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory'); }, clickRow: function(item) { if (!item.isDirectory) { @@ -468,14 +468,14 @@ this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/")); }, loadPath: function() { - this.$socket.sendObj('get_directory', { path: this.currentPath }, 'getDirectory'); + this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory'); let dirArray = this.currentPath.split("/"); this.files = findDirectory(this.filetree, dirArray); }, startPrint(filename = "") { filename = (this.currentPath+"/"+filename).substring(7); this.dialogPrintFile.show = false; - this.$socket.sendObj('post_printer_print_start', { filename: filename }, 'switchToDashboard'); + this.$socket.sendObj('printer.print.start', { filename: filename }, 'switchToDashboard'); }, dragOverUpload(e) { if (!this.draggingFile.status) { @@ -545,7 +545,7 @@ 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', { + this.$socket.sendObj('server.files.move', { source: this.currentPath+"/"+this.draggingFile.item.filename, dest: dest }, 'getPostFileMove'); @@ -591,7 +591,7 @@ for (let i = data.pageStart; i < data.pageStop; i++) { if (items[i] && !items[i].isDirectory && !items[i].metadataPulled) { let filename = (this.currentPath+"/"+items[i].filename).substring(7); - this.$socket.sendObj("get_file_metadata", { filename: filename }, "getMetadata"); + this.$socket.sendObj("server.files.metadata", { filename: filename }, "getMetadata"); } } diff --git a/src/pages/Heightmap.vue b/src/pages/Heightmap.vue index b90110fe..19a196d8 100644 --- a/src/pages/Heightmap.vue +++ b/src/pages/Heightmap.vue @@ -242,14 +242,23 @@ let x_count = 0; let y_count = 0; + let min = -1; + let max = 1; + if (this.showMeshType === 'probed') { x_count = this.bed_mesh.probed_matrix[0].length; y_count = this.bed_mesh.probed_matrix.length; this.data[0].z = this.bed_mesh.probed_matrix; + + min = Math.min.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.min.apply(Math, row); })); + max = Math.max.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.max.apply(Math, row); })); } else if (this.showMeshType === 'mesh') { x_count = this.bed_mesh.mesh_matrix[0].length; y_count = this.bed_mesh.mesh_matrix.length; this.data[0].z = this.bed_mesh.mesh_matrix; + + min = Math.min.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.min.apply(Math, row); })); + max = Math.max.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.max.apply(Math, row); })); } let x_step = (this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / (x_count - 1); @@ -262,6 +271,11 @@ this.data[0].y.push(parseFloat(this.bed_mesh.mesh_min[1]) + parseFloat(y_step) * i); } + if (min > -1) min = -1; + if (max < 1) max = 1; + + this.layout.scene.zaxis.range = [min, max]; + this.boolShowBedMesh = true; } else this.boolShowBedMesh = false; @@ -277,26 +291,26 @@ }, loadProfile: function() { this.$store.commit('setLoading', { name: 'bedMeshLoad' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "responseBedMeshLoad"); + this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "responseBedMeshLoad"); }, saveProfile: function() { this.saveDialog = false; this.$store.commit('setLoading', { name: 'bedMeshSave' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "responseBedMeshSave"); + this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "responseBedMeshSave"); }, removeProfile: function() { this.removeDialog = false; this.$store.commit('setLoading', { name: 'bedMeshRemove' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "responseBedMeshRemove"); + this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "responseBedMeshRemove"); }, clearBedMesh: function() { this.$store.commit('setLoading', { name: 'bedMeshClear' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_CLEAR" }, "responseBedMeshClear"); + this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "responseBedMeshClear"); }, calibrateMesh: function() { this.calibrateDialog = false; this.$store.commit('setLoading', { name: 'bedMeshCalibrate' }); - this.$socket.sendObj('post_printer_gcode_script', { script: "BED_MESH_CALIBRATE" }, "responseBedMeshCalibrate"); + this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "responseBedMeshCalibrate"); } }, created: function() { diff --git a/src/pages/Status.vue b/src/pages/Status.vue deleted file mode 100644 index 7e176b2e..00000000 --- a/src/pages/Status.vue +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/src/pages/settings/machine.vue b/src/pages/settings/machine.vue index e7e36bfd..0d0260f5 100644 --- a/src/pages/settings/machine.vue +++ b/src/pages/settings/machine.vue @@ -1,21 +1,21 @@