modifying pwncnc settings
This commit is contained in:
@@ -407,12 +407,10 @@ module.exports = new Vue({
|
||||
|
||||
save: async function() {
|
||||
const selected_tool = this.config.tool["selected-tool"];
|
||||
console.log(selected_tool);
|
||||
const saveModbus =
|
||||
selected_tool !== "pwm" &&
|
||||
selected_tool !== "laser" &&
|
||||
selected_tool !== "router";
|
||||
console.log("saveModBus: ", saveModbus);
|
||||
const settings = {
|
||||
["tool"]: { ...this.config.tool },
|
||||
["pwm-spindle"]: { ...this.config["pwm-spindle"] },
|
||||
@@ -421,8 +419,6 @@ module.exports = new Vue({
|
||||
: undefined,
|
||||
};
|
||||
delete settings.tool["tool-type"];
|
||||
console.log("settings: ", settings);
|
||||
console.log('this.config["selected-tool-settings"]: ', this.config["selected-tool-settings"]);
|
||||
|
||||
this.config["selected-tool-settings"][selected_tool] = settings;
|
||||
this.display_units = this.config.settings["units"];
|
||||
|
||||
@@ -155,17 +155,19 @@ module.exports = {
|
||||
methods: {
|
||||
change_selected_tool: function () {
|
||||
const selectedToolSettings = this.config["selected-tool-settings"] || {};
|
||||
console.log("selectedToolSettings: ", selectedToolSettings);
|
||||
const settings = selectedToolSettings[this.selected_tool] || {};
|
||||
console.log("settings", settings);
|
||||
this.config.tool = merge({}, this.config.tool, settings["tool"]);
|
||||
this.config["pwm-spindle"] = merge({}, this.config["pwm-spindle"], settings["pwm-spindle"]);
|
||||
this.config["modbus-spindle"] = merge({}, this.config["modbus-spindle"], settings["modbus-spindle"]);
|
||||
console.log(this.config);
|
||||
if (this.selected_tool == "pwncnc-vfd" && _.isEmpty(settings)) {
|
||||
this.config["modbus-spindle"]["regs"][5] = {
|
||||
"reg-value": 6,
|
||||
"reg-type": "stop-write",
|
||||
"reg-addr": 40960,
|
||||
};
|
||||
}
|
||||
const tool = this.toolList.find(tool => tool.id == this.config.tool["selected-tool"]);
|
||||
console.log("tool: ", tool);
|
||||
this.config.tool["tool-type"] = tool.type || tool.name;
|
||||
console.log(this.config.tool["tool-type"]);
|
||||
this.$dispatch("config-changed");
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user