Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c307735dc3 | |||
| 1af50d0bfc | |||
| 99b2b9dfce | |||
| 1004c7075e | |||
| 8f4cbc0eeb | |||
| f741a2d018 | |||
| 008897830d | |||
| 5c297687f1 | |||
| 213caf9796 | |||
| 3761493ec1 | |||
| 87300e7a43 | |||
| 85103f5f12 | |||
| 1059a98c27 | |||
| 8150afc624 | |||
| b0de357d89 | |||
| 44c1a41d99 | |||
| a6a9b64da2 | |||
| a4ccee71a8 | |||
| 2cbdab696c | |||
| 3fe5e4af0c | |||
| 577cf09951 | |||
| 0c18ce1829 | |||
| 7c336d4bd3 | |||
| 95955e23e0 | |||
| d387f83f87 | |||
| 0e1695bb4e | |||
| fba42100d8 | |||
| acd1b300d7 | |||
| 3f4d5de662 | |||
| 56f4f0274c | |||
| e6aeb9203d | |||
| da7581de63 | |||
| 6d9294775d | |||
| 3a7d685d31 |
@@ -10,5 +10,5 @@ burn_to_raspberry.sh
|
||||
```shell
|
||||
sh ./burn_to_raspberry.sh <HOST> <PASSWORD>
|
||||
|
||||
e.g. sh ./burn_to_raspberry.sh pi@192.168.3.53 raspberry
|
||||
e.g. sh ./burn_to_raspberry.sh pi@192.168.2.1 raspberry
|
||||
```
|
||||
|
||||
@@ -156,7 +156,7 @@ export default {
|
||||
})
|
||||
let _gridNumber = 0
|
||||
const register = this.metaList.map(meta => {
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(meta.parameter_set.MODE)
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(meta.parameter_set.MODE, meta.device.library_name)
|
||||
const xType = setting[0] // Elite or Time
|
||||
const yType = setting[2] // Elite or Time
|
||||
const xValue = setting[1] // 1: I, 2: V, 3: R
|
||||
@@ -235,6 +235,49 @@ export default {
|
||||
}
|
||||
this.zoomTime = 0
|
||||
},
|
||||
async computeResampleScale (meta, duration) {
|
||||
const sampleRate = meta.parameter_set.SAMPLE_RATE / 10
|
||||
const dataPointNum = (parseInt(duration) / 1e6) * sampleRate // us -> s: /1e6
|
||||
let scale
|
||||
if (dataPointNum > 2e6) { // 2000 (points) * 1000 (resample) = 2e6
|
||||
scale = '1000'
|
||||
} else if (dataPointNum > 2e5) { // 2000 (points) * 100 (resample) = 2e5
|
||||
scale = '100'
|
||||
} else if (dataPointNum > 2e4) { // 2000 (points) * 10 (resample) = 2e4
|
||||
scale = '10'
|
||||
} else {
|
||||
scale = '1'
|
||||
}
|
||||
let dataExist = false
|
||||
while (dataExist === false) {
|
||||
if (scale === '1') {
|
||||
break
|
||||
} else {
|
||||
let status
|
||||
for (const ch in Object.keys(meta.mini_data)) {
|
||||
let earlyStopFlag = false
|
||||
const dataIDArray = meta.mini_data[ch][scale]
|
||||
for (let i = 0; i < dataIDArray.length; i++) {
|
||||
const dataID = dataIDArray[i]
|
||||
const result = await download.getMiniExistOrNotByID(dataID, ch)
|
||||
status = result.data
|
||||
if (status === false) {
|
||||
earlyStopFlag = true
|
||||
scale = String(parseInt(scale) / 10)
|
||||
break
|
||||
}
|
||||
}
|
||||
if (earlyStopFlag === true) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (status === true) {
|
||||
dataExist = true // break
|
||||
}
|
||||
}
|
||||
}
|
||||
return scale
|
||||
},
|
||||
drawOverviewData: async function () {
|
||||
this.showChartLoading('overview')
|
||||
for (const meta in this.dataInfo) {
|
||||
@@ -244,21 +287,9 @@ export default {
|
||||
metaInfo = _meta
|
||||
}
|
||||
})
|
||||
let scale = '100'
|
||||
let scale = '1'
|
||||
if (this.axisXDataType.description === 'Time') {
|
||||
const sampleRate = metaInfo.parameter_set.SAMPLE_RATE / 10
|
||||
const dataPointNum = (parseInt(metaInfo.time_duration) / 1e6) * sampleRate // us -> s: /1e6
|
||||
if (dataPointNum > 2e6) { // 2000 (points) * 1000 (resample) = 2e6
|
||||
scale = '1000'
|
||||
} else if (dataPointNum > 2e5) { // 2000 (points) * 100 (resample) = 2e5
|
||||
scale = '100'
|
||||
} else if (dataPointNum > 2e4) { // 2000 (points) * 10 (resample) = 2e4
|
||||
scale = '10'
|
||||
} else {
|
||||
scale = '1'
|
||||
}
|
||||
} else {
|
||||
scale = '1' // [TODO] select by user
|
||||
scale = await this.computeResampleScale(metaInfo, metaInfo.time_duration)
|
||||
}
|
||||
console.log('overview scale:', scale)
|
||||
// download data
|
||||
@@ -303,21 +334,9 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
let scale = '100'
|
||||
let scale = '1'
|
||||
if (this.axisXDataType.description === 'Time') {
|
||||
const sampleRate = metaInfo.parameter_set.SAMPLE_RATE / 10
|
||||
const dataPointNum = (parseInt(timeDur) / 1e6) * sampleRate // us -> s: /1e6
|
||||
if (dataPointNum > 2e6) { // 2000 (points) * 1000 (resample) = 2e6
|
||||
scale = '1000'
|
||||
} else if (dataPointNum > 2e5) { // 2000 (points) * 100 (resample) = 2e5
|
||||
scale = '100'
|
||||
} else if (dataPointNum > 2e4) { // 2000 (points) * 10 (resample) = 2e4
|
||||
scale = '10'
|
||||
} else {
|
||||
scale = '1'
|
||||
}
|
||||
} else {
|
||||
scale = '1' // [TODO] select by user
|
||||
scale = await this.computeResampleScale(metaInfo, timeDur)
|
||||
}
|
||||
// elite的sample rate不像neulive這麼高,因此試試scale = 100 or 1000時不要再sampling一次了,不然有些形狀(e.g. peak)會不一樣
|
||||
if (scale === '100' || scale === '1000') {
|
||||
@@ -336,7 +355,7 @@ export default {
|
||||
const channelY = parseInt(this.axisYDataType.id)
|
||||
const dataListY = this.dataInfo[meta][channelY][scale]
|
||||
|
||||
const isThisModeHasCycle = this.GLOBAL.hasCycleMode(metaInfo.parameter_set.MODE)
|
||||
const isThisModeHasCycle = this.GLOBAL.hasCycleMode(metaInfo.parameter_set.MODE, metaInfo.device.library_name)
|
||||
let startTime
|
||||
let endTime
|
||||
if (isThisModeHasCycle === true && this.axisXDataType.description !== 'Time') { // if有cycle的mode且目前x軸不為時間,抓出第一圈所在的時間段,初始化時先畫第一圈就好,加快初始時間
|
||||
@@ -426,12 +445,17 @@ export default {
|
||||
},
|
||||
changeAxis (gridIndex) {
|
||||
if (this.initDone) {
|
||||
const libName = this.metaList[gridIndex].device.library_name
|
||||
let xType
|
||||
let xValue // 1: I, 2: V, 3: R
|
||||
let xValue
|
||||
if (this.axisXDataType.description === 'Time') {
|
||||
xType = 'Time'
|
||||
} else {
|
||||
xType = 'Elite'
|
||||
if (libName === 'EliteZM15') {
|
||||
xType = 'Elite'
|
||||
} else if (libName === 'EliteEIS') {
|
||||
xType = 'EliteEIS'
|
||||
}
|
||||
xValue = this.axisXDataType.id + 1
|
||||
}
|
||||
this.updateRegisteredChart({
|
||||
@@ -441,7 +465,7 @@ export default {
|
||||
deviceNameX: xType,
|
||||
deviceIDX: this.metaList[gridIndex].name,
|
||||
channelX: xValue,
|
||||
deviceNameY: 'Elite',
|
||||
deviceNameY: libName === 'EliteEIS' ? 'EliteEIS' : 'Elite',
|
||||
deviceIDY: '',
|
||||
channelY: this.axisYDataType.id + 1,
|
||||
})
|
||||
@@ -458,9 +482,6 @@ export default {
|
||||
...mapGetters('replay', [types.meta.getAll]),
|
||||
...mapGetters('replay', [types.rec.getAll, types.rec.getCycleDict]),
|
||||
},
|
||||
// use watch because va-select with @change will have bug
|
||||
watch: {
|
||||
},
|
||||
async mounted () {
|
||||
this.showChartLoading()
|
||||
const metaIDList = this.$route.params.metaList.split('-')
|
||||
|
||||
@@ -7,19 +7,18 @@
|
||||
<delete-file class="flex-child2"/>
|
||||
</div>
|
||||
<div class="flex-container">
|
||||
<change-axis class="flex-child" :ref="'change_axis_x'" deviceName="elite" axis="x" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle" @resetScale="resetScale"/>
|
||||
<change-unit class="flex-child2" :ref="'change_unit_x'" deviceName="elite" axis="x" @refreshChart="refreshChart"/>
|
||||
<change-scale class="flex-child1" :ref="'change_scale_x'" deviceName="elite" axis="x" @refreshChart="refreshChart" @clearCycle="clearCycle"/>
|
||||
<change-axis class="flex-child" :ref="'change_axis_x'" axis="x" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle" @resetScale="resetScale"/>
|
||||
<change-unit class="flex-child2" :ref="'change_unit_x'" axis="x" @refreshChart="refreshChart"/>
|
||||
<change-scale class="flex-child1" :ref="'change_scale_x'" axis="x" @refreshChart="refreshChart" @clearCycle="clearCycle"/>
|
||||
</div>
|
||||
<div class="flex-container">
|
||||
<change-axis class="flex-child" :ref="'change_axis_y'" deviceName="elite" axis="y" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle" @resetScale="resetScale"/>
|
||||
<change-unit class="flex-child2" :ref="'change_unit_y'" deviceName="elite" axis="y" @refreshChart="refreshChart"/>
|
||||
<change-scale class="flex-child1" :ref="'change_scale_y'" deviceName="elite" axis="y" @refreshChart="refreshChart" @clearCycle="clearCycle"/>
|
||||
<change-axis class="flex-child" :ref="'change_axis_y'" axis="y" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle" @resetScale="resetScale"/>
|
||||
<change-unit class="flex-child2" :ref="'change_unit_y'" axis="y" @refreshChart="refreshChart"/>
|
||||
<change-scale class="flex-child1" :ref="'change_scale_y'" axis="y" @refreshChart="refreshChart" @clearCycle="clearCycle"/>
|
||||
</div>
|
||||
<change-cycle v-show="showCyclePanel" style="margin: 3px;" :ref="'change_cycle'" @refreshChart="refreshChart"/>
|
||||
<show-resample-rate style="margin: 3px;"/>
|
||||
<sd-card-toggle :ref="'sd_card_toggle'"/>
|
||||
<show-parameter style="margin: 3px;" :ref="'show_param'" deviceName="elite"/>
|
||||
<show-parameter style="margin: 3px;" :ref="'show_param'"/>
|
||||
</va-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -34,7 +33,6 @@ import DownloadFile from '@/components/analysis/replay/toolbox/DownloadFile.vue'
|
||||
import DeleteFile from '@/components/analysis/replay/toolbox/DeleteFile.vue'
|
||||
import EditFileName from '@/components/analysis/replay/toolbox/EditFileName.vue'
|
||||
import ShowParameter from '@/components/analysis/replay/toolbox/ShowParameter.vue'
|
||||
import SdCardToggle from '@/components/analysis/replay/toolbox/SdCardToggle.vue'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
@@ -49,10 +47,10 @@ export default {
|
||||
DeleteFile,
|
||||
EditFileName,
|
||||
ShowParameter,
|
||||
SdCardToggle,
|
||||
},
|
||||
computed: {
|
||||
...mapFields('replay', [
|
||||
'metaList',
|
||||
'showCyclePanel',
|
||||
]),
|
||||
},
|
||||
@@ -62,6 +60,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceName: '',
|
||||
showCycle: false,
|
||||
}
|
||||
},
|
||||
@@ -69,15 +68,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.$refs.change_axis_x.init()
|
||||
this.$refs.change_axis_y.init()
|
||||
this.$refs.change_unit_x.init()
|
||||
this.$refs.change_unit_y.init()
|
||||
this.$refs.change_scale_x.init()
|
||||
this.$refs.change_scale_y.init()
|
||||
this.deviceName = this.metaList[0].device.library_name
|
||||
this.$refs.change_axis_x.init(this.deviceName)
|
||||
this.$refs.change_axis_y.init(this.deviceName)
|
||||
this.$refs.change_unit_x.init(this.deviceName)
|
||||
this.$refs.change_unit_y.init(this.deviceName)
|
||||
this.$refs.change_scale_x.init(this.deviceName)
|
||||
this.$refs.change_scale_y.init(this.deviceName)
|
||||
this.$refs.change_cycle.init()
|
||||
this.$refs.edit_file_name.init()
|
||||
this.$refs.show_param.init()
|
||||
this.$refs.show_param.init(this.deviceName)
|
||||
},
|
||||
refreshChart (options) {
|
||||
this.$emit('refreshChart', options)
|
||||
@@ -100,9 +100,6 @@ export default {
|
||||
this.$refs.change_scale_y.reset()
|
||||
},
|
||||
},
|
||||
// use watch because va-select with @change will have bug
|
||||
watch: {
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<span slot="header">Control Panel</span>
|
||||
<div slot="body">
|
||||
<div>
|
||||
<top-control-panel :ref="'top_control_panel'" @refreshChart="setOption"/>
|
||||
<top-control-panel :ref="'top_control_panel'" @refreshChart="setOption" @changeOverviewDataZoom="changeOverviewDataZoom"/>
|
||||
</div>
|
||||
</div>
|
||||
</va-collapse>
|
||||
@@ -56,6 +56,9 @@ export default {
|
||||
'chartOverviewData',
|
||||
'chartDetailData',
|
||||
'currentScale',
|
||||
'startTime',
|
||||
'endTime',
|
||||
'windowLength',
|
||||
'startTimeCurrent',
|
||||
'endTimeCurrent',
|
||||
'sampleMethod',
|
||||
@@ -87,8 +90,6 @@ export default {
|
||||
metaList: null,
|
||||
dataInfo: {},
|
||||
maxTime: 0,
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
zoomTime: 0,
|
||||
chartAreaClass: ['flex', 'xs12', 'sm12', 'md12', 'xl9', 'pa-0'],
|
||||
dataZoomStart: 0,
|
||||
@@ -134,7 +135,8 @@ export default {
|
||||
},
|
||||
getData: async function (scale, sampleMethod, id, channel, meta) {
|
||||
if (scale === 1) {
|
||||
if (this.useSdCardData) {
|
||||
// [TODO] 0: assume first meta temporarily
|
||||
if (this.useSdCardData && (this.metaList[0].sd_data_uploaded === true)) {
|
||||
return await download.rawSdDataByIDChannels(id, channel, meta)
|
||||
} else {
|
||||
return await download.rawByIDChannels(id, channel, meta)
|
||||
@@ -244,16 +246,22 @@ export default {
|
||||
e.batch.forEach(dataZoom => {
|
||||
const id = parseInt(dataZoom.dataZoomId.substr(dataZoom.dataZoomId.length - 3, dataZoom.dataZoomId.length - 1))
|
||||
if (id === 1) {
|
||||
this.startTime = this.maxTime * dataZoom.start / 100
|
||||
this.endTime = this.maxTime * dataZoom.end / 100
|
||||
this.startTime = parseInt(this.maxTime * dataZoom.start / 100)
|
||||
this.endTime = parseInt(this.maxTime * dataZoom.end / 100)
|
||||
this.windowLength = this.endTime - this.startTime
|
||||
this.chartOverviewData.dataZoom[0].start = dataZoom.start
|
||||
this.chartOverviewData.dataZoom[0].end = dataZoom.end
|
||||
// console.log(this.startTime, this.endTime)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const id = parseInt(e.dataZoomId.substr(e.dataZoomId.length - 3, e.dataZoomId.length - 1))
|
||||
if (id === 0) {
|
||||
this.startTime = this.maxTime * e.start / 100
|
||||
this.endTime = this.maxTime * e.end / 100
|
||||
this.startTime = parseInt(this.maxTime * e.start / 100)
|
||||
this.endTime = parseInt(this.maxTime * e.end / 100)
|
||||
this.windowLength = this.endTime - this.startTime
|
||||
this.chartOverviewData.dataZoom[0].start = e.start
|
||||
this.chartOverviewData.dataZoom[0].end = e.end
|
||||
// console.log(this.startTime, this.endTime)
|
||||
}
|
||||
}
|
||||
@@ -261,6 +269,13 @@ export default {
|
||||
this.chartOverviewData.series[0].markArea.data[0][1].xAxis = this.startTime + ((this.endTime - this.startTime) * (this.dataZoomEnd / 100))
|
||||
this.zoomTime = 0
|
||||
},
|
||||
changeOverviewDataZoom () {
|
||||
this.chartOverviewData.dataZoom[0].start = this.startTime * 100 / this.maxTime
|
||||
this.chartOverviewData.dataZoom[0].end = this.endTime * 100 / this.maxTime
|
||||
this.chartOverviewData.series[0].markArea.data[0][0].xAxis = this.startTime + ((this.endTime - this.startTime) * (this.dataZoomStart / 100))
|
||||
this.chartOverviewData.series[0].markArea.data[0][1].xAxis = this.startTime + ((this.endTime - this.startTime) * (this.dataZoomEnd / 100))
|
||||
this.$refs.chart_overview.mergeOptions(this.chartOverviewData)
|
||||
},
|
||||
drawInitData: async function () {
|
||||
this.showChartLoading('overview')
|
||||
for (const meta in this.dataInfo) {
|
||||
@@ -453,7 +468,7 @@ export default {
|
||||
...mapActions('replay', [types.meta.init]),
|
||||
...mapActions('replay', [types.rec.init, types.rec.intoData, types.rec.initDisplaySetting, types.rec.updateDisplaySetting]),
|
||||
|
||||
...mapMutations('replay', [types.chart.updateAxisLabel, types.chart.updateChartSampling]),
|
||||
...mapMutations('replay', [types.chart.updateAxisLabel, types.chart.updateChartSampling, types.chart.setOverviewDataZoomStartAndEnd]),
|
||||
...mapMutations('replay', [types.meta.updateByIndex]),
|
||||
|
||||
...mapGetters('replay', [types.meta.getAll]),
|
||||
@@ -472,6 +487,7 @@ export default {
|
||||
console.log(this.metaList)
|
||||
console.log(this.dataInfo)
|
||||
await this.register()
|
||||
this.setOverviewDataZoomStartAndEndChart()
|
||||
await this.drawInitData()
|
||||
this.dataZoomTimer = setInterval(this.checkDataZoom, 1000)
|
||||
this.$refs.top_control_panel.init()
|
||||
|
||||
@@ -54,6 +54,9 @@ export default {
|
||||
updateZoom: function (e) {
|
||||
this.$emit('dataZoomEvent', e)
|
||||
},
|
||||
mergeOptions (options) {
|
||||
this.$refs.chart_ref.mergeOptions(options)
|
||||
},
|
||||
showLoading (options) {
|
||||
this.$refs.chart_ref.showLoading(options)
|
||||
},
|
||||
|
||||
@@ -7,12 +7,16 @@
|
||||
<delete-file class="flex-child2"/>
|
||||
</div>
|
||||
<show-resample-rate/>
|
||||
<div class="flex-container">
|
||||
<change-window-start-and-size class="flex-child" :ref="'change_window_start_and_size'" @changeOverviewDataZoom="changeOverviewDataZoom"/>
|
||||
<lock-data-zoom class="flex-child2" :chartID="0"/>
|
||||
</div>
|
||||
<change-axis v-show="showXAxis" :ref="'change_axis_x'" deviceName="neulive" axis="x"/>
|
||||
<change-axis v-show="showYAxis" :ref="'change_axis_y'" deviceName="neulive" axis="y"/>
|
||||
<change-unit v-show="showXUnit" :ref="'change_unit_x'" deviceName="neulive" axis="x" @refreshChart="refreshChart"/>
|
||||
<change-unit :ref="'change_unit_y'" class="box_inline-block" deviceName="neulive" axis="y" @refreshChart="refreshChart"/>
|
||||
<change-scale :ref="'change_scale_y'" class="box_inline-block" deviceName="neulive" axis="y"/>
|
||||
<sd-card-toggle :ref="'sd_card_toggle'"/>
|
||||
<sd-card-toggle :ref="'sd_card_toggle'" :metaIndex="0"/>
|
||||
<show-parameter :ref="'show_param'" deviceName="neulive"/>
|
||||
</va-card>
|
||||
</div>
|
||||
@@ -28,6 +32,8 @@ import DeleteFile from '@/components/analysis/replay/toolbox/DeleteFile.vue'
|
||||
import EditFileName from '@/components/analysis/replay/toolbox/EditFileName.vue'
|
||||
import ShowParameter from '@/components/analysis/replay/toolbox/ShowParameter.vue'
|
||||
import SdCardToggle from '@/components/analysis/replay/toolbox/SdCardToggle.vue'
|
||||
import LockDataZoom from '@/components/analysis/replay/toolbox/LockDataZoom.vue'
|
||||
import ChangeWindowStartAndSize from '@/components/analysis/replay/toolbox/ChangeWindowStartAndSize.vue'
|
||||
|
||||
export default {
|
||||
name: 'top-control-panel',
|
||||
@@ -41,11 +47,11 @@ export default {
|
||||
EditFileName,
|
||||
ShowParameter,
|
||||
SdCardToggle,
|
||||
LockDataZoom,
|
||||
ChangeWindowStartAndSize,
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
props: {
|
||||
},
|
||||
async created () {
|
||||
},
|
||||
data () {
|
||||
@@ -66,6 +72,11 @@ export default {
|
||||
this.$refs.change_scale_y.init()
|
||||
this.$refs.edit_file_name.init()
|
||||
this.$refs.show_param.init()
|
||||
this.$refs.change_window_start_and_size.init()
|
||||
this.$refs.sd_card_toggle.init()
|
||||
},
|
||||
changeOverviewDataZoom () {
|
||||
this.$emit('changeOverviewDataZoom')
|
||||
},
|
||||
refreshChart (options) {
|
||||
this.$emit('refreshChart', options)
|
||||
|
||||
@@ -2,18 +2,28 @@
|
||||
<div>
|
||||
<span> {{ axis }} axis: </span>
|
||||
<div v-if="axis === 'x'" style="display: inline;">
|
||||
<select v-model="channelFormat" @change="changeAxis()">
|
||||
<select v-if="deviceName!=='EliteEIS'" v-model="channelFormat" @change="changeAxis()">
|
||||
<option v-for="option in channelOptions" :key="option.id" :value="option">
|
||||
{{ option.description }}
|
||||
</option>
|
||||
</select>
|
||||
<select v-if="deviceName==='EliteEIS'" v-model="channelFormat" @change="changeAxis()">
|
||||
<option v-for="option in eisChannelOptions" :key="option.id" :value="option">
|
||||
{{ option.description }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div v-if="axis === 'y'" style="display: inline;">
|
||||
<select v-model="channelFormat" @change="changeAxis()">
|
||||
<select v-if="deviceName!=='EliteEIS'" v-model="channelFormat" @change="changeAxis()">
|
||||
<option v-for="option in channelYOptions" :key="option.id" :value="option">
|
||||
{{ option.description }}
|
||||
</option>
|
||||
</select>
|
||||
<select v-if="deviceName==='EliteEIS'" v-model="channelFormat" @change="changeAxis()">
|
||||
<option v-for="option in eisChannelYOptions" :key="option.id" :value="option">
|
||||
{{ option.description }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,9 +36,6 @@ export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
deviceName: {
|
||||
type: String, // elite or neulive
|
||||
},
|
||||
axis: {
|
||||
type: String, // x or y
|
||||
},
|
||||
@@ -49,7 +56,8 @@ export default {
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init (deviceName) {
|
||||
this.deviceName = deviceName
|
||||
if (this.deviceName === 'neulive') {
|
||||
// now neulive only v-t
|
||||
if (this.axis === 'x') {
|
||||
@@ -57,9 +65,9 @@ export default {
|
||||
} else if (this.axis === 'y') {
|
||||
this.axisYDataType = this.channelOptions[1]
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15') {
|
||||
// use state meta to decide which default unit need to be used (like check I-V mode...)
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE)
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
|
||||
const xType = setting[0]
|
||||
const xValue = setting[1]
|
||||
const yType = setting[2]
|
||||
@@ -70,6 +78,53 @@ export default {
|
||||
settingType = xType
|
||||
settingValue = xValue
|
||||
if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.axisXDataType = this.channelOptions[0]
|
||||
} else if (settingValue === 2) {
|
||||
this.axisXDataType = this.channelOptions[1]
|
||||
} else if (settingValue === 3) {
|
||||
this.axisXDataType = this.channelOptions[2]
|
||||
} else if (settingValue === 4) {
|
||||
this.axisXDataType = this.channelOptions[3]
|
||||
}
|
||||
} else if (settingType === 'Time') {
|
||||
this.axisXDataType = this.channelOptions[4]
|
||||
}
|
||||
this.channelFormat = this.axisXDataType
|
||||
} else if (this.axis === 'y') {
|
||||
settingType = yType
|
||||
settingValue = yValue
|
||||
if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.axisYDataType = this.channelOptions[0]
|
||||
} else if (settingValue === 2) {
|
||||
this.axisYDataType = this.channelOptions[1]
|
||||
} else if (settingValue === 3) {
|
||||
this.axisYDataType = this.channelOptions[2]
|
||||
} else if (settingValue === 4) {
|
||||
this.axisXDataType = this.channelOptions[3]
|
||||
}
|
||||
} else if (settingType === 'Time') {
|
||||
this.axisYDataType = this.channelOptions[4]
|
||||
}
|
||||
this.channelFormat = this.axisYDataType
|
||||
}
|
||||
} else if (this.deviceName === 'EliteEIS') {
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
|
||||
const xType = setting[0]
|
||||
const xValue = setting[1]
|
||||
const yType = setting[2]
|
||||
const yValue = setting[3]
|
||||
let settingType
|
||||
let settingValue
|
||||
if (this.axis === 'x') {
|
||||
settingType = xType
|
||||
settingValue = xValue
|
||||
if (settingType === 'EliteEIS') {
|
||||
this.axisXDataType = this.eisChannelOptions.find(element => element.id === parseInt(settingValue) - 1)
|
||||
} else if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.axisXDataType = this.channelOptions[0]
|
||||
@@ -85,7 +140,9 @@ export default {
|
||||
} else if (this.axis === 'y') {
|
||||
settingType = yType
|
||||
settingValue = yValue
|
||||
if (settingType === 'Elite') {
|
||||
if (settingType === 'EliteEIS') {
|
||||
this.axisYDataType = this.eisChannelOptions.find(element => element.id === parseInt(settingValue) - 1)
|
||||
} else if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.axisYDataType = this.channelOptions[0]
|
||||
@@ -108,7 +165,7 @@ export default {
|
||||
if (this.deviceName === 'neulive') {
|
||||
// for elite now, cuz neulive now only have v-t graph, for future neulive replay need to adjust'
|
||||
// console.log('(Last updated: 2021/06/19)')
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
|
||||
if (this.axis === 'x') {
|
||||
this.axisXDataType = this.channelFormat
|
||||
} else if (this.axis === 'y') {
|
||||
@@ -130,6 +187,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceName: '',
|
||||
channelFormat: {},
|
||||
channelOptions: [
|
||||
{
|
||||
@@ -144,6 +202,10 @@ export default {
|
||||
id: 2,
|
||||
description: 'Resistance',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'Cycle',
|
||||
},
|
||||
{
|
||||
id: 100, // no usage, so assign a large number to avoid conflicting with existing channel data
|
||||
description: 'Time',
|
||||
@@ -162,6 +224,74 @@ export default {
|
||||
id: 2,
|
||||
description: 'Resistance',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'Cycle',
|
||||
},
|
||||
],
|
||||
eisChannelOptions: [ // id 0 (Raw Imag), 1 (Raw Real), 3 (Cycle) 不用給user選
|
||||
{
|
||||
id: 2,
|
||||
description: 'Frequency',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'Z_imag',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'Z_real',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
description: 'Impedance',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
description: 'Phase',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
description: 'Current',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
description: 'Gain Level',
|
||||
},
|
||||
{
|
||||
id: 100, // no usage, so assign a large number to avoid conflicting with existing channel data
|
||||
description: 'Time',
|
||||
},
|
||||
],
|
||||
eisChannelYOptions: [ // id 0 (Raw Imag), 1 (Raw Real), 3 (Cycle) 不用給user選
|
||||
{
|
||||
id: 2,
|
||||
description: 'Frequency',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'Z_imag',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'Z_real',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
description: 'Impedance',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
description: 'Phase',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
description: 'Current',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
description: 'Gain Level',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
@@ -77,9 +77,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.isThisModeHasCycle = this.GLOBAL.hasCycleMode(this.metaList[this.metaIndex].parameter_set.MODE)
|
||||
this.cycleNum = this.metaList[this.metaIndex].parameter_set.CYCLE_NUMBER
|
||||
this.metaID = this.metaList[this.metaIndex].id
|
||||
const meta = this.metaList[this.metaIndex]
|
||||
this.metaID = meta.id
|
||||
this.isThisModeHasCycle = this.GLOBAL.hasCycleMode(this.metaList[this.metaIndex].parameter_set.MODE, meta.device.library_name)
|
||||
if (this.isThisModeHasCycle === true) {
|
||||
this.showPanel = true
|
||||
} else {
|
||||
|
||||
@@ -19,9 +19,6 @@ export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
deviceName: {
|
||||
type: String, // elite or neulive
|
||||
},
|
||||
chartID: {
|
||||
type: Number, // detail data
|
||||
default: 1,
|
||||
@@ -52,7 +49,8 @@ export default {
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init (deviceName) {
|
||||
this.deviceName = deviceName
|
||||
this.metaInfo = this.metaList[this.metaIndex]
|
||||
this.metaID = this.metaInfo.id
|
||||
if (this.axis === 'x') {
|
||||
@@ -77,7 +75,7 @@ export default {
|
||||
this.calculateScaleHelper(gridIndex, ch)
|
||||
}
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
|
||||
this.calculateScaleHelper(this.metaIndex, -1) // [TODO] elite tmp use metaIndex for grid index
|
||||
}
|
||||
},
|
||||
@@ -87,9 +85,9 @@ export default {
|
||||
seriesData = JSON.parse(JSON.stringify(this.chartData[this.chartID].series[gridIndex].data))
|
||||
for (let i = 0; i < seriesData.length; i++) {
|
||||
if (this.axis === 'x') {
|
||||
seriesData[i][0] = Math.log10(Math.abs(seriesData[i][0]))
|
||||
seriesData[i][0] = Math.log10(Math.abs(seriesData[i][0])).toFixed(8)
|
||||
} else if (this.axis === 'y') {
|
||||
seriesData[i][1] = Math.log10(Math.abs(seriesData[i][1]))
|
||||
seriesData[i][1] = Math.log10(Math.abs(seriesData[i][1])).toFixed(8)
|
||||
}
|
||||
}
|
||||
} else if (this.scaleFormat.description === 'Linear') {
|
||||
@@ -124,10 +122,10 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
|
||||
seriesData = []
|
||||
|
||||
const isThisModeHasCycle = this.GLOBAL.hasCycleMode(this.metaInfo.parameter_set.MODE)
|
||||
const isThisModeHasCycle = this.GLOBAL.hasCycleMode(this.metaInfo.parameter_set.MODE, this.deviceName)
|
||||
let startTime
|
||||
let endTime
|
||||
if (isThisModeHasCycle === true && this.axisXDataType.description !== 'Time') { // if有cycle的mode且目前x軸不為時間,抓出第一圈所在的時間段,初始化時先畫第一圈就好,加快初始時間
|
||||
@@ -221,6 +219,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceName: '',
|
||||
metaID: 0,
|
||||
metaInfo: null,
|
||||
scaleFormat: { id: 0, description: 'Linear' },
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<select v-model="valueFormat" @change="changeUnit()">
|
||||
<select v-if="deviceName!=='EliteEIS'" v-model="valueFormat" @change="changeUnit()">
|
||||
<option v-for="option in valueFormatOptions[dataType]" :key="option.id" :value="option">
|
||||
{{ option.unit }}
|
||||
</option>
|
||||
</select>
|
||||
<select v-if="deviceName==='EliteEIS'" v-model="valueFormat" @change="changeUnit()">
|
||||
<option v-for="option in eisValueFormatOptions[dataType]" :key="option.id" :value="option">
|
||||
{{ option.unit }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -18,9 +23,6 @@ export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
deviceName: {
|
||||
type: String, // elite or neulive
|
||||
},
|
||||
axis: {
|
||||
type: String, // x or y
|
||||
},
|
||||
@@ -53,11 +55,14 @@ export default {
|
||||
return item.unit === 'uV'
|
||||
})
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15') {
|
||||
return this.valueFormatOptions[this.dataType][0]
|
||||
} else if (this.deviceName === 'EliteEIS') {
|
||||
return this.eisValueFormatOptions[this.dataType][0]
|
||||
}
|
||||
},
|
||||
init () {
|
||||
init (deviceName) {
|
||||
this.deviceName = deviceName
|
||||
if (this.deviceName === 'neulive') {
|
||||
// now neulive only v-t
|
||||
if (this.axis === 'x') {
|
||||
@@ -65,9 +70,9 @@ export default {
|
||||
} else if (this.axis === 'y') {
|
||||
this.dataType = 'voltage'
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15') {
|
||||
// use state meta to decide which default unit need to be used (like check I-V mode...)
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE)
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
|
||||
const xType = setting[0]
|
||||
const xValue = setting[1]
|
||||
const yType = setting[2]
|
||||
@@ -83,6 +88,48 @@ export default {
|
||||
}
|
||||
|
||||
if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.dataType = 'current'
|
||||
} else if (settingValue === 2) {
|
||||
this.dataType = 'voltage'
|
||||
} else if (settingValue === 3) {
|
||||
this.dataType = 'resistance'
|
||||
} else if (settingValue === 4) {
|
||||
this.dataType = 'cycle'
|
||||
}
|
||||
} else if (settingType === 'Time') {
|
||||
this.dataType = 'time'
|
||||
}
|
||||
} else if (this.deviceName === 'EliteEIS') {
|
||||
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
|
||||
const xType = setting[0]
|
||||
const xValue = setting[1]
|
||||
const yType = setting[2]
|
||||
const yValue = setting[3]
|
||||
let settingType
|
||||
let settingValue
|
||||
if (this.axis === 'x') {
|
||||
settingType = xType
|
||||
settingValue = xValue
|
||||
} else if (this.axis === 'y') {
|
||||
settingType = yType
|
||||
settingValue = yValue
|
||||
}
|
||||
|
||||
if (settingType === 'EliteEIS') {
|
||||
if (settingValue === 3) {
|
||||
this.dataType = 'frequency'
|
||||
} else if (settingValue === 5 || settingValue === 6 || settingValue === 7) {
|
||||
this.dataType = 'impedance'
|
||||
} else if (settingValue === 8) {
|
||||
this.dataType = 'phase'
|
||||
} else if (settingValue === 9) {
|
||||
this.dataType = 'current'
|
||||
} else if (settingValue === 10) {
|
||||
this.dataType = 'default'
|
||||
}
|
||||
} else if (settingType === 'Elite') {
|
||||
// 1: I, 2: V, 3: R
|
||||
if (settingValue === 1) {
|
||||
this.dataType = 'current'
|
||||
@@ -122,7 +169,7 @@ export default {
|
||||
channel: parseInt(key),
|
||||
})
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
|
||||
this.updateAxisLabelChart({
|
||||
chartID: chartID,
|
||||
axis: this.axis,
|
||||
@@ -142,6 +189,16 @@ export default {
|
||||
this.dataType = 'resistance'
|
||||
} else if (this.axisXDataType.description === 'Time') {
|
||||
this.dataType = 'time'
|
||||
} else if (this.axisXDataType.description === 'Cycle') {
|
||||
this.dataType = 'cycle'
|
||||
} else if (this.axisXDataType.description === 'Frequency') {
|
||||
this.dataType = 'frequency'
|
||||
} else if (this.axisXDataType.description === 'Z_imag' || this.axisXDataType.description === 'Z_real' || this.axisXDataType.description === 'Impedance') {
|
||||
this.dataType = 'impedance'
|
||||
} else if (this.axisXDataType.description === 'Phase') {
|
||||
this.dataType = 'phase'
|
||||
} else if (this.axisXDataType.description === 'Gain Level') {
|
||||
this.dataType = 'default'
|
||||
}
|
||||
} else if (this.axis === 'y') {
|
||||
if (this.axisYDataType.description === 'Current') {
|
||||
@@ -150,9 +207,23 @@ export default {
|
||||
this.dataType = 'voltage'
|
||||
} else if (this.axisYDataType.description === 'Resistance') {
|
||||
this.dataType = 'resistance'
|
||||
} else if (this.axisYDataType.description === 'Cycle') {
|
||||
this.dataType = 'cycle'
|
||||
} else if (this.axisYDataType.description === 'Frequency') {
|
||||
this.dataType = 'frequency'
|
||||
} else if (this.axisYDataType.description === 'Z_imag' || this.axisYDataType.description === 'Z_real' || this.axisYDataType.description === 'Impedance') {
|
||||
this.dataType = 'impedance'
|
||||
} else if (this.axisYDataType.description === 'Phase') {
|
||||
this.dataType = 'phase'
|
||||
} else if (this.axisYDataType.description === 'Gain Level') {
|
||||
this.dataType = 'default'
|
||||
}
|
||||
}
|
||||
this.valueFormat = this.valueFormatOptions[this.dataType][0]
|
||||
if (this.deviceName === 'EliteZM15') {
|
||||
this.valueFormat = this.valueFormatOptions[this.dataType][0]
|
||||
} else if (this.deviceName === 'EliteEIS') {
|
||||
this.valueFormat = this.eisValueFormatOptions[this.dataType][0]
|
||||
}
|
||||
this.changeUnit()
|
||||
},
|
||||
// call vuex to mutate chart label formatter by unit and axis
|
||||
@@ -162,6 +233,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceName: '',
|
||||
dataType: '',
|
||||
valueFormat: {},
|
||||
valueFormatOptions: { // below id: 0 mean default
|
||||
@@ -221,6 +293,13 @@ export default {
|
||||
unitScale: 1000000000,
|
||||
},
|
||||
],
|
||||
cycle: [ // Time
|
||||
{
|
||||
id: 0,
|
||||
unit: 'cycle',
|
||||
unitScale: 1,
|
||||
},
|
||||
],
|
||||
time: [ // Time
|
||||
{
|
||||
id: 0,
|
||||
@@ -229,6 +308,85 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
eisValueFormatOptions: { // below id: 0 mean default
|
||||
default: [
|
||||
{
|
||||
id: 0,
|
||||
unit: 'default',
|
||||
unitScale: 1,
|
||||
},
|
||||
],
|
||||
current: [
|
||||
{
|
||||
id: 0,
|
||||
unit: 'nA',
|
||||
unitScale: 1,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
unit: 'uA',
|
||||
unitScale: 1e3,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unit: 'mA',
|
||||
unitScale: 1e6,
|
||||
},
|
||||
],
|
||||
frequency: [ // Frequency
|
||||
{
|
||||
id: 0,
|
||||
unit: 'mHz',
|
||||
unitScale: 1,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
unit: 'Hz',
|
||||
unitScale: 1e3,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unit: 'kHz',
|
||||
unitScale: 1e6,
|
||||
},
|
||||
],
|
||||
impedance: [ // Impedance
|
||||
{
|
||||
id: 1,
|
||||
unit: 'Ω',
|
||||
unitScale: 1,
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
unit: 'mΩ',
|
||||
unitScale: 1e-3,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unit: 'kΩ',
|
||||
unitScale: 1e3,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
unit: 'MΩ',
|
||||
unitScale: 1e6,
|
||||
},
|
||||
],
|
||||
time: [ // Time
|
||||
{
|
||||
id: 0,
|
||||
unit: 'auto',
|
||||
unitScale: 1,
|
||||
},
|
||||
],
|
||||
phase: [ // Phase
|
||||
{
|
||||
id: 0,
|
||||
unit: '°',
|
||||
unitScale: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
destroyed () {
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="row flex sm12 xl12 md12 xs12 align--center my-0 py-0">
|
||||
<div class="flex sm6 xl6 md6 xs6 px-0 mx-0">
|
||||
Window Start
|
||||
<va-input
|
||||
@mouseleave.native="itemChange(startTime)"
|
||||
@keyup.enter="itemChange(startTime)"
|
||||
@blur="itemChange(startTime)"
|
||||
v-model="startTime"
|
||||
class="mb-0 flex-child"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
µs
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="flex sm6 xl6 md6 xs6 px-0 mx-0">
|
||||
Window Size
|
||||
<va-input
|
||||
@mouseleave.native="itemChange(windowLength)"
|
||||
@keyup.enter="itemChange(windowLength)"
|
||||
@blur="itemChange(windowLength)"
|
||||
v-model="windowLength"
|
||||
class="mb-0 flex-child"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
µs
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'change-window-start-and-size',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
},
|
||||
computed: {
|
||||
...mapFields('replay', [
|
||||
'startTime',
|
||||
'endTime',
|
||||
'windowLength',
|
||||
]),
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.windowLength = parseInt(this.endTime) - parseInt(this.startTime)
|
||||
},
|
||||
itemChange (val) {
|
||||
this.startTime = parseInt(this.startTime)
|
||||
this.windowLength = parseInt(this.windowLength)
|
||||
this.endTime = this.startTime + this.windowLength
|
||||
this.$emit('changeOverviewDataZoom')
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.flex-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-child {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.flex-child2 {
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.flex-child:first-child {
|
||||
margin-right: 1px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div>
|
||||
<va-button :icon="icon" @click="lockDataZoom"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { mapMutations } from 'vuex'
|
||||
import types from '@/store/modules/analysis/replay/types'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'lock-data-zoom',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
chartID: {
|
||||
type: Number, // detail data
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
icon: 'fa fa-unlock',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapFields('replay', [
|
||||
'chartData',
|
||||
'isLockDataZoom',
|
||||
]),
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
methods: {
|
||||
lockDataZoom () {
|
||||
this.isLockDataZoom = !this.isLockDataZoom
|
||||
this.lockDataZoomChart({
|
||||
chartAllData: this.chartData,
|
||||
chartID: 0,
|
||||
zoomLock: this.isLockDataZoom,
|
||||
})
|
||||
if (this.isLockDataZoom === true) {
|
||||
this.icon = 'fa fa-lock'
|
||||
} else if (this.isLockDataZoom === false) {
|
||||
this.icon = 'fa fa-unlock'
|
||||
}
|
||||
},
|
||||
...mapMutations('replay', [types.chart.lockDataZoom]),
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="box_inline-block"> use SD card data </span>
|
||||
<va-toggle flat small class="box_inline-block" v-model="useSdCardData"/>
|
||||
<va-toggle :disable="disableToggle" flat small class="box_inline-block" v-model="useSdCardData"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -15,20 +15,34 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapFields('replay', [
|
||||
'metaList',
|
||||
'useSdCardData',
|
||||
]),
|
||||
},
|
||||
props: {
|
||||
metaIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
disableToggle: true,
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
if (this.metaList[this.metaIndex].sd_data_uploaded === true) {
|
||||
this.disableToggle = false
|
||||
} else {
|
||||
this.disableToggle = true
|
||||
this.useSdCardData = false
|
||||
}
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
},
|
||||
|
||||
@@ -14,9 +14,6 @@ export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
deviceName: {
|
||||
type: String, // elite or neulive
|
||||
},
|
||||
metaIndex: {
|
||||
type: Number, // which meta file
|
||||
default: 0,
|
||||
@@ -26,6 +23,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceName: '',
|
||||
content: '',
|
||||
// [region] for neulive
|
||||
ampGainOptions: [
|
||||
@@ -281,6 +279,21 @@ export default {
|
||||
},
|
||||
],
|
||||
// [Endregion]
|
||||
// [region] for EliteEIS
|
||||
eisWorkingModeOptions: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'Potentiostatic Electrochemical Impedance Spectroscopy',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'CV',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Dev Tools',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -291,7 +304,8 @@ export default {
|
||||
watch: {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init (deviceName) {
|
||||
this.deviceName = deviceName
|
||||
const meta = this.metaList[this.metaIndex]
|
||||
const params = meta.parameter_set
|
||||
this.content += 'Duration: ' + parseInt(parseInt(meta.time_duration / 1000000) / 60) + ' m ' + parseInt((meta.time_duration % 60000000) / 1000000) + ' s<br/>'
|
||||
@@ -432,7 +446,7 @@ export default {
|
||||
this.content += ' Frequency: ' + String(1000 / period) + ' Hz' + '<br/>' // 1000 is cuz 1s = 1000ms
|
||||
this.content += ' Period: ' + String(period) + ' ms' + '<br/>'
|
||||
}
|
||||
} else if (this.deviceName === 'elite') {
|
||||
} else if (this.deviceName === 'EliteZM15') {
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
let showKey = ''
|
||||
let showValue = value
|
||||
@@ -528,6 +542,84 @@ export default {
|
||||
}
|
||||
this.content += ' ' + showKey + ': ' + showValue + '<br/>'
|
||||
}
|
||||
} else if (this.deviceName === 'EliteEIS') {
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
let showKey = ''
|
||||
let showValue = value
|
||||
if (key === 'MODE') {
|
||||
showKey = 'MODE'
|
||||
for (let i = 0; i < this.eisWorkingModeOptions.length; i++) {
|
||||
if (this.eisWorkingModeOptions[i].id === value) {
|
||||
showValue = this.eisWorkingModeOptions[i].description
|
||||
}
|
||||
}
|
||||
// EIS
|
||||
} else if (key === 'DC_BIAS') {
|
||||
showKey = 'DC Voltage'
|
||||
showValue = String(Math.round((parseInt(value) * 2200) / 4095)) + 'mV' // [TODO] unit
|
||||
} else if (key === 'AC_AMP') {
|
||||
showKey = 'AC Amplitude'
|
||||
showValue = String(Math.round(parseInt(value) / 2047 * 800)) // [TODO] unit
|
||||
} else if (key === 'FREQ_START') {
|
||||
showKey = 'Frequency Range Start'
|
||||
showValue = String(parseFloat(Math.round(parseFloat((value * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((value * 0.0149) * 100)) / 100).toFixed(1))
|
||||
} else if (key === 'FREQ_STOP') {
|
||||
showKey = 'Frequency Range End'
|
||||
showValue = String(parseFloat(Math.round(parseFloat((value * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((value * 0.0149) * 100)) / 100).toFixed(1))
|
||||
} else if (key === 'PPD') {
|
||||
showKey = 'Points Per Decades'
|
||||
showValue = value
|
||||
} else if (key === 'SCALE') {
|
||||
showKey = 'Point Spacing'
|
||||
const scaleArr = ['Logarithm', 'Linear']
|
||||
showValue = scaleArr[value]
|
||||
} else if (key === 'DELAY') {
|
||||
showKey = 'Delay'
|
||||
showValue = parseFloat((value / 10)).toFixed(1)
|
||||
} else if (key === 'AVERAGE_NUM') {
|
||||
showKey = 'Average'
|
||||
const numArr = ['2', '4', '6', '8']
|
||||
showValue = numArr[value]
|
||||
} else if (key === 'RTIA') {
|
||||
showKey = 'Current Range'
|
||||
const numArr = ['1', '2', '3', '4', 'Auto']
|
||||
showValue = numArr[value]
|
||||
// CV
|
||||
} else if (key === 'ADC_LEVEL_I_15') {
|
||||
showKey = 'Current Range'
|
||||
const currentRangeArr = ['<1.5 μA', '1-60 μA', '40-175 μA', '>120 uA', 'Auto']
|
||||
showValue = currentRangeArr[value]
|
||||
} else if (key === 'ADC_LEVEL_V_IN_15') {
|
||||
showKey = 'Voltage Range'
|
||||
const voltageInRangeArr = ['1', '2', '3', 'Auto']
|
||||
showValue = voltageInRangeArr[value]
|
||||
} else if (key === 'CTRL_HIGH_Z_15') {
|
||||
showKey = 'High Z'
|
||||
const highzArr = ['On', 'Off']
|
||||
showValue = highzArr[value]
|
||||
} else if (key === 'VOLT_INITIAL') {
|
||||
showKey = 'E Initial'
|
||||
showValue = parseInt((parseFloat(value) - 25000) / 5) / 1000 + 'V' // [TODO] unit
|
||||
} else if (key === 'VOLT_MAX') {
|
||||
showKey = 'E1'
|
||||
showValue = parseInt((parseFloat(value) - 25000) / 5) / 1000 + 'V' // [TODO] unit
|
||||
} else if (key === 'VOLT_MIN') {
|
||||
showKey = 'E2'
|
||||
showValue = parseInt((parseFloat(value) - 25000) / 5) / 1000 + 'V' // [TODO] unit
|
||||
} else if (key === 'Scan_Rate') {
|
||||
showKey = 'Voltage Scan Rate'
|
||||
showValue = parseFloat(value) / 100 // [TODO] unit
|
||||
} else if (key === 'SAMPLE_RATE') {
|
||||
showKey = 'Resolution'
|
||||
showValue = parseFloat(value) / 10 // [TODO] unit
|
||||
} else if (key === 'CYCLE_NUMBER') {
|
||||
showKey = 'Cycle'
|
||||
showValue = parseInt(value)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
this.content += ' ' + showKey + ': ' + showValue + '<br/>'
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -173,6 +173,9 @@
|
||||
{{transDeviceInfo(props.rowData.configuration)}}
|
||||
</template>
|
||||
<template slot="actions" slot-scope="props" >
|
||||
<va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
|
||||
<sd-card-button v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" :meta="props.rowData" :uuidList="SDuuidList" @refreshPage="refreshPage" @downloadSdCard="downloadSdCard"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`download ${props.rowData.name} in csv format`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" @click.stop="downloadCsv(props.rowData)"/>
|
||||
</va-popover>
|
||||
@@ -182,9 +185,6 @@
|
||||
<va-popover :message="`download ${props.rowData.name} in csv-edf format`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" @click.stop="downloadExcel(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
|
||||
<sd-card-button v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" :meta="props.rowData" @refreshPage="refreshPage" @downloadSdCard="downloadSdCard"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`replay ${props.rowData.name}`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-eye" v-if="props.rowData.type !== 'folder'" @click.stop="replay(props.rowData)"/>
|
||||
</va-popover>
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
term: null,
|
||||
perPage: '160',
|
||||
perPage: '80',
|
||||
perPageOptions: ['20', '40', '80', '160'],
|
||||
|
||||
fileLists: [],
|
||||
@@ -266,6 +266,7 @@ export default {
|
||||
height: '2rem',
|
||||
},
|
||||
},
|
||||
SDuuidList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -321,7 +322,7 @@ export default {
|
||||
{
|
||||
name: '__slot:actions',
|
||||
dataClass: 'text-right',
|
||||
width: '20%',
|
||||
width: '25%',
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -672,6 +673,16 @@ export default {
|
||||
window.open('http://' + href + '/#/download/csv/' + meta.id + '/sd')
|
||||
}
|
||||
},
|
||||
async getSDuuidList () {
|
||||
// const uuidList = ['32abdb14-fc0c-11eb-9aa8-dca6326cbc6b', '940ca938-f662-11eb-8a41-dca6326cbc6b']
|
||||
let uuidList = []
|
||||
const ret = await api.sdcard.getuuidList()
|
||||
if (ret.status === 200) {
|
||||
uuidList = ret.data.split(' ')
|
||||
}
|
||||
|
||||
return uuidList
|
||||
},
|
||||
replay: function (meta) {
|
||||
if (meta.device.library_name.includes('Neulive') === true) {
|
||||
// window.open('http://' + location.href.split('/')[2].split(':')[0] + '/#/admin/data-replay/' + meta.id)
|
||||
@@ -693,7 +704,8 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
async mounted () {
|
||||
this.SDuuidList = await this.getSDuuidList()
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<div/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { apiManager } from './apiManager'
|
||||
|
||||
export default {
|
||||
name: 'SdCardApiAction',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
metaID: '',
|
||||
mac_address: '',
|
||||
uuid: '',
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
initMetaInfo (meta) {
|
||||
this.metaID = meta.id
|
||||
this.mac_address = meta.device.device_address.toString()
|
||||
this.uuid = meta.uuid
|
||||
},
|
||||
async checkInSD (meta) {
|
||||
this.initMetaInfo(meta)
|
||||
this.pageToast('Start checking in SD card...')
|
||||
apiManager.startProgressBar()
|
||||
const result = await apiManager.call('Check_in_SD', this.metaID, this.mac_address, this.uuid)
|
||||
this.checkSDresult = result.data
|
||||
this.pageToast('In SD card: ' + this.checkSDresult)
|
||||
apiManager.endProgressBar()
|
||||
return result.data
|
||||
},
|
||||
async moveToDB (meta) {
|
||||
this.initMetaInfo(meta)
|
||||
this.pageToast('Start Moving to database...')
|
||||
apiManager.startProgressBar()
|
||||
await apiManager.call('Move_to_DB', this.metaID, this.mac_address, this.uuid)
|
||||
apiManager.endProgressBar()
|
||||
},
|
||||
async deleteSDCard (meta) {
|
||||
this.initMetaInfo(meta)
|
||||
this.pageToast('Start deleting in SD card...')
|
||||
apiManager.startProgressBar()
|
||||
await apiManager.call('Delete_SD', this.metaID, this.mac_address, this.uuid)
|
||||
apiManager.endProgressBar()
|
||||
},
|
||||
pageToast: function (mes) {
|
||||
this.showToast(
|
||||
mes,
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 4000,
|
||||
},
|
||||
)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
#nprogress .bar {
|
||||
background: red;
|
||||
}
|
||||
|
||||
#nprogress .spinner-icon {
|
||||
border-top-color: red;
|
||||
border-left-color: red;
|
||||
}
|
||||
</style>
|
||||
@@ -1,28 +1,45 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- recorded = false, no icon; recorded = true, gray icon; uploaded = true, blue icon; in uuid list: gray icon + red exclam -->
|
||||
<va-button
|
||||
flat
|
||||
small
|
||||
color="gray"
|
||||
:icon="icon"
|
||||
:disabled="isButtonDisable"
|
||||
@click.stop="checkButtonState()"
|
||||
:color="meta.sd_data_uploaded === true ? this.$themes.primary : 'gray'"
|
||||
v-show="meta.sd_data_record === true"
|
||||
:icon="meta.sd_data_uploaded === true ? 'fa fa-download' : 'fa fa-usb'"
|
||||
@click.stop="performButtonAction()"
|
||||
>
|
||||
<p :style="{color: this.$themes.danger}" class="display-6" v-show="!isButtonDisable && !isSdCardDataLoaded">
|
||||
<!-- span -->
|
||||
<p :style="{color: this.$themes.danger}" class="display-6" v-show="uuidList.includes(uuid) && !meta.sd_data_uploaded">
|
||||
!
|
||||
</p>
|
||||
</va-button>
|
||||
|
||||
<sd-card-api-action :ref="'sd_card_api'"/>
|
||||
<va-modal
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="moveToDBModal"
|
||||
size="small"
|
||||
:title="'UPLOAD SD CARD DATA'"
|
||||
:okText=" $t('modal.confirm') "
|
||||
@ok="moveToDB()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SdCardApiAction from './SdCardApiAction.vue'
|
||||
|
||||
import { apiManager } from './apiManager'
|
||||
export default {
|
||||
name: 'SdCardButton',
|
||||
components: {
|
||||
SdCardApiAction,
|
||||
},
|
||||
props: {
|
||||
uuidList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
meta: {
|
||||
type: Object,
|
||||
required: true,
|
||||
@@ -30,105 +47,60 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
isButtonDisable: false,
|
||||
isSdCardDataLoaded: false,
|
||||
moveToDBModal: false,
|
||||
checkSDresult: '',
|
||||
metaID: '',
|
||||
mac_address: '',
|
||||
uuid: '',
|
||||
icon: 'fa fa-eye',
|
||||
icon: 'fa fa-usb',
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
initMetaInfo () {
|
||||
init () {
|
||||
this.metaID = this.meta.id
|
||||
this.mac_address = this.meta.device.device_address.toString()
|
||||
this.uuid = this.meta.uuid
|
||||
},
|
||||
initButtonState () {
|
||||
const exist = this.meta.sd_data_exist // null, ture or false
|
||||
const uploaded = this.meta.sd_data_uploaded // null, ture or false
|
||||
if (exist === false) {
|
||||
this.isButtonDisable = true
|
||||
} else if (exist === true || exist === null) { // null: default value, mean it hasn't be checked yet
|
||||
this.isButtonDisable = false
|
||||
}
|
||||
|
||||
if (uploaded === false || uploaded === null) { // null: default value, mean it hasn't be uploaded yet
|
||||
this.isSdCardDataLoaded = false
|
||||
} else if (uploaded === true) {
|
||||
this.icon = 'fa fa-download'
|
||||
this.isSdCardDataLoaded = true
|
||||
}
|
||||
},
|
||||
init () {
|
||||
this.initMetaInfo()
|
||||
this.initButtonState()
|
||||
},
|
||||
async checkButtonState () {
|
||||
const exist = this.meta.sd_data_exist // null, ture or false
|
||||
const uploaded = this.meta.sd_data_uploaded // null, ture or false
|
||||
if (exist === null) {
|
||||
const checkResult = await this.checkInSD()
|
||||
if (checkResult === 'True') {
|
||||
await this.moveToDB()
|
||||
await this.deleteSDCard()
|
||||
this.$emit('refreshPage')
|
||||
}
|
||||
} else if (exist === true) {
|
||||
async performButtonAction () {
|
||||
const recorded = this.meta.sd_data_record // true or false
|
||||
const uploaded = this.meta.sd_data_uploaded // true or false
|
||||
if (recorded === true) {
|
||||
if (uploaded !== true) {
|
||||
await this.moveToDB()
|
||||
await this.deleteSDCard()
|
||||
this.$emit('refreshPage')
|
||||
const checkResult = await this.executeCheckInSD()
|
||||
if (checkResult === 'True') {
|
||||
this.moveToDBModal = true
|
||||
}
|
||||
} else {
|
||||
this.$emit('downloadSdCard', this.meta)
|
||||
this.executeDownload()
|
||||
}
|
||||
}
|
||||
},
|
||||
async checkInSD () {
|
||||
console.log('checkInSD')
|
||||
this.pageToast('Start checking in SD card')
|
||||
apiManager.startProgressBar()
|
||||
const result = await apiManager.call('Check_in_SD', this.metaID, this.mac_address, this.uuid)
|
||||
this.checkSDresult = result.data
|
||||
this.pageToast('In SD card: ' + this.checkSDresult)
|
||||
apiManager.endProgressBar()
|
||||
return result.data
|
||||
},
|
||||
async moveToDB () {
|
||||
console.log('moveToDB')
|
||||
this.pageToast('Start Moving to database...')
|
||||
apiManager.startProgressBar()
|
||||
await apiManager.call('Move_to_DB', this.metaID, this.mac_address, this.uuid)
|
||||
apiManager.endProgressBar()
|
||||
await this.executeUpload()
|
||||
this.$emit('refreshPage')
|
||||
},
|
||||
async deleteSDCard () {
|
||||
console.log('deleteSDCard')
|
||||
this.pageToast('Start deleting in SD card')
|
||||
apiManager.startProgressBar()
|
||||
await apiManager.call('Delete_SD', this.metaID, this.mac_address, this.uuid)
|
||||
apiManager.endProgressBar()
|
||||
console.log(status)
|
||||
async executeCheckInSD () {
|
||||
return await this.$refs.sd_card_api.checkInSD(this.meta)
|
||||
},
|
||||
pageToast: function (mes) {
|
||||
this.showToast(
|
||||
mes,
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 4000,
|
||||
},
|
||||
)
|
||||
async executeUpload () {
|
||||
await this.$refs.sd_card_api.moveToDB(this.meta)
|
||||
// remove delete sd card first, still have problem.
|
||||
// await this.$refs.sd_card_api.deleteSDCard(this.meta)
|
||||
},
|
||||
executeDownload () {
|
||||
this.$emit('downloadSdCard', this.meta)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
this.init()
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
watch: {
|
||||
watch: { // cuz data table will not call mounted
|
||||
meta: function (val) {
|
||||
this.init()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -176,7 +176,12 @@ export default {
|
||||
})
|
||||
this.channelSelectDisableX = false
|
||||
} else if (taskInfo.getDeviceInfo(this.deviceSelectX.id).info.library_name.indexOf('Elite') >= 0) {
|
||||
const channelSet = taskInfo.getDeviceInfo(this.deviceSelectX.id).parameterSet.CHANNEL_LABEL
|
||||
let channelSet
|
||||
if (taskInfo.getDeviceInfo(this.deviceSelectX.id).info.library_name === 'EliteEIS' && taskInfo.getDeviceInfo(this.deviceSelectX.id).parameterSet.MODE === 0) {
|
||||
channelSet = ['Zimag_Raw', 'Zreal_Raw', 'Frequency', 'Cycle', 'Zimag', 'Zreal', 'Impedance', 'Phase', 'Current', 'Level gain']
|
||||
} else {
|
||||
channelSet = taskInfo.getDeviceInfo(this.deviceSelectX.id).parameterSet.CHANNEL_LABEL
|
||||
}
|
||||
// console.log(channelSet)
|
||||
channelSet.forEach((element, index) => {
|
||||
channelOptions.push({
|
||||
@@ -238,7 +243,12 @@ export default {
|
||||
})
|
||||
this.channelSelectDisableY = false
|
||||
} else if (taskInfo.getDeviceInfo(this.deviceSelectY.id).info.library_name.indexOf('Elite') >= 0) {
|
||||
const channelSet = taskInfo.getDeviceInfo(this.deviceSelectY.id).parameterSet.CHANNEL_LABEL
|
||||
let channelSet
|
||||
if (taskInfo.getDeviceInfo(this.deviceSelectY.id).info.library_name === 'EliteEIS' && taskInfo.getDeviceInfo(this.deviceSelectY.id).parameterSet.MODE === 0) {
|
||||
channelSet = ['Zimag_Raw', 'Zreal_Raw', 'Frequency', 'Cycle', 'Zimag', 'Zreal', 'Impedance', 'Phase', 'Current', 'Level gain']
|
||||
} else {
|
||||
channelSet = taskInfo.getDeviceInfo(this.deviceSelectY.id).parameterSet.CHANNEL_LABEL
|
||||
}
|
||||
console.log(channelSet)
|
||||
channelSet.forEach((element, index) => {
|
||||
channelOptions.push({
|
||||
@@ -291,14 +301,22 @@ export default {
|
||||
if (this.deviceSelectX.name.indexOf('Neulive') >= 0) {
|
||||
deviceNameX = 'Neulive'
|
||||
} else if (this.deviceSelectX.name.indexOf('Elite') >= 0) {
|
||||
deviceNameX = 'Elite'
|
||||
if (taskInfo.getDeviceInfo(this.deviceSelectX.id).info.library_name === 'EliteEIS') {
|
||||
deviceNameX = 'EliteEIS'
|
||||
} else {
|
||||
deviceNameX = 'Elite'
|
||||
}
|
||||
} else if (this.deviceSelectX.name.indexOf('Time') >= 0) {
|
||||
deviceNameX = 'Time'
|
||||
}
|
||||
if (this.deviceSelectY.name.indexOf('Neulive') >= 0) {
|
||||
deviceNameY = 'Neulive'
|
||||
} else if (this.deviceSelectY.name.indexOf('Elite') >= 0) {
|
||||
deviceNameY = 'Elite'
|
||||
if (taskInfo.getDeviceInfo(this.deviceSelectY.id).info.library_name === 'EliteEIS') {
|
||||
deviceNameY = 'EliteEIS'
|
||||
} else {
|
||||
deviceNameY = 'Elite'
|
||||
}
|
||||
} else if (this.deviceSelectY.name.indexOf('Time') >= 0) {
|
||||
deviceNameY = 'Time'
|
||||
}
|
||||
|
||||
@@ -116,46 +116,42 @@ export default {
|
||||
this.$emit('remove', this.selectDevice)
|
||||
},
|
||||
start: async function (device) {
|
||||
const checkParam = await this.checkIfDeviceSetDoneParam({ device: device })
|
||||
const status = checkParam.status
|
||||
const message = checkParam.message
|
||||
if (status === true) {
|
||||
this.setArchiveSettings()
|
||||
// this.$emit('start', device)
|
||||
setTimeout(() => {
|
||||
this.$emit('start', device)
|
||||
}, 500)
|
||||
this.pageToast('The device ' + device.name + ' has been started.')
|
||||
} else {
|
||||
this.pageToast('The device cannot be started because:' + message)
|
||||
}
|
||||
// const checkParam = await this.checkIfDeviceSetDoneParam({ device: device })
|
||||
// const status = checkParam.status
|
||||
// const message = checkParam.message
|
||||
// if (status === true) {
|
||||
this.setArchiveSettings()
|
||||
// this.$emit('start', device)
|
||||
setTimeout(() => {
|
||||
this.$emit('start', device)
|
||||
}, 500)
|
||||
this.pageToast('The device ' + device.name + ' has been started.')
|
||||
// } else {
|
||||
// this.pageToast('The device cannot be started because:' + message)
|
||||
// }
|
||||
},
|
||||
stop: function (device) {
|
||||
if (!device.stopping) {
|
||||
this.$emit('stop', device)
|
||||
this.pageToast('The device ' + device.name + ' has been stopped.')
|
||||
}
|
||||
this.$emit('stop', device)
|
||||
this.pageToast('The device ' + device.name + ' has been stopped.')
|
||||
},
|
||||
record: async function (device) {
|
||||
const checkParam = await this.checkIfRecordingSetDoneParam({ device: device })
|
||||
const status = checkParam.status
|
||||
const message = checkParam.message
|
||||
if (status === true) {
|
||||
device.stopping = false
|
||||
this.setArchiveSettings()
|
||||
setTimeout(() => {
|
||||
this.$emit('record', device)
|
||||
}, 500)
|
||||
this.pageToast('The device ' + device.name + ' has been started.')
|
||||
} else {
|
||||
this.pageToast('Recording cannot be started because:' + message)
|
||||
}
|
||||
// const checkParam = await this.checkIfRecordingSetDoneParam({ device: device })
|
||||
// const status = checkParam.status
|
||||
// const message = checkParam.message
|
||||
// if (status === true) {
|
||||
// device.stopping = false
|
||||
this.setArchiveSettings()
|
||||
setTimeout(() => {
|
||||
this.$emit('record', device)
|
||||
}, 500)
|
||||
this.pageToast('The device ' + device.name + ' has been started.')
|
||||
// } else {
|
||||
// this.pageToast('Recording cannot be started because:' + message)
|
||||
// }
|
||||
},
|
||||
stopRecord: function (device) {
|
||||
if (!device.stopping) {
|
||||
this.$emit('stopRecord', device)
|
||||
this.pageToast('The device ' + device.name + ' has been stopped.')
|
||||
}
|
||||
this.$emit('stopRecord', device)
|
||||
this.pageToast('The device ' + device.name + ' has been stopped.')
|
||||
},
|
||||
generateChart: function (device) {
|
||||
this.$emit('generate', device)
|
||||
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
instruction: 'start',
|
||||
}))
|
||||
}
|
||||
device.stopping = false
|
||||
// device.stopping = false
|
||||
device.isSync = true
|
||||
this.$emit('refreshSetting')
|
||||
// ### show device info
|
||||
@@ -205,7 +205,7 @@ export default {
|
||||
instruction: 'interrupt',
|
||||
}))
|
||||
}
|
||||
device.stopping = true
|
||||
// device.stopping = true
|
||||
}
|
||||
},
|
||||
detectDevice: function (device) {
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
instruction: 'record',
|
||||
}))
|
||||
device.isSync = true
|
||||
device.stopping = false
|
||||
// device.stopping = false
|
||||
this.$emit('refreshSetting')
|
||||
api.task.update({
|
||||
device_config: taskInfo.getTaskInfo().deviceList,
|
||||
@@ -243,18 +243,16 @@ export default {
|
||||
}
|
||||
},
|
||||
stopRecord: function (device) {
|
||||
if (!device.stopping) {
|
||||
dataStreamBuffer.removeByDevice(taskInfo.getRawDeviceID(device.id))
|
||||
if (taskInfo.getDeviceInfo(device.id).info.isSync) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'device_instruction/0',
|
||||
device: taskInfo.getRawDeviceID(device.id),
|
||||
instruction: 'stop_record',
|
||||
}))
|
||||
}
|
||||
device.isSync = false
|
||||
device.stopping = true
|
||||
dataStreamBuffer.removeByDevice(taskInfo.getRawDeviceID(device.id))
|
||||
if (taskInfo.getDeviceInfo(device.id).info.isSync) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'device_instruction/0',
|
||||
device: taskInfo.getRawDeviceID(device.id),
|
||||
instruction: 'stop_record',
|
||||
}))
|
||||
}
|
||||
device.isSync = false
|
||||
// device.stopping = true
|
||||
},
|
||||
sti: function (device) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
@@ -361,7 +359,7 @@ export default {
|
||||
type: type,
|
||||
isSync: taskInfo.getDeviceInfoByRawID(selectID).info.isSync,
|
||||
isStimulate: taskInfo.getDeviceInfoByRawID(selectID).info.isStimulate,
|
||||
stopping: false,
|
||||
// stopping: false,
|
||||
}
|
||||
this.deviceList.push(_device)
|
||||
this.deviceSelect = ''
|
||||
|
||||
@@ -395,6 +395,7 @@ export default {
|
||||
this.measureEocButton.status = false
|
||||
},
|
||||
refresh () {
|
||||
// taskInfo.getDeviceInfo(this.deviceID).parameterSet.CHANNEL_LABEL = ['Z_image_Raw', 'Z_Real_Raw', 'Frequency', 'Cycle', 'Z_imag', 'Z_real', 'Impedance', 'Phase', 'Current', 'Level gain']
|
||||
this.workingModeSelect = this.workingModeOptions[taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE]
|
||||
if (this.workingModeSelect != null) {
|
||||
this.workingModeSelectChange(this.workingModeSelect)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<elite-parameter-recording v-if="eliteVer=='1'" :ref="'rec_ref'" :deviceID="deviceID"/>
|
||||
<elite-parameter-recording v-if="eliteVer=='1'" :ref="'rec_ref_1'" :deviceID="deviceID"/>
|
||||
<!-- <elite-parameter-recording-elitezm15 :ref="'rec_ref'" :deviceID="deviceID"/> -->
|
||||
<!--<elite-parameter-recording :ref="'rec_ref'" :deviceID="deviceID"/>-->
|
||||
<elite-parameter-recording-elitezm15 v-else-if="eliteVer=='2'" :ref="'rec_ref'" :deviceID="deviceID"/>
|
||||
<elite-parameter-recording-elite-e-i-s v-else :ref="'rec_ref'" :deviceID="deviceID"/>
|
||||
<elite-parameter-recording-elitezm15 v-else-if="eliteVer=='2'" :ref="'rec_ref_2'" :deviceID="deviceID"/>
|
||||
<elite-parameter-recording-elite-e-i-s v-else :ref="'rec_ref_4'" :deviceID="deviceID"/>
|
||||
<!--<elite-parameter-recording :ref="'rec_ref'" :deviceID="deviceID"/>-->
|
||||
|
||||
</div>
|
||||
@@ -53,6 +53,8 @@ export default {
|
||||
} else if (JSON.stringify(ver.slice(0, 4)) === JSON.stringify([0, 2, 1, 7])) {
|
||||
this.eliteVer = '3' // megafly
|
||||
// console.log('3:', JSON.stringify(ver.slice(0, 4)), ',', JSON.stringify([0, 2, 1, 7]))
|
||||
} else {
|
||||
this.eliteVer = '4'
|
||||
}
|
||||
},
|
||||
mqttPub: function (topic, mes) {
|
||||
@@ -70,11 +72,35 @@ export default {
|
||||
this.compareEliteVer(taskInfo.getDeviceInfo(this.deviceID).info.serial_number)
|
||||
},
|
||||
refresh: function () {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.rec_ref != null) {
|
||||
this.$refs.rec_ref.refresh()
|
||||
}
|
||||
})
|
||||
// console.log(this.eliteVer)
|
||||
switch (this.eliteVer) {
|
||||
case '1':
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.rec_ref_1 != null) {
|
||||
this.$refs.rec_ref_1.refresh()
|
||||
}
|
||||
})
|
||||
break
|
||||
case '2':
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.rec_ref_2 != null) {
|
||||
this.$refs.rec_ref_2.refresh()
|
||||
}
|
||||
})
|
||||
break
|
||||
case '4':
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.rec_ref_4 != null) {
|
||||
this.$refs.rec_ref_4.refresh()
|
||||
}
|
||||
})
|
||||
break
|
||||
}
|
||||
// this.$nextTick(() => {
|
||||
// if (this.$refs.rec_ref != null) {
|
||||
// this.$refs.rec_ref.refresh()
|
||||
// }
|
||||
// })
|
||||
// console.log('window:3,refresh(this.$nextTick:', this.$nextTick, ',this.$refs:', this.$refs, ')')
|
||||
},
|
||||
|
||||
|
||||
@@ -689,8 +689,13 @@ export default {
|
||||
}
|
||||
|
||||
this.autoComputeT4()
|
||||
const check1 = this.checkIndividualTRange(1, this.t1Range)
|
||||
const check2 = this.checkIndividualTRange(2, this.t2Range)
|
||||
const check3 = this.checkIndividualTRange(3, this.t3Range)
|
||||
const check4 = this.checkIndividualTRange(4, this.t4Range)
|
||||
if (check4) {
|
||||
|
||||
// if pass, call this.updateTimeRange(), if any fail, call updateErrorMsg in this.checkIndividualTRange()
|
||||
if (check1 === true && check2 === true && check3 === true && check4 === true) {
|
||||
this.updateTimeRange()
|
||||
}
|
||||
this.updateStiTRangeCheckParam()
|
||||
|
||||
@@ -31,6 +31,16 @@ async function getByID (channel, id) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getExistOrNotByID (channel, id) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get(`/api/file/mini/get_exist_or_not_by_id/${channel}/${id}`, { responseType: 'json', headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function getByParent (channel, parent) {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
@@ -85,6 +95,7 @@ const mini = {
|
||||
update,
|
||||
clearDel,
|
||||
getByID,
|
||||
getExistOrNotByID,
|
||||
getByParent,
|
||||
getAttrByParent,
|
||||
getAttrByID,
|
||||
|
||||
@@ -31,10 +31,21 @@ async function upload (attrs) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getuuidList () {
|
||||
const _header = auth.getHeader()
|
||||
try {
|
||||
return await api.axios.get('/api/file/sdcard/get', { headers: _header })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const sdcard = {
|
||||
exist,
|
||||
deleted,
|
||||
upload,
|
||||
getuuidList,
|
||||
}
|
||||
|
||||
export default sdcard
|
||||
|
||||
@@ -66,6 +66,10 @@ export const download = {
|
||||
await this.parseRawData(_data.data, prevLastTime, meta, result[channelID])
|
||||
return result
|
||||
},
|
||||
getMiniExistOrNotByID: async function (id, channel) {
|
||||
const result = await api.mini.getExistOrNotByID(channel, id)
|
||||
return result
|
||||
},
|
||||
rawByIDChannels: async function (id, channel, meta) {
|
||||
const data = []
|
||||
const rawData = await api.raw.getByID(channel, id)
|
||||
|
||||
+35
-22
@@ -9,32 +9,45 @@ const ChannelMaxNumber = 16
|
||||
|
||||
// const getTimeInDateTime = /(\d{4}),(\d{1,2}),(\d{1,2}),(\d{1,2}),(\d{1,2}),(\d{1,2})/
|
||||
|
||||
const hasCycleMode = (mode) => {
|
||||
if (mode === 1 || mode === 7) {
|
||||
return true
|
||||
const hasCycleMode = (mode, lib) => {
|
||||
if (lib !== 'EliteEIS') {
|
||||
if (mode === 1 || mode === 7) {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
if (mode === 1) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const getDefaultChartTypeByMode = (mode) => {
|
||||
// 1: I, 2: V, 3: R
|
||||
const settings = {}
|
||||
settings[0] = ['Elite', 2, 'Elite', 1]
|
||||
settings[1] = ['Elite', 2, 'Elite', 1]
|
||||
settings[2] = ['Time', 2, 'Elite', 2]
|
||||
settings[3] = ['Time', 2, 'Elite', 3]
|
||||
settings[4] = ['Time', 2, 'Elite', 2]
|
||||
settings[5] = ['Time', 2, 'Elite', 1]
|
||||
settings[6] = ['Time', 2, 'Elite', 2]
|
||||
settings[7] = ['Elite', 2, 'Elite', 1]
|
||||
settings[8] = ['Elite', 2, 'Elite', 1]
|
||||
settings[9] = ['Time', 2, 'Elite', 1]
|
||||
settings[10] = ['Elite', 2, 'Elite', 1]
|
||||
settings[11] = ['Time', 2, 'Elite', 1]
|
||||
settings[13] = ['Time', 2, 'Elite', 2]
|
||||
settings[14] = ['Time', 2, 'Elite', 2]
|
||||
settings[15] = ['Elite', 2, 'Elite', 1]
|
||||
return settings[mode]
|
||||
const getDefaultChartTypeByMode = (mode, lib) => {
|
||||
if (lib !== 'EliteEIS') {
|
||||
const settings = {}
|
||||
settings[0] = ['Elite', 2, 'Elite', 1]
|
||||
settings[1] = ['Elite', 2, 'Elite', 1]
|
||||
settings[2] = ['Time', 2, 'Elite', 2]
|
||||
settings[3] = ['Time', 2, 'Elite', 3]
|
||||
settings[4] = ['Time', 2, 'Elite', 2]
|
||||
settings[5] = ['Time', 2, 'Elite', 1]
|
||||
settings[6] = ['Time', 2, 'Elite', 2]
|
||||
settings[7] = ['Elite', 2, 'Elite', 1]
|
||||
settings[8] = ['Elite', 2, 'Elite', 1]
|
||||
settings[9] = ['Time', 2, 'Elite', 1]
|
||||
settings[10] = ['Elite', 2, 'Elite', 1]
|
||||
settings[11] = ['Time', 2, 'Elite', 1]
|
||||
settings[13] = ['Time', 2, 'Elite', 2]
|
||||
settings[14] = ['Time', 2, 'Elite', 2]
|
||||
settings[15] = ['Elite', 2, 'Elite', 1]
|
||||
return settings[mode]
|
||||
} else {
|
||||
const settings = {}
|
||||
settings[0] = ['EliteEIS', 6, 'EliteEIS', 5]
|
||||
settings[1] = ['Elite', 2, 'Elite', 1]
|
||||
settings[2] = ['Time', 2, 'Elite', 2]
|
||||
return settings[mode]
|
||||
}
|
||||
}
|
||||
|
||||
const transMac = (rawAddr) => {
|
||||
|
||||
@@ -150,6 +150,43 @@ function getLegendName (sourceList, formulaID) {
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
switch (source.channel) {
|
||||
case 1:
|
||||
legendName += 'E' + source.id + '-Zimag_raw'
|
||||
break
|
||||
case 2:
|
||||
legendName += 'E' + source.id + '-Zreal_raw'
|
||||
break
|
||||
case 3:
|
||||
legendName += 'E' + source.id + '-Freq'
|
||||
break
|
||||
case 4:
|
||||
legendName += 'E' + source.id + '-Cycle'
|
||||
break
|
||||
case 5:
|
||||
legendName += 'E' + source.id + '-Zimag'
|
||||
break
|
||||
case 6:
|
||||
legendName += 'E' + source.id + '-Zreal'
|
||||
break
|
||||
case 7:
|
||||
legendName += 'E' + source.id + '-Imped'
|
||||
break
|
||||
case 8:
|
||||
legendName += 'E' + source.id + '-Phase'
|
||||
break
|
||||
case 9:
|
||||
legendName += 'E' + source.id + '-Current'
|
||||
break
|
||||
case 10:
|
||||
legendName += 'E' + source.id + '-Level_gain'
|
||||
break
|
||||
default:
|
||||
legendName += 'E' + source.id + 'CH' + source.channel
|
||||
break
|
||||
}
|
||||
break
|
||||
default:
|
||||
legendName += 'D' + source.id + 'CH' + source.channel
|
||||
break
|
||||
@@ -684,7 +721,7 @@ export const chartData = {
|
||||
|
||||
const _chartRegisterDevice = (chartID, device) => {
|
||||
if (taskInfo.getDeviceInfo(device.id).info.library_name.indexOf('Elite') >= 0) {
|
||||
const setting = global_.getDefaultChartTypeByMode(taskInfo.getDeviceInfo(device.id).parameterSet.MODE)
|
||||
const setting = global_.getDefaultChartTypeByMode(taskInfo.getDeviceInfo(device.id).parameterSet.MODE, taskInfo.getDeviceInfo(device.id).info.library_name)
|
||||
console.log(setting)
|
||||
const xType = setting[0]
|
||||
const xValue = setting[1]
|
||||
@@ -693,31 +730,68 @@ export const chartData = {
|
||||
chartRegister(chartID, 0, xType, device.id, xValue, yType, device.id, yValue, null)
|
||||
_chartData[chartID].chartDevice = 'elite'
|
||||
_chartData[chartID].chartMode = taskInfo.getDeviceInfo(device.id).parameterSet.MODE
|
||||
switch (xValue) {
|
||||
case 1:
|
||||
_chartData[chartID].chartXUnit = 'uA' // nA * 1000
|
||||
break
|
||||
case 2:
|
||||
_chartData[chartID].chartXUnit = 'mV' // uV * 1000
|
||||
break
|
||||
case 3:
|
||||
_chartData[chartID].chartXUnit = 'Ω' // mOhm * 1000
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
switch (yValue) {
|
||||
case 1:
|
||||
_chartData[chartID].chartYUnit = 'uA'
|
||||
break
|
||||
case 2:
|
||||
_chartData[chartID].chartYUnit = 'mV'
|
||||
break
|
||||
case 3:
|
||||
_chartData[chartID].chartYUnit = 'Ω'
|
||||
break
|
||||
default:
|
||||
break
|
||||
if (taskInfo.getDeviceInfo(device.id).info.library_name === 'EliteEIS') {
|
||||
switch (xValue) {
|
||||
case 3:
|
||||
_chartData[chartID].chartXUnit = 'mHz'
|
||||
break
|
||||
case 4:
|
||||
_chartData[chartID].chartXUnit = 'cycle'
|
||||
break
|
||||
case 8:
|
||||
_chartData[chartID].chartXUnit = '˚'
|
||||
break
|
||||
case 9:
|
||||
_chartData[chartID].chartXUnit = 'nA'
|
||||
break
|
||||
default:
|
||||
_chartData[chartID].chartXUnit = 'ohm'
|
||||
break
|
||||
}
|
||||
switch (yValue) {
|
||||
case 3:
|
||||
_chartData[chartID].chartYUnit = 'mHz'
|
||||
break
|
||||
case 4:
|
||||
_chartData[chartID].chartYUnit = 'cycle'
|
||||
break
|
||||
case 8:
|
||||
_chartData[chartID].chartYUnit = '˚'
|
||||
break
|
||||
case 9:
|
||||
_chartData[chartID].chartYUnit = 'nA'
|
||||
break
|
||||
default:
|
||||
_chartData[chartID].chartYUnit = 'ohm'
|
||||
break
|
||||
}
|
||||
} else {
|
||||
switch (xValue) {
|
||||
case 1:
|
||||
_chartData[chartID].chartXUnit = 'uA' // nA * 1000
|
||||
break
|
||||
case 2:
|
||||
_chartData[chartID].chartXUnit = 'mV' // uV * 1000
|
||||
break
|
||||
case 3:
|
||||
_chartData[chartID].chartXUnit = 'Ω' // mOhm * 1000
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
switch (yValue) {
|
||||
case 1:
|
||||
_chartData[chartID].chartYUnit = 'uA'
|
||||
break
|
||||
case 2:
|
||||
_chartData[chartID].chartYUnit = 'mV'
|
||||
break
|
||||
case 3:
|
||||
_chartData[chartID].chartYUnit = 'Ω'
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if (taskInfo.getDeviceInfo(device.id).info.library_name.indexOf('Neulive') >= 0) {
|
||||
const channelSet = taskInfo.getDeviceInfo(device.id).parameterSet.RECORDING_CH.toString(2).split('').reverse()
|
||||
@@ -993,6 +1067,39 @@ const chartRegister = (chartID, gridIndex, deviceNameX, deviceIDX, channelX, dev
|
||||
default:
|
||||
break
|
||||
}
|
||||
} else if (sourceList[0].name === 'EliteEIS') {
|
||||
switch (sourceList[0].channel) {
|
||||
case 3:
|
||||
_chartData[chartID].xAxis[_xAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'mHz'
|
||||
}
|
||||
_chartData[chartID].chartXUnit = 'mHz' // nA * 1000
|
||||
break
|
||||
case 4:
|
||||
_chartData[chartID].xAxis[_xAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'cycle'
|
||||
}
|
||||
_chartData[chartID].chartXUnit = 'cycle' // nA * 1000
|
||||
break
|
||||
case 8:
|
||||
_chartData[chartID].xAxis[_xAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + '˚'
|
||||
}
|
||||
_chartData[chartID].chartXUnit = '˚' // nA * 1000
|
||||
break
|
||||
case 9:
|
||||
_chartData[chartID].xAxis[_xAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'nA'
|
||||
}
|
||||
_chartData[chartID].chartXUnit = 'nA'
|
||||
break
|
||||
default:
|
||||
_chartData[chartID].xAxis[_xAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'ohm'
|
||||
}
|
||||
_chartData[chartID].chartXUnit = 'ohm'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// set yAxis format
|
||||
@@ -1057,6 +1164,39 @@ const chartRegister = (chartID, gridIndex, deviceNameX, deviceIDX, channelX, dev
|
||||
default:
|
||||
break
|
||||
}
|
||||
} else if (sourceList[1].name === 'EliteEIS') {
|
||||
switch (sourceList[1].channel) {
|
||||
case 3:
|
||||
_chartData[chartID].yAxis[_yAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'mHz'
|
||||
}
|
||||
_chartData[chartID].chartYUnit = 'mHz' // nA * 1000
|
||||
break
|
||||
case 4:
|
||||
_chartData[chartID].yAxis[_yAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'cycle'
|
||||
}
|
||||
_chartData[chartID].chartYUnit = 'cycle' // nA * 1000
|
||||
break
|
||||
case 8:
|
||||
_chartData[chartID].yAxis[_yAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + '˚'
|
||||
}
|
||||
_chartData[chartID].chartYUnit = '˚' // nA * 1000
|
||||
break
|
||||
case 9:
|
||||
_chartData[chartID].yAxis[_yAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'nA'
|
||||
}
|
||||
_chartData[chartID].chartYUnit = 'nA'
|
||||
break
|
||||
default:
|
||||
_chartData[chartID].yAxis[_yAxisIndex].axisLabel.formatter = function (val) {
|
||||
return val + 'ohm'
|
||||
}
|
||||
_chartData[chartID].chartYUnit = 'ohm'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// register series into grid
|
||||
@@ -1093,6 +1233,46 @@ const chartRegister = (chartID, gridIndex, deviceNameX, deviceIDX, channelX, dev
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
_chartData[chartID].series[_chartData[chartID].series.length - 1].showSymbol = true
|
||||
_chartData[chartID].series[_chartData[chartID].series.length - 1].showAllSymbol = true
|
||||
dataStreamBuffer.register(chartID, taskInfo.getRawDeviceID(source.id), source.channel)
|
||||
switch (source.channel) {
|
||||
case 1:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZIMAG_RAW')
|
||||
break
|
||||
case 2:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZREAL_RAW')
|
||||
break
|
||||
case 3:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' FREQ')
|
||||
break
|
||||
case 4:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CYCLE')
|
||||
break
|
||||
case 5:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZIMAG')
|
||||
break
|
||||
case 6:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZREAL')
|
||||
break
|
||||
case 7:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' IMPEDANCE')
|
||||
break
|
||||
case 8:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' PHASE')
|
||||
break
|
||||
case 9:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CURRENT')
|
||||
break
|
||||
case 10:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' LEVEL_GAIN')
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
}
|
||||
break
|
||||
default:
|
||||
dataStreamBuffer.register(chartID, taskInfo.getRawDeviceID(source.id), source.channel)
|
||||
_axisList.push(_axis + ' AXIS = DEVICE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
@@ -1115,7 +1295,15 @@ const chartRegister = (chartID, gridIndex, deviceNameX, deviceIDX, channelX, dev
|
||||
if (_chartData[chartID].gridSource[gridIndex] == null) {
|
||||
_chartData[chartID].gridSource[gridIndex] = []
|
||||
}
|
||||
_chartData[chartID].gridSource[gridIndex].push(_gridSeries)
|
||||
let repeat = false
|
||||
_chartData[chartID].gridSource[gridIndex].forEach(s => {
|
||||
if (s.name === _gridSeries.name) {
|
||||
repeat = true
|
||||
}
|
||||
})
|
||||
if (!repeat) {
|
||||
_chartData[chartID].gridSource[gridIndex].push(_gridSeries)
|
||||
}
|
||||
|
||||
// console.log(_chartData[chartID])
|
||||
return _chartData[chartID]
|
||||
|
||||
@@ -97,8 +97,8 @@ export const dataStreamBuffer = {
|
||||
// }
|
||||
// lastTime = samplingTime
|
||||
// })
|
||||
|
||||
_dataStreamBuffer[chart][currentDeviceID][currentChannel].push(dataBatch)
|
||||
const _dataBatch = Array.from(dataBatch)
|
||||
_dataStreamBuffer[chart][currentDeviceID][currentChannel].push(_dataBatch)
|
||||
if (_dataStreamBuffer[chart][currentDeviceID][currentChannel].length > _dataStreamBufferSize) {
|
||||
_dataStreamBuffer[chart][currentDeviceID][currentChannel].shift()
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ function newDataZoom () {
|
||||
height: '10px',
|
||||
// realtime: false,
|
||||
bottom: '8%',
|
||||
zoomLock: false,
|
||||
handleStyle: {
|
||||
shadowColor: 'rgba(0, 0, 0, 0)',
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ function newSeries (type, legendName, xAxisIndex, yAxisIndex, xAxisSource, yAxis
|
||||
// symbol: 'circle',
|
||||
showSymbol: false,
|
||||
showAllSymbol: false,
|
||||
symbolSize: 2,
|
||||
symbolSize: 4,
|
||||
// [modified 2021/08/10] sampling method managed by vuex
|
||||
// sampling: 'average',
|
||||
// sampling: function (frame) {
|
||||
|
||||
@@ -115,6 +115,40 @@ function getLegendName (sourceList) {
|
||||
case 3:
|
||||
legendName += '' + source.id + '-R'
|
||||
break
|
||||
case 4:
|
||||
legendName += '' + source.id + '-Cycle'
|
||||
break
|
||||
default:
|
||||
legendName += '' + source.id + 'CH' + source.channel
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
switch (source.channel) {
|
||||
case 3:
|
||||
legendName += '' + source.id + '-Frequency'
|
||||
break
|
||||
case 4:
|
||||
legendName += '' + source.id + '-Cycle'
|
||||
break
|
||||
case 5:
|
||||
legendName += '' + source.id + '-Z_imag'
|
||||
break
|
||||
case 6:
|
||||
legendName += '' + source.id + '-Z_real'
|
||||
break
|
||||
case 7:
|
||||
legendName += '' + source.id + '-Impedance'
|
||||
break
|
||||
case 8:
|
||||
legendName += '' + source.id + '-Phase'
|
||||
break
|
||||
case 9:
|
||||
legendName += '' + source.id + '-Current'
|
||||
break
|
||||
case 10:
|
||||
legendName += '' + source.id + '-Gain Level'
|
||||
break
|
||||
default:
|
||||
legendName += '' + source.id + 'CH' + source.channel
|
||||
break
|
||||
@@ -394,11 +428,45 @@ const actions = {
|
||||
case 3:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' RESISTANCE')
|
||||
break
|
||||
case 4:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CYCLE')
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
switch (source.channel) {
|
||||
case 3:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Frequency')
|
||||
break
|
||||
case 4:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Cycle')
|
||||
break
|
||||
case 5:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Z_imag')
|
||||
break
|
||||
case 6:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Z_real')
|
||||
break
|
||||
case 7:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Impedance')
|
||||
break
|
||||
case 8:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Phase')
|
||||
break
|
||||
case 9:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Current')
|
||||
break
|
||||
case 10:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Gain Level')
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
}
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = DEVICE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
|
||||
@@ -41,6 +41,40 @@ function getLegendName (sourceList) {
|
||||
case 3:
|
||||
legendName += '' + source.id + '-R'
|
||||
break
|
||||
case 4:
|
||||
legendName += '' + source.id + '-Cycle'
|
||||
break
|
||||
default:
|
||||
legendName += '' + source.id + 'CH' + source.channel
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
switch (source.channel) {
|
||||
case 3:
|
||||
legendName += '' + source.id + '-Frequency'
|
||||
break
|
||||
case 4:
|
||||
legendName += '' + source.id + '-Cycle'
|
||||
break
|
||||
case 5:
|
||||
legendName += '' + source.id + '-Z_imag'
|
||||
break
|
||||
case 6:
|
||||
legendName += '' + source.id + '-Z_real'
|
||||
break
|
||||
case 7:
|
||||
legendName += '' + source.id + '-Impedance'
|
||||
break
|
||||
case 8:
|
||||
legendName += '' + source.id + '-Phase'
|
||||
break
|
||||
case 9:
|
||||
legendName += '' + source.id + '-Current'
|
||||
break
|
||||
case 10:
|
||||
legendName += '' + source.id + '-Gain Level'
|
||||
break
|
||||
default:
|
||||
legendName += '' + source.id + 'CH' + source.channel
|
||||
break
|
||||
@@ -266,11 +300,45 @@ const chartMutations = {
|
||||
case 3:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' RESISTANCE')
|
||||
break
|
||||
case 4:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CYCLE')
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'EliteEIS':
|
||||
switch (source.channel) {
|
||||
case 3:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Frequency')
|
||||
break
|
||||
case 4:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Cycle')
|
||||
break
|
||||
case 5:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Z_imag')
|
||||
break
|
||||
case 6:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Z_real')
|
||||
break
|
||||
case 7:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Impedance')
|
||||
break
|
||||
case 8:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Phase')
|
||||
break
|
||||
case 9:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Current')
|
||||
break
|
||||
case 10:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' Gain Level')
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
}
|
||||
break
|
||||
default:
|
||||
_axisList.push(_axis + ' AXIS = DEVICE ' + source.id + ' CHANNEL ' + source.channel)
|
||||
break
|
||||
@@ -330,6 +398,29 @@ const chartMutations = {
|
||||
state.chartData[payload.chartID].series[payload.seriesIndex].sampling = payload.method
|
||||
},
|
||||
|
||||
/**
|
||||
* lock dataZoom
|
||||
*
|
||||
* @param {object} chartAllData
|
||||
* @param {int} chartID
|
||||
* @param {bool} zoomLock
|
||||
*/
|
||||
[typePath.lockDataZoom]: (state, payload) => {
|
||||
if (payload.zoomLock === true || payload.zoomLock === false) {
|
||||
payload.chartAllData[payload.chartID].dataZoom[0].zoomLock = payload.zoomLock
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* for manually set datazoom start and end
|
||||
*
|
||||
*/
|
||||
[typePath.setOverviewDataZoomStartAndEnd]: (state, payload) => {
|
||||
if (state.chartOverviewData.dataZoom != null) {
|
||||
state.chartOverviewData.dataZoom[0].start = 0
|
||||
state.chartOverviewData.dataZoom[0].end = 100
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default chartMutations
|
||||
|
||||
@@ -17,6 +17,9 @@ function newState () {
|
||||
chartData: {},
|
||||
chartOverviewData: {},
|
||||
chartDetailData: {},
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
windowLength: 0,
|
||||
startTimeCurrent: 0,
|
||||
endTimeCurrent: 0,
|
||||
currentScale: '0',
|
||||
@@ -29,6 +32,7 @@ function newState () {
|
||||
valueFormatY: {},
|
||||
showCyclePanel: false,
|
||||
useSdCardData: false,
|
||||
isLockDataZoom: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ const types = {
|
||||
updateRegistered: 'updateRegisteredChart',
|
||||
updateAxisSplitNumber: 'updateAxisSplitNumberChart',
|
||||
updateChartSampling: 'updateChartSamplingChart',
|
||||
lockDataZoom: 'lockDataZoomChart',
|
||||
setOverviewDataZoomStartAndEnd: 'setOverviewDataZoomStartAndEndChart',
|
||||
},
|
||||
meta: {
|
||||
init: 'initMeta',
|
||||
|
||||
Reference in New Issue
Block a user