fixed addEvent commits

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2021-01-12 22:46:29 +01:00
parent c8cff6d3d8
commit ff3cf167ad
10 changed files with 39 additions and 32 deletions

View File

@ -74,11 +74,11 @@ export default {
Vue.prototype.$socket.sendObj(rpc,{ [device.device]: null },"server/power/responseToggle")
},
doRestart: function() {
this.$store.commit('server/addEvent', "RESTART")
this.$store.commit('server/addEvent', { message: "RESTART", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "RESTART" })
},
doFirmwareRestart: function() {
this.$store.commit('server/addEvent', "FIRMWARE_RESTART")
this.$store.commit('server/addEvent', { message: "FIRMWARE_RESTART", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" })
},
doServiceRestartKlipper: function() {

View File

@ -93,32 +93,32 @@
},
methods: {
doHome() {
this.$store.commit('server/addEvent', "G28");
this.$store.commit('server/addEvent', { message: "G28", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeAll' });
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' });
},
doHomeX() {
this.$store.commit('server/addEvent', "G28 X");
this.$store.commit('server/addEvent', { message: "G28 X", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeX' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "socket/removeLoading", { name: 'homeX' });
},
doHomeY() {
this.$store.commit('server/addEvent', "G28 Y");
this.$store.commit('server/addEvent', { message: "G28 Y", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeY' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "socket/removeLoading", { name: 'homeY' });
},
doHomeZ() {
this.$store.commit('server/addEvent', "G28 Z");
this.$store.commit('server/addEvent', { message: "G28 Z", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeZ' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "socket/removeLoading", { name: 'homeZ' });
},
doQGL() {
this.$store.commit('server/addEvent', "QUAD_GANTRY_LEVEL");
this.$store.commit('server/addEvent', { message: "QUAD_GANTRY_LEVEL", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'qgl' });
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "socket/removeLoading", { name: 'qgl' });
},
doZtilt() {
this.$store.commit('server/addEvent', "Z_TILT_ADJUST");
this.$store.commit('server/addEvent', { message: "Z_TILT_ADJUST", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'zTilt' });
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
},
@ -130,11 +130,11 @@
this.doSend(gcode);
},
doSend(gcode) {
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "server/getGcodeRespond");
},
doSendMacro(gcode) {
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
},

View File

@ -65,13 +65,13 @@
},
sendRetract() {
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
},
sendDetract() {
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
},

View File

@ -200,7 +200,7 @@ import {mapState} from 'vuex'
let output = "";
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
this.$store.commit('server/addEvent', output);
this.$store.commit('server/addEvent', { message: output, type: 'command' });
}
}
}

View File

@ -37,7 +37,7 @@
methods: {
changeSensor(runout) {
const gcode = 'SET_FILAMENT_SENSOR SENSOR='+runout.name+' ENABLE='+(runout.enabled ? 1 : 0)
this.$store.commit('server/addEvent', gcode)
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
}

View File

@ -37,7 +37,7 @@
</v-col>
</v-row>
</div>
<div v-for="(fan, index) in this['printer/getTemperatureFans']" v-bind:key="index+99" >
<div v-for="(fan, index) in temperatureFans" v-bind:key="index+99" >
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
@ -51,7 +51,7 @@
</v-col>
</v-row>
</div>
<div v-for="(sensor,index) in this['printer/getTemperatureSensors']" v-bind:key="index+999">
<div v-for="(sensor,index) in temperatureSensors" v-bind:key="index+999">
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
@ -87,7 +87,7 @@
</template>
<script>
import { mapGetters, mapState } from 'vuex'
import { mapState } from 'vuex'
import toolInput from '../../inputs/ToolInput'
import TempChart from '@/components/charts/TempChart'
@ -105,15 +105,22 @@
...mapState({
datasets: state => state.printer.tempHistory.datasets,
boolTempchart: state => state.gui.dashboard.boolTempchart,
printer: state => state.printer,
}),
...mapGetters([
'printer/getTemperatureFans',
'printer/getTemperatureSensors',
]),
heaters: {
get () {
return this.$store.getters["printer/getHeaters"]
}
},
temperatureFans: {
get () {
return this.$store.getters["printer/getTemperatureFans"]
}
},
temperatureSensors: {
get () {
return this.$store.getters["printer/getTemperatureSensors"]
}
}
},
created() {

View File

@ -59,25 +59,25 @@
sendBabySteppingDownFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingDownFine' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDownFine' });
},
sendBabySteppingDown() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingDown' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDown' });
},
sendBabySteppingUpFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingUpFine' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUpFine' });
},
sendBabySteppingUp() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingUp' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUp' });
},
}

View File

@ -86,7 +86,7 @@
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value/100);
if (gcode !== "") {
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$socket.sendObj('printer.gcode.script', { script: gcode });
}
},

View File

@ -98,7 +98,7 @@
methods: {
sendCmd() {
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
this.$store.commit('server/addEvent', gcode)
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
},
decrement() {

View File

@ -322,7 +322,7 @@
},
loadProfile: function(name) {
this.$store.commit('socket/addLoading', { name: 'bedMeshLoad_'+name })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE LOAD="+name)
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE LOAD="+name, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+name }, "socket/removeLoading", { name: 'bedMeshLoad_'+name })
},
openRenameProfile: function() {
@ -332,7 +332,7 @@
renameProfile: function() {
this.renameDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshRename' })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase())
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase(), type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "socket/removeLoading", { name: 'bedMeshRename' })
},
openRemoveProfile: function(name) {
@ -342,19 +342,19 @@
removeProfile: function() {
this.removeDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshRemove_'+this.newName })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE REMOVE="+this.newName)
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE REMOVE="+this.newName, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.newName }, "printer/removeBedMeshProfile", { name: this.newName })
this.removeDialogProfile = ""
},
clearBedMesh: function() {
this.$store.commit('socket/addLoading', { name: 'bedMeshClear' })
this.$store.commit('server/addEvent', "BED_MESH_CLEAR")
this.$store.commit('server/addEvent', { message: "BED_MESH_CLEAR", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "socket/removeLoading", { name: 'bedMeshClear' })
},
calibrateMesh: function() {
this.calibrateDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshCalibrate' });
this.$store.commit('server/addEvent', "BED_MESH_CALIBRATE")
this.$store.commit('server/addEvent', { message: "BED_MESH_CALIBRATE", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
}
},