Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52db5b818c | |||
| 507718e3a3 | |||
| 1c02ffb934 | |||
| 5d594eff06 | |||
| 29f7d23d38 | |||
| 4d032858a3 | |||
| 417c4010a9 | |||
| 6bf7edad0b |
@@ -25,12 +25,12 @@
|
||||
>
|
||||
<!-- *** icon -->
|
||||
<!-- <va-icon-vuestic /> -->
|
||||
<img src='@/assets/img/bps_logo.png'>
|
||||
<!-- <img src='@/assets/img/bps_logo.png'> -->
|
||||
</router-link>
|
||||
</div>
|
||||
<!-- <img style="height: 40px;" v-bind:src="'https://www.bioproweb.com/wp-content/uploads/2020/01/BPS-LOGO_60.png'"> -->
|
||||
<div class="app-navbar__center lg5 md4">
|
||||
<span
|
||||
<!-- <span
|
||||
class="app-navbar__text"
|
||||
:style="{color: this.$themes.gray}"
|
||||
>
|
||||
@@ -43,7 +43,7 @@
|
||||
>
|
||||
contact@bioproweb.com
|
||||
</a>
|
||||
</span>
|
||||
</span> -->
|
||||
</div>
|
||||
<app-navbar-actions
|
||||
class="app-navbar__actions md5 lg4"
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
{{ props.rowData.name }}
|
||||
</template>
|
||||
<template slot="parameter_set" slot-scope="props">
|
||||
{{ getWorkingMode(props.rowData) }}
|
||||
{{ getWorkingMode(props.rowData.device, props.rowData.parameter_set) }}
|
||||
</template>
|
||||
<template slot="created_at" slot-scope="props">
|
||||
{{transDate(props.rowData.created_at)}}
|
||||
@@ -629,10 +629,13 @@ export default {
|
||||
deleteFileDone: async function () {
|
||||
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
// rebuild table
|
||||
this.fileLists = this.fileLists.filter(file => file.name !== this.deleteInfo.name)
|
||||
await this.refreshPage()
|
||||
this.$refs.datatable_ref.currentPage = tmpCurrentPage
|
||||
this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
this.fileLists = this.fileLists.filter(file => {
|
||||
return file.id !== this.deleteInfo.metaID
|
||||
})
|
||||
// await this.refreshPage()
|
||||
await this.$refs.datatable_ref.inputPage(1)
|
||||
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
// this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
// this.loadingFiles = false
|
||||
this.showToast(`deleted ${this.deleteInfo.name}`, {
|
||||
position: 'bottom-right',
|
||||
@@ -676,7 +679,7 @@ export default {
|
||||
|
||||
// call getfolder api and update
|
||||
const folders = await api.collection.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')
|
||||
const files = await api.meta.getAttrByParent('folder', this.currentInfo.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
|
||||
file.updateFileList(folders)
|
||||
file.updateFileList(files)
|
||||
|
||||
@@ -703,8 +706,7 @@ export default {
|
||||
}
|
||||
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
await this.refreshPage()
|
||||
this.$refs.datatable_ref.currentPage = tmpCurrentPage
|
||||
this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
},
|
||||
downloadCsv: async function (meta) {
|
||||
const href = location.href.split('/')[2]
|
||||
@@ -774,11 +776,14 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
getWorkingMode: function (rowData) {
|
||||
getWorkingMode: function (device, parameterSet) {
|
||||
try {
|
||||
if (rowData.type === 'folder') return ''
|
||||
return configTable.getModeConfig(rowData.device.library_name, rowData.parameter_set.MODE).name
|
||||
} catch {
|
||||
if (parameterSet) {
|
||||
return configTable.getModeConfig(device.library_name, parameterSet.MODE).name
|
||||
}
|
||||
return ''
|
||||
} catch (e) {
|
||||
console.log('e', e)
|
||||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
@@ -204,7 +204,10 @@
|
||||
<template slot="popover">
|
||||
<div>
|
||||
<div v-for="(parameter) in parameterShow(parameterSet.MODE, deviceUUID)" :key="parameter + parameterSet.MODE">
|
||||
<p>
|
||||
<p v-if="getConfig(deviceUUID).includes('TRIG') === true">
|
||||
{{ parameterPair(parameter, parameterSet, deviceUUID) }}
|
||||
</p>
|
||||
<p v-else>
|
||||
{{ parameterName(parameter, deviceUUID) }} : {{ parameterValue(parameter, parameterSet[parameter], deviceUUID) }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -448,9 +451,44 @@ export default {
|
||||
parameterShow (mode, deviceKey) {
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) return config.MODE[mode].showParameter
|
||||
return config.MODE[mode].parameter
|
||||
}
|
||||
},
|
||||
parameterPair (name, valueSet, deviceKey) {
|
||||
let _name, _value
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) {
|
||||
if (name.includes('ACC_a_out')) {
|
||||
const accName = name + '_current'
|
||||
if (Boolean(valueSet[name]) === true) {
|
||||
_name = 'Channel' + String((parseInt(name.replace('ACC_a_out', '')) + 1))
|
||||
const scale = config[accName].unit[config[accName].defaultUnit]
|
||||
_value = `${config[accName].outputReadabilityData(valueSet[accName], scale)} ${config[accName].defaultUnit}`
|
||||
} else return ''
|
||||
} else if (name.includes('TRIG')) {
|
||||
if (Boolean(valueSet[name]) === true) {
|
||||
const optionTrigger = [
|
||||
'RISING',
|
||||
'FALLING',
|
||||
'BOTH',
|
||||
]
|
||||
const trigName = name.replace('en', '') + 'edge_type'
|
||||
_name = 'TRIG' + String((parseInt(name.replace('TRIG', '').replace('_en', '')) + 1))
|
||||
_value = optionTrigger[valueSet[trigName]]
|
||||
} else return ''
|
||||
} else if (name.includes('TIME_DURATION')) {
|
||||
if (valueSet.TIME_DURATION && parseInt(valueSet.TIME_DURATION) > 0) {
|
||||
const scale = config[name].unit[config[name].defaultUnit]
|
||||
_name = 'Timer'
|
||||
_value = `${config[name].outputReadabilityData(valueSet[name], scale)} ${config[name].defaultUnit}`
|
||||
} else return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
return _name + ': ' + _value
|
||||
},
|
||||
parameterName (name, deviceKey) {
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
@@ -498,6 +536,10 @@ export default {
|
||||
return cycleInfo[1]
|
||||
},
|
||||
|
||||
getConfig: function (deviceKey) {
|
||||
return this.getDeviceLibraryProject(deviceKey)
|
||||
},
|
||||
|
||||
handleMove (e) {
|
||||
const { index, futureIndex } = e.draggedContext
|
||||
this.index = index
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<va-item-section class="ml-3" caption>
|
||||
<!-- <va-button @click="getBattery(device)"> get battery </va-button> -->
|
||||
<!-- <pre> {{ device.battery }} </pre> -->
|
||||
<va-item-label v-if="device.library_name.includes('EIS')">
|
||||
<va-item-label v-if="device.library_name.includes('EIS') || device.library_name.includes('TRIG')">
|
||||
{{ `[${device.memory_board}]` }} {{ device.name }}
|
||||
</va-item-label>
|
||||
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) >= 75">
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- split because of styling problem(treenode), combine together furture -->
|
||||
<!-- Trigger -->
|
||||
<div v-if="library && library.includes('TRIG')">
|
||||
<Trigger :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></Trigger>
|
||||
</div>
|
||||
<!-- EIS -->
|
||||
<div v-if="library && library.includes('EIS')">
|
||||
<component
|
||||
@@ -124,6 +128,7 @@ import InputField from '../parameter/itemNew/InputField'
|
||||
import MultiInputField from '../parameter/itemNew/MultiInputField'
|
||||
import EliteParameterRecordingEliteDPV from '../parameter/itemNew/DPVNew/EliteParameterRecordingEliteDPV'
|
||||
import DevMode from '../parameter/itemNew/DevMode'
|
||||
import Trigger from '../parameter/itemNew/TriggerNew/Trigger'
|
||||
import EliteParameterRecordingElitePulseSensing from '../parameter/itemNew/PulseSensingNew/EliteParameterRecordingElitePulseSensing'
|
||||
import { VueFinalModal } from 'vue-final-modal'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
@@ -141,6 +146,7 @@ export default {
|
||||
InputField,
|
||||
MultiInputField,
|
||||
DevMode,
|
||||
Trigger,
|
||||
},
|
||||
props: {
|
||||
parameter: {
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
|
||||
<p class="display-6"> CHANNEL {{ Number(channel) + 1 }} <p/>
|
||||
</div>
|
||||
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-0 py-0">
|
||||
<va-input
|
||||
class="mb-0 small-va-input"
|
||||
v-model="inputStringText"
|
||||
:disabled="!channelToggle"
|
||||
@keyup.enter="inputChange(inputString)"
|
||||
@blur="inputChange(inputString)"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
mA
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-0 py-0">
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sm11 xl12 md12 xs12 my-1 py-1">
|
||||
<va-slider
|
||||
pins
|
||||
:min="outputReadabilityData(range.min)"
|
||||
:max="outputReadabilityData(range.max)"
|
||||
value-visible
|
||||
:step="10"
|
||||
:color="toggle === true ? 'primary' : 'gray'"
|
||||
:disabled="!toggle"
|
||||
v-model="inputSlider"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ChannelBlock',
|
||||
components: {
|
||||
},
|
||||
computed: {
|
||||
toggle: {
|
||||
get () {
|
||||
return Boolean(this.inputValue[this.toggleName])
|
||||
},
|
||||
set (val) {
|
||||
this.channelToggle = val
|
||||
},
|
||||
},
|
||||
inputStringText: {
|
||||
get () {
|
||||
return String(this.outputReadabilityData(this.inputValue[this.parameterName]))
|
||||
},
|
||||
set (val) {
|
||||
this.inputString = val
|
||||
},
|
||||
},
|
||||
inputSlider: {
|
||||
get () {
|
||||
return this.outputReadabilityData(this.inputValue[this.parameterName])
|
||||
},
|
||||
set (val) {
|
||||
this.inputChange(val)
|
||||
},
|
||||
},
|
||||
},
|
||||
props: {
|
||||
inputValue: {
|
||||
type: Object,
|
||||
},
|
||||
channel: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
parameterName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
toggleName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
range: {
|
||||
type: Object,
|
||||
},
|
||||
defaultUnit: {
|
||||
type: String,
|
||||
},
|
||||
unit: {
|
||||
type: Object,
|
||||
},
|
||||
outputReadabilityData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
outputRawData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
inputString: '',
|
||||
channelToggle: false,
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
inputChange (val) {
|
||||
// if change from input field
|
||||
if (typeof (val) === 'string') {
|
||||
if (isNaN(val) || val === '') {
|
||||
return false
|
||||
}
|
||||
val = this.outputRawData(val)
|
||||
if (parseFloat(val) < this.range.min) {
|
||||
val = this.range.min
|
||||
} else if (parseFloat(val) > this.range.max) {
|
||||
val = this.range.max
|
||||
}
|
||||
} else if (typeof (val) === 'number') {
|
||||
val = this.outputRawData(val)
|
||||
}
|
||||
this.$emit('parameterChange', this.parameterName, val, true)
|
||||
},
|
||||
switchToggle () {
|
||||
this.$emit('parameterChange', this.toggleName, this.channelToggle)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.small-va-input {
|
||||
.va-input {
|
||||
&__container {
|
||||
min-height: 1rem;
|
||||
}
|
||||
|
||||
&__container__input {
|
||||
margin-bottom: 0.001rem;
|
||||
padding: 0.8rem 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
|
||||
<p class="display-6 my-2"> Timer <p/>
|
||||
</div>
|
||||
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-2 py-0">
|
||||
<va-input
|
||||
class="mb-0 small-va-input"
|
||||
v-model="inputStringText"
|
||||
:disabled="!toggle"
|
||||
@keyup.enter="inputChange(inputString)"
|
||||
@blur="inputChange(inputString)"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
s
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-2 py-0">
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="sm11 xl12 md12 xs12 my-1 py-1">
|
||||
<va-slider
|
||||
pins
|
||||
:min="outputReadabilityData(range.min)"
|
||||
:max="outputReadabilityData(range.max)"
|
||||
value-visible
|
||||
:step="10"
|
||||
:color="timerToggle === true ? 'primary' : 'gray'"
|
||||
:disabled="!timerToggle"
|
||||
v-model="inputSlider"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TimerBlock',
|
||||
components: {
|
||||
},
|
||||
computed: {
|
||||
inputStringText: {
|
||||
get () {
|
||||
return String(this.outputReadabilityData(this.inputValue[this.parameterName]))
|
||||
},
|
||||
set (val) {
|
||||
this.inputString = val
|
||||
},
|
||||
},
|
||||
inputSlider: {
|
||||
get () {
|
||||
return this.outputReadabilityData(this.inputValue[this.parameterName])
|
||||
},
|
||||
set (val) {
|
||||
this.inputChange(val)
|
||||
},
|
||||
},
|
||||
toggle: {
|
||||
get () {
|
||||
return !(this.inputValue[this.parameterName] === 0)
|
||||
},
|
||||
set (val) {
|
||||
this.timerToggle = val
|
||||
},
|
||||
},
|
||||
},
|
||||
props: {
|
||||
inputValue: {
|
||||
type: Object,
|
||||
},
|
||||
parameterName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
range: {
|
||||
type: Object,
|
||||
},
|
||||
defaultUnit: {
|
||||
type: String,
|
||||
},
|
||||
unit: {
|
||||
type: Object,
|
||||
},
|
||||
outputReadabilityData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
outputRawData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
inputString: '',
|
||||
timerToggle: false,
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
inputChange (val) {
|
||||
// if change from input field
|
||||
if (typeof (val) === 'string') {
|
||||
if (isNaN(val) || val === '') {
|
||||
return false
|
||||
}
|
||||
val = this.outputRawData(val)
|
||||
if (parseFloat(val) < this.range.min) {
|
||||
val = this.range.min
|
||||
} else if (parseFloat(val) > this.range.max) {
|
||||
val = this.range.max
|
||||
}
|
||||
} else if (typeof (val) === 'number') {
|
||||
val = this.outputRawData(val)
|
||||
}
|
||||
this.$emit('parameterChange', this.parameterName, val, true)
|
||||
},
|
||||
switchToggle () {
|
||||
if (this.timerToggle === true) {
|
||||
this.$emit('parameterChange', this.parameterName, 1)
|
||||
}
|
||||
if (this.timerToggle === false) {
|
||||
this.$emit('parameterChange', this.parameterName, 0)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.small-va-input {
|
||||
.va-input {
|
||||
&__container {
|
||||
min-height: 1rem;
|
||||
}
|
||||
|
||||
&__container__input {
|
||||
margin-bottom: 0.001rem;
|
||||
padding: 0.8rem 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="parameter.MODE === 0">
|
||||
<div v-for="channel in channelList" :key="channel">
|
||||
<ChannelBlock
|
||||
:channel="channel"
|
||||
:inputValue="parameter"
|
||||
:parameterName="channelBlockCurrent(channel)"
|
||||
:toggleName="channelBlockToggle(channel)"
|
||||
v-bind="parameterTable[channelBlockCurrent(channel)]"
|
||||
@parameterChange="parameterChange"
|
||||
></ChannelBlock>
|
||||
</div>
|
||||
<div class="row px-0 mx-0">
|
||||
<p class="my-2 mr-2 display-5"> ADVANCED SETTING </p>
|
||||
<!-- <va-toggle class="mb-0" flat small color="success" v-model="openAdvanced"/> -->
|
||||
</div>
|
||||
<div>
|
||||
<TimerBlock
|
||||
:inputValue="parameter"
|
||||
:parameterName="'TIME_DURATION'"
|
||||
v-bind="parameterTable.TIME_DURATION"
|
||||
@parameterChange="parameterChange"
|
||||
></TimerBlock>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="triggerIndex in triggerList" :key="'trigger_' + triggerIndex">
|
||||
<TriggerBlock
|
||||
:triggerIndex="triggerIndex"
|
||||
:inputValue="parameter"
|
||||
:parameterName="triggerBlockType(triggerIndex)"
|
||||
:toggleName="triggerBlockEnable(triggerIndex)"
|
||||
v-bind="parameterTable[triggerBlockType()]"
|
||||
@parameterChange="parameterChange"
|
||||
></TriggerBlock>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ChannelBlock from './ChannelBlock.vue'
|
||||
import TriggerBlock from './TriggerBlock.vue'
|
||||
import TimerBlock from './TimerBlock.vue'
|
||||
export default {
|
||||
name: 'Trigger',
|
||||
components: {
|
||||
ChannelBlock,
|
||||
TriggerBlock,
|
||||
TimerBlock,
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
props: {
|
||||
parameter: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
parameterTable: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
channelList: [0, 1, 2, 3],
|
||||
triggerList: [0, 1],
|
||||
openAdvanced: Boolean(this.parameter.TRIG0_en || this.parameter.TRIG1_en),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
channelBlockToggle (channelIndex) {
|
||||
let name = 'ACC_a_out'
|
||||
if (channelIndex !== undefined) {
|
||||
name += channelIndex
|
||||
}
|
||||
return name
|
||||
},
|
||||
channelBlockCurrent (channelIndex) {
|
||||
let name = 'ACC_a_out'
|
||||
if (channelIndex !== undefined) {
|
||||
name += channelIndex
|
||||
}
|
||||
name += '_current'
|
||||
return name
|
||||
},
|
||||
triggerBlockEnable (triggerIndex) {
|
||||
let name = 'TRIG'
|
||||
if (triggerIndex !== undefined) {
|
||||
name += triggerIndex
|
||||
}
|
||||
name += '_en'
|
||||
return name
|
||||
},
|
||||
triggerBlockType (triggerIndex) {
|
||||
let name = 'TRIG'
|
||||
if (triggerIndex !== undefined) {
|
||||
name += triggerIndex
|
||||
}
|
||||
name += '_edge_type'
|
||||
return name
|
||||
},
|
||||
parameterChange: function (name, value, debounce) {
|
||||
this.$emit('parameterChange', name, value, debounce)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div class="row flex sm12 xl12 md12 xs12 ma-0 pa-0">
|
||||
<div class="d-flex sm12 xl12 md12 xs12 my-0 py-0">
|
||||
<div class="flex sm8 xl8 md8 xs8 my-1 py-0">
|
||||
<p class="display-6 my-2"> TRIGGER IN {{ triggerIndex + 1 }} <p/>
|
||||
</div>
|
||||
<div class="flex sm4 xl4 md4 xs4 ma-0 pa-0 my-2">
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
|
||||
<va-radio-button
|
||||
v-for="(option, index) in optionTrigger"
|
||||
:key="index"
|
||||
style="float: left;"
|
||||
v-model="selectTrigger"
|
||||
:option="optionTrigger[index]"
|
||||
:label="optionTrigger[index]"
|
||||
:disabled="!toggle"
|
||||
@click.native.stop="inputChange(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TriggerBlock',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
triggerIndex: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
inputValue: {
|
||||
type: Object,
|
||||
},
|
||||
parameterName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
toggleName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
range: {
|
||||
type: Object,
|
||||
},
|
||||
defaultUnit: {
|
||||
type: String,
|
||||
},
|
||||
unit: {
|
||||
type: Object,
|
||||
},
|
||||
outputReadabilityData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
outputRawData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
toggle: {
|
||||
get () {
|
||||
return Boolean(this.inputValue[this.toggleName])
|
||||
},
|
||||
set (val) {
|
||||
this.triggerToggle = val
|
||||
},
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
selectTrigger: 'RISING',
|
||||
optionTrigger: [
|
||||
'RISING',
|
||||
'FALLING',
|
||||
'BOTH',
|
||||
],
|
||||
triggerToggle: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
inputChange (val) {
|
||||
this.$emit('parameterChange', this.parameterName, val)
|
||||
},
|
||||
switchToggle () {
|
||||
this.$emit('parameterChange', this.toggleName, this.triggerToggle)
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.selectTrigger = this.optionTrigger[this.inputValue[this.parameterName]]
|
||||
this.triggerToggle = Boolean(this.inputValue[this.toggleName])
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
name: 'ACC',
|
||||
parameter: ['TIME_DURATION', 'ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'ACC_a_out0_current', 'ACC_a_out1_current', 'ACC_a_out2_current', 'ACC_a_out3_current', 'TRIG0_en', 'TRIG1_en', 'TRIG0_edge_type', 'TRIG1_edge_type'], // 這個mode用到的參數
|
||||
showParameter: ['ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'TRIG0_en', 'TRIG1_en', 'TIME_DURATION'], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
import Idle from '../Common/Idle'
|
||||
import ACC from './ACC'
|
||||
|
||||
const EliteTrigger = {
|
||||
TIME_DURATION: {
|
||||
type: 'number',
|
||||
showName: 'Time duration',
|
||||
componentType: 'input-range',
|
||||
range: Object.freeze({ min: 0, max: 86400 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(parseFloat(val))
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(parseFloat(val))
|
||||
},
|
||||
},
|
||||
ACC_a_out0: {
|
||||
type: 'number',
|
||||
showName: 'Channel 1 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out1: {
|
||||
type: 'number',
|
||||
showName: 'Channel 2 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out2: {
|
||||
type: 'number',
|
||||
showName: 'Channel 3 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out3: {
|
||||
type: 'number',
|
||||
showName: 'Channel 4 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out0_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 1 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
ACC_a_out1_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 2 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
ACC_a_out2_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 3 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
ACC_a_out3_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 4 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
TRIG0_en: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 0 Enable',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG1_en: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 1 Enable',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG0_edge_type: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 0 Type',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG1_edge_type: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 1 Type',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
MODE_OPTIONS: [
|
||||
{
|
||||
id: 1,
|
||||
description: 'Idle',
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
description: 'Analog Current Control (ACC)',
|
||||
},
|
||||
],
|
||||
MODE: {
|
||||
0: ACC,
|
||||
1: Idle,
|
||||
},
|
||||
}
|
||||
|
||||
export default EliteTrigger
|
||||
@@ -1,5 +1,6 @@
|
||||
import EliteEDC from './EliteEDC/index'
|
||||
import EliteEIS from './EliteEIS/index'
|
||||
import EliteTrigger from './EliteTrigger/index'
|
||||
import store from '@/store/index'
|
||||
|
||||
// object saving library name mapping table
|
||||
@@ -15,7 +16,7 @@ const libraryNameMappingTable = {
|
||||
'Elite_EIS_1.0': EliteEIS,
|
||||
'Elite_EIS_1.1': EliteEIS,
|
||||
'Elite_EIS_MINI_1.0': EliteEIS,
|
||||
'Elite_TRIG_0.1': null,
|
||||
'Elite_TRIG_0.1': EliteTrigger,
|
||||
'Elite_MEGAFLY_0.1': null,
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ const serialNumberMappingTable = {
|
||||
},
|
||||
5: {
|
||||
1: {
|
||||
0: null, // TRIG0.1
|
||||
0: EliteTrigger, // TRIG0.1
|
||||
},
|
||||
},
|
||||
6: {
|
||||
|
||||
Reference in New Issue
Block a user