Compare commits

...

3 Commits

Author SHA1 Message Date
peterlu14 a0fea97ca7 [update] differential 2022-08-19 18:56:12 +08:00
peterlu14 82f46030a3 [update] fix realtime unit function type 2022-08-19 16:17:57 +08:00
peterlu14 8052dfcbf4 [update] file table fix 2022-08-19 15:55:14 +08:00
6 changed files with 53 additions and 33 deletions
+7 -6
View File
@@ -179,7 +179,7 @@
{{ props.rowData.name }}
</template>
<template slot="parameter_set" slot-scope="props">
{{ (props.rowData.type==='folder') ? '' : getWorkingMode(props.rowData.device.library_name, props.rowData.parameter_set.MODE) }}
{{ getWorkingMode(props.rowData) }}
</template>
<template slot="created_at" slot-scope="props">
{{transDate(props.rowData.created_at)}}
@@ -427,7 +427,7 @@ export default {
// call getfolder api and update
const folders = await api.collection.getByParent('folder', info.id)
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -447,7 +447,7 @@ export default {
this.currentInfo = item
// call getfolder api and update
const folders = await api.collection.getByParent('folder', item.id)
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -468,7 +468,7 @@ export default {
if (initCollection.data.length === 1) {
this.currentInfo = initCollection.data[0]
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
this.fileLists = file.getFileList()
@@ -771,9 +771,10 @@ export default {
})
}
},
getWorkingMode: function (library, mode) {
getWorkingMode: function (rowData) {
try {
return configTable.getModeConfig(library, mode).name
if (rowData.type === 'folder') return ''
return configTable.getModeConfig(rowData.device.library_name, rowData.parameter_set.MODE).name
} catch {
return ''
}
@@ -241,19 +241,24 @@ export default {
const dataX = []
const dataY = []
const time = []
for (index = 0; index < dataLength; index++) {
const dsample = 1
const m = parseInt((this.sgFilterArgument.windowSize - 1) / 2)
for (index = 0; index < dataLength; index += dsample) {
dataX.push(seriesData[index][0])
dataY.push(seriesData[index][1])
dataY.push(seriesData[index][1] * 1e-9)
time.push(seriesData[index][2])
}
// console.log(time[time.length - 1], time[0])
// console.log(dataX.length, time[time.length - 1] - time[0], dataX.length * 1e6 / (time[time.length - 1] - time[0]))
// console.log('dataX', dataX)
// console.log('dataY', dataY)
// console.log('time', time)
const filteredData = sgFilter(dataY, this.sgFilterArgument.windowSize, this.sgFilterArgument.polynomial)
// console.log('filterdData', filteredData)
const filteredData = sgFilter(dataY, this.sgFilterArgument.windowSize, this.sgFilterArgument.polynomial, parseInt(dataX.length * 1e6 / (time[time.length - 1] - time[0])))
console.log('filterdData', filteredData)
for (index = 0; index < dataLength; index++) {
_data.push([dataX[index], filteredData[index], time[index]])
for (index = 0; index < filteredData.length; index++) {
_data.push([dataX[index + m], filteredData[index], time[index + m]])
}
// for (index = 0; index < dataLength; index++) {
@@ -424,6 +429,8 @@ export default {
},
async mounted () {
this.rawData = this.chartData[this.chartID]
// const test = [3.0, 12.9, 22.6, 32.10000000000001, 41.4, 50.5, 59.400000000000006, 68.1, 76.6, 84.9, 93.0, 100.9, 108.60000000000001, 116.1, 123.39999999999999, 130.5, 137.4, 144.10000000000002, 150.6, 156.9, 163.0, 168.9, 174.60000000000002, 180.10000000000002, 185.4, 190.5, 195.39999999999998, 200.1, 204.59999999999997, 208.90000000000003, 213.0, 216.89999999999998, 220.59999999999997, 224.09999999999997, 227.40000000000003, 230.5, 233.39999999999998, 236.1, 238.6, 240.90000000000003, 243.0, 244.9, 246.6, 248.10000000000002, 249.40000000000003, 250.5, 251.40000000000003, 252.09999999999997, 252.6, 252.9, 253.0, 252.90000000000003, 252.59999999999997, 252.10000000000002, 251.39999999999998, 250.5, 249.39999999999992, 248.09999999999997, 246.60000000000002, 244.89999999999998, 243.0, 240.89999999999992, 238.59999999999997, 236.10000000000002, 233.39999999999992, 230.5, 227.39999999999992, 224.10000000000002, 220.60000000000002, 216.89999999999992, 213.0, 208.89999999999986, 204.5999999999999, 200.10000000000002, 195.39999999999998, 190.5, 185.39999999999998, 180.0999999999999, 174.60000000000002, 168.89999999999998, 163.0, 156.89999999999998, 150.5999999999999, 144.10000000000002, 137.39999999999998, 130.5, 123.40000000000009, 116.10000000000002, 108.60000000000002, 100.89999999999986, 93.0, 84.90000000000009, 76.60000000000002, 68.10000000000002, 59.399999999999864, 50.5, 41.399999999999864, 32.09999999999991, 22.59999999999991, 12.899999999999977]
// console.log('sgFilter', sgFilter(test, 5, 2, 10))
// console.log('x', this.rawData.xAxis.length)
// if (this.mode_name === 'I-V Curve') {
// this.rawData.xAxis[0].boundaryGap = [0, '5%']
@@ -81,6 +81,11 @@ export default {
}
},
methods: {
getDeviceMode: function () {
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.chartData[this.chartID].mappingID))
if (device === undefined) return
return device.configuration.MODE
},
// for user to choose wanted unit
setUnit: function (gridIndex, channelIndex) {
// construct realTime object, i.e., record the coressponding value and unit
@@ -96,19 +101,16 @@ export default {
_newChannel.seriesSource = this.data.series.findIndex((ele) => ele.name === _newChannel.name)
// add device mode condition
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.chartData[this.chartID].mappingID))
let mode = -1
if (device !== undefined) mode = device.configuration.MODE
// set x-axis
_newChannel.xValue = 0
_newChannel.xUnit = (typeof _xAxis.default.defaultUnit === 'function') ? _xAxis.default.defaultUnit(mode) : _xAxis.default.defaultUnit
_newChannel.xUnit = (typeof _xAxis.default.defaultUnit === 'function') ? _xAxis.default.defaultUnit(this.getDeviceMode()) : _xAxis.default.defaultUnit
_newChannel.xScale = _xAxis.default.unit
_newChannel.xUnitOption = Object.keys(_xAxis.default.unit)
_newChannel.xName = _xAxis.default.name
// set y-axis
_newChannel.yValue = 0
_newChannel.yUnit = (typeof _yAxis.default.defaultUnit === 'function') ? _yAxis.default.defaultUnit(mode) : _yAxis.default.defaultUnit
_newChannel.yUnit = (typeof _yAxis.default.defaultUnit === 'function') ? _yAxis.default.defaultUnit(this.getDeviceMode()) : _yAxis.default.defaultUnit
_newChannel.yScale = _yAxis.default.unit
_newChannel.yUnitOption = Object.keys(_yAxis.default.unit)
_newChannel.yName = _yAxis.default.name
@@ -209,12 +211,12 @@ export default {
_currChannel.functional = newFunctional
// set x-axis
_currChannel.xUnit = _xAxis.default.defaultUnit
_currChannel.xUnit = (typeof _xAxis.default.defaultUnit === 'function') ? _xAxis.default.defaultUnit(this.getDeviceMode()) : _xAxis.default.defaultUnit
_currChannel.xScale = _xAxis.default.unit
_currChannel.xUnitOption = Object.keys(_xAxis.default.unit)
_currChannel.xName = _xAxis.default.name
// set y-axis
_currChannel.yUnit = _yAxis[newFunctional].defaultUnit
_currChannel.yUnit = (typeof _yAxis[newFunctional].defaultUnit === 'function') ? _yAxis[newFunctional].defaultUnit(this.getDeviceMode()) : _yAxis[newFunctional].defaultUnit
_currChannel.yScale = _yAxis[newFunctional].unit
_currChannel.yUnitOption = Object.keys(_yAxis[newFunctional].unit)
_currChannel.yName = _yAxis[newFunctional].name
@@ -159,9 +159,9 @@ const chartTable = {
differential: {
name: 'Transconductance',
unit: {
'mA/V': 1,
'A/V': 1e3,
'kA/V': 1e6,
'mA/V': 1e-3,
'A/V': 1,
'kA/V': 1e3,
},
defaultUnit: 'A/V',
downloadUnit: 'A/V',
+12 -11
View File
@@ -75,7 +75,7 @@ function sgFilter (data, windowSize, k) {
// return list
}
function sgFilterGetDifferential (data, windowSize, polynomial) {
function sgFilterGetDifferential (data, windowSize, polynomial, sampleRate = 1) {
// self
const arr = []
const m = parseInt((windowSize - 1) / 2)
@@ -96,23 +96,24 @@ function sgFilterGetDifferential (data, windowSize, polynomial) {
// use index 1 row in matrix
const rowOneInB = row(B, 1)._data[0]
const start = []
const end = []
// const start = []
// const end = []
const list = []
// eslint-disable-next-line no-unused-vars
for (const _ of range(0, m)) {
start.push(data[0])
end.push(data[data.length - 1])
}
const _data = [...start, ...data, ...end]
// for (const _ of range(0, m)) {
// start.push(data[0])
// end.push(data[data.length - 1])
// }
// const _data = [...start, ...data, ...end]
// const _data = [...data]
// m ... data_length - m - 1
for (const i of range(m, _data.length - m)) {
for (const i of range(m, data.length - m)) {
const arra = []
// -m ... 0 ... m
for (const j of range(-m, m + 1)) {
arra.push(_data[i.value + j.value])
arra.push(data[i.value + j.value])
}
let sum = 0
@@ -120,7 +121,7 @@ function sgFilterGetDifferential (data, windowSize, polynomial) {
sum += (arra[index] * rowOneInB[index])
}
list.push(sum)
list.push(sum * sampleRate)
}
return list
}
+9
View File
@@ -1,5 +1,6 @@
import EliteEDC from './EliteEDC/index'
import EliteEIS from './EliteEIS/index'
import store from '@/store/index'
// object saving library name mapping table
const libraryNameMappingTable = {
@@ -58,6 +59,14 @@ const serialNumberMappingTable = {
* @returns {Object} : config
*/
function getConfig (type) {
if (typeof type === 'number') {
const deviceList = store.getters.getField('taskContent').deviceListNew
if (deviceList === undefined) return
const device = deviceList.find(ele => ele.memory_board === type)
if (device === undefined) return
return libraryNameMappingTable[device.library_name]
}
// library name
if (typeof type === 'string') {
return libraryNameMappingTable[type]