Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ddffa2a212 | |||
| bd646fafc0 | |||
| 1a69bb5822 | |||
| 0e2ecc763d | |||
| 8a785ca15a | |||
| e2c5845bb8 | |||
| 782176bc29 | |||
| cd3a2d66a2 | |||
| 829fce435d | |||
| b457aa5496 | |||
| 0cfa124f00 | |||
| e8b175de7b | |||
| 4c2a398841 | |||
| 8bf5c4befc | |||
| 57b1dcc8d5 | |||
| 7140ba345c | |||
| 5905e34697 | |||
| 40ffe28ac7 | |||
| bf3f08629e | |||
| ed3cd23dc1 | |||
| 2708a5f8bf | |||
| c71e00b89e | |||
| 75bab13768 | |||
| bb4020d2d0 | |||
| 7e902c3236 | |||
| c7a5689023 | |||
| 7a303f2da2 | |||
| e49af9ccbd | |||
| 49e5c206dc | |||
| 0d83011474 | |||
| 229fa15d15 | |||
| ac243f926b |
@@ -36,6 +36,8 @@ import 'nprogress/nprogress.css'
|
||||
import Toast from 'vue-toastification'
|
||||
import 'vue-toastification/dist/index.css'
|
||||
|
||||
import api from '@/data/api/index'
|
||||
|
||||
import '../metrics'
|
||||
import '../registerServiceWorker'
|
||||
|
||||
@@ -62,6 +64,7 @@ Vue.use(VueMqtt, 'ws://' + location.href.split('/')[2] + ':8083')
|
||||
// Vue.use(VueMqtt, 'ws://' + '192.168.151.125' + ':8083')
|
||||
// Vue.use(VueMqtt, 'ws://' + '192.168.3.211' + ':8083')
|
||||
|
||||
Vue.prototype.API = api
|
||||
Vue.prototype.GLOBAL = global_
|
||||
|
||||
Vue.use(ColorThemePlugin, {
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
// [TODO] 0: not sure future UX design
|
||||
const meta = this.metaList[0]
|
||||
file.clearFileList()
|
||||
const files = await api.meta.getByParent('folder', meta.parent.folder[0])
|
||||
const files = await api.meta.getAttrByParent('folder', meta.parent.folder[0], 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(files)
|
||||
const tmpFiles = file.getFileList()
|
||||
for (let i = 0; i < tmpFiles.length; i++) {
|
||||
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
this.$refs.file_ref.currentInfo = initCollection.data[0]
|
||||
|
||||
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
|
||||
const files = await api.meta.getByParent('folder', initCollection.data[0].id)
|
||||
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
:okText=" $t('modal.confirm') "
|
||||
@ok="editFile()"
|
||||
@cancel="undoEdit()"
|
||||
@keyup.native.enter="() => {
|
||||
editFile()
|
||||
showModal.editFile = false
|
||||
}"
|
||||
tabindex="0"
|
||||
>
|
||||
<va-input
|
||||
:value="editInfo.changedName"
|
||||
@@ -37,6 +42,7 @@
|
||||
:success="editInfo.success"
|
||||
:error="editInfo.error"
|
||||
:error-messages="editInfo.errorMessages"
|
||||
:ref="'edit_input'"
|
||||
@input="checkFileNameValidate"
|
||||
removable
|
||||
/>
|
||||
@@ -45,20 +51,32 @@
|
||||
v-model="showModal.deleteFile"
|
||||
size="small"
|
||||
:title="'DELETE'"
|
||||
:message="`Delete File ${deleteInfo.name}?`"
|
||||
:okText=" $t('modal.confirm') "
|
||||
@ok="deleteFile()"
|
||||
@keyup.native.enter="() => {
|
||||
deleteFile()
|
||||
showModal.deleteFile = false
|
||||
}"
|
||||
tabindex="1"
|
||||
>
|
||||
<!-- invisiable to focus on modal -->
|
||||
<p>Delete File {{ deleteInfo.name }} ? <input type="text" :ref="'delete_input'" style="opacity: 0; line-height: 0;"/></p>
|
||||
</va-modal>
|
||||
|
||||
<va-modal
|
||||
v-model="showModal.deleteMultiFiles"
|
||||
size="small"
|
||||
:title="'DELETE'"
|
||||
:message="'Delete select files?'"
|
||||
:okText=" $t('modal.confirm') "
|
||||
@ok="deleteMultiFiles()"
|
||||
@keyup.native.enter="() => {
|
||||
deleteMultiFiles()
|
||||
showModal.deleteMultiFiles = false
|
||||
}"
|
||||
tabindex="2"
|
||||
>
|
||||
<!-- invisiable to focus on modal -->
|
||||
<p>Delete select files? <input type="text" :ref="'delete_multi_input'" style="opacity: 0; line-height: 0;"/></p>
|
||||
</va-modal>
|
||||
|
||||
<va-card class="flex sm12 xl12 md12 xs12">
|
||||
@@ -170,7 +188,7 @@
|
||||
{{transTime(props.rowData.time_duration)}}
|
||||
</template>
|
||||
<template slot="device_info" slot-scope="props">
|
||||
{{transDeviceInfo(props.rowData.configuration)}}
|
||||
{{transDeviceInfo(props.rowData.device)}}
|
||||
</template>
|
||||
<template slot="actions" slot-scope="props" >
|
||||
<va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
|
||||
@@ -263,8 +281,6 @@ export default {
|
||||
path: '',
|
||||
name: '',
|
||||
metaID: '',
|
||||
rawChannelAndIDArrays: [], // list of lists
|
||||
miniChannelAndIDArrays: [], // list of lists
|
||||
},
|
||||
|
||||
styleList: {
|
||||
@@ -381,11 +397,11 @@ export default {
|
||||
return this.GLOBAL.transTime(time)
|
||||
}
|
||||
},
|
||||
transDeviceInfo: function (configuration) {
|
||||
if (configuration === undefined) {
|
||||
transDeviceInfo: function (device) {
|
||||
if (device === undefined) {
|
||||
return '--'
|
||||
} else {
|
||||
return configuration._DEVICE_NAME_ + '\n' + configuration._DEVICE_ADDR_
|
||||
return device.device_name + '\n' + this.GLOBAL.transMac(device.device_address)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -400,7 +416,7 @@ export default {
|
||||
|
||||
// call getfolder api and update
|
||||
const folders = await api.collection.getByParent('folder', info.id)
|
||||
const files = await api.meta.getByParent('folder', info.id)
|
||||
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
|
||||
@@ -420,7 +436,7 @@ export default {
|
||||
this.currentInfo = item
|
||||
// call getfolder api and update
|
||||
const folders = await api.collection.getByParent('folder', item.id)
|
||||
const files = await api.meta.getByParent('folder', item.id)
|
||||
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
|
||||
@@ -441,7 +457,7 @@ export default {
|
||||
if (initCollection.data.length === 1) {
|
||||
this.currentInfo = initCollection.data[0]
|
||||
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
|
||||
const files = await api.meta.getByParent('folder', initCollection.data[0].id)
|
||||
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
this.fileLists = file.getFileList()
|
||||
@@ -496,6 +512,9 @@ export default {
|
||||
this.editInfo.info = info
|
||||
this.editInfo.changedName = info.name
|
||||
this.showModal.editFile = true
|
||||
setTimeout(() => {
|
||||
this.$refs.edit_input.$refs.input.focus()
|
||||
}, 100)
|
||||
},
|
||||
editFile: async function () {
|
||||
// TODO editFile
|
||||
@@ -558,7 +577,7 @@ export default {
|
||||
},
|
||||
removeFileFromList: function () {
|
||||
},
|
||||
fillDeleteInfo (info) {
|
||||
fillDeleteInfo: function (info) {
|
||||
if (info.type === 'folder') {
|
||||
this.deleteInfo.folderID = info.id
|
||||
this.deleteInfo.name = info.name
|
||||
@@ -566,32 +585,28 @@ export default {
|
||||
this.deleteInfo.path = info.path
|
||||
this.deleteInfo.name = info.name
|
||||
this.deleteInfo.metaID = info.id
|
||||
this.deleteInfo.rawChannelAndIDArrays = [] // list of lists
|
||||
this.deleteInfo.miniChannelAndIDArrays = [] // list of lists
|
||||
for (const [channel, idArray] of Object.entries(info.raw_data)) {
|
||||
this.deleteInfo.rawChannelAndIDArrays.push([channel, idArray[0]])
|
||||
}
|
||||
for (const [channel, scaleObject] of Object.entries(info.mini_data)) {
|
||||
for (const idArray of Object.values(scaleObject)) {
|
||||
this.deleteInfo.miniChannelAndIDArrays.push([channel, idArray[0]])
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async deleteFolder (id) {
|
||||
deleteFolder: async function (id) {
|
||||
await api.collection.update(id, { deleted: true })
|
||||
await api.collection.clearDel()
|
||||
},
|
||||
async deleteSingleFileByDeleteInfo () {
|
||||
deleteSingleFileByDeleteInfo: async function () {
|
||||
await api.meta.update(this.deleteInfo.metaID, { deleted: true })
|
||||
await api.meta.clearDel()
|
||||
},
|
||||
deleteFileConfirm: function (info) {
|
||||
this.fillDeleteInfo(info)
|
||||
this.showModal.deleteFile = true
|
||||
setTimeout(() => {
|
||||
this.$refs.delete_input.focus()
|
||||
}, 100)
|
||||
},
|
||||
deleteFile: async function () {
|
||||
if (this.deleteInfo.metaID !== undefined) {
|
||||
this.showToast('deleting file...', {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
if (this.deleteInfo.metaID === undefined) {
|
||||
await this.deleteFolder(this.deleteInfo.folderID)
|
||||
} else {
|
||||
await this.deleteSingleFileByDeleteInfo()
|
||||
@@ -612,8 +627,14 @@ export default {
|
||||
},
|
||||
deleteMultiFilesConfirm: function () {
|
||||
this.showModal.deleteMultiFiles = true
|
||||
setTimeout(() => {
|
||||
this.$refs.delete_multi_input.focus()
|
||||
}, 100)
|
||||
},
|
||||
deleteMultiFiles: async function () {
|
||||
this.showToast('deleting file...', {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
this.deleteSelected()
|
||||
},
|
||||
inputFieldReset: function (info) {
|
||||
@@ -642,7 +663,7 @@ export default {
|
||||
|
||||
// call getfolder api and update
|
||||
const folders = await api.collection.getByParent('folder', this.currentInfo.id)
|
||||
const files = await api.meta.getByParent('folder', this.currentInfo.id)
|
||||
const files = await api.meta.getAttrByParent('folder', this.currentInfo.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
: cardStyle.medium
|
||||
: cardStyle.large
|
||||
">
|
||||
<project-view @start_project="startProject($event)" />
|
||||
<project-view @start_project="startProject($event)" @stop_project="stopProject($event)" @save_project="saveProject($event)"/>
|
||||
</div>
|
||||
<div :class="cardStyle.small" v-show="taskViewPanel.show">
|
||||
<project-task/>
|
||||
@@ -22,7 +22,9 @@
|
||||
import ProjectManager from '@/components/project/manager/ProjectManager'
|
||||
import ProjectView from '@/components/project/view/ProjectView'
|
||||
import ProjectTask from '@/components/project/task/ProjectTask'
|
||||
import { mapActions } from 'vuex'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import types from '@/store/modules/project/types'
|
||||
import { taskInfo } from '@/data/task/TaskInfo'
|
||||
|
||||
export default {
|
||||
@@ -34,6 +36,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapFields('project', [
|
||||
'projectConfigList',
|
||||
'runningProjectList',
|
||||
'projectManagerPanel',
|
||||
'taskViewPanel',
|
||||
'deviceConnectList',
|
||||
@@ -51,6 +55,7 @@ export default {
|
||||
},
|
||||
mqtt: {
|
||||
async '+/get_device_info_all/+' (data, topic) {
|
||||
this.deviceConnectList.length = 0
|
||||
const deviceList = JSON.parse(String.fromCharCode.apply(null, data)).data
|
||||
|
||||
for (const device of deviceList) {
|
||||
@@ -63,8 +68,41 @@ export default {
|
||||
this.deviceConnectList.push(device)
|
||||
}
|
||||
},
|
||||
async '+/run_project/+' (data, topic) {
|
||||
const runningProjects = JSON.parse(String.fromCharCode.apply(null, data)).data
|
||||
this.runningProjectList.push(runningProjects)
|
||||
},
|
||||
async '+/get_running_project/+' (data, topic) {
|
||||
this.runningProjectList.length = 0
|
||||
const runningProjects = JSON.parse(String.fromCharCode.apply(null, data)).data
|
||||
this.runningProjectList.push(...runningProjects)
|
||||
},
|
||||
async '+/broadcast' (data, topic) {
|
||||
const mes = String.fromCharCode.apply(null, data).split(':')
|
||||
// let content
|
||||
switch (mes[0]) {
|
||||
case 'project':
|
||||
this.pageToast(mes.slice(1).join(':'))
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'get_running_project/0',
|
||||
}))
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
pageToast: function (mes) {
|
||||
this.showToast(
|
||||
mes,
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 10000,
|
||||
},
|
||||
)
|
||||
},
|
||||
mqttSub: function (val) {
|
||||
this.$mqtt.subscribe(val)
|
||||
},
|
||||
@@ -77,10 +115,14 @@ export default {
|
||||
pageMqttSub: function (id) {
|
||||
this.mqttSub(id + '/broadcast')
|
||||
this.mqttSub(id + '/get_device_info_all/+')
|
||||
this.mqttSub(id + '/run_project/+')
|
||||
this.mqttSub(id + '/get_running_project/+')
|
||||
},
|
||||
pageMqttUnSub: function (id) {
|
||||
this.mqttUnSub(id + '/broadcast')
|
||||
this.mqttUnSub(id + '/get_device_info_all/+')
|
||||
this.mqttUnSub(id + '/run_project/+')
|
||||
this.mqttUnSub(id + '/get_running_project/+')
|
||||
},
|
||||
initPage: async function () {
|
||||
await taskInfo.updateTaskInfo()
|
||||
@@ -94,6 +136,29 @@ export default {
|
||||
project: project,
|
||||
}))
|
||||
},
|
||||
stopProject: function (project) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'stop_project/0',
|
||||
project: project.uuid,
|
||||
}))
|
||||
},
|
||||
saveProject: async function (project) {
|
||||
this.updateProject({ project: project, api: this.API })
|
||||
this.showToast(
|
||||
'project update finish',
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 5000,
|
||||
},
|
||||
)
|
||||
},
|
||||
|
||||
...mapActions('project',
|
||||
[
|
||||
types.project.update,
|
||||
],
|
||||
),
|
||||
},
|
||||
async mounted () {
|
||||
await this.initPage()
|
||||
@@ -103,13 +168,20 @@ export default {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'get_device_info_all/0',
|
||||
}))
|
||||
const project = await this.API.project.getAll()
|
||||
this.projectConfigList.length = 0
|
||||
this.projectConfigList.push(...project.data)
|
||||
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'get_running_project/0',
|
||||
}))
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.project {
|
||||
font-size: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markup-tables {
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<va-card style="height: 80vh; overflow: auto; display: block;">
|
||||
<va-card style="height: 90vh; overflow: auto; display: block;">
|
||||
<template slot="header">
|
||||
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
|
||||
<h5 class="mt-0 mb-0">PROJECTS</h5>
|
||||
</template>
|
||||
<div class="flex d-flex m12 xs12 md12 xl12">
|
||||
<div>
|
||||
<va-button @click="createProject" icon="fa fa-plus"></va-button>
|
||||
<va-button @click="createProject({ api: API })" icon="fa fa-plus"></va-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<va-tabs v-model="tabValue" style="width: 100%;" grow>
|
||||
<va-tab v-for="title in tabTitles" :key="title">
|
||||
<va-tab v-for="(title, index) in tabTitles" :key="title" @click.native="switchProjectCategory(index)">
|
||||
{{ title }}
|
||||
</va-tab>
|
||||
</va-tabs>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<project-manager-list v-if='tabValue == 0'/>
|
||||
<!-- <project-manager-running-table v-if='tabValue == 1'/> -->
|
||||
<running-project-manager-list v-if='tabValue == 1'/>
|
||||
</div>
|
||||
</va-card>
|
||||
</div>
|
||||
@@ -27,17 +27,24 @@
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import types from '@/store/modules/project/types'
|
||||
|
||||
import ProjectManagerList from '@/components/project/manager/ProjectManagerList'
|
||||
// import ProjectManagerRunningTable from '@/components/project/manager/table/ProjectManagerRunningTable'
|
||||
import RunningProjectManagerList from '@/components/project/manager/RunningProjectManagerList'
|
||||
|
||||
export default {
|
||||
name: 'project-manager',
|
||||
components: {
|
||||
ProjectManagerList,
|
||||
RunningProjectManagerList,
|
||||
},
|
||||
computed: {
|
||||
...mapFields('project', [
|
||||
'lockMode',
|
||||
'projectList',
|
||||
'projectConfigList',
|
||||
'runningProjectList',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -46,6 +53,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchProjectCategory: function (title) {
|
||||
const projectType = ['projectConfigList', 'runningProjectList']
|
||||
this.projectList = this[projectType[title]]
|
||||
this.lockMode = Boolean(title)
|
||||
},
|
||||
...mapActions('project',
|
||||
[
|
||||
types.project.create,
|
||||
@@ -53,6 +65,7 @@ export default {
|
||||
),
|
||||
},
|
||||
mounted () {
|
||||
this.projectList = this.projectConfigList
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="flex xs12 lg12 md12">
|
||||
<va-item class="mb-1" v-for="(project, index) in projectList" :key="index" @click="selectProject({index: index})" clickable>
|
||||
<va-item-section>
|
||||
<va-item-label>
|
||||
<va-item class="mb-1" v-for="(project, index) in projectConfigList" :key="index" @click="selectProject({index: index})" clickable>
|
||||
<va-item-section @dblclick.native="switchEdit('name', index)">
|
||||
<div v-if="projectTable.name == index">
|
||||
<va-input
|
||||
v-model="project.name"
|
||||
style="width: 100px;"
|
||||
@blur="switchEdit('name', -1, project)"
|
||||
@keyup.enter="switchEdit('name', -1, project)"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ project.name }}
|
||||
</va-item-label>
|
||||
</div>
|
||||
<!-- <va-item-label>
|
||||
{{ project.name }}
|
||||
</va-item-label> -->
|
||||
</va-item-section>
|
||||
<va-item-section side>
|
||||
<va-icon class="fa fa-close" color="danger" @click.native.stop="deleteProject({index: index})"></va-icon>
|
||||
<va-icon class="fa fa-close" color="danger" @click.native.stop="deleteProject({ project: project, index: index, api: API })"></va-icon>
|
||||
</va-item-section>
|
||||
</va-item>
|
||||
</div>
|
||||
@@ -22,21 +33,29 @@ import types from '@/store/modules/project/types'
|
||||
export default {
|
||||
name: 'project-manager-list',
|
||||
computed: {
|
||||
|
||||
...mapFields('project', [
|
||||
'projectList',
|
||||
'projectConfigList',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
projectTable: {
|
||||
name: -1,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
switchEdit: function (tag, index, project) {
|
||||
if (this.projectTable[tag] >= 0) {
|
||||
this.projectTable[tag] = -1
|
||||
project && this.API.project.update(project.id, { name: project.name })
|
||||
} else {
|
||||
this.projectTable[tag] = index
|
||||
}
|
||||
},
|
||||
...mapActions('project',
|
||||
[
|
||||
types.project.select,
|
||||
types.project.save,
|
||||
types.project.delete,
|
||||
],
|
||||
),
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="flex xs12 lg12 md12 sm12">
|
||||
<va-item class="mb-1" v-for="(project, index) in runningProjectList"
|
||||
:key="index" @click="selectProject({index: index})"
|
||||
@mouseenter.native="() => mouse.hover = index"
|
||||
@mouseleave.native="() => mouse.hover = -1"
|
||||
>
|
||||
<va-item-section>
|
||||
<!-- {{ mouse.hover }} {{ index }} -->
|
||||
<p>{{ project.name }} </p>
|
||||
</va-item-section>
|
||||
<va-item-section v-if="project.status === 1" side>
|
||||
<!-- <div v-if="mouse.hover === index">
|
||||
<va-icon class="fa fa-stop-circle-o" ></va-icon>
|
||||
</div> -->
|
||||
<div>
|
||||
<fulfilling-bouncing-circle-spinner
|
||||
:animation-duration="3000"
|
||||
:color="'#6c7fee'"
|
||||
:size="16"
|
||||
></fulfilling-bouncing-circle-spinner>
|
||||
</div>
|
||||
</va-item-section>
|
||||
<va-item-section v-if="project.status === 2" side>
|
||||
<va-icon class="fa fa-check" ></va-icon>
|
||||
</va-item-section>
|
||||
</va-item>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import { mapActions } from 'vuex'
|
||||
import types from '@/store/modules/project/types'
|
||||
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
|
||||
|
||||
export default {
|
||||
name: 'running-project-manager-list',
|
||||
components: {
|
||||
FulfillingBouncingCircleSpinner,
|
||||
},
|
||||
computed: {
|
||||
...mapFields('project', [
|
||||
'runningProjectList',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
mouse: {
|
||||
hover: -1,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions('project',
|
||||
[
|
||||
types.project.select,
|
||||
types.project.delete,
|
||||
],
|
||||
),
|
||||
},
|
||||
mounted () {
|
||||
console.log(this.runningProjectList)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<va-card style="height: 80vh; overflow: auto;">
|
||||
<va-card style="height: 90vh; overflow: auto;">
|
||||
<project-task-config></project-task-config>
|
||||
</va-card>
|
||||
</div>
|
||||
|
||||
@@ -130,8 +130,8 @@ export default {
|
||||
const newAction = this.createAction(actionUUID, this.actionSelect, this.deviceSelect)
|
||||
|
||||
// if device not add in task then add in
|
||||
if (!this.getSelectTask.deviceList.includes(this.deviceSelect)) {
|
||||
this.getSelectTask.deviceList.push(this.deviceSelect)
|
||||
if (!this.getSelectTask.device.includes(this.deviceSelect)) {
|
||||
this.getSelectTask.device.push(this.deviceSelect)
|
||||
}
|
||||
|
||||
for (const key in this.conditionObj) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<va-list fit class="mb-2">
|
||||
<va-item v-for="(device, index) in getSelectProject.deviceList" :key="index" >
|
||||
<va-item v-for="(device, index) in getSelectProject.device" :key="index" >
|
||||
<va-item-section side>
|
||||
<va-checkbox
|
||||
:value="device.isSelect"
|
||||
@@ -30,7 +30,7 @@
|
||||
</va-item-label>
|
||||
|
||||
<va-item-label caption>
|
||||
{{ device.mac_address }}
|
||||
{{ device.connectDevice.device_address }}
|
||||
</va-item-label>
|
||||
</va-item-section>
|
||||
</va-item>
|
||||
@@ -69,23 +69,23 @@ export default {
|
||||
if (this.taskSelectKey !== undefined) {
|
||||
device.isSelect = event
|
||||
device.isSelect.includes(String(this.taskSelectKey)) === true
|
||||
? this.getSelectTask.deviceList.push(key)
|
||||
: this.getSelectTask.deviceList = this.getSelectTask.deviceList.filter(item => item !== key)
|
||||
? this.getSelectTask.device.push(key)
|
||||
: this.getSelectTask.device = this.getSelectTask.device.filter(item => item !== key)
|
||||
} else {
|
||||
// if select all tasks
|
||||
if (event.includes('-1')) {
|
||||
// check all
|
||||
device.isSelect = ['-1', ...Array(this.getSelectProject.taskList.length).fill().map((_, index) => String(index))]
|
||||
for (const task of this.getSelectProject.taskList) {
|
||||
if (!task.deviceList.includes(key)) {
|
||||
task.deviceList.push(key)
|
||||
device.isSelect = ['-1', ...Array(this.getSelectProject.task.length).fill().map((_, index) => String(index))]
|
||||
for (const task of this.getSelectProject.task) {
|
||||
if (!task.device.includes(key)) {
|
||||
task.device.push(key)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// uncheck all
|
||||
device.isSelect = []
|
||||
for (const task of this.getSelectProject.taskList) {
|
||||
task.deviceList = task.deviceList.filter(item => item !== key)
|
||||
for (const task of this.getSelectProject.task) {
|
||||
task.device = task.device.filter(item => item !== key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+342
-199
@@ -14,212 +14,274 @@
|
||||
</div>
|
||||
|
||||
<!-- 1.5ui -->
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Range ( ' + currentRangeOptions[currentRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'currentRangeSelect'" :deviceID="deviceID" :options="currentRangeOptions" :parameterName="'ADC_LEVEL_I_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0, 1, 2, 4, 5, 6, 7, 8, 9, 11, 13].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Range ( {{ currentRangeOptions[currentRangeSelect].label }} )</p>
|
||||
<level-button
|
||||
:ref="'currentRangeSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="currentRangeOptions"
|
||||
:parameterName="'ADC_LEVEL_I_15'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Range ( ' + voltageInRangeOptions[voltageInRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'voltageInRangeSelect'" :deviceID="deviceID" :options="voltageInRangeOptions" :parameterName="'ADC_LEVEL_V_IN_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0, 1, 2, 4, 5, 6, 7, 8, 9, 11, 13].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Range ( {{ voltageInRangeOptions[voltageInRangeSelect].label }} )</p>
|
||||
<level-button
|
||||
:ref="'voltageInRangeSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="voltageInRangeOptions"
|
||||
:parameterName="'ADC_LEVEL_V_IN_15'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 10"
|
||||
style="font-size: 20px;"
|
||||
:label="'HighZ ( ' + highzOptions[highzSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'highzSelect'" :deviceID="deviceID" :options="highzOptions" :parameterName="'CTRL_HIGH_Z_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">HighZ ( {{ highzOptions[highzSelect].label }} )</p>
|
||||
<level-button
|
||||
:ref="'highzSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="highzOptions"
|
||||
:parameterName="'CTRL_HIGH_Z_15'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 11"
|
||||
style="font-size: 20px;"
|
||||
:label="'Cali Channel ( ' + caliChannelOptions[caliChannelSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'caliChannelSelect'" :deviceID="deviceID" :options="caliChannelOptions" :parameterName="'ADC_DAC_CHANNEL_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[11].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Cali Channel ( {{ caliChannelOptions[caliChannelSelect].label }} )</p>
|
||||
<level-button
|
||||
:ref="'caliChannelSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="caliChannelOptions"
|
||||
:parameterName="'ADC_DAC_CHANNEL_15'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 10"
|
||||
style="font-size: 20px;"
|
||||
:label="'cali Volt ( ' + caliVoltNumber + ' )'">
|
||||
<va-tree-node>
|
||||
<cycle-range :ref="'caliVoltNumber'" :deviceID="deviceID" :parameterName="'DAC_VOLT'" :minValue="0" :maxValue="65535" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[10].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Cali Volt ( {{ caliVoltNumber }} )</p>
|
||||
<cycle-range
|
||||
:ref="'caliVoltNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'DAC_VOLT'"
|
||||
:minValue="0"
|
||||
:maxValue="65535"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt start ( ' + startVoltNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'startVoltNumber'" :deviceID="deviceID" :parameterName="'VOLT_ORIGIN'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0,1].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Start ( {{ (startVoltNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'startVoltNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_ORIGIN'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt stop ( ' + stopVoltNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'stopVoltNumber'" :deviceID="deviceID" :parameterName="'VOLT_FINAL'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0,1].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Stop ( {{ (stopVoltNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'stopVoltNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_FINAL'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt step ( ' + stepVoltNumber/10 + 'mV )'">
|
||||
<va-tree-node>
|
||||
<milli-volt-range :ref="'stepVoltNumber'" :deviceID="deviceID" :parameterName="'VOLT_STEP'" :minValue="0.2" :maxValue="100" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0,1].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Step ( {{ stepVoltNumber/10 }} mV )</p>
|
||||
<milli-volt-range
|
||||
:ref="'stepVoltNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_STEP'"
|
||||
:minValue="0.2" :maxValue="100"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1"
|
||||
style="font-size: 20px;"
|
||||
:label="'Step time ( ' + stepTimeOptions[stepTimeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'stepTimeSelect'" :deviceID="deviceID" :options="stepTimeOptions" :parameterName="'STEP_TIME'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0,1].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Step Time ( {{ stepTimeOptions[stepTimeSelect].label }} )</p>
|
||||
<level-button
|
||||
:ref="'stepTimeSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="stepTimeOptions"
|
||||
:parameterName="'STEP_TIME'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 5"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt out ( ' + outputVoltNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'outputVoltNumber'" :deviceID="deviceID" :parameterName="'DAC_VOLT'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[2,3,5].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Out ( {{ (outputVoltNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'outputVoltNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'DAC_VOLT'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Sample rate ( ' + sampleRateNumber/10 + 'sps )'">
|
||||
<va-tree-node>
|
||||
<resolution-range :ref="'sampleRateNumber'" :deviceID="deviceID" :parameterName="'SAMPLE_RATE'" :minValue="0.1" :maxValue="100" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[0,1,2,3,4,5,6,13].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Sample Rate ( {{ sampleRateNumber/10 }} sps )</p>
|
||||
<resolution-range
|
||||
:ref="'sampleRateNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'SAMPLE_RATE'"
|
||||
:minValue="0.1"
|
||||
:maxValue="100"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
style="font-size: 20px;"
|
||||
:label="'Charge ( ' + chargeOptions[chargeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<opp-level-button :ref="'chargeSelect'" :deviceID="deviceID" :options="chargeOptions" :parameterName="'Charge'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[6].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Charge ( {{ chargeOptions[chargeSelect].label }} )</p>
|
||||
<opp-level-button
|
||||
:ref="'chargeSelect'"
|
||||
:deviceID="deviceID"
|
||||
:options="chargeOptions"
|
||||
:parameterName="'Charge'"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
style="font-size: 20px;"
|
||||
:label="'Current ( ' + parseFloat(currentNumber / 100) + 'μA )'">
|
||||
<va-tree-node>
|
||||
<micro-ampere-range :ref="'currentNumber'" :deviceID="deviceID" :parameterName="'Const_Current_value'" :minValue="0" :maxValue="15000" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[6].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Current ( {{ parseFloat(currentNumber / 100) }} μA )</p>
|
||||
<micro-ampere-range
|
||||
:ref="'currentNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'Const_Current_value'"
|
||||
:minValue="0"
|
||||
:maxValue="15000"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt max stop ( ' + stopVoltMaxNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'stopVoltMaxNumber'" :deviceID="deviceID" :parameterName="'VOLTSTOP_MAX'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[6].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Max Stop ( {{ (stopVoltMaxNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'stopVoltMaxNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLTSTOP_MAX'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt min stop ( ' + stopVoltMinNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'stopVoltMinNumber'" :deviceID="deviceID" :parameterName="'VOLTSTOP_MIN'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[6].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Volt Min Stop ( {{ (stopVoltMinNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'stopVoltMinNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLTSTOP_MIN'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 7 || workingModeSelect.id == 8"
|
||||
style="font-size: 20px;"
|
||||
:label="'E-Initial ( ' + voltInitialNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'voltInitialNumber'" :deviceID="deviceID" :parameterName="'VOLT_INITIAL'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[7,8].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">E-Initial ( {{ (voltInitialNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'voltInitialNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_INITIAL'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 7"
|
||||
style="font-size: 20px;"
|
||||
:label="'E1 ( ' + voltMaxNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'voltMaxNumber'" :deviceID="deviceID" :parameterName="'VOLT_MAX'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[7].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">E1 ( {{ (voltMaxNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'voltMaxNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_MAX'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 7"
|
||||
style="font-size: 20px;"
|
||||
:label="'E2 ( ' + voltMinNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'voltMinNumber'" :deviceID="deviceID" :parameterName="'VOLT_MIN'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[7].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">E2 ( {{ (voltMinNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'voltMinNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_MIN'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 8"
|
||||
style="font-size: 20px;"
|
||||
:label="'E-Final ( ' + voltEFinalNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'voltEFinalNumber'" :deviceID="deviceID" :parameterName="'VOLT_EFINAL'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[8].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">E-Final ( {{ (voltEFinalNumber - 25000 ) / 5000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'voltEFinalNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_EFINAL'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 9"
|
||||
style="font-size: 20px;"
|
||||
:label="'VScan ( ' + voltVScanNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
<volt-range :ref="'voltVScanNumber'" :deviceID="deviceID" :parameterName="'VOLT_VSCAN'" :minValue="-5" :maxValue="5" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[9].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">VScan ( {{ voltVScanNumber / 1000 }} V )</p>
|
||||
<volt-range
|
||||
:ref="'voltVScanNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'VOLT_VSCAN'"
|
||||
:minValue="-5"
|
||||
:maxValue="5"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 7 || workingModeSelect.id == 8"
|
||||
style="font-size: 20px;"
|
||||
:label="'ScanRate ( ' + voltScanRateNumber/100 + 'mV/s )'">
|
||||
<va-tree-node>
|
||||
<scan-rate-range :ref="'voltScanRateNumber'" :deviceID="deviceID" :parameterName="'Scan_Rate'" :minValue="0.01" :maxValue="1000" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[7,8].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">ScanRate ( {{ voltScanRateNumber/100 }} mV/s )</p>
|
||||
<scan-rate-range
|
||||
:ref="'voltScanRateNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'Scan_Rate'"
|
||||
:minValue="0.01"
|
||||
:maxValue="1000"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9"
|
||||
style="font-size: 20px;"
|
||||
:label="'Resolution ( ' + sampleRateNumber/10 + 'sps )'">
|
||||
<va-tree-node>
|
||||
<resolution-range :ref="'sampleRateNumber'" :deviceID="deviceID" :parameterName="'SAMPLE_RATE'" :minValue="0.1" :maxValue="100" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[7, 8, 9].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Resolution ( {{ sampleRateNumber/10 }} sps )</p>
|
||||
<resolution-range
|
||||
:ref="'sampleRateNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'SAMPLE_RATE'"
|
||||
:minValue="0.1"
|
||||
:maxValue="100"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 1 || workingModeSelect.id == 7"
|
||||
style="font-size: 20px;"
|
||||
:label="'Cycle ( ' + cycleNoNumber + ' )'">
|
||||
<va-tree-node>
|
||||
<cycle-range :ref="'cycleNoNumber'" :deviceID="deviceID" :parameterName="'CYCLE_NUMBER'" :minValue="1" :maxValue="50000" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
<div v-show="[1, 7].includes(workingModeSelect.id)">
|
||||
<p style="font-size: 20px;">Cycle ( {{ cycleNoNumber }} )</p>
|
||||
<cycle-range
|
||||
:ref="'cycleNoNumber'"
|
||||
:deviceID="deviceID"
|
||||
:parameterName="'CYCLE_NUMBER'"
|
||||
:minValue="1"
|
||||
:maxValue="50000"
|
||||
@parameterChange="deviceParameterChange($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- <va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 13"
|
||||
@@ -391,6 +453,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
incomingData: undefined,
|
||||
workingModeSelect: {
|
||||
id: -1,
|
||||
description: 'Init',
|
||||
@@ -436,14 +499,14 @@ export default {
|
||||
id: 9,
|
||||
description: 'Chronoamperometric Graph',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
description: 'Cali DAC - test',
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
description: 'Cali ADC - test',
|
||||
},
|
||||
// {
|
||||
// id: 10,
|
||||
// description: 'Cali DAC - test',
|
||||
// },
|
||||
// {
|
||||
// id: 11,
|
||||
// description: 'Cali ADC - test',
|
||||
// },
|
||||
// {
|
||||
// id: 12,
|
||||
// description: 'Dev Mode',
|
||||
@@ -578,7 +641,7 @@ export default {
|
||||
read: '',
|
||||
notify: '',
|
||||
},
|
||||
duration: 0,
|
||||
duration: null,
|
||||
timeUnit: null,
|
||||
timeOptions: [
|
||||
{
|
||||
@@ -598,30 +661,110 @@ export default {
|
||||
label: 'ms',
|
||||
},
|
||||
],
|
||||
|
||||
emitFlag: true,
|
||||
paramTransTable: {
|
||||
// MODE: 'workingModeSelect',
|
||||
ADC_LEVEL_I_15: 'currentRangeSelect',
|
||||
ADC_LEVEL_V_IN_15: 'voltageInRangeSelect',
|
||||
CTRL_HIGH_Z_15: 'highzSelect',
|
||||
ADC_DAC_CHANNEL_15: 'caliChannelSelect',
|
||||
DAC_VOLT: ['outputVoltNumber', 'caliVoltNumber'],
|
||||
// DAC_VOLT: [-1].includes(mode) ? ['outputVoltNumber', 'caliVoltNumber'] : [2, 3, 5].includes(mode) ? 'outputVoltNumber' : [10].includes(mode) ? 'caliVoltNumber' : undefined,
|
||||
VOLT_ORIGIN: 'startVoltNumber',
|
||||
VOLT_FINAL: 'stopVoltNumber',
|
||||
VOLT_STEP: 'stepVoltNumber',
|
||||
STEP_TIME: 'stepTimeSelect',
|
||||
SAMPLE_RATE: 'sampleRateNumber',
|
||||
Charge: 'chargeSelect',
|
||||
Const_Current_value: 'currentNumber',
|
||||
VOLTSTOP_MAX: 'stopVoltMaxNumber',
|
||||
VOLTSTOP_MIN: 'stopVoltMinNumber',
|
||||
VOLT_INITIAL: 'voltInitialNumber',
|
||||
VOLT_MAX: 'voltMaxNumber',
|
||||
VOLT_MIN: 'voltMinNumber',
|
||||
VOLT_EFINAL: 'voltEFinalNumber',
|
||||
VOLT_VSCAN: 'voltVScanNumber',
|
||||
Scan_Rate: 'voltScanRateNumber',
|
||||
CYCLE_NUMBER: 'cycleNoNumber',
|
||||
},
|
||||
paramDefaultTable: {
|
||||
// MODE: -1,
|
||||
ADC_LEVEL_I_15: 4,
|
||||
ADC_LEVEL_V_IN_15: 3,
|
||||
CTRL_HIGH_Z_15: 1,
|
||||
ADC_DAC_CHANNEL_15: 0,
|
||||
DAC_VOLT: 25000,
|
||||
VOLT_ORIGIN: 25000,
|
||||
VOLT_FINAL: 25000,
|
||||
VOLT_STEP: 1000,
|
||||
STEP_TIME: 1,
|
||||
SAMPLE_RATE: 1000,
|
||||
Charge: 1,
|
||||
Const_Current_value: 0,
|
||||
VOLTSTOP_MAX: 50000,
|
||||
VOLTSTOP_MIN: 0,
|
||||
VOLT_INITIAL: 25000,
|
||||
VOLT_MAX: 27500,
|
||||
VOLT_MIN: 22500,
|
||||
VOLT_EFINAL: 25000,
|
||||
VOLT_VSCAN: 25000,
|
||||
Scan_Rate: 10000,
|
||||
CYCLE_NUMBER: 1,
|
||||
},
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
updateSetting: function () {
|
||||
const data = this.incomingData
|
||||
// update everything first
|
||||
this.emitFlag = false
|
||||
const paramTable = this.paramTransTable
|
||||
for (const param in paramTable) {
|
||||
const value = (data && data[param]) || this.paramDefaultTable[param]
|
||||
// console.log(param, paramTable[param], value)
|
||||
|
||||
if (Array.isArray(paramTable[param]) === true) {
|
||||
for (const paramName of paramTable[param]) {
|
||||
this[paramName] = value
|
||||
this.$refs[paramName] && this.$refs[paramName].update(value)
|
||||
}
|
||||
} else {
|
||||
this[paramTable[param]] = value
|
||||
this.$refs[paramTable[param]] && this.$refs[paramTable[param]].update(value)
|
||||
// console.log(paramTable[param], this[paramTable[param]])
|
||||
}
|
||||
}
|
||||
this.emitFlag = true
|
||||
},
|
||||
mqttPub: function (topic, mes) {
|
||||
this.$mqtt.publish(topic, mes)
|
||||
},
|
||||
// Array[String of Parameter Nmae, Value]
|
||||
deviceParameterChange: function (e) {
|
||||
console.log('e[0],e[1]', e[0], ',', e[1])
|
||||
this.$emit('parameterChange', e)
|
||||
const param = e[0]
|
||||
const value = e[1]
|
||||
// console.log('e[0],e[1]', e[0], ',', e[1])
|
||||
if (this.emitFlag === true) {
|
||||
this[this.paramTransTable[param]] = value
|
||||
this.$emit('parameterChange', e)
|
||||
}
|
||||
},
|
||||
workingModeSelectChange (val) {
|
||||
if (this.workingModeSelect.id === -1) {
|
||||
return false
|
||||
if (typeof val === 'object') {
|
||||
this.workingModeSelect = val
|
||||
} else if (typeof val === 'number') {
|
||||
this.workingModeSelect = this.workingModeOptions[val]
|
||||
}
|
||||
|
||||
this.workingModeSelect = val
|
||||
|
||||
this.updateSetting()
|
||||
this.deviceParameterChange(['MODE', this.workingModeSelect.id])
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
// this.updateSetting()
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
|
||||
@@ -99,7 +99,14 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
// init grab new
|
||||
console.log('getParameter', this.getParameterSetTask(this.deviceSelectKey))
|
||||
// console.log('getParameter', this.getParameterSetTask(this.taskSelectKey, this.deviceSelectKey))
|
||||
const parameterSet = this.getParameterSetTask(this.taskSelectKey, this.deviceSelectKey)
|
||||
if (parameterSet) {
|
||||
this.parameterUUID = Object.keys(parameterSet)[0]
|
||||
const param = Object.values(parameterSet)[0]
|
||||
this.$refs.rec_ref_2.incomingData = param
|
||||
this.$refs.rec_ref_2.workingModeSelectChange(param.MODE)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="cycleNumberChange(minValue)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="cycleNumberChange(cycleNoNumberInput)"
|
||||
@keyup.enter="cycleNumberChange(cycleNoNumberInput)"
|
||||
@blur="cycleNumberChange(cycleNoNumberInput)"
|
||||
@mouseleave.native="change(cycleNoNumberInput)"
|
||||
@keyup.enter="change(cycleNoNumberInput)"
|
||||
@blur="change(cycleNoNumberInput)"
|
||||
v-model="cycleNoNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="cycleNumberChange(maxValue)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="cycleNumberChange(cycleNoNumber)"
|
||||
@mouseleave.native="cycleNumberChange(cycleNoNumber)"
|
||||
@touchend.native="cycleNumberChange(cycleNoNumber)"
|
||||
@click.native="cycleNumberChange(cycleNoNumber)"
|
||||
@mouseup.native="change(cycleNoNumber)"
|
||||
@mouseleave.native="change(cycleNoNumber)"
|
||||
@touchend.native="change(cycleNoNumber)"
|
||||
@click.native="change(cycleNoNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="cycleNoNumber"
|
||||
:min="minValue"
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
cycleNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.cycleNoNumber == null) {
|
||||
return false
|
||||
@@ -87,8 +87,8 @@ export default {
|
||||
}
|
||||
this.$emit('parameterChange', [this.parameterName, this.cycleNoNumber])
|
||||
},
|
||||
updateCycleNumber (val) {
|
||||
this.cycleNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<va-button-toggle
|
||||
@click.native="levelButtonSelectChange(levelButtonSelect)"
|
||||
@click.native="change(levelButtonSelect)"
|
||||
small
|
||||
outline
|
||||
v-model="levelButtonSelect"
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
levelButtonSelectChange (val) {
|
||||
change (val) {
|
||||
if (this.levelButtonSelect == null) {
|
||||
return false
|
||||
}
|
||||
@@ -54,8 +54,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, this.levelButtonSelect])
|
||||
},
|
||||
updateLevelButton (val) {
|
||||
this.levelButtonSelectChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="currentNumberChange(minValue*100)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue*100)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="currentNumberChange(currentNumberInput)"
|
||||
@keyup.enter="currentNumberChange(currentNumberInput)"
|
||||
@blur="currentNumberChange(currentNumberInput)"
|
||||
@mouseleave.native="change(currentNumberInput)"
|
||||
@keyup.enter="change(currentNumberInput)"
|
||||
@blur="change(currentNumberInput)"
|
||||
v-model="currentNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
@@ -17,15 +17,15 @@
|
||||
μA
|
||||
</p>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="currentNumberChange(maxValue*100)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue*100)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="currentNumberChange(currentNumber)"
|
||||
@mouseleave.native="currentNumberChange(currentNumber)"
|
||||
@touchend.native="currentNumberChange(currentNumber)"
|
||||
@click.native="currentNumberChange(currentNumber)"
|
||||
@mouseup.native="change(currentNumber)"
|
||||
@mouseleave.native="change(currentNumber)"
|
||||
@touchend.native="change(currentNumber)"
|
||||
@click.native="change(currentNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="currentNumber"
|
||||
:min="minValue*100"
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
currentNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.currentNumber == null) {
|
||||
return false
|
||||
@@ -102,8 +102,8 @@ export default {
|
||||
}
|
||||
this.$emit('parameterChange', [this.parameterName, this.currentNumber])
|
||||
},
|
||||
updateMicroAmpereNumber (val) {
|
||||
this.currentNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="stepVoltNumberChange(minValue*10)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue*10)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="stepVoltNumberChange(voltNumberInput)"
|
||||
@keyup.enter="stepVoltNumberChange(voltNumberInput)"
|
||||
@blur="stepVoltNumberChange(voltNumberInput)"
|
||||
@mouseleave.native="change(voltNumberInput)"
|
||||
@keyup.enter="change(voltNumberInput)"
|
||||
@blur="change(voltNumberInput)"
|
||||
v-model="voltNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
@@ -17,15 +17,15 @@
|
||||
mV
|
||||
</p>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="stepVoltNumberChange(maxValue*10)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue*10)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="stepVoltNumberChange(voltNumber)"
|
||||
@mouseleave.native="stepVoltNumberChange(voltNumber)"
|
||||
@touchend.native="stepVoltNumberChange(voltNumber)"
|
||||
@click.native="stepVoltNumberChange(voltNumber)"
|
||||
@mouseup.native="change(voltNumber)"
|
||||
@mouseleave.native="change(voltNumber)"
|
||||
@touchend.native="change(voltNumber)"
|
||||
@click.native="change(voltNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="voltNumber"
|
||||
:min="minValue*10"
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
stepVoltNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.voltNumber == null) {
|
||||
return false
|
||||
@@ -112,8 +112,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, this.voltNumber])
|
||||
},
|
||||
updateStepVoltNumber (val) {
|
||||
this.stepVoltNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<va-button-toggle
|
||||
@click.native="levelButtonSelectChange(levelButtonSelect)"
|
||||
@click.native="change(levelButtonSelect)"
|
||||
small
|
||||
outline
|
||||
v-model="levelButtonSelect"
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
levelButtonSelectChange (val) {
|
||||
change (val) {
|
||||
if (this.levelButtonSelect == null) {
|
||||
return false
|
||||
}
|
||||
@@ -61,8 +61,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, _charge])
|
||||
},
|
||||
updateLevelButton (val) {
|
||||
this.levelButtonSelectChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="resolutionNumberChange(minValue*10)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue*10)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="resolutionNumberChange(resolutionNumberInput)"
|
||||
@keyup.enter="resolutionNumberChange(resolutionNumberInput)"
|
||||
@blur="resolutionNumberChange(resolutionNumberInput)"
|
||||
@mouseleave.native="change(resolutionNumberInput)"
|
||||
@keyup.enter="change(resolutionNumberInput)"
|
||||
@blur="change(resolutionNumberInput)"
|
||||
v-model="resolutionNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
@@ -17,15 +17,15 @@
|
||||
sps
|
||||
</p>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="resolutionNumberChange(maxValue*10)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue*10)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="resolutionNumberChange(resolutionNumber)"
|
||||
@mouseleave.native="resolutionNumberChange(resolutionNumber)"
|
||||
@touchend.native="resolutionNumberChange(resolutionNumber)"
|
||||
@click.native="resolutionNumberChange(resolutionNumber)"
|
||||
@mouseup.native="change(resolutionNumber)"
|
||||
@mouseleave.native="change(resolutionNumber)"
|
||||
@touchend.native="change(resolutionNumber)"
|
||||
@click.native="change(resolutionNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="resolutionNumber"
|
||||
:min="minValue*10"
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
},
|
||||
defaultValue: {
|
||||
type: Number,
|
||||
default: 2,
|
||||
default: 1000,
|
||||
},
|
||||
minValue: {
|
||||
type: Number,
|
||||
@@ -68,13 +68,13 @@ export default {
|
||||
return {
|
||||
inputeKey: 0,
|
||||
resolutionNumber: this.defaultValue,
|
||||
resolutionNumberInput: String(this.defaultValue),
|
||||
resolutionNumberInput: String(this.defaultValue / 10),
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
resolutionNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.resolutionNumber == null) {
|
||||
return false
|
||||
@@ -103,8 +103,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, this.resolutionNumber])
|
||||
},
|
||||
updateResolutionNumber (val) {
|
||||
this.resolutionNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="voltScanRateNumberChange(minValue*100)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue*100)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="voltScanRateNumberChange(voltScanRateNumberInput)"
|
||||
@keyup.enter="voltScanRateNumberChange(voltScanRateNumberInput)"
|
||||
@blur="voltScanRateNumberChange(voltScanRateNumberInput)"
|
||||
@mouseleave.native="change(voltScanRateNumberInput)"
|
||||
@keyup.enter="change(voltScanRateNumberInput)"
|
||||
@blur="change(voltScanRateNumberInput)"
|
||||
v-model="voltScanRateNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
@@ -17,15 +17,15 @@
|
||||
mV
|
||||
</p>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="voltScanRateNumberChange(maxValue*100)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue*100)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="voltScanRateNumberChange(voltScanRateNumber)"
|
||||
@mouseleave.native="voltScanRateNumberChange(voltScanRateNumber)"
|
||||
@touchend.native="voltScanRateNumberChange(voltScanRateNumber)"
|
||||
@click.native="voltScanRateNumberChange(voltScanRateNumber)"
|
||||
@mouseup.native="change(voltScanRateNumber)"
|
||||
@mouseleave.native="change(voltScanRateNumber)"
|
||||
@touchend.native="change(voltScanRateNumber)"
|
||||
@click.native="change(voltScanRateNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="voltScanRateNumber"
|
||||
:min="minValue*100"
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
voltScanRateNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.voltScanRateNumber == null) {
|
||||
return false
|
||||
@@ -103,8 +103,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, this.voltScanRateNumber])
|
||||
},
|
||||
updateVoltScanRateNumber (val) {
|
||||
this.voltScanRateNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center" :key="inputeKey">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="voltNumberChange(minValue*1000)">
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="change(minValue*1000)">
|
||||
{{ minValue }}
|
||||
</va-button>
|
||||
<va-input
|
||||
@mouseleave.native="voltNumberChange(voltNumberInput)"
|
||||
@keyup.enter="voltNumberChange(voltNumberInput)"
|
||||
@blur="voltNumberChange(voltNumberInput)"
|
||||
@mouseleave.native="change(voltNumberInput)"
|
||||
@keyup.enter="change(voltNumberInput)"
|
||||
@blur="change(voltNumberInput)"
|
||||
v-model="voltNumberInput"
|
||||
class="mb-0"
|
||||
style="width: 100px;"
|
||||
@@ -17,15 +17,15 @@
|
||||
V
|
||||
</p>
|
||||
</va-input>
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="voltNumberChange(maxValue*1000)">
|
||||
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="change(maxValue*1000)">
|
||||
{{ maxValue }}
|
||||
</va-button>
|
||||
</div>
|
||||
<va-slider
|
||||
@mouseup.native="voltNumberChange(voltNumber)"
|
||||
@mouseleave.native="voltNumberChange(voltNumber)"
|
||||
@touchend.native="voltNumberChange(voltNumber)"
|
||||
@click.native="voltNumberChange(voltNumber)"
|
||||
@mouseup.native="change(voltNumber)"
|
||||
@mouseleave.native="change(voltNumber)"
|
||||
@touchend.native="change(voltNumber)"
|
||||
@click.native="change(voltNumber)"
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="voltNumber"
|
||||
:min="minValue*1000"
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
voltNumberChange (val) {
|
||||
change (val) {
|
||||
this.inputeKey++
|
||||
if (this.voltNumber == null) {
|
||||
return false
|
||||
@@ -104,8 +104,8 @@ export default {
|
||||
|
||||
this.$emit('parameterChange', [this.parameterName, this.voltNumber * 5 + 25000])
|
||||
},
|
||||
updateVoltNumber (val) {
|
||||
this.voltNumberChange(val)
|
||||
update (val) {
|
||||
this.change(val)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<va-card style="height: 80vh; overflow: auto; display: block;">
|
||||
<va-card style="height: 90vh; overflow: auto; display: block;">
|
||||
<template slot="header">
|
||||
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
|
||||
<h5 class="mt-0 mb-0"> {{ getSelectProject ? getSelectProject.name : '' }}</h5>
|
||||
@@ -11,9 +11,13 @@
|
||||
<div v-else>
|
||||
<project-menu/>
|
||||
<project-table/>
|
||||
<div align="right">
|
||||
<div align="right" v-if="lockMode === false">
|
||||
<va-button @click="save">Save</va-button>
|
||||
<va-button @click="start">Start</va-button>
|
||||
</div>
|
||||
<div align="right" v-if="lockMode === true">
|
||||
<va-button @click="stop">Stop</va-button>
|
||||
</div>
|
||||
</div>
|
||||
</va-card>
|
||||
</div>
|
||||
@@ -36,6 +40,7 @@ export default {
|
||||
types.project.getSelect,
|
||||
]),
|
||||
...mapFields('project', [
|
||||
'lockMode',
|
||||
'projectList',
|
||||
'projectSelectIndex',
|
||||
]),
|
||||
@@ -46,9 +51,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
start: function () {
|
||||
console.log('finally', this.getSelectProject)
|
||||
this.$emit('start_project', this.getSelectProject)
|
||||
},
|
||||
stop: function () {
|
||||
this.$emit('stop_project', this.getSelectProject)
|
||||
},
|
||||
save: function () {
|
||||
this.$emit('save_project', this.getSelectProject)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="flex d-flex">
|
||||
<div v-for="(device, index) in getSelectProject.deviceList" :key="index">
|
||||
<div v-for="(device, index) in getSelectProject.device" :key="index">
|
||||
<va-button color="info" @click="showDeviceModal(device)" small>
|
||||
<va-icon name="fa fa-close" @click.native.stop="deleteDevice(index)"></va-icon>
|
||||
{{ device.name }} {{ device.connectDevice && device.connectDevice.device_address }}
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
<template>
|
||||
<div class="markup-tables flex d-flex sm12 xl12 md12 xs12" id="scro" style="height: 48vh; overflow: auto;">
|
||||
<div class="markup-tables project-table flex d-flex sm12 xl12 md12 xs12" id="scro" style="height: 66vh; overflow: auto;">
|
||||
<div class="table-wrapper">
|
||||
<table class="va-table va-table--hoverable">
|
||||
<table class="va-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<va-checkbox v-model="temp"/>
|
||||
<th v-if="lockMode === false">
|
||||
<va-checkbox
|
||||
v-model="tableColumn.checked"
|
||||
:array-value="'-1'"
|
||||
@input="selectAll($event)"
|
||||
/>
|
||||
</th>
|
||||
<th align="center">order</th>
|
||||
<th align="center">name</th>
|
||||
<th align="center" @click="openConfig(1)">device</th>
|
||||
<th align="center">action and condition</th>
|
||||
<th align="center">parameter</th>
|
||||
<th align="center"> </th>
|
||||
<th align="center"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<template v-for="(task, taskIndex) in getSelectProject.taskList">
|
||||
<tr v-if="task.deviceList.length === 0" :key="taskIndex">
|
||||
<td>
|
||||
<va-checkbox v-model="temp"/>
|
||||
<template v-for="(task, taskIndex) in getSelectProject.task">
|
||||
<tr v-if="task.device.length === 0" :key="taskIndex" height="80px">
|
||||
<td v-if="lockMode === false">
|
||||
<va-checkbox
|
||||
v-model="tableColumn.checked"
|
||||
:array-value="String(taskIndex)"
|
||||
/>
|
||||
</td>
|
||||
<td align="center">
|
||||
{{ taskIndex + 1 }}
|
||||
@@ -37,68 +44,72 @@
|
||||
<td align="center">
|
||||
<va-button :flat="true" @click="openConfig(4, taskIndex)" small>ParameterSet</va-button>
|
||||
</td>
|
||||
<td align="center" style="max-height: 50px; overflow: auto;">
|
||||
<div class="flex d-flex">
|
||||
<div class="flex-center">
|
||||
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
|
||||
</div>
|
||||
</div>
|
||||
<td align="center">
|
||||
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-for="(deviceUUID) in task.deviceList" :key="task.name + deviceUUID">
|
||||
<td>
|
||||
<va-checkbox v-model="temp"/>
|
||||
<tr v-for="(deviceUUID) in task.device" :key="taskIndex + deviceUUID" height="80px">
|
||||
<td v-if="lockMode === false">
|
||||
<va-checkbox
|
||||
v-model="tableColumn.checked"
|
||||
:array-value="String(taskIndex)"
|
||||
/>
|
||||
</td>
|
||||
<td align="center">
|
||||
{{ taskIndex + 1 }}
|
||||
</td>
|
||||
<td align="center">
|
||||
{{ task.name }}
|
||||
<td align="center" @dblclick="switchInput('name', taskIndex)">
|
||||
<div v-if="tableColumn.name == taskIndex && lockMode === false">
|
||||
<va-input
|
||||
v-model="task.name"
|
||||
style="width: 100px;"
|
||||
@blur="switchInput('name', -1)"
|
||||
@keyup.enter="switchInput('name', -1)"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ task.name }}
|
||||
</div>
|
||||
</td>
|
||||
<td align="center">
|
||||
<td align="center" @click="openConfig(1, taskIndex, deviceUUID)">
|
||||
<div >
|
||||
<span>{{ getDeviceProject(deviceUUID).name }} </span>
|
||||
</div>
|
||||
<div class="flex-center">
|
||||
<va-icon class="fa fa-edit" @click.native="openConfig(1, taskIndex, deviceUUID)"></va-icon>
|
||||
<span>{{ getDeviceProject(deviceUUID) && getDeviceProject(deviceUUID).name }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td align="center">
|
||||
<div class="flex d-flex">
|
||||
<div class="flex">
|
||||
<div v-for="(action, actionKey) in task.action" :key="actionKey">
|
||||
<div v-if="action.target === deviceUUID">
|
||||
<div v-for="conditionKey in action.condition" :key="conditionKey">
|
||||
{{ action.type }} {{ task.condition[conditionKey].type }} {{ task.condition[conditionKey].value }}
|
||||
</div>
|
||||
<td align="center" @click="openConfig(3, taskIndex, deviceUUID)">
|
||||
<div class="flex">
|
||||
<div v-for="(action, actionKey) in task.action" :key="actionKey">
|
||||
<div v-if="action.target === deviceUUID">
|
||||
<div v-for="conditionKey in action.condition" :key="conditionKey">
|
||||
{{ action.type }} {{ task.condition[conditionKey].type }} {{ task.condition[conditionKey].value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-center">
|
||||
<va-icon class="fa fa-edit" @click.native="openConfig(3, taskIndex, deviceUUID)"></va-icon>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td align="center" style="max-height: 50px; overflow: auto;">
|
||||
<td align="center" @click="openConfig(4, taskIndex, deviceUUID)">
|
||||
<div class="flex d-flex">
|
||||
<div class="flex">
|
||||
<div v-for="(parameterSet, parameterSetKey) in getParameterSetTask(taskIndex, deviceUUID)" :key="parameterSetKey">
|
||||
<div v-for="(parameter, parameterKey) in parameterSet" :key="parameterKey">
|
||||
<span v-if="parameterKey !== 'target'">{{ parameterKey }}: {{ parameter }}</span>
|
||||
<span v-if="parameterKey !== 'target'">{{ parameterTable[parameterKey].alias }}: {{ parameterTable[parameterKey].transFormula(parameter) }} {{ parameterTable[parameterKey].unit[0] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-center">
|
||||
<va-icon class="fa fa-edit" @click.native="openConfig(4, taskIndex, deviceUUID)"></va-icon>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td align="center" style="max-height: 50px; overflow: auto;">
|
||||
<div class="flex d-flex">
|
||||
<div class="flex-center">
|
||||
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
|
||||
</div>
|
||||
</div>
|
||||
<td align="center" v-if="lockMode === false">
|
||||
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
|
||||
</td>
|
||||
<td align="center" v-if="lockMode === true">
|
||||
<!-- {{ task.status }} -->
|
||||
<fulfilling-bouncing-circle-spinner
|
||||
v-if="task.status === 1"
|
||||
:animation-duration="3000"
|
||||
:color="'#6c7fee'"
|
||||
:size="16"
|
||||
></fulfilling-bouncing-circle-spinner>
|
||||
<va-icon v-if="task.status === 2" class="fa fa-check"></va-icon>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -111,10 +122,13 @@
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import { mapActions, mapGetters } from 'vuex'
|
||||
import types from '@/store/modules/project/types'
|
||||
import newEliteZm15Parameter from '@/factories/project/eliteZM15ParmameterFactory'
|
||||
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
|
||||
|
||||
export default {
|
||||
name: 'project-table',
|
||||
components: {
|
||||
FulfillingBouncingCircleSpinner,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('project', [
|
||||
@@ -129,26 +143,47 @@ export default {
|
||||
'taskViewPanel',
|
||||
'taskSelectKey',
|
||||
'deviceSelectKey',
|
||||
'lockMode',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
temp: false,
|
||||
tableColumn: {
|
||||
name: -1,
|
||||
checked: [],
|
||||
},
|
||||
parameterTable: newEliteZm15Parameter(),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchInput: function (tag, index) {
|
||||
this.tableColumn[tag] >= 0
|
||||
? this.tableColumn[tag] = -1
|
||||
: this.tableColumn[tag] = index
|
||||
},
|
||||
selectAll: function (selectedArray) {
|
||||
const totalRange = [...Array(this.getSelectProject.task.length).keys()].map(idx => String(idx))
|
||||
selectedArray.includes('-1')
|
||||
? (() => {
|
||||
selectedArray.push(...totalRange)
|
||||
selectedArray = [...new Set(selectedArray)]
|
||||
})()
|
||||
: selectedArray.length = 0
|
||||
},
|
||||
openConfig (type, taskIndex, deviceKey) {
|
||||
console.log(type, taskIndex, deviceKey, this.taskViewPanel.type, this.taskSelectKey, this.deviceSelectKey)
|
||||
if (this.taskViewPanel.type === type && this.taskSelectKey === taskIndex && this.deviceSelectKey === deviceKey) {
|
||||
this.taskSelectKey = ''
|
||||
this.taskViewPanel.type = -1
|
||||
this.taskViewPanel.show = false
|
||||
this.deviceSelectKey = ''
|
||||
} else {
|
||||
this.taskSelectKey = taskIndex
|
||||
this.taskViewPanel.type = type
|
||||
this.taskViewPanel.show = true
|
||||
this.deviceSelectKey = deviceKey
|
||||
if (!this.lockMode) {
|
||||
if (this.taskViewPanel.type === type && this.taskSelectKey === taskIndex && this.deviceSelectKey === deviceKey) {
|
||||
this.taskSelectKey = ''
|
||||
this.taskViewPanel.type = -1
|
||||
this.taskViewPanel.show = false
|
||||
this.deviceSelectKey = ''
|
||||
} else {
|
||||
this.taskSelectKey = taskIndex
|
||||
this.taskViewPanel.type = type
|
||||
this.taskViewPanel.show = true
|
||||
this.deviceSelectKey = deviceKey
|
||||
}
|
||||
}
|
||||
},
|
||||
...mapActions('project', [
|
||||
@@ -162,12 +197,34 @@ export default {
|
||||
|
||||
<style lang="scss">
|
||||
.markup-tables {
|
||||
width: 100%;
|
||||
|
||||
.table-wrapper {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.va-table {
|
||||
width: 100%;
|
||||
.project-table {
|
||||
td {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
max-width: fit-content;
|
||||
max-height: 100px;
|
||||
overflow: auto;
|
||||
white-space: nowrap;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
th {
|
||||
padding: 0 0 0 0;
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
div {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -117,6 +117,9 @@ export default {
|
||||
...mapFields('taskContent', [
|
||||
'deviceList',
|
||||
]),
|
||||
...mapFields('', [
|
||||
'developer_mode',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -146,9 +149,11 @@ export default {
|
||||
this.getParmDone = true
|
||||
},
|
||||
async '+/get_device_info/+' (data, topic) {
|
||||
await taskInfo.deviceInfo(String.fromCharCode.apply(null, data), this.deviceList)
|
||||
const dataObj = JSON.parse(String.fromCharCode.apply(null, data))
|
||||
await taskInfo.deviceInfo(dataObj, this.deviceList)
|
||||
this.refreshDevicesWindow()
|
||||
this.checkStiStatus()
|
||||
chartData.defaultChartGenerator(this.deviceList, taskInfo.getDeviceIDByRaw(dataObj.data.device_id), null, 'device')
|
||||
},
|
||||
async '+/device_parameter/+' (data, topic) {
|
||||
await taskInfo.deviceParameter(String.fromCharCode.apply(null, data))
|
||||
@@ -265,12 +270,17 @@ export default {
|
||||
this.showShutdownModal = true
|
||||
break
|
||||
case 'start':
|
||||
if (!taskInfo.getDeviceInfoByRawID(parseInt(parseInt(mes[1]))).info.isSync) {
|
||||
taskInfo.deviceStart(parseInt(mes[1]), this.deviceList)
|
||||
if (chartData.defaultChartGenerator(this.deviceList, taskInfo.getDeviceIDByRaw(parseInt(parseInt(mes[1]))), null, 'device')) {
|
||||
taskInfo.deviceStart(parseInt(parseInt(mes[1])), this.deviceList)
|
||||
}
|
||||
}
|
||||
taskInfo.deviceStart(parseInt(mes[1]), this.deviceList)
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'get_device_info/0',
|
||||
device: parseInt(mes[1]),
|
||||
}))
|
||||
// if (!taskInfo.getDeviceInfoByRawID(parseInt(parseInt(mes[1]))).info.isSync) {
|
||||
// taskInfo.deviceStart(parseInt(mes[1]), this.deviceList)
|
||||
// if (chartData.defaultChartGenerator(this.deviceList, taskInfo.getDeviceIDByRaw(parseInt(parseInt(mes[1]))), null, 'device')) {
|
||||
// taskInfo.deviceStart(parseInt(parseInt(mes[1])), this.deviceList)
|
||||
// }
|
||||
// }
|
||||
break
|
||||
case 'stop':
|
||||
if (mes[1] === 'all') {
|
||||
@@ -602,6 +612,11 @@ export default {
|
||||
watch: {
|
||||
},
|
||||
async mounted () {
|
||||
const devMode = this.$route.params.mode
|
||||
if (devMode === 'dev') {
|
||||
this.developer_mode = true
|
||||
}
|
||||
|
||||
await taskInfo.updateTaskInfo(this.$route.params.taskID)
|
||||
// console.log(taskInfo.getTaskInfo())
|
||||
// this.screenHeight = document.documentElement.clientHeight
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="row flex ma-0 pa-0">
|
||||
<div class="row flex ma-0 pa-0" v-if="developer_mode === true">
|
||||
<canvas-chart-filter :chartID="chartID" :filterIndex="0" />
|
||||
<canvas-chart-filter :chartID="chartID" :filterIndex="1" />
|
||||
<canvas-chart-filter :chartID="chartID" :filterIndex="2" />
|
||||
@@ -110,6 +110,7 @@ import CanvasChartFilterPopup from './CanvasChartFilterPopup.vue'
|
||||
import CanvasChartSource from './CanvasChartSource'
|
||||
import { taskInfo } from '../../../../data/task/TaskInfo'
|
||||
import { chartData } from '../../../../data/task/ChartsManagement'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'CanvasChart',
|
||||
@@ -141,6 +142,11 @@ export default {
|
||||
},
|
||||
created () {
|
||||
},
|
||||
computed: {
|
||||
...mapFields('', [
|
||||
'developer_mode',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// chartData: InitChartsData(this.chartID, 2000, 1, 1),
|
||||
@@ -158,8 +164,6 @@ export default {
|
||||
yIntervalInput: 'auto',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
// }
|
||||
// // console.log(this.deviceOptions)
|
||||
for (let i = 0; i <= 11; i++) {
|
||||
if (taskInfo.getDeviceInfoByRawID(i).info.device_status >= 1) {
|
||||
if (taskInfo.getDeviceInfoByRawID(i).info.device_status >= 0) {
|
||||
const index = this.deviceList.findIndex(d => taskInfo.getRawDeviceID(d.id) === i)
|
||||
if (index < 0) {
|
||||
await this.addDevice(i)
|
||||
@@ -193,6 +193,8 @@ export default {
|
||||
}
|
||||
// device.stopping = false
|
||||
device.isSync = true
|
||||
device.device_status = 1
|
||||
taskInfo.getDeviceInfo(device.id).info.device_status = 1
|
||||
this.$emit('refreshSetting')
|
||||
// ### show device info
|
||||
api.task.update({
|
||||
@@ -230,6 +232,8 @@ export default {
|
||||
}))
|
||||
}
|
||||
// device.stopping = true
|
||||
device.device_status = 0
|
||||
taskInfo.getDeviceInfo(device.id).info.device_status = 0
|
||||
}
|
||||
},
|
||||
detectDevice: function (device) {
|
||||
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
this.state.LOADING = false
|
||||
// console.log(this.deviceOptions)
|
||||
for (let i = 0; i <= 11; i++) {
|
||||
if (taskInfo.getDeviceInfoByRawID(i).info.status === 'connected') {
|
||||
if (taskInfo.getDeviceInfoByRawID(i).iinfo.device_status >= 0) {
|
||||
const index = this.deviceList.findIndex(d => taskInfo.getRawDeviceID(d.id) === i)
|
||||
if (index < 0) {
|
||||
await this.addDevice(i)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<va-tree-root class="flex sm12 xl12 md12 xs12 px-0 mx-0 my-0 py-0">
|
||||
<div class="flex sm12 xl12 md12 xs12 px-0 mx-0 my-0 py-0">
|
||||
<div class="flex row">
|
||||
<div class="flex sm11 xl11 md11 xs11 px-0 mx-0 my-0 py-0">
|
||||
<div class="flex sm10 xl10 md10 xs10 px-0 mx-0 my-0 py-0">
|
||||
<va-select
|
||||
@input="workingModeSelectChange(workingModeSelect)"
|
||||
:label="'WORKING MODE'"
|
||||
@@ -11,10 +11,10 @@
|
||||
textBy="description"
|
||||
:options="workingModeOptions"
|
||||
noClear
|
||||
style="width: 300px;"
|
||||
style="min-width: 50px;"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex sm1 xl1 md1 xs1 px-0 mx-0 my-0 py-0">
|
||||
<div class="flex sm2 xl2 md2 xs2 px-0 mx-0 my-0 py-0 pl-2">
|
||||
<va-button class="pa-0 ma-0 mt-2 circle-button" small color="dark" @click="showModal=true">
|
||||
<va-icon
|
||||
name="fa fa-info"
|
||||
@@ -23,7 +23,7 @@
|
||||
</va-button>
|
||||
</div>
|
||||
</div>
|
||||
<va-button
|
||||
<!-- <va-button
|
||||
v-if="!measureEocButton.status && workingModeSelect != null && (workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9)"
|
||||
color="primary"
|
||||
target="_blank"
|
||||
@@ -38,36 +38,10 @@
|
||||
@click="measureEocStop()"
|
||||
small>
|
||||
{{measureEocButton.stop}}
|
||||
</va-button>
|
||||
</va-button> -->
|
||||
</div>
|
||||
|
||||
<!-- 1.5ui -->
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Range ( ' + currentRangeOptions[currentRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'currentRangeSelect'" :deviceID="deviceID" :options="currentRangeOptions" :parameterName="'ADC_LEVEL_I_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Range ( ' + voltageInRangeOptions[voltageInRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'voltageInRangeSelect'" :deviceID="deviceID" :options="voltageInRangeOptions" :parameterName="'ADC_LEVEL_V_IN_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 10"
|
||||
style="font-size: 20px;"
|
||||
:label="'HighZ ( ' + highzOptions[highzSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'highzSelect'" :deviceID="deviceID" :options="highzOptions" :parameterName="'CTRL_HIGH_Z_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 11"
|
||||
@@ -133,16 +107,7 @@
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Sample rate ( ' + sampleRateNumber/10 + 'sps )'">
|
||||
<va-tree-node>
|
||||
<resolution-range :ref="'sampleRateNumber'" :deviceID="deviceID" :parameterName="'SAMPLE_RATE'" :minValue="0.1" :maxValue="100" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6 || workingModeSelect.id == 16"
|
||||
style="font-size: 20px;"
|
||||
:label="'Charge ( ' + chargeOptions[chargeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
@@ -151,7 +116,7 @@
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6 || workingModeSelect.id == 16"
|
||||
style="font-size: 20px;"
|
||||
:label="'Current ( ' + parseFloat(currentNumber / 100) + 'μA )'">
|
||||
<va-tree-node>
|
||||
@@ -160,7 +125,16 @@
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 3 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 16 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Sample rate ( ' + sampleRateNumber/10 + 'sps )'">
|
||||
<va-tree-node>
|
||||
<resolution-range :ref="'sampleRateNumber'" :deviceID="deviceID" :parameterName="'SAMPLE_RATE'" :minValue="0.1" :maxValue="100" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6 || workingModeSelect.id == 16"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt max stop ( ' + stopVoltMaxNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
@@ -169,7 +143,7 @@
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6"
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 6 || workingModeSelect.id == 16"
|
||||
style="font-size: 20px;"
|
||||
:label="'Volt min stop ( ' + stopVoltMinNumber/1000 + 'V )'">
|
||||
<va-tree-node>
|
||||
@@ -376,6 +350,42 @@
|
||||
<div v-if="workingModeSelect != null && workingModeSelect.id == 15">
|
||||
<elite-parameter-recording-elite-d-p-v :ref="'DPVMode'" :deviceID="deviceID" :deviceName="deviceName"/>
|
||||
</div>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 16 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Current range ( ' + currentRangeOptions[currentRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'currentRangeSelect'" :deviceID="deviceID" :options="currentRangeOptions" :parameterName="'ADC_LEVEL_I_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5 || workingModeSelect.id == 6 || workingModeSelect.id == 16 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 11 || workingModeSelect.id == 13"
|
||||
style="font-size: 20px;"
|
||||
:label="'Voltage range ( ' + voltageInRangeOptions[voltageInRangeSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'voltageInRangeSelect'" :deviceID="deviceID" :options="voltageInRangeOptions" :parameterName="'ADC_LEVEL_V_IN_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 2 || workingModeSelect.id == 4 || workingModeSelect.id == 5"
|
||||
style="font-size: 20px;"
|
||||
:label="'HighZ ( ' + highzOptions[highzSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'highzSelect'" :deviceID="deviceID" :options="highzOptions" :parameterName="'CTRL_HIGH_Z_15'" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
|
||||
<va-tree-category
|
||||
v-if="workingModeSelect != null && workingModeSelect.id == 0 || workingModeSelect.id == 1 || workingModeSelect.id == 3 || workingModeSelect.id == 6 || workingModeSelect.id == 16 || workingModeSelect.id == 7 || workingModeSelect.id == 8 || workingModeSelect.id == 9 || workingModeSelect.id == 10"
|
||||
style="font-size: 20px;"
|
||||
:label="'HighZ ( ' + highzOptions[highzSelect].label + ' )'">
|
||||
<va-tree-node>
|
||||
<level-button :ref="'highzSelect'" :deviceID="deviceID" :options="highzOptions" :parameterName="'CTRL_HIGH_Z_15'" :disable="deviceStatus" @parameterChange="deviceParameterChange($event)" />
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
</va-tree-root>
|
||||
<div>
|
||||
<vue-final-modal
|
||||
@@ -414,6 +424,7 @@ import ResolutionRange from '../parameter/item/ResolutionRange'
|
||||
import EliteParameterRecordingElitePulseSensing from '../parameter/item/PulseSensing/EliteParameterRecordingElitePulseSensing'
|
||||
import EliteParameterRecordingEliteDPV from '../parameter/item/DPV/EliteParameterRecordingEliteDPV'
|
||||
import { VueFinalModal } from 'vue-final-modal'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'EliteParameterRecordingElitezm15',
|
||||
@@ -444,12 +455,12 @@ export default {
|
||||
getImageUrl () {
|
||||
return this.workingModeSelect.img_src
|
||||
},
|
||||
// getImageUrl () {
|
||||
// if (this.workingModeSelect.img_src !== 'IV-Wire' && this.workingModeSelect.img_src !== 'FG-Wire') {
|
||||
// return this.workingModeOptions[0].img_src
|
||||
// }
|
||||
// return this.workingModeSelect.img_src
|
||||
// },
|
||||
deviceStatus () {
|
||||
return taskInfo.getDeviceInfo(this.deviceID).info.device_status === 0
|
||||
},
|
||||
...mapFields('', [
|
||||
'developer_mode',
|
||||
]),
|
||||
},
|
||||
created () {
|
||||
},
|
||||
@@ -461,56 +472,95 @@ export default {
|
||||
description: 'Init',
|
||||
img_src: 'IV-Wire',
|
||||
},
|
||||
workingModeOptions: [
|
||||
workingModeDevOptions: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'I-V Curve',
|
||||
img_src: 'IV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'Cycle I-V',
|
||||
img_src: 'CIV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Function Generator',
|
||||
img_src: 'FG-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'R-T Graph',
|
||||
img_src: 'RT-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'V-T Graph',
|
||||
img_src: 'VT-Wire',
|
||||
highz: 0,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'I-T Graph',
|
||||
img_src: 'IT-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
description: 'Constant Current',
|
||||
img_src: 'CC-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
description: 'Open Circuit Potential',
|
||||
img_src: 'OCP-Wire',
|
||||
highz: 0,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
description: 'Cyclic Voltammetry',
|
||||
img_src: 'CV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
description: 'Linear Sweep Voltammetry',
|
||||
img_src: 'LSV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
description: 'Chronoamperometric Graph',
|
||||
description: 'Chronoamperometric',
|
||||
img_src: 'CG-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
description: 'Chronopotentiometry',
|
||||
img_src: 'CC-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
description: 'Pulse Sensing',
|
||||
img_src: 'PS-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
description: 'Differential Pulse Voltammetry (DPV)',
|
||||
img_src: 'DPV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
description: 'Dev Mode',
|
||||
img_src: 'DevM-Wire',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
@@ -522,27 +572,99 @@ export default {
|
||||
description: 'Cali ADC - test',
|
||||
img_src: 'CADC-Wire',
|
||||
},
|
||||
],
|
||||
workingModeNoDevOptions: [
|
||||
{
|
||||
id: 12,
|
||||
description: 'Dev Mode',
|
||||
img_src: 'DevM-Wire',
|
||||
id: 0,
|
||||
description: 'I-V Curve',
|
||||
img_src: 'IV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'Cycle I-V',
|
||||
img_src: 'CIV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Function Generator',
|
||||
img_src: 'FG-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'R-T Graph',
|
||||
img_src: 'RT-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'V-T Graph',
|
||||
img_src: 'VT-Wire',
|
||||
highz: 0,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'I-T Graph',
|
||||
img_src: 'IT-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
description: 'Constant Current',
|
||||
img_src: 'CC-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
description: 'Open Circuit Potential',
|
||||
img_src: 'OCP-Wire',
|
||||
highz: 0,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
description: 'Cyclic Voltammetry',
|
||||
img_src: 'CV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
description: 'Linear Sweep Voltammetry',
|
||||
img_src: 'LSV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
description: 'Chronoamperometric',
|
||||
img_src: 'CG-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
description: 'Chronopotentiometry',
|
||||
img_src: 'CC-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
description: 'Pulse Sensing',
|
||||
img_src: 'PS-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
description: 'Differential Pulse Voltammetry (DPV)',
|
||||
img_src: 'DPV-Wire',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
description: 'Dev Mode',
|
||||
img_src: 'DevM-Wire',
|
||||
},
|
||||
],
|
||||
workingModeOptions: [],
|
||||
currentRangeSelect: null,
|
||||
currentRangeOptions: [
|
||||
{
|
||||
@@ -699,7 +821,14 @@ export default {
|
||||
}))
|
||||
},
|
||||
refresh () {
|
||||
this.workingModeSelect = this.workingModeOptions[taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE]
|
||||
this.workingModeSelect = this.workingModeOptions.find((ele) => ele.id === taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE)
|
||||
if (!this.workingModeSelect) {
|
||||
this.workingModeSelect = {
|
||||
id: -1,
|
||||
description: 'Init',
|
||||
img_src: 'IV-Wire',
|
||||
}
|
||||
}
|
||||
if (this.workingModeSelect != null) {
|
||||
this.workingModeSelectChange(this.workingModeSelect)
|
||||
}
|
||||
@@ -838,6 +967,11 @@ export default {
|
||||
|
||||
if (this.workingModeSelect.id !== taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE) {
|
||||
this.deviceParameterChange(['MODE', this.workingModeSelect.id])
|
||||
|
||||
// if device is idle, then setting highz when mode switch
|
||||
if (this.deviceStatus === true) {
|
||||
this.deviceParameterChange(['CTRL_HIGH_Z_15', this.workingModeSelect.highz])
|
||||
}
|
||||
// console.log(this.workingModeSelect.id, this.workingModeSelect.description)
|
||||
}
|
||||
},
|
||||
@@ -939,6 +1073,10 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.developer_mode === true
|
||||
? this.workingModeOptions = this.workingModeDevOptions
|
||||
: this.workingModeOptions = this.workingModeNoDevOptions
|
||||
|
||||
this.refresh()
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
outline
|
||||
v-model="levelButtonSelect"
|
||||
:options="options"
|
||||
:disabled="disable"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,6 +34,10 @@ export default {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
disable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@ import mini from './mini'
|
||||
import analysis from './analysis'
|
||||
import sdcard from './sdcard'
|
||||
import connection from './connection'
|
||||
import project from './project'
|
||||
|
||||
// axios.defaults.baseURL = 'http://192.168.3.211:3000'
|
||||
axios.defaults.baseURL = 'http://' + location.href.split('/')[2].split(':')[0] + ':3000'
|
||||
@@ -27,6 +28,7 @@ const api = {
|
||||
analysis,
|
||||
sdcard,
|
||||
connection,
|
||||
project,
|
||||
}
|
||||
|
||||
export default api
|
||||
|
||||
@@ -52,6 +52,16 @@ async function getByParent (type, parent) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getAttrByParent (type, parent, attr) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/file/meta/get_attr_by_parent/${type}/${parent}/${attr}`, { responseType: 'json', headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getByID (id) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
@@ -77,6 +87,7 @@ const meta = {
|
||||
update,
|
||||
clearDel,
|
||||
getByParent,
|
||||
getAttrByParent,
|
||||
getByParentWithLimit,
|
||||
getByID,
|
||||
getByName,
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import api from './index'
|
||||
import auth from './auth'
|
||||
|
||||
async function create (attrs) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.post('/api/project/create', attrs, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function update (id, attrs) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.post(`/api/project/update/${id}`, attrs, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function del (id) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/project/clear_deleted/${id}`, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getByID (id) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/project/get_by_id/${id}`, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getByName (name) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/project/get_by_name/${name}`, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getByMac (mac) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/project/get_by_mac/${mac}`, { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getAll () {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get('/api/project/get/all', { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const project = {
|
||||
create,
|
||||
update,
|
||||
del,
|
||||
getByID,
|
||||
getByMac,
|
||||
getByName,
|
||||
getAll,
|
||||
}
|
||||
|
||||
export default project
|
||||
@@ -41,6 +41,7 @@ const getDefaultChartTypeByMode = (mode, lib) => {
|
||||
settings[13] = ['Time', 2, 'Elite', 2]
|
||||
settings[14] = ['Time', 2, 'Elite', 2]
|
||||
settings[15] = ['Elite', 2, 'Elite', 1]
|
||||
settings[16] = ['Time', 2, 'Elite', 2]
|
||||
return settings[mode]
|
||||
} else if (lib === 'EliteEIS') {
|
||||
const settings = {}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
export default {
|
||||
name: 'Chronoamperometric Graph',
|
||||
name: 'Chronoamperometric',
|
||||
parameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'VOLT_VSCAN', 'SAMPLE_RATE'], // 這個mode用到的參數
|
||||
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'VOLT_VSCAN', 'SAMPLE_RATE'], // 有要秀給user看的參數
|
||||
valScales: {
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Chronoamperometric Graph',
|
||||
name: 'Chronoamperometric',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
@@ -0,0 +1,93 @@
|
||||
export default {
|
||||
name: 'Chronopotentiometry',
|
||||
parameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN'], // 這個mode用到的參數
|
||||
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN'], // 有要秀給user看的參數
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
m: 60 * 1e6,
|
||||
h: 60 * 60 * 1e6,
|
||||
auto: 1,
|
||||
},
|
||||
defaultUnit: 'auto',
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
mA: 1e6,
|
||||
},
|
||||
defaultUnit: 'uA',
|
||||
},
|
||||
1: {
|
||||
name: 'V_in',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
V: 1e6,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
V: 1e6,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Chronopotentiometry',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
x1: {
|
||||
type: 'time',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
y1: {
|
||||
type: 'value',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
data: [
|
||||
{
|
||||
legend: 'CP',
|
||||
x1: {
|
||||
channel: 'time',
|
||||
},
|
||||
y1: {
|
||||
channel: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -7,7 +7,8 @@ import IT from './IT'
|
||||
import ConstantCurrent from './ConstantCurrent'
|
||||
import CyclicVoltammetry from './CyclicVoltammetry'
|
||||
import LinearSweep from './LinearSweep'
|
||||
import ChronoamperometricGraph from './ChronoamperometricGraph'
|
||||
import Chronoamperometric from './Chronoamperometric'
|
||||
import Chronopotentiometry from './Chronopotentiometry'
|
||||
import CaliDAC from './CaliDAC'
|
||||
import CaliADC from './CaliADC'
|
||||
import DevMode from './DevMode'
|
||||
@@ -751,14 +752,14 @@ const EliteZM15 = {
|
||||
6: ConstantCurrent,
|
||||
7: CyclicVoltammetry,
|
||||
8: LinearSweep,
|
||||
9: ChronoamperometricGraph,
|
||||
9: Chronoamperometric,
|
||||
10: CaliDAC,
|
||||
11: CaliADC,
|
||||
12: DevMode,
|
||||
13: OCP,
|
||||
14: PulseSensing,
|
||||
// 'Differential Pulse Voltammetry (DPV)'
|
||||
|
||||
16: Chronopotentiometry,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function makeXAxis (gridIndex, type, channel) {
|
||||
show: true,
|
||||
showMinLabel: false,
|
||||
showMaxLabel: false,
|
||||
color: '#aaa',
|
||||
color: '#34495e',
|
||||
// rotate: 45,
|
||||
margin: 12,
|
||||
},
|
||||
@@ -71,7 +71,7 @@ function makeYAxis (gridIndex, type, channel) {
|
||||
axisLine: { show: false }, // color: '#ccc' } },
|
||||
axisLabel: {
|
||||
show: true,
|
||||
color: '#aaa',
|
||||
color: '#34495e',
|
||||
showMinLabel: false,
|
||||
showMaxLabel: false,
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ const updateAllList = async () => {
|
||||
name: 'Time',
|
||||
})
|
||||
for (const device in _taskInfo.deviceList) {
|
||||
if (_taskInfo.deviceList[parseInt(device)].info.status === 'connected') {
|
||||
if (_taskInfo.deviceList[parseInt(device)].info.device_status >= 0) {
|
||||
let _deviceListNotRegisterAdd = true
|
||||
_taskInfo.deviceAddrList.forEach(addr => {
|
||||
if (addr.toString() === _taskInfo.deviceList[parseInt(device)].info.device_address.toString()) {
|
||||
@@ -140,7 +140,7 @@ export const taskInfo = {
|
||||
},
|
||||
|
||||
deviceInfo: async (mes, deviceListState) => {
|
||||
const mesObj = JSON.parse(mes)
|
||||
const mesObj = typeof mes === 'string' ? JSON.parse(mes) : mes
|
||||
const update = async () => {
|
||||
try {
|
||||
if (Array.isArray(mesObj.data)) {
|
||||
@@ -267,9 +267,11 @@ export const taskInfo = {
|
||||
deviceStart: async (deviceID, deviceListState) => {
|
||||
const update = async () => {
|
||||
_taskInfo.deviceList[deviceID].info.isSync = true
|
||||
_taskInfo.deviceList[deviceID].info.device_status = 1
|
||||
deviceListState.forEach(device => {
|
||||
if (device.id === _taskInfo.taskDeviceID.indexOf(parseInt(deviceID))) {
|
||||
device.isSync = true
|
||||
device.device_status = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -280,9 +282,11 @@ export const taskInfo = {
|
||||
const update = async () => {
|
||||
await dataStreamBuffer.removeByDevice(taskInfo.getRawDeviceID(deviceID))
|
||||
_taskInfo.deviceList[deviceID].info.isSync = false
|
||||
_taskInfo.deviceList[deviceID].info.device_status = 0
|
||||
deviceListState.forEach(device => {
|
||||
if (device.id === _taskInfo.taskDeviceID.indexOf(parseInt(deviceID))) {
|
||||
device.isSync = false
|
||||
device.device_status = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,34 +8,41 @@ function newConditionTemplate (action) {
|
||||
suffix: '',
|
||||
value: '',
|
||||
},
|
||||
relative_time: {
|
||||
after_project_run: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'After',
|
||||
prefix: 'After project run',
|
||||
suffix: 'secs',
|
||||
value: '',
|
||||
},
|
||||
task: {
|
||||
after_task_run: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'Task',
|
||||
suffix: 'done',
|
||||
prefix: 'After task run',
|
||||
suffix: 'secs',
|
||||
value: '',
|
||||
},
|
||||
device: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'Device',
|
||||
suffix: 'done',
|
||||
value: '',
|
||||
},
|
||||
mode: {
|
||||
previous_task_done: {
|
||||
select: false,
|
||||
type: 'hidden',
|
||||
prefix: 'Mode',
|
||||
suffix: 'complete',
|
||||
prefix: 'When previous task done',
|
||||
suffix: 'done',
|
||||
value: '',
|
||||
},
|
||||
// device: {
|
||||
// select: false,
|
||||
// type: 'text',
|
||||
// prefix: 'Device',
|
||||
// suffix: 'done',
|
||||
// value: '',
|
||||
// },
|
||||
// mode: {
|
||||
// select: false,
|
||||
// type: 'hidden',
|
||||
// prefix: 'Mode',
|
||||
// suffix: 'complete',
|
||||
// value: '',
|
||||
// },
|
||||
},
|
||||
stop: {
|
||||
absolute_time: {
|
||||
@@ -45,34 +52,41 @@ function newConditionTemplate (action) {
|
||||
suffix: '',
|
||||
value: '',
|
||||
},
|
||||
relative_time: {
|
||||
after_project_run: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'After',
|
||||
prefix: 'After project run',
|
||||
suffix: 'secs',
|
||||
value: '',
|
||||
},
|
||||
task: {
|
||||
after_task_run: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'Task',
|
||||
suffix: 'done',
|
||||
value: '',
|
||||
},
|
||||
device: {
|
||||
select: false,
|
||||
type: 'text',
|
||||
prefix: 'Device',
|
||||
suffix: 'done',
|
||||
value: '',
|
||||
},
|
||||
mode: {
|
||||
select: false,
|
||||
type: 'hidden',
|
||||
prefix: 'Mode',
|
||||
suffix: 'complete',
|
||||
prefix: 'After task run',
|
||||
suffix: 'secs',
|
||||
value: '',
|
||||
},
|
||||
// task: {
|
||||
// select: false,
|
||||
// type: 'hidden',
|
||||
// prefix: 'When previous task done',
|
||||
// suffix: 'done',
|
||||
// value: '',
|
||||
// },
|
||||
// device: {
|
||||
// select: false,
|
||||
// type: 'hidden',
|
||||
// prefix: 'Device',
|
||||
// suffix: 'done',
|
||||
// value: '',
|
||||
// },
|
||||
// mode: {
|
||||
// select: false,
|
||||
// type: 'hidden',
|
||||
// prefix: 'Mode',
|
||||
// suffix: 'complete',
|
||||
// value: '',
|
||||
// },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,91 @@
|
||||
function newEliteZm15Parameter (workingMode) {
|
||||
function newEliteZm15Parameter () {
|
||||
return {
|
||||
ADC_LEVEL_I_15: {
|
||||
alias: 'currentRange',
|
||||
MODE: {
|
||||
alias: 'Mode',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'I-V Curve',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'Cycle I-V',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Function Generator',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'R-T Graph',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'V-T Graph',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'I-T Graph',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
description: 'Constant Current',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
description: 'Cyclic Voltammetry',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
description: 'Linear Sweep Voltammetry',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
description: 'Chronoamperometric Graph',
|
||||
},
|
||||
// {
|
||||
// id: 10,
|
||||
// description: 'Cali DAC - test',
|
||||
// },
|
||||
// {
|
||||
// id: 11,
|
||||
// description: 'Cali ADC - test',
|
||||
// },
|
||||
// {
|
||||
// id: 12,
|
||||
// description: 'Dev Mode',
|
||||
// },
|
||||
// {
|
||||
// id: 13,
|
||||
// description: 'Open Circuit Potential',
|
||||
// },
|
||||
// {
|
||||
// id: 14,
|
||||
// description: 'Pulse Sensing',
|
||||
// },
|
||||
// {
|
||||
// id: 15,
|
||||
// description: 'Differential Pulse Voltammetry (DPV)',
|
||||
// },
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].description },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
unit: [],
|
||||
},
|
||||
ADC_LEVEL_I_15: {
|
||||
alias: 'current range',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
@@ -26,29 +108,383 @@ function newEliteZm15Parameter (workingMode) {
|
||||
label: 'Auto',
|
||||
},
|
||||
],
|
||||
value: 0,
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
unit: [],
|
||||
},
|
||||
ADC_LEVEL_V_IN_15: {
|
||||
alias: 'voltageInRange',
|
||||
alias: 'voltage in range',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
label: '<7 mV',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '5-300 mV',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '>250 mV',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: 'Auto',
|
||||
},
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
unit: [],
|
||||
},
|
||||
CTRL_HIGH_Z_15: {
|
||||
alias: 'highz',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
label: 'On',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: 'Off',
|
||||
},
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
unit: [],
|
||||
},
|
||||
ADC_DAC_CHANNEL_15: {
|
||||
alias: 'cali channel',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
label: 'Iin',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: 'Vin',
|
||||
},
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
unit: [],
|
||||
},
|
||||
DAC_VOLT: {
|
||||
alias: 'output volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_ORIGIN: {
|
||||
alias: 'start volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_FINAL: {
|
||||
alias: 'stop volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_STEP: {
|
||||
alias: 'step volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return input / 10 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['mV'],
|
||||
},
|
||||
STEP_TIME: {
|
||||
alias: 'step time',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
label: '0.5s',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '1.0s',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '2.0s',
|
||||
},
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: [],
|
||||
},
|
||||
SAMPLE_RATE: {
|
||||
alias: 'sample rate',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return input / 10 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['sps'],
|
||||
},
|
||||
Charge: {
|
||||
alias: 'charge',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [
|
||||
{
|
||||
value: 0,
|
||||
label: 'Charge',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: 'Discharge',
|
||||
},
|
||||
],
|
||||
transFormula: function (input) { return this.option[input].label },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: [],
|
||||
},
|
||||
Const_Current_value: {
|
||||
alias: 'current',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return input },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['uA'],
|
||||
},
|
||||
VOLTSTOP_MAX: {
|
||||
alias: 'max stop volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLTSTOP_MIN: {
|
||||
alias: 'min stop volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_INITIAL: {
|
||||
alias: 'initial volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_MAX: {
|
||||
alias: 'max volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_MIN: {
|
||||
alias: 'min volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_EFINAL: {
|
||||
alias: 'efinal volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
VOLT_VSCAN: {
|
||||
alias: 'vscan volt',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return (input - 25000) / 5 / 1000 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['V'],
|
||||
},
|
||||
Scan_Rate: {
|
||||
alias: 'scan rate',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return input / 100 },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: ['mV/s'],
|
||||
},
|
||||
CYCLE_NUMBER: {
|
||||
alias: 'cycle',
|
||||
label: 'Range',
|
||||
type: 'select',
|
||||
default: 0,
|
||||
mode: [],
|
||||
order: [],
|
||||
option: [],
|
||||
transFormula: function (input) { return input },
|
||||
reverseFormula: function (input) { return input },
|
||||
change: function (input) { return input },
|
||||
update: function (input) { return input },
|
||||
min: '-5',
|
||||
max: '5',
|
||||
unit: [],
|
||||
},
|
||||
ADC_DAC_CHANNEL_15: 'caliChannelSelect',
|
||||
DAC_VOLT: 'caliVoltNumber',
|
||||
VOLT_ORIGIN: 'startVoltNumber',
|
||||
VOLT_FINAL: 'stopVoltNumber',
|
||||
VOLT_STEP: 'stepVoltNumber',
|
||||
STEP_TIME: 'stepTimeSelect',
|
||||
SAMPLE_RATE: 'sampleRateNumber',
|
||||
Charge: 'chargeSelect',
|
||||
Const_Current_value: 'currentNumber',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
function newProject (name) {
|
||||
function newProject (name, uuid) {
|
||||
return {
|
||||
id: -1,
|
||||
name: name,
|
||||
desc: '',
|
||||
taskList: [],
|
||||
deviceList: [],
|
||||
task: [],
|
||||
device: [],
|
||||
uuid: uuid,
|
||||
select: false,
|
||||
status: -1,
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ function newTask (name, uuid) {
|
||||
next: [],
|
||||
type: '',
|
||||
desc: '',
|
||||
deviceList: [],
|
||||
device: [],
|
||||
action: {},
|
||||
parameterSet: {},
|
||||
parameter_set: {},
|
||||
condition: {},
|
||||
select: false,
|
||||
status: -1,
|
||||
|
||||
@@ -20,6 +20,7 @@ function newState () {
|
||||
},
|
||||
isLoading: true,
|
||||
licenseCheck: true,
|
||||
developer_mode: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -88,7 +88,7 @@ export default new Router({
|
||||
},
|
||||
{
|
||||
name: 'Admin',
|
||||
path: '/admin',
|
||||
path: '/admin/:mode?',
|
||||
component: AppLayout,
|
||||
children: [
|
||||
{
|
||||
|
||||
@@ -33,3 +33,18 @@ $icon-font-path: './../fonts/';
|
||||
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.ttf'), '#{$icon-font-path}#{$icon-font-name}.ttf')) format('truetype'),
|
||||
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.svg##{$icon-font-svg-id}'), '#{$icon-font-path}#{$icon-font-name}.svg##{$icon-font-svg-id}')) format('svg');
|
||||
}
|
||||
|
||||
// @font-face {
|
||||
// font-family: 'ArialMT';
|
||||
// src: url('~@/fonts/ArialMT/arialmt.ttf') format('truetype');
|
||||
// }
|
||||
|
||||
// @font-face {
|
||||
// font-family: 'Arial-BoldMT';
|
||||
// src: url('~@/fonts/roboto/Roboto-Thin.ttf') format('truetype');
|
||||
// }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
src: url('~@/fonts/roboto/Roboto-Bold.ttf') format('truetype');
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ function makeXAxis (gridIndex, type) {
|
||||
show: false,
|
||||
showMinLabel: true,
|
||||
showMaxLabel: true,
|
||||
color: '#aaa',
|
||||
color: '#34495e',
|
||||
},
|
||||
splitLine: { show: true, lineStyle: { color: '#eee' } },
|
||||
splitNumber: 5,
|
||||
@@ -38,7 +38,7 @@ function makeYAxis (gridIndex, type) {
|
||||
gridIndex: gridIndex,
|
||||
axisTick: { show: false },
|
||||
axisLine: { show: false }, // color: '#ccc' } },
|
||||
axisLabel: { show: true, color: '#aaa', showMinLabel: true, showMaxLabel: true },
|
||||
axisLabel: { show: true, color: '#34495e', showMinLabel: true, showMaxLabel: true },
|
||||
splitLine: { show: true, lineStyle: { color: '#eee' } },
|
||||
splitNumber: 1,
|
||||
minorSplitLine: {
|
||||
@@ -58,7 +58,7 @@ function makeXAxisOverview (gridIndex, type) {
|
||||
gridIndex: gridIndex,
|
||||
axisLine: { show: false, onZero: false, lineStyle: { color: '#aaa' } },
|
||||
axisTick: { show: false },
|
||||
axisLabel: { show: false, showMinLabel: false, showMaxLabel: false, color: '#aaa' },
|
||||
axisLabel: { show: false, showMinLabel: false, showMaxLabel: false, color: '#34495e' },
|
||||
splitLine: { show: false, lineStyle: { color: '#eee' } },
|
||||
scale: true,
|
||||
min: null,
|
||||
@@ -73,7 +73,7 @@ function makeYAxisOverview (gridIndex, type) {
|
||||
gridIndex: gridIndex,
|
||||
axisTick: { show: false },
|
||||
axisLine: { show: false }, // color: '#ccc' } },
|
||||
axisLabel: { show: false, color: '#aaa', showMinLabel: false, showMaxLabel: false },
|
||||
axisLabel: { show: false, color: '#34495e', showMinLabel: false, showMaxLabel: false },
|
||||
splitLine: { show: false, lineStyle: { color: '#eee' } },
|
||||
animation: false,
|
||||
scale: true,
|
||||
|
||||
@@ -1,8 +1,24 @@
|
||||
import types from '@/store/modules/project/types'
|
||||
import newProject from '@/factories/project/projectFactory'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
const typePath = types.project
|
||||
|
||||
function findUniqueName (name, array, attribute, separated) {
|
||||
const splitName = name.split('-')
|
||||
const _name = splitName.slice(0, -1).join('')
|
||||
const _count = splitName.slice(splitName.length - 1).join('')
|
||||
for (const item of array) {
|
||||
const splitItemName = item[attribute].split('-')
|
||||
const itemName = splitItemName.slice(0, -1).join('')
|
||||
const itemCount = splitItemName.slice(splitItemName.length - 1).join('')
|
||||
if (itemName === _name && itemCount === _count) {
|
||||
return findUniqueName(_name + '-' + String(parseInt(_count) + 1), array, attribute, separated)
|
||||
}
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
const projectActs = {
|
||||
/**
|
||||
* init project
|
||||
@@ -17,8 +33,30 @@ const projectActs = {
|
||||
* @param {}
|
||||
*/
|
||||
[typePath.create]: async ({ state, getters, commit }, payload) => {
|
||||
const project = newProject(`Project${state.projectList.length + 1}`)
|
||||
state.projectList.push(project)
|
||||
// get unique name
|
||||
const name = findUniqueName(`Project-${state.projectList.length + 1}`, state.projectList, 'name', '-')
|
||||
const project = newProject(name, uuidv4())
|
||||
// create new project
|
||||
const response = await payload.api.project.create(project)
|
||||
// align project id with column id
|
||||
project.id = response.data.id
|
||||
|
||||
state.projectConfigList.push(project)
|
||||
},
|
||||
|
||||
/**
|
||||
* update project
|
||||
*
|
||||
* @param {}
|
||||
*/
|
||||
[typePath.update]: async ({ state, getters, commit }, payload) => {
|
||||
try {
|
||||
await payload.api.project.update(payload.project.id, payload.project)
|
||||
} catch (e) {
|
||||
console.log('update error', e)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -36,7 +74,11 @@ const projectActs = {
|
||||
* @param {number} index
|
||||
*/
|
||||
[typePath.delete]: async ({ state, getters, commit }, payload) => {
|
||||
state.projectList.splice(payload.index, 1)
|
||||
const { project, index, api } = payload
|
||||
await api.project.update(project.id, { deleted: true })
|
||||
await api.project.del()
|
||||
state.projectList.splice(index, 1)
|
||||
return true
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -46,7 +88,7 @@ const projectActs = {
|
||||
*/
|
||||
[typePath.addDevice]: async ({ state, getters, commit }, payload) => {
|
||||
const { device } = payload
|
||||
getters.getSelectProject.deviceList.push(device)
|
||||
getters.getSelectProject.device.push(device)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -56,7 +98,7 @@ const projectActs = {
|
||||
*/
|
||||
[typePath.findDevice]: ({ state, getters, commit }, payload) => {
|
||||
const { device } = payload
|
||||
const deviceList = getters.getSelectProject.deviceList
|
||||
const deviceList = getters.getSelectProject.device
|
||||
return deviceList.findIndex((v) => v.uuid === device.uuid)
|
||||
},
|
||||
|
||||
@@ -68,7 +110,7 @@ const projectActs = {
|
||||
*/
|
||||
[typePath.setDevice]: async ({ state, getters, commit }, payload) => {
|
||||
const { device, index } = payload
|
||||
const deviceList = getters.getSelectProject.deviceList
|
||||
const deviceList = getters.getSelectProject.device
|
||||
deviceList[index] = device
|
||||
return true
|
||||
},
|
||||
@@ -80,7 +122,7 @@ const projectActs = {
|
||||
*/
|
||||
[typePath.deleteDevice]: async ({ state, getters, commit }, payload) => {
|
||||
const { deviceIndex } = payload
|
||||
getters.getSelectProject.deviceList.splice(deviceIndex, 1)
|
||||
getters.getSelectProject.device.splice(deviceIndex, 1)
|
||||
return true
|
||||
},
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@ const taskActs = {
|
||||
*/
|
||||
[typePath.create]: async ({ state, getters, commit }, payload) => {
|
||||
const selectProject = getters.getSelectProject
|
||||
const name = `${selectProject.name}-task${(selectProject.taskList.length + 1)}`
|
||||
const name = `task${(selectProject.task.length + 1)}`
|
||||
const uuid = uuidv4()
|
||||
const task = newTask(name, uuid)
|
||||
|
||||
const prevTask = getters.getTask(selectProject.taskList.length - 1)
|
||||
const prevTask = getters.getTask(selectProject.task.length - 1)
|
||||
prevTask && prevTask.next.push(uuid)
|
||||
|
||||
selectProject.taskList.push(task)
|
||||
selectProject.task.push(task)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ const taskActs = {
|
||||
*/
|
||||
[typePath.delete]: async ({ state, getters, commit }, payload) => {
|
||||
const selectProject = getters.getSelectProject
|
||||
selectProject.taskList.splice(payload.index, 1)
|
||||
selectProject.task.splice(payload.index, 1)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -84,15 +84,19 @@ const taskActs = {
|
||||
[typePath.setParameterSet]: async ({ state, getters, commit }, payload) => {
|
||||
const task = getters.getSelectTask
|
||||
|
||||
if (task.parameterSet[payload.parameterKey] === undefined) {
|
||||
task.parameterSet[payload.parameterKey] = {}
|
||||
if (task.parameter_set[payload.parameterKey] === undefined) {
|
||||
task.parameter_set[payload.parameterKey] = {}
|
||||
}
|
||||
|
||||
task.parameterSet[payload.parameterKey] = {
|
||||
...task.parameterSet[payload.parameterKey],
|
||||
if (task.parameter_set[payload.parameterKey].MODE && payload.parameterSet.MODE && task.parameter_set[payload.parameterKey].MODE !== payload.parameterSet.MODE) {
|
||||
task.parameter_set[payload.parameterKey] = {}
|
||||
}
|
||||
|
||||
task.parameter_set[payload.parameterKey] = {
|
||||
...task.parameter_set[payload.parameterKey],
|
||||
...payload.parameterSet,
|
||||
}
|
||||
task.parameterSet = Object.assign({}, task.parameterSet)
|
||||
task.parameter_set = Object.assign({}, task.parameter_set)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ const projectGets = {
|
||||
},
|
||||
|
||||
[typePath.getDevice]: (state) => (deviceKey) => {
|
||||
return state.projectList[state.projectSelectIndex].deviceList[deviceKey]
|
||||
return state.projectList[state.projectSelectIndex].device[deviceKey]
|
||||
},
|
||||
|
||||
[typePath.getAllDevice]: (state) => {
|
||||
return state.projectList[state.projectSelectIndex].deviceList
|
||||
return state.projectList[state.projectSelectIndex].device
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const taskGets = {
|
||||
* @return {object} : task
|
||||
*/
|
||||
[typePath.get]: (state) => (index) => {
|
||||
return state.projectList[state.projectSelectIndex].taskList[index]
|
||||
return state.projectList[state.projectSelectIndex].task[index]
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ const taskGets = {
|
||||
* @return {object} : task
|
||||
*/
|
||||
[typePath.getSelect]: (state) => {
|
||||
return state.projectList[state.projectSelectIndex].taskList[state.taskSelectKey]
|
||||
return state.projectList[state.projectSelectIndex].task[state.taskSelectKey]
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -40,9 +40,9 @@ const taskGets = {
|
||||
*/
|
||||
[typePath.getParameterSet]: (state, getters) => (taskIndex, deviceKey) => {
|
||||
const task = getters.getTask(taskIndex)
|
||||
for (const parameterKey in task.parameterSet) {
|
||||
if (task.parameterSet[parameterKey].target === deviceKey) {
|
||||
return { [parameterKey]: task.parameterSet[parameterKey] }
|
||||
for (const parameterKey in task.parameter_set) {
|
||||
if (task.parameter_set[parameterKey].target === deviceKey) {
|
||||
return { [parameterKey]: task.parameter_set[parameterKey] }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,6 +6,9 @@ function newState () {
|
||||
projectList: [],
|
||||
projectSelectIndex: -1,
|
||||
|
||||
runningProjectList: [],
|
||||
projectConfigList: [],
|
||||
|
||||
taskSelectKey: '',
|
||||
|
||||
deviceConnectList: [],
|
||||
@@ -19,6 +22,8 @@ function newState () {
|
||||
show: false,
|
||||
type: '',
|
||||
},
|
||||
|
||||
lockMode: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ const types = {
|
||||
project: {
|
||||
init: 'initProject',
|
||||
create: 'createProject',
|
||||
update: 'updateProject',
|
||||
delete: 'deleteProject',
|
||||
save: 'saveProject',
|
||||
select: 'selectProject',
|
||||
|
||||
Reference in New Issue
Block a user