Compare commits

...

124 Commits

Author SHA1 Message Date
peterlu14 a3ccb942e5 - fix create task 2023-03-25 13:18:41 +08:00
peterlu14 eacc0d9547 - project sort with created time
- new project created time reassign
- copy project created time reassign
- save project (create task, copy task, delete task)
2023-03-25 13:07:46 +08:00
peterlu14 9cc653b761 -auto save ( cycle, device) 2023-03-24 19:22:38 +08:00
peterlu14 0cfc02c939 - reset projecttableselectIndex
- prevent select task null
- fixed parameter is undefined
- fix scheduler change mode reset problem
- auto save
2023-03-24 19:07:42 +08:00
ROY 60252b5cfe [update] update AC_AMP defaultValue of schedule 2023-03-21 16:21:51 +08:00
peterlu14 cc5207ae07 - fix legend name duplicate problem 2023-03-16 17:56:32 +08:00
peterlu14 4ad2b51161 - Elite EDC VOLT_VSCAN to CA_VOLT 2023-03-08 09:37:12 +08:00
ROY 0f32263d12 [update] update bat0.1 and new bat1.0 2023-03-07 18:03:59 +08:00
peterlu14 52db5b818c [update] remove navbar info 2023-02-04 10:56:28 +08:00
peterlu14 507718e3a3 [update] remove trigger battery 2023-01-12 10:04:15 +08:00
peterlu14 1c02ffb934 [update] fix scheduler trigger parameter show & layout 2023-01-10 11:30:00 +08:00
peterlu14 5d594eff06 [update] fix trigger scheduler & todo fix mode select and parameter info 2023-01-09 18:21:50 +08:00
peterlu14 29f7d23d38 [debug] fix delete file working mode error 2023-01-04 15:21:40 +08:00
peterlu14 4d032858a3 [update] trigger add timer 2023-01-03 15:30:03 +08:00
peterlu14 417c4010a9 [update] fix advanced setting 2023-01-03 14:58:48 +08:00
peterlu14 6bf7edad0b [update] recover trigger ui 2023-01-03 14:42:54 +08:00
peterlu14 fafc6620d2 [debug] fix CC Mode csv header wrong information 2022-12-27 11:04:40 +08:00
peterlu14 78d236d9c0 [update] fix scheduler parameter default problem 2022-12-27 11:03:52 +08:00
ROY 6e42dc9333 [update] add debug channel in file 2022-12-07 14:23:19 +08:00
peterlu14 d4d6172645 Merge branch 'dev/scheduler_UI' into dev/test_ac_amp 2022-12-06 16:07:17 +08:00
peterlu14 8685768f42 [update] fix impendance scale & millidegree 2022-12-06 15:58:06 +08:00
peterlu14 8ca0e3fa28 Merge branch 'dev/scheduler_UI' into dev/test_ac_amp 2022-12-06 14:22:32 +08:00
peterlu14 7e61eb6e52 [update] fix phase degree scale error 2022-12-06 14:22:12 +08:00
peterlu14 d16d7b0cb5 Merge branch 'dev/scheduler_UI' into dev/test_ac_amp 2022-12-05 11:57:19 +08:00
peterlu14 c960a8228c [update] fix phase degree scale error 2022-12-05 11:56:39 +08:00
ROY d4423503d6 Merge remote-tracking branch 'origin/dev/scheduler_UI' into dev/test_ac_amp 2022-12-02 17:45:35 +08:00
peterlu14 6c8583e139 [update] fix CF mode name & name PEIS into EIS 2022-12-02 17:40:54 +08:00
peterlu14 f3817694cf [update] scheduler count start from 0 2022-12-02 17:30:13 +08:00
peterlu14 73eced5f52 [update] EIS_AVERAGE_NUM default 3 -> 0 2022-12-02 17:29:54 +08:00
peterlu14 5453928bc1 [update] remove project table cell for cycle 2022-12-02 17:29:29 +08:00
peterlu14 814cfa8b86 [update] fix delete project step 2022-12-02 17:28:56 +08:00
ROY c3f6349c6e [test] print notify_one & notify_two & notify_three 2022-12-01 14:15:12 +08:00
peterlu14 0dc8cc4344 [update] support cancel delete project click anywhere 2022-11-28 10:09:41 +08:00
peterlu14 9358ad7ffa [update] input auto focus & double check delete 2022-11-25 13:27:58 +08:00
peterlu14 95203486e2 [update] add showProjectManagerPanel button 2022-11-25 13:26:07 +08:00
peterlu14 164a658870 [update] fix project copy parameter show error 2022-11-24 18:01:01 +08:00
peterlu14 d4c71fd4f9 [update] update package v-tooltips 2022-11-24 11:21:42 +08:00
peterlu14 4b60975782 [update] show available parameters 2022-11-24 11:19:55 +08:00
peterlu14 d1b8683387 [update] add v-popover to parameter 2022-11-24 11:18:56 +08:00
peterlu14 fd4a677173 [update] fix draggable problem by combine device table row together 2022-11-24 10:13:09 +08:00
peterlu14 6f4d96fb17 [update] project manager filter & table header 2022-11-21 17:44:33 +08:00
peterlu14 3ad822bde1 [update] open cf mode 2022-11-21 16:48:29 +08:00
peterlu14 2b2dd50f41 [update] modify project menu device and table font & fix draggable bug 2022-11-21 16:45:44 +08:00
peterlu14 ca57978763 [update] device not pair coor change & draggable cannot drag while input & table header & cell font-size change 2022-11-21 15:40:35 +08:00
peterlu14 6c41341392 [update] fix getConfigTable & getDevice null error 2022-11-21 11:50:30 +08:00
peterlu14 4a5f07da18 [update] fix project parameter refs init problem 2022-11-21 11:49:12 +08:00
peterlu14 17492ccc98 [update] Vue use v-tooltip 2022-11-18 16:57:11 +08:00
peterlu14 e5603cd80e [update] minor modify to project typography 2022-11-18 15:49:07 +08:00
peterlu14 99898dc862 [update] thead sticky top 2022-11-18 15:44:45 +08:00
peterlu14 66bdf13955 [update] display menu in flexbox layout 2022-11-18 14:22:05 +08:00
peterlu14 89ffad6fbe [update] fix img src, project manager ui change 2022-11-18 13:25:59 +08:00
peterlu14 079ba2023d [update] img resource 2022-11-18 13:21:57 +08:00
peterlu14 9158697bdc [update] device text change place 2022-11-17 16:05:35 +08:00
peterlu14 0b20104133 [update] hover show parameter & add task bottom & table font alter 2022-11-17 16:05:16 +08:00
peterlu14 90f6090edb Merge branch 'release/v1.3.9/scheduler_device' into dev/scheduler_cf 2022-11-16 17:34:41 +08:00
peterlu14 c51c723e5f [update] chart table add new pair T_Impedance, T_Phase, T_Current 2022-11-16 15:41:32 +08:00
peterlu14 e38df250e2 [update] fix cf_mode channel set index error 2022-11-16 15:40:36 +08:00
peterlu14 06d52cabea Merge remote-tracking branch 'origin/dev/cf_mode' into dev/scheduler_cf 2022-11-16 13:47:21 +08:00
ROY 11305159a9 [update] new cf mode, but hide 2022-11-16 11:54:17 +08:00
peterlu14 aef2a48b78 [update] menu font & device font fix 2022-11-16 10:54:00 +08:00
peterlu14 036f4b664e [update] project cycle height 50 px & fix task add show 2022-11-15 17:27:12 +08:00
peterlu14 45653ba7cb [update] fix draggable 2022-11-15 16:59:01 +08:00
ROY 504f4dc32c [update] clean up eis parameter 2022-11-15 16:08:31 +08:00
ROY 28f17e7280 [update] remove ADC_LEVEL_V_IN_15 parameter 2022-11-15 16:08:26 +08:00
ROY 18ba482f3d [update] update VT_MEASURE_VIN_RANGE parameter 2022-11-15 16:03:32 +08:00
ROY e82660bcbe [update] update CA_VOLT parameter 2022-11-15 16:01:07 +08:00
ROY 2441996848 [update] update CV_SCAN_RATE parameter 2022-11-15 15:51:28 +08:00
ROY cabb38be6f [update] update CV_E2 parameter 2022-11-15 15:47:59 +08:00
ROY 8b8094ce3e [update] update CV_E1 parameter 2022-11-15 15:44:33 +08:00
ROY 88ca4b4c62 [update] update CV_E_INITIAL parameter 2022-11-15 15:42:40 +08:00
peterlu14 b45f731f1d [update] project only one device & auto add start 2022-11-15 14:32:23 +08:00
peterlu14 7946ada265 [update] default parameter bug fix 2022-11-15 13:14:34 +08:00
peterlu14 90c722a7c3 [update] project ui & cursor pointer 2022-11-15 13:14:02 +08:00
peterlu14 d6712139f3 [update] add working mode Idle 2022-11-15 11:53:48 +08:00
peterlu14 1d20f9c207 [update] action&condition into start stop & create start in select device & project table ui optimize & add taskAct method 2022-11-15 11:50:23 +08:00
peterlu14 3e3fe59bd2 [update] add start & stop icon and recover menu function 2022-11-15 11:42:57 +08:00
ROY d9ef45a5a2 [update] new lprtia function 2022-11-10 14:11:37 +08:00
peterlu14 9495a17d2d [update] remove folder 2022-11-10 11:43:07 +08:00
peterlu14 120a7d45b1 [update] remove EIS device battery 2022-11-10 11:42:44 +08:00
peterlu14 d8bc49a100 [update] project menu UI update 2022-11-09 13:49:39 +08:00
ROY c4417a6458 [update] update GENERAL_HS_RTIA parameter 2022-11-08 16:13:46 +08:00
ROY 91c02007bc [update] update EIS_AVERAGE_NUM parameter 2022-11-08 15:58:32 +08:00
ROY 023de635fa [update] update EIS_DELAY parameter 2022-11-08 15:45:13 +08:00
ROY 4b410bfb3a [update] update EIS_SCALE parameter 2022-11-08 15:36:40 +08:00
ROY 2c205af6dd [update] update EIS_PPD parameter 2022-11-08 14:49:40 +08:00
ROY e517e9f796 [update] update EIS_AC_AMP parameter 2022-11-08 14:24:41 +08:00
ROY a5a590c007 [update] update EIS_DC_BIAS parameter 2022-11-08 14:18:05 +08:00
ROY 3dae7e644a [update] update EIS_FREQ parameter 2022-11-08 12:07:35 +08:00
ROY 768168c614 [update] delete FREQ_START & FREQ_STOP parameter 2022-11-08 11:05:56 +08:00
ROY 0a4635d648 [update] delete CHANNEL_LABEL parameter 2022-11-08 10:39:16 +08:00
ROY 3eb0e66b01 [update] update RT mode 2022-10-27 17:42:47 +08:00
peterlu14 a44f865d2d [update] disable RT Mode 2022-10-26 13:45:55 +08:00
peterlu14 46cf78cd55 [update] hide scheduler 2022-10-26 10:08:36 +08:00
ROY 200a8d25fa [update] EIS RT Mode 2022-10-25 13:32:37 +08:00
peterlu14 b5908f8815 [update] EIS RT Mode 2022-10-25 10:16:37 +08:00
peterlu14 abf5b0e54b [update] projectTable UI 2022-10-18 11:51:10 +08:00
peterlu14 9637a5365e [update] remove some condition & add device SelectKey in condition & project table UI 2022-10-18 11:42:20 +08:00
peterlu14 2c1e247178 [update&debug] fix rearrange problem & add copy function & auto pair device in task 2022-10-18 11:38:19 +08:00
peterlu14 dbbf30623d [update] task device setting big update & auto register connect device 2022-10-14 17:43:11 +08:00
peterlu14 eeb43694b1 [update] add order property in device 2022-10-14 16:03:42 +08:00
peterlu14 4054a113d0 [update] remove device hide modal 2022-10-14 16:01:15 +08:00
peterlu14 6bcf4b100f [update] remove add device button 2022-10-14 11:10:26 +08:00
peterlu14 a2237aeb0a [update] add detect function 2022-10-14 10:27:55 +08:00
peterlu14 2972fa365c [update] remove old auto get device 2022-10-14 10:14:12 +08:00
peterlu14 75d71099ed [update] device need to pair to run scheduler 2022-10-14 10:13:28 +08:00
peterlu14 2ab96c3bf6 [update] scheduler device big update from array to object & auto pairing 2022-10-14 10:11:17 +08:00
peterlu14 a088b940e6 [update] fix EIS DELAY range & add library EDC EIS 2022-10-14 10:06:13 +08:00
peterlu14 59ce90d348 [update] temp fix many project message error 2022-10-11 10:48:40 +08:00
peterlu14 01f1cf28d5 [update] temp fix project table element key duplicate error 2022-10-11 10:48:08 +08:00
peterlu14 b826442672 [update] fix project copy 2022-10-11 10:47:27 +08:00
ROY 0c385ee212 [update] remove LEVEL_V button and update V_RANGE label name 2022-10-06 16:54:42 +08:00
peterlu14 15eeb513a6 [debug] fix eis replay parameter & eis realtime chart fix 2022-10-05 18:09:11 +08:00
peterlu14 f5f30cbe61 [debug] eis realtime chart source and cache problem 2022-10-05 17:01:58 +08:00
peterlu14 f7dbf43e77 [update] project enable Elite_EDC & Elite_EIS 2022-10-05 12:02:28 +08:00
peterlu14 dba675254d [update] FREQ 13333333 2022-10-05 12:00:28 +08:00
peterlu14 7635f991c1 [update] vt add parameter MEASURE_VIN_RANGE 2022-10-05 11:21:49 +08:00
peterlu14 476a1699a5 [update] add VT_MODE 2022-10-05 10:59:50 +08:00
peterlu14 8131a19e97 [debug] fix copy id 2022-10-04 13:56:47 +08:00
peterlu14 c310cd4253 [update] check action target when create fake action 2022-10-04 13:56:27 +08:00
peterlu14 6c80390917 [debug] dismiss type error 2022-10-04 13:55:00 +08:00
peterlu14 ff0da52db8 [update] remove cycle & text ui & add -> + 2022-09-30 11:37:46 +08:00
peterlu14 4074af8b4f Merge remote-tracking branch 'origin/dev/debug_cp' into release/v1.3.8/cycle 2022-09-30 10:59:53 +08:00
peterlu14 562632e417 [update] replay new page & modal outside-dismiss 2022-09-30 10:42:07 +08:00
peterlu14 782efbf366 [update] project add cycle 2022-09-30 10:40:31 +08:00
82 changed files with 4449 additions and 1147 deletions
+43 -9
View File
@@ -17021,13 +17021,29 @@
"integrity": "sha512-VPNCOTZK6WZy73lcWc+R7IW1uaBFEO3/Csrs5CzWVOdvE30V8Y1+BE/BtTlcEmeDGx0eqdE7bSCg55Jj37PMJg=="
},
"v-tooltip": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.0.3.tgz",
"integrity": "sha512-KZZY3s+dcijzZmV2qoDH4rYmjMZ9YKGBVoUznZKQX0e3c2GjpJm3Sldzz8HHH2Ud87JqhZPB4+4gyKZ6m98cKQ==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.1.3.tgz",
"integrity": "sha512-xXngyxLQTOx/yUEy50thb8te7Qo4XU6h4LZB6cvEfVd9mnysUxLEoYwGWDdqR+l69liKsy3IPkdYff3J1gAJ5w==",
"requires": {
"lodash": "^4.17.15",
"popper.js": "^1.16.0",
"vue-resize": "^0.4.5"
"@babel/runtime": "^7.13.10",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"vue-resize": "^1.0.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.20.1",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz",
"integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==",
"requires": {
"regenerator-runtime": "^0.13.10"
}
},
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
},
"v8-compile-cache": {
@@ -17327,9 +17343,27 @@
}
},
"vue-resize": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz",
"integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-1.0.1.tgz",
"integrity": "sha512-z5M7lJs0QluJnaoMFTIeGx6dIkYxOwHThlZDeQnWZBizKblb99GSejPnK37ZbNE/rVwDcYcHY+Io+AxdpY952w==",
"requires": {
"@babel/runtime": "^7.13.10"
},
"dependencies": {
"@babel/runtime": {
"version": "7.20.1",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz",
"integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==",
"requires": {
"regenerator-runtime": "^0.13.10"
}
},
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
},
"vue-router": {
"version": "3.3.4",
+1 -1
View File
@@ -46,7 +46,7 @@
"regenerator-runtime": "^0.13.3",
"register-service-worker": "^1.6.2",
"streamsaver": "^2.0.5",
"v-tooltip": "^2.0.2",
"v-tooltip": "^2.1.3",
"vee-validate": "^2.2.13",
"vue": "^2.6.10",
"vue-axios": "^3.2.0",
+4
View File
@@ -33,6 +33,8 @@ import localforage from 'localforage'
import SlideOut from '@hyjiacan/vue-slideout'
import '@hyjiacan/vue-slideout/lib/slideout.css'
import VTooltip from 'v-tooltip'
import '../metrics'
import '../registerServiceWorker'
@@ -108,6 +110,8 @@ Vue.use(SlideOut, {
// set default props here
})
Vue.use(VTooltip)
Vue.prototype.API = api
Vue.prototype.GLOBAL = global_
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="#FFFFFF" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>

After

Width:  |  Height:  |  Size: 477 B

+4
View File
@@ -0,0 +1,4 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.3334 1.83337H9.16671C8.15562 1.83337 7.33337 2.65562 7.33337 3.66671V7.33337H3.66671C2.65562 7.33337 1.83337 8.15562 1.83337 9.16671V18.3334C1.83337 19.3445 2.65562 20.1667 3.66671 20.1667H12.8334C13.8445 20.1667 14.6667 19.3445 14.6667 18.3334V14.6667H18.3334C19.3445 14.6667 20.1667 13.8445 20.1667 12.8334V3.66671C20.1667 2.65562 19.3445 1.83337 18.3334 1.83337ZM3.66671 18.3334V9.16671H12.8334L12.8352 18.3334H3.66671ZM18.3334 12.8334H14.6667V9.16671C14.6667 8.15562 13.8445 7.33337 12.8334 7.33337H9.16671V3.66671H18.3334V12.8334Z" fill="#B8C3CC"/>
<path d="M5.5 11H11V12.8333H5.5V11ZM5.5 14.6667H11V16.5H5.5V14.6667Z" fill="#B8C3CC"/>
</svg>

After

Width:  |  Height:  |  Size: 757 B

+4
View File
@@ -0,0 +1,4 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.3333 2.33325H11.6666C10.3798 2.33325 9.33331 3.37975 9.33331 4.66659V9.33325H4.66665C3.37981 9.33325 2.33331 10.3798 2.33331 11.6666V23.3333C2.33331 24.6201 3.37981 25.6666 4.66665 25.6666H16.3333C17.6201 25.6666 18.6666 24.6201 18.6666 23.3333V18.6666H23.3333C24.6201 18.6666 25.6666 17.6201 25.6666 16.3333V4.66659C25.6666 3.37975 24.6201 2.33325 23.3333 2.33325ZM4.66665 23.3333V11.6666H16.3333L16.3356 23.3333H4.66665ZM23.3333 16.3333H18.6666V11.6666C18.6666 10.3798 17.6201 9.33325 16.3333 9.33325H11.6666V4.66659H23.3333V16.3333Z" fill="white"/>
<path d="M7 14H14V16.3333H7V14ZM7 18.6667H14V21H7V18.6667Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 743 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11 14.3337H13V10.8337H16V8.50041H13V5.00041H11V8.50041H8V10.8337H11V14.3337ZM6 19.0004C5.45 19.0004 4.97933 18.7721 4.588 18.3156C4.196 17.8582 4 17.3087 4 16.6671V2.66707C4 2.02541 4.196 1.47591 4.588 1.01857C4.97933 0.562018 5.45 0.33374 6 0.33374H18C18.55 0.33374 19.021 0.562018 19.413 1.01857C19.8043 1.47591 20 2.02541 20 2.66707V16.6671C20 17.3087 19.8043 17.8582 19.413 18.3156C19.021 18.7721 18.55 19.0004 18 19.0004H6ZM6 16.6671H18V2.66707H6V16.6671ZM2 23.6671C1.45 23.6671 0.979333 23.4388 0.588 22.9822C0.196 22.5249 0 21.9754 0 21.3337V5.00041H2V21.3337H16V23.6671H2Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 710 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.2132 12.6274L6.97054 8.38479L2.7279 12.6274L1.31369 11.2132L5.55633 6.97058L1.31369 2.72794L2.7279 1.31373L6.97054 5.55637L11.2132 1.31373L12.6274 2.72794L8.38475 6.97058L12.6274 11.2132L11.2132 12.6274Z" fill="#B8C3CC" stroke="#B8C3CC" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 379 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="19" height="21" viewBox="0 0 19 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.87524 20.625C3.25649 20.625 2.72699 20.4049 2.28674 19.9646C1.84574 19.5236 1.62524 18.9938 1.62524 18.375V3.75H0.500244V1.5H6.12524V0.375H12.8752V1.5H18.5002V3.75H17.3752V18.375C17.3752 18.9938 17.1551 19.5236 16.7149 19.9646C16.2739 20.4049 15.744 20.625 15.1252 20.625H3.87524ZM15.1252 3.75H3.87524V18.375H15.1252V3.75ZM6.12524 16.125H8.37524V6H6.12524V16.125ZM10.6252 16.125H12.8752V6H10.6252V16.125Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 536 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="14" height="14" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 18C2.45 18 1.97933 17.8043 1.588 17.413C1.196 17.021 1 16.55 1 16V3H0V1H5V0H11V1H16V3H15V16C15 16.55 14.8043 17.021 14.413 17.413C14.021 17.8043 13.55 18 13 18H3ZM13 3H3V16H13V3ZM5 14H7V5H5V14ZM9 14H11V5H9V14Z" fill="#FF6C63"/>
</svg>

After

Width:  |  Height:  |  Size: 343 B

+8
View File
@@ -0,0 +1,8 @@
<svg width="36" height="38" viewBox="0 0 36 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_3_20" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="38">
<rect width="36" height="38" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_3_20)">
<path d="M25.737 18.6561C25.5543 18.849 25.5543 19.151 25.737 19.3439L30.8113 24.7L29.4 26.1897L22.5888 19L29.4 11.8103L30.8113 13.3L25.737 18.6561ZM5 28V25.8333H23.5V28H5ZM5 20.0833V17.9167H19V20.0833H5ZM5 12.1667V10H23.5V12.1667H5Z" fill="#768B9B" stroke="#768B9B" stroke-linejoin="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 592 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="26" height="30" viewBox="0 0 26 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M24.6304 15L1.9413 27.9904V2.00962L24.6304 15Z" fill="white" stroke="white" stroke-width="2.5" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 233 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.75012 18.7498V11.2498H1.25012V8.74976H8.75012V1.24976H11.2501V8.74976H18.7501V11.2498H11.2501V18.7498H8.75012Z" fill="white" stroke="white" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 281 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.25 1.5C2.78587 1.5 2.34075 1.68437 2.01256 2.01256C1.68437 2.34075 1.5 2.78587 1.5 3.25V18.75C1.50001 19.1708 1.65165 19.5775 1.92714 19.8956C2.20263 20.2137 2.58351 20.4219 3 20.482V13.25C3 12.6533 3.23705 12.081 3.65901 11.659C4.08097 11.2371 4.65326 11 5.25 11H16.75C17.3467 11 17.919 11.2371 18.341 11.659C18.7629 12.081 19 12.6533 19 13.25V20.482C19.4165 20.4219 19.7974 20.2137 20.0729 19.8956C20.3483 19.5775 20.5 19.1708 20.5 18.75V5.786C20.5 5.321 20.316 4.876 19.987 4.548L17.452 2.013C17.2895 1.85035 17.0965 1.72133 16.884 1.63331C16.6716 1.54528 16.4439 1.49998 16.214 1.5H16V5.75C16 6.04547 15.9418 6.33805 15.8287 6.61104C15.7157 6.88402 15.5499 7.13206 15.341 7.34099C15.1321 7.54992 14.884 7.71566 14.611 7.82873C14.3381 7.9418 14.0455 8 13.75 8H7.25C6.65326 8 6.08097 7.76295 5.65901 7.34099C5.23705 6.91903 5 6.34674 5 5.75V1.5H3.25ZM6.5 1.5V5.75C6.5 6.164 6.836 6.5 7.25 6.5H13.75C13.9489 6.5 14.1397 6.42098 14.2803 6.28033C14.421 6.13968 14.5 5.94891 14.5 5.75V1.5H6.5ZM17.5 20.5V13.25C17.5 13.0511 17.421 12.8603 17.2803 12.7197C17.1397 12.579 16.9489 12.5 16.75 12.5H5.25C5.05109 12.5 4.86032 12.579 4.71967 12.7197C4.57902 12.8603 4.5 13.0511 4.5 13.25V20.5H17.5ZM0 3.25C0 2.38805 0.34241 1.5614 0.951903 0.951903C1.5614 0.34241 2.38805 0 3.25 0H16.215C17.0769 5.14719e-05 17.9035 0.342495 18.513 0.952L21.048 3.487C21.658 4.097 22 4.924 22 5.786V18.75C22 19.612 21.6576 20.4386 21.0481 21.0481C20.4386 21.6576 19.612 22 18.75 22H3.25C2.38805 22 1.5614 21.6576 0.951903 21.0481C0.34241 20.4386 0 19.612 0 18.75V3.25Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="25" height="22" viewBox="0 0 25 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.7246 13.3226L23.2481 20.2889L22.872 20.6372L15.2354 13.5662L14.627 13.0029L13.9608 13.4964C13.3939 13.9164 12.7313 14.257 11.9636 14.5122C11.2143 14.7612 10.4084 14.8889 9.54002 14.8889C7.37746 14.8889 5.59555 14.2043 4.13159 12.8488C2.66996 11.4954 1.96002 9.88006 1.96002 7.94444C1.96002 6.00883 2.66996 4.39346 4.13159 3.04009C5.59555 1.68457 7.37746 1 9.54002 1C11.7026 1 13.485 1.68458 14.95 3.04027C16.4105 4.39351 17.12 6.00882 17.12 7.94444C17.12 8.7236 16.9867 9.44582 16.7256 10.1191C16.4567 10.8127 16.0964 11.4153 15.6473 11.9351L15.0157 12.6662L15.7246 13.3226ZM14.4273 12.5749L14.4279 12.5744C15.7797 11.3218 16.48 9.76006 16.48 7.94444C16.48 6.12883 15.7797 4.56711 14.4279 3.3145L14.4273 3.31398C13.0775 2.06509 11.4285 1.44444 9.54002 1.44444C7.65159 1.44444 6.00256 2.06509 4.65273 3.31398L4.65217 3.3145C3.30039 4.56711 2.60002 6.12883 2.60002 7.94444C2.60002 9.76006 3.30039 11.3218 4.65217 12.5744L4.65273 12.5749C6.00256 13.8238 7.65158 14.4444 9.54002 14.4444C11.4285 14.4444 13.0775 13.8238 14.4273 12.5749Z" fill="#2C4053" stroke="#B8C3CC" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect rx="5" ry="5" width="25" height="25" style="fill: white;"/>
</svg>

After

Width:  |  Height:  |  Size: 172 B

@@ -25,12 +25,12 @@
>
<!-- *** icon -->
<!-- <va-icon-vuestic /> -->
<img src='@/assets/img/bps_logo.png'>
<!-- <img src='@/assets/img/bps_logo.png'> -->
</router-link>
</div>
<!-- <img style="height: 40px;" v-bind:src="'https://www.bioproweb.com/wp-content/uploads/2020/01/BPS-LOGO_60.png'"> -->
<div class="app-navbar__center lg5 md4">
<span
<!-- <span
class="app-navbar__text"
:style="{color: this.$themes.gray}"
>
@@ -43,7 +43,7 @@
>
contact@bioproweb.com
</a>
</span>
</span> -->
</div>
<app-navbar-actions
class="app-navbar__actions md5 lg4"
+24 -16
View File
@@ -33,6 +33,7 @@
editFile()
showModal.editFile = false
}"
:noOutsideDismiss="true"
tabindex="0"
>
<va-input
@@ -179,7 +180,7 @@
{{ props.rowData.name }}
</template>
<template slot="parameter_set" slot-scope="props">
{{ getWorkingMode(props.rowData) }}
{{ getWorkingMode(props.rowData.device, props.rowData.parameter_set) }}
</template>
<template slot="created_at" slot-scope="props">
{{transDate(props.rowData.created_at)}}
@@ -590,6 +591,7 @@ export default {
},
fillDeleteInfo: function (info) {
if (info.type === 'folder') {
this.deleteInfo.metaID = undefined
this.deleteInfo.folderID = info.id
this.deleteInfo.name = info.name
} else {
@@ -627,10 +629,13 @@ export default {
deleteFileDone: async function () {
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
// rebuild table
this.fileLists = this.fileLists.filter(file => file.name !== this.deleteInfo.name)
await this.refreshPage()
this.$refs.datatable_ref.currentPage = tmpCurrentPage
this.$refs.datatable_ref.inputPage(tmpCurrentPage)
this.fileLists = this.fileLists.filter(file => {
return file.id !== this.deleteInfo.metaID
})
// await this.refreshPage()
await this.$refs.datatable_ref.inputPage(1)
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
// this.$refs.datatable_ref.inputPage(tmpCurrentPage)
// this.loadingFiles = false
this.showToast(`deleted ${this.deleteInfo.name}`, {
position: 'bottom-right',
@@ -674,7 +679,7 @@ export default {
// call getfolder api and update
const folders = await api.collection.getByParent('folder', this.currentInfo.id)
const files = await api.meta.getAttrByParent('folder', this.currentInfo.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', this.currentInfo.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -701,8 +706,7 @@ export default {
}
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
await this.refreshPage()
this.$refs.datatable_ref.currentPage = tmpCurrentPage
this.$refs.datatable_ref.inputPage(tmpCurrentPage)
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
},
downloadCsv: async function (meta) {
const href = location.href.split('/')[2]
@@ -752,16 +756,17 @@ export default {
}
},
replay: function (meta) {
const href = location.href.split('/')[2]
if (meta.device.library_name.includes('Neulive') === true) {
// window.open('http://' + location.href.split('/')[2].split(':')[0] + '/#/admin/data-replay/' + meta.id)
this.$router.push({
path: '/admin/data-replay/' + meta.id,
})
} else if (meta.device.library_name.includes('Elite') === true) {
// window.open('http://' + location.href.split('/')[2].split(':')[0] + '/#/admin/data-replay/elite/' + meta.id)
this.$router.push({
path: '/admin/data-replay/elite/' + meta.id,
})
window.open('http://' + href + '/#/admin/data-replay/elite/' + meta.id)
// this.$router.push({
// path: '/admin/data-replay/elite/' + meta.id,
// })
}
},
spike: function (meta) {
@@ -771,11 +776,14 @@ export default {
})
}
},
getWorkingMode: function (rowData) {
getWorkingMode: function (device, parameterSet) {
try {
if (rowData.type === 'folder') return ''
return configTable.getModeConfig(rowData.device.library_name, rowData.parameter_set.MODE).name
} catch {
if (parameterSet) {
return configTable.getModeConfig(device.library_name, parameterSet.MODE).name
}
return ''
} catch (e) {
console.log('e', e)
return ''
}
},
+48 -28
View File
@@ -8,22 +8,14 @@
? cardStyle.medium
: cardStyle.large
">
<!-- :class="(taskViewPanel.show || projectManagerPanel.show)
? (taskViewPanel.show && projectManagerPanel.show)
? cardStyle.small
: cardStyle.medium
: cardStyle.large
"> -->
<project-view @start_project="startProject($event)" @stop_project="stopProject($event)" @save_project="saveProject($event)"/>
<project-view @start_project="startProject($event)" @stop_project="stopProject($event)" @save_project="saveProject($event)" @detect="detect"/>
</div>
<!-- <div :class="cardStyle.small" v-show="taskViewPanel.show">
<project-task/>
</div> -->
<slide-out
dock="right"
:mask-color="'rgba(0, 0, 0, 0)'"
:visible.sync="taskViewPanel.show"
:title="(taskViewPanel.type === 1) ? 'Device' : (taskViewPanel.type === 3) ? 'Condition' : (taskViewPanel.type === 4) ? 'Parameter' : ''"
@closed="onClosing"
resizable
>
<project-task/>
@@ -35,7 +27,7 @@
import ProjectManager from '@/components/project/manager/ProjectManager'
import ProjectView from '@/components/project/view/ProjectView'
import ProjectTask from '@/components/project/task/ProjectTask'
import { mapActions } from 'vuex'
import { mapActions, mapGetters } from 'vuex'
import { mapFields } from 'vuex-map-fields'
import types from '@/store/modules/project/types'
import { taskInfo } from '@/data/task/TaskInfo'
@@ -48,6 +40,9 @@ export default {
ProjectTask,
},
computed: {
...mapGetters('project', [
types.project.getSelect,
]),
...mapFields('project', [
'projectConfigList',
'runningProjectList',
@@ -60,8 +55,8 @@ export default {
return {
controllerList: [],
cardStyle: {
small: 'flex xl4 md4 sm12 xs12',
medium: 'flex xl8 md8 sm12 xs12',
small: 'flex xl3 md3 sm12 xs12',
medium: 'flex xl9 md9 sm12 xs12',
large: 'flex xl12 md12 sm12 xs12',
},
}
@@ -87,7 +82,7 @@ export default {
},
async '+/get_running_project/+' (data, topic) {
this.runningProjectList.length = 0
const runningProjects = JSON.parse(String.fromCharCode.apply(null, data)).data
const runningProjects = JSON.parse(new TextDecoder().decode(data)).data
this.runningProjectList.push(...runningProjects)
},
async '+/broadcast' (data, topic) {
@@ -106,6 +101,9 @@ export default {
},
},
methods: {
onClosing: async function () {
await this.saveProject(this.getSelectProject)
},
pageToast: function (mes) {
this.showToast(
mes,
@@ -138,16 +136,28 @@ export default {
this.mqttUnSub(id + '/get_running_project/+')
},
initPage: async function () {
await this.initProject()
await taskInfo.updateTaskInfo()
this.pageMqttSub(taskInfo.getTaskInfo().controllerID)
},
startProject: function (project) {
console.log('start_project', project)
console.log('taskInfo.getTaskInfo().controllerID', taskInfo.getTaskInfo().controllerID)
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'run_project/0',
project: project,
}))
let deviceReady = true
for (const device of Object.values(this.getSelectProject.device)) {
if (device.pairStatus !== 1) {
if (device.pair === null) {
window.alert('Device ' + device.name + ' is not connected yet.')
} else {
window.alert('Device ' + device.pair + ' is not connected yet.')
}
deviceReady = false
}
}
if (deviceReady === true) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'run_project/0',
project: project,
}))
}
},
stopProject: function (project) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
@@ -157,18 +167,25 @@ export default {
},
saveProject: async function (project) {
this.updateProject({ project: project, api: this.API })
this.showToast(
'project update finish',
{
icon: 'fa-bell',
position: 'bottom-right',
duration: 5000,
},
)
},
detect: async function (device) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_instruction/0',
device: device,
instruction: 'VIS_DEVICE_DETECT',
}))
setTimeout(() => {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_instruction/0',
device: device,
instruction: 'VIS_DEVICE_DONE',
}))
}, 5000)
},
...mapActions('project',
[
types.project.init,
types.project.update,
types.project.addDevice,
],
@@ -192,6 +209,9 @@ export default {
header: 'get_running_project/0',
}))
},
destroyed () {
this.projectManagerPanel.show = true
},
}
</script>
@@ -4,34 +4,25 @@
<template slot="header">
<div class="row">
<div class="flex d-flex xs5 sm5 lg5 xl5">
<va-icon name="fa fa-bluetooth-b" color="primary"/>
<h5 class="mb-0">PROJECTS</h5>
<p class="project-view-header">PROJECTS</p>
</div>
<div class="flex xs7 sm7 lg7 xl7" style="text-align: right;">
<!-- <va-button v-if="projectConfigList.length !== 0" class="ma-0 circle-button" @click="closePanel"> -->
<va-icon v-if="projectConfigList.length !== 0" @click.native="closePanel"
name="fa fa-times"
color="black"
/>
<!-- </va-button> -->
<img class="img-vertical-center" src="@/assets/img/project/menu_close.svg" @click="closePanel">
</div>
</div>
<!-- <div class="flex d-flex xl5 lg5 sm5 xs5 ma-0">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 class="mb-0">PROJECTS</h5>
</div>
<div class="flex d-flex xl7 lg7 sm7 xs7 ma-0" style="text-align: right;">
<va-button v-if="projectConfigList.length !== 0" class="pa-0 ma-0 circle-button" small color="dark" @click="closePanel">
<va-icon
name="fa fa-times"
color="white"
/>
</va-button>
</div> -->
</template>
<div class="flex d-flex m12 xs12 md12 xl12">
<div>
<va-button @click="createProject({ api: API })" icon="fa fa-plus"></va-button>
<div class="input-icons input-style flex sm12 xs12 md7 xl7 pa-0">
<img class="icon" src="@/assets/img/project/search.svg">
<input class="input-field" type="text" v-model="filterText">
</div>
<div class="ml-1 pa-0" style="text-align: right;">
<button class="project-copy-btn" @click="copyProject({ project: getSelectProject, index: index, api: API })">
<img class="img-vertical-center" src="@/assets/img/project/copy-alt.svg">
</button>
<button class="project-copy-btn ml-1" @click="createProject({ api: API })">
<img class="img-vertical-center" src="@/assets/img/project/plus.svg">
</button>
</div>
</div>
<div>
@@ -42,15 +33,15 @@
</va-tabs>
</div>
<div class="mt-1">
<project-manager-list v-if='tabValue == 0'/>
<running-project-manager-list v-if='tabValue == 1'/>
<project-manager-list v-if='tabValue == 0' :filterText="filterText"/>
<running-project-manager-list v-if='tabValue == 1' :filterText="filterText"/>
</div>
</va-card>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { mapActions, mapGetters } from 'vuex'
import { mapFields } from 'vuex-map-fields'
import types from '@/store/modules/project/types'
import ProjectManagerList from '@/components/project/manager/ProjectManagerList'
@@ -63,6 +54,10 @@ export default {
RunningProjectManagerList,
},
computed: {
...mapGetters('project', [
'getSelectProject',
]),
...mapFields('project', [
'lockMode',
'projectList',
@@ -75,6 +70,7 @@ export default {
return {
tabValue: 0,
tabTitles: ['CONFIG', 'RUNNING'],
filterText: '',
}
},
methods: {
@@ -86,6 +82,9 @@ export default {
...mapActions('project',
[
types.project.create,
types.project.copy,
types.project.select,
types.project.delete,
],
),
closePanel: function () {
@@ -100,4 +99,39 @@ export default {
<style>
.input-icons img {
position: absolute;
}
.input-icons {
width: 67%;
/* margin-bottom: 10px; */
}
.icon {
color: grey;
min-width: 40px;
padding: 10px;
}
.input-field {
width: 100%;
padding: 9px;
text-align: right;
background: #f1f1f1;
border: none;
border-radius: 6px 6px 0 0;
border-bottom: 1.5px solid #758b9a;
}
.project-copy-btn {
width: 50px;
height: 38px;
background: #858dd6;
border: none;
border-radius: 5px;
cursor: pointer;
}
</style>
@@ -1,12 +1,13 @@
<template>
<div class="row">
<div class="flex xs12 lg12 md12">
<va-item class="mb-1" v-for="(project, index) in projectConfigList" :key="index" @click="selectProject({index: index})" clickable>
<va-item :class="(selectProjectIndex === index) ? 'project-list-text project-list-focus': 'project-list-text project-list'" v-for="(project, index) in configList" :key="index" @click="select(index)">
<va-item-section @dblclick.native="switchEdit('name', index)">
<div v-if="projectTable.name == index">
<va-input
:ref="'input_ref'"
v-model="project.name"
style="width: 100px;"
style="min-width: 100px;"
@blur="switchEdit('name', -1, project)"
@keyup.enter="switchEdit('name', -1, project)"
/>
@@ -14,12 +15,11 @@
<div v-else>
{{ project.name }}
</div>
<!-- <va-item-label>
{{ project.name }}
</va-item-label> -->
</va-item-section>
<va-item-section side>
<va-icon class="fa fa-close" color="danger" @click.native.stop="deleteProject({ project: project, index: index, api: API })"></va-icon>
<img class="mr-2" src="@/assets/img/project/copy-alt-grey.svg" @click="copyProject({ project: project, index: index, api: API })">
<img v-if="selectDeleteIndex !== index" class="mr-2" src="@/assets/img/project/cross.svg" @click.stop="confirmDelete($event, index)">
<img v-else class="mr-2" src="@/assets/img/project/delete14_14.svg" @click.stop="_deleteProject(project, index)">
</va-item-section>
</va-item>
</div>
@@ -32,9 +32,28 @@ import types from '@/store/modules/project/types'
export default {
name: 'project-manager-list',
props: {
filterText: {
type: String,
default: '',
},
},
computed: {
configList () {
const projectList = this.projectConfigList
projectList.sort((a, b) => {
const date1 = new Date(a.created_at).getTime()
const date2 = new Date(b.created_at).getTime()
return date2 - date1
})
if (this.filterText === '') return projectList
return projectList.filter(ele => ele.name.includes(this.filterText))
},
...mapFields('project', [
'projectConfigList',
'projectSelectIndex',
'projectTableSelectIndex',
]),
},
data () {
@@ -42,19 +61,53 @@ export default {
projectTable: {
name: -1,
},
selectProjectIndex: -1,
selectDeleteIndex: -1,
}
},
methods: {
reset: function () {
this.selectProjectIndex = -1
this.selectDeleteIndex = -1
},
resetDelete: function (e) {
if (e.target.classList.contains('clicked')) {
e.target.classList.remove('clicked')
return
}
this.selectDeleteIndex = -1
},
confirmDelete: function (e, index) {
e.target.classList.add('clicked')
this.selectProjectIndex = index
this.selectDeleteIndex = index
window.addEventListener('mousedown', this.resetDelete, { once: true })
},
_deleteProject: async function (project, index) {
this.reset()
await this.deleteProject({ project: project, index: index, api: this.API })
},
select: function (index) {
this.selectProjectIndex = index
this.selectDeleteIndex = -1
this.projectTableSelectIndex = -1
this.selectProject({ index: index })
},
switchEdit: function (tag, index, project) {
if (this.projectTable[tag] >= 0) {
this.projectTable[tag] = -1
project && this.API.project.update(project.id, { name: project.name })
} else {
this.projectTable[tag] = index
this.$nextTick(() => {
this.$refs.input_ref[0].$refs.input.focus()
})
}
},
...mapActions('project',
[
types.project.copy,
types.project.select,
types.project.delete,
],
@@ -64,3 +117,32 @@ export default {
},
}
</script>
<style lang="scss">
.project-list-text {
// font
font-family: 'Inter-Regular';
font-style: italic;
font-weight: 400;
font-size: 16px;
line-height: 24px;
color: #768b9b;
}
.project-list-focus {
/* Rectangle 5 */
background: #ebedff;
border: 1px solid #dbdcf0;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
.project-list-focus:hover {
opacity: 0.8;
background: #ebedff;
}
.project-list:hover {
opacity: 0.8;
}
</style>
@@ -1,8 +1,9 @@
<template>
<div>
<project-task-config-device v-if="taskViewPanel.type===1"></project-task-config-device>
<project-task-config-condition v-if="taskViewPanel.type===3"></project-task-config-condition>
<project-task-config-parameter v-if="taskViewPanel.type===4"></project-task-config-parameter>
<project-task-config-condition v-if="taskViewPanel.type===2" :actionType="'start'"></project-task-config-condition>
<project-task-config-condition v-if="taskViewPanel.type===3" :actionType="'stop'"></project-task-config-condition>
<project-task-config-parameter v-show="taskViewPanel.type===4"></project-task-config-parameter>
</div>
</template>
<script>
@@ -1,63 +1,18 @@
<template>
<div class="flex sm12 xl12 md12 xs12">
<!-- <div class="task-config__header-separator mb-1">
<div class="task-config__header-text">
<span>Action &#38; Condition</span>
<va-button class="circle-button" small color="dark" @click="closePanel">
<va-icon
name="fa fa-times"
color="white"
/>
</va-button>
</div>
</div> -->
<span>Device</span>
<div class="flex d-flex" v-if="Object.keys(registeredDevice).length > 0">
<div v-for="(device, deviceKey) in registeredDevice" :key="deviceKey">
<va-button @click="selectDevice(deviceKey)" small>{{ device.name }}</va-button>
<!-- <span>Condition</span> -->
<div v-for="(condition, key) in conditionObj" :key="key">
<!-- <div v-if="key === 'cycle' || key === 'cycle_next'" class="flex d-flex align--center"> -->
<div class="flex d-flex align--center">
<va-checkbox v-model="condition.select"></va-checkbox>
<span class="mr-1">{{ condition.prefix }}</span>
<input style="width: 100px;" class="mr-1" :type="condition.type" v-model="condition.value"/>
<span>{{ condition.suffix }}</span>
</div>
</div>
<div align="center" v-else>
No registered device found.
</div>
<div v-if="settingStep >= 1">
<span>Action</span>
<div class="flex d-flex">
<div v-for="action in actionTemplate" :key="action">
<va-button color="info" @click="selectAction(action)" small>{{ action }}</va-button>
</div>
</div>
</div>
<div v-if="settingStep >= 2">
<span>Condition</span>
<div v-for="(condition, key) in conditionObj" :key="key">
<!-- <div v-if="key === 'cycle' || key === 'cycle_next'" class="flex d-flex align--center"> -->
<div v-if="key === 'cycle_next'" class="flex d-flex align--center">
<!-- <va-checkbox v-model="condition.select"></va-checkbox> -->
<span class="mr-1">{{ condition.prefix }}</span>
<!-- <input class="mr-1" :type="condition.type" v-model="condition.value"/> -->
<va-select
@click.native="updateTaskOptions()"
:label="''"
v-model="conditionObj.cycle_next.value"
textBy="description"
class="va-select-without-margin"
:options="taskOptionsKeys"
:noClear='false'
/>
<span>{{ condition.suffix }}</span>
</div>
<div v-else class="flex d-flex align--center">
<va-checkbox v-model="condition.select"></va-checkbox>
<span class="mr-1">{{ condition.prefix }}</span>
<input class="mr-1" :type="condition.type" v-model="condition.value"/>
<span>{{ condition.suffix }}</span>
</div>
</div>
<div align="right">
<va-button color="warning" @click="reset" small>Reset</va-button>
<va-button color="success" @click="save" small>Save</va-button>
</div>
<div align="right">
<va-button color="warning" @click="reset" small>Reset</va-button>
<va-button color="success" @click="save" small>Save</va-button>
</div>
</div>
</template>
@@ -72,9 +27,15 @@ export default {
name: 'project-task-config-condition',
components: {
},
props: {
actionType: {
type: String,
required: true,
},
},
computed: {
conditionObj () {
return this.conditionTemplate[this.actionSelect]
return this.conditionTemplate[this.actionType]
},
deviceSelectName () {
@@ -89,16 +50,18 @@ export default {
types.project.getSelect,
types.project.getDevice,
types.project.getAllDevice,
types.project.getDeviceShowName,
]),
...mapFields('project', [
'taskSelectKey',
'taskViewPanel',
'deviceSelectKey',
]),
},
data () {
return {
settingStep: 0,
settingStep: 1,
registeredDevice: {},
deviceSelect: '',
@@ -114,7 +77,6 @@ export default {
project: {},
device: {},
task: {},
}
},
methods: {
@@ -152,12 +114,8 @@ export default {
}
},
save: function () {
// create fake start previous done
const fakeStartActionUUID = this.GLOBAL.getUUID()
const fakeAction = this.createAction(fakeStartActionUUID, 'start', this.deviceSelect)
const actionUUID = this.GLOBAL.getUUID()
const newAction = this.createAction(actionUUID, this.actionSelect, this.deviceSelect)
const newAction = this.createAction(actionUUID, this.actionType, this.deviceSelect)
// if device not add in task then add in
if (!this.getSelectTask.device.includes(this.deviceSelect)) {
@@ -165,42 +123,15 @@ export default {
}
for (const key in this.conditionObj) {
if (key === 'cycle') {
// use 'cycle' and 'cycle_next' to set the default to condition: previous_task_done & after_task_run 0
if (this.conditionObj[key].select) {
const conditionUUID = this.GLOBAL.getUUID()
const newCondition = this.createCondition(conditionUUID, 'previous_task_done', 'equal', '')
this.setConditionTask({ condition: newCondition })
newAction[actionUUID].condition.push(conditionUUID)
}
} else if (key === 'cycle_next') {
if (this.conditionObj.cycle.select) {
const conditionUUID = this.GLOBAL.getUUID()
const newCondition = this.createCondition(conditionUUID, 'after_task_run', 'equal', '0')
this.setConditionTask({ condition: newCondition })
newAction[actionUUID].condition.push(conditionUUID)
}
} else {
if (this.conditionObj[key].select) {
// create fake condition
const fakeConditionUUID = this.GLOBAL.getUUID()
const fakeCondition = this.createCondition(fakeConditionUUID, 'previous_task_done', 'equal', '')
this.setConditionTask({ condition: fakeCondition })
fakeAction[fakeStartActionUUID].condition.push(fakeConditionUUID)
if (this.conditionObj[key].select) {
const conditionUUID = this.GLOBAL.getUUID()
const newCondition = this.createCondition(conditionUUID, key, 'equal', this.conditionObj[key].value)
const conditionUUID = this.GLOBAL.getUUID()
const newCondition = this.createCondition(conditionUUID, key, 'equal', this.conditionObj[key].value)
this.setConditionTask({ condition: newCondition })
newAction[actionUUID].condition.push(conditionUUID)
}
this.setConditionTask({ condition: newCondition })
newAction[actionUUID].condition.push(conditionUUID)
}
}
this.setActionTask({ action: newAction })
this.setActionTask({ action: fakeAction })
if (this.conditionObj.cycle_next !== undefined) {
this.setCycleTask({ cycle: Number(this.conditionObj.cycle.value), cycle_next: this.conditionObj.cycle_next.value, cycle_next_uuid: this.taskOptions[this.conditionObj.cycle_next.value] })
}
this.reset()
},
updateTaskOptions: function () {
@@ -217,21 +148,23 @@ export default {
]),
},
mounted () {
// const project = this.getSelectProject
// const device = this.getAllDeviceProject
// const task = this.getSelectTask
this.project = this.getSelectProject
this.device = this.getAllDeviceProject
this.deviceSelect = this.deviceSelectKey
this.task = this.getSelectTask
for (var idx = 0; idx < this.project.task.length; idx++) {
this.taskOptions[this.project.task[idx].name] = this.project.task[idx].uuid
}
this.taskOptionsKeys = Object.keys(this.taskOptions)
// console.log('project', this.project)
// console.log('task', this.task)
this.registeredDevice = this.device
},
watch: {
// refresh parameter when click different task's parameter
deviceSelectKey: {
handler: function () {
this.deviceSelect = this.deviceSelectKey
},
},
},
}
</script>
@@ -1,54 +1,54 @@
<template>
<div class="flex sm12 xl12 md12 xs12">
<!-- <div class="task-config__header-separator mb-1">
<div class="task-config__header-text">
<span> Device </span>
<va-button class="circle-button" small color="dark" @click="closePanel">
<va-icon
name="fa fa-times"
color="white"
/>
</va-button>
</div>
</div> -->
<div>
<va-list fit class="mb-2">
<va-item v-for="(device, index) in getSelectProject.device" :key="index" >
<va-item-section side>
<va-checkbox
:value="device.isSelect"
:arrayValue="(taskSelectKey != undefined)? String(taskSelectKey) : '-1'"
@input="selectDevice($event, device, index)"
ref="checkbox_ref"
/>
</va-item-section>
<va-list fit class="mb-2 pb-0">
<va-list-label>
Register
</va-list-label>
<va-item-section avatar class="ml-0">
<va-avatar style="border-radius: 0;">
<img
src='@/assets/img/elite_img.png' :alt="device.name">
</va-avatar>
</va-item-section>
<template v-for="(device, index) in deviceListInOrder">
<va-item :class="taskDevice.includes(device[0]) === true ? 'device-list-focus': ''" :key="'register' + String(index)" @click="selectDevice(device, index)" clickable>
<va-item-section avatar>
<va-avatar style="border-radius: 0;">
<img src='@/assets/img/elite_img.png' :alt="device[1].name">
</va-avatar>
</va-item-section>
<va-item-section>
<va-item-label>
{{ device.name }}
</va-item-label>
<va-item-section>
<va-item-label>
{{ getDeviceShowNameProject(device[0]) }}
</va-item-label>
</va-item-section>
</va-item>
</template>
</va-list>
<va-list fit class="mb-2 pb-0">
<va-list-label>
Connect
</va-list-label>
<va-item-label caption>
{{ device.connectDevice.device_address }}
</va-item-label>
</va-item-section>
</va-item>
<template v-for="(device, index) in getNotRegisterDeviceProject()">
<va-item :key="'connect' + index" clickable @click="registerConnectDevice(device)">
<va-item-section avatar>
<va-avatar style="border-radius: 0;">
<img src='@/assets/img/elite_img.png' :alt="device.macAddress">
</va-avatar>
</va-item-section>
<va-item-section>
<va-item-label>
{{ device.macAddress }}
</va-item-label>
</va-item-section>
</va-item>
</template>
</va-list>
</div>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { mapGetters } from 'vuex'
// import eliteImgUrl from '@/assets/img/elite_img.png'
// import neuliveImgUrl from '@/assets/img/neulive_img.png'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
export default {
@@ -56,9 +56,21 @@ export default {
components: {
},
computed: {
deviceListInOrder () {
return Object.entries(this.getSelectProject.device).sort((a, b) => a[1].order - b[1].order)
},
taskDevice () {
if (this.getSelectTask.device) {
return this.getSelectTask.device
}
return null
},
...mapGetters('project', [
types.project.getSelect,
types.task.getSelect,
types.project.getDeviceShowName,
types.project.getNotRegisterDevice,
]),
...mapFields('project', [
@@ -71,38 +83,70 @@ export default {
}
},
methods: {
selectDevice: function (event, device, key) {
// if select single task
if (this.taskSelectKey !== undefined) {
device.isSelect = event
// console.log('device.isSelect: ', device.isSelect)
device.isSelect.includes(String(this.taskSelectKey)) === true
? this.getSelectTask.device.push(key)
: this.getSelectTask.device = this.getSelectTask.device.filter(item => item !== key)
selectDevice: function (device, index) {
if (this.taskDevice.includes(device[0]) === false) {
this.appendToTask(device[0])
} else {
// if select all tasks
if (event.includes('-1')) {
// check all
device.isSelect = ['-1', ...Array(this.getSelectProject.task.length).fill().map((_, index) => String(index))]
for (const task of this.getSelectProject.task) {
if (!task.device.includes(key)) {
task.device.push(key)
}
}
} else {
// uncheck all
device.isSelect = []
for (const task of this.getSelectProject.task) {
task.device = task.device.filter(item => item !== key)
}
}
this.removeFromTask(device[0])
}
},
resetDevice: function () {
},
registerConnectDevice: async function (device) {
// register device
await this.createDeviceProject({
name: device.name,
library: device.library,
pair: device.macAddress,
pairStatus: 1,
order: this.getDeviceMaxOrderProject,
})
// select device
this.selectDevice(this.deviceListInOrder[this.deviceListInOrder.length - 1])
},
appendToTask: function (key) {
// if select single task
this.getSelectTask.device.push(key)
// create start action-condtion-pair when choose device
this.createActionConditionPairTask({
device: key,
task: this.getSelectTask,
action: 'start',
condition: {
type: 'previous_task_done',
comparsion: 'equal',
value: '',
},
})
},
removeFromTask: function (key) {
// if select single task
// this.getSelectTask.device = this.getSelectTask.device.filter(item => item !== key)
// remove device & relation action, condition, parameter
this.deleteDeviceTask({ deviceKey: key, onlySelectTask: true })
},
closePanel: function () {
this.taskViewPanel.show = !(this.taskViewPanel.show)
},
...mapActions('project',
[
types.project.createDevice,
types.task.deleteDevice,
types.task.createActionConditionPair,
],
),
},
mounted () {
},
}
</script>
<style lang="scss">
.device-list-focus {
background: #ebedff;
border: 1px solid #dbdcf0;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
</style>
@@ -1,22 +1,12 @@
<template>
<div class="flex sm12 xl12 md12 xs12">
<!-- <div class="task-config__header-separator mb-1">
<div class="task-config__header-text">
<span >Parameter Set</span>
<va-button class="circle-button" small color="dark" @click="closePanel">
<va-icon
name="fa fa-times"
color="white"
/>
</va-button>
</div>
</div> -->
<div>
<device-parameter-recording
:ref="'device_parameter_ref'"
:parameter="parameter"
:library="'Elite_EDC_1.5'"
:library="library"
:place="'scheduler'"
:resetParameterModeChange="true"
@setParameter="setParameter"
@setParameterWithDebounce="setParameterWithDebounce"
/>
@@ -38,6 +28,11 @@ export default {
DeviceParameterRecording,
},
computed: {
library () {
if (this.device === null || this.device === undefined) return null
return this.device.library
},
...mapGetters('project', [
types.task.getSelect,
types.task.getParameterSet,
@@ -48,6 +43,7 @@ export default {
'taskViewPanel',
'taskSelectKey',
'deviceSelectKey',
'projectSelectIndex',
]),
},
data () {
@@ -71,7 +67,8 @@ export default {
condition.select = !condition.select
},
setParameter: function (name, value) {
this.parameter = Object.assign({}, this.parameter)
// this.parameter = Object.assign({}, this.parameter)
this.parameter[name] = value
if (this.parameterUUID === '') {
this.parameterUUID = this.GLOBAL.getUUID()
@@ -90,6 +87,7 @@ export default {
resetParameter: function (mode) {
// get Device
this.device = this.getDeviceProject(this.deviceSelectKey)
if (this.device === undefined) return
// get Config
if (typeof this.device.library === 'string') { // string
this.config = configTable.getConfig(this.device.library)
@@ -109,10 +107,11 @@ export default {
this.parameterUUID = Object.keys(parameterSet)[0]
const param = Object.values(parameterSet)[0]
const modeOption = this.$refs.device_parameter_ref.workingModeOptions.find(ele => ele.id === param.MODE)
this.$refs.device_parameter_ref.workingModeSelectChange(modeOption)
this.$refs.device_parameter_ref.workingModeSelectChange(modeOption, false)
this.parameter = Object.assign(this.parameter, Object.values(parameterSet)[0])
} else {
this.setParameter('MODE', 0)
const defaultMode = this.config.MODE_OPTIONS.find(ele => ele.description === 'Idle')
this.setParameter('MODE', defaultMode.id)
}
},
...mapActions('project',
@@ -122,13 +121,12 @@ export default {
),
},
mounted () {
// init parameter
this.resetParameter()
},
watch: {
// refresh parameter when click different task's parameter
taskSelectKey: {
handler: function () {
this.device = null
this.parameter = {}
this.parameterUUID = ''
this.resetParameter()
@@ -136,6 +134,15 @@ export default {
},
deviceSelectKey: {
handler: function () {
this.device = null
this.parameter = {}
this.parameterUUID = ''
this.resetParameter()
},
},
projectSelectIndex: {
handler: function () {
this.device = null
this.parameter = {}
this.parameterUUID = ''
this.resetParameter()
@@ -12,14 +12,14 @@
</div>
<!-- EIS -->
<div v-if="workingModeSelect != null && workingModeSelect.id == 0">
<d-c-volt :ref="'DCVolt'" :deviceID="deviceID" :parameterName="'DC_BIAS'" @parameterChange="deviceParameterChange($event)" />
<a-c-amplitude :ref="'ACAmplitude'" :deviceID="deviceID" :parameterName="'AC_AMP'" @parameterChange="deviceParameterChange($event)" />
<freq-range :ref="'FreqRange'" :deviceID="deviceID" :parameterName="'FREQ'" @parameterChange="deviceParameterChange($event)" />
<points-per-decades :ref="'PointsPerDecades'" :deviceID="deviceID" :parameterName="'PPD'" @parameterChange="deviceParameterChange($event)" />
<point-spacing :ref="'PointSpacing'" :deviceID="deviceID" :parameterName="'SCALE'" @parameterChange="deviceParameterChange($event)" />
<delay :ref="'Delay'" :deviceID="deviceID" :parameterName="'DELAY'" @parameterChange="deviceParameterChange($event)" />
<average :ref="'Average'" :deviceID="deviceID" :parameterName="'AVERAGE_NUM'" @parameterChange="deviceParameterChange($event)" />
<current-range :ref="'CurrentRange'" :deviceID="deviceID" :parameterName="'RTIA'" @parameterChange="deviceParameterChange($event)" />
<d-c-volt :ref="'DCVolt'" :deviceID="deviceID" :parameterName="'EIS_DC_BIAS'" @parameterChange="deviceParameterChange($event)" />
<a-c-amplitude :ref="'ACAmplitude'" :deviceID="deviceID" :parameterName="'EIS_AC_AMP'" @parameterChange="deviceParameterChange($event)" />
<freq-range :ref="'FreqRange'" :deviceID="deviceID" :parameterName="'EIS_FREQ'" @parameterChange="deviceParameterChange($event)" />
<points-per-decades :ref="'PointsPerDecades'" :deviceID="deviceID" :parameterName="'EIS_PPD'" @parameterChange="deviceParameterChange($event)" />
<point-spacing :ref="'PointSpacing'" :deviceID="deviceID" :parameterName="'EIS_SCALE'" @parameterChange="deviceParameterChange($event)" />
<delay :ref="'Delay'" :deviceID="deviceID" :parameterName="'EIS_DELAY'" @parameterChange="deviceParameterChange($event)" />
<average :ref="'Average'" :deviceID="deviceID" :parameterName="'EIS_AVERAGE_NUM'" @parameterChange="deviceParameterChange($event)" />
<current-range :ref="'CurrentRange'" :deviceID="deviceID" :parameterName="'GENERAL_HS_RTIA'" @parameterChange="deviceParameterChange($event)" />
</div>
<!-- CV -->
<div v-if="workingModeSelect != null && workingModeSelect.id == 1">
@@ -45,14 +45,6 @@
<level-button :ref="'currentRangeSelect'" :deviceID="deviceID" :options="currentRangeOptions" :parameterName="'ADC_LEVEL_I_15'" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
<p class="display-6">Voltage Range<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<level-button :ref="'voltageInRangeSelect'" :deviceID="deviceID" :options="voltageInRangeOptions" :parameterName="'ADC_LEVEL_V_IN_15'" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
<p class="display-6">High Z<p/>
@@ -66,7 +58,7 @@
<p class="display-6">E Initial<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltInitialNumber'" :deviceID="deviceID" :parameterName="'VOLT_INITIAL'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltInitialNumber'" :deviceID="deviceID" :parameterName="'CV_E_INITIAL'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -74,7 +66,7 @@
<p class="display-6">E1<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltMaxNumber'" :deviceID="deviceID" :parameterName="'VOLT_MAX'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltMaxNumber'" :deviceID="deviceID" :parameterName="'CV_E1'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -82,7 +74,7 @@
<p class="display-6">E2<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltMinNumber'" :deviceID="deviceID" :parameterName="'VOLT_MIN'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltMinNumber'" :deviceID="deviceID" :parameterName="'CV_E2'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -90,7 +82,7 @@
<p class="display-6">Voltage Scan Rate<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<scan-rate-range :ref="'voltScanRateNumber'" :deviceID="deviceID" :parameterName="'Scan_Rate'" :minValue="0.01" :maxValue="1000" @parameterChange="deviceParameterChange($event)" />
<scan-rate-range :ref="'voltScanRateNumber'" :deviceID="deviceID" :parameterName="'CV_SCAN_RATE'" :minValue="0.01" :maxValue="1000" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -283,7 +275,7 @@ export default {
},
],
DCVolt: null,
AC_AMP: null,
EIS_AC_AMP: null,
FreqStart: null,
FreqStop: null,
PointsPerDecades: null,
@@ -395,44 +387,35 @@ export default {
this.measureEocButton.status = false
},
refresh () {
// taskInfo.getDeviceInfo(this.deviceID).parameterSet.CHANNEL_LABEL = ['Z_image_Raw', 'Z_Real_Raw', 'Frequency', 'Cycle', 'Z_imag', 'Z_real', 'Impedance', 'Phase', 'Current', 'Level gain']
this.workingModeSelect = this.workingModeOptions[taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE]
if (this.workingModeSelect != null) {
this.workingModeSelectChange(this.workingModeSelect)
}
this.ACAmplitude = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.AC_AMP) / 2047 * 800))
this.ACAmplitude = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_AC_AMP) / 2047 * 800))
if (this.$refs.ACAmplitude != null) {
this.$refs.ACAmplitude.itemChange(this.ACAmplitude)
}
this.Average = taskInfo.getDeviceInfo(this.deviceID).parameterSet.AVERAGE_NUM
this.Average = taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_AVERAGE_NUM
if (this.$refs.Average != null) {
this.$refs.Average.itemChange(this.Average)
}
this.CurrentRange = taskInfo.getDeviceInfo(this.deviceID).parameterSet.RTIA
this.CurrentRange = taskInfo.getDeviceInfo(this.deviceID).parameterSet.GENERAL_HS_RTIA
if (this.$refs.CurrentRange != null) {
this.$refs.CurrentRange.itemChange(this.CurrentRange)
}
this.PointSpacing = taskInfo.getDeviceInfo(this.deviceID).parameterSet.SCALE
this.PointSpacing = taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_SCALE
if (this.$refs.PointSpacing != null) {
this.$refs.PointSpacing.itemChange(this.PointSpacing)
}
this.DCVolt = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.DC_BIAS) * 2200 / 4095))
this.DCVolt = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_DC_BIAS) * 2200 / 4095))
if (this.$refs.DCVolt != null) {
this.$refs.DCVolt.itemChange(this.DCVolt)
}
this.Delay = String(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.DELAY) / 10).toFixed(1))
this.Delay = String(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_DELAY) / 10).toFixed(1))
if (this.$refs.Delay != null) {
this.$refs.Delay.itemChange(this.Delay)
}
this.FreqStart = String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_START * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_START * 0.0149) * 100)) / 100).toFixed(1))
if (this.$refs.FreqRange != null) {
this.$refs.FreqRange.itemChangeMax(this.FreqStart)
}
this.FreqStop = String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_STOP * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_STOP * 0.0149) * 100)) / 100).toFixed(1))
if (this.$refs.FreqRange != null) {
this.$refs.FreqRange.itemChangeMin(this.FreqStop)
}
this.PointsPerDecades = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.PPD)))
this.PointsPerDecades = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_PPD)))
if (this.$refs.PointsPerDecades != null) {
this.$refs.PointsPerDecades.itemChange(this.PointsPerDecades)
}
@@ -443,11 +426,6 @@ export default {
this.$refs.currentRangeSelect.updateLevelButton(this.currentRangeSelect)
}
this.voltageInRangeSelect = taskInfo.getDeviceInfo(this.deviceID).parameterSet.ADC_LEVEL_V_IN_15
if (this.$refs.voltageInRangeSelect != null) {
this.$refs.voltageInRangeSelect.updateLevelButton(this.voltageInRangeSelect)
}
this.highzSelect = taskInfo.getDeviceInfo(this.deviceID).parameterSet.CTRL_HIGH_Z_15
if (this.$refs.highzSelect != null) {
this.$refs.highzSelect.updateLevelButton(this.highzSelect)
@@ -463,12 +441,12 @@ export default {
this.$refs.stopVoltMinNumber.updateVoltNumber(this.stopVoltMinNumber)
}
this.voltInitialNumber = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.VOLT_INITIAL - 25000) / 5
this.voltInitialNumber = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.CV_E_INITIAL - 25000) / 5
if (this.$refs.voltInitialNumber != null) {
this.$refs.voltInitialNumber.updateVoltNumber(this.voltInitialNumber)
}
this.voltScanRateNumber = taskInfo.getDeviceInfo(this.deviceID).parameterSet.Scan_Rate
this.voltScanRateNumber = taskInfo.getDeviceInfo(this.deviceID).parameterSet.CV_SCAN_RATE
if (this.$refs.voltScanRateNumber != null) {
this.$refs.voltScanRateNumber.updateVoltScanRateNumber(this.voltScanRateNumber)
}
+104 -32
View File
@@ -1,22 +1,30 @@
<template>
<div>
<va-card style="height: 88vh; overflow: auto; display: block;">
<!-- <pre>{{ getSelectProject }} </pre> -->
<va-card style="height: 88vh; overflow: auto; display: block;" @mousemove.native="mousemove">
<div id="project-view-show-btn" v-if="!projectManagerPanel.show" @click="showProjectManagerPanel">
<img id="project-view-show-btn-img" src="@/assets/img/project/arrow-right.svg">
</div>
<template slot="header">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 class="mt-0 mb-0"> {{ getSelectProject ? getSelectProject.name : '' }}</h5>
<p class="project-view-header">{{ getSelectProject ? getSelectProject.name : '' }}</p>
</template>
<div v-if="getSelectProject === undefined">
<span>please select project</span>
</div>
<div v-else>
<project-menu/>
<project-table/>
<project-menu @detect="detect" @save_project="save"/>
<project-table @save="save"/>
<div align="right" v-if="lockMode === false">
<va-button @click="save">Save</va-button>
<va-button @click="start">Start</va-button>
<button class="project-start-btn" @click="start">
<div>
<img src='@/assets/img/project/play.svg' alt="start">
</div>
</button>
</div>
<div align="right" v-if="lockMode === true">
<va-button @click="stop">Stop</va-button>
<button class="project-stop-btn" @click="stop">
<img src='@/assets/img/project/stop.svg' alt="stop">
</button>
</div>
</div>
</va-card>
@@ -45,6 +53,7 @@ export default {
'deviceConnectList',
'projectSelectIndex',
'projectLibrary',
'projectManagerPanel',
]),
},
data () {
@@ -52,14 +61,48 @@ export default {
}
},
methods: {
showProjectManagerPanel: function () {
this.projectManagerPanel.show = true
},
mousemove: function (e) {
// define constant
const DETECT_X_MAX = 50
const DETECT_X_MIN = 0
// get element
const element = document.getElementById('project-view-show-btn')
if (!element) return
let x = e.offsetX
// console.log('e', e, e.srcElement.className, e.srcElement.id)
// if mouse on project
if (e.srcElement.id === 'project-view-show-btn' || e.srcElement.id === 'project-view-show-btn-img') {
element.style.opacity = 0.7
element.style.transform = 'rotate(90deg) translate(40vh, 25px)'
return
}
if (e.srcElement.className !== 'va-card__body' && e.srcElement.className !== 'va-card') {
element.style.transform = 'rotate(90deg) translate(40vh, 75px)'
return
}
if (x >= DETECT_X_MAX) x = DETECT_X_MAX
if (x < DETECT_X_MIN) x = DETECT_X_MIN
const offsetPercentage = Math.round(((DETECT_X_MAX - x) / DETECT_X_MAX) * 4) / 4
const newOffset = 75 - offsetPercentage * 50
element.style.opacity = offsetPercentage * 0.7
element.style.transform = 'rotate(90deg) translate(40vh, ' + String(newOffset) + 'px)'
},
start: function () {
this.$emit('start_project', this.getSelectProject)
},
stop: function () {
this.$emit('stop_project', this.getSelectProject)
},
save: function () {
this.$emit('save_project', this.getSelectProject)
save: function (project) {
this.$emit('save_project', project)
},
detect: function (device) {
this.$emit('detect', device)
},
...mapActions('project',
[
@@ -69,30 +112,59 @@ export default {
),
},
watch: {
projectSelectIndex: {
handler: async function () {
// console.log('device', this.deviceConnectList)
for (const device of this.deviceConnectList) {
var newDevice = {
uuid: this.GLOBAL.getUUID(),
name: device.mac_address,
product: device.device_name,
library: device.library_name,
connectDevice: device,
isSelect: [],
}
await this.addDeviceProject({ device: newDevice })
if (device.library_name !== undefined) {
this.projectLibrary = device.library_name
}
}
},
},
},
async mounted () {
// console.log('mounted')
// console.log(this.deviceConnectList)
// console.log(this.deviceConnectList.length)
},
}
</script>
<style lang="scss">
#project-view-show-btn {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 50px;
border-radius: 100px 100px 0 0;
background-color: #495057;
transform: rotate(90deg) translate(40vh, 75px);
transition: transform 0.1s linear;
}
#project-view-show-btn-img {
position: relative;
top: 5px;
left: 30px;
width: 40px;
height: 40px;
}
.project-view-header {
margin: 0.3rem 0 2rem 0;
font-family: 'Inter-ExtraBold';
// font-style: normal;
// font-weight: 800;
font-size: 24px;
line-height: 29px;
/* identical to box height */
color: #2c4053;
}
.project-start-btn {
width: 120px;
height: 50px;
background: #87d9d4;
border-radius: 8px;
border: white;
cursor: pointer;
}
.project-stop-btn {
width: 120px;
height: 50px;
background: #ff6c63;
border-radius: 8px;
border: white;
cursor: pointer;
}
</style>
+129 -31
View File
@@ -1,57 +1,155 @@
<template>
<div>
<div class="row">
<div class="flex d-flex">
<switch-project/>
<add-task/>
<add-device @showDeviceModal="showDeviceModal"/>
<!-- <clear-task/>
<save-project/>
<import-project/>
<export-project/>
<delete-project/> -->
<project-device @showDeviceModal="showDeviceModal" @save="saveProject"></project-device>
<div class="flex d-flex sm12 xs12 md6 xl4 px-0">
<add-task @save="saveProject"/>
<div>
<button class="add-cycle-btn" @click="showCycleModal">
<div class="add-cycle-text">
<p>Add Cycle</p>
</div>
</button>
</div>
<div>
<button class="copy-project-btn" @click="() => {
copyTask({ project: getSelectProject, index: projectTableSelectIndex})
saveProject()
}">
<img class="img-vertical-center" src="@/assets/img/project/copy.svg">
</button>
</div>
<div>
<button class="copy-project-btn" @click="saveProject(true)">
<img class="img-vertical-center" src="@/assets/img/project/save.svg">
</button>
</div>
<div>
<button class="copy-project-btn" @click="() => {
deleteTask({ project: getSelectProject, index: projectTableSelectIndex})
saveProject()
}">
<img class="img-vertical-center" src="@/assets/img/project/delete.svg">
</button>
</div>
</div>
<project-device @showDeviceModal="showDeviceModal($event)"></project-device>
<device-modal ref="device_modal_ref"></device-modal>
<new-device-modal ref="device_modal_ref" @detect="detect" @save="saveProject"></new-device-modal>
<cycle-modal ref="cycle_modal_ref" @createCycle="createCycle"></cycle-modal>
</div>
</template>
<script>
import SwitchProject from '@/components/project/view/menu/components/SwitchProject'
// import SwitchProject from '@/components/project/view/menu/components/SwitchProject'
import AddTask from '@/components/project/view/menu/components/AddTask'
// import ClearTask from '@/components/project/view/menu/components/ClearTask'
// import ExportProject from '@/components/project/view/menu/components/ExportProject'
// import ImportProject from '@/components/project/view/menu/components/ImportProject'
// import SaveProject from '@/components/project/view/menu/components/SaveProject'
// import DeleteProject from '@/components/project/view/menu/components/DeleteProject'
import AddDevice from '@/components/project/view/menu/components/AddDevice'
// import AddDevice from '@/components/project/view/menu/components/AddDevice'
import ProjectDevice from '@/components/project/view/menu/components/ProjectDevice'
import DeviceModal from '@/components/project/view/menu/components/DeviceModal'
import NewDeviceModal from '@/components/project/view/menu/components/NewDeviceModal'
import CycleModal from '@/components/project/view/menu/components/CycleModal'
import { mapFields } from 'vuex-map-fields'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
export default {
name: 'project-menu',
components: {
SwitchProject,
AddTask,
AddDevice,
// ClearTask,
// ExportProject,
// ImportProject,
// SaveProject,
// DeleteProject,
// AddDevice,
ProjectDevice,
DeviceModal,
NewDeviceModal,
CycleModal,
},
computed: {
...mapGetters('project', [
types.project.getSelect,
]),
...mapFields('project', [
'taskViewPanel',
'taskSelectKey',
'deviceSelectKey',
'lockMode',
'projectTableSelectIndex',
]),
},
data () {
return {
}
},
methods: {
showDeviceModal: function (device) {
this.$refs.device_modal_ref.show()
this.$refs.device_modal_ref.initSetting(device)
detect: function (device) {
this.$emit('detect', device)
},
showDeviceModal: function (key, device) {
this.$refs.device_modal_ref.show()
this.$refs.device_modal_ref.initSetting(key, device)
},
createCycle: function (cycleInfo) {
this.createCycleTask({ cycleInfo: cycleInfo })
},
showCycleModal: function () {
this.$refs.cycle_modal_ref.show()
this.$refs.cycle_modal_ref.reset()
},
saveProject: function (showMessage = false) {
if (showMessage === true) {
this.showToast(
'project update finish',
{
icon: 'fa-bell',
position: 'bottom-right',
duration: 5000,
},
)
}
this.$emit('save_project', this.getSelectProject)
},
...mapActions('project',
[
types.task.copy,
types.task.delete,
types.task.rearrange,
types.task.createCycle,
],
),
},
}
</script>
<style lang="scss">
.add-cycle-btn {
margin-left: 0.5rem;
width: 120px;
height: 38px;
left: 0;
top: 0;
background: #87d9d4;
border: none;
border-radius: 8px;
cursor: pointer;
}
.add-cycle-text {
width: 110px;
height: 24px;
font-family: 'Inter-Bold';
font-style: normal;
font-weight: 700;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #ffffff;
margin: 0 auto;
}
.copy-project-btn {
margin-left: 0.5rem;
width: 50px;
height: 38px;
background: #87d9d4;
border: none;
border-radius: 8px;
cursor: pointer;
}
.img-vertical-center {
vertical-align: middle;
}
</style>
@@ -1,6 +1,6 @@
<template>
<div>
<va-button @click="addDevice" small>ADD DEVICE</va-button>
<va-button @click="addDevice" small>+ DEVICE</va-button>
</div>
</template>
<script>
@@ -1,6 +1,13 @@
<template>
<div>
<va-button @click="createTask" small>ADD TASK</va-button>
<button class="add-task-btn" @click="() => {
createTask()
save()
}">
<div class="add-task-text">
<p>Add Task</p>
</div>
</button>
</div>
</template>
<script>
@@ -18,15 +25,39 @@ export default {
}
},
methods: {
save: function () {
this.$emit('save')
},
...mapActions('project',
[
types.task.init,
types.task.create,
types.task.save,
types.task.delete,
types.task.select,
],
),
},
}
</script>
<style lang="scss">
.add-task-btn {
width: 120px;
height: 38px;
left: 0;
top: 0;
background: #87d9d4;
border: none;
border-radius: 8px;
cursor: pointer;
}
.add-task-text {
width: 100px;
height: 24px;
font-family: 'Inter-Bold';
font-style: normal;
font-weight: 700;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #ffffff;
margin: 0 auto;
}
</style>
@@ -0,0 +1,259 @@
<template>
<div>
<va-modal
class="flex sm12 xl12 md12 xs12"
v-model="showModal"
size="small"
:noOutsideDismiss="true"
hide-default-actions
>
<template slot="header">
<div class="d-flex mb-3">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 v-if="Object.keys(cycleInfo).length == 0" class="mt-0 mb-0">Create Cycle</h5>
<h5 v-else class="mt-0 mb-0">{{ cycleInfo.name }}</h5>
</div>
</template>
<div class="row">
<div class="row flex sm6 xl6 md6 xs6">
<div class="flex sm2 xl2 md2 xs2 pt-2">
<span>Start</span>
</div>
<div class="flex sm8 xl8 md8 xs8">
<va-select
:label="''"
v-model="task.start"
textBy="name"
class="va-select-without-margin"
:options="taskOptions"
:noClear='true'
/>
</div>
</div>
<div class="row flex sm6 xl6 md6 xs6">
<div class="flex sm2 xl2 md2 xs2 pt-2">
<span>End</span>
</div>
<div class="flex sm8 xl8 md8 xs8">
<va-select
:label="''"
v-model="task.end"
textBy="name"
class="va-select-without-margin"
:options="taskOptions"
:noClear='true'
/>
</div>
</div>
<div class="row flex sm12 xl12 md12 xs12">
<div class="flex sm2 xl2 md2 xs2 pt-2">
<span> Cycle No. </span>
</div>
<div class="flex sm2 xl2 md2 xs2">
<va-input v-model="task.cycle"/>
</div>
</div>
<div class="row flex sm12 xl12 md12 xs12" style="height: 40px;">
<div class="flex sm1 xl1 md1 xs1">
<va-checkbox
v-model="task.useID"
/>
</div>
<div class="flex sm4 xl4 md4 xs4">
Use ID As Header
</div>
<div v-if="task.useID" class="flex sm4 xl4 md4 xs4">
<va-input v-model="task.id"></va-input>
</div>
</div>
<!-- <div class="row flex sm12 xl12 md12 xs12">
<div class="flex sm1 xl1 md1 xs1">
<va-checkbox
v-model="task.buttonTrigger"
/>
</div>
<div class="flex sm6 xl6 md6 xs6">
Wait Until Button Press In Next Loop
</div>
</div> -->
</div>
<div class="flex-center sm12 xl12 md12 xs12">
<va-button v-if="Object.keys(cycleInfo).length > 0" @click="removeCycle" color="danger">Remove</va-button>
<va-button @click="hide">Cancel</va-button>
<va-button @click="createCycle" @keyup.native="keyFunction($event,item)">OK</va-button>
</div>
</va-modal>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
export default {
name: 'cycle-modal',
components: {
},
computed: {
...mapGetters('project', [
types.project.getSelect,
]),
...mapFields('project', [
'deviceConnectList',
'projectLibrary',
]),
},
data () {
return {
showModal: false,
taskOptions: [],
task: {
id: '',
name: '',
start: -1,
end: -1,
cycle: '1',
useID: false,
buttonTrigger: false,
uuid: '',
},
cycleInfo: {},
}
},
methods: {
show: function () {
this.showModal = true
// window.addEventListener('keydown', (e) => {
// console.log('e', e)
// if (e.keyCode === 13) {
// this.createCycle()
// }
// }, { once: true })
},
hide: function () {
this.showModal = false
},
createCycle: async function () {
const project = this.getSelectProject
if (Object.keys(this.cycleInfo).length === 0) {
this.$emit('createCycle', this.task)
}
if (Object.keys(this.cycleInfo).length !== 0) {
this.cycleInfo.max = this.task.cycle
this.cycleInfo.name = this.task.name
this.cycleInfo.useID = this.task.useID
this.cycleInfo.id = this.task.id
const originStartIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[0] })
const newStartIndex = await this.getIndexTask({ project: project, uuid: this.task.start.value })
if (this.task.useID === true) {
const condition = project.task[originStartIndex].condition
const action = project.task[originStartIndex].action
delete condition[(Object.keys(condition).find(key => condition[key].type === 'after_task_run'))]
const conditionUUID = this.GLOBAL.getUUID()
const newCond = await this.createConditionTask({ uuid: conditionUUID, condition: 'until_button_trigger', compOp: 'equal', value: '' })
project.task[originStartIndex].condition = Object.assign({}, condition, newCond)
action[Object.keys(action).find(key => action[key].type === 'cycle')].condition.push(conditionUUID)
project.task[originStartIndex].name = this.task.name
} else {
const condition = project.task[originStartIndex].condition
const action = project.task[originStartIndex].action
delete condition[(Object.keys(condition).find(key => condition[key].type === 'until_button_trigger'))]
const conditionUUID = this.GLOBAL.getUUID()
const newCond = await this.createConditionTask({ uuid: conditionUUID, condition: 'after_task_run', compOp: 'equal', value: '0' })
project.task[originStartIndex].condition = Object.assign({}, condition, newCond)
action[Object.keys(action).find(key => action[key].type === 'cycle')].condition.push(conditionUUID)
}
if (Number(originStartIndex) + 1 !== Number(newStartIndex)) {
await this.swapTask({ project: project, originIndex: originStartIndex, newIndex: newStartIndex })
}
const originEndIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[1] })
const newEndIndex = await this.getIndexTask({ project: project, uuid: this.task.end.value })
project.task[originEndIndex].name = this.task.name
if (Number(originEndIndex) - 1 !== Number(newEndIndex)) {
await this.swapTask({ project: project, originIndex: originEndIndex, newIndex: newEndIndex + 1 })
}
}
this.$emit('save')
this.showModal = false
return true
},
removeCycle: async function () {
const project = this.getSelectProject
// remove project cycle
project.cycle.splice(project.cycle.findIndex(ele => ele.name === this.cycleInfo.name), 1)
// remove left cycle task
const originStartIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[0] })
await this.deleteTask({ project: project, index: originStartIndex })
// remove right cycle task
const originEndIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[1] })
await this.deleteTask({ project: project, index: originEndIndex })
this.$emit('save')
this.showModal = false
return true
},
updateTaskOptions: function () {
const taskOptions = []
const project = this.getSelectProject
for (var idx = 0; idx < project.task.length; idx++) {
if (Object.keys(this.cycleInfo).length !== 0) {
if (this.cycleInfo.range.findIndex(ele => ele === project.task[idx].uuid) !== -1) continue
}
taskOptions.push({
id: idx,
name: project.task[idx].name,
value: project.task[idx].uuid,
})
}
this.taskOptions = taskOptions
},
reset: function () {
this.updateTaskOptions()
this.task.start = this.taskOptions[0]
this.task.end = this.taskOptions[this.taskOptions.length - 1]
},
setCycleInfo: async function (project, uuid) {
this.cycleInfo = project.cycle.find(ele => ele.range.find(ele => ele === uuid))
const startIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[0] }) + 1
const endIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[1] }) - 1
this.updateTaskOptions()
this.task.start = this.taskOptions[this.taskOptions.findIndex(ele => ele.value === project.task[startIndex].uuid)]
this.task.end = this.taskOptions[this.taskOptions.findIndex(ele => ele.value === project.task[endIndex].uuid)]
this.task.name = this.cycleInfo.name
this.task.cycle = this.cycleInfo.max
this.task.useID = this.cycleInfo.useID
this.task.id = this.cycleInfo.id
},
...mapActions('project',
[
types.project.addDevice,
types.project.findDevice,
types.project.setDevice,
types.task.init,
types.task.create,
types.task.save,
types.task.delete,
types.task.select,
types.task.getIndex,
types.task.swap,
types.task.createCondition,
],
),
},
mounted () {
},
}
</script>
@@ -0,0 +1,155 @@
<template>
<div>
<va-modal
class="flex sm12 xl12 md12 xs12"
v-model="showModal"
size="small"
:noOutsideDismiss="true"
hide-default-actions
>
<template slot="header">
<div class="d-flex mb-3">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 class="mt-0 mb-0">Choose Device</h5>
</div>
</template>
<va-list fit class="mb-2 pb-0">
<va-list-label>
Connect
</va-list-label>
<va-item v-if="deviceList.length === 0">
<va-item-section>
There is no connected device.
</va-item-section>
</va-item>
<template v-else v-for="(device, index) in deviceList">
<va-item :class="deviceSelect === index ? 'device-list-focus': ''" :key="'connect-' + index" @click="selectDevice(device, index)" clickable>
<va-item-section avatar>
<va-avatar style="border-radius: 0;">
<img src='@/assets/img/elite_img.png' :alt="device.macAddress">
</va-avatar>
</va-item-section>
<va-item-section>
{{ device.macAddress }}
</va-item-section>
<va-item-section side>
<va-icon name="fa fa-map-marker" color="gray" @click.native="detect(device.macAddress)"/>
</va-item-section>
</va-item>
<!-- <va-list-separator v-if="index < deviceList.length - 1" :key="'separator-' + index" /> -->
</template>
</va-list>
<div class="flex-center sm12 xl12 md12 xs12">
<va-button color='danger' @click="removeDevice">Remove</va-button>
<va-button @click="hide">Cancel</va-button>
<va-button @click="changeDevice">OK</va-button>
</div>
</va-modal>
</div>
</template>
<script>
// import { mapFields } from 'vuex-map-fields'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
export default {
name: 'add-device-modal',
components: {
},
computed: {
optionDeviceVersion () {
return (this.optionDeviceVersionObj[this.device.product.value] !== undefined)
? this.optionDeviceVersionObj[this.device.product.value]
: undefined
},
...mapGetters('project', [
types.project.getSelect,
types.project.getDeviceShowName,
]),
// ...mapFields('project', [
// 'deviceConnectList',
// ]),
},
data () {
return {
showModal: false,
showDisplayDevice: false,
key: '',
device: {},
deviceList: [],
deviceSelect: -1,
}
},
methods: {
show: function () {
this.showModal = true
},
hide: function () {
this.showModal = false
},
detect: function (device) {
if (device) this.$emit('detect', device)
},
selectDevice: function (device, index) {
this.deviceSelect = index
},
changeDevice: function () {
if (this.deviceList[this.deviceSelect]) {
this.device.pair = this.deviceList[this.deviceSelect].macAddress
}
this.$emit('save')
this.hide()
},
removeDevice: function () {
this.deleteDeviceProject({ deviceKey: this.key })
this.$emit('save')
this.hide()
},
getDeviceList: async function (device) {
const deviceList = await this.checkNotRegisterDeviceProject({ library: device.library })
const _device = { macAddress: device.pair, library: device.library }
if (device.pair !== null) {
this.deviceList = [_device, ...deviceList]
} else {
this.deviceList = [...deviceList]
}
},
initSetting: function (key, device) {
this.key = key
this.device = device
this.deviceList = []
this.deviceSelect = 0
this.getDeviceList(device)
},
...mapActions('project',
[
types.project.addDevice,
types.project.findDevice,
types.project.setDevice,
types.project.deleteDevice,
types.project.checkNotRegisterDevice,
types.task.init,
types.task.create,
types.task.save,
types.task.delete,
types.task.select,
],
),
},
mounted () {
},
}
</script>
<style lang="scss">
.device-list-focus {
background: #ebedff;
border: 1px solid #dbdcf0;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
</style>
@@ -1,13 +1,44 @@
<template>
<div class="row">
<div class="flex d-flex">
<div v-for="(device, index) in getSelectProject.device" :key="index">
<va-button color="info" @click="showDeviceModal(device)" small>
<va-icon name="fa fa-close" @click.native.stop="deleteDevice(index)"></va-icon>
{{ device.name }} {{ device.connectDevice && device.connectDevice.device_address }}
</va-button>
<div class="flex d-flex sm12 xs12 md12 xl12 pa-0" style="align-items: center; margin-left: 0.6rem; margin-top: -12px;">
<!-- header -->
<div class="flex sm3 xs3 md3 xl1 px-0 project-device-header-text">
<p>Device</p>
</div>
<!-- create persudo devcie -->
<div class="flex d-flex" v-if="showLibrary === true">
<div class="flex d-flex pa-0 sm12 xs12 md6 xl3">
<div>
<button class="pair-button" @click="clickShowDevice('EDC')">
<span class="pair-button-text">EDC</span>
</button>
</div>
<div class="ml-2">
<button class="pair-button" @click="clickShowDevice('EIS')">
<span class="pair-button-text">EIS</span>
</button>
</div>
<div class="ml-2">
<button class="pair-button" @click="cancelSelectDevice()">
<span class="pair-button-text">X</span>
</button>
</div>
</div>
</div>
<!-- device list -->
<div class="flex d-flex" v-if="showDevice === false && showLibrary === false">
<draggable class="d-flex" :list="deviceListInOrder" :move="handleMove" @end="handleDragEnd">
<!-- devices -->
<div class="mr-2" v-for="(device, index) in deviceListInOrder" :key="index">
<button :class="device[1].pairStatus === 1 ? 'pair-button mr-2' : 'not-pair-button mr-2'" @click="showDeviceModal(device[0], device[1])">
<span class="pair-button-text">{{ getDeviceShowNameProject(device[0]) }}</span>
</button>
</div>
<!-- append device -->
<div v-if="deviceListInOrder.length < 4">
<button class="add-button" icon="fa fa-plus" @click="clickShowLibrary"><span class="add-button-text">+</span></button>
</div>
</draggable>
</div>
</div>
</template>
@@ -15,46 +46,171 @@
import { mapFields } from 'vuex-map-fields'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
import draggable from 'vuedraggable'
export default {
name: 'project-device',
components: {
draggable,
},
computed: {
deviceListInOrder () {
return Object.entries(this.getSelectProject.device).sort((a, b) => a[1].order - b[1].order)
},
...mapGetters('project', [
types.project.getSelect,
types.project.getDeviceShowName,
types.project.getDeviceMaxOrder,
]),
...mapFields('project', [
'projectLibrary',
'projectSelectIndex',
]),
},
data () {
return {
showDevice: false,
showLibrary: false,
notRegisterDevice: [],
index: -1,
futureIndex: -1,
}
},
methods: {
showDeviceModal: function (device) {
this.$emit('showDeviceModal', device)
clickShowLibrary: async function () {
this.notRegisterDevice = await this.checkNotRegisterDeviceProject({})
if (this.notRegisterDevice.length === 0) {
this.showLibrary = true
return true
}
await this.createDeviceProject({
name: this.notRegisterDevice[0].name,
library: this.notRegisterDevice[0].library,
pair: this.notRegisterDevice[0].macAddress,
pairStatus: 1,
order: this.getDeviceMaxOrderProject,
})
this.$emit('save')
return true
},
clickShowDevice: async function (library) {
this.showLibrary = false
await this.createDeviceProject({
name: library + '-' + String(Object.keys(this.getSelectProject.device).length + 1),
library: library,
pair: null,
pairStatus: 0,
order: this.getDeviceMaxOrderProject,
})
this.$emit('save')
return false
},
cancelSelectDevice: function () {
this.showLibrary = false
},
showDeviceModal: function (key, device) {
this.$emit('showDeviceModal', key, device)
},
deleteDevice: function (deviceIndex) {
this.deleteDeviceProject({ index: deviceIndex })
this.$emit('save')
},
handleMove (e) {
const { index, futureIndex } = e.draggedContext
this.index = index
this.futureIndex = futureIndex
return false // disable sort
},
handleDragEnd () {
const changeList = ['name', 'library', 'pair', 'pairStatus']
const deviceListTemp = JSON.parse(JSON.stringify(this.deviceListInOrder))
const keyOld = deviceListTemp[this.index][0]
const keyNew = deviceListTemp[this.futureIndex][0]
const deviceList = this.getSelectProject.device
for (const key of changeList) {
deviceList[keyOld][key] = deviceListTemp[this.futureIndex][1][key]
deviceList[keyNew][key] = deviceListTemp[this.index][1][key]
}
this.$emit('save')
},
...mapActions('project',
[
types.project.createDevice,
types.project.deleteDevice,
types.project.checkNotRegisterDevice,
types.project.checkPairDeviceExist,
],
),
},
mounted () {
for (const device in this.getSelectProject.device) {
if (this.projectLibrary === null) {
this.projectLibrary = this.getSelectProject.device[device].library.value
}
}
},
watch: {
projectSelectIndex: {
immediate: true,
handler: async function (val) {
console.log('projectSelectIndex', val)
this.checkPairDeviceExistProject()
},
},
},
}
</script>
<style lang="scss">
.add-button {
width: 38px;
height: 36px;
background: #e0e0e0;
border: 2px dashed #b7b7b7;
border-radius: 20px;
}
.add-button-text {
color: white;
font-size: 20px;
font-weight: bold;
}
.pair-button {
width: 100%;
height: 36px;
background: #858dd6;
border: 0;
border-radius: 20px;
}
.not-pair-button {
width: 100%;
height: 36px;
background: #e0e0e0;
border: 0;
border-radius: 20px;
}
.pair-button-text {
font-family: 'Inter-Regular';
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #ffffff;
}
.project-device-header-text {
align-items: center;
// font-family: 'Inter-Regular';
// font-style: normal;
font-weight: 700;
font-size: 20px;
line-height: 29px;
/* identical to box height */
color: rgb(52, 73, 94);
// color: #768b9b;
}
</style>
+527 -155
View File
@@ -1,67 +1,124 @@
<template>
<div class="markup-tables project-table flex d-flex sm12 xl12 md12 xs12" id="scro" style="height: 66vh; overflow: auto;">
<div class="table-wrapper">
<table class="va-table">
<div class="markup-tables project-table flex d-flex sm12 xl12 md12 xs12 px-0 mx-0" id="scro" style="width: 100%; height: 55vh; overflow: auto; padding-top: 0;">
<div class="table-wrapper" style="width: 100%;">
<table class="va-table project-table-text">
<thead>
<tr>
<th v-if="lockMode === false">
<va-checkbox
v-model="tableColumn.checked"
:array-value="'-1'"
@input="selectAll($event)"
/>
</th>
<th align="center">order</th>
<th align="center">name</th>
<tr class="project-table-header">
<th align="center" style="min-width: 50px; padding: 0;">order</th>
<th align="center" style="min-width: 100px;">name</th>
<th align="center" @click="openConfig(1)">device</th>
<th align="center">action and condition</th>
<th align="center">parameter</th>
<th v-if="lockMode" align="center">cycle</th>
<th align="center"></th>
<th align="center" style="min-width: 100px;">start</th>
<th align="center" style="min-width: 100px;">stop</th>
<th align="center" style="min-width: 100px;">parameter</th>
<!-- <th v-if="lockMode" align="center">cycle</th> -->
<th align="center" style="min-width: 50px;"></th>
</tr>
</thead>
<!-- <tbody> -->
<vuedraggable :disabled="lockMode === true" class="draggable" v-model="getSelectProject.task" @start="() => {}" @end="() => {}" tag="tbody" animation="500">
<vuedraggable :disabled="lockMode === true || inputMode === true" class="draggable" :list="getSelectProject.task" @end="()=> {
rearrangeTask({ project: getSelectProject })
saveProject()
}" tag="tbody" animation="500">
<template class="item" v-for="(task, taskIndex) in getSelectProject.task">
<tr v-if="task.device && task.device.length === 0" :key="'empty' + taskIndex" height="80px" @click="() => { focus = taskIndex }">
<td v-if="lockMode === false">
<va-checkbox
v-model="tableColumn.checked"
:array-value="String(taskIndex)"
/>
</td>
<tr
v-if="task.type === 'cycle'"
:key="'empty' + taskIndex"
height="50px"
@click="showCycleModal(task.uuid)"
>
<td align="center">
{{ taskIndex + 1 }}
</td>
<td align="center">
{{ task.name }}
<td align="center" @dblclick="switchInput('name', taskIndex)">
<div v-if="tableColumn.name == taskIndex && getCycleInfo(task.uuid, 'useID') === true && lockMode === true">
<va-input
v-model="inputSaved"
style="width: 100px;"
@blur="switchCycle('name', -1, getSelectProject, task)"
@keyup.enter="switchCycle('name', -1, getSelectProject, task)"
/>
</div>
<div v-else>
<div v-if="getCycleInfo(task.uuid, 'useID') === true">
{{ getCycleInfo(task.uuid, 'id') }}
</div>
<div v-if="getCycleInfo(task.uuid, 'useID') === false">
{{ getCycleInfo(task.uuid, 'name') }}
</div>
</div>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(1, taskIndex)" small>Add Device</va-button>
<td align="center" v-if="getCycleLocation(task.uuid) === 'start'">
{{ getCycleInfo(task.uuid, 'max') }} Rounds
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(3, taskIndex)" small>+ New Action/Condition</va-button>
<td v-if="lockMode === true && getCycleLocation(task.uuid) === 'start'">
{{ getCycleInfo(task.uuid, 'count') }} / {{ getCycleInfo(task.uuid, 'max') }}
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(4, taskIndex)" small>Add Parameter</va-button>
</td>
<td align="center">
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
<td v-if="lockMode === true && Object.values(task.condition).findIndex(ele => ele.type == 'until_button_trigger') != -1 && task.status === 1">
<va-button icon="fa fa-play" @click="trigger_button(getSelectProject)" flat></va-button>
<td/>
<td align="center" v-if="lockMode === true">
<fulfilling-bouncing-circle-spinner
v-if="task.status === 1"
:animation-duration="3000"
:color="'#6c7fee'"
:size="16"
></fulfilling-bouncing-circle-spinner>
<!-- <va-icon v-if="task.status === 2" class="fa fa-check"></va-icon> -->
</td>
</tr>
<tr :class="taskIndex === focus ? 'table-row-focus' : ''" v-else v-for="(deviceUUID) in task.device" :key="taskIndex + deviceUUID" height="80px" @click="() => { focus = taskIndex }">
<td v-if="lockMode === false">
<va-checkbox
v-model="tableColumn.checked"
:array-value="String(taskIndex)"
/>
</td>
<tr
v-else-if="task.device && task.device.length === 0"
:class="taskIndex === projectTableSelectIndex ? 'table-row-focus' : ''"
:key="'empty' + taskIndex" height="50px"
@click="() => { projectTableSelectIndex = taskIndex }"
>
<td align="center">
{{ taskIndex + 1 }}
{{ taskIndex + 1 }}
</td>
<!-- name -->
<td align="center" @dblclick="switchInput('name', taskIndex)">
<div v-if="tableColumn.name == taskIndex && lockMode === false">
<va-input
:ref="'input_ref'"
v-model="task.name"
style="width: 100px;"
@blur="switchInput('name', -1)"
@keyup.enter="switchInput('name', -1)"
/>
</div>
<div v-else align="center">
{{ task.name }}
</div>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(1, taskIndex)" small>+</va-button>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(2, taskIndex)" :disabled="true" small>-</va-button>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(3, taskIndex)" :disabled="true" small>-</va-button>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(4, taskIndex)" :disabled="true" small>-</va-button>
</td>
</tr>
<tr
v-else
height="50px"
:class="taskIndex === projectTableSelectIndex ? 'table-row-focus' : ''"
:key="String(taskIndex)"
@click="() => { projectTableSelectIndex = taskIndex }"
>
<!-- order -->
<td align="center">
{{ taskIndex + 1 }}
</td>
<!-- name -->
<td align="center" @dblclick="switchInput('name', taskIndex)">
<div v-if="tableColumn.name == taskIndex && lockMode === false">
<va-input
:ref="'input_ref'"
v-model="task.name"
style="width: 100px;"
@blur="switchInput('name', -1)"
@@ -69,9 +126,6 @@
/>
</div>
<div v-else>
<!-- <vuedraggable class="draggable">
{{ task.name }}
</vuedraggable> -->
{{ task.name }}
</div>
</td>
@@ -79,80 +133,110 @@
<td align="center">
<div v-if="task.device && task.device.length === 0">
<va-button :flat="true" @click="openConfig(1, taskIndex, deviceUUID)" small>
Add device
+ Device
</va-button>
</div>
<div v-else>
<va-button :flat="true" @click="openConfig(1, taskIndex, deviceUUID)" small>
<span>{{ getDeviceProject(deviceUUID) && getDeviceProject(deviceUUID).name }}</span>
</va-button>
<div class="flex project-table-cell" v-for="(deviceUUID) in task.device" :key="deviceUUID" @click="openConfig(1, taskIndex, deviceUUID)">
<p>{{ getDeviceShowNameProject(deviceUUID)}}</p>
</div>
</div>
</td>
<!-- device end -->
<!-- action -->
<!-- start -->
<td align="center">
<div v-if="Object.keys(task.action).length === 0">
<va-button :flat="true" @click="openConfig(3, taskIndex, deviceUUID)" small>
Add event
</va-button>
</div>
<div v-else class="flex">
<div class="flex project-table-cell" v-for="(deviceUUID) in task.device" :key="deviceUUID">
<div v-if="Object.values(task.action).filter(ele => ele.type === 'start' && ele.target === deviceUUID).length === 0">
+
</div>
<div v-for="(action, actionKey) in task.action" :key="actionKey">
<div v-if="action.target === deviceUUID">
<div v-for="conditionKey in action.condition" :key="conditionKey">
<div small v-if="action.type !== 'cycle' && action.type !== 'start'">
{{ action.type }} {{ task.condition[conditionKey].type }} {{ task.condition[conditionKey].value }}
<va-icon class="fa fa-close" @click.native="delAction(task, actionKey, conditionKey)"/>
</div>
<div small v-else-if="action.type == 'cycle' && task.condition[conditionKey].type === 'previous_task_done'">
{{ action.type }} go to {{ task.cycle_next }} run {{ task.cycle }} times
<va-icon class="fa fa-close" @click.native="delAction(task, actionKey, conditionKey)"/>
<div v-if="action.condition.length === 0">
+
</div>
<div v-else v-for="conditionKey in action.condition" :key="conditionKey">
<div v-if="action.type == 'start' && task.condition[conditionKey].type === 'previous_task_done'">
<div v-if=" taskIndex === 0"> - </div>
<div v-else> Follow {{ getSelectProject.task[taskIndex - 1].name }} </div>
</div>
</div>
</div>
</div>
<va-button :flat="true" @click="openConfig(3, taskIndex, deviceUUID)" small>
+ New Action/Condition
</va-button>
</div>
</td>
<!-- action end -->
<!-- start end -->
<!-- stop -->
<td align="center">
<div v-if="Object.keys(task.parameter_set).length === 0">
<va-button :flat="true" @click="openConfig(4, taskIndex, deviceUUID)" small>
Add Parameter
</va-button>
</div>
<va-button :flat="true" @click="openConfig(4, taskIndex, deviceUUID)" v-else class="flex d-flex">
<div class="flex" small>
<div v-for="(parameterSet, parameterSetKey) in getParameterSetTask(taskIndex, deviceUUID)" :key="parameterSetKey">
<div v-for="(parameter, parameterKey) in parameterSet" :key="parameterKey">
<span v-if="parameterKey !== 'target'">
<div small>
{{ parameterName(parameterKey) }} : {{ parameterValue(parameterKey, parameter) }}
</div>
</span>
<div class="flex project-table-cell" v-for="(deviceUUID) in task.device" :key="deviceUUID" @click="openConfig(3, taskIndex, deviceUUID)">
<div v-if="Object.values(task.action).filter(ele => ele.type === 'stop' && ele.target === deviceUUID).length === 0">
+
</div>
<div v-for="(action, actionKey) in task.action" :key="actionKey">
<div v-if="action.target === deviceUUID">
<div v-if="action.condition.length === 0">
+
</div>
<div v-else v-for="conditionKey in action.condition" :key="conditionKey">
<div v-if="action.type == 'stop' && task.condition[conditionKey].type === 'after_task_run'" >
{{ transTime(task.condition[conditionKey].value) }}
<va-icon class="fa fa-close" @click.native="delAction(task, actionKey, conditionKey)"/>
</div>
</div>
</div>
</div>
</va-button>
</div>
</td>
<!-- stop end -->
<td align="center">
<div class="flex project-table-cell" v-for="(deviceUUID) in task.device" :key="deviceUUID" @click="openConfig(4, taskIndex, deviceUUID)">
<div v-if="Object.values(task.parameter_set).filter(ele => ele.target === deviceUUID).length === 0" >
<p>
+
</p>
</div>
<div style="height: auto;" v-for="(parameterSet, parameterSetKey) in getParameterSetTask(taskIndex, deviceUUID)" :key="parameterSetKey">
<v-popover
placement="right"
trigger="hover"
popoverBaseClass="tooltip popover test"
:disabled="!Object.keys(parameterSet).filter(ele=>ele !== 'MODE' && ele !== 'target').length > 0"
>
<div class="tooltip-target">
{{ parameterName('MODE', deviceUUID) }} : {{ parameterValue('MODE', parameterSet.MODE, deviceUUID) }}
</div>
<template slot="popover">
<div>
<div v-for="(parameter) in parameterShow(parameterSet.MODE, deviceUUID)" :key="parameter + parameterSet.MODE">
<p v-if="getConfig(deviceUUID).includes('TRIG') === true">
{{ parameterPair(parameter, parameterSet, deviceUUID) }}
</p>
<p v-else>
{{ parameterName(parameter, deviceUUID) }} : {{ parameterValue(parameter, parameterSet[parameter], deviceUUID) }}
</p>
</div>
</div>
</template>
</v-popover>
</div>
</div>
</td>
<td align="center" v-if="lockMode === false">
<va-icon v-if="String(taskIndex) !== '0'" class="fa fa-toggle-up" @click.native="swapTask(taskIndex, 0)"/>
<!-- <va-icon v-if="String(taskIndex) !== '0'" class="fa fa-toggle-up" @click.native="swapTask(taskIndex, 0)"/>
<va-icon v-if="parseInt(taskIndex) !== getSelectProject.task.length - 1" class="fa fa-toggle-down" @click.native="swapTask(taskIndex, 1)"/>
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
<va-icon class="fa fa-copy ml-1" @click.native="() => copyTask({ project: getSelectProject, index: taskIndex})"></va-icon> -->
<va-icon class="fa fa-close" color="#B8C3CC" @click.native="() => deleteTask({ project: getSelectProject, index: taskIndex})"></va-icon>
</td>
<td align="center" v-if="lockMode === true">
<!-- <td align="center" v-if="lockMode === true">
<div v-if="task.cycle > 0 && task.status === 2 && task.cycle_count === 0">
{{ task.cycle }}/{{ task.cycle }}
</div>
<div v-else-if="task.cycle > 0">
{{ task.cycle_count }}/{{ task.cycle }}
</div>
</td>
<td v-if="lockMode === true && Object.values(task.condition).findIndex(ele => ele.type == 'until_button_trigger') != -1 && task.status === 1">
</td> -->
<!-- <td v-if="lockMode === true && Object.values(task.condition).findIndex(ele => ele.type == 'until_button_trigger') != -1 && task.status === 1">
<va-button icon="fa fa-play" @click="trigger_button(getSelectProject)" flat></va-button>
<td/>
<td/> -->
<td align="center" v-if="lockMode === true">
<!-- {{ task.status }} -->
<fulfilling-bouncing-circle-spinner
@@ -166,9 +250,15 @@
</tr>
</template>
</vuedraggable>
<!-- </tbody> -->
<!-- </tbody> -->
<tr class="table-row-add-task" v-if="lockMode === false">
<td align="center" colspan="7" class="table-row-add-task-text" @click="createTask">+ task</td>
</tr>
</table>
</div>
<div>
<cycle-modal ref="cycle_modal_ref" @save="saveProject"></cycle-modal>
</div>
</div>
</template>
<script>
@@ -179,12 +269,14 @@ import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
import configTable from '@/data/config-table/index'
import vuedraggable from 'vuedraggable'
import { taskInfo } from '@/data/task/TaskInfo'
import CycleModal from '@/components/project/view/menu/components/CycleModal'
export default {
name: 'project-table',
components: {
FulfillingBouncingCircleSpinner,
vuedraggable,
CycleModal,
},
computed: {
config () {
@@ -194,6 +286,9 @@ export default {
...mapGetters('project', [
types.project.getSelect,
types.project.getDevice,
types.project.getCycle,
types.project.getDeviceLibrary,
types.project.getDeviceShowName,
types.task.get,
types.task.getCondition,
types.task.getParameterSet,
@@ -205,6 +300,7 @@ export default {
'deviceSelectKey',
'lockMode',
'projectLibrary',
'projectTableSelectIndex',
]),
},
data () {
@@ -213,33 +309,61 @@ export default {
name: -1,
checked: [],
},
focus: -1,
inputSaved: '',
index: -1,
futureIndex: -1,
inputMode: false,
}
},
methods: {
transTime: function (sec) {
if (sec === undefined || sec === 'None') {
return '0 s'
}
let result = ''
if (sec < 1) {
result = '~ 1 s'
} else {
let seconds = parseInt(sec / 1)
if (seconds < 60) {
result = `${seconds} sec`
} else {
let minutes = parseInt(seconds / 60)
seconds %= 60
if (minutes < 60) {
if (seconds === 0) {
result = `${minutes} min`
} else {
result = `${minutes} m ${seconds} s`
}
} else {
const hours = parseInt(minutes / 60)
minutes %= 60
if (seconds === 0 && minutes === 0) {
result = `${hours} hour`
} else {
result = `${hours} h ${minutes} m ${seconds} s`
}
}
}
}
return result
},
mqttPub: function (topic, mes) {
this.$mqtt.publish(topic, mes)
},
dragEnd: function (event) {
console.log('event', event)
console.log('from', event.oldDraggableIndex)
console.log('to', event.newDraggableIndex)
const newTaskList = JSON.parse(JSON.stringify(this.getSelectProject.task))
console.log('this.getSelectProject.task', newTaskList, this.getSelectProject.task)
const b = newTaskList[event.oldDraggableIndex]
const a = newTaskList[event.newDraggableIndex]
console.log('a', a)
console.log('b', b)
console.log('b.device.length', b.device.length)
if (b && b.device.length === 0) return
console.log('1')
// newTaskList.splice(event.newDraggableIndex, 1, this.getSelectProject.task[event.oldDraggableIndex])
if (a === undefined) return
console.log('2')
// newTaskList.splice(event.oldDraggableIndex, 1, a)
newTaskList.filter(ele => ele != null)
console.log('newTaskList', newTaskList)
// this.getSelectProject.task = newTaskList
this.rearrangeTask({ project: this.getSelectProject })
this.saveProject()
},
swapTask: function (taskIndex, upDown) {
taskIndex = parseInt(taskIndex)
@@ -252,35 +376,30 @@ export default {
this.getSelectProject.task.splice(taskIndex, 1, this.getSelectProject.task[taskIndex + 1])
this.getSelectProject.task.splice(taskIndex + 1, 1, a)
}
this.rearrangeTask({ project: this.getSelectProject })
this.saveProject()
},
delSelected: function () {
for (const indexSelected of this.tableColumn.checked) {
this.deleteTask({ index: indexSelected })
this.deleteTask({ project: this.getSelectProject, index: indexSelected })
}
this.saveProject()
},
delAction: function (task, actionKey, conditionKey) {
// console.log(action)
// console.log(conditionKey)
// console.log(action.condition[0])
// console.log(action.condition.length)
// for (let i = 0; i < action.condition.length; i++) {
// if (String(action.condition[i]) === String(conditionKey)) {
// delete action.condition[i]
// break
// }
// }
const _action = JSON.parse(JSON.stringify(task.action))
const _condition = JSON.parse(JSON.stringify(task.condition))
// console.log(Object.keys(_task.action))
delete _action[actionKey]
delete _condition[conditionKey]
// delete _task.action[actionKey]
// delete _task.condition[conditionKey]
// console.log(Object.keys(_task.action))
task.action = _action
task.condition = _condition
console.log('task', task)
// delete action.condition[0]
this.saveProject()
},
saveProject: function () {
console.log('saveProject')
this.$emit('save', this.getSelectProject)
},
trigger_button: function (projectID) {
console.log('project', projectID)
@@ -291,9 +410,33 @@ export default {
}))
},
switchInput: function (tag, index) {
this.tableColumn[tag] >= 0
? this.tableColumn[tag] = -1
: this.tableColumn[tag] = index
if (this.tableColumn[tag] === -1) {
if (index !== -1) {
this.inputMode = true
this.tableColumn[tag] = index
this.$nextTick(() => {
this.$refs.input_ref[0].$refs.input.focus()
})
}
} else {
this.inputMode = false
this.tableColumn[tag] = -1
}
this.saveProject()
},
switchCycle: function (tag, index, projectID, task) {
this.switchInput(tag, index)
const cycleInfo = this.getCycleProject(task.uuid) // 0: index, 1: location, 2: info
if (this.inputSaved === cycleInfo[2].id) return
cycleInfo[2].id = this.inputSaved
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'set_project_cycle/0',
project: projectID.uuid,
index: cycleInfo[0],
content: { id: this.inputSaved },
}))
this.$emit('save', this.getSelectProject)
},
selectAll: function (selectedArray) {
const totalRange = [...Array(this.getSelectProject.task.length).keys()].map(idx => String(idx))
@@ -320,34 +463,109 @@ export default {
}
}
},
parameterName (name) {
if (this.config !== undefined && Object.keys(this.config) !== 0) {
parameterShow (mode, deviceKey) {
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
if (config !== undefined && Object.keys(config) !== 0) {
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) return config.MODE[mode].showParameter
return config.MODE[mode].parameter
}
},
parameterPair (name, valueSet, deviceKey) {
let _name, _value
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
if (config !== undefined && Object.keys(config) !== 0) {
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) {
if (name.includes('ACC_a_out')) {
const accName = name + '_current'
if (Boolean(valueSet[name]) === true) {
_name = 'Channel' + String((parseInt(name.replace('ACC_a_out', '')) + 1))
const scale = config[accName].unit[config[accName].defaultUnit]
_value = `${config[accName].outputReadabilityData(valueSet[accName], scale)} ${config[accName].defaultUnit}`
} else return ''
} else if (name.includes('TRIG')) {
if (Boolean(valueSet[name]) === true) {
const optionTrigger = [
'RISING',
'FALLING',
'BOTH',
]
const trigName = name.replace('en', '') + 'edge_type'
_name = 'TRIG' + String((parseInt(name.replace('TRIG', '').replace('_en', '')) + 1))
_value = optionTrigger[valueSet[trigName]]
} else return ''
} else if (name.includes('TIME_DURATION')) {
if (valueSet.TIME_DURATION && parseInt(valueSet.TIME_DURATION) > 0) {
const scale = config[name].unit[config[name].defaultUnit]
_name = 'Timer'
_value = `${config[name].outputReadabilityData(valueSet[name], scale)} ${config[name].defaultUnit}`
} else return ''
}
}
}
return _name + ': ' + _value
},
parameterName (name, deviceKey) {
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
if (config !== undefined && Object.keys(config) !== 0) {
if (name === 'MODE') {
return 'Mode'
}
if (typeof this.config[name].showName === 'function') {
return this.config[name].showName()
if (typeof config[name].showName === 'function') {
return config[name].showName()
}
return this.config[name].showName
return config[name].showName
}
},
parameterValue (name, value) {
if (this.config !== undefined && Object.keys(this.config) !== 0) {
parameterValue (name, value, deviceKey) {
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
const _value = (value === undefined) ? config[name].defaultValue : value
if (config !== undefined && Object.keys(config) !== 0) {
if (name === 'MODE') {
return this.config.MODE[value].name
return config.MODE[_value].name
}
if (this.config[name].type === 'number') {
const scale = this.config[name].unit[this.config[name].defaultUnit]
return `${this.config[name].outputReadabilityData(value, scale)} ${this.config[name].defaultUnit}`
} else if (this.config[name].type === 'array') {
return `${this.config[name].outputReadabilityData(value)}`
} else if (this.config[name].type === 'none') {
if (config[name].type === 'number') {
const scale = config[name].unit[config[name].defaultUnit]
return `${config[name].outputReadabilityData(_value, scale)} ${config[name].defaultUnit}`
} else if (config[name].type === 'array') {
return `${config[name].outputReadabilityData(_value)}`
} else if (config[name].type === 'none') {
return ''
}
}
},
showCycleModal: function (uuid) {
if (!this.lockMode) {
this.$refs.cycle_modal_ref.show()
this.$refs.cycle_modal_ref.setCycleInfo(this.getSelectProject, uuid)
}
},
getCycleInfo: function (uuid, attribute) {
const cycleInfo = this.getCycleProject(uuid) // 0: index, 1: location, 2: info
if (cycleInfo.length === 0) return ''
return cycleInfo[2][attribute]
},
getCycleLocation: function (uuid) {
const cycleInfo = this.getCycleProject(uuid) // 0: index, 1: location, 2: info
return cycleInfo[1]
},
getConfig: function (deviceKey) {
return this.getDeviceLibraryProject(deviceKey)
},
handleMove (e) {
const { index, futureIndex } = e.draggedContext
this.index = index
this.futureIndex = futureIndex
return false // disable sort
},
...mapActions('project', [
types.task.create,
types.task.copy,
types.task.delete,
types.task.rearrange,
]),
},
mounted () {
@@ -361,20 +579,10 @@ export default {
margin: auto;
}
// .item {
// height: 40px;
// line-height: 40px;
// margin-bottom: 20px;
// background-color: skyblue;
// text-align: center;
// color: #ffffff;
// cursor: move;
// }
.table-row-focus {
background: #ebedff;
border: 1px solid #dbdcf0;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
// border: 0.5px solid #dbdcf0;
// box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
@@ -394,13 +602,17 @@ export default {
max-height: 100px;
overflow: auto;
white-space: nowrap;
font-size: 1.1rem;
}
td:hover {
cursor: pointer;
}
th {
padding: 0 0 0 0;
margin: 0;
// padding: 0 0 0;
// margin: 0;
font-size: 1rem;
border: none;
}
div {
@@ -409,4 +621,164 @@ export default {
}
}
.table-row-add-task {
height: 50px;
background: #f4f4f4;
border: 1px dashed #c7c7c7;
border-radius: 5px;
}
.table-row-add-task-text {
font-family: 'Inter-Regular';
font-style: italic;
font-weight: 600;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #c7c7c7;
}
.project-table-header {
position: sticky;
top: 0;
background: white;
font-family: 'Inter-Bold';
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #2c4053;
}
.project-table-text {
font-family: 'Inter-Regular';
font-style: normal;
// font-weight: 400;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #2c4053;
}
.project-table-cell:hover {
opacity: 0.6;
}
.tooltip {
display: block !important;
z-index: 10000;
.tooltip-inner {
// background: red !important;
color: white;
border-radius: 16px;
padding: 5px 10px 4px;
box-shadow: rgba(108, 127, 238, 0.6) 0 2px 3px 0;
background-color: #ebedff !important;
}
.tooltip-arrow {
width: 0;
height: 0;
border-style: solid;
position: absolute;
margin: 5px;
border-color: black;
z-index: 1;
}
&[x-placement^="top"] {
margin-bottom: 5px;
.tooltip-arrow {
border-width: 5px 5px 0 5px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
bottom: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="bottom"] {
margin-top: 5px;
.tooltip-arrow {
border-width: 0 5px 5px 5px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-top-color: transparent !important;
top: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="right"] {
margin-left: 5px;
.tooltip-arrow {
border-width: 5px 5px 5px 0;
border-left-color: transparent !important;
border-top-color: transparent !important;
border-bottom-color: transparent !important;
left: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
&[x-placement^="left"] {
margin-right: 5px;
.tooltip-arrow {
border-width: 5px 0 5px 5px;
border-top-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
right: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
&.popover {
$color: #ebedff;
.popover-inner {
background: $color;
color: black;
padding: 24px;
border-radius: 5px;
box-shadow: 0 5px 30px rgba(black, 0.1);
}
.popover-arrow {
border-color: $color;
}
}
&[aria-hidden='true'] {
visibility: hidden;
opacity: 0;
transition: opacity 0.15s, visibility 0.15s;
}
&[aria-hidden='false'] {
visibility: visible;
opacity: 1;
transition: opacity 0.15s;
}
}
.test {
left: -175px !important;
}
</style>
@@ -137,9 +137,22 @@ export default {
if (this.data !== undefined && this.data.gridSource !== undefined) {
let _xPhysicsQuantity = this.data.gridSource[plotIndex][curveIndex].name.split('_')[0].split('-').at(-1)
let _yPhysicsQuantity = this.data.gridSource[plotIndex][curveIndex].name.split('_')[1].split('-').at(-1)
// console.log('1', _xPhysicsQuantity, _yPhysicsQuantity)
if (!_xPhysicsQuantity.includes('ZReal') && !_xPhysicsQuantity.includes('ZImag')) {
_xPhysicsQuantity = _xPhysicsQuantity.substring(0, 1)
} else {
_xPhysicsQuantity = _xPhysicsQuantity.substring(0, 5)
}
if (!_yPhysicsQuantity.includes('ZReal') && !_yPhysicsQuantity.includes('ZImag')) {
_yPhysicsQuantity = _yPhysicsQuantity.substring(0, 1)
} else {
_yPhysicsQuantity = _yPhysicsQuantity.substring(0, 5)
}
// console.log('2', _xPhysicsQuantity, _yPhysicsQuantity)
// Potential
if (_xPhysicsQuantity === 'P') _xPhysicsQuantity = 'V'
if (_yPhysicsQuantity === 'P') _yPhysicsQuantity = 'V'
// console.log('2', _xPhysicsQuantity, _yPhysicsQuantity)
const [_xAxis, _yAxis] = this.chartRouter.getChartTable(_xPhysicsQuantity, _yPhysicsQuantity)
const _realTime = JSON.parse(JSON.stringify(this.realTime))
const _newCurve = {}
@@ -186,10 +186,9 @@ export default {
} else if (deviceInfo.library_name.includes('Elite')) {
const sourceObj = configTable.getChannelConfig(String(deviceInfo.library_name), deviceInfo.configuration.MODE) // [{id:0 channel:'Current'}, {id:1, channel:'Voltage'}, ]
let channelSet
if (deviceInfo.library_name.includes('EIS') && deviceInfo.configuration.MODE === 0) {
if (deviceInfo.library_name.includes('EIS') && (deviceInfo.configuration.MODE === 0 || deviceInfo.configuration.MODE === 5)) {
channelSet = ['Zimag_Raw', 'Zreal_Raw', 'Frequency', 'Cycle', 'Zimag', 'Zreal', 'Impedance', 'Phase', 'Current', 'Level gain']
} else {
// channelSet = deviceInfo.configuration.CHANNEL_LABEL
channelSet = []
const keys = Object.keys(sourceObj)
for (let i = 0; i < keys.length; i++) {
@@ -263,10 +262,9 @@ export default {
} else if (deviceInfo.library_name.indexOf('Elite') >= 0) {
const sourceObj = configTable.getChannelConfig(String(deviceInfo.library_name), deviceInfo.configuration.MODE) // [{id:0 channel:'Current'}, {id:1, channel:'Voltage'}, ]
let channelSet
if (deviceInfo.library_name.includes('EIS') && deviceInfo.configuration.MODE === 0) {
if (deviceInfo.library_name.includes('EIS') && (deviceInfo.configuration.MODE === 0 || deviceInfo.configuration.MODE === 5)) {
channelSet = ['Zimag_Raw', 'Zreal_Raw', 'Frequency', 'Cycle', 'Zimag', 'Zreal', 'Impedance', 'Phase', 'Current', 'Level gain']
} else {
// channelSet = deviceInfo.configuration.CHANNEL_LABEL
channelSet = []
const keys = Object.keys(sourceObj)
for (let i = 0; i < keys.length; i++) {
@@ -105,6 +105,109 @@ const chartTable = {
},
},
],
T_Impedance: [
// 0
{
default: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
min: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 's',
downloadUnit: 'ms',
},
},
// 1
{
default: {
name: 'Resistance',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
},
],
T_Phase: [
// 0
{
default: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
min: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 's',
downloadUnit: 'ms',
},
},
// 1
{
default: {
name: 'degree',
unit: {
'°': 1e3,
},
defaultUnit: '°',
downloadUnit: '°',
},
},
],
T_Current: [
// 0
// 0
{
default: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
min: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 's',
downloadUnit: 'ms',
},
},
// 1
{
default: {
name: 'Current',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
A: 1e9,
},
defaultUnit: (Mode) => { return (Mode === 10 || Mode === 11) ? 'nA' : 'mA' },
downloadUnit: 'mA',
},
// Q = ∫ I dt
integral: {
name: 'Charge',
unit: {
nAh: 3600 * 1e6,
uAh: 1600 * 1e9,
mAh: 3600 * 1e12,
Ah: 3600 * 1e15,
},
defaultUnit: 'mAh',
downloadUnit: 'mAh',
},
},
],
V_V: [
// 0
{
@@ -264,7 +367,7 @@ const chartTable = {
},
},
],
Zreal_Zimag: [
ZReal_ZImag: [
// 0
{
default: {
@@ -19,11 +19,13 @@
<img :src="device.picture" :alt="device.name">
</va-avatar>
</va-item-section>
<va-item-section class="ml-3" caption>
<!-- <va-button @click="getBattery(device)"> get battery </va-button> -->
<!-- <pre> {{ device.battery }} </pre> -->
<va-item-label v-if="parseInt((device.battery - 2900) / 10) >= 75">
<va-item-label v-if="device.library_name.includes('EIS') || device.library_name.includes('TRIG')">
{{ `[${device.memory_board}]` }} {{ device.name }}
</va-item-label>
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) >= 75">
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-full" color="#5BC236"/> {{ (parseInt((device.battery - 2900) / 10) > 100 ? 100 : parseInt((device.battery - 2900) / 10)) + '%' }}
</va-item-label>
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) >= 50">
@@ -26,8 +26,12 @@
</div>
</div>
<!-- split because of styling problem(treenode), combine together furture -->
<!-- Trigger -->
<div v-if="library && library.includes('TRIG')">
<Trigger :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></Trigger>
</div>
<!-- EIS -->
<div v-if="library.includes('EIS')">
<div v-if="library && library.includes('EIS')">
<component
v-for="name in parameterArrayInMode"
:key="name"
@@ -44,7 +48,7 @@
/>
</div>
<!-- ZM15-PulseSensingMode -->
<div v-else-if="parameter.MODE === 14">
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT')) && parameter.MODE === 14">
<EliteParameterRecordingElitePulseSensing
:parameter="parameter"
:device="device"
@@ -55,7 +59,7 @@
/>
</div>
<!-- ZM15-DPVMode -->
<div v-else-if="parameter.MODE === 15">
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT')) && parameter.MODE === 15">
<EliteParameterRecordingEliteDPV
:parameter="parameter"
:device="device"
@@ -66,7 +70,7 @@
/>
</div>
<!-- ZM15-OtherModes -->
<div v-else>
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT'))">
<va-tree-category
v-for="name in parameterArrayInMode"
:key="name"
@@ -94,7 +98,7 @@
<!-- guide picture button -->
<div>
<vue-final-modal
v-if="library.includes('Elite_EDC')"
v-if="library && library.includes('EDC')"
v-model="showModal"
classes="modal-container"
content-class="modal-content"
@@ -124,6 +128,7 @@ import InputField from '../parameter/itemNew/InputField'
import MultiInputField from '../parameter/itemNew/MultiInputField'
import EliteParameterRecordingEliteDPV from '../parameter/itemNew/DPVNew/EliteParameterRecordingEliteDPV'
import DevMode from '../parameter/itemNew/DevMode'
import Trigger from '../parameter/itemNew/TriggerNew/Trigger'
import EliteParameterRecordingElitePulseSensing from '../parameter/itemNew/PulseSensingNew/EliteParameterRecordingElitePulseSensing'
import { VueFinalModal } from 'vue-final-modal'
import { mapFields } from 'vuex-map-fields'
@@ -141,6 +146,7 @@ export default {
InputField,
MultiInputField,
DevMode,
Trigger,
},
props: {
parameter: {
@@ -148,7 +154,8 @@ export default {
required: true,
},
library: {
type: String,
type: [String, null],
default: null,
},
serialNumber: {
type: [String, Array],
@@ -161,6 +168,10 @@ export default {
type: String,
default: '',
},
resetParameterModeChange: {
type: Boolean,
default: false,
},
},
computed: {
parameterTable () {
@@ -179,7 +190,7 @@ export default {
return null
},
parameterArrayInMode () {
return this.workingModeSelect && this.parameterTable.MODE[this.workingModeSelect.id].parameter
return this.workingModeSelect && this.parameterTable && this.parameterTable.MODE[this.workingModeSelect.id].parameter
},
modeSelection () {
if (this.parameter.MODE) {
@@ -188,7 +199,7 @@ export default {
return this.workingModeSelect.id
},
getImageUrl () {
if (this.workingModeSelect === null) {
if (!this.workingModeSelect) {
return 'IV-Wire'
} else {
return this.workingModeSelect.img_src
@@ -246,12 +257,20 @@ export default {
},
refresh () {
},
workingModeSelectChange (val) {
workingModeSelectChange (val, reset = true) {
if (val === undefined || this.parameter.MODE === undefined) return
this.workingModeSelect = val
console.log('workingModeSelectChange', this.workingModeSelect.id, this.parameter.MODE)
// console.log('workingModeSelectChange', this.workingModeSelect, this.parameter.MODE)
if (this.workingModeSelect.id !== this.parameter.MODE) {
this.parameterChange('MODE', this.workingModeSelect.id)
if (this.resetParameterModeChange === true) {
if (reset === true) {
for (const parameter of this.parameterTable.MODE[this.workingModeSelect.id].parameter) {
this.$emit('setParameter', parameter, this.parameterTable[parameter].defaultValue)
}
}
}
// if device is idle, then setting highz when mode switch
if (this.deviceStatus === true) {
@@ -261,6 +280,11 @@ export default {
}
}
},
resetWorkingMode () {
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
console.log(this.workingModeOptions, this.workingModeSelect)
},
getParameter: function (name) {
this.$emit('getParameter', name)
},
@@ -273,9 +297,11 @@ export default {
// this.developerMode === true
// ? this.workingModeOptions = this.workingModeDevOptions
// : this.workingModeOptions = this.workingModeNoDevOptions
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
// init mode
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
if (this.parameterTable !== null) {
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
// init mode
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
}
},
watch: {
parameter: {
@@ -285,6 +311,13 @@ export default {
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
},
},
library: {
handler: function () {
if (!this.parameterTable) return
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
},
},
},
destroyed () {
},
@@ -12,14 +12,14 @@
</div>
<!-- EIS -->
<div v-if="workingModeSelect != null && workingModeSelect.id == 0">
<d-c-volt :ref="'DCVolt'" :deviceID="deviceID" :parameterName="'DC_BIAS'" @parameterChange="deviceParameterChange($event)" />
<a-c-amplitude :ref="'ACAmplitude'" :deviceID="deviceID" :parameterName="'AC_AMP'" @parameterChange="deviceParameterChange($event)" />
<freq-range :ref="'FreqRange'" :deviceID="deviceID" :parameterName="'FREQ'" @parameterChange="deviceParameterChange($event)" />
<points-per-decades :ref="'PointsPerDecades'" :deviceID="deviceID" :parameterName="'PPD'" @parameterChange="deviceParameterChange($event)" />
<point-spacing :ref="'PointSpacing'" :deviceID="deviceID" :parameterName="'SCALE'" @parameterChange="deviceParameterChange($event)" />
<delay :ref="'Delay'" :deviceID="deviceID" :parameterName="'DELAY'" @parameterChange="deviceParameterChange($event)" />
<average :ref="'Average'" :deviceID="deviceID" :parameterName="'AVERAGE_NUM'" @parameterChange="deviceParameterChange($event)" />
<current-range :ref="'CurrentRange'" :deviceID="deviceID" :parameterName="'RTIA'" @parameterChange="deviceParameterChange($event)" />
<d-c-volt :ref="'DCVolt'" :deviceID="deviceID" :parameterName="'EIS_DC_BIAS'" @parameterChange="deviceParameterChange($event)" />
<a-c-amplitude :ref="'ACAmplitude'" :deviceID="deviceID" :parameterName="'EIS_AC_AMP'" @parameterChange="deviceParameterChange($event)" />
<freq-range :ref="'FreqRange'" :deviceID="deviceID" :parameterName="'EIS_FREQ'" @parameterChange="deviceParameterChange($event)" />
<points-per-decades :ref="'PointsPerDecades'" :deviceID="deviceID" :parameterName="'EIS_PPD'" @parameterChange="deviceParameterChange($event)" />
<point-spacing :ref="'PointSpacing'" :deviceID="deviceID" :parameterName="'EIS_SCALE'" @parameterChange="deviceParameterChange($event)" />
<delay :ref="'Delay'" :deviceID="deviceID" :parameterName="'EIS_DELAY'" @parameterChange="deviceParameterChange($event)" />
<average :ref="'Average'" :deviceID="deviceID" :parameterName="'EIS_AVERAGE_NUM'" @parameterChange="deviceParameterChange($event)" />
<current-range :ref="'CurrentRange'" :deviceID="deviceID" :parameterName="'GENERAL_HS_RTIA'" @parameterChange="deviceParameterChange($event)" />
</div>
<!-- CV -->
<div v-if="workingModeSelect != null && workingModeSelect.id == 1">
@@ -45,14 +45,6 @@
<level-button :ref="'currentRangeSelect'" :deviceID="deviceID" :options="currentRangeOptions" :parameterName="'ADC_LEVEL_I_15'" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
<p class="display-6">Voltage Range<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<level-button :ref="'voltageInRangeSelect'" :deviceID="deviceID" :options="voltageInRangeOptions" :parameterName="'ADC_LEVEL_V_IN_15'" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
<p class="display-6">High Z<p/>
@@ -66,7 +58,7 @@
<p class="display-6">E Initial<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltInitialNumber'" :deviceID="deviceID" :parameterName="'VOLT_INITIAL'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltInitialNumber'" :deviceID="deviceID" :parameterName="'CV_E_INITIAL'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -74,7 +66,7 @@
<p class="display-6">E1<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltMaxNumber'" :deviceID="deviceID" :parameterName="'VOLT_MAX'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltMaxNumber'" :deviceID="deviceID" :parameterName="'CV_E1'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -82,7 +74,7 @@
<p class="display-6">E2<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<volt-range :ref="'voltMinNumber'" :deviceID="deviceID" :parameterName="'VOLT_MIN'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
<volt-range :ref="'voltMinNumber'" :deviceID="deviceID" :parameterName="'CV_E2'" :minValue="-1.8" :maxValue="2" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -90,7 +82,7 @@
<p class="display-6">Voltage Scan Rate<p/>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-1" >
<scan-rate-range :ref="'voltScanRateNumber'" :deviceID="deviceID" :parameterName="'Scan_Rate'" :minValue="0.01" :maxValue="1000" @parameterChange="deviceParameterChange($event)" />
<scan-rate-range :ref="'voltScanRateNumber'" :deviceID="deviceID" :parameterName="'CV_SCAN_RATE'" :minValue="0.01" :maxValue="1000" @parameterChange="deviceParameterChange($event)" />
</div>
</div>
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12 align--center">
@@ -283,7 +275,7 @@ export default {
},
],
DCVolt: null,
AC_AMP: null,
EIS_AC_AMP: null,
FreqStart: null,
FreqStop: null,
PointsPerDecades: null,
@@ -395,45 +387,36 @@ export default {
this.measureEocButton.status = false
},
refresh () {
// taskInfo.getDeviceInfo(this.deviceID).parameterSet.CHANNEL_LABEL = ['Z_image_Raw', 'Z_Real_Raw', 'Frequency', 'Cycle', 'Z_imag', 'Z_real', 'Impedance', 'Phase', 'Current', 'Level gain']
this.workingModeSelect = this.workingModeOptions[taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE]
if (this.workingModeSelect != null) {
this.workingModeSelectChange(this.workingModeSelect)
}
this.ACAmplitude = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.AC_AMP) / 2047 * 800))
this.ACAmplitude = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_AC_AMP) / 2047 * 800))
if (this.$refs.ACAmplitude != null) {
this.$refs.ACAmplitude.itemChange(this.ACAmplitude)
}
this.Average = taskInfo.getDeviceInfo(this.deviceID).parameterSet.AVERAGE_NUM
this.Average = taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_AVERAGE_NUM
if (this.$refs.Average != null) {
this.$refs.Average.itemChange(this.Average)
}
this.CurrentRange = taskInfo.getDeviceInfo(this.deviceID).parameterSet.RTIA
this.CurrentRange = taskInfo.getDeviceInfo(this.deviceID).parameterSet.GENERAL_HS_RTIA
if (this.$refs.CurrentRange != null) {
this.$refs.CurrentRange.itemChange(this.CurrentRange)
}
this.PointSpacing = taskInfo.getDeviceInfo(this.deviceID).parameterSet.SCALE
this.PointSpacing = taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_SCALE
if (this.$refs.PointSpacing != null) {
this.$refs.PointSpacing.itemChange(this.PointSpacing)
}
this.DCVolt = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.DC_BIAS - 15000) / 10
this.DCVolt = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_DC_BIAS - 15000) / 10
if (this.$refs.DCVolt != null) {
this.$refs.DCVolt.itemChange(this.DCVolt)
}
this.Delay = String(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.DELAY) / 10).toFixed(1))
this.Delay = String(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_DELAY) / 10).toFixed(1))
if (this.$refs.Delay != null) {
this.$refs.Delay.itemChange(this.Delay)
}
this.FreqStart = String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_START * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_START * 0.0149) * 100)) / 100).toFixed(1))
if (this.$refs.FreqRange != null) {
this.$refs.FreqRange.itemChangeMax(this.FreqStart)
}
this.FreqStop = String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_STOP * 0.0149) * 100)) / 100).toFixed(1)) === '0.0' ? '0.015' : String(parseFloat(Math.round(parseFloat((taskInfo.getDeviceInfo(this.deviceID).parameterSet.FREQ_STOP * 0.0149) * 100)) / 100).toFixed(1))
if (this.$refs.FreqRange != null) {
this.$refs.FreqRange.itemChangeMin(this.FreqStop)
}
this.PointsPerDecades = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.PPD)))
this.PointsPerDecades = String(Math.round((taskInfo.getDeviceInfo(this.deviceID).parameterSet.EIS_PPD)))
if (this.$refs.PointsPerDecades != null) {
this.$refs.PointsPerDecades.itemChange(this.PointsPerDecades)
}
@@ -444,11 +427,6 @@ export default {
this.$refs.currentRangeSelect.updateLevelButton(this.currentRangeSelect)
}
this.voltageInRangeSelect = taskInfo.getDeviceInfo(this.deviceID).parameterSet.ADC_LEVEL_V_IN_15
if (this.$refs.voltageInRangeSelect != null) {
this.$refs.voltageInRangeSelect.updateLevelButton(this.voltageInRangeSelect)
}
this.highzSelect = taskInfo.getDeviceInfo(this.deviceID).parameterSet.CTRL_HIGH_Z_15
if (this.$refs.highzSelect != null) {
this.$refs.highzSelect.updateLevelButton(this.highzSelect)
@@ -464,12 +442,12 @@ export default {
this.$refs.stopVoltMinNumber.updateVoltNumber(this.stopVoltMinNumber)
}
this.voltInitialNumber = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.VOLT_INITIAL - 25000) / 5
this.voltInitialNumber = (taskInfo.getDeviceInfo(this.deviceID).parameterSet.CV_E_INITIAL - 25000) / 5
if (this.$refs.voltInitialNumber != null) {
this.$refs.voltInitialNumber.updateVoltNumber(this.voltInitialNumber)
}
this.voltScanRateNumber = taskInfo.getDeviceInfo(this.deviceID).parameterSet.Scan_Rate
this.voltScanRateNumber = taskInfo.getDeviceInfo(this.deviceID).parameterSet.CV_SCAN_RATE
if (this.$refs.voltScanRateNumber != null) {
this.$refs.voltScanRateNumber.updateVoltScanRateNumber(this.voltScanRateNumber)
}
@@ -0,0 +1,152 @@
<template>
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
<div class="row">
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
<p class="display-6"> CHANNEL {{ Number(channel) + 1 }} <p/>
</div>
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-0 py-0">
<va-input
class="mb-0 small-va-input"
v-model="inputStringText"
:disabled="!channelToggle"
@keyup.enter="inputChange(inputString)"
@blur="inputChange(inputString)"
>
<p slot="append" style="margin-right: 0;" small>
mA
</p>
</va-input>
</div>
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-0 py-0">
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
</div>
</div>
<div class="sm11 xl12 md12 xs12 my-1 py-1">
<va-slider
pins
:min="outputReadabilityData(range.min)"
:max="outputReadabilityData(range.max)"
value-visible
:step="10"
:color="toggle === true ? 'primary' : 'gray'"
:disabled="!toggle"
v-model="inputSlider"
/>
</div>
</div>
</template>
<script>
export default {
name: 'ChannelBlock',
components: {
},
computed: {
toggle: {
get () {
return Boolean(this.inputValue[this.toggleName])
},
set (val) {
this.channelToggle = val
},
},
inputStringText: {
get () {
return String(this.outputReadabilityData(this.inputValue[this.parameterName]))
},
set (val) {
this.inputString = val
},
},
inputSlider: {
get () {
return this.outputReadabilityData(this.inputValue[this.parameterName])
},
set (val) {
this.inputChange(val)
},
},
},
props: {
inputValue: {
type: Object,
},
channel: {
type: Number,
required: true,
},
parameterName: {
type: String,
required: true,
},
toggleName: {
type: String,
required: true,
},
range: {
type: Object,
},
defaultUnit: {
type: String,
},
unit: {
type: Object,
},
outputReadabilityData: {
type: Function,
default: (val) => val,
},
outputRawData: {
type: Function,
default: (val) => val,
},
},
created () {
},
data () {
return {
inputString: '',
channelToggle: false,
}
},
mqtt: {
},
methods: {
inputChange (val) {
// if change from input field
if (typeof (val) === 'string') {
if (isNaN(val) || val === '') {
return false
}
val = this.outputRawData(val)
if (parseFloat(val) < this.range.min) {
val = this.range.min
} else if (parseFloat(val) > this.range.max) {
val = this.range.max
}
} else if (typeof (val) === 'number') {
val = this.outputRawData(val)
}
this.$emit('parameterChange', this.parameterName, val, true)
},
switchToggle () {
this.$emit('parameterChange', this.toggleName, this.channelToggle)
},
},
}
</script>
<style lang="scss">
.small-va-input {
.va-input {
&__container {
min-height: 1rem;
}
&__container__input {
margin-bottom: 0.001rem;
padding: 0.8rem 0.5rem;
}
}
}
</style>
@@ -0,0 +1,149 @@
<template>
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
<div class="row">
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
<p class="display-6 my-2"> Timer <p/>
</div>
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-2 py-0">
<va-input
class="mb-0 small-va-input"
v-model="inputStringText"
:disabled="!toggle"
@keyup.enter="inputChange(inputString)"
@blur="inputChange(inputString)"
>
<p slot="append" style="margin-right: 0;" small>
s
</p>
</va-input>
</div>
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-2 py-0">
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
</div>
</div>
<!-- <div class="sm11 xl12 md12 xs12 my-1 py-1">
<va-slider
pins
:min="outputReadabilityData(range.min)"
:max="outputReadabilityData(range.max)"
value-visible
:step="10"
:color="timerToggle === true ? 'primary' : 'gray'"
:disabled="!timerToggle"
v-model="inputSlider"
/>
</div> -->
</div>
</template>
<script>
export default {
name: 'TimerBlock',
components: {
},
computed: {
inputStringText: {
get () {
return String(this.outputReadabilityData(this.inputValue[this.parameterName]))
},
set (val) {
this.inputString = val
},
},
inputSlider: {
get () {
return this.outputReadabilityData(this.inputValue[this.parameterName])
},
set (val) {
this.inputChange(val)
},
},
toggle: {
get () {
return !(this.inputValue[this.parameterName] === 0)
},
set (val) {
this.timerToggle = val
},
},
},
props: {
inputValue: {
type: Object,
},
parameterName: {
type: String,
required: true,
},
range: {
type: Object,
},
defaultUnit: {
type: String,
},
unit: {
type: Object,
},
outputReadabilityData: {
type: Function,
default: (val) => val,
},
outputRawData: {
type: Function,
default: (val) => val,
},
},
created () {
},
data () {
return {
inputString: '',
timerToggle: false,
}
},
mqtt: {
},
methods: {
inputChange (val) {
// if change from input field
if (typeof (val) === 'string') {
if (isNaN(val) || val === '') {
return false
}
val = this.outputRawData(val)
if (parseFloat(val) < this.range.min) {
val = this.range.min
} else if (parseFloat(val) > this.range.max) {
val = this.range.max
}
} else if (typeof (val) === 'number') {
val = this.outputRawData(val)
}
this.$emit('parameterChange', this.parameterName, val, true)
},
switchToggle () {
if (this.timerToggle === true) {
this.$emit('parameterChange', this.parameterName, 1)
}
if (this.timerToggle === false) {
this.$emit('parameterChange', this.parameterName, 0)
}
},
},
}
</script>
<style lang="scss">
.small-va-input {
.va-input {
&__container {
min-height: 1rem;
}
&__container__input {
margin-bottom: 0.001rem;
padding: 0.8rem 0.5rem;
}
}
}
</style>
@@ -0,0 +1,108 @@
<template>
<div>
<div v-if="parameter.MODE === 0">
<div v-for="channel in channelList" :key="channel">
<ChannelBlock
:channel="channel"
:inputValue="parameter"
:parameterName="channelBlockCurrent(channel)"
:toggleName="channelBlockToggle(channel)"
v-bind="parameterTable[channelBlockCurrent(channel)]"
@parameterChange="parameterChange"
></ChannelBlock>
</div>
<div class="row px-0 mx-0">
<p class="my-2 mr-2 display-5"> ADVANCED SETTING </p>
<!-- <va-toggle class="mb-0" flat small color="success" v-model="openAdvanced"/> -->
</div>
<div>
<TimerBlock
:inputValue="parameter"
:parameterName="'TIME_DURATION'"
v-bind="parameterTable.TIME_DURATION"
@parameterChange="parameterChange"
></TimerBlock>
</div>
<div>
<div v-for="triggerIndex in triggerList" :key="'trigger_' + triggerIndex">
<TriggerBlock
:triggerIndex="triggerIndex"
:inputValue="parameter"
:parameterName="triggerBlockType(triggerIndex)"
:toggleName="triggerBlockEnable(triggerIndex)"
v-bind="parameterTable[triggerBlockType()]"
@parameterChange="parameterChange"
></TriggerBlock>
</div>
</div>
</div>
</div>
</template>
<script>
import ChannelBlock from './ChannelBlock.vue'
import TriggerBlock from './TriggerBlock.vue'
import TimerBlock from './TimerBlock.vue'
export default {
name: 'Trigger',
components: {
ChannelBlock,
TriggerBlock,
TimerBlock,
},
computed: {
},
props: {
parameter: {
type: Object,
default: () => {},
},
parameterTable: {
type: Object,
default: () => {},
},
},
data () {
return {
channelList: [0, 1, 2, 3],
triggerList: [0, 1],
openAdvanced: Boolean(this.parameter.TRIG0_en || this.parameter.TRIG1_en),
}
},
methods: {
channelBlockToggle (channelIndex) {
let name = 'ACC_a_out'
if (channelIndex !== undefined) {
name += channelIndex
}
return name
},
channelBlockCurrent (channelIndex) {
let name = 'ACC_a_out'
if (channelIndex !== undefined) {
name += channelIndex
}
name += '_current'
return name
},
triggerBlockEnable (triggerIndex) {
let name = 'TRIG'
if (triggerIndex !== undefined) {
name += triggerIndex
}
name += '_en'
return name
},
triggerBlockType (triggerIndex) {
let name = 'TRIG'
if (triggerIndex !== undefined) {
name += triggerIndex
}
name += '_edge_type'
return name
},
parameterChange: function (name, value, debounce) {
this.$emit('parameterChange', name, value, debounce)
},
},
}
</script>
@@ -0,0 +1,101 @@
<template>
<div class="row flex sm12 xl12 md12 xs12 ma-0 pa-0">
<div class="d-flex sm12 xl12 md12 xs12 my-0 py-0">
<div class="flex sm8 xl8 md8 xs8 my-1 py-0">
<p class="display-6 my-2"> TRIGGER IN {{ triggerIndex + 1 }} <p/>
</div>
<div class="flex sm4 xl4 md4 xs4 ma-0 pa-0 my-2">
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
</div>
</div>
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
<va-radio-button
v-for="(option, index) in optionTrigger"
:key="index"
style="float: left;"
v-model="selectTrigger"
:option="optionTrigger[index]"
:label="optionTrigger[index]"
:disabled="!toggle"
@click.native.stop="inputChange(index)"
/>
</div>
</div>
</template>
<script>
export default {
name: 'TriggerBlock',
components: {
},
props: {
triggerIndex: {
type: Number,
required: true,
},
inputValue: {
type: Object,
},
parameterName: {
type: String,
required: true,
},
toggleName: {
type: String,
required: true,
},
range: {
type: Object,
},
defaultUnit: {
type: String,
},
unit: {
type: Object,
},
outputReadabilityData: {
type: Function,
default: (val) => val,
},
outputRawData: {
type: Function,
default: (val) => val,
},
},
computed: {
toggle: {
get () {
return Boolean(this.inputValue[this.toggleName])
},
set (val) {
this.triggerToggle = val
},
},
},
created () {
},
data () {
return {
selectTrigger: 'RISING',
optionTrigger: [
'RISING',
'FALLING',
'BOTH',
],
triggerToggle: false,
}
},
methods: {
inputChange (val) {
this.$emit('parameterChange', this.parameterName, val)
},
switchToggle () {
this.$emit('parameterChange', this.toggleName, this.triggerToggle)
},
},
mounted () {
this.selectTrigger = this.optionTrigger[this.inputValue[this.parameterName]]
this.triggerToggle = Boolean(this.inputValue[this.toggleName])
},
}
</script>
+22
View File
@@ -0,0 +1,22 @@
export default {
name: 'Idle',
parameter: [], // 這個mode用到的參數
showParameter: [], // 有要秀給user看的參數
headerParameter: () => [], // export header的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: {
},
charts: {
},
}
@@ -1,8 +1,8 @@
export default {
name: 'Chronoamperometry',
parameter: ['VOLT_VSCAN', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'VOLT_VSCAN', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['VOLT_VSCAN', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 有要秀給user看的參數
parameter: ['CA_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'CA_VOLT', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['CA_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
+18 -10
View File
@@ -1,3 +1,4 @@
import Idle from '../Common/Idle'
import IV from './IV'
import CycleIV from './CycleIV'
import FunctionGenerator from './FunctionGenerator'
@@ -98,20 +99,20 @@ const EliteZM15 = {
showName: 'Current range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '<4 μA' },
{ value: 1, label: '2.5-100 μA' },
{ value: 2, label: '85-2050 μA' },
{ value: 0, label: '<4 uA' },
{ value: 1, label: '2.5-100 uA' },
{ value: 2, label: '85-2050 uA' },
{ value: 3, label: '1800 uA' },
{ value: 4, label: 'Auto' },
],
range: ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto'],
range: ['<4 uA', '2.5-100 uA', '85-2050 uA', '1800 uA', 'Auto'],
defaultValue: 4,
outputRawData: (val) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
const currentRangeArr = ['<4 uA', '2.5-100 uA', '85-2050 uA', '1800 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const currentRangeArr = ['<4 μA', '2.5-100 μA', '85-2050 μA', '1800 uA', 'Auto']
const currentRangeArr = ['<4 uA', '2.5-100 uA', '85-2050 uA', '1800 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
@@ -392,10 +393,10 @@ const EliteZM15 = {
componentType: 'input-range',
range: Object.freeze({ min: 0, max: 1500000 }),
defaultValue: 0,
defaultUnit: 'μA',
downloadUnit: 'mA',
defaultUnit: 'uA',
downloadUnit: 'uA',
unit: {
μA: 1,
uA: 1,
mA: 1e3,
},
outputRawData: (val) => {
@@ -519,7 +520,7 @@ const EliteZM15 = {
return parseInt((parseFloat(val) - 25000) / 5) / scale
},
},
VOLT_VSCAN: {
CA_VOLT: {
type: 'number',
showName: 'Volt (v.s. ref)',
componentType: 'input-range',
@@ -952,6 +953,12 @@ const EliteZM15 = {
},
MODE_OPTIONS: [
{
id: 17,
description: 'Idle',
img_src: 'IV-Wire',
highz: 1,
},
{
id: 0,
description: 'I-V Curve',
@@ -1070,6 +1077,7 @@ const EliteZM15 = {
14: PulseSensing,
15: DPV,
16: Chronopotentiometry,
17: Idle,
},
}
@@ -1,8 +1,8 @@
export default {
name: 'Chronoamperometry',
parameter: ['VOLT_VSCAN', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'VOLT_VSCAN', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['VOLT_VSCAN', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 有要秀給user看的參數
parameter: ['CA_VOLT', 'SAMPLE_RATE', 'GENERAL_LP_RTIA', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['GENERAL_LP_RTIA', 'CTRL_HIGH_Z_15', 'CA_VOLT', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['CA_VOLT', 'SAMPLE_RATE', 'GENERAL_LP_RTIA', 'TIME_DURATION'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
@@ -0,0 +1,246 @@
export default {
name: 'Constant Frequency',
parameter: ['CF_DC_BIAS', 'CF_AC_AMP', 'CF_FREQ', 'CF_PPD', 'CF_SCALE', 'CF_DELAY', 'CF_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 這個mode用到的參數
showParameter: ['CF_DC_BIAS', 'CF_AC_AMP', 'CF_FREQ', 'CF_PPD', 'CF_SCALE', 'CF_DELAY', 'CF_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 有要秀給user看的參數
headerParameter: () => ['CF_DC_BIAS', 'CF_AC_AMP', 'CF_FREQ', 'CF_PPD', 'CF_SCALE', 'CF_DELAY', 'CF_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
downloadUnit: 'ms',
},
0: {
name: 'Z_Imag_Raw',
unit: {
ohm: 1,
},
downloadUnit: 'ohm',
defaultUnit: 'ohm',
},
1: {
name: 'Z_Real_Raw',
unit: {
default: 1,
},
downloadUnit: 'ohm',
defaultUnit: 'ohm',
},
2: {
name: 'Frequency',
unit: {
mHz: 1,
Hz: 1e3,
kHz: 1e6,
},
downloadUnit: 'mHz',
defaultUnit: 'mHz',
},
// 3: {
// name: 'Cycle',
// unit: {
// cycle: 1,
// },
// defaultUnit: 'cycle',
// downloadUnit: null,
// },
4: {
name: 'Z_Imag',
unit: {
mohm: 1e-3,
: 1e-3,
ohm: 1,
Ω: 1,
kohm: 1e3,
: 1e3,
Mohm: 1e6,
: 1e6,
},
downloadUnit: 'ohm',
defaultUnit: 'Ω',
},
5: {
name: 'Z_Real',
unit: {
mohm: 1e-3,
: 1e-3,
ohm: 1,
Ω: 1,
kohm: 1e3,
: 1e3,
Mohm: 1e6,
: 1e6,
},
downloadUnit: 'ohm',
defaultUnit: 'Ω',
},
6: {
name: 'Impedance',
unit: {
mohm: 1e-3,
: 1e-3,
ohm: 1,
Ω: 1,
kohm: 1e3,
: 1e3,
Mohm: 1e6,
: 1e6,
},
downloadUnit: 'ohm',
defaultUnit: 'Ω',
},
7: {
name: 'Phase',
unit: {
millidegree: 1,
'°': 1e3,
},
downloadUnit: 'millidegree',
defaultUnit: '°',
},
8: {
name: 'Current',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
downloadUnit: 'nA',
defaultUnit: 'nA',
},
9: {
name: 'Level gain',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
10: {
name: 'notify_one',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
11: {
name: 'notify_two',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
12: {
name: 'notify_three',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
13: {
name: 'debug_amp[mV]',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
},
charts: {
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,
},
},
],
},
],
},
],
},
}
@@ -1,8 +1,8 @@
export default {
name: 'Cyclic Voltammetry',
parameter: ['VOLT_INITIAL', 'VOLT_MAX', 'VOLT_MIN', 'Scan_Rate', 'SAMPLE_RATE', 'CYCLE_NUMBER', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'VOLT_INITIAL', 'VOLT_MAX', 'VOLT_MIN', 'Scan_Rate', 'SAMPLE_RATE', 'CYCLE_NUMBER'], // 有要秀給user看的參數
headerParameter: () => ['VOLT_INITIAL', 'VOLT_MAX', 'VOLT_MIN', 'Scan_Rate', 'SAMPLE_RATE', 'CYCLE_NUMBER', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // 有要秀給user看的參數
parameter: ['CV_E_INITIAL', 'CV_E1', 'CV_E2', 'CV_SCAN_RATE', 'SAMPLE_RATE', 'CYCLE_NUMBER', 'GENERAL_LP_RTIA'], // 這個mode用到的參數
showParameter: ['GENERAL_LP_RTIA', 'CTRL_HIGH_Z_15', 'CV_E_INITIAL', 'CV_E1', 'CV_E2', 'CV_SCAN_RATE', 'SAMPLE_RATE', 'CYCLE_NUMBER'], // 有要秀給user看的參數
headerParameter: () => ['CV_E_INITIAL', 'CV_E1', 'CV_E2', 'CV_SCAN_RATE', 'SAMPLE_RATE', 'CYCLE_NUMBER', 'GENERAL_LP_RTIA'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
@@ -1,9 +1,8 @@
export default {
name: 'Potentiostatic Electrochemical Impedance Spectroscopy',
parameter: ['DC_BIAS', 'AC_AMP', 'FREQ', 'PPD', 'SCALE', 'DELAY', 'AVERAGE_NUM', 'RTIA'],
// parameter: ['DC_BIAS', 'AC_AMP', 'FREQ_START', 'FREQ_STOP', 'PPD', 'SCALE', 'DELAY', 'AVERAGE_NUM', 'RTIA'], // 這個mode用到的參數
showParameter: ['DC_BIAS', 'AC_AMP', 'FREQ_START', 'FREQ_STOP', 'PPD', 'SCALE', 'DELAY', 'AVERAGE_NUM', 'RTIA'], // 有要秀給user看的參數
headerParameter: () => ['DC_BIAS', 'AC_AMP', 'FREQ_START', 'FREQ_STOP', 'PPD', 'SCALE', 'DELAY', 'AVERAGE_NUM', 'RTIA'], // 有要秀給user看的參數
name: 'EIS',
parameter: ['EIS_DC_BIAS', 'EIS_AC_AMP', 'EIS_FREQ', 'EIS_PPD', 'EIS_SCALE', 'EIS_DELAY', 'EIS_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 這個mode用到的參數
showParameter: ['EIS_DC_BIAS', 'EIS_AC_AMP', 'EIS_FREQ', 'EIS_PPD', 'EIS_SCALE', 'EIS_DELAY', 'EIS_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 有要秀給user看的參數
headerParameter: () => ['EIS_DC_BIAS', 'EIS_AC_AMP', 'EIS_FREQ', 'EIS_PPD', 'EIS_SCALE', 'EIS_DELAY', 'EIS_AVERAGE_NUM', 'GENERAL_HS_RTIA'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
@@ -31,7 +30,7 @@ export default {
downloadUnit: 'ms',
},
0: {
name: 'Z_imag_Raw',
name: 'Z_Imag_Raw',
unit: {
ohm: 1,
},
@@ -65,7 +64,7 @@ export default {
// downloadUnit: null,
// },
4: {
name: 'Z_imag',
name: 'Z_Imag',
unit: {
mohm: 1e-3,
: 1e-3,
@@ -80,7 +79,7 @@ export default {
defaultUnit: 'Ω',
},
5: {
name: 'Z_real',
name: 'Z_Real',
unit: {
mohm: 1e-3,
: 1e-3,
@@ -112,9 +111,10 @@ export default {
7: {
name: 'Phase',
unit: {
'°': 1,
millidegree: 1,
'°': 1e3,
},
downloadUnit: null,
downloadUnit: 'millidegree',
defaultUnit: '°',
},
8: {
@@ -135,6 +135,40 @@ export default {
downloadUnit: null,
defaultUnit: 'default',
},
10: {
name: 'notify_one',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
11: {
name: 'notify_two',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
12: {
name: 'notify_three',
unit: {
default: 1,
},
downloadUnit: null,
defaultUnit: 'default',
},
13: {
name: 'debug_amp[mV]',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
charts: {
default: [
+102
View File
@@ -0,0 +1,102 @@
export default {
name: 'R-T Graph',
parameter: ['RT_VOLT_SET', 'SAMPLE_RATE', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['RT_VOLT_SET', 'SAMPLE_RATE', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['RT_VOLT_SET', 'SAMPLE_RATE', 'GENERAL_LP_RTIA', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
2: {
name: 'Resistor',
unit: {
: 1,
mohm: 1,
Ω: 1e3,
ohm: 1e3,
: 1e6,
kohm: 1e6,
: 1e9,
Mohm: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'ohm',
},
},
charts: {
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,
},
},
],
},
],
},
],
},
}
+87
View File
@@ -0,0 +1,87 @@
export default {
name: 'V-T Graph',
parameter: ['SAMPLE_RATE', 'VT_MEASURE_VIN_RANGE', 'GENERAL_LP_RTIA', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['SAMPLE_RATE', 'VT_MEASURE_VIN_RANGE', 'GENERAL_LP_RTIA', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['SAMPLE_RATE', 'VT_MEASURE_VIN_RANGE', 'GENERAL_LP_RTIA', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: {
time: {
name: 'Time',
unit: {
us: 1,
ms: 1e3,
s: 1e6,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
name: 'I_in',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
name: 'V_in',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
charts: {
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,
},
},
],
},
],
},
],
},
}
+490 -330
View File
@@ -2,249 +2,12 @@ import PotentiostaticEIS from './PotentiostaticEIS'
import CyclicVoltammetry from './CyclicVoltammetry'
import DevMode from './DevMode'
import Chronoamperometry from './Chronoamperometry'
import VT from './VT'
import RT from './RT'
import ConstantFrequency from './ConstantFrequency'
import Idle from '../Common/Idle'
const EliteEIS = {
VOLT_VSCAN: {
type: 'number',
showName: 'Volt (v.s. ref)',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
ADC_VALUE_I: {
type: 'none',
showName: 'Instruction',
componentType: 'dev-mode',
},
DC_BIAS: {
type: 'number',
showName: 'DC Volt',
componentType: 'input-field',
range: Object.freeze({ min: 2500, max: 50000 }), // UI上能輸入的最大最小值
outputRawData: (val, scale = 1) => {
return Math.round((parseInt(val) * 12.5 * scale) + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val - 25000) / 12.5) / scale
},
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
AC_AMP: {
type: 'number',
showName: 'AC Amp',
componentType: 'input-field',
range: Object.freeze({ min: 0, max: 2047 }),
outputRawData: (val, scale = 1) => {
return Math.round(parseInt(val * scale) / 800 * 2047)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val) / 2047 * 800) / scale
},
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
},
},
FREQ: {
type: 'array',
showName: 'Frequency',
componentType: 'multi-input-field',
range: Object.freeze({ min: 1, max: 4294967296 }),
outputRawData: (val) => {
return parseFloat(val) < 0.1 ? Math.round(0.1 / 0.015) : Math.round(parseFloat(val) / 0.015)
},
outputReadabilityData: (val) => {
return (parseFloat(val) * 0.015).toFixed(1)
},
defaultUnit: 'Hz',
downloadUnit: 'Hz',
unit: {
Hz: 1,
},
},
FREQ_START: {
type: 'number',
showName: 'Freq max',
range: Object.freeze({ min: 0.015, max: 200000 }),
outputRawData: (val) => {
return parseFloat(val) < 0.1 ? 1 : Math.round(parseFloat(val) / 0.0149)
},
outputReadabilityData: (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',
downloadUnit: 'Hz',
unit: {
Hz: 1,
},
},
FREQ_STOP: {
type: 'number',
showName: 'Freq min',
range: Object.freeze({ min: 0.015, max: 200000 }),
outputRawData: (val) => {
return parseFloat(val) < 0.1 ? 1 : Math.round(parseFloat(val) / 0.0149)
},
outputReadabilityData: (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',
downloadUnit: 'Hz',
unit: {
Hz: 1,
},
},
PPD: {
type: 'number',
showName: 'Points per decades',
componentType: 'input-field',
range: Object.freeze({ min: 1, max: 10 }),
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
SCALE: {
type: 'array',
showName: 'Point spacing',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: 'Logarithm' },
{ value: 1, label: 'Linear' },
],
range: ['Logarithm', 'Linear'],
outputRawData: (val) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr[parseInt(idx)]
},
},
DELAY: {
type: 'number',
showName: 'DELAY',
componentType: 'input-field',
range: Object.freeze({ min: 1, max: 100 }),
outputRawData: (val) => {
return parseInt(parseFloat(val) * 10)
},
outputReadabilityData: (val) => {
return parseFloat((val / 10)).toFixed(1)
},
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
AVERAGE_NUM: {
type: 'array',
showName: 'Average',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '2' },
{ value: 1, label: '4' },
{ value: 2, label: '6' },
{ value: 3, label: '8' },
],
range: ['2', '4', '6', '8'],
outputRawData: (val) => {
const numArr = ['2', '4', '6', '8']
return numArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const numArr = ['2', '4', '6', '8']
return numArr[parseInt(idx)]
},
},
RTIA: {
type: 'array',
showName: 'Current range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '1' },
{ value: 1, label: '2' },
{ value: 2, label: '3' },
{ value: 3, label: '4' },
{ value: 4, label: 'Auto' },
],
range: ['1', '2', '3', '4', 'Auto'],
outputRawData: (val) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr[parseInt(idx)]
},
},
ADC_LEVEL_I_15: {
type: 'array',
showName: 'Current Range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '<1.5 uA' },
{ value: 1, label: '1-60 uA' },
{ value: 2, label: '40-175 uA' },
{ value: 3, label: '>120 uA' },
{ value: 4, label: 'Auto' },
],
range: ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto'],
outputRawData: (val) => {
const currentRangeArr = ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const currentRangeArr = ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
ADC_LEVEL_V_IN_15: {
type: 'array',
showName: 'Voltage Range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '1' },
{ value: 1, label: '2' },
{ value: 2, label: '3' },
{ value: 3, label: 'Auto' },
],
range: ['1', '2', '3', 'Auto'],
outputRawData: (val) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
TIME_DURATION: {
type: 'number',
showName: 'Time duration',
@@ -275,6 +38,7 @@ const EliteEIS = {
{ value: 1, label: 'Off' },
],
range: ['On', 'Off'],
defaultValue: 1,
outputRawData: (val) => {
const highzArr = ['On', 'Off']
return highzArr.indexOf(val.toString())
@@ -284,94 +48,6 @@ const EliteEIS = {
return highzArr[parseInt(idx)]
},
},
VOLT_INITIAL: {
type: 'number',
showName: 'E-Initial',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
VOLT_MAX: {
type: 'number',
showName: 'E1',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
VOLT_MIN: {
type: 'number',
showName: 'E2',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
Scan_Rate: {
type: 'number',
showName: 'ScanRate',
componentType: 'input-range',
range: Object.freeze({ min: 1, max: 100000 }),
outputRawData: (val) => {
return parseInt(parseFloat(val) * 100)
},
outputReadabilityData: (val) => {
return parseFloat(val) / 100
},
defaultUnit: 'mV/s',
downloadUnit: 'mV/s',
unit: {
'mV/s': 1,
},
},
SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
componentType: 'input-range',
range: Object.freeze({ min: 1, max: 1000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * 10)
},
outputReadabilityData: (val, scale = 1) => {
return parseFloat(val) / 10
},
defaultUnit: 'sps',
downloadUnit: 'sps',
unit: {
sps: 1,
},
},
CYCLE_NUMBER: {
type: 'number',
showName: 'Cycle',
@@ -383,14 +59,482 @@ const EliteEIS = {
outputReadabilityData: (val) => {
return parseInt(val)
},
defaultValue: 1,
defaultUnit: 'cycle',
downloadUnit: null,
unit: {
cycle: 1,
},
},
SAMPLE_RATE: {
type: 'number',
showName: 'Sample rate',
componentType: 'input-range',
range: Object.freeze({ min: 1, max: 1000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * 10)
},
outputReadabilityData: (val, scale = 1) => {
return parseFloat(val) / 10
},
defaultValue: 1000,
defaultUnit: 'sps',
downloadUnit: 'sps',
unit: {
sps: 1,
},
},
GENERAL_HS_RTIA: {
type: 'array',
showName: 'Current range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '1' },
{ value: 1, label: '2' },
{ value: 2, label: '3' },
{ value: 3, label: '4' },
{ value: 4, label: 'Auto' },
],
range: ['1', '2', '3', '4', 'Auto'],
defaultValue: 4,
outputRawData: (val) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const numArr = ['1', '2', '3', '4', 'Auto']
return numArr[parseInt(idx)]
},
},
GENERAL_LP_RTIA: {
type: 'array',
showName: 'Current Range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '<1.5 uA' },
{ value: 1, label: '1-60 uA' },
{ value: 2, label: '40-175 uA' },
{ value: 3, label: '>120 uA' },
{ value: 4, label: 'Auto' },
],
range: ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto'],
defaultValue: 4,
outputRawData: (val) => {
const currentRangeArr = ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto']
return currentRangeArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const currentRangeArr = ['<1.5 uA', '1-60 uA', '40-175 uA', '>120 uA', 'Auto']
return currentRangeArr[parseInt(idx)]
},
},
EIS_DC_BIAS: {
type: 'number',
showName: 'DC Volt',
componentType: 'input-field',
range: Object.freeze({ min: 2500, max: 50000 }), // UI上能輸入的最大最小值
outputRawData: (val, scale = 1) => {
return Math.round((parseInt(val) * 12.5 * scale) + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
EIS_AC_AMP: {
type: 'number',
showName: 'AC Amp',
componentType: 'input-field',
range: Object.freeze({ min: 0, max: 2047 }),
outputRawData: (val, scale = 1) => {
return Math.round(parseInt(val * scale) / 800 * 2047)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val) / 2047 * 800) / scale
},
defaultValue: 26,
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
},
},
EIS_FREQ: {
type: 'array',
showName: 'Frequency',
componentType: 'multi-input-field',
range: Object.freeze({ min: 1, max: 13333333 }),
outputRawData: (val) => {
return parseFloat(val) < 0.1 ? Math.round(0.1 / 0.015) : Math.round(parseFloat(val) / 0.015)
},
outputReadabilityData: (val) => {
return (parseFloat(val) * 0.015).toFixed(1)
},
defaultValue: [13333333, 7],
defaultUnit: 'Hz',
downloadUnit: 'Hz',
unit: {
Hz: 1,
},
},
EIS_PPD: {
type: 'number',
showName: 'Points per decades',
componentType: 'input-field',
range: Object.freeze({ min: 1, max: 10 }),
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
defaultValue: 10,
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
EIS_SCALE: {
type: 'array',
showName: 'Point spacing',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: 'Logarithm' },
{ value: 1, label: 'Linear' },
],
range: ['Logarithm', 'Linear'],
defaultValue: 0,
outputRawData: (val) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr[parseInt(idx)]
},
},
EIS_DELAY: {
type: 'number',
showName: 'DELAY',
componentType: 'input-field',
range: Object.freeze({ min: 0, max: 100 }),
outputRawData: (val) => {
return parseInt(parseFloat(val) * 10)
},
outputReadabilityData: (val) => {
return parseFloat((val / 10)).toFixed(1)
},
defaultValue: 0,
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
EIS_AVERAGE_NUM: {
type: 'array',
showName: 'Average',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '2' },
{ value: 1, label: '4' },
{ value: 2, label: '6' },
{ value: 3, label: '8' },
],
range: ['2', '4', '6', '8'],
defaultValue: 0,
outputRawData: (val) => {
const numArr = ['2', '4', '6', '8']
return numArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const numArr = ['2', '4', '6', '8']
return numArr[parseInt(idx)]
},
},
CF_DC_BIAS: {
type: 'number',
showName: 'DC Volt',
componentType: 'input-field',
range: Object.freeze({ min: 2500, max: 50000 }), // UI上能輸入的最大最小值
outputRawData: (val, scale = 1) => {
return Math.round((parseInt(val) * 12.5 * scale) + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
CF_AC_AMP: {
type: 'number',
showName: 'AC Amp',
componentType: 'input-field',
range: Object.freeze({ min: 0, max: 2047 }),
outputRawData: (val, scale = 1) => {
return Math.round(parseInt(val * scale) / 800 * 2047)
},
outputReadabilityData: (val, scale = 1) => {
return Math.round(parseInt(val) / 2047 * 800) / scale
},
defaultValue: 26,
defaultUnit: 'mV',
downloadUnit: 'mV',
unit: {
mV: 1,
},
},
CF_FREQ: {
type: 'number',
showName: 'Frequency',
componentType: 'input-field',
range: Object.freeze({ min: 1, max: 13333333 }),
outputRawData: (val) => {
return parseFloat(val) < 0.1 ? Math.round(0.1 / 0.015) : Math.round(parseFloat(val) / 0.015)
},
outputReadabilityData: (val) => {
return (parseFloat(val) * 0.015).toFixed(1)
},
defaultValue: 13333333,
defaultUnit: 'Hz',
downloadUnit: 'Hz',
unit: {
Hz: 1,
},
},
CF_PPD: {
type: 'number',
showName: 'Points per decades',
componentType: 'input-field',
range: Object.freeze({ min: 1, max: 10 }),
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
defaultValue: 10,
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
CF_SCALE: {
type: 'array',
showName: 'Point spacing',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: 'Logarithm' },
{ value: 1, label: 'Linear' },
],
range: ['Logarithm', 'Linear'],
defaultValue: 0,
outputRawData: (val) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const scaleArr = ['Logarithm', 'Linear']
return scaleArr[parseInt(idx)]
},
},
CF_DELAY: {
type: 'number',
showName: 'DELAY',
componentType: 'input-field',
range: Object.freeze({ min: 0, max: 100 }),
outputRawData: (val) => {
return parseInt(parseFloat(val) * 10)
},
outputReadabilityData: (val) => {
return parseFloat((val / 10)).toFixed(1)
},
defaultValue: 0,
defaultUnit: 'points',
downloadUnit: null,
unit: {
points: 1,
},
},
CF_AVERAGE_NUM: {
type: 'array',
showName: 'Average',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '2' },
{ value: 1, label: '4' },
{ value: 2, label: '6' },
{ value: 3, label: '8' },
],
range: ['2', '4', '6', '8'],
defaultValue: 3,
outputRawData: (val) => {
const numArr = ['2', '4', '6', '8']
return numArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const numArr = ['2', '4', '6', '8']
return numArr[parseInt(idx)]
},
},
CV_E_INITIAL: {
type: 'number',
showName: 'E-Initial',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
CV_E1: {
type: 'number',
showName: 'E1',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
CV_E2: {
type: 'number',
showName: 'E2',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
CV_SCAN_RATE: {
type: 'number',
showName: 'ScanRate',
componentType: 'input-range',
range: Object.freeze({ min: 1, max: 100000 }),
outputRawData: (val) => {
return parseInt(parseFloat(val) * 100)
},
outputReadabilityData: (val) => {
return parseFloat(val) / 100
},
defaultValue: 10000,
defaultUnit: 'mV/s',
downloadUnit: 'mV/s',
unit: {
'mV/s': 1,
},
},
CA_VOLT: {
type: 'number',
showName: 'Volt (v.s. ref)',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
defaultValue: 25000,
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
},
VT_MEASURE_VIN_RANGE: {
type: 'array',
showName: 'Vin Range',
componentType: 'input-button-toggle',
options: [
{ value: 0, label: '0~2V' },
{ value: 1, label: '-1~1V' },
{ value: 2, label: '-2~0V' },
{ value: 3, label: 'Auto' },
],
range: ['1', '2', '3', 'Auto'],
defaultValue: 0,
outputRawData: (val) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr.indexOf(val.toString())
},
outputReadabilityData: (idx) => {
const voltageInRangeArr = ['1', '2', '3', 'Auto']
return voltageInRangeArr[parseInt(idx)]
},
},
RT_VOLT_SET: {
type: 'number',
showName: 'Volt out',
componentType: 'input-range',
range: Object.freeze({ min: 2500, max: 50000 }),
defaultValue: 37500,
defaultUnit: 'V',
downloadUnit: 'mV',
unit: {
mV: 1,
V: 1e3,
},
outputRawData: (val, scale = 1) => {
return parseInt(parseFloat(val) * scale * 12.5 + 25000)
},
outputReadabilityData: (val, scale = 1) => {
return parseInt((parseFloat(val) - 25000) / 12.5) / scale
},
},
ADC_VALUE_I: {
type: 'none',
showName: 'Instruction',
componentType: 'dev-mode',
},
MODE_OPTIONS: [
{
id: 7,
description: 'Idle',
},
{
id: 0,
description: 'Potentiostatic Electrochemical Impedance Spectroscopy',
@@ -405,6 +549,18 @@ const EliteEIS = {
},
{
id: 3,
description: 'VT',
},
{
id: 4,
description: 'RT',
},
{
id: 5,
description: 'Constant Frequency',
},
{
id: 6,
description: 'Dev Tools',
},
],
@@ -412,7 +568,11 @@ const EliteEIS = {
0: PotentiostaticEIS,
1: CyclicVoltammetry,
2: Chronoamperometry,
3: DevMode,
3: VT,
4: RT,
5: ConstantFrequency,
6: DevMode,
7: Idle,
},
}
+24
View File
@@ -0,0 +1,24 @@
export default {
name: 'ACC',
parameter: ['TIME_DURATION', 'ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'ACC_a_out0_current', 'ACC_a_out1_current', 'ACC_a_out2_current', 'ACC_a_out3_current', 'TRIG0_en', 'TRIG1_en', 'TRIG0_edge_type', 'TRIG1_edge_type'], // 這個mode用到的參數
showParameter: ['ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'TRIG0_en', 'TRIG1_en', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => [], // export header的參數
valScales: {
linear: {
func: (val) => {
return val
},
},
log: {
func: (val) => {
return Math.log10(Math.abs(val))
},
},
},
channels: {
},
charts: {
default: [
],
},
}
+242
View File
@@ -0,0 +1,242 @@
import Idle from '../Common/Idle'
import ACC from './ACC'
const EliteTrigger = {
TIME_DURATION: {
type: 'number',
showName: 'Time duration',
componentType: 'input-range',
range: Object.freeze({ min: 0, max: 86400 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: 's',
downloadUnit: 's',
unit: {
ms: 1e-3,
s: 1,
m: 60,
h: 3600,
},
outputRawData: (val) => {
return parseInt(parseFloat(val))
},
outputReadabilityData: (val) => {
return parseInt(parseFloat(val))
},
},
ACC_a_out0: {
type: 'number',
showName: 'Channel 1 Enable',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
ACC_a_out1: {
type: 'number',
showName: 'Channel 2 Enable',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
ACC_a_out2: {
type: 'number',
showName: 'Channel 3 Enable',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
ACC_a_out3: {
type: 'number',
showName: 'Channel 4 Enable',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
ACC_a_out0_current: {
type: 'number',
showName: 'Channel 1 Current',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: 'mA',
downloadUnit: null,
unit: {
mA: 1,
},
outputRawData: (val) => {
return val * 250
},
outputReadabilityData: (val) => {
return val / 250
},
},
ACC_a_out1_current: {
type: 'number',
showName: 'Channel 2 Current',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: 'mA',
downloadUnit: null,
unit: {
mA: 1,
},
outputRawData: (val) => {
return val * 250
},
outputReadabilityData: (val) => {
return val / 250
},
},
ACC_a_out2_current: {
type: 'number',
showName: 'Channel 3 Current',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: 'mA',
downloadUnit: null,
unit: {
mA: 1,
},
outputRawData: (val) => {
return val * 250
},
outputReadabilityData: (val) => {
return val / 250
},
},
ACC_a_out3_current: {
type: 'number',
showName: 'Channel 4 Current',
componentType: 'channelBlock',
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: 'mA',
downloadUnit: null,
unit: {
mA: 1,
},
outputRawData: (val) => {
return val * 250
},
outputReadabilityData: (val) => {
return val / 250
},
},
TRIG0_en: {
type: 'number',
showName: 'Trigger 0 Enable',
componentType: 'triggerBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
TRIG1_en: {
type: 'number',
showName: 'Trigger 1 Enable',
componentType: 'triggerBlock',
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
TRIG0_edge_type: {
type: 'number',
showName: 'Trigger 0 Type',
componentType: 'triggerBlock',
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
TRIG1_edge_type: {
type: 'number',
showName: 'Trigger 1 Type',
componentType: 'triggerBlock',
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
defaultValue: 0,
defaultUnit: null,
downloadUnit: null,
unit: {},
outputRawData: (val) => {
return parseInt(val)
},
outputReadabilityData: (val) => {
return parseInt(val)
},
},
MODE_OPTIONS: [
{
id: 1,
description: 'Idle',
},
{
id: 0,
description: 'Analog Current Control (ACC)',
},
],
MODE: {
0: ACC,
1: Idle,
},
}
export default EliteTrigger
+9 -4
View File
@@ -1,19 +1,22 @@
import EliteEDC from './EliteEDC/index'
import EliteEIS from './EliteEIS/index'
import EliteTrigger from './EliteTrigger/index'
import store from '@/store/index'
// object saving library name mapping table
const libraryNameMappingTable = {
EDC: EliteEDC,
EliteZM15: EliteEDC,
'Elite_EDC_1.4': null,
'Elite_EDC_1.5': EliteEDC,
'Elite_EDC_1.5re': EliteEDC,
'Elite_EDC_1.5r2': EliteEDC,
'Elite_BAT_1.0': EliteEDC,
EIS: EliteEIS,
'Elite_EIS_1.0': EliteEIS,
'Elite_EIS_1.1': EliteEIS,
'Elite_EIS_MINI_1.0': EliteEIS,
'Elite_TRIG_0.1': null,
'Elite_TRIG_0.1': EliteTrigger,
'Elite_MEGAFLY_0.1': null,
}
@@ -30,19 +33,20 @@ const serialNumberMappingTable = {
},
3: {
1: {
0: EliteEDC, // BAT1.0
0: EliteEDC, // BAT0.1
1: EliteEDC, // BAT1.0
},
},
4: {
1: {
0: EliteEIS, // EIS1.0
1: EliteEIS, // EIS1.1
2: EliteEIS, // EIS1.1mini
2: EliteEIS, // EIS mini1.0
},
},
5: {
1: {
0: null, // TRIG0.1
0: EliteTrigger, // TRIG0.1
},
},
6: {
@@ -59,6 +63,7 @@ const serialNumberMappingTable = {
* @returns {Object} : config
*/
function getConfig (type) {
if (type === undefined || type === null) return
if (typeof type === 'number') {
const deviceList = store.getters.getField('taskContent').deviceListNew
if (deviceList === undefined) return
-1
View File
@@ -143,7 +143,6 @@ export const getFileInfoFormat = () => {
ADC_LEVEL: 0,
ADC_VALUE_I: 0,
ADC_VALUE_V: 0,
CHANNEL_LABEL: [],
CURRNET_LIMIT_VALUE: 1500000,
CYCLE_NUMBER: 0,
Charge: 1,
+2
View File
@@ -52,6 +52,8 @@ const getDefaultChartTypeByMode = (mode, lib) => {
settings[1] = ['Elite', 2, 'Elite', 1]
settings[2] = ['Time', 2, 'Elite', 1]
settings[3] = ['Time', 2, 'Elite', 2]
settings[4] = ['Time', 2, 'Elite', 3]
settings[5] = ['EliteEIS', 6, 'EliteEIS', 5]
return settings[mode]
} else if (lib === 'Elite_TRI') {
// const settings = {}
+1 -1
View File
@@ -2,7 +2,7 @@ function newActionTemplate () {
return [
// 'start',
'stop',
'cycle',
// 'cycle',
'idle',
]
}
+33 -33
View File
@@ -45,25 +45,25 @@ function newConditionTemplate (action) {
// },
},
stop: {
absolute_time: {
select: false,
type: 'datetime-local',
prefix: 'At',
suffix: '',
value: '',
},
after_project_run: {
select: false,
type: 'text',
prefix: 'After project run',
suffix: 'secs',
value: '',
},
// absolute_time: {
// select: false,
// type: 'datetime-local',
// prefix: 'At',
// suffix: '',
// value: '',
// },
// after_project_run: {
// select: false,
// type: 'text',
// prefix: 'After project run',
// suffix: 'secs',
// value: '',
// },
after_task_run: {
select: false,
select: true,
type: 'text',
prefix: 'After task run',
suffix: 'secs',
prefix: 'when task run for',
suffix: 'seconds',
value: '',
},
// task: {
@@ -88,22 +88,22 @@ function newConditionTemplate (action) {
// value: '',
// },
},
cycle: {
cycle_next: {
select: false,
type: 'text',
prefix: 'Cycle next go to:',
suffix: '',
value: '',
},
cycle: {
select: false,
type: 'text',
prefix: 'Run',
suffix: 'times',
value: '0',
},
},
// cycle: {
// cycle_next: {
// select: false,
// type: 'text',
// prefix: 'Cycle next go to:',
// suffix: '',
// value: '',
// },
// cycle: {
// select: false,
// type: 'text',
// prefix: 'Run',
// suffix: 'times',
// value: '0',
// },
// },
idle: {
after_task_run: {
select: false,
+5 -4
View File
@@ -1,10 +1,11 @@
function newDevice (uuid = '', name = '', product = 0, library = 0, connectDevice = {}) {
function newDevice (order = -1, name = '', library = '', device = null) {
return {
order: order,
name: name,
product: product,
library: library,
uuid: uuid,
connectDevice: connectDevice,
pair: device,
pairStatus: -1,
locked: false,
isSelect: [],
}
}
+2 -1
View File
@@ -3,10 +3,11 @@ function newProject (name, uuid) {
name: name,
desc: '',
task: [],
device: [],
device: {},
uuid: uuid,
select: false,
status: -1,
cycle: [],
}
}
+2 -2
View File
@@ -1,9 +1,9 @@
function newTask (name, uuid) {
function newTask (name, uuid, type = '') {
return {
id: -1,
name: name,
next: [],
type: '',
type: type,
desc: '',
device: [],
action: {},
+7 -10
View File
@@ -162,7 +162,6 @@ function newParameterSet () {
ADC_LEVEL: 0,
ADC_VALUE_I: 0,
ADC_VALUE_V: 0,
CHANNEL_LABEL: [],
CURRNET_LIMIT_VALUE: 1500000,
CYCLE_NUMBER: 0,
Charge: 1,
@@ -231,15 +230,13 @@ function newParameterSet () {
DPV_mode: 0, // Auto / Advanced / Engineering
DPV_engineering_enable: 0,
// Elite EIS
FREQ_START: 0,
FREQ_STOP: 0,
DELAY: 1,
AVERAGE_NUM: 2,
DC_BIAS: 0,
AC_AMP: 0,
SCALE: 0,
PPD: 0,
RTIA: 0,
EIS_DC_BIAS: 0,
EIS_AC_AMP: 0,
EIS_PPD: 0,
EIS_SCALE: 0,
EIS_DELAY: 1,
EIS_AVERAGE_NUM: 2,
GENERAL_HS_RTIA: 0,
// Elite Trigger
ACC_a_out0: 0,
ACC_a_out0_current: 0,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
View File
@@ -48,3 +48,23 @@ $icon-font-path: './../fonts/';
font-family: 'Roboto';
src: url('~@/fonts/roboto/Roboto-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Inter-ExtraBold';
src: url('~@/fonts/inter/Inter-ExtraBold.ttf') format('truetype');
}
@font-face {
font-family: 'Inter-Bold';
src: url('~@/fonts/inter/Inter-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Inter-Regular';
src: url('~@/fonts/inter/Inter-Regular.ttf') format('truetype');
}
// @font-face {
// font-family: 'Inter';
// src: url('~@/fonts/inter/Inter-Regular.ttf') format('truetype');
// }
@@ -60,7 +60,7 @@ const exportActs = {
const parameterValue = [modeObj.name]
const outputValue = []
Object.keys(meta.parameter_set).sort().forEach(key => {
if (!['BLE_WRITE', 'CHANNEL', 'CHANNEL_LABEL'].includes(key)) {
if (!['BLE_WRITE', 'CHANNEL'].includes(key)) {
parameterName.push(key)
parameterValue.push(meta.parameter_set[key])
}
+138 -17
View File
@@ -1,6 +1,8 @@
import types from '@/store/modules/project/types'
import newProject from '@/factories/project/projectFactory'
import newDevice from '@/factories/project/deviceFactory'
import { v4 as uuidv4 } from 'uuid'
import Vue from 'vue'
const typePath = types.project
@@ -26,6 +28,14 @@ const projectActs = {
* @param {}
*/
[typePath.init]: async ({ state, getters, commit }, payload) => {
state.projectSelectIndex = -1
state.taskSelectKey = ''
state.deviceSelectKey = ''
state.lockMode = false
state.taskViewPanel = {
show: false,
type: '',
}
},
/**
* create project
@@ -40,6 +50,7 @@ const projectActs = {
const response = await payload.api.project.create(project)
// align project id with column id
project.id = response.data.id
project.created_at = response.data.created_at
state.projectConfigList.push(project)
},
@@ -72,7 +83,6 @@ const projectActs = {
} else {
state.projectLibrary = state.projectList[payload.index].device[0]?.library
}
// state.projectLibrary = state.projectList[payload.index].device[0]?.library.value
},
/**
@@ -82,6 +92,7 @@ const projectActs = {
*/
[typePath.delete]: async ({ state, getters, commit }, payload) => {
const { project, index, api } = payload
if (project === undefined) return
await api.project.update(project.id, { deleted: true })
await api.project.del()
state.projectList.splice(index, 1)
@@ -89,22 +100,57 @@ const projectActs = {
return true
},
/**
* delete device
*
* @param {number} deviceIndex
*/
[typePath.copy]: async ({ state, getters, commit }, payload) => {
const { project, api } = payload
if (project === undefined) return
const copyProject = JSON.parse(JSON.stringify(project))
copyProject.name += ' copy'
copyProject.uuid = uuidv4()
// create project need to remove
delete copyProject.id
delete copyProject.created_at
delete copyProject.updated_at
const response = await api.project.create(copyProject)
copyProject.id = response.data.id
copyProject.created_at = response.data.created_at
copyProject.updated_at = response.data.updated_at
state.projectList.push(copyProject)
},
/**
* register device
*
* @param {object} device
*/
[typePath.addDevice]: async ({ state, getters, commit }, payload) => {
const { device } = payload
// console.log(getters.getSelectProject.device)
let flag = false
for (const eachDevice of getters.getSelectProject.device) {
if (device.connectDevice.mac_address === eachDevice.connectDevice.mac_address) {
flag = true
break
}
}
if (!flag) getters.getSelectProject.device.push(device)
[typePath.appendDevice]: async ({ state, getters, commit }, payload) => {
const { key, device } = payload
Vue.set(getters.getSelectProject.device, key, device)
return true
},
/**
* create device
*
* @param {object} device
*/
[typePath.createDevice]: async ({ state, getters, commit, dispatch }, payload) => {
const { name, library, pair, pairStatus, order } = payload
const uuid = uuidv4()
const device = newDevice()
device.name = name
device.library = library
device.pair = pair
device.order = order
if (pairStatus) device.pairStatus = pairStatus
await dispatch(typePath.appendDevice, { key: uuid, device: device })
return true
},
/**
@@ -127,20 +173,95 @@ const projectActs = {
[typePath.setDevice]: async ({ state, getters, commit }, payload) => {
const { device, index } = payload
const deviceList = getters.getSelectProject.device
deviceList[index] = device
if (index) {
deviceList[index] = device
return true
}
deviceList.push(device)
return true
},
/**
* delete device
*
* @param {number} deviceIndex
* @param {string} deviceKey
* @param {string} macAddress
*/
[typePath.deleteDevice]: async ({ state, getters, commit }, payload) => {
const { deviceIndex } = payload
getters.getSelectProject.device.splice(deviceIndex, 1)
[typePath.deleteDevice]: async ({ state, getters, commit, dispatch }, payload) => {
const { deviceKey } = payload
// delete project register device
if (deviceKey) {
Vue.delete(getters.getSelectProject.device, deviceKey)
}
// delete task device
await dispatch('deleteDeviceTask', { deviceKey: deviceKey })
return true
},
/**
* find devices that is connected but not register in project
*
* @param {string} library
*/
[typePath.checkNotRegisterDevice]: async ({ state, getters, commit }, payload) => {
const library = payload.library
const deviceList = []
const connectedDevices = state.deviceConnectList
const registeredDevices = getters.getSelectProject?.device
// if there is not connect device then return
if (connectedDevices.length === 0) return deviceList
// if there is registered device, need to remove cause duplicate device
if (registeredDevices) {
for (const device of connectedDevices) {
if (Object.values(registeredDevices).findIndex(ele => {
return ele.pair === device.mac_address
}) === -1) {
// if no metion which library
if (library === undefined) {
deviceList.push({ macAddress: device.mac_address, library: device.library_name })
}
// if library is assign then need to be same library
if (library && device.library_name.includes(library)) {
deviceList.push({ macAddress: device.mac_address, library: device.library_name })
}
}
}
}
return deviceList
},
/**
* find devices that is register in project but not connected
*
* @param {number} deviceIndex
*/
[typePath.checkPairDeviceExist]: async ({ state, getters, commit, dispatch }, payload) => {
const deviceList = getters.getSelectProject.device
// check project each device is connected(exist) or not
for (const device in deviceList) {
const _device = deviceList[device]
_device.pairStatus = 0
let deviceExist = false
for (const connectDevice of state.deviceConnectList) {
if (deviceList[device].pair === connectDevice.mac_address) {
_device.pairStatus = 1
deviceExist = true
}
}
// if not exist then check if there is connected device is idle and not register in project
if (deviceExist === false) {
const passDevice = await dispatch(typePath.checkNotRegisterDevice, { library: deviceList[device].library })
if (passDevice.length > 0) {
_device.pairStatus = 1
deviceList[device].pair = passDevice[0].macAddress
}
if (passDevice.length === 0) {
_device.pairStatus = 0
}
}
}
},
}
export default projectActs
+232 -24
View File
@@ -1,6 +1,8 @@
import types from '@/store/modules/project/types'
import newTask from '@/factories/project/taskFactory'
import { v4 as uuidv4 } from 'uuid'
import global from '@/data/global/global.js'
import Vue from 'vue'
const typePath = types.task
@@ -17,33 +19,158 @@ const taskActs = {
*
* @param {}
*/
[typePath.create]: async ({ state, getters, commit }, payload) => {
[typePath.create]: async ({ state, getters, commit, dispatch }, payload) => {
const selectProject = getters.getSelectProject
const name = `task${(selectProject.task.length + 1)}`
const uuid = uuidv4()
const task = newTask(name, uuid)
const prevTask = getters.getTask(selectProject.task.length - 1)
prevTask && prevTask.next.push(uuid)
// check device needs to add auto
const deviceArray = Object.keys(getters.getSelectProject.device)
if (deviceArray.length === 1) {
task.device.push(deviceArray[0])
await dispatch(typePath.createActionConditionPair, {
device: deviceArray[0],
action: 'start',
condition: {
type: 'previous_task_done',
comparsion: 'equal',
value: '',
},
task: task,
})
}
selectProject.task.push(task)
await dispatch(typePath.insert, { project: selectProject, task: task, index: selectProject.task.length })
},
/**
* select task
*
* @param {}
*/
[typePath.select]: async ({ state, getters, commit }, payload) => {
[typePath.createCycle]: async ({ state, getters, commit, dispatch }, payload) => {
const { cycleInfo } = payload
const selectProject = getters.getSelectProject
const start = cycleInfo.start.id
const end = cycleInfo.end.id + 1
const max = cycleInfo.cycle
const useID = cycleInfo.useID
const id = cycleInfo.id
const count = 0
const cycleLength = selectProject.cycle.length + 1
const name = 'Loop' + cycleLength
// create start & end task
const taskStartUUID = global.getUUID()
const taskEndUUID = global.getUUID()
const taskStart = newTask(name, taskStartUUID, 'cycle')
const taskEnd = newTask(name, taskEndUUID, 'cycle')
// create action
const fakeStartActionUUID = global.getUUID()
const fakeAction = await dispatch(typePath.createAction, { uuid: fakeStartActionUUID, action: 'cycle', target: null })
// create start condition
const conditionUUID = global.getUUID()
const newCondition = await dispatch(typePath.createCondition, { uuid: conditionUUID, condition: 'previous_task_done', compOp: 'equal', value: '' })
taskStart.condition = Object.assign({}, taskStart.condition, newCondition)
taskEnd.condition = Object.assign({}, taskEnd.condition, newCondition)
// create stop condition
const conditionUUID1 = global.getUUID()
let newCondition1
if (!useID) {
newCondition1 = await dispatch(typePath.createCondition, { uuid: conditionUUID1, condition: 'after_task_run', compOp: 'equal', value: '0' })
} else {
newCondition1 = await dispatch(typePath.createCondition, { uuid: conditionUUID1, condition: 'until_button_trigger', compOp: 'equal', value: '' })
}
taskStart.condition = Object.assign({}, taskStart.condition, newCondition1)
const conditionUUID2 = global.getUUID()
const newCondition2 = await dispatch(typePath.createCondition, { uuid: conditionUUID2, condition: 'after_task_run', compOp: 'equal', value: '0' })
taskEnd.condition = Object.assign({}, taskEnd.condition, newCondition2)
// assign action & condition
fakeAction[fakeStartActionUUID].condition.push(conditionUUID)
fakeAction[fakeStartActionUUID].condition.push(conditionUUID1)
fakeAction[fakeStartActionUUID].condition.push(conditionUUID2)
taskStart.action = Object.assign({}, taskStart.action, fakeAction)
taskEnd.action = Object.assign({}, taskEnd.action, fakeAction)
taskStart.next.push(await dispatch(typePath.get, { project: selectProject, index: start, attribute: 'uuid' }))
await dispatch(typePath.insert, { project: selectProject, task: taskEnd, index: end })
await dispatch(typePath.insert, { project: selectProject, task: taskStart, index: start })
await dispatch(typePath.rearrange, { project: selectProject })
selectProject.cycle.push({
id: id,
name: name,
range: [taskStartUUID, taskEndUUID],
max: max,
count: count,
useID: useID,
})
},
/**
* save task
*
* @param {}
*/
[typePath.save]: async ({ state, getters, commit }, payload) => {
[typePath.insert]: async ({ state, getters, commit }, payload) => {
const { project, task, index } = payload
project.task.splice(index, 0, task)
if (index !== 0) {
project.task[index - 1].next.length = 0
project.task[index - 1].next.push(task.uuid)
}
if (index !== project.task.length - 1) {
task.next.length = 0
task.next.push(project.task[index + 1].uuid)
}
},
[typePath.copy]: async ({ state, getters, commit, dispatch }, payload) => {
const { project, index } = payload
const copyTask = JSON.parse(JSON.stringify(project.task[index]))
copyTask.name += '-copy'
copyTask.uuid = uuidv4()
project.task.push(copyTask)
await dispatch(typePath.rearrange, { project: project })
},
[typePath.get]: async ({ state, getters, commit }, payload) => {
const { project, index, attribute } = payload
if (attribute) return project.task[index][attribute]
return project.task[index]
},
[typePath.getIndex]: ({ state, getters, commit }, payload) => {
const { project, uuid } = payload
return project.task.findIndex(ele => ele.uuid === uuid)
},
[typePath.swap]: async ({ state, getters, commit, dispatch }, payload) => {
const { project, originIndex, newIndex } = payload
// if swap to higher index insert first then delete
if (originIndex < newIndex) {
const task = project.task[originIndex]
project.task.splice(newIndex, 0, task)
await dispatch(typePath.delete, { project: project, index: originIndex })
}
// if swap to lower index delete first then insert
if (originIndex > newIndex) {
const task = project.task[originIndex]
await dispatch(typePath.delete, { project: project, index: originIndex })
project.task.splice(newIndex, 0, task)
}
await dispatch(typePath.rearrange, { project: project })
return true
},
[typePath.rearrange]: async ({ state, getters, commit, dispatch }, payload) => {
const { project } = payload
project.task = project.task.filter(ele => ele !== undefined)
for (const idx in project.task) {
project.task[idx].next.length = 0
if (Number(idx) === Number(project.task.length - 1)) return
project.task[idx].next.push(project.task[Number(idx) + 1].uuid)
}
},
/**
@@ -51,9 +178,58 @@ const taskActs = {
*
* @param {}
*/
[typePath.delete]: async ({ state, getters, commit }, payload) => {
const selectProject = getters.getSelectProject
selectProject.task.splice(payload.index, 1)
[typePath.delete]: async ({ state, getters, commit, dispatch }, payload) => {
const { project, index } = payload
project.task.splice(index, 1)
await dispatch(typePath.rearrange, { project: project })
},
/**
* delete task
*
* @param {}
*/
[typePath.deleteDevice]: async ({ state, getters, commit, dispatch }, payload) => {
const { deviceKey, onlySelectTask } = payload
if (onlySelectTask !== undefined) {
const task = getters.getSelectTask
task.device = task.device.filter(ele => ele !== deviceKey)
// delete task action & condition
for (const [key, value] of Object.entries(task.action)) {
if (value.target === deviceKey) {
for (const condition of value.condition) {
Vue.delete(task.action, condition)
}
Vue.delete(task.action, key)
}
}
// delete task parameter
for (const [key, value] of Object.entries(task.parameter_set)) {
if (value.target === deviceKey) {
Vue.delete(task.parameter_set, key)
}
}
return true
}
for (const task of getters.getSelectProject.task) {
// delete task device
task.device = task.device.filter(ele => ele !== deviceKey)
// delete task action & condition
for (const [key, value] of Object.entries(task.action)) {
if (value.target === deviceKey) {
for (const condition of value.condition) {
Vue.delete(task.action, condition)
}
Vue.delete(task.action, key)
}
}
// delete task parameter
for (const [key, value] of Object.entries(task.parameter_set)) {
if (value.target === deviceKey) {
Vue.delete(task.parameter_set, key)
}
}
}
},
/**
@@ -62,7 +238,7 @@ const taskActs = {
* @param {}
*/
[typePath.setCondition]: async ({ state, getters, commit }, payload) => {
const task = getters.getSelectTask
const task = payload.task ? payload.task : getters.getSelectTask
task.condition = Object.assign({}, task.condition, payload.condition)
},
@@ -72,7 +248,7 @@ const taskActs = {
* @param {}
*/
[typePath.setAction]: async ({ state, getters, commit }, payload) => {
const task = getters.getSelectTask
const task = payload.task ? payload.task : getters.getSelectTask
task.action = Object.assign({}, task.action, payload.action)
},
@@ -83,12 +259,9 @@ const taskActs = {
*/
[typePath.setCycle]: async ({ state, getters, commit }, payload) => {
const task = getters.getSelectTask
// task.cycle = Object.assign({}, task.cycle, payload.cycle)
// task.cycle_next = Object.assign({}, task.cycle_next, payload.cycle_next)
task.cycle = payload.cycle
task.cycle_next = payload.cycle_next
task.cycle_next_uuid = payload.cycle_next_uuid
// console.log(task, task.cycle, task.cycle_next, task.cycle_next_uuid)
},
/**
@@ -113,6 +286,41 @@ const taskActs = {
}
task.parameter_set = Object.assign({}, task.parameter_set)
},
[typePath.createActionConditionPair]: async ({ state, getters, commit, dispatch }, payload) => {
const { device, action, condition, task } = payload
const conditionUUID = global.getUUID()
const _condition = await dispatch(typePath.createCondition, { uuid: conditionUUID, condition: condition.type, compOp: condition.comparsion, value: condition.value })
await dispatch(typePath.setCondition, { task: task, condition: _condition })
const actionUUID = global.getUUID()
const _action = await dispatch(typePath.createAction, { uuid: actionUUID, action: action, target: device, condition: conditionUUID })
await dispatch(typePath.setAction, { task: task, action: _action })
},
[typePath.createCondition]: async ({ state, getters, commit }, payload) => {
const { uuid, condition, compOp, value } = payload
return {
[uuid]: {
type: condition,
comparsion: compOp,
value: value,
},
}
},
[typePath.createAction]: async ({ state, getters, commit }, payload) => {
const { uuid, action, target, condition } = payload
const conditionArray = []
if (condition !== undefined) {
if (typeof condition === 'string') conditionArray.push(condition)
if (typeof condition === 'object') conditionArray.push(...condition)
}
return {
[uuid]: {
type: action,
target: target,
condition: conditionArray,
},
}
},
}
export default taskActs
@@ -16,13 +16,89 @@ const projectGets = {
return state.projectList[state.projectSelectIndex]
},
[typePath.getDevice]: (state) => (deviceKey) => {
return state.projectList[state.projectSelectIndex].device[deviceKey]
[typePath.getDevice]: (state, getters) => (deviceKey) => {
/** if project is undefined */
if (getters[typePath.getSelect] === undefined) return
return getters[typePath.getSelect].device[deviceKey]
},
[typePath.getDeviceNum]: (state, getters) => {
return Object.keys(getters[typePath.getSelect].device).length
},
[typePath.getDeviceLibrary]: (state, getters) => (key) => {
return getters[typePath.getSelect].device[key].library
},
[typePath.getDeviceMaxOrder]: (state, getters) => {
const deviceList = getters[typePath.getSelect].device
if (deviceList.length === 0) return 0
let order = 0
for (const device in deviceList) {
order = Math.max(deviceList[device].order, order)
}
order += 1
return order
},
[typePath.getDeviceShowName]: (state, getters) => (key) => {
if (getters[typePath.getSelect].device[key].pair === null) {
return getters[typePath.getSelect].device[key].name
}
return getters[typePath.getSelect].device[key].pair
},
[typePath.getAllDevice]: (state) => {
return state.projectList[state.projectSelectIndex].device
},
[typePath.getCycle]: (state) => (uuid) => {
// 0: index, 1: location, 2: info
let location
const project = state.projectList[state.projectSelectIndex]
// if no input then reject
if (uuid === undefined) return []
const cycleIndex = project.cycle.findIndex(ele => ele.range.find(ele => ele === uuid))
// if find no index then reject
if (cycleIndex === -1) return []
if (project.cycle[cycleIndex].range[0] === uuid) location = 'start'
if (project.cycle[cycleIndex].range[1] === uuid) location = 'end'
return [cycleIndex, location, project.cycle[cycleIndex]]
},
/**
* find devices that is connected but not register in project
*
* @param {string} library
*/
[typePath.getNotRegisterDevice]: (state, getters) => (library) => {
const deviceList = []
const connectedDevices = state.deviceConnectList
const registeredDevices = getters.getSelectProject.device
// if there is not connect device then return
if (connectedDevices.length === 0) return deviceList
// if there is registered device, need to remove cause duplicate device
if (registeredDevices) {
for (const device of connectedDevices) {
if (Object.values(registeredDevices).findIndex(ele => {
return ele.pair === device.mac_address
}) === -1) {
// if no metion which library
if (library === undefined) {
deviceList.push({ name: device.name, macAddress: device.mac_address, library: device.library_name })
}
// if library is assign then need to be same library
if (library && device.library_name.includes(library)) {
deviceList.push({ name: device.name, macAddress: device.mac_address, library: device.library_name })
}
}
}
}
return deviceList
},
}
export default projectGets
+2
View File
@@ -17,6 +17,8 @@ function newState () {
// library
projectLibrary: null,
projectTableSelectIndex: -1,
taskViewPanel: {
show: false,
type: '',
+21 -2
View File
@@ -7,24 +7,42 @@ const types = {
delete: 'deleteProject',
save: 'saveProject',
select: 'selectProject',
copy: 'copyProject',
get: 'getProject',
getSelect: 'getSelectProject',
getDevice: 'getDeviceProject',
getCycle: 'getCycleProject',
getAllDevice: 'getAllDeviceProject',
getDeviceNum: 'getDeviceNumProject',
getDeviceShowName: 'getDeviceShowNameProject',
getDeviceLibrary: 'getDeviceLibraryProject',
getDeviceMaxOrder: 'getDeviceMaxOrderProject',
getNotRegisterDevice: 'getNotRegisterDeviceProject',
addDevice: 'addDeviceProject',
appendDevice: 'appendDeviceProject',
createDevice: 'createDeviceProject',
findDevice: 'findDeviceProject',
setDevice: 'setDeviceProject',
checkNotRegisterDevice: 'checkNotRegisterDeviceProject',
checkPairDeviceExist: 'checkPairDeviceExistProject',
deleteDevice: 'deleteDeviceProject',
},
task: {
init: 'initTask',
create: 'createTask',
createCycle: 'createCycleTask',
createAction: 'createActionTask',
createCondition: 'createConditionTask',
createActionConditionPair: 'createActionConditionPairTask',
insert: 'insertTask',
swap: 'swapTask',
delete: 'deleteTask',
deleteDevice: 'deleteDeviceTask',
rearrange: 'rearrangeTask',
save: 'saveTask',
select: 'selectTask',
copy: 'copyTask',
setCondition: 'setConditionTask',
setAction: 'setActionTask',
@@ -32,6 +50,7 @@ const types = {
setParameterSet: 'setParameterSetTask',
get: 'getTask',
getIndex: 'getIndexTask',
getSelect: 'getSelectTask',
getCondition: 'getConditionTask',
getParameterSet: 'getParameterSetTask',
@@ -434,44 +434,20 @@ const chartActs = {
}
break
case 'EliteEIS':
if (state.chartData[chartID].chartMode === 0) {
// eslint-disable-next-line no-case-declarations
const device = state.deviceListNew.find((ele) => String(ele.memory_board) === String(source.id))
if (device === undefined) break
if (Number(device.configuration.MODE) === 0 || Number(device.configuration.MODE) === 5) {
state.chartData[chartID].series[state.chartData[chartID].series.length - 1].showSymbol = true
state.chartData[chartID].series[state.chartData[chartID].series.length - 1].showAllSymbol = true
}
dataStreamBuffer.register(chartID, source.id, source.channel)
switch (source.channel) {
case 1:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZIMAG_RAW')
break
case 2:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZREAL_RAW')
break
case 3:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' FREQ')
break
case 4:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CYCLE')
break
case 5:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZIMAG')
break
case 6:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' ZREAL')
break
case 7:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' IMPEDANCE')
break
case 8:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' PHASE')
break
case 9:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CURRENT')
break
case 10:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' LEVEL_GAIN')
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' CHANNEL ' + source.channel)
break
default:
_axisList.push(_axis + ' AXIS = ELITE ' + source.id + ' CHANNEL ' + source.channel)
_axisList.push(_axis + ' AXIS = ELITEEIS ' + source.id + ' CHANNEL ' + source.channel)
break
}
break
@@ -1135,6 +1111,8 @@ function parseGridSourceAxis (gridSourceAxis) {
break
case 'ELITEEIS':
deviceInfo.deviceName = 'EliteEIS'
deviceInfo.deviceID = parseResult[1]
deviceInfo.channel = Number(parseResult[3])
break
default:
break
@@ -1246,54 +1224,33 @@ function getLegendName (sourceList, formulaID, deviceList) {
if (formulaID == null) {
// source only 2 device
sourceList.forEach(source => {
let device = ''
let channelName = ''
switch (source.name) {
case 'Time':
legendName += 'T'
break
case 'Elite':
// eslint-disable-next-line no-case-declarations
const device = deviceList.find((ele) => String(ele.memory_board) === String(source.id))
device = deviceList.find((ele) => String(ele.memory_board) === String(source.id))
if (device === undefined) break
// eslint-disable-next-line no-case-declarations
const channelName = getConfigChannel(device.library_name, device.configuration.MODE, source.channel - 1)
legendName += 'E' + source.id + '-' + channelName.name[0]
channelName = getConfigChannel(device.library_name, device.configuration.MODE, source.channel - 1)
if (!channelName) break
legendName += 'E' + source.id + '-' + channelName.name.replace('_', '')
break
case 'EliteEIS':
switch (source.channel) {
case 1:
legendName += 'E' + source.id + '-Zimag_raw'
break
case 2:
legendName += 'E' + source.id + '-Zreal_raw'
break
case 3:
legendName += 'E' + source.id + '-Freq'
break
case 4:
legendName += 'E' + source.id + '-Cycle'
break
case 5:
legendName += 'E' + source.id + '-Zimag'
break
case 6:
legendName += 'E' + source.id + '-Zreal'
break
case 7:
legendName += 'E' + source.id + '-Imped'
break
case 8:
legendName += 'E' + source.id + '-Phase'
break
case 9:
legendName += 'E' + source.id + '-Current'
break
case 10:
legendName += 'E' + source.id + '-Level_gain'
break
default:
legendName += 'E' + source.id + 'CH' + source.channel
break
// eslint-disable-next-line no-case-declarations
device = deviceList.find((ele) => String(ele.memory_board) === String(source.id))
if (device === undefined) break
// eslint-disable-next-line no-case-declarations
channelName = getConfigChannel(device.library_name, device.configuration.MODE, source.channel - 1)
if (!channelName) break
if ([0, 5].indexOf(Number(device.configuration.MODE)) !== -1) {
legendName += 'E' + source.id + '-' + channelName.name.split('_').join('')
break
}
legendName += 'E' + source.id + '-' + channelName.name.replace('_', '')
break
default:
legendName += 'D' + source.id + 'CH' + source.channel