Compare commits

...

11 Commits

Author SHA1 Message Date
Jordan Hsu 8ce7cf59df [modify] 3.1/3.5 split to sub file 2021-10-28 22:46:44 +08:00
Jordan Hsu e211b59d8e [update] elite param 2021-10-28 18:51:50 +08:00
Jordan Hsu 5dfb93a214 [update] 3.1/3.5 format and comment 2021-10-28 18:05:06 +08:00
Jordan Hsu 42d98eb0c2 [TODO] assure 3.1/3.5 type format and write comment 2021-10-28 13:07:06 +08:00
Jordan Hsu e42aa75dfa [modify] neulive 3.1 issue 2021-10-27 22:20:48 +08:00
Jordan Hsu 2920fb2997 [add] elite param table split 2021-10-25 10:38:33 +08:00
Jordan Hsu 9ed296dced [add] elite param table and apply to elite replay 2021-10-21 19:30:11 +08:00
TommyXin 4aeb343aab neulive 3.1 issue 2021-10-13 12:38:50 +08:00
Jordan Hsu 4cfb06fcaa [init] neulive 3.1/3.5, elite edc/eis param table 2021-10-11 23:20:54 +08:00
Jordan Hsu 781e0889f7 [remove] redundant code and fix EIS param 2021-10-05 10:11:54 +08:00
Jordan Hsu 4fbd4af65a [add] elite 1.5 param table 2021-09-27 23:10:41 +08:00
94 changed files with 4530 additions and 310 deletions
@@ -469,7 +469,7 @@ export default {
},
...mapActions('replay', [types.chart.init, types.chart.register, types.chart.clear, types.chart.updateGridList, types.chart.updateDataZoom]),
...mapActions('replay', [types.meta.init]),
...mapActions('replay', [types.rec.init, types.rec.intoData, types.rec.initDisplaySetting, types.rec.updateDisplaySetting]),
...mapActions('replay', [types.rec.init, types.rec.intoData]),
...mapMutations('replay', [types.chart.updateRegistered, types.chart.updateAxisSplitNumber, types.chart.updateChartSampling]),
...mapMutations('replay', [types.meta.updateByIndex]),
@@ -18,7 +18,7 @@
</div>
<change-cycle v-show="showCyclePanel" style="margin: 3px;" :ref="'change_cycle'" @refreshChart="refreshChart"/>
<show-resample-rate style="margin: 3px;"/>
<show-parameter style="margin: 3px;" :ref="'show_param'" deviceName="elite"/>
<show-parameter style="margin: 3px;" :ref="'show_param'"/>
</va-card>
</div>
</template>
@@ -50,6 +50,7 @@ export default {
},
computed: {
...mapFields('replay', [
'metaList',
'showCyclePanel',
]),
},
@@ -59,6 +60,7 @@ export default {
},
data () {
return {
deviceName: '',
showCycle: false,
}
},
@@ -66,6 +68,7 @@ export default {
},
methods: {
init () {
this.deviceName = this.metaList[0].device.library_name
this.$refs.change_axis_x.init()
this.$refs.change_axis_y.init()
this.$refs.change_unit_x.init()
@@ -74,7 +77,7 @@ export default {
this.$refs.change_scale_y.init()
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)
@@ -466,7 +466,7 @@ export default {
},
...mapActions('replay', [types.chart.init, types.chart.register, types.chart.clear, types.chart.updateGridList, types.chart.updateDataZoom]),
...mapActions('replay', [types.meta.init]),
...mapActions('replay', [types.rec.init, types.rec.intoData, types.rec.initDisplaySetting, types.rec.updateDisplaySetting]),
...mapActions('replay', [types.rec.init, types.rec.intoData]),
...mapMutations('replay', [types.chart.updateAxisLabel, types.chart.updateChartSampling, types.chart.setOverviewDataZoomStartAndEnd]),
...mapMutations('replay', [types.meta.updateByIndex]),
@@ -8,15 +8,13 @@
<script>
import { mapFields } from 'vuex-map-fields'
import paramTable from '@/data/param-table/index.js'
export default {
name: 'show-parameter',
components: {
},
props: {
deviceName: {
type: String, // elite or neulive
},
metaIndex: {
type: Number, // which meta file
default: 0,
@@ -26,7 +24,9 @@ export default {
},
data () {
return {
deviceName: '',
content: '',
showDict: {},
// [region] for neulive
ampGainOptions: [
{
@@ -143,144 +143,6 @@ export default {
},
],
// [Endregion]
// [region] for elite
workingModeOptions: [
{
id: 0,
description: 'I-V Curve',
},
{
id: 1,
description: 'Cycle I-V',
},
{
id: 2,
description: 'Function Generator',
},
{
id: 3,
description: 'R-T Graph',
},
{
id: 4,
description: 'V-T Graph',
},
{
id: 5,
description: 'I-T Graph',
},
{
id: 6,
description: 'ADC_Test',
},
{
id: 7,
description: 'Constant Current',
},
{
id: 8,
description: 'Cyclic Voltammetry',
},
{
id: 9,
description: 'Cyclic Voltammetry-hi-cycles',
},
{
id: 10,
description: 'Linear Sweep Voltammetry',
},
{
id: 11,
description: 'Chronoamperometric Graph',
},
],
currentRangeOptions: [
{
value: 0,
label: '<40 μA',
},
{
value: 1,
label: '30-1350 μA',
},
{
value: 2,
label: '>1000 μA',
},
{
value: 3,
label: 'Auto',
},
],
stepTimeOptions: [
{
value: 0,
label: '0.5s',
},
{
value: 1,
label: '1.0s',
},
{
value: 2,
label: '2.0s',
},
],
resisterRangeOptions: [
{
value: 0,
label: '>50 kΩ',
},
{
value: 1,
label: '2-100 kΩ',
},
{
value: 2,
label: '<10 kΩ',
},
{
value: 3,
label: 'Auto',
},
],
eliteSampleRateOptions: [
{
value: 0,
label: '100',
},
{
value: 1,
label: '10',
},
{
value: 2,
label: '5',
},
{
value: 3,
label: '1',
},
{
value: 4,
label: '0.1',
},
{
value: 5,
label: '0.01',
},
],
chargeOptions: [
{
value: 0,
label: 'Charge',
},
{
value: 1,
label: 'Discharge',
},
],
// [Endregion]
}
},
computed: {
@@ -291,14 +153,15 @@ 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/>'
this.content += 'Duration: ' + parseInt(parseInt(meta.time_duration / 1e6) / 60) + ' m ' + parseInt((meta.time_duration % 6e7) / 1e6) + ' s<br/>'
this.content += '<br/>Parameter: <br/>'
this.content += '<br/> Recording: <br/>'
if (this.deviceName === 'neulive') {
if (this.deviceName.startsWith('Neulive')) {
// recording param
this.content += '<br/> Recording: <br/>'
for (const [key, value] of Object.entries(params)) {
if (!(key.includes('sti') || key.includes('STI'))) {
let showKey = ''
@@ -432,103 +295,47 @@ 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') {
for (const [key, value] of Object.entries(params)) {
let showKey = ''
let showValue = value
if (key === 'MODE') {
showKey = 'MODE'
for (let i = 0; i < this.workingModeOptions.length; i++) {
if (this.workingModeOptions[i].id === value) {
showValue = this.workingModeOptions[i].description
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
const mode = params.MODE
const modeName = paramTable[this.deviceName].MODE[mode].name
const showParams = paramTable[this.deviceName].MODE[mode].showParameter
this.showDict.MODE = modeName
if (modeName === 'Pulse Sensing') {
const duplicateParam = ['V_initial', 't_pulse', 'CURR_REC_START', 'CURR_REC_END']
for (let i = 0; i < 4; i++) {
const key = 'segment_order_' + String(i)
const order = paramTable[this.deviceName][key].rev_func(params[key])
if (parseInt(order) !== 0) { // if === 0, 代表沒有使用這個block
for (let key of duplicateParam) {
key = key + '_' + String(i)
this.fillShowDict(key, params[key])
}
}
} else if (key === 'ADC_LEVEL') {
showKey = 'Current Range'
for (let i = 0; i < this.currentRangeOptions.length; i++) {
if (this.currentRangeOptions[i].value === value) {
showValue = this.currentRangeOptions[i].label
}
}
} else if (key === 'VOLT_ORIGIN') {
showKey = 'Volt start'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLT_FINAL') {
showKey = 'Volt stop'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLT_STEP') {
showKey = 'Volt step'
showValue = ((value * 2) + 2) / 10 + 'mV'
} else if (key === 'STEP_TIME') {
showKey = 'Step time'
for (let i = 0; i < this.stepTimeOptions.length; i++) {
if (this.stepTimeOptions[i].value === value) {
showValue = this.stepTimeOptions[i].label
}
}
} else if (key === 'CYCLE_NUMBER') {
showKey = 'Cycle number'
showValue = value
} else if (key === 'DAC_VOLT') {
showKey = 'Volt out'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'Resister_LEVEL') {
showKey = 'Resister Range'
for (let i = 0; i < this.resisterRangeOptions.length; i++) {
if (this.resisterRangeOptions[i].value === value) {
showValue = this.resisterRangeOptions[i].label
}
}
} else if (key === 'SAMPLE_RATE') {
showKey = 'Sample rate'
for (let i = 0; i < this.eliteSampleRateOptions.length; i++) {
if (this.eliteSampleRateOptions[i].value === value) {
showValue = this.eliteSampleRateOptions[i].label
}
}
} else if (key === 'Const_Current_value') {
showKey = 'Current'
showValue = value + 'μA'
} else if (key === 'VOLTSTOP_MAX') {
showKey = 'Volt max stop'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLTSTOP_MIN') {
showKey = 'Volt min stop'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'Charge') {
showKey = 'Charge'
for (let i = 0; i < this.chargeOptions.length; i++) {
if (this.chargeOptions[i].value === value) {
showValue = this.chargeOptions[i].label
}
}
} else if (key === 'VOLT_INITIAL') {
showKey = 'E-Initial'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLT_MAX') {
showKey = 'Volt max stop'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLT_MIN') {
showKey = 'Volt min stop'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'Scan_Rate') {
showKey = 'ScanRate'
showValue = (value / 100) + 0.01 + 'mV/s'
} else if (key === 'Data_Resolution_Scan') {
showKey = 'Resolution'
showValue = (value / 10) + 0.1 + 'sps'
} else if (key === 'VOLT_EFINAL') {
showKey = 'E-Final'
showValue = (value / 5000) - 5 + 'V'
} else if (key === 'VOLT_VSCAN') {
showKey = 'VScan'
showValue = (value / 5000) - 5 + 'V'
} else {
continue
}
this.content += ' ' + showKey + ': ' + showValue + '<br/>'
const remainParams = showParams.filter((e) => { // 差集
return duplicateParam.indexOf(e) === -1
})
for (const key of remainParams) {
this.fillShowDict(key, params[key])
}
} else {
for (const key of showParams) {
this.fillShowDict(key, params[key])
}
}
}
this.dump()
},
fillShowDict (key, value) {
const expVal = paramTable[this.deviceName][key].rev_func(value)
const name = paramTable[this.deviceName][key].showName
const unit = paramTable[this.deviceName][key].defaultUnit
this.showDict[name] = unit !== undefined ? expVal.toString() + unit : expVal.toString()
},
dump () {
for (const [showKey, showValue] of Object.entries(this.showDict)) {
this.content += ' ' + showKey + ': ' + showValue + '<br/>'
}
},
},
}
+1 -1
View File
@@ -347,7 +347,7 @@ export default {
},
...mapActions('spike', [types.chart.init, types.chart.initSelectedChannel, types.chart.register, types.chart.clear, types.chart.updateGridList, types.chart.updateDataZoom]),
...mapActions('spike', [types.meta.init]),
...mapActions('spike', [types.rec.init, types.rec.intoData, types.rec.initDisplaySetting, types.rec.updateDisplaySetting]),
...mapActions('spike', [types.rec.init, types.rec.intoData]),
...mapMutations('spike', [types.chart.updateAxisLabel, types.chart.updateChartSampling]),
...mapMutations('spike', [types.meta.updateByIndex]),
@@ -239,7 +239,8 @@
</va-tree-node>
</va-tree-category>
<va-tree-category
<!-- [TODO] wait for schedule -->
<!-- <va-tree-category
v-if="workingModeSelect != null && workingModeSelect.id == 13"
style="font-size: 20px;"
:label="'Duration ( ' + duration + timeOptions[timeUnit].label + ' )'">
@@ -256,7 +257,7 @@
</div>
</div>
</va-tree-node>
</va-tree-category>
</va-tree-category> -->
<va-tree-category
v-if="workingModeSelect != null && workingModeSelect.id == 12"
@@ -78,7 +78,7 @@ export default {
this.inputeKey++
if (parseFloat(this.itemInputMax).toFixed(1) !== parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_STOP * 0.0149) * 100)) / 100).toFixed(1)) {
if (parseFloat(this.itemInputMax) < 0.1) {
this.$emit('parameterChange', [this.parameterName + '_START', 1])
this.$emit('parameterChange', [this.parameterName + '_STOP', 1])
} else {
this.$emit('parameterChange', [this.parameterName + '_STOP', Math.round((parseFloat(this.itemInputMax)) / 0.0149)])
}
@@ -0,0 +1,48 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out-V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
3: {
name: 'Cycle',
unit: {
cycle: 1,
},
defaultUnit: 'cycle',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Cyclic Voltammetry',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'CV',
x1: {
channel: 1,
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Cyclic Voltammetry',
shortName: 'CV',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,136 @@
export default {
CV_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<1.5 μA', '1-60 μA', '40-175 μA', '>120 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<1.5 μA', '1-60 μA', '40-175 μA', '>120 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<1.5 μA', '1-60 μA', '40-175 μA', '>120 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CV_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['1', '2', '3', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CV_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CV_VOLT_INITIAL: {
type: 'number',
showName: 'E-Initial',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -1.8, max: 2 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_VOLT_MAX: {
type: 'number',
showName: 'E1',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -1.8, max: 2 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_VOLT_MIN: {
type: 'number',
showName: 'E2',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -1.8, max: 2 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_Scan_Rate: {
type: 'number',
showName: 'ScanRate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.01, max: 1000 }),
func: (val) => {
return parseInt(parseFloat(val) * 100)
},
rev_func: (val) => {
return parseFloat(val) / 100
},
defaultUnit: 'mV',
unit: {
mV: 1,
},
},
CV_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
CV_CYCLE_NUMBER: {
type: 'number',
showName: 'Cycle',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 50000 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
},
}
@@ -0,0 +1,42 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: '0',
unit: {
default: 1,
},
defaultUnit: 'default',
},
1: {
name: '1',
unit: {
default: 1,
},
defaultUnit: 'default',
},
2: {
name: '2',
unit: {
default: 1,
},
defaultUnit: 'default',
},
3: {
name: '3',
unit: {
default: 1,
},
defaultUnit: 'default',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Dev Mode',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'dev',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Dev Mode',
shortName: 'Dev',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,3 @@
export default {
// [2021/10/22] no any param now
}
@@ -0,0 +1,97 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'Raw Imag',
unit: {
default: 1,
},
defaultUnit: 'default',
},
1: {
name: 'Raw Real',
unit: {
default: 1,
},
defaultUnit: 'default',
},
2: {
name: 'Frequency',
unit: {
mHz: 1,
Hz: 1e3,
kHz: 1e6,
},
defaultUnit: 'mHz',
},
3: {
name: 'Cycle',
unit: {
cycle: 1,
},
defaultUnit: 'cycle',
},
4: {
name: 'Z_imag',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
defaultUnit: 'Ω',
},
5: {
name: 'Z_real',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
defaultUnit: 'Ω',
},
6: {
name: 'Impedance',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
defaultUnit: 'Ω',
},
7: {
name: 'Phase',
unit: {
'°': 1,
},
defaultUnit: '°',
},
8: {
name: 'Current',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'nA',
},
9: {
name: 'Gain Level',
unit: {
default: 1,
},
defaultUnit: 'default',
},
}
@@ -0,0 +1,75 @@
export default {
default: [
{
name: 'Nyquist',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'Nyquist',
x1: {
channel: 5,
},
y1: {
channel: 4,
},
},
],
},
],
},
{
name: 'Bode',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'log',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y2: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'Bode',
x1: {
channel: 2,
},
y1: {
channel: 6,
},
y2: {
channel: 7,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Potentiostatic Electrochemical Impedance Spectroscopy',
shortName: 'EIS',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,140 @@
export default {
EIS_DC_BIAS: {
type: 'number',
showName: 'DC Voltage',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 2200 }), // UI上能輸入的最大最小值
func: (val) => {
return Math.round((parseInt(val) * 4095) / 2200)
},
rev_func: (val) => {
return Math.round((parseInt(val) * 2200) / 4095)
},
defaultUnit: 'mV',
unit: {
mV: 1,
},
},
EIS_AC_AMP: {
type: 'number',
showName: 'AC Amplitude',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 800 }),
func: (val) => {
return Math.round(parseInt(val) / 800 * 2047)
},
rev_func: (val) => {
return Math.round(parseInt(val) / 2047 * 800)
},
defaultUnit: 'mV',
unit: {
mV: 1,
},
},
EIS_FREQ_START: {
type: 'number',
showName: 'Frequency Range Start',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.015, max: 200000 }),
func: (val) => {
return parseFloat(val) < 0.1 ? 1 : Math.round(parseFloat(val) / 0.0149)
},
rev_func: (val) => {
return String(parseFloat(Math.round(parseFloat((val * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? 0.015 : parseFloat(Math.round(parseFloat((val * 0.0149) * 100)) / 100).toFixed(1)
},
defaultUnit: 'Hz',
unit: {
Hz: 1,
},
},
EIS_FREQ_STOP: {
type: 'number',
showName: 'Frequency Range Stop',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.015, max: 200000 }),
func: (val) => {
return parseFloat(val) < 0.1 ? 1 : Math.round(parseFloat(val) / 0.0149)
},
rev_func: (val) => {
return String(parseFloat(Math.round(parseFloat((val * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? 0.015 : parseFloat(Math.round(parseFloat((val * 0.0149) * 100)) / 100).toFixed(1)
},
defaultUnit: 'Hz',
unit: {
Hz: 1,
},
},
EIS_PPD: {
type: 'number',
showName: 'Points Per Decades',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 10 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
defaultUnit: 'points',
unit: {
points: 1,
},
},
EIS_SCALE: {
type: 'string',
showName: 'Point Spacing',
show: true, // 是否需顯示給user看
range: ['Logarithm', 'Linear'],
func: (val) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr.indexOf(val.toString())
},
rev_func: (idx) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr[parseInt(idx)]
},
},
EIS_DELAY: {
type: 'number',
showName: 'DELAY',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 10 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat((val / 10)).toFixed(1)
},
defaultUnit: 'points',
unit: {
points: 1,
},
},
EIS_AVERAGE_NUM: {
type: 'string',
showName: 'Average',
show: true, // 是否需顯示給user看
range: ['2', '4', '6', '8'],
func: (val) => {
const numArr = ['2', '4', '6', '8']
return numArr.indexOf(val.toString())
},
rev_func: (idx) => {
const numArr = ['2', '4', '6', '8']
return numArr[parseInt(idx)]
},
},
EIS_RTIA: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['1', '2', '3', '4', 'Auto'],
func: (val) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr.indexOf(val.toString())
},
rev_func: (idx) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr[parseInt(idx)]
},
},
}
+25
View File
@@ -0,0 +1,25 @@
import PotentiostaticEIS from './PotentiostaticEIS/index'
import CyclicVoltammetry from './CyclicVoltammetry/index'
import DevMode from './DevMode/index'
/* elite eis前端參數表(只列出前端有在publish的參數)
格式:
type: 轉換函數(func,前端值轉後端值)輸入值的型態
show: boolean, 用於判斷此參數是否需顯示在UI上 or not,如需顯示,顯示名稱為showName欄位所寫的值
range: 用於檢查輸入值是否合法,range型態為Array的為選項、型態為Object的為上下界、型態為function的會直接return是否合法(true/false
func: 轉換函數,將前端值轉成後端值
rev_func: 反轉換函數,將後端值轉成前端值
showName (optional): 顯示在UI上的名稱,show = true時才會有
defaultUnit (optional): "前端"顯示的預設單位
unit (optional): 單位轉換表,object key為單位名稱、object value為unit scale,如scale = 1代表為後端儲存的單位,scale = 1e3代表將後端值轉換成這單位要除1e3e.g. ms -> s
*/
const EliteEIS = {
MODE: {
0: PotentiostaticEIS,
1: CyclicVoltammetry,
2: DevMode,
},
}
export default EliteEIS
@@ -0,0 +1,35 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
},
defaultUnit: 'nA',
},
1: {
name: 'V_in/V_out',
unit: {
uV: 1,
},
defaultUnit: 'uV',
},
2: {
name: 'Gain',
unit: {
default: 1,
},
defaultUnit: 'default',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Cali ADC - test',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'ADC',
x1: {
channel: 'time',
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Cali ADC - test',
shortName: 'CaliADC',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,44 @@
export default {
CaliADC_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CaliADC_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true,
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CaliADC_ADC_DAC_CHANNEL_15: {
type: 'string',
showName: 'Cali Channel',
show: true,
range: ['Iin', 'Vin'],
func: (val) => {
const caliChannelArr = ['Iin', 'Vin']
return caliChannelArr.indexOf(val.toString())
},
rev_func: (idx) => {
const caliChannelArr = ['Iin', 'Vin']
return caliChannelArr[parseInt(idx)]
},
},
}
@@ -0,0 +1,35 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
},
defaultUnit: 'nA',
},
1: {
name: 'V_in/V_out',
unit: {
uV: 1,
},
defaultUnit: 'uV',
},
2: {
name: 'Gain',
unit: {
default: 1,
},
defaultUnit: 'default',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Cali DAC - test',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'DAC',
x1: {
channel: 'time',
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Cali DAC - test',
shortName: 'CaliDAC',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,32 @@
export default {
CaliDAC_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CaliDAC_DAC_VOLT: {
type: 'number',
showName: 'Volt out',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out-V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Chronoamperometric Graph',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'chrono',
x1: {
channel: 'time',
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Chronoamperometric Graph',
shortName: 'CG',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,76 @@
export default {
CG_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CG_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CG_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CG_VOLT_VSCAN: {
type: 'number',
showName: 'VScan',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CG_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Constant Current',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'CC',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Constant Current',
shortName: 'CC',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,122 @@
export default {
CC_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CC_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CC_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CC_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
CC_Charge: {
type: 'string',
showName: 'Charge',
show: true, // 是否需顯示給user看
range: ['Charge', 'Discharge'],
func: (val) => {
const chargeArr = ['Charge', 'Discharge']
return chargeArr.indexOf(val.toString())
},
rev_func: (val) => {
const chargeArr = ['Charge', 'Discharge']
return chargeArr[(parseInt(val) + 1) % 2]
},
},
CC_Const_Current_value: {
type: 'number',
showName: 'Current',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 15000 }),
func: (val) => {
return parseInt(parseFloat(val) * 100)
},
rev_func: (val) => {
return parseFloat(val) / 100
},
defaultUnit: 'μA',
unit: {
μA: 1,
},
},
CC_VOLTSTOP_MAX: {
type: 'number',
showName: 'Volt max',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CC_VOLTSTOP_MIN: {
type: 'number',
showName: 'Volt min stop',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
}
@@ -0,0 +1,48 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
3: {
name: 'Cycle',
unit: {
cycle: 1,
},
defaultUnit: 'cycle',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Cycle I-V',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'CycleIV',
x1: {
channel: 1,
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Cycle I-V',
shortName: 'CycleIV',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,138 @@
export default {
CycleIV_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CycleIV_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CycleIV_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CycleIV_VOLT_ORIGIN: {
type: 'number',
showName: 'Volt start',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }), // UI上能輸入的最大最小值
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CycleIV_VOLT_FINAL: {
type: 'number',
showName: 'Volt stop',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CycleIV_VOLT_STEP: {
type: 'number',
showName: 'Volt step',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.2, max: 100 }),
func: (val) => {
if ((parseFloat(val) * 10) % 2 !== 0) { // odd number
return parseFloat(val) * 10 + 1
} else {
return parseFloat(val) * 10
}
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'mV',
unit: {
mV: 1,
},
},
CycleIV_STEP_TIME: {
type: 'string',
showName: 'Step time',
show: true, // 是否需顯示給user看
range: ['0.5s', '1.0s', '2.0s'],
func: (val) => {
const stepTimeArr = ['0.5s', '1.0s', '2.0s']
return stepTimeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const stepTimeArr = ['0.5s', '1.0s', '2.0s']
return stepTimeArr[parseInt(idx)]
},
},
CycleIV_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
CycleIV_CYCLE_NUMBER: {
type: 'number',
showName: 'Cycle',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 50000 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
},
}
@@ -0,0 +1,48 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out-V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
3: {
name: 'Cycle',
unit: {
cycle: 1,
},
defaultUnit: 'cycle',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Cyclic Voltammetry',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'CV',
x1: {
channel: 1,
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Cyclic Voltammetry',
shortName: 'CV',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,136 @@
export default {
CV_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
CV_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
CV_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
CV_VOLT_INITIAL: {
type: 'number',
showName: 'E-Initial',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_VOLT_MAX: {
type: 'number',
showName: 'E1',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_VOLT_MIN: {
type: 'number',
showName: 'E2',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
CV_Scan_Rate: {
type: 'number',
showName: 'ScanRate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.01, max: 1000 }),
func: (val) => {
return parseInt(parseFloat(val) * 100)
},
rev_func: (val) => {
return parseFloat(val) / 100
},
defaultUnit: 'mV/s',
unit: {
'mV/s': 1,
},
},
CV_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
CV_CYCLE_NUMBER: {
type: 'number',
showName: 'Cycle',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 50000 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
},
}
@@ -0,0 +1,42 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: '0',
unit: {
default: 1,
},
defaultUnit: 'default',
},
1: {
name: '1',
unit: {
default: 1,
},
defaultUnit: 'default',
},
2: {
name: '2',
unit: {
default: 1,
},
defaultUnit: 'default',
},
3: {
name: '3',
unit: {
default: 1,
},
defaultUnit: 'default',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Dev Mode',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'dev',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Dev Mode',
shortName: 'Dev',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,3 @@
export default {
// [2021/10/22] no any param now
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Function Generator',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'FuncGen',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Function Generator',
shortName: 'FG',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,76 @@
export default {
FG_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
FG_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
FG_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
FG_DAC_VOLT: {
type: 'number',
showName: 'Volt out',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
FG_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'I-T Graph',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'IT',
x1: {
channel: 'time',
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'I-T Graph',
shortName: 'IT',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,76 @@
export default {
IT_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
IT_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
IT_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
IT_DAC_VOLT: {
type: 'number',
showName: 'Volt out',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
IT_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'I-V Curve',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'IV',
x1: {
channel: 1,
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'I-V Curve',
shortName: 'IV',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
+126
View File
@@ -0,0 +1,126 @@
export default {
IV_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
IV_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
IV_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
IV_VOLT_ORIGIN: {
type: 'number',
showName: 'Volt start',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }), // UI上能輸入的最大最小值
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
IV_VOLT_FINAL: {
type: 'number',
showName: 'Volt stop',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
IV_VOLT_STEP: {
type: 'number',
showName: 'Volt step',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.2, max: 100 }),
func: (val) => {
if ((parseFloat(val) * 10) % 2 !== 0) { // odd number
return parseFloat(val) * 10 + 1
} else {
return parseFloat(val) * 10
}
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'mV',
unit: {
mV: 1,
},
},
IV_STEP_TIME: {
type: 'string',
showName: 'Step time',
show: true, // 是否需顯示給user看
range: ['0.5s', '1.0s', '2.0s'],
func: (val) => {
const stepTimeArr = ['0.5s', '1.0s', '2.0s']
return stepTimeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const stepTimeArr = ['0.5s', '1.0s', '2.0s']
return stepTimeArr[parseInt(idx)]
},
},
IV_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out-V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Linear Sweep Voltammetry',
description: '',
subplot: [
{
x1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'LSV',
x1: {
channel: 1,
},
y1: {
channel: 0,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Linear Sweep Voltammetry',
shortName: 'LSV',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,108 @@
export default {
LSV_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
LSV_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
LSV_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
LSV_VOLT_INITIAL: {
type: 'number',
showName: 'E-Initial',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
LSV_VOLT_EFINAL: {
type: 'number',
showName: 'E-Final',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
LSV_Scan_Rate: {
type: 'number',
showName: 'ScanRate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.01, max: 1000 }),
func: (val) => {
return parseInt(parseFloat(val) * 100)
},
rev_func: (val) => {
return parseFloat(val) / 100
},
defaultUnit: 'mV/s',
unit: {
'mV/s': 1,
},
},
LSV_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,41 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out-V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Open Circuit Potential',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'OCP',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Open Circuit Potential',
shortName: 'OCP',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,46 @@
export default {
OCP_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
OCP_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
OCP_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,32 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'pul1_I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'pul2_I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'Pulse Sensing',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'PulseSensing',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'Pulse Sensing',
shortName: 'Pulse',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,145 @@
export default {
// **** 這邊的參數會有repeat欄位,代表有名稱相同編號不同的參數,見下方i.e. *****
Pulse_V_initial_0: {
type: 'number',
showName: 'Segment Voltage',
show: true, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_V_initial_0, Pulse_V_initial_1, Pulse_V_initial_2, Pulse_V_initial_3
repeatName: 'Pulse_V_initial',
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
Pulse_t_pulse_0: {
type: 'number',
showName: 'Segment Duration',
show: true, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_t_pulse_0, Pulse_t_pulse_1, Pulse_t_pulse_2, Pulse_t_pulse_3
repeatName: 'Pulse_t_pulse',
range: Object.freeze({ min: 1, max: 1e5 }), // ms
func: (val) => {
let _val = parseInt(val) * 1000
// 5 ms a step
const remainder = parseInt(_val) % 5
if (remainder !== 0) {
_val = parseInt(_val) + (5 - remainder)
}
return _val * 10
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'ms',
unit: {
ms: 1,
},
},
Pulse_CURR_REC_START_0: {
type: 'number',
showName: 'Segment Current Recording START',
show: true, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_CURR_REC_START_0, Pulse_CURR_REC_START_1, Pulse_CURR_REC_START_2, Pulse_CURR_REC_START_3
repeatName: 'Pulse_CURR_REC_START',
range: Object.freeze({ min: 0, max: 100 }), // percentage
func: (val) => {
const _val = parseInt(val)
if (_val === 0) {
return 1
}
return _val
},
rev_func: (val) => {
return parseInt(val)
},
defaultUnit: '%',
unit: {
'%': 1,
},
},
Pulse_CURR_REC_END_0: {
type: 'number',
showName: 'Segment Current Recording END',
show: true, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_CURR_REC_END_0, Pulse_CURR_REC_END_1, Pulse_CURR_REC_END_2, Pulse_CURR_REC_END_3
repeatName: 'Pulse_CURR_REC_END',
range: Object.freeze({ min: 0, max: 100 }), // percentage
func: (val) => {
const _val = parseInt(val)
if (_val === 100) {
return 99
}
return _val
},
rev_func: (val) => {
const _val = parseInt(val)
if (_val === 99) {
return 100
}
return _val
},
defaultUnit: '%',
unit: {
'%': 1,
},
},
Pulse_segment_ui_order_0: {
type: 'number',
show: false, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_segment_ui_order_0, Pulse_segment_ui_order_1, Pulse_segment_ui_order_2, Pulse_segment_ui_order_3
repeatName: 'Pulse_segment_ui_order',
range: Object.freeze({ min: 0, max: 4 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return Math.max(0, parseInt(val) - 1)
},
},
Pulse_segment_order_0: {
type: 'number',
show: false, // 是否需顯示給user看
repeat: 4, // i.e. 總共有4個,Pulse_segment_order_0, Pulse_segment_order_1, Pulse_segment_order_2, Pulse_segment_order_3
repeatName: 'Pulse_segment_order',
range: Object.freeze({ min: 0, max: 4 }),
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
},
Pulse_DATA_OUTPUT: {
type: 'string',
showName: 'Data Output',
show: true, // 是否需顯示給user看
range: ['Average', 'Raw Data'],
func: (val) => {
const outputArr = ['Average', 'Raw Data']
return outputArr.indexOf(val.toString())
},
rev_func: (idx) => {
const outputArr = ['Average', 'Raw Data']
return outputArr[parseInt(idx)]
},
},
Pulse_CYCLE_NUMBER: {
type: 'number',
showName: 'Cycle',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 0 }), // only infinity now [2021/10/23]
func: (val) => {
return parseInt(val)
},
rev_func: (val) => {
return parseInt(val)
},
},
}
@@ -0,0 +1,42 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
2: {
name: 'R',
unit: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'R-T Graph',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'RT',
x1: {
channel: 'time',
},
y1: {
channel: 2,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'R-T Graph',
shortName: 'RT',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,48 @@
export default {
RT_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
RT_DAC_VOLT: {
type: 'number',
showName: 'Volt out',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: -5, max: 5 }),
func: (val) => {
return parseInt(parseFloat(val) * 1000 * 5 + 25000)
},
rev_func: (val) => {
return parseInt((parseFloat(val) - 25000) / 5) / 1000
},
defaultUnit: 'V',
unit: {
V: 1,
},
},
RT_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
@@ -0,0 +1,32 @@
export default {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
},
1: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
},
}
@@ -0,0 +1,35 @@
export default {
default: [
{
name: 'V-T Graph',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'VT',
x1: {
channel: 'time',
},
y1: {
channel: 1,
},
},
],
},
],
},
],
}
@@ -0,0 +1,23 @@
import param from './param'
import channels from './channels'
import charts from './charts'
export default {
name: 'V-T Graph',
shortName: 'VT',
parameter: param, // 這個mode用到的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: channels,
charts: charts,
}
@@ -0,0 +1,60 @@
export default {
VT_ADC_LEVEL_I_15: {
type: 'string',
showName: 'Current Range',
show: true, // 是否需顯示給user看
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
func: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
VT_ADC_LEVEL_V_IN_15: {
type: 'string',
showName: 'Voltage Range',
show: true, // 是否需顯示給user看
range: ['<7 mV', '5-300 mV', '>250 mV', 'Auto'],
func: (val) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
rev_func: (idx) => {
const voltageInRangeArr = ['<7 mV', '5-300 mV', '>250 mV', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
VT_CTRL_HIGH_Z_15: {
type: 'string',
showName: 'HighZ',
show: true, // 是否需顯示給user看
range: ['On', 'Off'],
func: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
},
rev_func: (idx) => {
const highzArr = ['On', 'Off']
return highzArr[parseInt(idx)]
},
},
VT_SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0.1, max: 100 }),
func: (val) => {
return parseInt(parseFloat(val) * 10)
},
rev_func: (val) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
unit: {
sps: 1,
},
},
}
+53
View File
@@ -0,0 +1,53 @@
import IV from './IV/index'
import CycleIV from './CycleIV/index'
import FunctionGenerator from './FunctionGenerator/index'
import RT from './RT/index'
import VT from './VT/index'
import IT from './IT/index'
import ConstantCurrent from './ConstantCurrent/index'
import CyclicVoltammetry from './CyclicVoltammetry/index'
import LinearSweep from './LinearSweep/index'
import ChronoamperometricGraph from './ChronoamperometricGraph/index'
import CaliDAC from './CaliDAC/index'
import CaliADC from './CaliADC/index'
import DevMode from './DevMode/index'
import OCP from './OCP/index'
import PulseSensing from './PulseSensing/index'
/* elite 1.5publish
格式:
type: 轉換函數func前端值轉後端值輸入值的型態
show: boolean, 用於判斷此參數是否需顯示在UI上 or not如需顯示顯示名稱為showName欄位所寫的值
range: 用於檢查輸入值是否合法range型態為Array的為選項型態為Object的為上下界型態為function的會直接return是否合法true/false
func: 轉換函數將前端值轉成後端值
rev_func: 反轉換函數將後端值轉成前端值
showName (optional): 顯示在UI上的名稱show = true時才會有
repeat (optional): 有幾個重複前綴詞但標號不同的參數可參考pulse mode參數範例
repeatName (optional): 承repeat表示前綴詞名稱叫什麼可參考pulse mode參數範例
defaultUnit (optional): "前端"顯示的預設單位
unit (optional): 單位轉換表object key為單位名稱object value為unit scale如scale = 1代表為後端儲存的單位scale = 1e3代表將後端值轉換成這單位要除1e3e.g. ms -> s
*/
const EliteZM15 = {
MODE: {
0: IV,
1: CycleIV,
2: FunctionGenerator,
3: RT,
4: VT,
5: IT,
6: ConstantCurrent,
7: CyclicVoltammetry,
8: LinearSweep,
9: ChronoamperometricGraph,
10: CaliDAC,
11: CaliADC,
12: DevMode,
13: OCP,
14: PulseSensing,
// 'Differential Pulse Voltammetry (DPV)'
},
}
export default EliteZM15
+99
View File
@@ -0,0 +1,99 @@
import option from './option'
export default {
// rec
RECORDING: (val) => {
return val
},
RECORDING_CH: (chList) => {
let channelStr = ''
chList.forEach(function (item) {
channelStr += item
})
return parseInt(channelStr, 2)
},
AXIS_CH: (chList) => {
let channelStr = ''
chList.forEach(function (item) {
channelStr += item
})
return parseInt(channelStr, 2)
},
AMP_GAIN: (val) => {
return option.AMP_GAIN.indexOf(val.toString())
},
SAMPLE_RATE: (val) => {
return option.SAMPLE_RATE.indexOf(val.toString())
},
ADC_CLOCK: (val) => {
return parseInt(val)
},
ACCELERATOR_S: (val) => {
return option.ACCELERATOR_S.indexOf(val.toString())
},
// sti
STIMULATING: (val) => {
return val
},
STI_CHANNEL: (posChList, negChList) => {
let stiChannelSet = ''
for (let i = 7; i >= 0; i--) {
stiChannelSet += String(posChList[i] & negChList[i])
}
return parseInt(stiChannelSet, 2)
},
STI_POLARITY: (posChList, negChList) => {
let stiPolaritySet = ''
for (let i = 7; i >= 0; i--) {
stiPolaritySet += String(posChList[i] & negChList[i])
}
return parseInt(stiPolaritySet, 2)
},
STI_H_BRIDGE: (val) => {
return option.STI_H_BRIDGE.indexOf(val.toString())
},
CONTINUOUS_STI: (val) => {
return option.CONTINUOUS_STI.indexOf(val.toString())
},
STI_CYCLE_LIST: (cycleNum) => {
const cycleNumberArray = Array(9).fill(1)
cycleNumberArray.fill(cycleNum, 0)
return '0:9=' + cycleNumberArray.toString()
},
STI_AMPLITUDE: (val) => {
return parseInt(val / 5)
},
STI_AMPLITUDE_H: (val) => {
return parseInt(val / 5)
},
STI_AMPLITUDE_L: (val) => {
return parseInt(val / 5)
},
STI_PATTERN: (val) => {
return option.STI_PATTERN.indexOf(val.toString())
},
STI_T1: (val) => { // input unit: us
const tRange = parseInt(val / 10)
const tRangeArray = Array(9).fill(0)
tRangeArray.fill(tRange, 0)
return '0:9=' + String(tRangeArray)
},
STI_T2: (val) => { // input unit: us
const tRange = parseInt(val / 10)
const tRangeArray = Array(9).fill(0)
tRangeArray.fill(tRange, 0)
return '0:9=' + String(tRangeArray)
},
STI_T3: (val) => { // input unit: us
const tRange = parseInt(val / 10)
const tRangeArray = Array(9).fill(0)
tRangeArray.fill(tRange, 0)
return '0:9=' + String(tRangeArray)
},
STI_T4: (val) => { // input unit: us
const tRange = parseInt(val / 10)
const tRangeArray = Array(9).fill(0)
tRangeArray.fill(tRange, 0)
return '0:9=' + String(tRangeArray)
},
}
+250
View File
@@ -0,0 +1,250 @@
/* neulive 3.1publish
格式:
type: 轉換函數func前端值轉後端值輸入值的型態
show: boolean, 用於判斷此參數是否需顯示在UI上 or not如需顯示顯示名稱為showName欄位所寫的值
range: 用於檢查輸入值是否合法range型態為Array的為選項型態為Object的為上下界型態為function的會直接return是否合法true/false
func: 轉換函數將前端值轉成後端值
revFunc: 反轉換函數將後端值轉成前端值
showName (optional): 顯示在UI上的名稱show = true時才會有
start (optional): 參數起始編號offset的概念現用於channel相關的參數
defaultUnit (optional): "前端"顯示的預設單位
unit (optional): 單位轉換表object key為單位名稱object value為unit scale如scale = 1代表為後端儲存的單位scale = 1e3代表將後端值轉換成這單位要除1e3e.g. ms -> s
*/
import func from './func'
import revFunc from './revFunc'
import option from './option'
const Neulive31 = {
// rec
RECORDING: {
type: 'boolean',
showName: 'RECORDING',
show: true, // 是否需顯示給user看
range: [true, false],
func: func.RECORDING,
revFunc: revFunc.RECORDING,
},
RECORDING_CH: {
type: 'array',
showName: 'Recording Channels',
show: true, // 是否需顯示給user看
range: Array(16).fill([0, 1]), // UI上能輸入的最大最小值
func: func.RECORDING_CH,
revFunc: revFunc.RECORDING_CH,
},
AXIS_CH: {
type: 'array',
showName: 'Recording 3-AXIS',
show: true, // 是否需顯示給user看
start: 256,
range: Array(4).fill([0, 1]),
func: func.AXIS_CH,
revFunc: revFunc.AXIS_CH,
},
AMP_GAIN: {
type: 'string',
showName: 'Amp gain',
show: true, // 是否需顯示給user看
range: option.AMP_GAIN,
func: func.AMP_GAIN,
revFunc: revFunc.AMP_GAIN,
},
SAMPLE_RATE: {
type: 'string',
showName: 'Sample Rate',
show: true, // 是否需顯示給user看
range: option.SAMPLE_RATE,
func: func.SAMPLE_RATE,
revFunc: revFunc.SAMPLE_RATE,
},
ADC_CLOCK: {
type: 'number',
show: false, // 是否需顯示給user看
range: Object.freeze({ min: 40, max: 800 }), // adcClock = 8e5 / sampleRate, min: 8e5 / 20k = 40, max: 8e5 / 1k = 800
func: func.ADC_CLOCK,
revFunc: revFunc.ADC_CLOCK,
},
ACCELERATOR_S: { // [TODO] acc sensitivity val?
type: 'string',
showName: 'Accelerator Sensitivity',
show: true, // 是否需顯示給user看
range: option.ACCELERATOR_S,
func: func.ACCELERATOR_S,
revFunc: revFunc.ACCELERATOR_S,
},
// sti
STIMULATING: {
type: 'boolean',
showName: 'STIMULATING',
show: true, // 是否需顯示給user看
range: [true, false],
func: func.STIMULATING,
revFunc: revFunc.STIMULATING,
},
STI_CHANNEL: {
type: 'array',
showName: 'Stimulation Channels',
show: true, // 是否需顯示給user看
range: function (posChList, negChList) { // channelList 須為 0/1 array
posChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
negChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
return true
},
func: func.STI_CHANNEL,
revFunc: revFunc.STI_CHANNEL,
},
STI_POLARITY: {
type: 'array',
showName: 'Polarity',
show: true, // 是否需顯示給user看
range: function (posChList, negChList) { // channelList 須為 0/1 array
posChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
negChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
return true
},
func: func.STI_POLARITY,
revFunc: revFunc.STI_POLARITY,
},
STI_H_BRIDGE: {
type: 'string',
showName: 'ELECTRODE',
show: true, // 是否需顯示給user看
range: option.STI_H_BRIDGE,
func: func.STI_H_BRIDGE,
revFunc: revFunc.STI_H_BRIDGE,
},
CONTINUOUS_STI: {
type: 'string',
showName: 'CYCLE NUMBER SELECT',
show: true, // 是否需顯示給user看
range: option.CONTINUOUS_STI,
func: func.CONTINUOUS_STI,
revFunc: revFunc.CONTINUOUS_STI,
},
STI_CYCLE_LIST: {
type: 'number',
show: false, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 255 }),
func: func.STI_CYCLE_LIST,
revFunc: revFunc.STI_CYCLE_LIST,
},
STI_AMPLITUDE: {
type: 'number',
showName: 'AMPLITUDE',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 5, max: 4000 }),
func: func.STI_AMPLITUDE,
revFunc: revFunc.STI_AMPLITUDE,
defaultUnit: 'uA',
unit: {
uA: 1,
},
},
STI_AMPLITUDE_H: {
type: 'number',
showName: 'AMPLITUDE_HIGH',
show: false, // 是否需顯示給user看
range: Object.freeze({ min: 5, max: 4000 }),
func: func.STI_AMPLITUDE_H,
revFunc: revFunc.STI_AMPLITUDE_H,
defaultUnit: 'uA',
unit: {
uA: 1,
},
},
STI_AMPLITUDE_L: {
type: 'number',
showName: 'AMPLITUDE_LOW',
show: false, // 是否需顯示給user看
range: Object.freeze({ min: 5, max: 4000 }),
func: func.STI_AMPLITUDE_L,
revFunc: revFunc.STI_AMPLITUDE_L,
defaultUnit: 'uA',
unit: {
uA: 1,
},
},
STI_PATTERN: {
type: 'string',
showName: 'PATTERN',
show: true, // 是否需顯示給user看
range: option.STI_PATTERN,
func: func.STI_PATTERN,
revFunc: revFunc.STI_PATTERN,
},
STI_T1: {
type: 'number',
showName: 'T1',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 100, max: 10230 }), // 0.1ms~10.23ms
func: func.STI_T1,
revFunc: revFunc.STI_T1,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T2: {
type: 'number',
showName: 'T2',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 10230 }), // 0ms~10.23ms
func: func.STI_T2,
revFunc: revFunc.STI_T2,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T3: {
type: 'number',
showName: 'T3',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 100, max: 10230 }), // 0.1ms~10.23ms
func: func.STI_T3,
revFunc: revFunc.STI_T3,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T4: {
type: 'number',
showName: 'T4',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 0, max: 1310710 }), // 0ms~1310.71ms
func: func.STI_T4,
revFunc: revFunc.STI_T4,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
}
export default Neulive31
+10
View File
@@ -0,0 +1,10 @@
export default {
// rec
AMP_GAIN: ['100', '400', '800'],
SAMPLE_RATE: ['1k', '2k', '4k', '5k', '8k', '10k', '20k'],
ACCELERATOR_S: ['2G', '4G', '8G', '16G'],
// sti
STI_H_BRIDGE: ['Monopolar', 'Bipolar'],
CONTINUOUS_STI: ['limite', 'Unlimite'],
STI_PATTERN: ['Monophasic', 'Biphasic'],
}
+117
View File
@@ -0,0 +1,117 @@
import option from './option'
export default {
// rec
RECORDING: (val) => {
return parseInt(val) === 1
},
RECORDING_CH: (val) => {
const channelList = []
const channelSet = val.toString(2).split('').reverse()
channelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
channelList.push(index + 1)
}
})
return channelList
},
AXIS_CH: (val) => {
const axisChannelList = []
const axisChannelSet = val.toString(2).split('').reverse()
axisChannelSet.forEach((element, index) => {
if (parseInt(element) === 1) {
if (index === 0) {
axisChannelList.push('x')
} else if (index === 1) {
axisChannelList.push('y')
} else if (index === 2) {
axisChannelList.push('z')
} else if (index === 3) {
axisChannelList.push('m')
}
}
})
return axisChannelList
},
AMP_GAIN: (idx) => {
return option.AMP_GAIN[parseInt(idx)]
},
SAMPLE_RATE: (idx) => {
return option.SAMPLE_RATE[parseInt(idx)]
},
ADC_CLOCK: (val) => {
return parseInt(val)
},
ACCELERATOR_S: (idx) => {
return option.ACCELERATOR_S[parseInt(idx)]
},
// sti
STIMULATING: (val) => {
return parseInt(val) === 1
},
STI_CHANNEL: (val, stiPolarityBinaryVal) => {
const stiChannelSet = val.toString(2).split('').reverse()
const stiPolaritySet = stiPolarityBinaryVal.toString(2).split('').reverse()
const posChannelList = []
const negChannelList = []
stiChannelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
if (parseInt(stiPolaritySet[index]) > 0) {
posChannelList.push(index + 1)
} else {
negChannelList.push(index + 1)
}
}
})
return { pos: posChannelList, neg: negChannelList }
},
STI_POLARITY: (val, stiChannelBinaryVal) => {
const stiPolaritySet = val.toString(2).split('').reverse()
const stiChannelSet = stiChannelBinaryVal.toString(2).split('').reverse()
const posChannelList = []
const negChannelList = []
stiChannelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
if (parseInt(stiPolaritySet[index]) > 0) {
posChannelList.push(index + 1)
} else {
negChannelList.push(index + 1)
}
}
})
return { pos: posChannelList, neg: negChannelList }
},
STI_H_BRIDGE: (idx) => {
return option.STI_H_BRIDGE[parseInt(idx)]
},
CONTINUOUS_STI: (idx) => {
return option.CONTINUOUS_STI[parseInt(idx)]
},
STI_CYCLE_LIST: (_list) => {
return parseInt(_list[0]) // cycle number
},
STI_AMPLITUDE: (val) => {
return val * 5
},
STI_AMPLITUDE_H: (val) => {
return val * 5
},
STI_AMPLITUDE_L: (val) => {
return val * 5
},
STI_PATTERN: (idx) => {
return option.STI_PATTERN[parseInt(idx)]
},
STI_T1: (_list) => { // output unit: us
return parseInt(_list[0] * 10)
},
STI_T2: (_list) => { // output unit: us
return parseInt(_list[0] * 10)
},
STI_T3: (_list) => { // output unit: us
return parseInt(_list[0] * 10)
},
STI_T4: (_list) => { // output unit: us
return parseInt(_list[0] * 10)
},
}
+95
View File
@@ -0,0 +1,95 @@
import option from './option'
export default {
// rec
RECORDING_CH_L: (chList) => {
let channelStr = ''
chList.forEach(function (item) {
channelStr += item
})
return parseInt(channelStr, 2)
},
RECORDING_CH_H: (chList) => {
let channelStr = ''
chList.forEach(function (item) {
channelStr += item
})
return parseInt(channelStr, 2)
},
AMP_GAIN: (val) => {
return option.AMP_GAIN.indexOf(val.toString())
},
SAMPLE_RATE: (val) => {
return option.SAMPLE_RATE.indexOf(val.toString())
},
ADC_CLOCK: (val) => {
return parseInt(val)
},
RECORDING: (val) => {
return val
},
AXIS_CH: (chList) => {
let channelStr = ''
chList.forEach(function (item) {
channelStr += item
})
return parseInt(channelStr, 2)
},
ACCELERATOR_S: (val) => {
return option.ACCELERATOR_S.indexOf(val.toString())
},
// sti
STIMULATING: (val) => {
return val
},
STI_CHANNEL: (posChList, negChList) => {
let stiChannelSet = ''
for (let i = 15; i >= 0; i--) {
stiChannelSet += String(posChList[i] & negChList[i])
}
return parseInt(stiChannelSet, 2)
},
STI_POLARITY: (posChList, negChList) => {
let stiPolaritySet = ''
for (let i = 15; i >= 0; i--) {
stiPolaritySet += String(posChList[i] & negChList[i])
}
return parseInt(stiPolaritySet, 2)
},
STI_H_BRIDGE: (val) => {
return option.STI_H_BRIDGE.indexOf(val.toString())
},
CONTINUOUS_STI: (val) => {
return option.CONTINUOUS_STI.indexOf(val.toString())
},
STI_CYCLE_CH0: (cycleNum) => {
return String(cycleNum - 1)
},
REPEAT_TIME_littleEndian: (val) => {
return parseInt(val)
},
REPEAT_INTERVAL_littleEndian: (val) => { // UI (input) unit: s (要輸入s的原因是精度為10ms,因此需四捨五入取到小數點第二位,且UI上單位為s)
return parseFloat(parseFloat(val).toFixed(2)) * 1e3 // * 1e3: s -> ms
},
STI_AMPLITUDE_L1: (val) => {
return parseInt(val / 5)
},
STI_AMPLITUDE_H3: (val) => {
return parseInt(val / 5)
},
STI_PATTERN: (val) => {
return option.STI_PATTERN.indexOf(val.toString())
},
STI_T1_CH0: (val) => { // input unit: us
return String(parseFloat(val / 10))
},
STI_T2_CH0: (val) => { // input unit: us
return String(parseFloat(val / 10))
},
STI_T3_CH0: (val) => { // input unit: us
return String(parseFloat(val / 10))
},
STI_T4_CH0: (val) => { // input unit: us
return String(parseFloat(val / 10))
},
}
+285
View File
@@ -0,0 +1,285 @@
/* neulive 3.5publish
格式:
type: 轉換函數func前端值轉後端值輸入值的型態
show: boolean, 用於判斷此參數是否需顯示在UI上 or not如需顯示顯示名稱為showName欄位所寫的值
range: 用於檢查輸入值是否合法range型態為Array的為選項型態為Object的為上下界型態為function的會直接return是否合法true/false
func: 轉換函數將前端值轉成後端值
revFunc: 反轉換函數將後端值轉成前端值
showName (optional): 顯示在UI上的名稱show = true時才會有
start (optional): 參數起始編號offset的概念現用於channel相關的參數
repeat (optional): 有幾個重複前綴詞但標號不同的參數現用於channel相關的參數可參考STI_CYCLE_CHO參數範例
repeatName (optional): 承repeat表示前綴詞名稱叫什麼可參考STI_CYCLE_CHO參數範例
defaultUnit (optional): "前端"顯示的預設單位
unit (optional): 單位轉換表object key為單位名稱object value為unit scale如scale = 1代表為後端儲存的單位scale = 1e3代表將後端值轉換成這單位要除1e3e.g. ms -> s
*/
import func from './func'
import revFunc from './revFunc'
import option from './option'
const Neulive35 = {
// rec
RECORDING_CH_L: {
type: 'array',
showName: 'Recording Channel Low',
show: true, // 是否需顯示給user看
range: Array(16).fill([0, 1]), // 選項0 or 1
func: func.RECORDING_CH_L,
revFunc: revFunc.RECORDING_CH_L,
},
RECORDING_CH_H: {
type: 'array',
showName: 'Recording Channel High',
show: true, // 是否需顯示給user看
start: 17,
range: Array(16).fill([0, 1]),
func: func.RECORDING_CH_H,
revFunc: revFunc.RECORDING_CH_H,
},
AMP_GAIN: {
type: 'string',
showName: 'Amp Gain',
show: true, // 是否需顯示給user看
range: option.AMP_GAIN,
func: func.AMP_GAIN,
revFunc: revFunc.AMP_GAIN,
},
SAMPLE_RATE: {
type: 'string',
showName: 'Sample Rate',
show: true, // 是否需顯示給user看
range: option.SAMPLE_RATE,
func: func.SAMPLE_RATE,
revFunc: revFunc.SAMPLE_RATE,
},
ADC_CLOCK: {
type: 'number',
show: false, // 是否需顯示給user看
range: Object.freeze({ min: 80, max: 8e3 }), // adcClock = 8e6 / sampleRate, min: 8e6 / 100k = 80, max: 8e6 / 1k = 8e3
func: func.ADC_CLOCK,
revFunc: revFunc.ADC_CLOCK,
},
RECORDING: {
type: 'boolean',
showName: 'RECORDING',
show: true, // 是否需顯示給user看
range: [true, false], // 選項true or false
func: func.RECORDING,
revFunc: revFunc.RECORDING,
},
AXIS_CH: {
type: 'array',
showName: 'Recording 3-AXIS',
show: true, // 是否需顯示給user看
start: 256,
range: Array(4).fill([0, 1]),
func: func.AXIS_CH,
revFunc: revFunc.AXIS_CH,
},
ACCELERATOR_S: { // [TODO] acc sensitivity val?
type: 'string',
showName: 'Accelerator Sensitivity',
show: true, // 是否需顯示給user看
range: option.ACCELERATOR_S,
func: func.ACCELERATOR_S,
revFunc: revFunc.ACCELERATOR_S,
},
// sti
STIMULATING: {
type: 'boolean',
showName: 'STIMULATING',
show: true, // 是否需顯示給user看
range: [true, false],
func: func.STIMULATING,
revFunc: revFunc.STIMULATING,
},
STI_CHANNEL: {
type: 'array',
showName: 'Stimulation Channels',
show: true, // 是否需顯示給user看
range: function (posChList, negChList) { // channelList 須為 0/1 array
posChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
negChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
return true
},
func: func.STI_CHANNEL,
revFunc: revFunc.STI_CHANNEL,
},
STI_POLARITY: {
type: 'array',
showName: 'Polarity',
show: true, // 是否需顯示給user看
range: function (posChList, negChList) { // channelList 須為 0/1 array
posChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
negChList.forEach(function (item) {
if (parseInt(item) !== 0 && parseInt(item) !== 1) {
return false
}
})
return true
},
func: func.STI_POLARITY,
revFunc: revFunc.STI_POLARITY,
},
STI_H_BRIDGE: {
type: 'string',
showName: 'ELECTRODE',
show: true, // 是否需顯示給user看
range: option.STI_H_BRIDGE,
func: func.STI_H_BRIDGE,
revFunc: revFunc.STI_H_BRIDGE,
},
CONTINUOUS_STI: {
type: 'string',
showName: 'CYCLE NUMBER SELECT',
show: true, // 是否需顯示給user看
range: option.CONTINUOUS_STI,
func: func.CONTINUOUS_STI,
revFunc: revFunc.CONTINUOUS_STI,
},
STI_CYCLE_CH0: {
type: 'number',
showName: 'CYCLE NUMBER',
show: true, // 是否需顯示給user看
repeat: 16, // total 16 channels
repeatName: 'STI_CYCLE_CH', // STI_CYCLE_CH0, STI_CYCLE_CH1 ... STI_CYCLE_CH15
range: Object.freeze({ min: 1, max: 256 }),
func: func.STI_CYCLE_CH0,
revFunc: revFunc.STI_CYCLE_CH0,
},
REPEAT_TIME_littleEndian: {
type: 'number',
showName: 'REPEAT NUMBER',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 1, max: 255 }), // [TODO] 3.5介面中一邊寫255一邊寫256 & 後端寫max 255 ?
func: func.REPEAT_TIME_littleEndian,
revFunc: revFunc.REPEAT_TIME_littleEndian,
},
REPEAT_INTERVAL_littleEndian: { // unit: ms
type: 'number',
showName: 'REPEAT INTERVAL',
show: true, // 是否需顯示給user看
range: function (val, periodNumber, cycleNumber, T5) {
// 1e6: s -> us
const usVal = parseFloat(parseFloat(val).toFixed(2)) * 1e6
return usVal > periodNumber * cycleNumber + T5
},
func: func.REPEAT_INTERVAL_littleEndian,
revFunc: revFunc.REPEAT_INTERVAL_littleEndian,
defaultUnit: 's',
unit: {
ms: 1,
s: 1e3,
},
},
STI_AMPLITUDE_L1: {
type: 'number',
showName: 'AMPLITUDE PHASE1 (uA)',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 5, max: 4000 }),
func: func.STI_AMPLITUDE_L1,
revFunc: revFunc.STI_AMPLITUDE_L1,
defaultUnit: 'uA',
unit: {
uA: 1,
},
},
STI_AMPLITUDE_H3: {
type: 'number',
showName: 'AMPLITUDE PHASE2 (uA)',
show: true, // 是否需顯示給user看
range: Object.freeze({ min: 5, max: 4000 }),
func: func.STI_AMPLITUDE_H3,
revFunc: revFunc.STI_AMPLITUDE_H3,
defaultUnit: 'uA',
unit: {
uA: 1,
},
},
STI_PATTERN: {
type: 'string',
showName: 'PATTERN',
show: true, // 是否需顯示給user看
range: option.STI_PATTERN,
func: func.STI_PATTERN,
revFunc: revFunc.STI_PATTERN,
},
STI_T1_CH0: {
type: 'number',
showName: 'T1',
show: true, // 是否需顯示給user看
repeat: 16, // total 16 channels
repeatName: 'STI_T1_CH', // STI_T1_CH0, STI_T1_CH1 ... STI_T1_CH15
range: Object.freeze({ min: 10, max: 655350 }), // 0.01ms~655.35ms
func: func.STI_T1_CH0,
revFunc: revFunc.STI_T1_CH0,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T2_CH0: {
type: 'number',
showName: 'T2',
show: true, // 是否需顯示給user看
repeat: 16, // total 16 channels
repeatName: 'STI_T2_CH', // STI_T2_CH0, STI_T2_CH1 ... STI_T2_CH15
range: Object.freeze({ min: 0, max: 655350 }), // 0ms~655.35ms
func: func.STI_T2_CH0,
revFunc: revFunc.STI_T2_CH0,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T3_CH0: {
type: 'number',
showName: 'T3',
show: true, // 是否需顯示給user看
repeat: 16, // total 16 channels
repeatName: 'STI_T3_CH', // STI_T3_CH0, STI_T3_CH1 ... STI_T3_CH15
range: Object.freeze({ min: 0, max: 655350 }), // 0ms~655.35ms
func: func.STI_T3_CH0,
revFunc: revFunc.STI_T3_CH0,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
STI_T4_CH0: {
type: 'number',
showName: 'T4',
show: true, // 是否需顯示給user看
repeat: 16, // total 16 channels
repeatName: 'STI_T4_CH', // STI_T4_CH0, STI_T4_CH1 ... STI_T4_CH15
range: Object.freeze({ min: 0, max: 655350 }), // 0ms~655.35ms
func: func.STI_T4_CH0,
revFunc: revFunc.STI_T4_CH0,
defaultUnit: 'ms',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
},
},
}
export default Neulive35
+10
View File
@@ -0,0 +1,10 @@
export default {
// rec
AMP_GAIN: ['100', '500', '300'],
SAMPLE_RATE: ['1k', '2k', '4k', '5k', '8k', '10k', '20k', '30k', '40k', '50k', '60k', '70k', '80k', '90k', '100k'],
ACCELERATOR_S: ['2G', '4G', '8G', '16G'],
// sti
STI_H_BRIDGE: ['Monopolar', 'Bipolar'],
CONTINUOUS_STI: ['limite', 'Unlimite'],
STI_PATTERN: ['Monophasic', 'Biphasic'],
}
+130
View File
@@ -0,0 +1,130 @@
import option from './option'
export default {
// rec
RECORDING_CH_L: (val) => {
const channelList = []
const channelSet = val.toString(2).split('').reverse()
channelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
channelList.push(index + 1)
}
})
return channelList
},
RECORDING_CH_H: (val) => {
const channelList = []
const channelSet = val.toString(2).split('').reverse()
channelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
channelList.push(index + 17)
}
})
return channelList
},
AMP_GAIN: (idx) => {
return option.AMP_GAIN[parseInt(idx)]
},
SAMPLE_RATE: (idx) => {
return option.SAMPLE_RATE[parseInt(idx)]
},
ADC_CLOCK: (val) => {
return parseInt(val)
},
RECORDING: (val) => {
return parseInt(val) === 1
},
AXIS_CH: (val) => {
const axisChannelList = []
const axisChannelSet = val.toString(2).split('').reverse()
axisChannelSet.forEach((element, index) => {
if (parseInt(element) === 1) {
if (index === 0) {
axisChannelList.push('x')
} else if (index === 1) {
axisChannelList.push('y')
} else if (index === 2) {
axisChannelList.push('z')
} else if (index === 3) {
axisChannelList.push('m')
}
}
})
return axisChannelList
},
ACCELERATOR_S: (idx) => {
return option.ACCELERATOR_S[parseInt(idx)]
},
// sti
STIMULATING: (val) => {
return parseInt(val) === 1
},
STI_CHANNEL: (val, stiPolarityBinaryVal) => {
const stiChannelSet = val.toString(2).split('').reverse()
const stiPolaritySet = stiPolarityBinaryVal.toString(2).split('').reverse()
const posChannelList = []
const negChannelList = []
stiChannelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
if (parseInt(stiPolaritySet[index]) > 0) {
posChannelList.push(index + 1)
} else {
negChannelList.push(index + 1)
}
}
})
return { pos: posChannelList, neg: negChannelList }
},
STI_POLARITY: (val, stiChannelBinaryVal) => {
const stiPolaritySet = val.toString(2).split('').reverse()
const stiChannelSet = stiChannelBinaryVal.toString(2).split('').reverse()
const posChannelList = []
const negChannelList = []
stiChannelSet.forEach((element, index) => {
if (parseInt(element) > 0) {
if (parseInt(stiPolaritySet[index]) > 0) {
posChannelList.push(index + 1)
} else {
negChannelList.push(index + 1)
}
}
})
return { pos: posChannelList, neg: negChannelList }
},
STI_H_BRIDGE: (idx) => {
return option.STI_H_BRIDGE[parseInt(idx)]
},
CONTINUOUS_STI: (idx) => {
return option.CONTINUOUS_STI[parseInt(idx)]
},
STI_CYCLE_CH0: (val) => {
return parseInt(val) + 1
},
REPEAT_TIME_littleEndian: (val) => {
return parseInt(val)
},
REPEAT_INTERVAL_littleEndian: (val) => { // output unit: ms
return parseInt(val)
},
STI_AMPLITUDE_L1: (val) => {
return parseInt(val * 5)
},
STI_AMPLITUDE_H3: (val) => {
return val * 5
},
STI_PATTERN: (idx) => {
return option.STI_PATTERN[parseInt(idx)]
},
STI_T1_CH0: (val) => { // output unit: us
return val * 10
},
STI_T2_CH0: (val) => { // output unit: us
return val * 10
},
STI_T3_CH0: (val) => { // output unit: us
return val * 10
},
STI_T4_CH0: (val) => { // output unit: us
return val * 10
},
}
+13
View File
@@ -0,0 +1,13 @@
import Neulive31 from './Neulive31/index'
import Neulive35 from './Neulive35/index'
import EliteZM15 from './EliteZM15/index'
import EliteEIS from './EliteEIS/index'
const paramTable = {
Neulive31, // [TODO] replace by library_name
Neulive35, // [TODO] replace by library_name
EliteZM15,
EliteEIS,
}
export default paramTable
@@ -97,35 +97,6 @@ const recActs = {
data: payload.data,
})
},
/**
* into data to rec
*
* @param {int} meta
* @param {str} device
*/
[typePath.initDisplaySetting]: async ({ state, getters, commit }, payload) => {
switch (payload.device) {
case 'Neulive':
commit(typePath.initDisplaySettingNeulive, {
meta: payload.meta,
})
break
case 'Elite':
commit(typePath.initDisplaySettingElite, {
meta: payload.meta,
})
break
default:
break
}
},
[typePath.updateDisplaySetting]: async ({ state, getters, commit }, payload) => {
commit(typePath.updateDisplaySetting, {
updateObject: payload.updateObject,
})
},
}
export default recActs
@@ -49,14 +49,10 @@ const types = {
rec: {
init: 'initRec',
intoData: 'intoDataRec',
initDisplaySetting: 'initDisplaySettingRec',
initDisplaySettingNeulive: 'initDisplaySettingNeuliveRec',
initDisplaySettingElite: 'initDisplaySettingEliteRec',
set: 'setRec',
update: 'updateRec',
updateDataByIndex: 'updateDataByIndexRec',
updateDisplaySetting: 'updateDisplaySettingRec',
getAll: 'getAllRec',
getCycleDict: 'getCycleDictRec',
@@ -97,35 +97,6 @@ const recActs = {
data: payload.data,
})
},
/**
* into data to rec
*
* @param {int} meta
* @param {str} device
*/
[typePath.initDisplaySetting]: async ({ state, getters, commit }, payload) => {
switch (payload.device) {
case 'Neulive':
commit(typePath.initDisplaySettingNeulive, {
meta: payload.meta,
})
break
case 'Elite':
commit(typePath.initDisplaySettingElite, {
meta: payload.meta,
})
break
default:
break
}
},
[typePath.updateDisplaySetting]: async ({ state, getters, commit }, payload) => {
commit(typePath.updateDisplaySetting, {
updateObject: payload.updateObject,
})
},
}
export default recActs
@@ -48,9 +48,6 @@ const types = {
rec: {
init: 'initRec',
intoData: 'intoDataRec',
initDisplaySetting: 'initDisplaySettingRec',
initDisplaySettingNeulive: 'initDisplaySettingNeuliveRec',
initDisplaySettingElite: 'initDisplaySettingEliteRec',
set: 'setRec',
update: 'updateRec',