You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
214 lines
4.7 KiB
214 lines
4.7 KiB
import { defineStore } from 'pinia'
|
|
|
|
export const useSystemStore = defineStore('system', {
|
|
state: (): System.SystemStore => ({
|
|
systemStatus: {
|
|
virtual: false,
|
|
initComplete: false,
|
|
selfTest: true,
|
|
emergencyStop: false,
|
|
door: {
|
|
status: false,
|
|
},
|
|
gantryArm: {
|
|
idle: true,
|
|
},
|
|
solutionArea: {
|
|
idle: true,
|
|
shaking: false,
|
|
trayStatus: 0,
|
|
solutionContainer: [
|
|
{
|
|
id: 1,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 2,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 3,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 4,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 5,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 6,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 7,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 8,
|
|
type: 'solution',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
{
|
|
id: 9,
|
|
type: 'neutralization',
|
|
empty: false,
|
|
full: false,
|
|
},
|
|
],
|
|
pumping: false,
|
|
},
|
|
heatModule: [
|
|
{
|
|
moduleCode: 'heat_module_01',
|
|
trayStatus: 1,
|
|
heating: false,
|
|
capExist: false,
|
|
temperature: 0,
|
|
targetTemperature: 0,
|
|
},
|
|
{
|
|
moduleCode: 'heat_module_02',
|
|
trayStatus: 1,
|
|
heating: false,
|
|
capExist: false,
|
|
temperature: 100,
|
|
targetTemperature: 0,
|
|
},
|
|
{
|
|
moduleCode: 'heat_module_03',
|
|
trayStatus: 2,
|
|
heating: true,
|
|
capExist: false,
|
|
temperature: 130,
|
|
targetTemperature: 0,
|
|
},
|
|
{
|
|
moduleCode: 'heat_module_04',
|
|
trayStatus: 2,
|
|
heating: false,
|
|
capExist: false,
|
|
temperature: 0,
|
|
targetTemperature: 0,
|
|
},
|
|
{
|
|
moduleCode: 'heat_module_05',
|
|
trayStatus: 1,
|
|
heating: false,
|
|
capExist: false,
|
|
temperature: 0,
|
|
targetTemperature: 0,
|
|
},
|
|
{
|
|
moduleCode: 'heat_module_06',
|
|
trayStatus: 0,
|
|
heating: false,
|
|
capExist: false,
|
|
temperature: 0,
|
|
targetTemperature: 0,
|
|
},
|
|
],
|
|
tray: [
|
|
{
|
|
uuid: '',
|
|
heatModuleId: 'heat_module_01',
|
|
inSolutionArea: false,
|
|
inHeatModule: true,
|
|
tubes: [
|
|
{
|
|
addSolution: true,
|
|
exists: true,
|
|
},
|
|
],
|
|
crafts: {
|
|
state: 'READY',
|
|
},
|
|
},
|
|
{
|
|
uuid: '',
|
|
heatModuleId: 'heat_module_02',
|
|
inSolutionArea: false,
|
|
inHeatModule: true,
|
|
tubes: [
|
|
{
|
|
addSolution: true,
|
|
exists: true,
|
|
},
|
|
],
|
|
crafts: {
|
|
state: 'RUNNING',
|
|
craft: {
|
|
id: 1,
|
|
name: '菱锌矿硫酸溶解法',
|
|
steps: '',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
uuid: '',
|
|
heatModuleId: 'heat_module_03',
|
|
inSolutionArea: false,
|
|
inHeatModule: true,
|
|
tubes: [
|
|
{
|
|
addSolution: true,
|
|
exists: true,
|
|
},
|
|
],
|
|
crafts: {
|
|
state: 'ERROR',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
systemUser: {
|
|
username: '',
|
|
},
|
|
loginForm: {
|
|
username: import.meta.env.FT_NODE_ENV !== 'prod' ? 'admin' : '',
|
|
password: import.meta.env.FT_NODE_ENV !== 'prod' ? '123456' : '',
|
|
},
|
|
menuExpand: true,
|
|
isDebug: import.meta.env.FT_NODE_ENV !== 'prod',
|
|
streamVisible: false,
|
|
systemList: [],
|
|
}),
|
|
actions: {
|
|
updateDebug() {
|
|
this.isDebug = !this.isDebug
|
|
},
|
|
updateSystemStatus(data: System.SystemStatus) {
|
|
this.systemStatus = data
|
|
},
|
|
updateStreamVisible(bool: boolean) {
|
|
this.streamVisible = bool
|
|
},
|
|
updateMenuExpand() {
|
|
this.menuExpand = !this.menuExpand
|
|
},
|
|
updateSystemUser(data: System.SystemUser) {
|
|
this.systemUser = data
|
|
},
|
|
pushSystemList(text: any) {
|
|
this.systemList.push(text)
|
|
},
|
|
},
|
|
persist: false,
|
|
})
|