FanucWeb/ActiveBOWeb/src/store/ControlStore.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-02-27 15:49:09 +00:00
import { defineStore } from "pinia";
export const useCStore = defineStore('Control Store', {
state: () => {
return {
user_mode: 'manually',
nr_episodes: 10,
nr_runs: 1,
greedy: 0,
sendWeights: false,
runner: false,
}
},
getters: {
getUserMode: (state) => state.user_mode,
getNrEpisodes: (state) => state.nr_episodes,
getNrRuns: (state) => state.nr_runs,
getGreedy: (state) => state.greedy,
getSendWeights: (state) => state.sendWeights,
getRunner: (state) => state.runner,
},
actions: {
setUserMode(value) {
this.user_mode = value;
},
setNrEpisodes(value) {
this.nr_episodes = value;
},
setNrRuns(value) {
this.nr_runs = value;
},
setGreedy(value) {
this.greedy = value;
},
setSendWeights() {
this.sendWeights = !this.sendWeights;
},
setRunner() {
this.runner = !this.runner;
},
}
})