FanucWeb/ActiveBOWeb/src/store/ControlStore.js
2023-02-28 16:24:12 +01:00

44 lines
1.1 KiB
JavaScript

import { defineStore } from "pinia";
export const useCStore = defineStore('Control Store', {
state: () => {
return {
mode: null,
user_modes: ['manually', 'BO', 'active BO'],
nr_episodes: 10,
nr_runs: 1,
greedy: 0,
sendWeights: false,
runner: false,
}
},
getters: {
getUserMode: (state) => state.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.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;
},
}
})