FanucWeb/ActiveBOWeb/src/store/ControlStore.js

44 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 {
2023-02-28 15:24:12 +00:00
mode: null,
user_modes: ['manually', 'BO', 'active BO'],
2023-02-27 15:49:09 +00:00
nr_episodes: 10,
nr_runs: 1,
greedy: 0,
sendWeights: false,
runner: false,
}
},
getters: {
2023-02-28 15:24:12 +00:00
getUserMode: (state) => state.mode,
2023-02-27 15:49:09 +00:00
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) {
2023-02-28 15:24:12 +00:00
this.mode = value;
2023-02-27 15:49:09 +00:00
},
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;
},
}
})