|
|
|
@@ -241,9 +241,9 @@
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="flex sm12 xl12 md12 xs12">
|
|
|
|
|
<div class="flex row align--center">
|
|
|
|
|
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(1, 0.1)">
|
|
|
|
|
<!-- <va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(1, 0.1)">
|
|
|
|
|
0.1
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
<va-input
|
|
|
|
|
@keyup.enter="timeRangeChange(1, t1RangeInput)"
|
|
|
|
|
v-model="t1RangeInput"
|
|
|
|
@@ -256,9 +256,9 @@
|
|
|
|
|
{{unitOptions[unitSelect].label}}
|
|
|
|
|
</p>
|
|
|
|
|
</va-input>
|
|
|
|
|
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(1, 10.23)">
|
|
|
|
|
<!-- <va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(1, 10.23)">
|
|
|
|
|
10.23
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -266,9 +266,9 @@
|
|
|
|
|
<div class="row" v-if="patternModeSelect==1">
|
|
|
|
|
<div class="flex sm12 xl12 md12 xs12">
|
|
|
|
|
<div class="flex row align--center">
|
|
|
|
|
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(2, 0)">
|
|
|
|
|
<!-- <va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(2, 0)">
|
|
|
|
|
0
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
<va-input
|
|
|
|
|
@keyup.enter="timeRangeChange(2, t2RangeInput)"
|
|
|
|
|
v-model="t2RangeInput"
|
|
|
|
@@ -281,9 +281,9 @@
|
|
|
|
|
{{unitOptions[unitSelect].label}}
|
|
|
|
|
</p>
|
|
|
|
|
</va-input>
|
|
|
|
|
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(2, 10.23)">
|
|
|
|
|
<!-- <va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(2, 10.23)">
|
|
|
|
|
10.23
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -291,9 +291,9 @@
|
|
|
|
|
<div class="row" v-if="patternModeSelect==1">
|
|
|
|
|
<div class="flex sm12 xl12 md12 xs12">
|
|
|
|
|
<div class="flex row align--center">
|
|
|
|
|
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(3, 0.1)">
|
|
|
|
|
<!-- <va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(3, 0.1)">
|
|
|
|
|
0.1
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
<va-input
|
|
|
|
|
@keyup.enter="timeRangeChange(3, t3RangeInput)"
|
|
|
|
|
v-model="t3RangeInput"
|
|
|
|
@@ -306,9 +306,9 @@
|
|
|
|
|
{{unitOptions[unitSelect].label}}
|
|
|
|
|
</p>
|
|
|
|
|
</va-input>
|
|
|
|
|
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(3, 10.23)">
|
|
|
|
|
<!-- <va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(3, 10.23)">
|
|
|
|
|
10.23
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -316,11 +316,12 @@
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="flex sm12 xl12 md12 xs12">
|
|
|
|
|
<div class="flex row align--center">
|
|
|
|
|
<va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(4, 0)">
|
|
|
|
|
<!-- <va-button slot="append" class="mr-2 pa-1 shrink" small @click="timeRangeChange(4, 0)">
|
|
|
|
|
0
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
<va-input
|
|
|
|
|
@keyup.enter="timeRangeChange(4, t4RangeInput)"
|
|
|
|
|
readonly
|
|
|
|
|
v-model="t4RangeInput"
|
|
|
|
|
class="mb-0"
|
|
|
|
|
:label="'T4 RANGE'"
|
|
|
|
@@ -331,9 +332,9 @@
|
|
|
|
|
{{unitOptions[unitSelect].label}}
|
|
|
|
|
</p>
|
|
|
|
|
</va-input>
|
|
|
|
|
<va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(4, 1310.71)">
|
|
|
|
|
<!-- <va-button slot="append" class="ml-2 pa-1 shrink" small @click="timeRangeChange(4, 1310.71)">
|
|
|
|
|
1310.71
|
|
|
|
|
</va-button>
|
|
|
|
|
</va-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -360,7 +361,7 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { taskInfo } from '../../../../data/task/TaskInfo'
|
|
|
|
|
import { mapMutations } from 'vuex'
|
|
|
|
|
import { mapActions, mapMutations } from 'vuex'
|
|
|
|
|
import { mapFields } from 'vuex-map-fields'
|
|
|
|
|
import types from '@/store/modules/task/content/types'
|
|
|
|
|
|
|
|
|
@@ -507,7 +508,7 @@ export default {
|
|
|
|
|
this.periodNumberInput = String((this.periodNumber) / this.unitMultiply)
|
|
|
|
|
|
|
|
|
|
if (this.periodNumber !== 0) {
|
|
|
|
|
this.frequencyNumber = parseInt(1e6 / this.periodNumber)
|
|
|
|
|
this.frequencyNumber = parseInt(1 / (this.periodNumber * 1e-6))
|
|
|
|
|
this.frequencyNumberInput = String(this.frequencyNumber)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@@ -687,6 +688,12 @@ export default {
|
|
|
|
|
parameter: 'STI_PATTERN',
|
|
|
|
|
content: this.patternModeSelect,
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
this.autoComputeT4()
|
|
|
|
|
const check4 = this.checkIndividualTRange(4, this.t4Range)
|
|
|
|
|
if (check4) {
|
|
|
|
|
this.updateTimeRange()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
frequencyNumberChange (val) {
|
|
|
|
|
if (this.frequencyNumberInput == null || isNaN(val)) {
|
|
|
|
@@ -755,18 +762,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
autoResetAllTRange () {
|
|
|
|
|
if (this.patternModeSelect === 0) { // Monophasic
|
|
|
|
|
this.t1Range = this.periodNumber * 0.5 / 10
|
|
|
|
|
this.t1Range = 10
|
|
|
|
|
this.t1RangeInput = String((this.t1Range * 10) / this.unitMultiply)
|
|
|
|
|
this.t4Range = this.periodNumber * 0.5 / 10
|
|
|
|
|
this.t4Range = this.periodNumber / 10 - this.t1Range
|
|
|
|
|
this.t4RangeInput = String((this.t4Range * 10) / this.unitMultiply)
|
|
|
|
|
} else if (this.patternModeSelect === 1) { // Biphasic
|
|
|
|
|
this.t1Range = this.periodNumber * 0.4 / 10
|
|
|
|
|
this.t1Range = 10
|
|
|
|
|
this.t1RangeInput = String((this.t1Range * 10) / this.unitMultiply)
|
|
|
|
|
this.t2Range = this.periodNumber * 0.1 / 10
|
|
|
|
|
this.t2Range = 10
|
|
|
|
|
this.t2RangeInput = String((this.t2Range * 10) / this.unitMultiply)
|
|
|
|
|
this.t3Range = this.periodNumber * 0.4 / 10
|
|
|
|
|
this.t3Range = 10
|
|
|
|
|
this.t3RangeInput = String((this.t3Range * 10) / this.unitMultiply)
|
|
|
|
|
this.t4Range = this.periodNumber * 0.1 / 10
|
|
|
|
|
this.t4Range = this.periodNumber / 10 - this.t1Range - this.t2Range - this.t3Range
|
|
|
|
|
this.t4RangeInput = String((this.t4Range * 10) / this.unitMultiply)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@@ -801,6 +808,7 @@ export default {
|
|
|
|
|
const status3 = this.checkIndividualTRange(3, this.t3Range)
|
|
|
|
|
const status4 = this.checkIndividualTRange(4, this.t4Range)
|
|
|
|
|
if (overallStatus && status1 && status2 && status3 && status4) {
|
|
|
|
|
this.resetAllTRangeErrorMsgParam({ totalT: 4 })
|
|
|
|
|
this.updateTimeRange()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@@ -815,85 +823,69 @@ export default {
|
|
|
|
|
this.pageToast('Auto complete T4 value')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
checkOverallTRange () { // [TODO] updateErrorMsg
|
|
|
|
|
checkOverallTRange () {
|
|
|
|
|
let status = true
|
|
|
|
|
if (this.t1Range > this.periodNumber) {
|
|
|
|
|
this.updateTRangeErrorMsg(1, true, 'T1 > Period')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: 1, status: true, msg: 'T1 > Period' })
|
|
|
|
|
status = false
|
|
|
|
|
}
|
|
|
|
|
if (this.t2Range > this.periodNumber) {
|
|
|
|
|
this.updateTRangeErrorMsg(2, true, 'T2 > Period')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: 2, status: true, msg: 'T2 > Period' })
|
|
|
|
|
status = false
|
|
|
|
|
}
|
|
|
|
|
if (this.t3Range > this.periodNumber) {
|
|
|
|
|
this.updateTRangeErrorMsg(3, true, 'T3 > Period')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: 3, status: true, msg: 'T3 > Period' })
|
|
|
|
|
status = false
|
|
|
|
|
}
|
|
|
|
|
if (this.t4Range > this.periodNumber) {
|
|
|
|
|
this.updateTRangeErrorMsg(4, true, 'T4 > Period')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: 4, status: true, msg: 'T4 > Period' })
|
|
|
|
|
status = false
|
|
|
|
|
}
|
|
|
|
|
if (this.t1Range + this.t2Range + this.t3Range + this.t4Range !== this.periodNumber) {
|
|
|
|
|
this.updateTRangeErrorMsg(1, true, 'T1 + T2 + T3 + T4 != period')
|
|
|
|
|
status = false
|
|
|
|
|
}
|
|
|
|
|
this.resetAllTRangeErrorMsg()
|
|
|
|
|
return status
|
|
|
|
|
},
|
|
|
|
|
checkIndividualTRange (stiIimeSelect, val) { // [TODO] updateErrorMsg
|
|
|
|
|
checkIndividualTRange (stiIimeSelect, val) {
|
|
|
|
|
// val unit: us
|
|
|
|
|
val = parseFloat(val) * 10 // UI us
|
|
|
|
|
if (val < 0 || isNaN(val)) {
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, true, 'T > 0')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: true, msg: 'T > 0' })
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (stiIimeSelect) {
|
|
|
|
|
case 1:
|
|
|
|
|
if (val < 100 || val > 10230) { // us
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, true, '0.1ms <= T1 <= 10.23ms')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: true, msg: '0.1ms <= T1 <= 10.23ms' })
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, false, '')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: false, msg: '' })
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
if (val < 0 || val > 10230) { // us
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, true, '0ms <= T2 <= 10.23ms')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: true, msg: '0ms <= T2 <= 10.23ms' })
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, false, '')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: false, msg: '' })
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
if (val < 100 || val > 10230) { // us
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, true, '0.1ms <= T3 <= 10.23ms')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: true, msg: '0.1ms <= T3 <= 10.23ms' })
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, false, '')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: false, msg: '' })
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
if (val < 0 || val > 1310710) { // us
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, true, '0ms <= T4 <= 1310.71ms')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: true, msg: '0ms <= T4 <= 1310.71ms' })
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
this.updateTRangeErrorMsg(stiIimeSelect, false, '')
|
|
|
|
|
this.updateTRangeErrorMsgParam({ stiIimeSelect: stiIimeSelect, status: false, msg: '' })
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
updateTRangeErrorMsg (stiIimeSelect, status, msg) {
|
|
|
|
|
const index = stiIimeSelect - 1
|
|
|
|
|
this.TRangeErrorMsgList[index].showError = status
|
|
|
|
|
this.TRangeErrorMsgList[index].errorMsg[0] = msg
|
|
|
|
|
},
|
|
|
|
|
resetAllTRangeErrorMsg () {
|
|
|
|
|
this.updateTRangeErrorMsg(1, false, '')
|
|
|
|
|
this.updateTRangeErrorMsg(2, false, '')
|
|
|
|
|
this.updateTRangeErrorMsg(3, false, '')
|
|
|
|
|
this.updateTRangeErrorMsg(4, false, '')
|
|
|
|
|
},
|
|
|
|
|
updateStiChannel () {
|
|
|
|
|
// stiChannelSet (+,-), stiPolaritySet (+)
|
|
|
|
|
let stiChannelSet = ''
|
|
|
|
@@ -969,7 +961,8 @@ export default {
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
...mapMutations('taskContent', [types.param.initTRangeErrorMsgList]),
|
|
|
|
|
...mapActions('taskContent', [types.param.resetAllTRangeErrorMsg]),
|
|
|
|
|
...mapMutations('taskContent', [types.param.initTRangeErrorMsgList, types.param.updateTRangeErrorMsg]),
|
|
|
|
|
},
|
|
|
|
|
created () {
|
|
|
|
|
this.initTRangeErrorMsgListParam({ totalT: 4 })
|
|
|
|
|