Compare commits

...

279 Commits

Author SHA1 Message Date
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
ROY d9ef45a5a2 [update] new lprtia function 2022-11-10 14:11:37 +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
ROY 6a1a31d6e3 [update] debug cp 2022-09-20 18:49:49 +08:00
ROY 86c7f2b30d [update] update eis AC_AMP fomula 2022-09-16 10:43:39 +08:00
ROY 97de1cf4e3 [update] update eis AC_AMP & FREQ fomula 2022-09-14 18:22:03 +08:00
peterlu14 91e100319f [update] project parameter duplicate remove 2022-09-14 18:19:29 +08:00
peterlu14 ca3a525332 [update] add slide-out 2022-09-07 09:46:53 +08:00
peterlu14 9d77ba9c01 [update] add fake start action at start & add new action idle & add click css 2022-09-06 19:43:19 +08:00
peterlu14 53ba6ee486 [update] battery 1s -> 1min & Potential force direct to V 2022-09-05 14:48:29 +08:00
peterlu14 cb42635f6a Merge remote-tracking branch 'origin/dev/battery_display' into release/v1.3.6/battery 2022-08-31 10:20:30 +08:00
peterlu14 d43de5927f Merge remote-tracking branch 'origin/dev/sync-parameter' into release/v1.3.5/cached 2022-08-31 10:08:45 +08:00
sss28072637 05ecd69ecd [update] update battery icon & add low battery warning 2022-08-30 18:16:31 +08:00
peterlu14 062938dd0b [update] refresh cache 2022-08-30 15:31:06 +08:00
peterlu14 5e3eb47614 [update] area display fix 2022-08-29 16:48:05 +08:00
peterlu14 1b682421fd [debug] get legend name fail & capture multitimes 2022-08-29 16:36:29 +08:00
peterlu14 aac74382ad Merge remote-tracking branch 'origin/dev/EISReplayFix' into release/v1.3.4/battery&replayEIS 2022-08-29 16:04:11 +08:00
nthu1080112244 0b005638f6 [debug] fix chartAct device undefined 2022-08-29 16:03:43 +08:00
nthu1080112244 f5604b4ad4 [debug] fix typing error 2022-08-29 15:51:03 +08:00
peterlu14 5d772b9d5b Merge remote-tracking branch 'origin/dev/EISReplayFix' into release/v1.3.4/battery&replayEIS 2022-08-29 15:50:26 +08:00
nthu1080112244 857184392c [update] brush delay = 0 2022-08-29 15:46:51 +08:00
nthu1080112244 6c1304bcea [debug] fix specific integral key in bug 2022-08-29 11:40:49 +08:00
nthu1080112244 bcdaecca77 [debug] resolve replay cycle select bug 2022-08-29 11:13:19 +08:00
nthu1080112244 a5330c71dc [debug] fix some typing error 2022-08-29 10:12:41 +08:00
nthu1080112244 a8b6937b72 [update] new setting table, new replay layout 2022-08-26 16:53:23 +08:00
sss28072637 e69e42ac63 [update] adjust the formula of calculating battery, add battery icon & percentage 2022-08-24 17:55:38 +08:00
peterlu14 01f0f45bdd [update] sg_filter scale with sample rate & volt step 2022-08-24 13:27:25 +08:00
ROY 0719284f24 [update] fix VOLT_VSCAN scale 2022-08-23 11:37:02 +08:00
sss28072637 0cecf9abec [update] add battery display 2022-08-22 18:07:06 +08:00
nthu1080112244 93a0ea9b24 Merge branch 'release/v1.3.2/replay_new_function' into dev/EISReplayFix 2022-08-22 17:25:47 +08:00
nthu1080112244 0a7ecfb060 [debug] add comment 2022-08-22 16:40:34 +08:00
nthu1080112244 7642e41d58 [debug] remove annoying console log 2022-08-22 16:16:21 +08:00
nthu1080112244 a0050047d0 [debug] captured chart fix 2022-08-22 16:12:02 +08:00
peterlu14 d3fcf78b45 [refresh] realtime parameter refresh 2022-08-22 11:40:05 +08:00
peterlu14 0d279cb0bf [debug] fix capture data clear problem 2022-08-22 11:38:40 +08:00
peterlu14 44989dd7f7 [debug] fix scheduler parameter not refresh & default MODE = 0 2022-08-22 11:37:56 +08:00
nthu1080112244 07c38de627 [fix] fix real time display 2022-08-22 10:15:12 +08:00
peterlu14 e4c2018e12 Merge remote-tracking branch 'origin/dev/scheduler-function' into release/v1.3.3/merge_scheduler 2022-08-19 18:56:45 +08:00
peterlu14 a0fea97ca7 [update] differential 2022-08-19 18:56:12 +08:00
nthu1080112244 347e1b647f [update] fix add chart option & display bar 2022-08-19 18:16:29 +08:00
108000207 20d94f8c09 [debug] project table library bug (auto connect) 2022-08-19 17:57:06 +08:00
108000207 eb80489c41 [update] scheduler cycle UI 2022-08-19 17:11:37 +08:00
108000207 d337afd7b9 [update] show cycle number on project running 2022-08-19 16:54:20 +08:00
peterlu14 82f46030a3 [update] fix realtime unit function type 2022-08-19 16:17:57 +08:00
peterlu14 8052dfcbf4 [update] file table fix 2022-08-19 15:55:14 +08:00
nthu1080112244 3030b46a64 Merge remote-tracking branch 'origin/dev/source_channel' into dev/repalyControlPanelNew 2022-08-19 14:28:21 +08:00
108000207 ec7edb6bd9 Merge remote-tracking branch 'origin/dev/drag_task' into dev/scheduler-function 2022-08-18 18:25:05 +08:00
unknown eca51be1f8 [update] get source from different mode (some bugs need to be fixed) 2022-08-18 18:21:44 +08:00
108000207 4ac9fe32d1 [update] remove cycle save condition 2022-08-18 18:16:38 +08:00
108000207 46def3dab3 [update] change the UI of scheduler cycle 2022-08-18 17:38:12 +08:00
unknown b560670ada Merge remote-tracking branch 'origin/release/v1.3.2/replay_new_function-hide_project' into dev/drag_task 2022-08-18 14:59:16 +08:00
unknown e7786e6c8c [update] complete drag task function 2022-08-18 14:51:59 +08:00
nthu1080112244 bdd9113b80 [update] real time grid setting 2022-08-17 17:58:58 +08:00
unknown 60d4b63d6b [update] drag task (remain some bugs need to be fixed) 2022-08-17 17:57:52 +08:00
peterlu14 56559738c4 Revert "[update] realtime chart default unit determine by mode now"
This reverts commit fc269f972a.
2022-08-17 15:37:06 +08:00
peterlu14 7639d495b9 Merge branch 'release/v1.3.2/replay_new_function' into release/v1.3.2/replay_new_function-hide_project 2022-08-17 15:23:26 +08:00
108000207 d08f49548b [update] scheduler cycle v1 ( support nest cycle) 2022-08-17 11:58:32 +08:00
ROY 99f51f4307 Merge remote-tracking branch 'origin/release/v1.3.2/replay_new_function' into dev/sync-parameter 2022-08-17 10:54:29 +08:00
peterlu14 001f7139eb [update] fix file table 2022-08-16 20:27:35 +08:00
peterlu14 27bb612bd8 [update] add eis global mode 2022-08-16 19:51:35 +08:00
peterlu14 f5ce74f308 [update] EIS add VOLT_VSCAN and time_duration 2022-08-16 19:51:31 +08:00
108000207 c85c7b0285 [update] fix cycle count 2022-08-16 14:34:18 +08:00
ROY dec4ad1093 [update] realtime nA support mode [10, 11] 2022-08-16 11:32:14 +08:00
ROY e2735f7782 Merge remote-tracking branch 'origin/release/v1.3.2/replay_new_function' into dev/sync-parameter 2022-08-16 11:30:50 +08:00
108000207 3c14cc552f Merge remote-tracking branch 'origin/dev/scheduler' into dev/scheduler-function 2022-08-16 11:16:58 +08:00
nthu1080112244 e3267fdb3a [update] new version control panel 2022-08-16 10:10:46 +08:00
peterlu14 fe723ae897 Merge remote-tracking branch 'origin/dev/delete_actions' into dev/scheduler 2022-08-15 19:10:37 +08:00
peterlu14 fc269f972a [update] realtime chart default unit determine by mode now 2022-08-15 19:06:16 +08:00
sss28072637 c12c4e8fff [update] complete delete actions and the function of swap task 2022-08-15 18:19:50 +08:00
peterlu14 05abfd122a [debug] fix file-table folder show working mode error 2022-08-15 18:12:04 +08:00
JayC319 39bb196db7 message 2022-08-15 17:51:58 +08:00
JayC319 df34998b51 Merge remote-tracking branch 'origin/release/v1.3.2/replay_new_function' into dev/sync-parameter 2022-08-15 17:44:33 +08:00
peterlu14 567d7595cf Merge remote-tracking branch 'origin/dev/delete_actions' into release/v1.3.2/replay_new_function 2022-08-15 14:26:50 +08:00
108000207 a312a32ddc Merge remote-tracking branch 'origin/dev/delete_actions' into dev/scheduler-function 2022-08-15 14:01:48 +08:00
sss28072637 2167f9ef06 [update] complete delete actions, default parameter 2022-08-15 12:01:57 +08:00
108000207 4005961b8a Merge remote-tracking branch 'origin/release/v1.3.2/replay_new_function-hide_project' into dev/scheduler-function 2022-08-15 09:34:37 +08:00
108000207 8cb9ac007e [update] add scheduler cycle at condition, for setting cycle, cycle_next, and cycle_count 2022-08-15 09:31:21 +08:00
peterlu14 41907d5151 Merge branch 'release/v1.3.2/replay_new_function' into release/v1.3.2/replay_new_function-hide_project 2022-08-14 19:30:29 +08:00
peterlu14 68e0edfcdd [update] fix captured failed 2022-08-14 19:09:24 +08:00
peterlu14 4d5f6afffb [update] hide project 2022-08-13 22:43:44 +08:00
peterlu14 07c3f6c9a6 [update] file show working mode 2022-08-13 22:41:00 +08:00
peterlu14 7fb30ffa0a [update] remove replay Axis option cycle 2022-08-13 22:05:14 +08:00
peterlu14 d501d2e01d [update] change default unit & change idiot to not support 2022-08-13 21:53:00 +08:00
peterlu14 99d903dcbf [debug] fix init Time-X Graph change xAxis to other cause chart crush problem (cost lots time) 2022-08-13 21:52:24 +08:00
peterlu14 599838adc5 [debug] fix init not showing data 2022-08-13 21:51:05 +08:00
peterlu14 c9593e2a6e [update] remove old code & refreshformatter no need to refreshChart 2022-08-13 21:50:24 +08:00
peterlu14 16e3e49168 [debug] fix cycle not showing & data null & rules followed by controlPanel 2022-08-13 20:38:45 +08:00
peterlu14 fb0d8bd3f2 [update] replay hide old methods 2022-08-12 21:34:33 +08:00
peterlu14 2f1fe88a60 [update] remove 456456 2022-08-12 21:10:28 +08:00
peterlu14 1eca3c0e72 [update] chart ui resize & mac address to uppercase 2022-08-12 21:09:57 +08:00
peterlu14 1f72708e69 [update] chart name uppercase 2022-08-12 21:08:20 +08:00
peterlu14 8efeb6572d Merge remote-tracking branch 'origin/dev/replayControlPanelFix' into release/v1.3.1/issue_fixed 2022-08-12 19:00:23 +08:00
nthu1080112244 3fce79d6c9 [update] replay control panel & real time layout 2022-08-12 18:57:42 +08:00
peterlu14 52d93f7fad Merge remote-tracking branch 'origin/dev/adjust_button' into release/v1.3.1/issue_fixed 2022-08-12 18:51:33 +08:00
sss28072637 4178842ba3 [update] update button icon 2022-08-12 18:06:33 +08:00
sss28072637 625908053b [fix] fix select-box of device 2022-08-12 11:05:48 +08:00
peterlu14 94eb83ec24 [update] fix replay legend label not showing 2022-08-11 20:33:45 +08:00
peterlu14 4bd25148de [update] hide overview chart legend name 2022-08-11 19:14:37 +08:00
sss28072637 17feeb893e [update] device automatically connect when clicking project 2022-08-11 18:19:28 +08:00
peterlu14 f6b66f0114 [update] hide control panel 2022-08-11 17:36:39 +08:00
108000207 402dd3a66b [debug] fix the bug of project(scheduler): change task but not refresh real-time axis 2022-08-11 15:36:47 +08:00
peterlu14 a256112c6b [update] refresh timer speed up 2022-08-11 15:20:14 +08:00
sss28072637 0ad6b39f96 [update] add button of each task & add close btn 2022-08-11 15:18:11 +08:00
peterlu14 bad7406b10 [update] remove duplicate router 2022-08-11 13:33:05 +08:00
peterlu14 957e806abb [debug] fix last data not show 2022-08-11 13:32:38 +08:00
peterlu14 0824a6b534 [update] remove max limit & short max range 2022-08-11 11:20:45 +08:00
peterlu14 95f1e05b7e [debug] fix databufferstream not clear problem 2022-08-11 11:19:30 +08:00
peterlu14 1fae8538e8 Merge branch 'dev/debug' into release/v1.3.0/replay-capture-sgFilter 2022-08-11 01:04:28 +08:00
peterlu14 f92ba3d098 Merge remote-tracking branch 'origin/dev/scheduler-function' into release/v1.3.0/replay-capture-sgFilter 2022-08-11 01:04:25 +08:00
peterlu14 28b6ee9aa8 Merge remote-tracking branch 'origin/dev/task_button_scheduler' into release/v1.3.0/replay-capture-sgFilter 2022-08-11 01:04:08 +08:00
peterlu14 1a028c1595 Merge remote-tracking branch 'origin/dev/replayControlPanelFix' into release/v1.3.0/replay-capture-sgFilter 2022-08-11 01:02:25 +08:00
peterlu14 b3a745252f [update] add show datastream buffer in dev mode 2022-08-11 00:59:14 +08:00
peterlu14 d229e1be28 [update] add debug button (show data) 2022-08-11 00:51:58 +08:00
peterlu14 c95bc79096 [update] rename developer mode & bind key 2022-08-10 23:56:38 +08:00
peterlu14 ac19737527 [update] default time unit ms -> s 2022-08-10 22:21:18 +08:00
peterlu14 69e4af91af [update] remove x-axis interval and select all buttons & resize grid and dataZoom and asixLabel 2022-08-10 22:20:54 +08:00
peterlu14 cd961f70f9 [warning] remove warning of e-charts update 2022-08-10 22:13:53 +08:00
nthu1080112244 fc5c222dc7 [update] unit and functional can works 2022-08-10 18:09:38 +08:00
sss28072637 ff3a9061de [update] add setting button to the row of Task 2022-08-10 17:59:33 +08:00
108000207 89e80a67af [update] add the router for Project(scheduler) 2022-08-10 14:02:44 +08:00
nthu1080112244 868577de7d [update] new comtrol panel block 2022-08-10 12:06:35 +08:00
sss28072637 82dfb8a5ff Merge branch 'release/v1.3.0/replay-capture-sgFilter' of https://gitlab.com/wisetop/controller/wisetopvue into release/v1.3.0/replay-capture-sgFilter 2022-08-09 17:49:08 +08:00
peterlu14 8b7b92bffb [update] add eis ca mode 2022-08-09 14:54:32 +08:00
peterlu14 1b38bd1c00 [debug] fix library rename cause scheduler not showing problem 2022-08-09 14:53:12 +08:00
peterlu14 e2e0b5609a [update] add -sync-parameter 2022-08-09 14:18:38 +08:00
sss28072637 726e262124 [debug] fix dataZoom of Slider 2022-08-09 11:16:25 +08:00
peterlu14 ab630b88e6 [update] fix replay show panel (x-axis not yet) 2022-08-09 09:11:56 +08:00
peterlu14 d83ae9370f remove brush in factory & hide value 2022-08-08 17:51:51 +08:00
peterlu14 a11393f512 Merge branch 'dev/sg-filter' into release/v1.3.0/replay-capture-sgFilter 2022-08-08 17:34:02 +08:00
peterlu14 69d604045e Merge remote-tracking branch 'origin/testing/echarts-update' into release/v1.3.0/replay-capture-sgFilter 2022-08-08 17:32:09 +08:00
peterlu14 26cb680e6f Merge remote-tracking branch 'origin/dev/capture_chartData' into release/v1.3.0/replay-capture-sgFilter 2022-08-08 17:31:50 +08:00
peterlu14 815754ddf6 [debug] fix file name not refresh problem 2022-08-08 17:25:55 +08:00
peterlu14 d29a5a11e1 [update] fix ca mode naming problem 2022-08-08 17:05:42 +08:00
peterlu14 f1781037be [update] sg-filter 2022-08-08 17:03:42 +08:00
108000207 cfab65e4a0 [update] check the calculation of specific integral done 2022-08-08 16:43:52 +08:00
sss28072637 fdd8c29bfb [update] finish capture data & boundaryGap 2022-08-08 16:36:09 +08:00
108000207 ad4d31ce64 [update] SpecificIntegral component works 2022-08-08 10:29:21 +08:00
sss28072637 5a9349d903 [update] add boundaryGap (need to be adjustable) 2022-08-05 18:23:10 +08:00
108000207 e1453cf107 [update] new component for Specific Integral, but haven't connect with TopControlPanel 2022-08-05 18:18:44 +08:00
108000207 1453e70915 [update] add auto refresh after blur the va-input 2022-08-05 18:00:37 +08:00
108000207 2791d20173 [update] add va-input for the brush boundary 2022-08-05 17:36:52 +08:00
108000207 bd314b03dc [update] add specific integral on replay 2022-08-05 11:33:11 +08:00
sss28072637 a801c0626a [update] add the new function of capturing chart to a new chart 2022-08-04 17:47:34 +08:00
peterlu14 5f3f3110d9 [update] fix loading 2022-08-04 13:33:38 +08:00
peterlu14 41b00129ef [update] echarts update version 5.3.3 2022-08-04 10:39:27 +08:00
peterlu14 13cb610302 Merge branch 'release/v1.2.8/realtime-tool' into testing/echarts-update 2022-08-04 10:14:54 +08:00
peterlu14 b7b70b86e2 Merge remote-tracking branch 'origin/dev/fix_dataZoom' into release/v1.2.8/realtime-tool 2022-08-03 14:50:36 +08:00
sss28072637 2575a97894 [debug] fix real-time dataZoom bug 2022-08-03 14:45:38 +08:00
peterlu14 a1f09942d9 Merge branch 'release/v1.2.9/fix-testing-bugs' into release/v1.2.8/realtime-tool 2022-08-02 18:42:49 +08:00
peterlu14 e9dc718d85 [update] fix cache with controller id 2022-08-02 16:25:47 +08:00
108000207 2f7a6b97e7 Merge branch 'dev/replay-calculation' into release/v1.2.8/realtime-tool 2022-08-02 14:35:31 +08:00
108000207 11a6de5e57 [update] add the getPanelInfo for tooltips formatter 2022-08-02 14:21:13 +08:00
peterlu14 7630951470 Merge remote-tracking branch 'origin/dev/realTimeDisplay_realTimeCalculation' into release/v1.2.8/realtime-tool 2022-08-02 12:52:16 +08:00
nthu1080112244 eb672d9c0a [update] real time cycle display 2022-08-02 12:51:19 +08:00
sss28072637 566f59e29c fix replay bugs, add integral in I-V mode(replay & realtime) and fix integral bugs 2022-08-01 18:22:01 +08:00
peterlu14 f06003304a Merge branch 'release/v1.2.9/fix-testing-bugs' into release/v1.2.8/realtime-tool 2022-07-29 14:54:26 +08:00
peterlu14 c0fc13c451 [update] cp-mode rename 2022-07-29 14:54:07 +08:00
peterlu14 ab1df2cfe1 [update] add time duration in excel and replay & add cp mode volt unit 2022-07-29 10:16:05 +08:00
peterlu14 0b01d6c785 [update] fix display problem & help pic 2022-07-28 16:56:26 +08:00
peterlu14 d769a50459 [debug] charge/discharge value error 2022-07-28 14:58:47 +08:00
peterlu14 dac276c9de [debug] fix cc mode charge display error 2022-07-28 14:40:36 +08:00
peterlu14 65c00031e3 [debug] fix volt step unit error 2022-07-28 10:35:51 +08:00
peterlu14 0ff3dd556f [update] remove vue warn 2022-07-28 10:30:09 +08:00
peterlu14 968c578cee Merge branch 'dev/realTimeDisplay_realTimeCalculation' into 'release/v1.2.8/realtime-tool'
[debug]  fix the conflict between display tool and funtional tool

See merge request wisetop/controller/wisetopvue!1
2022-07-28 02:22:44 +00:00
peterlu14 b3510b1990 [debug] fix volt step unit error 2022-07-28 10:05:47 +08:00
108000207 7fc8d24a71 [update] add replay functional, need to check the time gap 2022-07-27 18:31:52 +08:00
nthu1080112244 35d45a36a4 [update] time-axis formatter 2022-07-27 18:31:16 +08:00
nthu1080112244 f1a55c3cd1 [debug] remove useless code 2022-07-27 14:09:20 +08:00
nthu1080112244 2577dcba9a [update] 1. built and use CanvasChartTable.js
2. merge real time functional amd real time display
                3. tooltip update
2022-07-27 13:41:33 +08:00
108000207 f2709241d2 [init] add CanvasChartReplayCalculation component 2022-07-27 09:56:20 +08:00
ROY 632762ce14 [update] library EliteEIS rename cause replay problem 2022-07-26 18:29:34 +08:00
sss28072637 63b627622b [update] use setTimeOut to make the emit from changeScale work 2022-07-26 18:07:30 +08:00
ROY e4e89a414a [update] fix library rename replay nameing bug 2022-07-26 14:00:15 +08:00
ROY 921166cdc7 [update] update library name & change global chart setting 2022-07-26 11:05:50 +08:00
peterlu14 a3e7c7e2a6 Merge remote-tracking branch 'origin/dev/realTimeDisplayNew' into release/v1.2.8/realtime-tool 2022-07-26 09:53:25 +08:00
peterlu14 7469d270d0 Merge remote-tracking branch 'origin/dev/realtime-tool-fixed' into release/v1.2.8/realtime-tool 2022-07-26 09:53:21 +08:00
nthu1080112244 3c4676ec2c [update] construct new table for chart axis unit 2022-07-26 09:45:49 +08:00
sss28072637 265c363858 fix real-time tooltips 2022-07-25 14:14:26 +08:00
peterlu14 89da594392 Merge remote-tracking branch 'origin/dev/haolung' into release/v1.2.8/realtime-tool 2022-07-22 16:24:33 +08:00
sss28072637 436ed27479 fix button bug 2022-07-22 14:55:42 +08:00
peterlu14 ea14ee2f3e [update] remove redundence code 2022-07-22 14:31:16 +08:00
peterlu14 4416367acf [update] fix replay tooltip problem 2022-07-22 14:31:13 +08:00
peterlu14 e44c1e4c18 [update] fix merge config table problem 2022-07-22 14:31:09 +08:00
peterlu14 4910719aa4 Merge remote-tracking branch 'origin/dev/real_time_value' into release/v1.2.8/realtime-tool 2022-07-22 14:30:32 +08:00
peterlu14 223e898d5e [update] fix config-table rename problem ( download, replay ) 2022-07-22 14:25:05 +08:00
sss28072637 1e80731438 separate the calculation file 2022-07-22 14:17:09 +08:00
peterlu14 d3d080eb08 [update] add EIS mimi 2022-07-22 10:34:07 +08:00
nthu1080112244 0bd84d865f [update] integrate axis unit, tooltip information 2022-07-22 09:41:40 +08:00
sss28072637 b14488cf49 simplify the code (ver1) 2022-07-21 17:08:49 +08:00
peterlu14 4dda2d0a6a [update] switch page remove cache fix 2022-07-21 17:02:16 +08:00
sss28072637 3460a0bfa0 fix time axisLabel 2022-07-21 11:46:47 +08:00
sss28072637 90738611eb (07/20) finish differential, log, integral, add additional function, fix bugs and clear console log 2022-07-20 17:12:30 +08:00
peterlu14 35ba66ddd6 Merge branch 'release/v1.2.5/task_configuration' into release/v1.2.7/scheduler-parameter 2022-07-20 09:53:03 +08:00
peterlu14 4c3c63a0ba [update] schedule parameter fix & config-table add default value 2022-07-20 09:52:40 +08:00
sss28072637 d22653a5a5 clear console error 2022-07-19 16:38:39 +08:00
sss28072637 05cae92b12 finish integral, differential and log 2022-07-19 14:59:08 +08:00
sss28072637 adbf30f08d Merge remote-tracking branch 'origin/release/v1.2.5/task_configuration' into dev/haolung 2022-07-19 11:32:16 +08:00
nthu1080112244 5fe321828a Merge remote-tracking branch 'origin/release/v1.2.5/task_configuration' into dev/real_time_value 2022-07-19 11:30:21 +08:00
peterlu14 ca823d174b [update] reset series data type error fix 2022-07-19 11:26:46 +08:00
nthu1080112244 2e573e2c72 [update] add coment 2022-07-19 11:22:55 +08:00
nthu1080112244 84d136d4cf [update] real time display modularization 2022-07-18 18:28:23 +08:00
nthu1080112244 9b296c45bd [update] complete real time value display 2022-07-18 15:13:16 +08:00
nthu1080112244 ef9db8bee2 Merge commit 'bcf7b51dc6f0c241ab2f8bd3fdffb4173a5e7693' into dev/real_time_value 2022-07-18 14:15:23 +08:00
sss28072637 175f4ef23e Merge remote-tracking branch 'origin/release/v1.2.5/task_configuration' into dev/haolung 2022-07-18 10:28:38 +08:00
sss28072637 eba7c080b4 merge_0718 2022-07-18 09:55:05 +08:00
nthu1080112244 7c4515521d [update] unit correction, real time value bar 2022-07-15 19:40:34 +08:00
peterlu14 3db09734d2 [update] use deviceParameterWindow instead 2022-07-15 10:08:24 +08:00
peterlu14 c0e3a9c61a [update] rename param-table to config-table & add api to config 2022-07-15 10:08:24 +08:00
peterlu14 bcf7b51dc6 [update] mapping unify format string 2022-07-15 10:05:24 +08:00
peterlu14 ba660ac952 [update] fix girdsource not clear problem 2022-07-14 10:21:39 +08:00
sss28072637 1062aea8db fix tooltip constructor parameters, start / stop clicked reset, clear console errors, add differential function, get timeIndex automatically 2022-07-13 16:33:17 +08:00
sss28072637 b1f9edc624 Merge remote-tracking branch 'origin/release/v1.2.5/task_configuration' into dev/haolung 2022-07-13 09:37:41 +08:00
sss28072637 9210646611 add comments 2022-07-12 18:17:38 +08:00
sss28072637 de2315cd5b finish integral and log 2022-07-12 17:33:01 +08:00
sss28072637 ec231aa368 fix stop mode intergration 2022-07-12 15:33:21 +08:00
nthu1080112244 7b6948d027 Merge remote-tracking branch 'origin/release/v1.2.5/task_configuration' into dev/real_time_value 2022-07-12 15:15:12 +08:00
nthu1080112244 28f1aef82c [update] default real time representation 2022-07-12 15:14:31 +08:00
sss28072637 908db19110 finish mode switch button 2022-07-12 14:06:12 +08:00
sss28072637 9520e5102c finish integral of VT_mode 2022-07-12 12:02:58 +08:00
peterlu14 d171d8b572 [update] only refresh chart which device running 2022-07-12 10:41:43 +08:00
peterlu14 1e57bde1df [update] chartID uuid && fix mappingID -1 && reset series data && chart created manual or default 2022-07-12 10:38:04 +08:00
peterlu14 0946b01a41 [update] prop chartID add new type 2022-07-12 10:30:36 +08:00
peterlu14 a25e784fd4 Merge branch 'release/v1.2.4/develop_env_var' 2022-07-07 09:35:39 +08:00
peterlu14 ff18fdd8bd [update] add development env variable to control websocket ip 2022-06-29 15:58:23 +08:00
peterlu14 4c4631e89b [update] add debug page 2022-06-29 11:42:03 +08:00
peterlu14 7480717cac Merge branch 'release/v1.2.2/led_testing&download_all' 2022-06-24 15:11:44 +08:00
peterlu14 a29d32fd0f [update] add download all 2022-06-23 20:01:41 +08:00
peterlu14 942e98199e [update] add developer page with LED testing 2022-06-23 20:00:40 +08:00
peterlu14 482caf9650 Merge branch 'release/v.1.2.1/restruct_taskInfo_and_param' 2022-06-23 17:50:36 +08:00
139 changed files with 7751 additions and 2136 deletions
+110 -16
View File
@@ -1217,6 +1217,11 @@
"@hapi/hoek": "^8.3.0"
}
},
"@hyjiacan/vue-slideout": {
"version": "2.5.9",
"resolved": "https://registry.npmjs.org/@hyjiacan/vue-slideout/-/vue-slideout-2.5.9.tgz",
"integrity": "sha512-SSf0QaENGt9B2We8lL5QF+gNK7/pHqUEA8SiwUKtMTDj2rbjhGYFpCD+grV7oAAynGdiEIhQ3b3Mphh9/+keBg=="
},
"@intervolga/optimize-cssnano-plugin": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@intervolga/optimize-cssnano-plugin/-/optimize-cssnano-plugin-1.0.6.tgz",
@@ -2351,6 +2356,12 @@
}
}
},
"@vue/composition-api": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.7.0.tgz",
"integrity": "sha512-hxOgLYR+wjuPX9bkP2pAPlqUs98XxBoa9DSLyp1z6+YR92wC42PZcZKs4d+VRtcv4udOv041Kss+F6ap5nj8YA==",
"dev": true
},
"@vue/eslint-config-standard": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@vue/eslint-config-standard/-/eslint-config-standard-5.1.2.tgz",
@@ -4754,6 +4765,11 @@
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"complex.js": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.1.tgz",
"integrity": "sha512-8njCHOTtFFLtegk6zQo0kkVX1rngygb/KQI6z1qZxlFI3scluC+LVTCFbrkWjBv4vvLlbQ9t88IPMC6k95VTTg=="
},
"component-emitter": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
@@ -5684,6 +5700,11 @@
"map-obj": "^1.0.0"
}
},
"decimal.js": {
"version": "10.3.1",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz",
"integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ=="
},
"decode-uri-component": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
@@ -6199,11 +6220,19 @@
}
},
"echarts": {
"version": "4.9.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
"integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz",
"integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==",
"requires": {
"zrender": "4.3.2"
"tslib": "2.3.0",
"zrender": "5.3.2"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"editorconfig": {
@@ -6485,6 +6514,11 @@
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
"dev": true
},
"escape-latex": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
"integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@@ -7747,6 +7781,11 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true
},
"fraction.js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
"integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA=="
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@@ -9399,6 +9438,11 @@
"html-escaper": "^2.0.0"
}
},
"javascript-natural-sort": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw=="
},
"javascript-stringify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.0.1.tgz",
@@ -11225,6 +11269,32 @@
"resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz",
"integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg=="
},
"mathjs": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-11.0.1.tgz",
"integrity": "sha512-Kgm+GcTxwD68zupr7BPK0yrlWpTh2q8sMH6VcBcQe5+JCBqcwOrBxBF11WPah7hVv0NCLDnJnFTiXtik1Phasg==",
"requires": {
"@babel/runtime": "^7.18.9",
"complex.js": "^2.1.1",
"decimal.js": "^10.3.1",
"escape-latex": "^1.2.0",
"fraction.js": "^4.2.0",
"javascript-natural-sort": "^0.7.1",
"seedrandom": "^3.0.5",
"tiny-emitter": "^2.1.0",
"typed-function": "^3.0.0"
},
"dependencies": {
"@babel/runtime": {
"version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
}
}
},
"mathml-tag-names": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
@@ -14185,9 +14255,9 @@
"dev": true
},
"resize-detector": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/resize-detector/-/resize-detector-0.1.10.tgz",
"integrity": "sha512-iLcXC8A6Fb0DfA+TRiywrK/0A22bFqkhntjMJMEzXDA4XkcEkfwpNbv7W8iewUiD0xYIaeiXOfiEehTqGKsUFw=="
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/resize-detector/-/resize-detector-0.3.0.tgz",
"integrity": "sha512-R/tCuvuOHQ8o2boRP6vgx8hXCCy87H1eY9V5imBYeVNyNVpuL9ciReSccLj2gDcax9+2weXy3bc8Vv+NRXeEvQ=="
},
"resolve": {
"version": "1.17.0",
@@ -14475,6 +14545,11 @@
}
}
},
"seedrandom": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
"integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
@@ -16544,6 +16619,11 @@
"mime-types": "~2.1.24"
}
},
"typed-function": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/typed-function/-/typed-function-3.0.0.tgz",
"integrity": "sha512-mKJKkt2xYxJUuMD7jyfgUxfn5KCsCxkEKBVjep5yYellJJ5aEDO2QUAmIGdvcZmfQnIrplkzELIaG+5b1475qg=="
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
@@ -17101,14 +17181,18 @@
"vue": "^2.6.9"
}
},
"vue-demi": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.5.tgz",
"integrity": "sha512-tO3K2bML3AwiHmVHeKCq6HLef2st4zBXIV5aEkoJl6HZ+gJWxWv2O8wLH8qrA3SX3lDoTDHNghLX1xZg83MXvw=="
},
"vue-echarts": {
"version": "5.0.0-beta.0",
"resolved": "https://registry.npmjs.org/vue-echarts/-/vue-echarts-5.0.0-beta.0.tgz",
"integrity": "sha512-QZFKGXDAYFQo+F20REpzcdLx79nsl4kOorJRpN+08aYq4YiIlmtWss1Lxadm7Fo+NYyWm8nnT+h4xHv3uqWIDQ==",
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/vue-echarts/-/vue-echarts-6.2.3.tgz",
"integrity": "sha512-xHzUvgsgk/asJTcNa8iVVwoovZU3iEUHvmBa3bzbiP3Y6OMxM1YXsoWOKVmVVaUusGs4ob4pSwjwNy2FemAz9w==",
"requires": {
"core-js": "^3.4.4",
"lodash": "^4.17.15",
"resize-detector": "^0.1.10"
"resize-detector": "^0.3.0",
"vue-demi": "^0.13.2"
}
},
"vue-epic-bus": {
@@ -18563,9 +18647,19 @@
}
},
"zrender": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.2.tgz",
"integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz",
"integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
}
}
+6 -3
View File
@@ -5,7 +5,7 @@
"description": "Vue.js admin template",
"author": "smartapant <smartapant@gmail.com>",
"scripts": {
"serve": "vue-cli-service serve",
"serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"lint:style": "stylelint --fix src/**/*.{vue,htm,html,css,sss,less,scss}",
@@ -15,6 +15,7 @@
"dependencies": {
"@fontsource/source-code-pro": "^4.5.0",
"@fontsource/source-sans-pro": "^4.5.1",
"@hyjiacan/vue-slideout": "^2.5.9",
"@types/jest": "^24.0.11",
"amcharts3": "^3.21.14",
"ammap3": "^3.21.14",
@@ -25,7 +26,7 @@
"chart.js": "^2.9.3",
"core-js": "3",
"detect-browser": "^4.8.0",
"echarts": "^4.9.0",
"echarts": "^5.3.3",
"element-resize-detector": "^1.1.15",
"epic-spinners": "^1.1.0",
"extend": "3.0.2",
@@ -37,6 +38,7 @@
"leaflet-map": "^0.2.1",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"mathjs": "^11.0.1",
"medium-editor": "^5.23.3",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
@@ -53,7 +55,7 @@
"vue-clipboard2": "^0.3.1",
"vue-color": "^2.7.0",
"vue-ctk-date-time-picker": "^2.5.0",
"vue-echarts": "^5.0.0-beta.0",
"vue-echarts": "^6.2.3",
"vue-epic-bus": "^0.1.2",
"vue-final-modal": "^2.4.1",
"vue-gtm": "^2.2.0",
@@ -77,6 +79,7 @@
"@vue/cli-plugin-pwa": "^4.0.5",
"@vue/cli-plugin-unit-jest": "^4.0.5",
"@vue/cli-service": "^4.0.5",
"@vue/composition-api": "^1.7.0",
"@vue/eslint-config-standard": "^5.0.0",
"@vue/test-utils": "^1.0.0-beta.29",
"autoprefixer": "^9.7.2",
+3
View File
@@ -2,6 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
+1 -1
View File
@@ -15,7 +15,7 @@ export default {
// Temporary config for 2.1.
contextConfig: {
gradient: true,
shadow: 'lg', // 3 states: 'sm', 'lg', undefined (no shadow).
shadow: 'lg', // 3 states: 'sm', 'sddssslg', undefined (no shadow).
invertedColor: false,
},
}
+56 -15
View File
@@ -14,16 +14,7 @@ import YmapPlugin from 'vue-yandex-maps'
import VueClipboard from 'vue-clipboard2'
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/dataZoom'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/legend/ScrollableLegendModel.js'
import 'echarts/lib/component/legend/ScrollableLegendView.js'
import 'echarts/lib/component/legend/scrollableLegendAction.js'
import 'echarts/lib/component/axisPointer'
import 'echarts/lib/component/grid'
import 'echarts/lib/component/markArea'
import { use } from 'echarts/core'
import VueMqtt from 'vue-mqtt'
import global_ from '../data/global/global'
@@ -39,18 +30,65 @@ import 'vue-toastification/dist/index.css'
import api from '@/data/api/index'
import localforage from 'localforage'
import SlideOut from '@hyjiacan/vue-slideout'
import '@hyjiacan/vue-slideout/lib/slideout.css'
import '../metrics'
import '../registerServiceWorker'
// import ECharts modules manually to reduce bundle size
import {
CanvasRenderer,
} from 'echarts/renderers'
import {
LineChart,
PieChart,
BarChart,
} from 'echarts/charts'
import {
GridComponent,
TooltipComponent,
LegendComponent,
TitleComponent,
DataZoomComponent,
BrushComponent,
ToolboxComponent,
} from 'echarts/components'
use([
CanvasRenderer,
LineChart,
BarChart,
PieChart,
GridComponent,
TooltipComponent,
ToolboxComponent,
LegendComponent,
TitleComponent,
DataZoomComponent,
BrushComponent,
])
localforage.config({ name: 'bioprovue' })
let MqttUrl
// for developer
if (process.env.NODE_ENV === 'development') {
MqttUrl = 'ws://192.168.5.66:8083'
// MqttUrl = 'ws://192.168.5.57:8083'
// MqttUrl = 'ws://192.168.5.57:8080'
} else {
// for user
MqttUrl = `ws://${location.href.split('/')[2]}:8083`
}
if (process.env.VUE_APP_BUILD_VERSION) {
// eslint-disable-next-line
const message = `%c${'Build_information:'}\n %c${'Version'}: %c${VERSION},\n %c${'Timestamp'}: %c${TIMESTAMP},\n %c${'Commit'}: %c${COMMIT}`
const message = `%c${'Build_information:'}\n %c${'Version'}: %c${VERSION},\n %c${'Timestamp'}: %c${TIMESTAMP},\n %c${'Commit'}: %c${COMMIT} %c${'Mqtt'}: %c${MqttUrl}`
// eslint-disable-next-line
console.info(
message,
'color: blue;', 'color: red;', 'color: blue;', 'color: red;', 'color: blue;', 'color: red;', 'color: blue;',
'color: blue;', 'color: red;', 'color: blue;', 'color: red;', 'color: blue;', 'color: red;', 'color: blue;', 'color: red;', 'color: blue;',
)
}
@@ -61,11 +99,14 @@ Vue.component('chart', ECharts)
Vue.use(VueWorker)
Vue.use(VueAxios, axios)
Vue.use(Toast)
// Vue.use(VueMqtt, 'ws://52.194.17.114:8083')
Vue.use(VueMqtt, 'ws://' + location.href.split('/')[2] + ':8083')
// Vue.use(VueMqtt, 'ws://' + location.href.split('/')[2] + ':8083')
// Vue.use(VueMqtt, 'ws://' + '192.168.151.125' + ':8083')
// Vue.use(VueMqtt, 'ws://' + '192.168.3.211' + ':8083')
Vue.use(VueMqtt, MqttUrl)
Vue.use(SlideOut, {
// set default props here
})
Vue.prototype.API = api
Vue.prototype.GLOBAL = global_
+4
View File
@@ -0,0 +1,4 @@
<svg width="55" height="30" viewBox="0 0 55 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="55" height="30" rx="15" fill="#45589E"/>
<path d="M10.8849 20V9.81818H13.0376V18.2251H17.4027V20H10.8849ZM22.2388 20.1491C21.4666 20.1491 20.7987 19.9851 20.2353 19.657C19.6751 19.3255 19.2426 18.8648 18.9377 18.2749C18.6328 17.6816 18.4803 16.9938 18.4803 16.2116C18.4803 15.4228 18.6328 14.7334 18.9377 14.1435C19.2426 13.5502 19.6751 13.0895 20.2353 12.7614C20.7987 12.4299 21.4666 12.2642 22.2388 12.2642C23.0111 12.2642 23.6773 12.4299 24.2374 12.7614C24.8008 13.0895 25.235 13.5502 25.54 14.1435C25.8449 14.7334 25.9973 15.4228 25.9973 16.2116C25.9973 16.9938 25.8449 17.6816 25.54 18.2749C25.235 18.8648 24.8008 19.3255 24.2374 19.657C23.6773 19.9851 23.0111 20.1491 22.2388 20.1491ZM22.2488 18.5085C22.6001 18.5085 22.8934 18.4091 23.1287 18.2102C23.3641 18.008 23.5414 17.733 23.6607 17.3849C23.7833 17.0369 23.8446 16.6409 23.8446 16.1967C23.8446 15.7526 23.7833 15.3565 23.6607 15.0085C23.5414 14.6605 23.3641 14.3854 23.1287 14.1832C22.8934 13.9811 22.6001 13.88 22.2488 13.88C21.8941 13.88 21.5958 13.9811 21.3539 14.1832C21.1152 14.3854 20.9346 14.6605 20.812 15.0085C20.6926 15.3565 20.633 15.7526 20.633 16.1967C20.633 16.6409 20.6926 17.0369 20.812 17.3849C20.9346 17.733 21.1152 18.008 21.3539 18.2102C21.5958 18.4091 21.8941 18.5085 22.2488 18.5085ZM30.8148 23.0227C30.1287 23.0227 29.5404 22.9283 29.0499 22.7393C28.5627 22.5537 28.1749 22.3002 27.8865 21.9787C27.5982 21.6572 27.4109 21.2959 27.3248 20.8949L29.2836 20.6314C29.3432 20.7839 29.4377 20.9264 29.5669 21.0589C29.6962 21.1915 29.8669 21.2976 30.079 21.3771C30.2944 21.46 30.5563 21.5014 30.8645 21.5014C31.3252 21.5014 31.7047 21.3887 32.003 21.1634C32.3046 20.9413 32.4554 20.5684 32.4554 20.0447V18.6477H32.3659C32.2731 18.8598 32.1339 19.0604 31.9483 19.2493C31.7627 19.4382 31.5241 19.5923 31.2324 19.7116C30.9408 19.831 30.5927 19.8906 30.1884 19.8906C29.615 19.8906 29.093 19.758 28.6223 19.4929C28.155 19.2244 27.7821 18.8151 27.5037 18.2649C27.2286 17.7114 27.0911 17.0121 27.0911 16.1669C27.0911 15.3018 27.2319 14.5793 27.5137 13.9993C27.7954 13.4193 28.1699 12.9851 28.6373 12.6967C29.1079 12.4084 29.6233 12.2642 30.1834 12.2642C30.611 12.2642 30.9689 12.3371 31.2573 12.483C31.5456 12.6255 31.7776 12.8045 31.9533 13.0199C32.1323 13.232 32.2698 13.4408 32.3659 13.6463H32.4455V12.3636H34.5485V20.0746C34.5485 20.7242 34.3894 21.2678 34.0712 21.7053C33.753 22.1428 33.3122 22.4709 32.7488 22.6896C32.1886 22.9117 31.544 23.0227 30.8148 23.0227ZM30.8596 18.2997C31.2009 18.2997 31.4893 18.2152 31.7246 18.0462C31.9632 17.8738 32.1455 17.6286 32.2715 17.3104C32.4007 16.9889 32.4654 16.6044 32.4654 16.157C32.4654 15.7095 32.4024 15.3217 32.2765 14.9936C32.1505 14.6622 31.9682 14.4053 31.7296 14.223C31.4909 14.0407 31.2009 13.9496 30.8596 13.9496C30.5115 13.9496 30.2182 14.044 29.9796 14.233C29.7409 14.4186 29.5603 14.6771 29.4377 15.0085C29.315 15.34 29.2537 15.7228 29.2537 16.157C29.2537 16.5978 29.315 16.9789 29.4377 17.3004C29.5636 17.6186 29.7443 17.8655 29.9796 18.0412C30.2182 18.2135 30.5115 18.2997 30.8596 18.2997ZM38.2921 9.81818L40.3453 13.2884H40.4249L42.4881 9.81818H44.9192L41.812 14.9091L44.9888 20H42.513L40.4249 16.5249H40.3453L38.2573 20H35.7914L38.9782 14.9091L35.851 9.81818H38.2921Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg width="55" height="30" viewBox="0 0 55 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="55" height="30" rx="15" fill="#E34A4A"/>
<path d="M10.8849 20V9.81818H13.0376V18.2251H17.4027V20H10.8849ZM22.2388 20.1491C21.4666 20.1491 20.7987 19.9851 20.2353 19.657C19.6751 19.3255 19.2426 18.8648 18.9377 18.2749C18.6328 17.6816 18.4803 16.9938 18.4803 16.2116C18.4803 15.4228 18.6328 14.7334 18.9377 14.1435C19.2426 13.5502 19.6751 13.0895 20.2353 12.7614C20.7987 12.4299 21.4666 12.2642 22.2388 12.2642C23.0111 12.2642 23.6773 12.4299 24.2374 12.7614C24.8008 13.0895 25.235 13.5502 25.54 14.1435C25.8449 14.7334 25.9973 15.4228 25.9973 16.2116C25.9973 16.9938 25.8449 17.6816 25.54 18.2749C25.235 18.8648 24.8008 19.3255 24.2374 19.657C23.6773 19.9851 23.0111 20.1491 22.2388 20.1491ZM22.2488 18.5085C22.6001 18.5085 22.8934 18.4091 23.1287 18.2102C23.3641 18.008 23.5414 17.733 23.6607 17.3849C23.7833 17.0369 23.8446 16.6409 23.8446 16.1967C23.8446 15.7526 23.7833 15.3565 23.6607 15.0085C23.5414 14.6605 23.3641 14.3854 23.1287 14.1832C22.8934 13.9811 22.6001 13.88 22.2488 13.88C21.8941 13.88 21.5958 13.9811 21.3539 14.1832C21.1152 14.3854 20.9346 14.6605 20.812 15.0085C20.6926 15.3565 20.633 15.7526 20.633 16.1967C20.633 16.6409 20.6926 17.0369 20.812 17.3849C20.9346 17.733 21.1152 18.008 21.3539 18.2102C21.5958 18.4091 21.8941 18.5085 22.2488 18.5085ZM30.8148 23.0227C30.1287 23.0227 29.5404 22.9283 29.0499 22.7393C28.5627 22.5537 28.1749 22.3002 27.8865 21.9787C27.5982 21.6572 27.4109 21.2959 27.3248 20.8949L29.2836 20.6314C29.3432 20.7839 29.4377 20.9264 29.5669 21.0589C29.6962 21.1915 29.8669 21.2976 30.079 21.3771C30.2944 21.46 30.5563 21.5014 30.8645 21.5014C31.3252 21.5014 31.7047 21.3887 32.003 21.1634C32.3046 20.9413 32.4554 20.5684 32.4554 20.0447V18.6477H32.3659C32.2731 18.8598 32.1339 19.0604 31.9483 19.2493C31.7627 19.4382 31.5241 19.5923 31.2324 19.7116C30.9408 19.831 30.5927 19.8906 30.1884 19.8906C29.615 19.8906 29.093 19.758 28.6223 19.4929C28.155 19.2244 27.7821 18.8151 27.5037 18.2649C27.2286 17.7114 27.0911 17.0121 27.0911 16.1669C27.0911 15.3018 27.2319 14.5793 27.5137 13.9993C27.7954 13.4193 28.1699 12.9851 28.6373 12.6967C29.1079 12.4084 29.6233 12.2642 30.1834 12.2642C30.611 12.2642 30.9689 12.3371 31.2573 12.483C31.5456 12.6255 31.7776 12.8045 31.9533 13.0199C32.1323 13.232 32.2698 13.4408 32.3659 13.6463H32.4455V12.3636H34.5485V20.0746C34.5485 20.7242 34.3894 21.2678 34.0712 21.7053C33.753 22.1428 33.3122 22.4709 32.7488 22.6896C32.1886 22.9117 31.544 23.0227 30.8148 23.0227ZM30.8596 18.2997C31.2009 18.2997 31.4893 18.2152 31.7246 18.0462C31.9632 17.8738 32.1455 17.6286 32.2715 17.3104C32.4007 16.9889 32.4654 16.6044 32.4654 16.157C32.4654 15.7095 32.4024 15.3217 32.2765 14.9936C32.1505 14.6622 31.9682 14.4053 31.7296 14.223C31.4909 14.0407 31.2009 13.9496 30.8596 13.9496C30.5115 13.9496 30.2182 14.044 29.9796 14.233C29.7409 14.4186 29.5603 14.6771 29.4377 15.0085C29.315 15.34 29.2537 15.7228 29.2537 16.157C29.2537 16.5978 29.315 16.9789 29.4377 17.3004C29.5636 17.6186 29.7443 17.8655 29.9796 18.0412C30.2182 18.2135 30.5115 18.2997 30.8596 18.2997ZM38.2921 9.81818L40.3453 13.2884H40.4249L42.4881 9.81818H44.9192L41.812 14.9091L44.9888 20H42.513L40.4249 16.5249H40.3453L38.2573 20H35.7914L38.9782 14.9091L35.851 9.81818H38.2921Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg width="55" height="30" viewBox="0 0 55 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="55" height="30" rx="15" fill="#6CB0A4"/>
<path d="M10.8849 20V9.81818H13.0376V18.2251H17.4027V20H10.8849ZM22.2388 20.1491C21.4666 20.1491 20.7987 19.9851 20.2353 19.657C19.6751 19.3255 19.2426 18.8648 18.9377 18.2749C18.6328 17.6816 18.4803 16.9938 18.4803 16.2116C18.4803 15.4228 18.6328 14.7334 18.9377 14.1435C19.2426 13.5502 19.6751 13.0895 20.2353 12.7614C20.7987 12.4299 21.4666 12.2642 22.2388 12.2642C23.0111 12.2642 23.6773 12.4299 24.2374 12.7614C24.8008 13.0895 25.235 13.5502 25.54 14.1435C25.8449 14.7334 25.9973 15.4228 25.9973 16.2116C25.9973 16.9938 25.8449 17.6816 25.54 18.2749C25.235 18.8648 24.8008 19.3255 24.2374 19.657C23.6773 19.9851 23.0111 20.1491 22.2388 20.1491ZM22.2488 18.5085C22.6001 18.5085 22.8934 18.4091 23.1287 18.2102C23.3641 18.008 23.5414 17.733 23.6607 17.3849C23.7833 17.0369 23.8446 16.6409 23.8446 16.1967C23.8446 15.7526 23.7833 15.3565 23.6607 15.0085C23.5414 14.6605 23.3641 14.3854 23.1287 14.1832C22.8934 13.9811 22.6001 13.88 22.2488 13.88C21.8941 13.88 21.5958 13.9811 21.3539 14.1832C21.1152 14.3854 20.9346 14.6605 20.812 15.0085C20.6926 15.3565 20.633 15.7526 20.633 16.1967C20.633 16.6409 20.6926 17.0369 20.812 17.3849C20.9346 17.733 21.1152 18.008 21.3539 18.2102C21.5958 18.4091 21.8941 18.5085 22.2488 18.5085ZM30.8148 23.0227C30.1287 23.0227 29.5404 22.9283 29.0499 22.7393C28.5627 22.5537 28.1749 22.3002 27.8865 21.9787C27.5982 21.6572 27.4109 21.2959 27.3248 20.8949L29.2836 20.6314C29.3432 20.7839 29.4377 20.9264 29.5669 21.0589C29.6962 21.1915 29.8669 21.2976 30.079 21.3771C30.2944 21.46 30.5563 21.5014 30.8645 21.5014C31.3252 21.5014 31.7047 21.3887 32.003 21.1634C32.3046 20.9413 32.4554 20.5684 32.4554 20.0447V18.6477H32.3659C32.2731 18.8598 32.1339 19.0604 31.9483 19.2493C31.7627 19.4382 31.5241 19.5923 31.2324 19.7116C30.9408 19.831 30.5927 19.8906 30.1884 19.8906C29.615 19.8906 29.093 19.758 28.6223 19.4929C28.155 19.2244 27.7821 18.8151 27.5037 18.2649C27.2286 17.7114 27.0911 17.0121 27.0911 16.1669C27.0911 15.3018 27.2319 14.5793 27.5137 13.9993C27.7954 13.4193 28.1699 12.9851 28.6373 12.6967C29.1079 12.4084 29.6233 12.2642 30.1834 12.2642C30.611 12.2642 30.9689 12.3371 31.2573 12.483C31.5456 12.6255 31.7776 12.8045 31.9533 13.0199C32.1323 13.232 32.2698 13.4408 32.3659 13.6463H32.4455V12.3636H34.5485V20.0746C34.5485 20.7242 34.3894 21.2678 34.0712 21.7053C33.753 22.1428 33.3122 22.4709 32.7488 22.6896C32.1886 22.9117 31.544 23.0227 30.8148 23.0227ZM30.8596 18.2997C31.2009 18.2997 31.4893 18.2152 31.7246 18.0462C31.9632 17.8738 32.1455 17.6286 32.2715 17.3104C32.4007 16.9889 32.4654 16.6044 32.4654 16.157C32.4654 15.7095 32.4024 15.3217 32.2765 14.9936C32.1505 14.6622 31.9682 14.4053 31.7296 14.223C31.4909 14.0407 31.2009 13.9496 30.8596 13.9496C30.5115 13.9496 30.2182 14.044 29.9796 14.233C29.7409 14.4186 29.5603 14.6771 29.4377 15.0085C29.315 15.34 29.2537 15.7228 29.2537 16.157C29.2537 16.5978 29.315 16.9789 29.4377 17.3004C29.5636 17.6186 29.7443 17.8655 29.9796 18.0412C30.2182 18.2135 30.5115 18.2997 30.8596 18.2997ZM35.677 9.81818H38.0882L40.41 14.2031H40.5094L42.8311 9.81818H45.2424L41.5286 16.4006V20H39.3908V16.4006L35.677 9.81818Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg width="55" height="30" viewBox="0 0 55 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="55" height="30" rx="15" fill="#E34A4A"/>
<path d="M10.8849 20V9.81818H13.0376V18.2251H17.4027V20H10.8849ZM22.2388 20.1491C21.4666 20.1491 20.7987 19.9851 20.2353 19.657C19.6751 19.3255 19.2426 18.8648 18.9377 18.2749C18.6328 17.6816 18.4803 16.9938 18.4803 16.2116C18.4803 15.4228 18.6328 14.7334 18.9377 14.1435C19.2426 13.5502 19.6751 13.0895 20.2353 12.7614C20.7987 12.4299 21.4666 12.2642 22.2388 12.2642C23.0111 12.2642 23.6773 12.4299 24.2374 12.7614C24.8008 13.0895 25.235 13.5502 25.54 14.1435C25.8449 14.7334 25.9973 15.4228 25.9973 16.2116C25.9973 16.9938 25.8449 17.6816 25.54 18.2749C25.235 18.8648 24.8008 19.3255 24.2374 19.657C23.6773 19.9851 23.0111 20.1491 22.2388 20.1491ZM22.2488 18.5085C22.6001 18.5085 22.8934 18.4091 23.1287 18.2102C23.3641 18.008 23.5414 17.733 23.6607 17.3849C23.7833 17.0369 23.8446 16.6409 23.8446 16.1967C23.8446 15.7526 23.7833 15.3565 23.6607 15.0085C23.5414 14.6605 23.3641 14.3854 23.1287 14.1832C22.8934 13.9811 22.6001 13.88 22.2488 13.88C21.8941 13.88 21.5958 13.9811 21.3539 14.1832C21.1152 14.3854 20.9346 14.6605 20.812 15.0085C20.6926 15.3565 20.633 15.7526 20.633 16.1967C20.633 16.6409 20.6926 17.0369 20.812 17.3849C20.9346 17.733 21.1152 18.008 21.3539 18.2102C21.5958 18.4091 21.8941 18.5085 22.2488 18.5085ZM30.8148 23.0227C30.1287 23.0227 29.5404 22.9283 29.0499 22.7393C28.5627 22.5537 28.1749 22.3002 27.8865 21.9787C27.5982 21.6572 27.4109 21.2959 27.3248 20.8949L29.2836 20.6314C29.3432 20.7839 29.4377 20.9264 29.5669 21.0589C29.6962 21.1915 29.8669 21.2976 30.079 21.3771C30.2944 21.46 30.5563 21.5014 30.8645 21.5014C31.3252 21.5014 31.7047 21.3887 32.003 21.1634C32.3046 20.9413 32.4554 20.5684 32.4554 20.0447V18.6477H32.3659C32.2731 18.8598 32.1339 19.0604 31.9483 19.2493C31.7627 19.4382 31.5241 19.5923 31.2324 19.7116C30.9408 19.831 30.5927 19.8906 30.1884 19.8906C29.615 19.8906 29.093 19.758 28.6223 19.4929C28.155 19.2244 27.7821 18.8151 27.5037 18.2649C27.2286 17.7114 27.0911 17.0121 27.0911 16.1669C27.0911 15.3018 27.2319 14.5793 27.5137 13.9993C27.7954 13.4193 28.1699 12.9851 28.6373 12.6967C29.1079 12.4084 29.6233 12.2642 30.1834 12.2642C30.611 12.2642 30.9689 12.3371 31.2573 12.483C31.5456 12.6255 31.7776 12.8045 31.9533 13.0199C32.1323 13.232 32.2698 13.4408 32.3659 13.6463H32.4455V12.3636H34.5485V20.0746C34.5485 20.7242 34.3894 21.2678 34.0712 21.7053C33.753 22.1428 33.3122 22.4709 32.7488 22.6896C32.1886 22.9117 31.544 23.0227 30.8148 23.0227ZM30.8596 18.2997C31.2009 18.2997 31.4893 18.2152 31.7246 18.0462C31.9632 17.8738 32.1455 17.6286 32.2715 17.3104C32.4007 16.9889 32.4654 16.6044 32.4654 16.157C32.4654 15.7095 32.4024 15.3217 32.2765 14.9936C32.1505 14.6622 31.9682 14.4053 31.7296 14.223C31.4909 14.0407 31.2009 13.9496 30.8596 13.9496C30.5115 13.9496 30.2182 14.044 29.9796 14.233C29.7409 14.4186 29.5603 14.6771 29.4377 15.0085C29.315 15.34 29.2537 15.7228 29.2537 16.157C29.2537 16.5978 29.315 16.9789 29.4377 17.3004C29.5636 17.6186 29.7443 17.8655 29.9796 18.0412C30.2182 18.2135 30.5115 18.2997 30.8596 18.2997ZM35.677 9.81818H38.0882L40.41 14.2031H40.5094L42.8311 9.81818H45.2424L41.5286 16.4006V20H39.3908V16.4006L35.677 9.81818Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

+9
View File
@@ -0,0 +1,9 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0C23.2843 0 30 6.71573 30 15Z" fill="#D6860F"/>
<mask id="mask0_4_143" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="5" y="5" width="20" height="19">
<rect x="5" y="5" width="20" height="19" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_4_143)">
<path d="M20.8334 11.3333V9.75001H19.1667V8.16668H20.8334V6.58334H22.5V8.16668H24.1667V9.75001H22.5V11.3333H20.8334ZM7.50004 22.4167C7.04171 22.4167 6.64949 22.2618 6.32337 21.952C5.99671 21.6416 5.83337 21.2688 5.83337 20.8333V11.3333C5.83337 10.8979 5.99671 10.5253 6.32337 10.2155C6.64949 9.90518 7.04171 9.75001 7.50004 9.75001H10.125L11.6667 8.16668H16.6667V9.75001H12.3959L10.875 11.3333H7.50004V20.8333H20.8334V13.7083H22.5V20.8333C22.5 21.2688 22.337 21.6416 22.0109 21.952C21.6842 22.2618 21.2917 22.4167 20.8334 22.4167H7.50004ZM14.1667 19.6458C15.2084 19.6458 16.0939 19.2996 16.8234 18.6072C17.5523 17.9142 17.9167 17.0729 17.9167 16.0833C17.9167 15.0938 17.5523 14.2525 16.8234 13.5595C16.0939 12.8671 15.2084 12.5208 14.1667 12.5208C13.125 12.5208 12.2395 12.8671 11.51 13.5595C10.7812 14.2525 10.4167 15.0938 10.4167 16.0833C10.4167 17.0729 10.7812 17.9142 11.51 18.6072C12.2395 19.2996 13.125 19.6458 14.1667 19.6458ZM14.1667 18.0625C13.5834 18.0625 13.0903 17.8712 12.6875 17.4886C12.2848 17.1059 12.0834 16.6375 12.0834 16.0833C12.0834 15.5292 12.2848 15.0608 12.6875 14.6781C13.0903 14.2955 13.5834 14.1042 14.1667 14.1042C14.75 14.1042 15.2431 14.2955 15.6459 14.6781C16.0487 15.0608 16.25 15.5292 16.25 16.0833C16.25 16.6375 16.0487 17.1059 15.6459 17.4886C15.2431 17.8712 14.75 18.0625 14.1667 18.0625Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="15" fill="#8D8D8D"/>
<path d="M6.61364 12.0888C6.19934 12.0888 5.8241 11.9822 5.48793 11.7692C5.15412 11.5537 4.88897 11.2377 4.69247 10.821C4.49834 10.402 4.40128 9.88826 4.40128 9.27983C4.40128 8.65483 4.50189 8.13518 4.70312 7.72088C4.90436 7.30421 5.17188 6.9929 5.50568 6.78693C5.84186 6.5786 6.20999 6.47443 6.61009 6.47443C6.91548 6.47443 7.16998 6.52652 7.37358 6.63068C7.57955 6.73248 7.74527 6.86032 7.87074 7.0142C7.99858 7.16572 8.09564 7.31487 8.16193 7.46165H8.2081V4.72727H9.71733V12H8.22585V11.1264H8.16193C8.09091 11.2779 7.99029 11.4283 7.86009 11.5774C7.73224 11.7242 7.56534 11.8461 7.35938 11.9432C7.15578 12.0402 6.9072 12.0888 6.61364 12.0888ZM7.09304 10.8849C7.33688 10.8849 7.54285 10.8187 7.71094 10.6861C7.88139 10.5511 8.0116 10.3629 8.10156 10.1214C8.19389 9.87997 8.24006 9.59706 8.24006 9.27273C8.24006 8.94839 8.19508 8.66667 8.10511 8.42756C8.01515 8.18845 7.88494 8.00379 7.71449 7.87358C7.54403 7.74337 7.33688 7.67827 7.09304 7.67827C6.84446 7.67827 6.63494 7.74574 6.46449 7.88068C6.29403 8.01562 6.16501 8.20265 6.07741 8.44176C5.98982 8.68087 5.94602 8.95786 5.94602 9.27273C5.94602 9.58996 5.98982 9.8705 6.07741 10.1143C6.16738 10.3558 6.2964 10.5452 6.46449 10.6825C6.63494 10.8175 6.84446 10.8849 7.09304 10.8849ZM11.8951 14.0455C11.7033 14.0455 11.5234 14.0301 11.3553 13.9993C11.1896 13.9709 11.0523 13.9342 10.9434 13.8892L11.2843 12.7599C11.4618 12.8144 11.6216 12.844 11.7637 12.8487C11.9081 12.8535 12.0324 12.8203 12.1365 12.7493C12.2431 12.6783 12.3295 12.5575 12.3958 12.3871L12.4846 12.1562L10.5279 6.54545H12.1188L13.248 10.5511H13.3049L14.4448 6.54545H16.0463L13.9263 12.5895C13.8245 12.883 13.686 13.1387 13.5108 13.3565C13.338 13.5767 13.119 13.746 12.8539 13.8643C12.5887 13.9851 12.2691 14.0455 11.8951 14.0455Z" fill="white"/>
<path d="M15.6136 25.0888C15.1993 25.0888 14.8241 24.9822 14.4879 24.7692C14.1541 24.5537 13.889 24.2377 13.6925 23.821C13.4983 23.402 13.4013 22.8883 13.4013 22.2798C13.4013 21.6548 13.5019 21.1352 13.7031 20.7209C13.9044 20.3042 14.1719 19.9929 14.5057 19.7869C14.8419 19.5786 15.21 19.4744 15.6101 19.4744C15.9155 19.4744 16.17 19.5265 16.3736 19.6307C16.5795 19.7325 16.7453 19.8603 16.8707 20.0142C16.9986 20.1657 17.0956 20.3149 17.1619 20.4616H17.2081V17.7273H18.7173V25H17.2259V24.1264H17.1619C17.0909 24.2779 16.9903 24.4283 16.8601 24.5774C16.7322 24.7242 16.5653 24.8461 16.3594 24.9432C16.1558 25.0402 15.9072 25.0888 15.6136 25.0888ZM16.093 23.8849C16.3369 23.8849 16.5429 23.8187 16.7109 23.6861C16.8814 23.5511 17.0116 23.3629 17.1016 23.1214C17.1939 22.88 17.2401 22.5971 17.2401 22.2727C17.2401 21.9484 17.1951 21.6667 17.1051 21.4276C17.0152 21.1884 16.8849 21.0038 16.7145 20.8736C16.544 20.7434 16.3369 20.6783 16.093 20.6783C15.8445 20.6783 15.6349 20.7457 15.4645 20.8807C15.294 21.0156 15.165 21.2027 15.0774 21.4418C14.9898 21.6809 14.946 21.9579 14.946 22.2727C14.946 22.59 14.9898 22.8705 15.0774 23.1143C15.1674 23.3558 15.2964 23.5452 15.4645 23.6825C15.6349 23.8175 15.8445 23.8849 16.093 23.8849ZM21.2253 19.5455L22.2267 21.4524L23.253 19.5455H24.8049L23.2246 22.2727L24.8475 25H23.3027L22.2267 23.1143L21.1685 25H19.606L21.2253 22.2727L19.6628 19.5455H21.2253Z" fill="white"/>
<line x1="6.81281" y1="22.7756" x2="21.9396" y2="7.02154" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="15" fill="#E34A4A"/>
<path d="M6.61364 12.0888C6.19934 12.0888 5.8241 11.9822 5.48793 11.7692C5.15412 11.5537 4.88897 11.2377 4.69247 10.821C4.49834 10.402 4.40128 9.88826 4.40128 9.27983C4.40128 8.65483 4.50189 8.13518 4.70312 7.72088C4.90436 7.30421 5.17188 6.9929 5.50568 6.78693C5.84186 6.5786 6.20999 6.47443 6.61009 6.47443C6.91548 6.47443 7.16998 6.52652 7.37358 6.63068C7.57955 6.73248 7.74527 6.86032 7.87074 7.0142C7.99858 7.16572 8.09564 7.31487 8.16193 7.46165H8.2081V4.72727H9.71733V12H8.22585V11.1264H8.16193C8.09091 11.2779 7.99029 11.4283 7.86009 11.5774C7.73224 11.7242 7.56534 11.8461 7.35938 11.9432C7.15578 12.0402 6.9072 12.0888 6.61364 12.0888ZM7.09304 10.8849C7.33688 10.8849 7.54285 10.8187 7.71094 10.6861C7.88139 10.5511 8.0116 10.3629 8.10156 10.1214C8.19389 9.87997 8.24006 9.59706 8.24006 9.27273C8.24006 8.94839 8.19508 8.66667 8.10511 8.42756C8.01515 8.18845 7.88494 8.00379 7.71449 7.87358C7.54403 7.74337 7.33688 7.67827 7.09304 7.67827C6.84446 7.67827 6.63494 7.74574 6.46449 7.88068C6.29403 8.01562 6.16501 8.20265 6.07741 8.44176C5.98982 8.68087 5.94602 8.95786 5.94602 9.27273C5.94602 9.58996 5.98982 9.8705 6.07741 10.1143C6.16738 10.3558 6.2964 10.5452 6.46449 10.6825C6.63494 10.8175 6.84446 10.8849 7.09304 10.8849ZM11.8951 14.0455C11.7033 14.0455 11.5234 14.0301 11.3553 13.9993C11.1896 13.9709 11.0523 13.9342 10.9434 13.8892L11.2843 12.7599C11.4618 12.8144 11.6216 12.844 11.7637 12.8487C11.9081 12.8535 12.0324 12.8203 12.1365 12.7493C12.2431 12.6783 12.3295 12.5575 12.3958 12.3871L12.4846 12.1562L10.5279 6.54545H12.1188L13.248 10.5511H13.3049L14.4448 6.54545H16.0463L13.9263 12.5895C13.8245 12.883 13.686 13.1387 13.5108 13.3565C13.338 13.5767 13.119 13.746 12.8539 13.8643C12.5887 13.9851 12.2691 14.0455 11.8951 14.0455Z" fill="white"/>
<path d="M15.6136 25.0888C15.1993 25.0888 14.8241 24.9822 14.4879 24.7692C14.1541 24.5537 13.889 24.2377 13.6925 23.821C13.4983 23.402 13.4013 22.8883 13.4013 22.2798C13.4013 21.6548 13.5019 21.1352 13.7031 20.7209C13.9044 20.3042 14.1719 19.9929 14.5057 19.7869C14.8419 19.5786 15.21 19.4744 15.6101 19.4744C15.9155 19.4744 16.17 19.5265 16.3736 19.6307C16.5795 19.7325 16.7453 19.8603 16.8707 20.0142C16.9986 20.1657 17.0956 20.3149 17.1619 20.4616H17.2081V17.7273H18.7173V25H17.2259V24.1264H17.1619C17.0909 24.2779 16.9903 24.4283 16.8601 24.5774C16.7322 24.7242 16.5653 24.8461 16.3594 24.9432C16.1558 25.0402 15.9072 25.0888 15.6136 25.0888ZM16.093 23.8849C16.3369 23.8849 16.5429 23.8187 16.7109 23.6861C16.8814 23.5511 17.0116 23.3629 17.1016 23.1214C17.1939 22.88 17.2401 22.5971 17.2401 22.2727C17.2401 21.9484 17.1951 21.6667 17.1051 21.4276C17.0152 21.1884 16.8849 21.0038 16.7145 20.8736C16.544 20.7434 16.3369 20.6783 16.093 20.6783C15.8445 20.6783 15.6349 20.7457 15.4645 20.8807C15.294 21.0156 15.165 21.2027 15.0774 21.4418C14.9898 21.6809 14.946 21.9579 14.946 22.2727C14.946 22.59 14.9898 22.8705 15.0774 23.1143C15.1674 23.3558 15.2964 23.5452 15.4645 23.6825C15.6349 23.8175 15.8445 23.8849 16.093 23.8849ZM21.2253 19.5455L22.2267 21.4524L23.253 19.5455H24.8049L23.2246 22.2727L24.8475 25H23.3027L22.2267 23.1143L21.1685 25H19.606L21.2253 22.2727L19.6628 19.5455H21.2253Z" fill="white"/>
<line x1="6.81281" y1="22.7756" x2="21.9396" y2="7.02154" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="15" fill="#4597B1"/>
<path d="M15.0199 20.2131C14.8021 21.5199 14.3073 22.5213 13.5355 23.2173C12.7637 23.9134 11.7576 24.2614 10.517 24.2614C10.2424 24.2614 9.98911 24.2495 9.7571 24.2259C9.52036 24.2022 9.28835 24.1619 9.06108 24.1051L9.60085 21.7685C9.72396 21.7969 9.86127 21.8229 10.0128 21.8466C10.1643 21.8703 10.3442 21.8821 10.5526 21.8821C10.9976 21.8821 11.3456 21.759 11.5966 21.5128C11.8523 21.2713 12.0204 20.8949 12.1009 20.3835L13.9972 8.94886C14.2197 7.6089 14.7334 6.58144 15.5384 5.86648C16.3433 5.15151 17.392 4.79403 18.6847 4.79403C18.9356 4.79403 19.1889 4.81297 19.4446 4.85085C19.7003 4.884 19.9702 4.93845 20.2543 5.0142L19.6364 7.27983C19.4991 7.25142 19.3168 7.23011 19.0895 7.21591C18.867 7.2017 18.642 7.1946 18.4148 7.1946C17.9886 7.1946 17.6548 7.30824 17.4134 7.53551C17.1766 7.76278 17.018 8.1179 16.9375 8.60085L15.0199 20.2131Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1010 B

@@ -0,0 +1,4 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="15" fill="#E34A4A"/>
<path d="M15.0199 20.2131C14.8021 21.5199 14.3073 22.5213 13.5355 23.2173C12.7637 23.9134 11.7576 24.2614 10.517 24.2614C10.2424 24.2614 9.98911 24.2495 9.7571 24.2259C9.52036 24.2022 9.28835 24.1619 9.06108 24.1051L9.60085 21.7685C9.72396 21.7969 9.86127 21.8229 10.0128 21.8466C10.1643 21.8703 10.3442 21.8821 10.5526 21.8821C10.9976 21.8821 11.3456 21.759 11.5966 21.5128C11.8523 21.2713 12.0204 20.8949 12.1009 20.3835L13.9972 8.94886C14.2197 7.6089 14.7334 6.58144 15.5384 5.86648C16.3433 5.15151 17.392 4.79403 18.6847 4.79403C18.9356 4.79403 19.1889 4.81297 19.4446 4.85085C19.7003 4.884 19.9702 4.93845 20.2543 5.0142L19.6364 7.27983C19.4991 7.25142 19.3168 7.23011 19.0895 7.21591C18.867 7.2017 18.642 7.1946 18.4148 7.1946C17.9886 7.1946 17.6548 7.30824 17.4134 7.53551C17.1766 7.76278 17.018 8.1179 16.9375 8.60085L15.0199 20.2131Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1010 B

@@ -10,6 +10,7 @@
<language-dropdown class="app-navbar-actions__item"/> -->
<license-check-button :ref="'license_check_button_ref'" @updateLicense="updateLicense"/>
<license-update-modal :title="'Update'" :ref="'license_update_modal_ref'" @refresh="refresh"/>
<va-button @click="reload" icon="fa fa-refresh" flat></va-button>
<profile-dropdown class="app-navbar-actions__item app-navbar-actions__item--profile">
<span>{{userName}}</span>
</profile-dropdown>
@@ -70,6 +71,9 @@ export default {
this.$refs.license_check_button_ref.refresh()
this.$refs.license_update_modal_ref.hide()
},
reload () {
window.location.reload(true)
},
},
}
</script>
@@ -62,6 +62,14 @@ export const navigationRoutes = {
},
},
// {
// name: 'project',
// displayName: 'Scheduler',
// meta: {
// iconClass: 'vuestic-iconset vuestic-iconset-tables',
// // iconClass: 'vuestic-iconset vuestic-iconset-browse-gallery',
// },
// },
// {
// name: 'forms',
// displayName: 'menu.forms',
// meta: {
@@ -9,8 +9,11 @@
<span slot="header">Control Panel</span>
<div slot="body">
<div>
<top-control-panel :ref="'top_control_panel'" @refreshChart="setOption" @changeAxis="changeAxis" @changeOverviewDataZoom="changeOverviewDataZoom"/>
<top-control-panel :ref="'top_control_panel'" @refreshChart="setOption" @changeAxis="changeAxis" @changeOverviewDataZoom="changeOverviewDataZoom" @changeFunctional="changeFunctional" @setBrushBoundary="setBrushBoundary"/>
</div>
<!-- <div>
{{ this.specificIntegral }}
</div> -->
</div>
</va-collapse>
</va-accordion>
@@ -21,8 +24,9 @@
<div :class="chartAreaClass">
<div class="row" >
<div class="flex sm12 xl12 md12 xs12">
<!-- <chart :style="'width: auto; height: 88vhvh;'" :option="options"></chart> -->
<elite-replay-overview-chart v-show="showOverviewChart" :ref="'chart_overview'" class="mb-1" :cardheight="'7vh'" :data="chartOverviewData" @dataZoomEvent="dataZoomEvent($event)"/>
<elite-replay-chart :ref="'chart_detail'" :cardheight="'88vh'" :chartheight="detailchartheight" :data="chartDetailData" />
<elite-replay-chart :ref="'chart_detail'" :cardheight="'90vh'" :chartheight="detailchartheight" :data="chartDetailData" @updateIntegralBoundary="updateIntegralBoundary" />
<change-channel-value-min-max :ref="'set_min_max'"/>
</div>
</div>
@@ -75,6 +79,7 @@ export default {
'startTimeCurrent',
'endTimeCurrent',
'sampleMethod',
'controlPanel',
]),
},
props: {
@@ -106,6 +111,30 @@ export default {
zoomTime: 0,
initDone: false,
chartAreaClass: ['flex', 'xs12', 'sm12', 'md12', 'xl9', 'pa-0'],
xfunctional: 'Linear',
yfunctional: 'Linear',
options: {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)',
},
},
],
brush: {
},
},
specificIntegral: 0,
}
},
mqtt: {
@@ -118,10 +147,10 @@ export default {
this.$refs.chart_detail.turnOffAxisEventHandler(eventName, handler, attr)
},
showMinMaxPanel (params) {
this.$refs.set_min_max.showPanel(params)
return this.$refs.set_min_max.showPanel(params)
},
setOption (options) {
this.$refs.chart_detail.mergeOptions(options)
this.$refs.chart_detail.setOptions(options)
},
showChartLoading: function (chart) {
const loadStyle = {
@@ -172,7 +201,7 @@ export default {
const yType = setting[2] // Elite or Time
const xValue = setting[1] // 1: I, 2: V, 3: R
const yValue = setting[3] // 1: I, 2: V, 3: R
console.log(setting)
// console.log(setting)
this.registerChart({
chartAllData: this.chartData,
chartID: this.chartDetailData.chartID,
@@ -195,6 +224,8 @@ export default {
channelY: ch,
})
})
// disable overviewData legend
this.chartOverviewData.legend.show = false
this.chartDetailData.xAxis[_gridNumber].axisLabel.show = true
if (this.maxTime < parseInt(meta.time_duration)) {
this.maxTime = parseInt(meta.time_duration)
@@ -236,7 +267,6 @@ export default {
this.windowLength = this.endTime - this.startTime
this.chartOverviewData.dataZoom[0].start = dataZoom.start
this.chartOverviewData.dataZoom[0].end = dataZoom.end
// console.log(this.startTime, this.endTime)
}
})
} else {
@@ -247,7 +277,6 @@ export default {
this.windowLength = this.endTime - this.startTime
this.chartOverviewData.dataZoom[0].start = e.start
this.chartOverviewData.dataZoom[0].end = e.end
// console.log(this.startTime, this.endTime)
}
}
this.zoomTime = 0
@@ -255,7 +284,7 @@ export default {
changeOverviewDataZoom () {
this.chartOverviewData.dataZoom[0].start = this.startTime * 100 / this.maxTime
this.chartOverviewData.dataZoom[0].end = this.endTime * 100 / this.maxTime
this.$refs.chart_overview.mergeOptions(this.chartOverviewData)
this.$refs.chart_overview.setOptions(this.chartOverviewData)
},
async computeResampleScale (meta, duration) {
const sampleRate = meta.parameter_set.SAMPLE_RATE / 10
@@ -313,7 +342,6 @@ export default {
if (this.axisXDataType.description === 'Time') {
scale = await this.computeResampleScale(metaInfo, metaInfo.time_duration)
}
console.log('overview scale:', scale)
// download data
const getAllData = async function (_this) {
for (const ch in _this.dataInfo[meta]) {
@@ -346,6 +374,14 @@ export default {
this.hideChartLoading()
},
drawDetailData: async function () {
// brush setting write at here, due to mounted won't show the brush
this.chartDetailData.brush = {
toolbox: ['rect', 'clear'],
// toolbox: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'],
xAxisIndex: 0,
throttleType: 'debounce',
throttleDelay: 0,
}
this.showChartLoading('detail')
const timeDur = this.endTimeCurrent - this.startTimeCurrent
let _gridNumber = 0
@@ -358,7 +394,7 @@ export default {
})
let scale = '1'
if (this.axisXDataType.description === 'Time') {
if (this.controlPanel.x.axis.description === 'Time') {
scale = await this.computeResampleScale(metaInfo, timeDur)
}
// elite的sample rate不像neulive這麼高,因此試試scale = 100 or 1000時不要再sampling一次了,不然有些形狀(e.g. peak)會不一樣
@@ -368,7 +404,7 @@ export default {
this.updateChartSamplingChart({ chartID: this.chartDetailData.chartID, seriesIndex: _gridNumber, method: 'lttb' })
}
if (metaInfo.device.library_name === 'EliteEIS' && metaInfo.parameter_set.MODE === 0) {
if (metaInfo.device.library_name.includes('EIS') && metaInfo.parameter_set.MODE === 0) {
this.chartDetailData.series[this.chartDetailData.series.length - 1].showSymbol = true
this.chartDetailData.series[this.chartDetailData.series.length - 1].showAllSymbol = true
this.chartDetailData.series[this.chartDetailData.series.length - 1].symbolSize = 6
@@ -377,11 +413,11 @@ export default {
this.currentScale = scale
this.chartDetailData.series[_gridNumber].data.length = 0
let dataListX
const channelX = parseInt(this.axisXDataType.id)
if (this.axisXDataType.description !== 'Time') {
const channelX = parseInt(this.controlPanel.x.axis.channel)
if (this.controlPanel.x.axis.description !== 'Time') {
dataListX = this.dataInfo[meta][channelX][scale]
}
const channelY = parseInt(this.axisYDataType.id)
const channelY = parseInt(this.controlPanel.y.axis.channel)
const dataListY = this.dataInfo[meta][channelY][scale]
const isThisModeHasCycle = this.GLOBAL.hasCycleMode(metaInfo.parameter_set.MODE, metaInfo.device.library_name)
@@ -419,32 +455,118 @@ export default {
}
}
// download and push into chart
// due to the (endIndex - startIndex) may more than 1, need to record variables outside the loop
var integralResult = 0
var curXData = 0
var curYData = 0
var prevXData = 0
var prevYData = 0
for (let i = startIndex; i <= endIndex; i++) {
const data = await this.getData(parseInt(scale), this.sampleMethod, dataListY[i].id, channelY, metaInfo)
let dataX
if (this.axisXDataType.description !== 'Time') {
if (this.controlPanel.x.axis.description !== 'Time') {
dataX = await this.getData(parseInt(scale), this.sampleMethod, dataListX[i].id, channelX, metaInfo)
}
var deltaX = 0
var diffResult = 0
var logZero = false
var lastXinThisTable
for (let j = 0, len = data.length; j < len; j++) {
// check which channel and push processed data (i.e. merge two channel data, now data is (time, value) format)
if (parseInt(data[j][0]) >= _startTime && parseInt(data[j][0]) <= _endTime) {
const processedData = data[j]
logZero = false
// cases without time
if (dataX !== undefined) {
processedData[0] = dataX[j][1]
// add time on the chart
// TODO: not sure the time is right or not?
processedData[2] = parseFloat(dataX[j][0])
}
if (this.displayType.x === 'log' || this.absToggleStatus.x === true) {
// below is the original version for the log
/* if (this.displayType.x === 'log' || this.absToggleStatus.x === true) {
processedData[0] = Math.abs(processedData[0])
}
if (this.displayType.y === 'log' || this.absToggleStatus.y === true) {
processedData[1] = Math.abs(processedData[1])
} */
if (this.xfunctional === 'Log') {
// avoid log10(0) cases
if (Math.abs(processedData[0]) === 0) logZero = true
processedData[0] = Math.log10(Math.abs(processedData[0]))
}
this.chartDetailData.series[_gridNumber].data.push(processedData)
if (this.yfunctional === 'Log') {
if (Math.abs(processedData[1]) === 0) logZero = true
processedData[1] = Math.log10(Math.abs(processedData[1]))
} else if (this.yfunctional === 'Integral') {
if (j === 0) {
// TODO: need to change the series[deviceID]
// TODO: change the time index(dynamic changing)
curYData = parseFloat(processedData[1])
// integral only when I-T & C-A, so writen as [0] directly
prevYData = parseFloat(data[j][1])
// initial integral as 0
if (i === 0) processedData[1] = 0
else {
if (dataX !== undefined) {
// e.g. I-V: deltaX is V
deltaX = parseFloat(dataX[j][1]) - lastXinThisTable
} else {
// e.g. I-T: deltaX is T
deltaX = parseFloat(data[j][0]) - lastXinThisTable
}
integralResult += parseFloat((Math.abs(curYData) + Math.abs(prevYData)) * Math.abs(deltaX) / 2)
processedData[1] = integralResult
}
} else {
curYData = parseFloat(data[j][1])
if (dataX !== undefined) {
// e.g. I-V: deltaX is V
deltaX = parseFloat(dataX[j][1]) - parseFloat(dataX[j - 1][1])
lastXinThisTable = parseFloat(dataX[j][1])
} else {
// e.g. I-T: deltaX is T
deltaX = parseFloat(data[j][0]) - parseFloat(data[j - 1][0])
lastXinThisTable = parseFloat(data[j][0])
}
integralResult += parseFloat((Math.abs(curYData) + Math.abs(prevYData)) * Math.abs(deltaX) / 2)
// assign here is due to the fetch the modify value
prevYData = curYData
processedData[1] = integralResult
}
} else if (this.yfunctional === 'Differential') {
if (j === 0) {
// TODO: need to change the series[deviceID]
// TODO: change the time index(dynamic changing)
curXData = parseFloat(processedData[0])
curYData = parseFloat(processedData[1])
deltaX = parseFloat(dataX[j + 1][0]) - parseFloat(dataX[j][0])
if (i === 0) logZero = true
// due to the limitation of the getData table, the number of page may > 1
else {
diffResult = parseFloat((curYData - prevYData) / (curXData - prevXData))
processedData[0] = curXData
processedData[1] = diffResult
}
prevXData = parseFloat(processedData[0])
prevYData = parseFloat(processedData[1])
} else {
curXData = parseFloat(processedData[0])
curYData = parseFloat(processedData[1])
diffResult = parseFloat((curYData - prevYData) / (curXData - prevXData))
prevXData = curXData
prevYData = curYData
processedData[0] = curXData
processedData[1] = diffResult
}
}
// avoid pushing the infinity data into the chart
if (!logZero) this.chartDetailData.series[_gridNumber].data.push(processedData)
}
}
}
if (this.axisXDataType.description === 'Time') {
if (this.controlPanel.x.axis.description === 'Time') {
this.chartDetailData.xAxis[_gridNumber].min = _startTime
this.chartDetailData.xAxis[_gridNumber].max = _endTime
} else {
@@ -454,16 +576,16 @@ export default {
_gridNumber += 1
}
if (this.axisXDataType.description !== 'Time') {
if (this.controlPanel.x.axis.description !== 'Time') {
this.showOverviewChart = false
this.detailchartheight = '88vh'
// this.$refs.chart_detail.updateChartHeight()
this.turnOnAxisEventHandler('click', 'xAxis.axisLabel', this.showMinMaxPanel, { axis: 'x' })
this.turnOnAxisEventHandler('click', 'xAxis', this.showMinMaxPanel, { axis: 'x' })
} else {
this.showOverviewChart = true
this.detailchartheight = '80vh'
this.turnOffAxisEventHandler('click', this.showMinMaxPanel, { axis: 'x' })
this.turnOnAxisEventHandler('click', 'yAxis.axisLabel', this.showMinMaxPanel, { axis: 'y' })
this.turnOnAxisEventHandler('click', 'yAxis', this.showMinMaxPanel, { axis: 'y' })
}
this.hideChartLoading()
@@ -478,38 +600,125 @@ export default {
}
}
},
changeFunctional (axis, functional) {
if (axis === 'x') {
this.xfunctional = functional
} else {
this.yfunctional = functional
}
},
changeAxis (gridIndex) {
// if (this.initDone) {
// const libName = this.metaList[gridIndex].device.library_name
// let xType
// let xValue
// if (this.axisXDataType.description === 'Time') {
// xType = 'Time'
// } else {
// if (libName === 'EliteZM15' || libName.includes('Elite_EDC')) {
// xType = 'Elite'
// } else if (libName.includes('EIS')) {
// xType = 'EliteEIS'
// }
// xValue = this.axisXDataType.id + 1
// }
// this.updateRegisteredChart({
// chartAllData: this.chartData,
// chartID: this.chartDetailData.chartID,
// gridIndex: gridIndex,
// deviceNameX: xType,
// deviceIDX: this.metaList[gridIndex].name,
// channelX: xValue,
// deviceNameY: libName.includes('EIS') ? 'EliteEIS' : 'Elite',
// deviceIDY: '',
// channelY: this.axisYDataType.id + 1,
// })
// console.log({
// chartAllData: this.chartData,
// chartID: this.chartDetailData.chartID,
// gridIndex: gridIndex,
// deviceNameX: xType,
// deviceIDX: this.metaList[gridIndex].name,
// channelX: xValue,
// deviceNameY: libName.includes('EIS') ? 'EliteEIS' : 'Elite',
// deviceIDY: '',
// channelY: this.axisYDataType.id + 1,
// })
// }
// if (this.axisXDataType.description === 'Time') {
// this.drawOverviewData()
// }
// this.drawDetailData() // reDraw
// tang
if (this.initDone) {
const libName = this.metaList[gridIndex].device.library_name
let xType
let xValue
if (this.axisXDataType.description === 'Time') {
xType = 'Time'
} else {
if (libName === 'EliteZM15') {
xType = 'Elite'
} else if (libName === 'EliteEIS') {
xType = 'EliteEIS'
}
xValue = this.axisXDataType.id + 1
}
const xType = (this.controlPanel.x.axis.description === 'Time') ? 'Time' : ((libName === 'EliteZM15' || libName.includes('Elite_EDC') ? 'Elite' : 'EliteEIS'))
const xChannel = (this.controlPanel.x.axis.channel === -1) ? undefined : this.controlPanel.x.axis.channel + 1
this.updateRegisteredChart({
chartAllData: this.chartData,
chartID: this.chartDetailData.chartID,
gridIndex: gridIndex,
deviceNameX: xType,
deviceIDX: this.metaList[gridIndex].name,
channelX: xValue,
deviceNameY: libName === 'EliteEIS' ? 'EliteEIS' : 'Elite',
channelX: xChannel,
deviceNameY: libName.includes('EIS') ? 'EliteEIS' : 'Elite',
deviceIDY: '',
channelY: this.axisYDataType.id + 1,
channelY: this.controlPanel.y.axis.channel + 1,
})
}
if (this.axisXDataType.description === 'Time') {
if (this.controlPanel.x.axis.description === 'Time') {
this.drawOverviewData()
}
this.drawDetailData() // reDraw
},
updateIntegralBoundary (boundary) {
var rawData = JSON.parse(JSON.stringify(this.chartDetailData.series[0].data))
var deltaX
var averageY
var area
var prevIndex
this.specificIntegral = 0
for (let index = 0, len = rawData.length; index < len; index++) {
prevIndex = index - 1
if (index === 0) {
if (rawData[len - 1][0] >= boundary.x_start && rawData[len - 1][0] <= boundary.x_end &&
rawData[index][0] >= boundary.x_start && rawData[index][0] <= boundary.x_end) {
prevIndex = len - 1
} else continue
}
if (rawData[prevIndex][0] >= boundary.x_start && rawData[prevIndex][0] <= boundary.x_end &&
rawData[index][0] >= boundary.x_start && rawData[index][0] <= boundary.x_end) {
deltaX = Math.abs(Number(rawData[index][0]) - Number(rawData[prevIndex][0]))
if (rawData[index][1] > boundary.y_end) rawData[index][1] = boundary.y_end
else if (rawData[index][1] < boundary.y_start) {
continue
}
averageY = (Number(rawData[index][1]) + Number(rawData[prevIndex][1])) / 2 - boundary.y_start
area = deltaX * averageY
if (!isNaN(area)) {
this.specificIntegral += area
}
}
}
// this.specificIntegral = (this.specificIntegral * 1e-15).toFixed(4) + 'W'
this.$refs.top_control_panel.$refs.specific_integral.getSpecificIntegral(this.specificIntegral, boundary)
},
setBrushBoundary (boundary) {
this.$refs.chart_detail.$refs.chart_ref.chart.dispatchAction({
type: 'brush',
areas: [
{
xAxisIndex: 0,
brushType: 'rect',
coordRange: [
[boundary.x_start, boundary.x_end],
[boundary.y_start, boundary.y_end],
],
},
],
})
},
...mapActions('replay', [types.chart.init, types.chart.register, types.chart.clear, types.chart.updateGridList, types.chart.updateDataZoom, types.chart.setAxisDisplay]),
...mapActions('replay', [types.meta.init]),
...mapActions('replay', [types.rec.init, types.rec.intoData, types.rec.initDisplaySetting, types.rec.updateDisplaySetting]),
@@ -527,19 +736,19 @@ export default {
this.metaList = this.getAllMeta()
await this.initRec({ api: api })
this.dataInfo = this.getAllRec()
console.log(this.metaList)
console.log(this.dataInfo)
// console.log(this.metaList)
// console.log(this.dataInfo)
await this.register()
this.setOverviewDataZoomStartAndEndChart()
this.$refs.top_control_panel.init() // will call changeAxis() here
this.$refs.set_min_max.init()
this.turnOnAxisEventHandler('click', 'yAxis.axisLabel', this.showMinMaxPanel, { axis: 'y' })
this.turnOnAxisEventHandler('click', 'yAxis', this.showMinMaxPanel, { axis: 'y' })
this.updateAxisSplitNumberChart({ chartID: this.chartDetailData.chartID, axis: 'x' })
this.updateAxisSplitNumberChart({ chartID: this.chartDetailData.chartID, axis: 'y' })
this.dataZoomTimer = setInterval(this.checkDataZoom, 1000)
this.initDone = true
console.log(this.chartOverviewData)
console.log(this.chartDetailData)
// console.log(this.chartOverviewData)
// console.log(this.chartDetailData)
},
beforeDestroy () {
this.$refs.chart_overview.clear()
@@ -1,7 +1,14 @@
<template>
<div class="flex" :class="cardclass">
<va-card :style="'height: ' + cardheight + ';'">
<chart :ref="'chart_ref'" :style="'width: '+ cardwidth + '; height: ' + chartheight + ';'" :options="data" @dataZoom="updateZoom" :auto-resize="true"></chart>
<chart
:ref="'chart_ref'"
:style="'width: '+ cardwidth + '; height: ' + chartheight + ';'"
:option="data"
:auto-resize="true"
:loading="loading"
@dataZoom="updateZoom"
></chart>
</va-card>
</div>
</template>
@@ -44,6 +51,7 @@ export default {
},
data () {
return {
loading: false,
}
},
computed: {
@@ -59,8 +67,8 @@ export default {
updateZoom: function (e) {
this.$emit('dataZoomEvent', e)
},
mergeOptions (options) {
this.$refs.chart_ref.mergeOptions(options)
setOptions (options) {
this.$refs.chart_ref.setOption(options)
},
turnOnAxisEventHandler (eventName, query, handler, attr) {
const chartID = 1
@@ -70,7 +78,7 @@ export default {
status: 'on',
})
// doc: https://echarts.apache.org/zh/api.html#echartsInstance.on
this.$refs.chart_ref.chart._zr.on(eventName, query, handler)
this.$refs.chart_ref.chart.on(eventName, query, handler)
},
turnOffAxisEventHandler (eventName, handler, attr) {
const chartID = 1
@@ -80,22 +88,42 @@ export default {
status: 'off',
})
// doc: https://echarts.apache.org/zh/api.html#echartsInstance.off
this.$refs.chart_ref.chart._zr.off(eventName, handler)
this.$refs.chart_ref.chart.off(eventName, handler)
},
showLoading (options) {
this.$refs.chart_ref.showLoading(options)
this.loading = true
},
hideLoading () {
this.$refs.chart_ref.hideLoading()
this.loading = false
},
clear () {
this.$refs.chart_ref.clear()
},
updateBoundary (boundary) {
this.$emit('updateIntegralBoundary', boundary)
},
...mapMutations('replay', [types.chart.updateAxisEventHandler]),
},
async mounted () {
this.resizeTimer = setInterval(this.resize, 1000)
// brush set at here won't work
this.data.brush = {
toolbox: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'],
xAxisIndex: 0,
throttleType: 'debounce',
throttleDelay: 0,
}
this.$refs.chart_ref.chart.on('brushSelected', (params) => {
if (params.batch[0] && params.batch[0].areas.length !== 0) {
var boundary = {
x_start: Number(params.batch[0].areas[0].coordRange[0][0].toFixed(4)),
x_end: Number(params.batch[0].areas[0].coordRange[0][1].toFixed(4)),
y_start: Number(params.batch[0].areas[0].coordRange[1][0].toFixed(4)),
y_end: Number(params.batch[0].areas[0].coordRange[1][1].toFixed(4)),
}
this.updateBoundary(boundary)
}
})
},
destroyed () {
clearInterval(this.resizeTimer)
@@ -1,7 +1,15 @@
<template>
<div class="flex" :class="cardclass">
<va-card :style="'height: 8vh;'">
<chart :ref="'chart_ref'" :style="'width: '+ cardwidth + '; height: ' + cardheight + ';'" :options="data" @dataZoom="updateZoom" :auto-resize="true"></chart>
<chart
:ref="'chart_ref'"
:style="'width: '+ cardwidth + '; height: ' + cardheight + ';'"
:option="data"
:auto-resize="true"
:loading="loading"
@dataZoom="updateZoom"
>
</chart>
</va-card>
</div>
</template>
@@ -38,6 +46,7 @@ export default {
},
data () {
return {
loading: false,
}
},
computed: {
@@ -53,14 +62,14 @@ export default {
updateZoom: function (e) {
this.$emit('dataZoomEvent', e)
},
mergeOptions (options) {
this.$refs.chart_ref.mergeOptions(options)
setOptions (options) {
this.$refs.chart_ref.setOption(options)
},
showLoading (options) {
this.$refs.chart_ref.showLoading(options)
this.loading = true
},
hideLoading () {
this.$refs.chart_ref.hideLoading()
this.loading = false
},
clear () {
this.$refs.chart_ref.clear()
@@ -12,49 +12,66 @@
<delete-file />
</div>
</div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0">
<p class="display-6"> X-axis <p/>
<p class="display-6"> X-Axis </p>
</div>
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-axis :ref="'change_axis_x'" axis="x" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle"/>
<control-axis
:ref="'axis_x'"
coordinate="x"
@changeAxis="changeAxis"
/>
</div>
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-unit :ref="'change_unit_x'" axis="x" @refreshChart="refreshChart"/>
<control-unit
:ref="'unit_x'"
coordinate="x"
@changeUnit="changeUnit"
style="width: 75px;"
/>
</div>
</div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0" />
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-scale :ref="'change_scale_x'" axis="x" @refreshChart="refreshChart" @clearCycle="clearCycle" @changeAxis="changeAxis"/>
</div>
<div class="flex sm5 xl5 md5 xs5 px-0 py-0">
<abs-toggle :ref="'abs_x'" axis="x" @changeAxis="changeAxis"/>
<control-funct
:ref="'funct_x'"
coordinate="x"
@changeFunct="changeFunct"
/>
</div>
</div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0">
<p class="display-6"> Y-axis <p/>
<p class="display-6"> Y-Axis </p>
</div>
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-axis :ref="'change_axis_y'" axis="y" @changeAxis="changeAxis" @changeUnit="changeUnit" @clearCycle="clearCycle"/>
<control-axis
:ref="'axis_y'"
coordinate="y"
@changeAxis="changeAxis"
/>
</div>
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-unit :ref="'change_unit_y'" axis="y" @refreshChart="refreshChart"/>
<control-unit
:ref="'unit_y'"
coordinate="y"
@changeUnit="changeUnit"
style="width: 75px;"
/>
</div>
</div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0" />
<div class="flex sm5 xl5 md5 xs5 pl-1 pr-0 py-0">
<change-scale :ref="'change_scale_y'" axis="y" @refreshChart="refreshChart" @clearCycle="clearCycle" @changeAxis="changeAxis"/>
</div>
<div class="flex sm5 xl5 md5 xs5 px-0 py-0">
<abs-toggle :ref="'abs_y'" axis="y" @changeAxis="changeAxis"/>
<control-funct
:ref="'funct_y'"
coordinate="y"
@changeFunct="changeFunct"/>
</div>
</div>
<specific-integral :ref="'specific_integral'" @setBrushBoundary="setBrushBoundary"/>
<div class="flex-container mb-2">
<div class="flex sm10 xl10 md10 xs10 px-0 py-0">
<change-window-start-and-size :ref="'change_window_start_and_size'" @changeOverviewDataZoom="changeOverviewDataZoom"/>
@@ -72,28 +89,32 @@
<script>
import ShowResampleRate from '@/components/analysis/replay/toolbox/ShowResampleRate.vue'
import ChangeAxis from '@/components/analysis/replay/toolbox/ChangeAxis.vue'
import ChangeUnit from '@/components/analysis/replay/toolbox/ChangeUnit.vue'
import ChangeScale from '@/components/analysis/replay/toolbox/ChangeScale.vue'
import controlAxis from '@/components/analysis/replay/toolbox/ControlAxis'
import controlUnit from '@/components/analysis/replay/toolbox/ControlUnit'
import controlFunct from '@/components/analysis/replay/toolbox/ControlFunct'
import ChangeCycle from '@/components/analysis/replay/toolbox/ChangeCycle.vue'
import AbsToggle from '@/components/analysis/replay/toolbox/AbsToggle.vue'
import SpecificIntegral from '@/components/analysis/replay/toolbox/SpecificIntegral.vue'
import DownloadFile from '@/components/analysis/replay/toolbox/DownloadFile.vue'
import DeleteFile from '@/components/analysis/replay/toolbox/DeleteFile.vue'
import EditFileName from '@/components/analysis/replay/toolbox/EditFileName.vue'
import ShowParameter from '@/components/analysis/replay/toolbox/ShowParameter.vue'
import LockDataZoom from '@/components/analysis/replay/toolbox/LockDataZoom.vue'
import ChangeWindowStartAndSize from '@/components/analysis/replay/toolbox/ChangeWindowStartAndSize.vue'
import { mapMutations } from 'vuex'
import { mapFields } from 'vuex-map-fields'
import { tableRouter } from '@/components/analysis/replay/toolbox/EliteReplayTable'
import configRouter from '@/components/analysis/replay/toolbox/configTable'
import types from '@/store/modules/analysis/replay/types'
export default {
name: 'top-control-panel',
components: {
ShowResampleRate,
ChangeAxis,
ChangeUnit,
ChangeScale,
controlAxis,
controlUnit,
controlFunct,
ChangeCycle,
AbsToggle,
SpecificIntegral,
DownloadFile,
DeleteFile,
EditFileName,
@@ -103,37 +124,93 @@ export default {
},
computed: {
...mapFields('replay', [
'chartData',
'metaList',
'showCyclePanel',
'controlPanel',
]),
},
props: {
},
async created () {
},
data () {
return {
deviceName: '',
libraryName: '',
showCycle: false,
innerCollapse: false,
tableRouter,
configRouter,
}
},
mqtt: {
},
methods: {
...mapMutations('replay', [types.chart.updateAxisLabel]),
// initialize control buttons
init () {
this.deviceName = this.metaList[0].device.library_name
this.$refs.change_axis_x.init(this.deviceName)
this.$refs.change_axis_y.init(this.deviceName)
this.$refs.change_unit_x.init(this.deviceName)
this.$refs.change_unit_y.init(this.deviceName)
this.$refs.change_scale_x.init(this.deviceName)
this.$refs.change_scale_y.init(this.deviceName)
this.$refs.abs_x.init(this.deviceName)
this.$refs.abs_y.init(this.deviceName)
// get config information
this.libraryName = this.metaList[0].device.library_name
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[0].parameter_set.MODE, this.libraryName)
this.controlPanel.x.axis = this.configRouter.getAxis(this.libraryName, setting[0], setting[1])
this.controlPanel.y.axis = this.configRouter.getAxis(this.libraryName, setting[2], setting[3])
this.controlPanel.FSM = this.configRouter.getFSM(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
// initialize other blocks
this.$refs.axis_x.init(this.libraryName, setting[0])
this.$refs.axis_y.init(this.libraryName, setting[2])
this.$refs.unit_x.init(this.controlPanel.x.axis.description)
this.$refs.unit_y.init(this.controlPanel.y.axis.description)
this.$refs.funct_x.init(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.funct_y.init(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.change_cycle.init()
this.$refs.edit_file_name.init()
this.$refs.show_param.init(this.deviceName)
this.$refs.show_param.init(this.libraryName)
this.$refs.change_window_start_and_size.init()
this.refreshFormatter('x')
this.refreshFormatter('y')
this.$emit('changeFunctional', 'x', 'Linear')
this.$emit('changeFunctional', 'y', 'Linear')
this.$emit('changeAxis', 0)
this.$refs.specific_integral.checkMeaning(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.specific_integral.setDisplayParam(this.controlPanel.x.axis.description, this.controlPanel.x.unit, this.controlPanel.y.axis.description, this.controlPanel.y.unit)
},
/* changeXXX: activate when pressing XXX button */
// trigger when changing the axis type
changeAxis (gridIndex) {
this.controlPanel.FSM = this.configRouter.getFSM(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
// initialize other blocks
this.$refs.unit_x.init(this.controlPanel.x.axis.description)
this.$refs.unit_y.init(this.controlPanel.y.axis.description)
this.$refs.funct_x.init(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.funct_y.init(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.change_cycle.init()
this.refreshFormatter('x')
this.refreshFormatter('y')
this.$emit('changeFunctional', 'x', 'Linear')
this.$emit('changeFunctional', 'y', 'Linear')
this.$emit('changeAxis', gridIndex)
this.$refs.specific_integral.checkMeaning(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.$refs.specific_integral.setDisplayParam(this.controlPanel.x.axis.description, this.controlPanel.x.unit, this.controlPanel.y.axis.description, this.controlPanel.y.unit)
},
// trigger when changing the unit
changeUnit (coordinate) {
this.refreshFormatter(coordinate)
this.$refs.specific_integral.refreshDisplayParam(this.controlPanel.x.axis.description, this.controlPanel.x.unit, this.controlPanel.y.axis.description, this.controlPanel.y.unit)
},
// trigger when press the functional button
changeFunct (coordinate) {
if (coordinate === 'y') {
this.controlPanel.y.axis.description = this.controlPanel.FSM[this.controlPanel.y.funct]
this.$refs.unit_y.init(this.controlPanel.y.axis.description)
this.$refs.specific_integral.checkMeaning(this.controlPanel.x.axis.description, this.controlPanel.y.axis.description)
this.refreshFormatter(coordinate)
}
this.$emit('changeFunctional', coordinate, this.controlPanel[coordinate].funct)
this.$emit('changeAxis', 0)
},
/* refreshXXX: passively called by changeXXX function to refresh some setting */
// refresh all formatters of charts
refreshFormatter (coordinate) {
this.updateAxisLabelChart({
chartID: 1,
axis: coordinate,
type: this.controlPanel[coordinate].axis.description,
axisIndex: 0,
})
},
changeOverviewDataZoom () {
this.$emit('changeOverviewDataZoom')
@@ -141,21 +218,12 @@ export default {
refreshChart (options) {
this.$emit('refreshChart', options)
},
changeAxis (gridIndex) {
this.$emit('changeAxis', gridIndex)
},
changeUnit (axis) {
if (axis === 'x') {
this.$refs.change_unit_x.changeUnitByAxis()
} else if (axis === 'y') {
this.$refs.change_unit_y.changeUnitByAxis()
}
},
clearCycle () {
this.$refs.change_cycle.clear()
},
},
mounted () {
setBrushBoundary (boundary) {
this.$emit('setBrushBoundary', boundary)
},
},
}
</script>
@@ -70,7 +70,7 @@ export default {
},
performABS () {
this.absToggleStatus[this.axis] = !this.absToggleStatus[this.axis]
if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
this.calculateHelper(this.metaIndex) // [TODO] elite tmp use metaIndex for grid index
}
this.clickTime++
@@ -93,7 +93,7 @@ export default {
data: seriesData,
})
} else {
if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
this.$emit('changeAxis', this.metaIndex) // [TODO] elite tmp use metaIndex for grid index
}
}
@@ -0,0 +1,332 @@
<template>
<div>
<va-button v-if="integralClicked && (mode_name==='Chronoamperometric' || mode_name==='I-T Graph')" color="danger" class="mb-2" @click="clickIntegral" small>
To Raw Mode
</va-button>
<va-button v-if="!integralClicked && (mode_name==='Chronoamperometric' || mode_name==='I-T Graph')" color="primary" class="mb-2" @click="clickIntegral" small>
To Integral Mode
</va-button>
<va-button v-if="xlogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" class="mb-2" @click="clickXLog" small>
To Raw Mode
</va-button>
<va-button :disabled="disableLog" v-if="!xlogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="primary" class="mb-2" @click="clickXLog" small>
To log Mode (x-axis)
</va-button>
<va-button v-if="ylogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" class="mb-2" @click="clickYLog" small>
To Raw Mode
</va-button>
<va-button :disabled="disableLog" v-if="!ylogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="primary" class="mb-2" @click="clickYLog" small>
To log Mode (y-axis)
</va-button>
<va-button v-if="diffClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" class="mb-2" @click="clickDiff" small>
To Raw Mode
</va-button>
<va-button :disabled="disableDiff" v-if="!diffClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="primary" class="mb-2" @click="clickDiff" small>
To Differential Mode
</va-button>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { mapActions } from 'vuex'
import taskTypes from '@/store/modules/task/content/types'
import paramTable from '@/data/config-table/index'
import { getTimeFormatter } from '@/store/modules/task/content/actions/chartAct'
export default {
name: 'CanvasChartReplayCalculation',
components: {
},
props: {
chartID: {
type: [Number, String],
required: true,
},
},
computed: {
...mapFields('', [
'developerMode',
]),
...mapFields('taskContent', [
'chartData',
'taskContentChartKey',
'deviceListNew',
]),
},
data () {
return {
info: null,
paramTable: paramTable,
rawData: null,
mode_name: '',
xName: '',
yName: '',
obj: null,
integralClicked: false,
xlogClicked: false,
ylogClicked: false,
diffClicked: false,
disableDiff: false,
disableLog: false,
}
},
// watch rawData is use for detect whether the chartData is changed
watch: {
rawData: {
deep: true,
handler: function () {
// avoid getting null data
if (this.rawData.series.length > 0) {
this.watchHandler()
}
},
},
},
methods: {
// Do arithmetic operations triggered by button(raw, integral, log)
watchHandler: function () {
// this.data need to be deep copy from rawData, since we don't want to modify the source(chartData[])
// this.data = Object.assign({}, this.rawData)
this.data = JSON.parse(JSON.stringify(this.rawData))
this.addSource()
var curXData = 0
var curYData = 0
var prevXData = 0
var prevYData = 0
var timeGap = 0
var curTime = 0
var integralResult = 0
var diffResult = 0
var index = 0
var timeIndex = this.getTimeIndex()
var _data = []
const dataLength = this.data.series[0].data.length
const seriesData = this.data.series[0].data
if (this.integralClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
// TODO: need to change the series[deviceID]
// TODO: change the time index(dynamic changing)
curYData = parseFloat(seriesData[index][1])
timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
_data.push([curTime, 0])
} else {
prevYData = parseFloat(seriesData[index - 1][1])
curYData = parseFloat(seriesData[index][1])
integralResult += parseFloat((Math.abs(curYData) + Math.abs(prevYData)) * timeGap / 2)
curTime += timeGap
_data.push([curTime, integralResult])
}
}
} else if (this.xlogClicked || this.ylogClicked) {
if (this.xlogClicked && this.ylogClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curXData !== 0 && curYData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), Math.log10(Math.abs(curYData)), curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += timeGap
if (curXData !== 0 && curYData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), Math.log10(Math.abs(curYData)), curTime])
}
}
}
} else if (this.xlogClicked && !(this.ylogClicked)) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curXData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), curYData, curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += timeGap
if (curXData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), curYData, curTime])
}
}
}
} else if (!(this.xlogClicked) && this.ylogClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curYData !== 0) {
_data.push([curXData, Math.log10(Math.abs(curYData)), curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += timeGap
if (curYData !== 0) {
_data.push([curXData, Math.log10(Math.abs(curYData)), curTime])
}
}
}
}
} else if (this.diffClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
// TODO: need to change the series[deviceID]
// TODO: change the time index(dynamic changing)
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
// _data.push([curTime, 0, curTime])
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
prevXData = parseFloat(seriesData[index - 1][0])
prevYData = parseFloat(seriesData[index - 1][1])
curTime += timeGap
diffResult = parseFloat((curYData - prevYData) / (curXData - prevXData))
_data.push([curXData, diffResult, curTime])
}
}
}
// decide feed in raw data / modified one
if (this.integralClicked || this.xlogClicked || this.ylogClicked || this.diffClicked) {
// console.log(_data)
this.data.series[0].data = _data
}
this.data.xAxis[0].type = 'value'
if (this.integralClicked) {
this.$emit('switchModeButton', 'Integral')
} else if (this.xlogClicked || this.ylogClicked) {
this.$emit('switchModeButton', 'log')
} else if (this.diffClicked) {
this.$emit('switchModeButton', 'Differential')
} else {
this.$emit('switchModeButton', '')
}
// TODO: modify the redundant code
if (this.xName === 'TIME') {
this.data.xAxis[0].axisLabel.formatter = function (val) {
return getTimeFormatter(val)
}
}
this.$emit('refreshData', this.data)
},
// resetClicked: function () {
// this.integralClicked = false
// this.xlogClicked = false
// this.ylogClicked = false
// this.diffClicked = false
// this.disableDiff = false
// this.disableLog = false
// },
clickIntegral: function () {
this.integralClicked = !(this.integralClicked)
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0) {
this.watchHandler()
}
}
},
clickXLog: function () {
if (this.xlogClicked) {
this.xlogClicked = false
if (this.ylogClicked) {
this.disableDiff = true
} else {
this.disableDiff = false
}
} else {
this.xlogClicked = true
this.disableDiff = true
}
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0) {
this.watchHandler()
}
}
},
clickYLog: function () {
if (this.ylogClicked) {
this.ylogClicked = false
if (this.xlogClicked) {
this.disableDiff = true
} else {
this.disableDiff = false
}
} else {
this.ylogClicked = true
this.disableDiff = true
}
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0) {
this.watchHandler()
}
}
},
clickDiff: function () {
this.diffClicked = !(this.diffClicked)
this.disableLog = !(this.disableLog)
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0) {
this.watchHandler()
}
}
},
addSource () {
if (this.data.gridSource.length > 0) {
const xAxisName = this.data.gridSource[0][0].xAxis
const yAxisName = this.data.gridSource[0][0].yAxis
this.xName = (xAxisName.split(' ')).pop()
this.yName = (yAxisName.split(' ')).pop()
if ((this.xName === 'VOLTAGE' && this.yName === 'CURRENT') || (this.xName === 'CURRENT' && this.yName === 'VOLTAGE')) {
this.mode_name = 'I-V Curve' // integration
} else if (this.xName === 'TIME' && this.yName === 'CURRENT') {
this.mode_name = 'I-T Graph' // differential and log
}
}
},
// index 0 is for the mode which x-axis is represent time, 2 is for the other mode(s)
getTimeIndex: function () {
let xAxisName = this.rawData.gridSource[0][0].xAxis
xAxisName = (xAxisName.split(' ')).pop()
return (xAxisName === 'TIME') ? 0 : 2
},
// these function below are using for print out the data (debug)
getAlldata: function () {
return this.data.series[0].data[(this.data.series[0].data).length - 1]
},
getXdata: function () {
var value = this.data.series[0].data[(this.data.series[0].data).length - 1][0]
return this.xName + ': ' + value + ' ' + this.xUnit
},
getYdata: function () {
var value = this.data.series[0].data[(this.data.series[0].data).length - 1][1]
return this.yName + ': ' + value + ' ' + this.yUnit
},
...mapActions('taskContent', [
taskTypes.chart.saveToCache,
]),
},
async mounted () {
this.rawData = this.chartData[this.chartID]
},
}
</script>
@@ -84,7 +84,7 @@ export default {
} else if (this.axis === 'y') {
this.axisYDataType = this.channelOptions[1]
}
} else if (this.deviceName === 'EliteZM15') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC')) {
// use state meta to decide which default unit need to be used (like check I-V mode...)
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
const xType = setting[0]
@@ -130,7 +130,7 @@ export default {
}
this.channelFormat = this.axisYDataType
}
} else if (this.deviceName === 'EliteEIS') {
} else if (this.deviceName.includes('EIS')) {
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
const xType = setting[0]
const xValue = setting[1]
@@ -141,7 +141,7 @@ export default {
if (this.axis === 'x') {
settingType = xType
settingValue = xValue
if (settingType === 'EliteEIS') {
if (settingType.includes('EIS')) {
this.axisXDataType = this.eisChannelOptions.find(element => element.id === parseInt(settingValue) - 1)
} else if (settingType === 'Elite') {
// 1: I, 2: V, 3: R
@@ -159,7 +159,7 @@ export default {
} else if (this.axis === 'y') {
settingType = yType
settingValue = yValue
if (settingType === 'EliteEIS') {
if (settingType.includes('EIS')) {
this.axisYDataType = this.eisChannelOptions.find(element => element.id === parseInt(settingValue) - 1)
} else if (settingType === 'Elite') {
// 1: I, 2: V, 3: R
@@ -184,7 +184,7 @@ export default {
if (this.deviceName.startsWith('Neulive')) {
// for elite now, cuz neulive now only have v-t graph, for future neulive replay need to adjust'
// console.log('(Last updated: 2021/06/19)')
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
if (this.axis === 'x') {
this.axisXDataType = this.channelFormat
} else if (this.axis === 'y') {
@@ -200,6 +200,9 @@ export default {
this.$emit('clearCycle')
}
},
getChannelByAxis () {
return this.channelFormat.description
},
},
mounted () {
},
@@ -64,13 +64,13 @@ export default {
}
},
showPanel (params) {
if (params.target !== undefined) {
if (params.target.eventData.componentType === 'xAxis' && params.target.eventData.targetType === 'axisLabel') {
this.gridIndex = params.target.eventData.xAxisIndex
if (params.targetType !== undefined) {
if (params.componentType === 'xAxis' && params.targetType === 'axisLabel') {
this.gridIndex = params.xAxisIndex
this.axis = 'x'
this.position = 'bottom'
} else if (params.target.eventData.componentType === 'yAxis' && params.target.eventData.targetType === 'axisLabel') {
this.gridIndex = params.target.eventData.yAxisIndex
} else if (params.componentType === 'yAxis' && params.targetType === 'axisLabel') {
this.gridIndex = params.yAxisIndex
this.axis = 'y'
this.position = 'left'
}
@@ -49,7 +49,9 @@ export default {
'axisYDataType',
'axisXLabelScale',
'axisYLabelScale',
'showCyclePanel',
'showWhichCycles',
'controlPanel',
]),
},
watch: {
@@ -76,21 +78,20 @@ export default {
return sortedCycleList
},
init () {
this.showWhichCycles = '1'
this.cycleNum = this.metaList[this.metaIndex].parameter_set.CYCLE_NUMBER
const meta = this.metaList[this.metaIndex]
this.metaID = meta.id
this.isThisModeHasCycle = this.GLOBAL.hasCycleMode(this.metaList[this.metaIndex].parameter_set.MODE, meta.device.library_name)
if (this.isThisModeHasCycle === true) {
this.showCyclePanel = true
this.showPanel = true
} else {
this.showCyclePanel = false
this.showPanel = false
}
},
clear () {
this.showWhichCycles = '1'
},
async setCycle () {
console.log('setCycle')
if (this.isThisModeHasCycle === true) {
const dataCycleList = this.recInfo[this.metaID][this.cycleDataID][this.currentScale]
const cycleDataList = []
@@ -105,15 +106,14 @@ export default {
const cycleDict = this.getCycleDictRec()(cycleDataList)
this.cycleNum = Object.keys(cycleDict).length
let dataXList
if (this.axisXDataType.description !== 'Time') {
dataXList = this.recInfo[this.metaID][this.axisXDataType.id][this.currentScale]
if (this.controlPanel.x.axis.description !== 'Time') {
dataXList = this.recInfo[this.metaID][this.controlPanel.x.axis.channel][this.currentScale]
}
const dataYList = this.recInfo[this.metaID][this.axisYDataType.id][this.currentScale]
const dataYList = this.recInfo[this.metaID][this.controlPanel.y.axis.channel][this.currentScale]
const filteredData = []
let counter = 0
for (let sliceIndex = 0; sliceIndex < this.cycleNum; sliceIndex++) {
// console.log(this.slices)
if (this.slices() === '' || this.slices().includes((sliceIndex + 1).toString())) {
// slice data
const value = cycleDict[sliceIndex + 1]
@@ -129,36 +129,18 @@ export default {
endIndex = i
}
}
for (let i = startIndex; i <= endIndex; i++) {
const dataY = await this.getData(parseInt(this.currentScale), this.sampleMethod, dataYList[i].id, this.axisYDataType.id, this.metaList[this.metaIndex])
if (this.axisXDataType.description !== 'Time') {
const dataX = await this.getData(parseInt(this.currentScale), this.sampleMethod, dataXList[i].id, this.axisXDataType.id, this.metaList[this.metaIndex])
const dataY = await this.getData(parseInt(this.currentScale), this.sampleMethod, dataYList[i].id, this.controlPanel.y.axis.channel, this.metaList[this.metaIndex])
if (this.controlPanel.x.axis.description !== 'Time') {
const dataX = await this.getData(parseInt(this.currentScale), this.sampleMethod, dataXList[i].id, this.controlPanel.x.axis.channel, this.metaList[this.metaIndex])
for (let j = 0, len = dataY.length; j < len; j++) {
if (parseInt(dataY[j][0]) >= startTime && parseInt(dataY[j][0]) <= endTime) {
let x
let y
if (this.axisXLabelScale.description === 'Log') {
x = Math.abs(dataX[j][1])
} else if (this.axisXLabelScale.description === 'Linear') {
x = dataX[j][1]
}
if (this.axisYLabelScale.description === 'Log') {
y = Math.abs(dataY[j][1])
} else if (this.axisYLabelScale.description === 'Linear') {
y = dataY[j][1]
}
filteredData.push([x, y])
filteredData.push([dataX[j][1], dataY[j][1]])
}
}
} else {
for (let j = 0, len = dataY.length; j < len; j++) {
if (parseInt(dataY[j][0]) >= startTime && parseInt(dataY[j][0]) <= endTime) {
if (this.axisYLabelScale.description === 'Log') {
dataY[j][1] = Math.abs(dataY[j][1])
} else if (this.axisYLabelScale.description === 'Linear') {
// do nothing
}
filteredData.push(dataY[j])
}
}
@@ -170,14 +152,13 @@ export default {
seriesIndex: this.metaIndex,
data: filteredData,
})
if (this.axisXDataType.description === 'Time') {
if (this.controlPanel.x.axis.description === 'Time') {
if (counter === 0) {
this.chartData[this.chartID].xAxis[this.metaIndex].min = startTime
}
this.chartData[this.chartID].xAxis[this.metaIndex].max = endTime
counter++
}
// this.$emit('refreshChart', this.chartData[this.chartID])
}
}
}
@@ -196,11 +177,6 @@ export default {
...mapMutations('replay', [types.chart.updateSeries]),
...mapGetters('replay', [types.rec.getCycleDict]),
},
mounted () {
},
destroyed () {
},
}
</script>
@@ -1,3 +1,4 @@
<!-- eslint-disable prefer-const -->
<template>
<div>
<va-select
@@ -87,31 +88,116 @@ export default {
this.calculateScaleHelper(gridIndex, ch)
}
}
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
this.calculateScaleHelper(this.metaIndex, -1) // [TODO] elite tmp use metaIndex for grid index
}
},
async calculateScaleHelper (gridIndex, ch) {
let seriesData
if (this.scaleFormat.description === 'Log') {
seriesData = JSON.parse(JSON.stringify(this.chartData[this.chartID].series[gridIndex].data))
for (let i = 0; i < seriesData.length; i++) {
if (this.axis === 'x') {
seriesData[i][0] = Math.abs(seriesData[i][0])
} else if (this.axis === 'y') {
seriesData[i][1] = Math.abs(seriesData[i][1])
// console.log('desc', this.scaleFormat.description)
/* var _dataDiff = []
var _dataIntegral = []
var _dataLog = []
// this.$emit('changeAxis', this.metaIndex)
// this.$emit('clearCycle')
if (this.scaleFormat.description === 'Differential') {
// await this.reDrawChart()
// eslint-disable-next-line prefer-const
let seriesData = JSON.parse(JSON.stringify(this.chartData[this.chartID].series[gridIndex].data))
// console.log('diff')
var curXData = 0
var curYData = 0
var prevXData = 0
var prevYData = 0
var timeGap = 0
var curTime = 0
_dataDiff = []
var diffResult = 0
for (let index = 0; index < seriesData.length; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
// timeGap = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
// curTime = seriesData[index][timeIndex]
// _data.push([curTime, 0, curTime])
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
prevXData = parseFloat(seriesData[index - 1][0])
prevYData = parseFloat(seriesData[index - 1][1])
curTime += timeGap
diffResult = parseFloat((curYData - prevYData) / (curXData - prevXData))
_dataDiff.push([curXData, diffResult])
}
}
this.updateSeriesChart({
chartID: this.chartID,
seriesIndex: gridIndex,
data: seriesData,
data: _dataDiff,
})
} else if (this.scaleFormat.description === 'Integral') {
// await this.reDrawChart()
// eslint-disable-next-line prefer-const
let seriesData = JSON.parse(JSON.stringify(this.chartData[this.chartID].series[gridIndex].data))
var curYDataIntegral = 0
var prevYDataIntegral = 0
var timeGapIntegral = 0
var curTimeIntegral = 0
var integralResult = 0
_dataIntegral = []
for (let index = 0; index < seriesData.length; index++) {
if (index === 0) {
curYDataIntegral = parseFloat(seriesData[index][1])
timeGapIntegral = seriesData[index + 1][0] - seriesData[index][0]
curTimeIntegral = seriesData[index][0]
_dataIntegral.push([curTime, 0])
} else {
prevYDataIntegral = parseFloat(seriesData[index - 1][1])
curYDataIntegral = parseFloat(seriesData[index][1])
integralResult += parseFloat((Math.abs(curYDataIntegral) + Math.abs(prevYDataIntegral)) * timeGapIntegral / 2)
curTimeIntegral += timeGapIntegral
_dataIntegral.push([curTimeIntegral, integralResult])
}
}
this.updateSeriesChart({
chartID: this.chartID,
seriesIndex: gridIndex,
data: _dataIntegral,
})
} else if (this.scaleFormat.description === 'Log') {
await this.reDrawChart()
setTimeout(() => {
// eslint-disable-next-line prefer-const
let seriesData = JSON.parse(JSON.stringify(this.chartData[this.chartID].series[gridIndex].data))
_dataLog = seriesData
for (let i = 0; i < seriesData.length; i++) {
if (this.axis === 'x') {
seriesData[i][0] = parseFloat(seriesData[i][0])
if (seriesData[i][0] !== 0) {
// seriesData[i][0] = Math.log10(Math.abs(seriesData[i][0]))
_dataLog[i][0] = Math.log10(Math.abs(seriesData[i][0]))
}
} else if (this.axis === 'y') {
seriesData[i][1] = parseFloat(seriesData[i][1])
if (seriesData[i][1] !== 0) {
// seriesData[i][1] = Math.log10(Math.abs(seriesData[i][1]))
_dataLog[i][1] = Math.log10(Math.abs(seriesData[i][1]))
}
}
}
this.updateSeriesChart({
chartID: this.chartID,
seriesIndex: gridIndex,
data: _dataLog,
})
console.log('done')
}, 2000)
// eslint-disable-next-line prefer-const
} else if (this.scaleFormat.description === 'Linear') {
// console.log(this.recInfo)
if (this.deviceName.startsWith('Neulive')) {
console.log('inside neulive')
// [Region] get the subfile index
seriesData = []
// eslint-disable-next-line prefer-const
let seriesData = []
const dataYList = this.recInfo[this.metaID][ch][this.currentScale]
let startIndex = 0
let endIndex = 0
@@ -140,12 +226,23 @@ export default {
}
}
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
this.$emit('changeAxis', this.metaIndex)
this.$emit('clearCycle')
console.log('inside Elite')
// this.$emit('changeAxis', this.metaIndex)
// this.$emit('clearCycle')
this.reDrawChart()
}
}
} */
// console.log('inside changeScale: ', this.scaleFormat.description)
this.reDrawChart()
this.setAxisDisplayChart({ type: this.displayType[this.axis], axis: this.axis, chartID: this.chartID, gridIndex: gridIndex })
},
reDrawChart: function () {
// console.log('die here')
this.$emit('changeFunctional', this.axis, this.scaleFormat.description)
// console.log('reDrawChart: ', this.axis, this.scaleFormat.description)
this.$emit('changeAxis', this.metaIndex)
this.$emit('clearCycle')
},
getData: async function (scale, sampleMethod, id, channel, meta) {
if (scale === 1) {
return await download.rawByIDChannels(id, channel, meta)
@@ -157,11 +254,19 @@ export default {
}
}
},
getScaleByAxis () {
return this.scaleFormat.description
},
...mapActions('replay', [types.chart.setAxisDisplay]),
...mapMutations('replay', [types.chart.updateSeries]),
...mapGetters('replay', [types.rec.getCycleDict]),
},
mounted () {
if (this.axis === 'x') {
this.scaleOptions = this.scaleXOptions
} else if (this.axis === 'y') {
this.scaleOptions = this.scaleYOptions
}
},
data () {
return {
@@ -169,7 +274,8 @@ export default {
metaID: 0,
metaInfo: null,
scaleFormat: { id: 0, description: 'Linear' },
scaleOptions: [
scaleOptions: [],
scaleXOptions: [
{
id: 0,
description: 'Linear',
@@ -179,6 +285,24 @@ export default {
description: 'Log',
},
],
scaleYOptions: [
{
id: 0,
description: 'Linear',
},
{
id: 1,
description: 'Log',
},
{
id: 2,
description: 'Integral',
},
{
id: 3,
description: 'Differential',
},
],
}
},
destroyed () {
@@ -65,9 +65,9 @@ export default {
return item.unit === 'uV'
})
}
} else if (this.deviceName === 'EliteZM15') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC')) {
return this.valueFormatOptions[this.dataType][0]
} else if (this.deviceName === 'EliteEIS') {
} else if (this.deviceName.includes('EIS')) {
return this.eisValueFormatOptions[this.dataType][0]
}
},
@@ -80,7 +80,7 @@ export default {
} else if (this.axis === 'y') {
this.dataType = 'voltage'
}
} else if (this.deviceName === 'EliteZM15') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC')) {
// use state meta to decide which default unit need to be used (like check I-V mode...)
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
const xType = setting[0]
@@ -111,7 +111,7 @@ export default {
} else if (settingType === 'Time') {
this.dataType = 'time'
}
} else if (this.deviceName === 'EliteEIS') {
} else if (this.deviceName.includes('EIS')) {
const setting = this.GLOBAL.getDefaultChartTypeByMode(this.metaList[this.metaIndex].parameter_set.MODE, this.deviceName)
const xType = setting[0]
const xValue = setting[1]
@@ -127,7 +127,7 @@ export default {
settingValue = yValue
}
if (settingType === 'EliteEIS') {
if (settingType.includes('EIS')) {
if (settingValue === 3) {
this.dataType = 'frequency'
} else if (settingValue === 5 || settingValue === 6 || settingValue === 7) {
@@ -179,7 +179,7 @@ export default {
channel: parseInt(key),
})
}
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
this.updateAxisLabelChart({
chartID: chartID,
axis: this.axis,
@@ -229,13 +229,20 @@ export default {
this.dataType = 'default'
}
}
if (this.deviceName === 'EliteZM15') {
if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC')) {
this.valueFormat = this.valueFormatOptions[this.dataType][0]
} else if (this.deviceName === 'EliteEIS') {
} else if (this.deviceName.includes('EIS')) {
this.valueFormat = this.eisValueFormatOptions[this.dataType][0]
}
this.changeUnit()
},
getUnitByAxis () {
// console.log('valueFormat: ', this.valueFormat.unit)
if (this.valueFormat.unit === undefined) {
return 'auto'
}
return this.valueFormat.unit
},
// call vuex to mutate chart label formatter by unit and axis
...mapMutations('replay', [types.chart.updateAxisLabel]),
},
@@ -0,0 +1,56 @@
<template>
<div>
<va-select
v-model="controlPanel[coordinate].axis"
class="va-select-without-margin"
:options="axisOption"
text-by="description"
key-by="description"
:noClear='true'
@input="changeAxis()"
/>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { tableRouter } from '@/components/analysis/replay/toolbox/EliteReplayTable'
import configRouter from '@/components/analysis/replay/toolbox/configTable'
export default {
name: 'controlAxis',
props: {
coordinate: {
type: String, // x or y
},
},
data () {
return {
axisOption: [],
tableRouter,
configRouter,
}
},
computed: {
...mapFields('replay', [
'controlPanel',
]),
},
methods: {
init (library, settingType) {
this.axisOption = this.configRouter.getAxisOption(library, settingType, this.coordinate)
},
changeAxis () {
this.$emit('changeAxis', 0)
},
},
}
</script>
<style lang="scss">
.va-select-without-margin {
.va-select {
margin-bottom: 0;
}
}
</style>
@@ -0,0 +1,50 @@
<template>
<div class="flex row">
<va-radio-button
v-for="(funct, index) in functOption"
v-model="controlPanel[coordinate].funct"
:key="index"
:option="funct"
@input="changeFunct()"
/>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { tableRouter } from '@/components/analysis/replay/toolbox/EliteReplayTable'
import configRouter from '@/components/analysis/replay/toolbox/configTable'
export default {
name: 'controlFunct',
props: {
coordinate: {
type: String, // x or y
},
},
data () {
return {
funct: '',
functOption: [],
tableRouter,
configRouter,
}
},
computed: {
...mapFields('replay', [
'controlPanel',
]),
},
methods: {
init (xAxis, yAxis) {
this.controlPanel[this.coordinate].funct = 'Linear'
this.functOption = this.configRouter.getFunctOption(xAxis, yAxis, this.coordinate)
},
changeFunct () {
this.$emit('changeFunct', this.coordinate)
},
},
}
</script>
@@ -0,0 +1,57 @@
<template>
<div>
<va-select
v-model="controlPanel[coordinate].unit"
class="va-select-without-margin"
:options="unitOption"
:noClear='true'
@input="changeUnit()"
/>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { tableRouter } from '@/components/analysis/replay/toolbox/EliteReplayTable'
import configRouter from '@/components/analysis/replay/toolbox/configTable'
export default {
name: 'controlUnit',
props: {
coordinate: {
type: String, // x or y
},
},
data () {
return {
unit: '',
unitOption: [],
tableRouter,
configRouter,
}
},
computed: {
...mapFields('replay', [
'controlPanel',
]),
},
methods: {
init (axis) {
this.controlPanel[this.coordinate].unit = this.configRouter.getUnit(axis)
this.unitOption = this.configRouter.getUnitOption(axis)
},
changeUnit () {
this.$emit('changeUnit', this.coordinate)
},
},
}
</script>
<style lang="scss">
.va-select-without-margin {
.va-select {
margin-bottom: 0;
}
}
</style>
@@ -0,0 +1,209 @@
// library definition
// const libraryInfo = {
// EDC: {
// x: ['Time',
// 'Current',
// 'Voltage',
// 'Resistance',
// ],
// y: ['Current',
// 'Voltage',
// 'Resistance',
// ],
// },
// }
// axis information
const axisInfo = {
// axis type
Time: {
name: 'Time',
channel: -1,
option: {
auto: 1,
},
defaultUnit: 'auto',
downloadUnit: 'auto',
},
Current: {
name: 'Current',
channel: 0,
option: {
nA: 1,
uA: 1e3,
mA: 1e6,
A: 1e9,
},
defaultUnit: 'mA',
downloadUnit: 'A',
},
Voltage: {
name: 'Voltage',
channel: 1,
option: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'V',
},
Resistance: {
name: 'Resistance',
channel: 2,
option: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
Cycle: {
name: 'Cycle',
channel: 3,
option: {
cycle: 1,
},
defaultUnit: 'cycle',
downloadUnit: 'cycle',
},
Charge: {
name: 'Charge',
channel: -1,
option: {
nAh: 3600 * 1e6,
uAh: 1600 * 1e9,
mAh: 3600 * 1e12,
Ah: 3600 * 1e15,
},
defaultUnit: 'mAh',
downloadUnit: 'mAh',
},
Power: {
name: 'Power',
channel: -1,
option: {
mW: 1e12,
W: 1e15,
kW: 1e18,
},
defaultUnit: 'W',
downloadUnit: 'W',
},
Transconductance: {
name: 'Transconductance',
channel: -1,
option: {
'mA/V': 1,
'A/V': 1e3,
'kA/V': 1e6,
},
defaultUnit: 'A/V',
downloadUnit: 'A/V',
},
Impedance: {
name: 'Impedance',
chanel: 6,
option: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
None: {
name: 'not support',
channel: -1,
option: {
none: 1,
},
defaultUnit: 'none',
downloadUnit: 'none',
},
}
export const tableRouter = {
getChannel: (axis) => {
return axisInfo[axis].channel
},
getDefaultUnit: (axis) => {
return axisInfo[axis].defaultUnit
},
getOption: (axis) => {
return axisInfo[axis].option
},
getTable: (xAxis, xFunct, yAxis, yFunct) => {
var xTable = axisInfo[xAxis]
var yTable = axisInfo.None
if (yFunct === 'Linear' || yFunct === 'Log') {
yTable = axisInfo[yAxis]
} else if (yFunct === 'Integral') {
if (xAxis === 'Time' && yAxis === 'Current') {
yTable = axisInfo.Charge
} else if (xAxis === 'Current' && yAxis === 'Voltage') {
yTable = axisInfo.Power
} else if (xAxis === 'Voltage' && yAxis === 'Current') {
yTable = axisInfo.Power
}
} else if (yFunct === 'Differential') {
if (xAxis === 'Current' && yAxis === 'Voltage') {
yTable = axisInfo.Resistance
} else if (xAxis === 'Voltage' && yAxis === 'Current') {
yTable = axisInfo.Transconductance
}
}
return [xTable, yTable]
},
getFunct (xAxis, yAxis, axis) {
let xTable = ['']
let yTable = ['']
if (xAxis === 'Time') {
xTable = ['Linear']
if (yAxis === 'Current') {
yTable = ['Linear', 'Log', 'Integral']
} else {
yTable = ['Linear', 'Log']
}
} else {
xTable = ['Linear', 'Log']
if ((xAxis === 'Voltage' && yAxis === 'Current') || (xAxis === 'Current' && yAxis === 'Voltage')) {
yTable = ['Linear', 'Log', 'Integral', 'Differential']
} else {
yTable = ['Linear', 'Log']
}
}
if (axis === 'x') return xTable
else return yTable
},
// axisLabel formatter
autoTimeFormatter (val) {
let label = ''
const hour = parseInt(val / 3.6e9)
const minute = parseInt((val % 3.6e9) / 1000000 / 60)
const second = parseInt((val % 6e7) / 1000000)
const millisecond = parseInt((val % 1e6) / 1000)
if (hour > 0) {
label += hour + ' h '
}
if (minute > 0) {
label += minute + ' m '
}
if (second > 0) {
label += second + ' s '
}
if (millisecond > 0) {
label += millisecond + ' ms '
}
if (hour === 0 && minute === 0 && second === 0 && millisecond === 0) {
label += ' 0 ms '
}
return label
},
}
@@ -8,7 +8,7 @@
<script>
import { mapFields } from 'vuex-map-fields'
import paramTable from '@/data/param-table/index.js'
import paramTable from '@/data/config-table/index.js'
export default {
name: 'show-parameter',
@@ -378,19 +378,21 @@ export default {
this.content += ' Frequency: ' + String(1000 / period) + ' Hz' + '<br/>' // 1000 is cuz 1s = 1000ms
this.content += ' Period: ' + String(period) + ' ms' + '<br/>'
}
} else if (this.deviceName === 'EliteZM15' || this.deviceName === 'EliteEIS') {
} else if (this.deviceName === 'EliteZM15' || this.deviceName.includes('Elite_EDC') || this.deviceName.includes('EIS')) {
const mode = this.mode = params.MODE
const modeName = paramTable[this.deviceName].MODE[mode].name
const showParams = paramTable[this.deviceName].MODE[mode].showParameter
const config = paramTable.getConfig(this.deviceName)
const modeConfig = paramTable.getModeConfig(this.deviceName, mode)
const modeName = modeConfig.name
const showParams = modeConfig.showParameter
this.showDict.MODE = modeName
if (modeName === 'Pulse Sensing') {
const duplicateParam = ['V_initial', 't_pulse', 'CURR_REC']
for (let i = 0; i < 4; i++) {
const key = 'segment_order'
const order = paramTable[this.deviceName][key].outputReadabilityData(params[key], 1, i)
const order = config[key].outputReadabilityData(params[key], 1, i)
if (parseInt(order) >= 0) { // if === -1, 代表沒有使用這個block
for (const key of duplicateParam) {
this.fillShowDict(key, paramTable[this.deviceName][key].outputReadabilityData(params[key], 1, i), i)
this.fillShowDict(key, config[key].outputReadabilityData(params[key], 1, i), i)
}
}
}
@@ -409,16 +411,17 @@ export default {
this.dump()
},
fillShowDict (key, value, index = -1) {
const expVal = paramTable[this.deviceName][key].defaultUnit
? paramTable[this.deviceName][key].outputReadabilityData(value, paramTable[this.deviceName][key].unit[paramTable[this.deviceName][key].defaultUnit])
: paramTable[this.deviceName][key].outputReadabilityData(value)
let name = typeof (paramTable[this.deviceName][key].showName) === 'function'
? paramTable[this.deviceName][key].showName(this.mode)
: paramTable[this.deviceName][key].showName
const config = paramTable.getConfig(this.deviceName)
const expVal = config[key].defaultUnit
? config[key].outputReadabilityData(value, config[key].unit[config[key].defaultUnit])
: config[key].outputReadabilityData(value)
let name = typeof (config[key].showName) === 'function'
? config[key].showName(this.mode)
: config[key].showName
if (index >= 0) {
name += ` ${index + 1}`
}
const unit = paramTable[this.deviceName][key].defaultUnit
const unit = config[key].defaultUnit
this.showDict[name] = unit !== undefined ? expVal.toString() + unit : expVal.toString()
},
dump () {
@@ -0,0 +1,177 @@
<template>
<div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0">
<p class="display-6" v-if="ifMeaning"> Area </p>
</div>
<div
class="row flex sm10 xl10 md10 xs10"
v-show="ifMeaning"
>
<div class="xs6 sm6 lg6 xl6">
<va-input
v-model="specificIntegral"
label="Integral value"
disabled
>
<p slot="append" style="margin-right: 0;" small>
{{ integralResult }}
</p>
</va-input>
</div>
<div class="xs2 sm2 lg2 xl2">
<va-select
v-model="integralUnit"
:options="integralOption"
@input="refreshScale"
style="width: 75px;"
class="va-select-without-margin"
noClear
/>
</div>
</div>
</div>
<div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0">
<p class="display-6"> Range </p>
</div>
<va-input
v-model="x_start"
label="X Start"
@focus="userEnter()"
@blur="userEnter()"
@keyup.enter="setBrushBoundary"
>
<p slot="append" style="margin-right: 0;" small>
{{ xUnit }}
</p>
</va-input>
<va-input
v-model="x_end"
label="X End"
@focus="userEnter()"
@blur="userEnter()"
@keyup.enter="setBrushBoundary"
>
<p slot="append" style="margin-right: 0;" small>
{{ xUnit }}
</p>
</va-input>
</div>
<div class="flex-container mb-2">
<div class="flex sm2 xl2 md2 xs2 px-0 py-0">
</div>
<va-input
v-model="y_start"
label="Y Start"
@focus="userEnter()"
@blur="userEnter()"
@keyup.enter="setBrushBoundary"
>
<p slot="append" style="margin-right: 0;" small>
{{ yUnit }}
</p>
</va-input>
<va-input
v-model="y_end"
label="Y End"
@focus="userEnter()"
@blur="userEnter()"
@keyup.enter="setBrushBoundary"
>
<p slot="append" style="margin-right: 0;" small>
{{ yUnit }}
</p>
</va-input>
</div>
</div>
</div>
</template>
<script>
import { tableRouter } from '@/components/analysis/replay/toolbox/EliteReplayTable'
import configRouter from '@/components/analysis/replay/toolbox/configTable'
export default {
name: 'SpecificIntegral',
data () {
return {
specificIntegral: 0,
x_start: 0,
x_end: 0,
y_start: 0,
y_end: 0,
xUnit: '',
yUnit: '',
xScale: '',
yScale: '',
integralResult: '',
integralUnit: '',
integralOption: [],
integralTable: {},
integralScale: '',
ifMeaning: true,
ifUserKeyIn: false,
tableRouter,
configRouter,
}
},
methods: {
refreshScale () {
this.integralScale = this.configRouter.getUnitScale(this.integralResult)[this.integralUnit]
},
userEnter () {
this.ifUserKeyIn = !this.ifUserKeyIn
},
getSpecificIntegral (specificIntegral, boundary) {
this.specificIntegral = specificIntegral / this.integralScale
if (!this.ifUserKeyIn) {
this.x_start = (boundary.x_start / this.xScale).toFixed(3)
this.x_end = (boundary.x_end / this.xScale).toFixed(3)
this.y_start = (boundary.y_start / this.yScale).toFixed(3)
this.y_end = (boundary.y_end / this.yScale).toFixed(3)
}
},
setBrushBoundary () {
if (isNaN(this.x_start)) this.x_start = 0
if (isNaN(this.x_end)) this.x_start = 0
if (isNaN(this.xy_start)) this.y_start = 0
if (isNaN(this.y_end)) this.y_end = 0
var boundary = {
x_start: Number(this.x_start) * this.xScale,
x_end: Number(this.x_end) * this.xScale,
y_start: Number(this.y_start) * this.yScale,
y_end: Number(this.y_end) * this.yScale,
}
this.$emit('setBrushBoundary', boundary)
},
setDisplayParam (xAxis, xUnit, yAxis, yUnit) {
const xScaleOption = this.configRouter.getUnitScale(xAxis)
const yScaleOption = this.configRouter.getUnitScale(yAxis)
const integralResult = this.configRouter.getFSM(xAxis, yAxis).Integral
this.xUnit = xUnit
this.yUnit = yUnit
this.xScale = xScaleOption[xUnit]
this.yScale = yScaleOption[yUnit]
this.integralResult = integralResult
this.integralUnit = this.configRouter.getUnit(integralResult)
this.integralOption = this.configRouter.getUnitOption(integralResult)
this.integralScale = this.configRouter.getUnitScale(integralResult)[this.integralUnit]
},
refreshDisplayParam (xAxis, xUnit, yAxis, yUnit) {
const xScaleOption = this.configRouter.getUnitScale(xAxis)
const yScaleOption = this.configRouter.getUnitScale(yAxis)
this.xUnit = xUnit
this.yUnit = yUnit
this.xScale = xScaleOption[xUnit]
this.yScale = yScaleOption[yUnit]
},
checkMeaning (xAxis, yAxis) {
const functOption = this.configRouter.getFunctOption(xAxis, yAxis)
this.ifMeaning = functOption.includes('Integral')
},
},
}
</script>
@@ -0,0 +1,405 @@
// object saving library name mapping table
const libraryNameMappingTable = {
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',
'Elite_EIS_1.0': 'EliteEIS',
'Elite_EIS_1.1': 'EliteEIS',
'Elite_EIS_MINI_1.0': 'EliteEIS',
'Elite_TRIG_0.1': null,
'Elite_MEGAFLY_0.1': null,
}
// object saving setting type mapping table
const settingTypeMappingTable = {
EliteEDC: {
Time: {
description: 'Time',
channel: undefined,
},
Elite: {
1: {
description: 'Current',
channel: 0,
},
2: {
description: 'Voltage',
channel: 1,
},
3: {
description: 'Resistance',
channel: 2,
},
// 4: {
// description: 'Cycle',
// channel: 3,
// },
},
},
EliteEIS: {
Time: {
description: 'Time',
channel: undefined,
},
Elite: {
1: {
description: 'Current',
channel: 0,
},
2: {
description: 'Voltage',
channel: 1,
},
3: {
description: 'Resistance',
channel: 2,
},
},
EliteEIS: {
3: {
description: 'Frequency',
channel: 2,
},
5: {
description: 'Z_imag',
channel: 4,
},
6: {
description: 'Z_real',
channel: 5,
},
7: {
description: 'Impedance',
channel: 6,
},
8: {
description: 'Phase',
channel: 7,
},
9: {
description: 'Current',
channel: 8,
},
10: {
description: 'Gain_Level',
channel: 9,
},
},
},
}
// object saving unit information mapping table
const unitInfoMappingTable = {
// Time
Time: {
name: 'Time',
channel: -1,
option: {
auto: 1,
us: 1,
ms: 1e3,
s: 1e6,
min: 60 * 1e6,
hour: 3600 * 1e6,
},
defaultUnit: 'auto',
downloadUnit: 'auto',
},
// Elite
Current: {
name: 'Current',
channel: 0,
option: {
nA: 1,
uA: 1e3,
mA: 1e6,
A: 1e9,
},
defaultUnit: 'mA',
downloadUnit: 'A',
},
Voltage: {
name: 'Voltage',
channel: 1,
option: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'V',
},
Resistance: {
name: 'Resistance',
channel: 2,
option: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
// Elite after Integral
Charge: {
name: 'Charge',
channel: -1,
option: {
nAh: 3600 * 1e6,
uAh: 1600 * 1e9,
mAh: 3600 * 1e12,
Ah: 3600 * 1e15,
},
defaultUnit: 'mAh',
downloadUnit: 'mAh',
},
Power: {
name: 'Power',
channel: -1,
option: {
mW: 1e12,
W: 1e15,
kW: 1e18,
},
defaultUnit: 'W',
downloadUnit: 'W',
},
// Elite after Differential
Transconductance: {
name: 'Transconductance',
channel: -1,
option: {
'mA/V': 1,
'A/V': 1e3,
'kA/V': 1e6,
},
defaultUnit: 'A/V',
downloadUnit: 'A/V',
},
// EliteEIS
Frequency: {
name: 'Frequency',
chanel: 2,
option: {
mHz: 1,
Hz: 1e3,
kHz: 1e6,
MHz: 1e9,
},
downloadUnit: 'Hz',
defaultUnit: 'Hz',
},
Z_imag: {
name: 'Z_imag',
chanel: 4,
option: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
Z_real: {
name: 'Z_real',
chanel: 5,
option: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
Impedance: {
name: 'Impedance',
chanel: 6,
option: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
Phase: {
name: 'Phase',
chanel: 7,
option: {
'°': 1,
},
downloadUnit: '°',
defaultUnit: '°',
},
Gain_Level: {
name: 'Gain Level',
chanel: 9,
option: {
'#': 1,
},
downloadUnit: '#',
defaultUnit: '#',
},
undefined: {
name: 'not support',
channel: -1,
option: {
none: 1,
},
defaultUnit: 'none',
downloadUnit: 'none',
},
}
// object saving specific functional information mapping table
const functInfoMappingTable = {
// Time
Time: {
},
// Elite
Current: {
Time: {
Linear: 'Current',
Log: 'Current',
Integral: 'Charge',
},
Voltage: {
Linear: 'Current',
Log: 'Current',
Integral: 'Power',
Differential: 'Impedance',
},
},
Voltage: {
Current: {
Linear: 'Voltage',
Log: 'Voltage',
Integral: 'Power',
Differential: 'Transconductance',
},
},
Resistance: {
},
// EliteEIS
Frequency: {
},
Z_imag: {
},
Z_real: {
},
Impedance: {
},
Phase: {
},
Gain_Level: {
},
None: {
},
}
/**
* return axis description and channel by library, type and index
* @param {String} library
* @param {String} type
* @param {String} index
* @returns {Object} : configuration
*/
function getAxis (library, type, index) {
// some physical property || Time
return settingTypeMappingTable[libraryNameMappingTable[library]][type][index] || settingTypeMappingTable[libraryNameMappingTable[library]][type]
}
/**
* retrun default unit by physical property
* @param {String} axis
* @returns {Object} : unit
*/
function getUnit (axis) {
return unitInfoMappingTable[axis].defaultUnit
}
/**
* return axis option by library, type
* @param {String} library
* @param {String} type
* @param {String} coordinate
* @returns {Object} : axisOption
*/
function getAxisOption (library, type, coordinate) {
if (type === 'Time') type = 'Elite'
const axisOption = Object.values(settingTypeMappingTable[libraryNameMappingTable[library]][type]).map((setting) => {
return setting
})
if (coordinate === 'x') {
axisOption.unshift({
description: 'Time',
channel: undefined,
})
}
return axisOption
}
/**
* retrun option of unit by physical property
* @param {String} axis
* @returns {Object} : unitOption
*/
function getUnitOption (axis) {
return Object.keys(unitInfoMappingTable[axis].option)
}
/**
* retrun a dictionary of scale corresponding to unit by physical property
* @param {String} axis
* @returns {Object} : unitScale
*/
function getUnitScale (axis) {
return unitInfoMappingTable[axis].option
}
/**
* retrun option of functionl by both axis physical property
* @param {String} xAxis
* @param {String} yAxis
* @param {String} coordinate
* @returns {Object} : functOption
*/
function getFunctOption (xAxis, yAxis, coordinate) {
if (coordinate === 'x') return ['Linear', 'Log']
else if (functInfoMappingTable[yAxis] === undefined) return ['Linear', 'Log']
else if (functInfoMappingTable[yAxis][xAxis] === undefined) return ['Linear', 'Log']
else return Object.keys(functInfoMappingTable[yAxis][xAxis])
}
/**
* retrun functional correponding physics property
* @param {String} xAxis
* @param {String} yAxis
* @returns {Object} : functOption
*/
function getFSM (xAxis, yAxis) {
return functInfoMappingTable[yAxis][xAxis] || {
Linear: yAxis,
Log: yAxis,
}
}
const configRouter = {
getAxis,
getUnit,
getAxisOption,
getUnitOption,
getUnitScale,
getFunctOption,
getFSM,
}
export default configRouter
+60
View File
@@ -0,0 +1,60 @@
<template>
<div>
<p>aaa</p>
<chart class="chart" :option="option" />
</div>
</template>
<script>
export default {
data () {
return {
option: {
title: {
text: 'Traffic Sources',
left: 'center',
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)',
},
legend: {
orient: 'vertical',
left: 'left',
data: ['Direct', 'Email', 'Ad Networks', 'Video Ads', 'Search Engines'],
},
series: [
{
name: 'Traffic Sources',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{ value: 335, name: 'Direct' },
{ value: 310, name: 'Email' },
{ value: 234, name: 'Ad Networks' },
{ value: 135, name: 'Video Ads' },
{ value: 1548, name: 'Search Engines' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
},
],
brush: {
},
},
}
},
}
</script>
<style>
.chart {
height: 100vh;
}
</style>
+115
View File
@@ -0,0 +1,115 @@
<template>
<va-card class="flex xl3 md3 sm12 xs12" title="MQTT">
<div class="row ma-1 text-center">
<va-button @click="getControllerID">Controller-ID</va-button>
<div class="flex-center">
{{ controllerID }}
</div>
</div>
<div class="row ma-1 text-start" v-if="controllerID !== ''">
<va-button @click="getHardwareInfo">HardwareInfo</va-button>
<div class="">
{{ responseMessage }}
</div>
</div>
</va-card>
</template>
<script>
import api from '@/data/api'
export default {
name: 'Developer',
components: {
},
data () {
return {
controllerID: '',
responseMessage: '',
}
},
mqtt: {
async '+/get_device_info_all/+' (data, topic) {
console.log('get_device_info_all', String.fromCharCode.apply(null, data))
},
async '+/hardware_device/+' (data, topic) {
console.log('hardware_device', String.fromCharCode.apply(null, data))
},
async '+/hardware_datetime/+' (data, topic) {
console.log('hardware_datetime', String.fromCharCode.apply(null, data))
},
async '+/hardware_info/+' (data, topic) {
console.log('hardware_info', String.fromCharCode.apply(null, data))
this.responseMessage = String.fromCharCode.apply(null, data)
},
async '+/broadcast/+' (data, topic) {
console.log('broadcast', String.fromCharCode.apply(null, data))
},
},
methods: {
mqttPub: function (topic, mes) {
this.$mqtt.publish(topic, mes)
},
mqttSub: function (val) {
this.$mqtt.subscribe(val)
},
mqttUnSub: function (val) {
this.$mqtt.unsubscribe(val)
},
pageMqttSub: function (id) {
this.mqttSub(id + '/hardware_datetime/+')
this.mqttSub(id + '/hardware_device/+')
this.mqttSub(id + '/hardware_info/+')
this.mqttSub(id + '/broadcast')
this.mqttSub(id + '/get_device_info_all/+')
},
pageMqttUnSub: function (id) {
this.mqttUnSub(id + '/hardware_datetime/+')
this.mqttUnSub(id + '/hardware_device/+')
this.mqttUnSub(id + '/hardware_info/+')
this.mqttUnSub(id + '/broadcast')
this.mqttUnSub(id + '/get_device_info_all/+')
},
getControllerID: async function () {
try {
const response = await api.controller.getAll()
if (response.status === 200) {
if (response.data.length > 0) {
this.controllerID = response.data[0].mqtt_id
this.pageMqttSub(this.controllerID)
return true
}
this.controllerID = 'No Controller Info'
return false
}
this.controllerID = 'Wrong status ' + response.status
} catch (e) {
console.log(e)
this.controllerID = e
}
},
getHardwareDatetime: function () {
this.mqttPub(this.controllerID + '_user', JSON.stringify({
header: 'hardware_datetime/0',
content: String(Date.now()),
}))
},
getHardwareInfo: function () {
this.mqttPub(this.controllerID + '_user', JSON.stringify({
header: 'hardware_info/0',
}))
},
},
async mounted () {
},
destroyed () {
if (this.controllerID !== '') {
this.pageMqttUnSub(this.controllerID)
}
},
}
</script>
<style>
</style>
+58
View File
@@ -0,0 +1,58 @@
<template>
<va-card class="" title="LED">
<div class="row ma-1">
<va-button v-for="color in colors" :key="color" :color="colorMapping[color]" @click="changeLedColor(color)">
{{color}}
</va-button>
<va-button :color="'gray'" @click="testLed()">test</va-button>
</div>
</va-card>
</template>
<script>
import { taskInfo } from '@/data/task/TaskInfo'
export default {
name: 'Developer',
components: {
},
data () {
return {
colors: ['red', 'orange', 'yellow', 'green', 'blue', 'cyan', 'magenta'],
colorMapping: {
red: 'danger',
orange: 'Orange',
blue: 'primary',
yellow: 'warning',
green: 'success',
cyan: 'info',
magenta: 'violet',
},
}
},
methods: {
mqttPub: function (topic, mes) {
this.$mqtt.publish(topic, mes)
},
testLed: function () {
this.changeLedColor('red')
setTimeout(() => { this.changeLedColor('blue') }, 2000)
setTimeout(() => { this.changeLedColor('green') }, 4000)
},
changeLedColor: function (color) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'hardware_send/0',
command: 'led',
state: color,
}))
},
},
async mounted () {
await taskInfo.updateTaskInfo(this.$route.params.taskID)
},
}
</script>
<style>
</style>
+1 -1
View File
@@ -1,6 +1,5 @@
<template>
<div class="devices-overview">
<div >
<va-card
v-for="controller in controllerList" :key="controller.id"
@@ -518,6 +517,7 @@ export default {
async mounted () {
await taskInfo.updateTaskInfo()
await this.getControllerList()
this.GLOBAL.refreshCache()
this.pageMqttSub()
this.pageInitPub()
+2 -2
View File
@@ -22,7 +22,7 @@ import { mapFields } from 'vuex-map-fields'
import newDownload from '@/factories/file/downloadFactory'
import newChannel from '@/factories/file/channelFactory'
import { taskInfo } from '@/data/task/TaskInfo'
import paramTable from '@/data/param-table/index'
import configTable from '@/data/config-table/index'
export default {
name: 'Download',
@@ -108,7 +108,7 @@ export default {
}
if (meta !== undefined) {
this.metaInfo = meta
const channelParamObj = paramTable[meta.device.library_name].MODE[meta.parameter_set.MODE].channels
const channelParamObj = configTable.getModeConfig(meta.device.library_name, meta.parameter_set.MODE).channels
const channelArray = allChannel === 'all' ? JSON.parse(this.metaInfo.channels) : Object.keys(channelParamObj).filter(ele => ele !== 'time')
const channelList = []
+2 -2
View File
@@ -26,7 +26,7 @@ import newDownload from '@/factories/file/downloadFactory'
import newChannel from '@/factories/file/channelFactory'
import progressModal from '@/components/common/progressBarByValueModal/progressModal.vue'
import { taskInfo } from '@/data/task/TaskInfo'
import paramTable from '@/data/param-table/index'
import configTable from '@/data/config-table/index'
export default {
name: 'DownloadOffline',
@@ -113,7 +113,7 @@ export default {
}
if (meta !== undefined) {
this.metaInfo = meta
const channelParamObj = paramTable[meta.device.library_name].MODE[meta.parameter_set.MODE].channels
const channelParamObj = configTable.getModeConfig(meta.device.library_name, meta.parameter_set.MODE).channels
const channelArray = allChannel === 'all' ? JSON.parse(this.metaInfo.channels) : Object.keys(channelParamObj).filter(ele => ele !== 'time')
const channelList = []
+1 -1
View File
@@ -68,7 +68,7 @@ export default {
this.$refs.file_ref.currentInfo = initCollection.data[0]
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
+36 -15
View File
@@ -33,6 +33,7 @@
editFile()
showModal.editFile = false
}"
:noOutsideDismiss="true"
tabindex="0"
>
<va-input
@@ -82,9 +83,9 @@
<va-card class="flex sm12 xl12 md12 xs12">
<template slot="header">
<div class="flex sm12 xl12 md12 xs12" style="text-align: end;">
<!-- <va-button class="" color="success" v-if="selected.length" @click="downloadSelected" target="_blank" small>
<va-button class="" color="success" v-if="selected.length" @click="downloadSelected" target="_blank" small>
DOWNLOAD
</va-button> -->
</va-button>
<va-button class="" color="danger" v-if="selected.length" @click="deleteMultiFilesConfirm" target="_blank" small>
DELETE
</va-button>
@@ -178,6 +179,9 @@
/>
{{ props.rowData.name }}
</template>
<template slot="parameter_set" slot-scope="props">
{{ getWorkingMode(props.rowData) }}
</template>
<template slot="created_at" slot-scope="props">
{{transDate(props.rowData.created_at)}}
</template>
@@ -234,6 +238,7 @@ import { file } from '../../../data/file/File'
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
import api from '../../../data/api/index'
import SdCardButton from '../sdcard/SdCardButton.vue'
import configTable from '@/data/config-table/index.js'
export default {
name: 'FileTable',
@@ -315,6 +320,13 @@ export default {
// titleClass: 'text-center',
// dataClass: 'text-center',
// },
{
name: '__slot:parameter_set',
title: 'Working Mode',
width: '10%',
titleClass: 'text-center',
dataClass: 'text-center',
},
{
name: '__slot:created_at',
title: 'create time',
@@ -416,7 +428,7 @@ export default {
// call getfolder api and update
const folders = await api.collection.getByParent('folder', info.id)
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -436,7 +448,7 @@ export default {
this.currentInfo = item
// call getfolder api and update
const folders = await api.collection.getByParent('folder', item.id)
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -457,7 +469,7 @@ export default {
if (initCollection.data.length === 1) {
this.currentInfo = initCollection.data[0]
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-parameter_set-created_at')
file.updateFileList(folders)
file.updateFileList(files)
this.fileLists = file.getFileList()
@@ -673,12 +685,12 @@ export default {
// this.$refs.datatable_ref.refresh()
// this.$refs.datatable_ref.currentPage = 1
},
// downloadSelected: function () {
// for (let i = 0; i < this.selected.length; i++) {
// const meta = this.selected[i]
// this.downloadCsv(meta)
// }
// },
downloadSelected: function () {
for (let i = 0; i < this.selected.length; i++) {
const meta = this.selected[i]
this.downloadExcel(meta)
}
},
async deleteSelected () {
for (let i = 0; i < this.selected.length; i++) {
const meta = this.selected[i]
@@ -741,16 +753,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) {
@@ -760,6 +773,14 @@ export default {
})
}
},
getWorkingMode: function (rowData) {
try {
if (rowData.type === 'folder') return ''
return configTable.getModeConfig(rowData.device.library_name, rowData.parameter_set.MODE).name
} catch {
return ''
}
},
},
async mounted () {
const controllerList = await api.controller.getAll()
+53 -16
View File
@@ -4,17 +4,21 @@
<project-manager/>
</div>
<div
:class="(taskViewPanel.show || projectManagerPanel.show)
? (taskViewPanel.show && projectManagerPanel.show)
? cardStyle.small
: cardStyle.medium
:class="(projectManagerPanel.show)
? 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">
<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' : ''"
resizable
>
<project-task/>
</div>
</slide-out>
</div>
</template>
@@ -22,7 +26,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'
@@ -35,6 +39,9 @@ export default {
ProjectTask,
},
computed: {
...mapGetters('project', [
types.project.getSelect,
]),
...mapFields('project', [
'projectConfigList',
'runningProjectList',
@@ -74,7 +81,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) {
@@ -125,16 +132,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({
@@ -153,24 +172,42 @@ export default {
},
)
},
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,
],
),
},
async mounted () {
await this.initPage()
console.log('controllerID', taskInfo.getTaskInfo().controllerID)
// console.log('controllerID', taskInfo.getTaskInfo().controllerID)
/** get connect device list */
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'get_device_info_all/0',
}))
const project = await this.API.project.getAll()
// console.log('project: ', project)
this.projectConfigList.length = 0
this.projectConfigList.push(...project.data)
// console.log('projectConfigList: ', this.projectConfigList)
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'get_running_project/0',
@@ -1,9 +1,33 @@
<template>
<div>
<va-card style="height: 90vh; overflow: auto; display: block;">
<va-card style="height: 88vh; overflow: auto; display: block;">
<template slot="header">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 class="mt-0 mb-0">PROJECTS</h5>
<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>
</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> -->
</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>
@@ -44,6 +68,7 @@ export default {
'projectList',
'projectConfigList',
'runningProjectList',
'projectManagerPanel',
]),
},
data () {
@@ -63,9 +88,16 @@ export default {
types.project.create,
],
),
closePanel: function () {
this.projectManagerPanel.show = !this.projectManagerPanel.show
},
},
mounted () {
this.projectList = this.projectConfigList
},
}
</script>
<style>
</style>
@@ -19,6 +19,7 @@
</va-item-label> -->
</va-item-section>
<va-item-section side>
<va-icon class="fa fa-copy mr-2" color="bloack" @click.native.stop="copyProject({ project: project, index: index, api: API })"></va-icon>
<va-icon class="fa fa-close" color="danger" @click.native.stop="deleteProject({ project: project, index: index, api: API })"></va-icon>
</va-item-section>
</va-item>
@@ -55,6 +56,7 @@ export default {
},
...mapActions('project',
[
types.project.copy,
types.project.select,
types.project.delete,
],
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div>
<va-card style="height: 90vh; overflow: auto;">
<va-card style="height: 88vh; overflow: auto;">
<project-task-config></project-task-config>
</va-card>
</div>
@@ -1,26 +1,16 @@
<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>
</div>
</div>
<div>
<!-- <div v-for="(action, actionKey) in this.getSelectTask.action" :key="actionKey">
{{ getDeviceProject(action.target).name }} {{ action.type }} {{ getConditionTask(action.condition[0]).value }}
</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>Device</span>
<div class="row flex sm12 xl12 md12 xs12" v-if="Object.keys(registeredDevice).length > 0">
<div class="flex sm12 xl6 md6 xs12" v-for="(device, key) in registeredDevice" :key="key">
<va-button @click="selectDevice(key)" small>{{ getDeviceShowNameProject(key) }}</va-button>
</div>
</div>
<div align="center" v-else>
No registered device found.
</div>
</div> -->
<div v-if="settingStep >= 1">
<span>Action</span>
<!-- <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>
@@ -28,12 +18,13 @@
</div>
</div>
<div v-if="settingStep >= 2">
<span>Condition</span>
<!-- <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 class="mr-1" :type="condition.type" v-model="condition.value"/>
<input style="width: 100px;" class="mr-1" :type="condition.type" v-model="condition.value"/>
<span>{{ condition.suffix }}</span>
</div>
</div>
@@ -72,15 +63,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: '',
@@ -91,10 +85,17 @@ export default {
conditionTemplate: newConditionTemplate(),
conditionList: [],
taskOptions: {},
taskOptionsKeys: [],
project: {},
device: {},
task: {},
}
},
methods: {
closePanel: function () {
this.taskViewPanel.show = !(this.taskViewPanel.show)
},
selectDevice: function (deviceKey) {
this.settingStep = 1
this.deviceSelect = deviceKey
@@ -136,6 +137,18 @@ export default {
for (const key in this.conditionObj) {
if (this.conditionObj[key].select) {
// create fake condition if duplicate type & target
if (Object.values(this.getSelectTask.condition).findIndex(ele => ele.type === 'previous_task_done' && ele.target === this.deviceSelect) === -1) {
// create fake start previous done
const fakeStartActionUUID = this.GLOBAL.getUUID()
const fakeAction = this.createAction(fakeStartActionUUID, 'start', this.deviceSelect)
const fakeConditionUUID = this.GLOBAL.getUUID()
const fakeCondition = this.createCondition(fakeConditionUUID, 'previous_task_done', 'equal', '')
this.setConditionTask({ condition: fakeCondition })
fakeAction[fakeStartActionUUID].condition.push(fakeConditionUUID)
this.setActionTask({ action: fakeAction })
}
const conditionUUID = this.GLOBAL.getUUID()
const newCondition = this.createCondition(conditionUUID, key, 'equal', this.conditionObj[key].value)
@@ -146,21 +159,37 @@ export default {
this.setActionTask({ action: newAction })
this.reset()
},
updateTaskOptions: function () {
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)
},
...mapActions('project', [
types.task.setCondition,
types.task.setAction,
types.task.setCycle,
]),
},
mounted () {
const project = this.getSelectProject
const device = this.getAllDeviceProject
const task = this.getSelectTask
console.log('project', project)
console.log('task', task)
this.registeredDevice = device
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)
this.registeredDevice = this.device
},
watch: {
// refresh parameter when click different task's parameter
deviceSelectKey: {
handler: function () {
this.deviceSelect = this.deviceSelectKey
},
},
},
}
</script>
@@ -1,48 +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>
</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 {
@@ -50,13 +56,23 @@ export default {
components: {
},
computed: {
deviceListInOrder () {
return Object.entries(this.getSelectProject.device).sort((a, b) => a[1].order - b[1].order)
},
taskDevice () {
return this.getSelectTask.device
},
...mapGetters('project', [
types.project.getSelect,
types.task.getSelect,
types.project.getDeviceShowName,
types.project.getNotRegisterDevice,
]),
...mapFields('project', [
'taskSelectKey',
'taskViewPanel',
]),
},
data () {
@@ -64,34 +80,55 @@ export default {
}
},
methods: {
selectDevice: function (event, device, key) {
// if select single task
if (this.taskSelectKey !== undefined) {
device.isSelect = event
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)
},
removeFromTask: function (key) {
// if select single task
this.getSelectTask.device = this.getSelectTask.device.filter(item => item !== key)
},
closePanel: function () {
this.taskViewPanel.show = !(this.taskViewPanel.show)
},
...mapActions('project',
[
types.project.createDevice,
],
),
},
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,45 +1,146 @@
<template>
<div class="flex sm12 xl12 md12 xs12">
<div class="task-config__header-separator mb-1">
<!-- <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> -->
<div>
<elite-parameter-window></elite-parameter-window>
<device-parameter-recording
:ref="'device_parameter_ref'"
:parameter="parameter"
:library="device.library"
:place="'scheduler'"
@setParameter="setParameter"
@setParameterWithDebounce="setParameterWithDebounce"
/>
</div>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import newCondition from '@/factories/project/conditionFactory'
import EliteParameterWindow from '@/components/project/task/config/parameter/EliteParameterWindow'
import { mapActions, mapGetters } from 'vuex'
import { mapFields } from 'vuex-map-fields'
import types from '@/store/modules/project/types'
import DeviceParameterRecording from '@/components/task/content/parameter/DeviceParameterRecording.vue'
import _ from 'lodash'
import configTable from '@/data/config-table/index'
export default {
name: 'project-task-config-parameter',
components: {
EliteParameterWindow,
DeviceParameterRecording,
},
computed: {
...mapGetters('project', [
types.task.getSelect,
types.task.getParameterSet,
types.project.getDevice,
types.project.getSelect,
]),
...mapFields('project', [
'taskSelect',
'taskViewPanel',
'taskSelectKey',
'deviceSelectKey',
]),
},
data () {
return {
parameter: {},
conditionList: newCondition(),
deviceSelected: null,
parameterUUID: '',
device: null,
config: null,
}
},
methods: {
closePanel: function () {
this.taskViewPanel.show = !(this.taskViewPanel.show)
},
selectDevice: function (device) {
this.deviceSelected = device
},
selectCondition: function (condition) {
condition.select = !condition.select
},
setParameter: function (name, value) {
this.parameter = Object.assign({}, this.parameter)
if (this.parameterUUID === '') {
this.parameterUUID = this.GLOBAL.getUUID()
}
this.setParameterSetTask({
parameterSet: {
[name]: value,
target: this.deviceSelectKey,
},
parameterKey: this.parameterUUID,
})
},
setParameterWithDebounce: _.debounce(function (name, value) {
this.setParameter(name, value)
}, 100),
resetParameter: function (mode) {
// get Device
this.device = this.getDeviceProject(this.deviceSelectKey)
// get Config
if (typeof this.device.library === 'string') { // string
this.config = configTable.getConfig(this.device.library)
} else { // object
this.config = configTable.getConfig(this.device.library.value)
}
// create default parameter
const defaultValue = {}
for (const key in this.config) {
if (this.config[key].defaultValue !== undefined) {
defaultValue[key] = this.config[key].defaultValue
}
}
const parameterSet = this.getParameterSetTask(this.taskSelectKey, this.deviceSelectKey)
this.parameter = { ...defaultValue }
if (parameterSet) {
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.parameter = Object.assign(this.parameter, Object.values(parameterSet)[0])
} else {
this.setParameter('MODE', 0)
}
},
...mapActions('project',
[
types.task.setParameterSet,
],
),
},
mounted () {
// init parameter
this.resetParameter()
},
watch: {
// refresh parameter when click different task's parameter
taskSelectKey: {
handler: function () {
this.parameter = {}
this.parameterUUID = ''
this.resetParameter()
},
},
deviceSelectKey: {
handler: function () {
this.parameter = {}
this.parameterUUID = ''
this.resetParameter()
},
},
},
}
</script>
@@ -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)
}
@@ -505,7 +505,7 @@ export default {
// },
// {
// id: 11,
// description: 'Cali ADC - test',
// description: 'Cali Mode - test',
// },
// {
// id: 12,
@@ -576,6 +576,10 @@ export default {
value: 1,
label: 'Vin',
},
{
value: 2,
label: 'Vout',
},
],
startVoltNumber: null,
stopVoltNumber: null,
@@ -1,6 +1,6 @@
<template>
<div>
<elite-parameter-recording-elitezm15 :ref="'rec_ref_2'" :deviceID="deviceID" @parameterChange="parameterChange"/>
<elite-parameter-recording-elitezm15 :ref="'rec_ref_2'" :deviceID="deviceID" @parameterChange="parameterChange" :place="'scheduler'"/>
<!-- <elite-parameter-recording v-if="eliteVer=='1'" :ref="'rec_ref_1'" :deviceID="deviceID"/>
<elite-parameter-recording-elitezm15 v-else-if="eliteVer=='2'" :ref="'rec_ref_2'" :deviceID="deviceID"/>
<elite-parameter-recording-elite-e-i-s v-else-if="eliteVer=='4'" :ref="'rec_ref_4'" :deviceID="deviceID"/>
+22 -3
View File
@@ -1,6 +1,7 @@
<template>
<div>
<va-card style="height: 90vh; overflow: auto; display: block;">
<!-- <pre>{{ getSelectProject }} </pre> -->
<va-card style="height: 88vh; overflow: auto; display: block;">
<template slot="header">
<va-icon name="fa fa-bluetooth-b mr-3" color="primary"/>
<h5 class="mt-0 mb-0"> {{ getSelectProject ? getSelectProject.name : '' }}</h5>
@@ -9,7 +10,7 @@
<span>please select project</span>
</div>
<div v-else>
<project-menu/>
<project-menu @detect="detect"/>
<project-table/>
<div align="right" v-if="lockMode === false">
<va-button @click="save">Save</va-button>
@@ -26,7 +27,7 @@
import ProjectMenu from '@/components/project/view/menu/ProjectMenu'
import ProjectTable from '@/components/project/view/table/ProjectTable'
import { mapFields } from 'vuex-map-fields'
import { mapGetters } from 'vuex'
import { mapGetters, mapActions } from 'vuex'
import types from '@/store/modules/project/types'
export default {
@@ -42,7 +43,9 @@ export default {
...mapFields('project', [
'lockMode',
'projectList',
'deviceConnectList',
'projectSelectIndex',
'projectLibrary',
]),
},
data () {
@@ -59,6 +62,22 @@ export default {
save: function () {
this.$emit('save_project', this.getSelectProject)
},
detect: function (device) {
this.$emit('detect', device)
},
...mapActions('project',
[
types.project.update,
types.project.addDevice,
],
),
},
watch: {
},
async mounted () {
// console.log('mounted')
// console.log(this.deviceConnectList)
// console.log(this.deviceConnectList.length)
},
}
</script>
@@ -4,54 +4,62 @@
<div class="flex d-flex">
<switch-project/>
<add-task/>
<add-device @showDeviceModal="showDeviceModal"/>
<!-- <clear-task/>
<save-project/>
<import-project/>
<export-project/>
<delete-project/> -->
<!-- <add-device @showDeviceModal="showDeviceModal"/> -->
<va-button @click="showCycleModal" small>+ Cycle</va-button>
</div>
</div>
<project-device @showDeviceModal="showDeviceModal($event)"></project-device>
<device-modal ref="device_modal_ref"></device-modal>
<project-device @showDeviceModal="showDeviceModal"></project-device>
<new-device-modal ref="device_modal_ref" @detect="detect"></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 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 { mapActions } 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,
},
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()
},
...mapActions('project',
[
types.task.createCycle,
],
),
},
}
</script>
@@ -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,6 @@
<template>
<div>
<va-button @click="createTask" small>ADD TASK</va-button>
<va-button @click="createTask" small>+ TASK</va-button>
</div>
</template>
<script>
@@ -0,0 +1,258 @@
<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 () {
this.showModal = false
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 })
}
}
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.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>
@@ -84,6 +84,7 @@ export default {
...mapFields('project', [
'deviceConnectList',
'projectLibrary',
]),
},
data () {
@@ -157,6 +158,9 @@ export default {
} else {
await this.setDeviceProject({ device: this.device, index: deviceIndex })
}
if (this.device.library !== undefined) {
this.projectLibrary = this.device.library.value
}
this.hide()
this.resetSetting()
@@ -173,6 +177,7 @@ export default {
this.optionDeviceConnect = this.deviceConnectList
if (device) {
this.device = device
this.projectLibrary = this.device.library.value
}
},
@@ -0,0 +1,153 @@
<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.hide()
},
removeDevice: function () {
this.deleteDeviceProject({ deviceKey: this.key })
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,50 +1,177 @@
<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" v-if="showLibrary === true">
<va-button small @click="clickShowDevice('EDC')">EDC</va-button>
<va-button small @click="clickShowDevice('EIS')">EIS</va-button>
<va-button small @click="cancelSelectDevice()">X</va-button>
</div>
<div class="flex d-flex" v-if="showDevice === false && showLibrary === false">
<draggable class="flex row" :list="deviceListInOrder" :move="handleMove" @end="handleDragEnd">
<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>
</draggable>
<div>
<button class="add-button" icon="fa fa-plus" @click="clickShowLibrary"><span class="add-button-text">+</span></button>
</div>
</div>
</div>
</template>
<script>
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,
})
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,
})
return false
},
cancelSelectDevice: function () {
this.showLibrary = false
},
showDeviceModal: function (key, device) {
this.$emit('showDeviceModal', key, device)
},
deleteDevice: function (deviceIndex) {
this.deleteDeviceProject({ index: deviceIndex })
},
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]
}
},
...mapActions('project',
[
types.project.createDevice,
types.project.deleteDevice,
types.project.checkNotRegisterDevice,
types.project.checkPairDeviceExist,
],
),
},
mounted () {
},
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: #858dd6;
border: 1px #ffffff dashed;
border-radius: 20px;
}
.pair-button-text {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 18px;
line-height: 24px;
text-align: center;
color: #ffffff;
}
</style>
@@ -1,6 +1,6 @@
<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">
<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;">
<div class="table-wrapper" style="width: 100%;">
<table class="va-table">
<thead>
<tr>
@@ -16,13 +16,62 @@
<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>
</tr>
</thead>
<tbody>
<template v-for="(task, taskIndex) in getSelectProject.task">
<tr v-if="task.device.length === 0" :key="taskIndex" height="80px">
<!-- <tbody> -->
<vuedraggable :disabled="lockMode === true" class="draggable" :list="getSelectProject.task" @end="rearrangeTask({ project: getSelectProject })" tag="tbody" animation="500">
<template class="item" v-for="(task, taskIndex) in getSelectProject.task">
<tr v-if="task.type === 'cycle'" :key="'empty' + taskIndex" height="80px" @click="showCycleModal(task.uuid)">
<td v-if="lockMode === false">
<va-checkbox
v-model="tableColumn.checked"
:array-value="String(taskIndex)"
/>
</td>
<td align="center">
{{ taskIndex + 1 }}
</td>
<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" v-if="getCycleLocation(task.uuid) === 'start'">
{{ getCycleInfo(task.uuid, 'max') }} Rounds
</td>
<td v-if="lockMode === true && getCycleLocation(task.uuid) === 'start'">
{{ getCycleInfo(task.uuid, 'count') }} / {{ getCycleInfo(task.uuid, 'max') }}
</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 align="center" v-if="lockMode === true">
<!-- {{ task.status }} -->
<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 v-else-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"
@@ -36,19 +85,19 @@
{{ task.name }}
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(1, taskIndex)" small>Device</va-button>
<va-button :flat="true" @click="openConfig(1, taskIndex)" small>+ Device</va-button>
</td>
<td align="center">
<va-button :flat="true" @click="openConfig(3, taskIndex)" small>Add event</va-button>
<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)" small>ParameterSet</va-button>
<va-button :flat="true" @click="openConfig(4, taskIndex)" :disabled="true" small>-</va-button>
</td>
<td align="center">
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
<va-icon class="fa fa-close" @click.native="() => deleteTask({ project: getSelectProject, index: taskIndex})"></va-icon>
</td>
</tr>
<tr v-for="(deviceUUID) in task.device" :key="taskIndex + deviceUUID" height="80px">
<tr :class="taskIndex === focus ? 'table-row-focus' : ''" v-else v-for="(deviceUUID) in task.device" :key="String(taskIndex) + ' ' + String(deviceUUID)" height="80px" @click="() => { focus = taskIndex }">
<td v-if="lockMode === false">
<va-checkbox
v-model="tableColumn.checked"
@@ -71,36 +120,85 @@
{{ task.name }}
</div>
</td>
<td align="center" @click="openConfig(1, taskIndex, deviceUUID)">
<div >
<span>{{ getDeviceProject(deviceUUID) && getDeviceProject(deviceUUID).name }}</span>
<!-- device -->
<td align="center">
<div v-if="task.device && task.device.length === 0">
<va-button :flat="true" @click="openConfig(1, taskIndex, deviceUUID)" small>
+ Device
</va-button>
</div>
<div v-else>
<va-button :flat="true" @click="openConfig(1, taskIndex, deviceUUID)" small>
<span>{{ getDeviceShowNameProject(deviceUUID)}}</span>
</va-button>
</div>
</td>
<td align="center" @click="openConfig(3, taskIndex, deviceUUID)">
<div class="flex">
<!-- device end -->
<!-- action -->
<td align="center">
<div v-if="Object.keys(task.action).length === 0">
<va-button :flat="true" @click="openConfig(3, taskIndex, deviceUUID)" small>
+ Event
</va-button>
</div>
<div v-else class="flex">
<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">
{{ action.type }} {{ task.condition[conditionKey].type }} {{ task.condition[conditionKey].value }}
<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>
</div>
</div>
</div>
<va-button :flat="true" @click="openConfig(3, taskIndex, deviceUUID)" small>
+ Event
</va-button>
</div>
</td>
<td align="center" @click="openConfig(4, taskIndex, deviceUUID)">
<div class="flex d-flex">
<div class="flex">
<!-- action end -->
<td align="center">
<div v-if="Object.keys(task.parameter_set).length === 0">
<va-button :flat="true" @click="openConfig(4, taskIndex, deviceUUID)" small>
+ 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'">{{ parameterTable[parameterKey].alias }}: {{ parameterTable[parameterKey].transFormula(parameter) }} {{ parameterTable[parameterKey].unit[0] }}</span>
<span v-if="parameterKey !== 'target'">
<div small>
{{ parameterName(parameterKey, deviceUUID) }} : {{ parameterValue(parameterKey, parameter, deviceUUID) }}
</div>
</span>
</div>
</div>
</div>
</div>
</va-button>
</td>
<td align="center" v-if="lockMode === false">
<va-icon class="fa fa-close" @click.native="() => deleteTask({ index: taskIndex})"></va-icon>
<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-copy ml-1" @click.native="() => copyTask({ project: getSelectProject, index: taskIndex})"></va-icon>
<va-icon class="fa fa-close ml-1" @click.native="() => deleteTask({ project: getSelectProject, index: taskIndex})"></va-icon>
</td>
<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">
<va-button icon="fa fa-play" @click="trigger_button(getSelectProject)" flat></va-button>
<td/>
<td align="center" v-if="lockMode === true">
<!-- {{ task.status }} -->
<fulfilling-bouncing-circle-spinner
@@ -113,27 +211,43 @@
</td>
</tr>
</template>
</tbody>
</vuedraggable>
<!-- </tbody> -->
</table>
</div>
<div>
<cycle-modal ref="cycle_modal_ref"></cycle-modal>
</div>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { mapActions, mapGetters } from 'vuex'
import types from '@/store/modules/project/types'
import newEliteZm15Parameter from '@/factories/project/eliteZM15ParmameterFactory'
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 () {
return configTable.getConfig(this.projectLibrary)
},
...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,
@@ -144,6 +258,7 @@ export default {
'taskSelectKey',
'deviceSelectKey',
'lockMode',
'projectLibrary',
]),
},
data () {
@@ -152,15 +267,78 @@ export default {
name: -1,
checked: [],
},
parameterTable: newEliteZm15Parameter(),
inputSaved: '',
focus: -1,
index: -1,
futureIndex: -1,
}
},
methods: {
mqttPub: function (topic, mes) {
this.$mqtt.publish(topic, mes)
},
dragEnd: function (event) {
const newTaskList = JSON.parse(JSON.stringify(this.getSelectProject.task))
const b = newTaskList[event.oldDraggableIndex]
const a = newTaskList[event.newDraggableIndex]
if (b && b.device.length === 0) return
if (a === undefined) return
newTaskList.filter(ele => ele != null)
this.rearrangeTask({ project: this.getSelectProject })
},
swapTask: function (taskIndex, upDown) {
taskIndex = parseInt(taskIndex)
if (upDown === 0) {
const a = this.getSelectProject.task[taskIndex]
this.getSelectProject.task.splice(taskIndex, 1, this.getSelectProject.task[taskIndex - 1])
this.getSelectProject.task.splice(taskIndex - 1, 1, a)
} else {
const a = this.getSelectProject.task[taskIndex]
this.getSelectProject.task.splice(taskIndex, 1, this.getSelectProject.task[taskIndex + 1])
this.getSelectProject.task.splice(taskIndex + 1, 1, a)
}
this.rearrangeTask({ project: this.getSelectProject })
},
delSelected: function () {
for (const indexSelected of this.tableColumn.checked) {
this.deleteTask({ project: this.getSelectProject, index: indexSelected })
}
},
delAction: function (task, actionKey, conditionKey) {
const _action = JSON.parse(JSON.stringify(task.action))
const _condition = JSON.parse(JSON.stringify(task.condition))
delete _action[actionKey]
delete _condition[conditionKey]
task.action = _action
task.condition = _condition
},
trigger_button: function (projectID) {
console.log('project', projectID)
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'set_project/0',
project: projectID.uuid,
content: 'test',
}))
},
switchInput: function (tag, index) {
this.tableColumn[tag] >= 0
? this.tableColumn[tag] = -1
: this.tableColumn[tag] = index
},
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 },
}))
},
selectAll: function (selectedArray) {
const totalRange = [...Array(this.getSelectProject.task.length).keys()].map(idx => String(idx))
selectedArray.includes('-1')
@@ -173,7 +351,7 @@ export default {
openConfig (type, taskIndex, deviceKey) {
console.log(type, taskIndex, deviceKey, this.taskViewPanel.type, this.taskSelectKey, this.deviceSelectKey)
if (!this.lockMode) {
if (this.taskViewPanel.type === type && this.taskSelectKey === taskIndex && this.deviceSelectKey === deviceKey) {
if (this.taskViewPanel.type === type && this.taskSelectKey === taskIndex && this.deviceSelectKey === deviceKey && this.taskViewPanel.show === true) {
this.taskSelectKey = ''
this.taskViewPanel.type = -1
this.taskViewPanel.show = false
@@ -186,8 +364,62 @@ export default {
}
}
},
parameterName (name, deviceKey) {
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
if (config !== undefined && Object.keys(config) !== 0) {
if (name === 'MODE') {
return 'Mode'
}
if (typeof config[name].showName === 'function') {
return config[name].showName()
}
return config[name].showName
}
},
parameterValue (name, value, deviceKey) {
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
if (config !== undefined && Object.keys(config) !== 0) {
if (name === 'MODE') {
return config.MODE[value].name
}
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]
},
handleMove (e) {
const { index, futureIndex } = e.draggedContext
this.index = index
this.futureIndex = futureIndex
return false // disable sort
},
...mapActions('project', [
types.task.copy,
types.task.delete,
types.task.rearrange,
]),
},
mounted () {
@@ -196,6 +428,18 @@ export default {
</script>
<style lang="scss">
.draggable {
width: 500px;
margin: auto;
}
.table-row-focus {
background: #ebedff;
border: 1px solid #dbdcf0;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
.markup-tables {
width: 100%;
+107 -24
View File
@@ -1,6 +1,5 @@
<template>
<div class="task-content">
<va-modal
v-model="showShutdownModal"
size="small"
@@ -29,7 +28,7 @@
<div class="flex sm12 xl12 md12 xs12">
<task-devices-new :ref="'devices_ref'" @add="addDevice($event)" @remove="removeDevice($event)" @refreshSetting="refreshChartSetting($event)" class="pa-0" />
</div>
<div class="flex sm12 xl12 md12 xs12" v-if="developer_mode">
<div class="flex sm12 xl12 md12 xs12" v-if="developerMode">
<task-formula :ref="'formula_ref'" @add="addFormula($event)" @remove="removeFormula($event)" class="pa-0" />
</div>
</div>
@@ -108,6 +107,7 @@ import { mapFields } from 'vuex-map-fields'
import { mapActions } from 'vuex'
import taskTypes from '@/store/modules/task/content/types'
import TaskFormula from './formula/TaskFormula'
import { v4 as uuid } from 'uuid'
// TODO change chart data tag format
@@ -128,7 +128,7 @@ export default {
'deviceListNew',
]),
...mapFields('', [
'developer_mode',
'developerMode',
]),
},
data () {
@@ -143,13 +143,29 @@ export default {
showDeviceSetting: true,
chartAreaClass: ['flex', 'xs12', 'sm12', 'md12', 'xl8', 'pa-0'],
getParmDone: false,
batteryInterval: {},
}
},
mqtt: {
async '+/device_battery/+' (data, topic) {
const deviceBattery = JSON.parse(String.fromCharCode.apply(null, data)).data
const device = this.deviceListNew.find(ele => ele.memory_board === deviceBattery.device)
device.battery = deviceBattery.battery
},
async '+/get_device_info_all/+' (data, topic) {
// console.log('get_device_info_all', String.fromCharCode.apply(null, data))
this.deviceListNew = JSON.parse(String.fromCharCode.apply(null, data)).data
// console.log(this.deviceListNew)
for (let i = 0; i < this.deviceListNew.length; i++) {
const curDevice = this.deviceListNew[i]
if ((curDevice.memory_board in this.batteryInterval) === false) {
this.batteryInterval[curDevice.memory_board] = setInterval(() => { this.getBattery(curDevice) }, 60000)
}
}
// console.log(this.batteryInterval)
// console.log(this.deviceListNew)
// await taskInfo.deviceInfo(String.fromCharCode.apply(null, data), this.deviceList)
// console.log('this.deviceList 0', this.deviceList)
@@ -158,7 +174,7 @@ export default {
if (this.$refs.devices_ref != null) {
await this.$refs.devices_ref.loadingDone()
}
await this.taskContentChartInitCustomizedFromCache()
await this.taskContentChartInitCustomizedFromCache({ controllerID: taskInfo.getTaskInfo().controllerID })
this.getParmDone = true
},
async '+/get_device_info/+' (data, topic) {
@@ -199,7 +215,7 @@ export default {
await taskInfo.deviceInfo(String.fromCharCode.apply(null, data), this.deviceList)
if (this.$refs.devices_ref != null) {
await this.$refs.devices_ref.loadingDone()
await this.taskContentChartInitCustomizedFromCache()
await this.taskContentChartInitCustomizedFromCache({ controllerID: taskInfo.getTaskInfo().controllerID })
}
},
// listen datastream [ topic: controllerID/data_server/device_data_stream/deviceID/channel ]
@@ -207,7 +223,6 @@ export default {
const topicSplit = topic.split('/')
const deviceID = parseInt(topicSplit[3])
const channel = parseInt(topicSplit[4])
dataStreamBuffer.into(String.fromCharCode.apply(null, data), deviceID, (channel + 1))
},
'+/device_save_path/+' (data, topic) {
@@ -261,12 +276,22 @@ export default {
this.showShutdownModal = true
break
case 'start':
// register default chart again
await this.taskContentChartDefaultChartGenerator({
_deviceList: this.deviceListNew,
_itemID: parseInt(mes[1]),
_chartID: null,
_type: 'device',
})
// remove mapping ID chart series data
for (const chart in this.chartData) {
this.taskContentChartResetSeriesData({
chartID: chart,
mappingID: mes[1],
})
}
device = this.deviceListNew.find((ele) => ele.memory_board === parseInt(mes[1]))
device.status = 1
break
@@ -289,12 +314,25 @@ export default {
}))
this.pageToast('The device [' + taskInfo.getDeviceIDByRaw(parseInt(mes[1])) + '] mission is done.')
break
case 'project':
// refresh real-time page when going to next task
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'get_device_info_all/0',
}))
this.pageToast(mes[1])
break
default:
break
}
},
},
methods: {
getBattery: function (device) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_battery/0',
device: device.memory_board,
}))
},
mqttSub: function (val) {
this.$mqtt.subscribe(val)
},
@@ -312,6 +350,7 @@ export default {
this.mqttSub(id + '/device_parameter/+')
this.mqttSub(id + '/device_parameter_value/+')
this.mqttSub(id + '/device_sd_card_status/+')
this.mqttSub('+/device_battery/+')
},
pageMqttUnSub: function (id) {
for (const device in taskInfo.getTaskInfo().deviceList) {
@@ -324,6 +363,7 @@ export default {
this.mqttUnSub(id + '/device_parameter/+')
this.mqttUnSub(id + '/device_parameter_value/+')
this.mqttUnSub(id + '/device_sd_card_status/+')
this.mqttUnSub('+/device_battery/+')
},
pageInit: async function () {
if (await this.$refs.devices_ref != null) {
@@ -347,12 +387,20 @@ export default {
)
},
refreshData: function () {
// TODO don't need to refresh chart with stop status
for (const chart in this.chartData) {
this.taskContentChartRefreshData({
chartID: parseInt(chart),
deviceList: this.deviceListNew,
})
// find each chart mappingID with device memory_board
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.chartData[chart].mappingID))
// device not found continue
if (device === undefined) {
continue
}
// device is running refresh chart
if (this.chartData[chart].captured !== true) {
this.taskContentChartRefreshData({
chartID: chart,
deviceList: this.deviceListNew,
})
}
}
},
refreshDevicesWindow: function () {
@@ -362,25 +410,35 @@ export default {
}
},
addChart: async function (isDefault) {
this.taskContentChartAdd({
chartID: this.taskContentChartNumber,
maxDots: 4000,
// create chartID with uuid instead of length of chart list
const newChart = await this.taskContentChartAdd({
chartID: uuid(),
maxDots: 5000,
gridLength: 1,
})
// createby default
if (isDefault === true) {
newChart.createdBy = 'default'
}
// createby manaul
if (isDefault === false) {
newChart.createdBy = 'manual'
}
if (this.$refs.chart_ref != null) {
this.$refs.chart_ref.forEach(ref => {
ref.refreshMappingSelect()
})
}
this.taskContentChartRefreshPanel()
this.taskContentChartNumber++
// save chart config to web storage
if (!isDefault) {
await this.taskContentChartSaveToCache()
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
}
this.pageToast('The chart has been added.')
return this.taskContentChartNumber - 1
return newChart.chartID
},
refreshChartSetting: async function () {
if (this.$refs.chart_ref != null) {
@@ -402,7 +460,7 @@ export default {
this.selectChartID = chartID
this.showRemoveChartModal = true
},
removeChart: async function (chartID) {
removeChart: async function (chartID, saveCache = true) {
if (chartID == null) {
chartID = this.selectChartID
}
@@ -429,8 +487,9 @@ export default {
})
}
}
await this.taskContentChartSaveToCache()
if (saveCache === true) {
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
}
this.pageToast('The chart has been removed.')
},
showDeviceSettingClick: function () {
@@ -462,9 +521,11 @@ export default {
return chart
},
addDevice: async function (deviceID, memoryBoardID) {
// subscribe datastream when add device
this.mqttSub(`${taskInfo.getTaskInfo().controllerID}/data_server/device_data_stream/${deviceID}/+`)
// add mapping chart
await this.addMappingChart(deviceID)
// register default chart
await this.taskContentChartDefaultChartGenerator({
_deviceList: this.deviceListNew,
_itemID: deviceID,
@@ -560,6 +621,10 @@ export default {
path: '/',
})
},
switchMode: function () {
console.log('switch mode', this.developerMode)
this.developerMode = !this.developerMode
},
...mapActions('taskContent', [
taskTypes.chart.initCustomizedFromCache,
@@ -567,6 +632,7 @@ export default {
taskTypes.chart.add,
taskTypes.chart.defaultChartGenerator,
taskTypes.chart.reset,
taskTypes.chart.resetSeriesData,
taskTypes.chart.refreshData,
taskTypes.chart.refreshChart,
taskTypes.chart.refreshPanel,
@@ -577,22 +643,39 @@ export default {
async mounted () {
const devMode = this.$route.params.mode
if (devMode === 'dev') {
this.developer_mode = true
this.developerMode = true
}
await taskInfo.updateTaskInfo(this.$route.params.taskID)
this.GLOBAL.refreshCache()
this.pageMqttSub(taskInfo.getTaskInfo().controllerID)
await this.pageInit()
this.dataRefreshTimer = setInterval(this.refreshData, 100)
var switchModeHander = function (switchMode, e) {
if (e.shiftKey && e.metaKey && e.keyCode === 83) {
switchMode()
}
if (e.shiftKey && e.ctrlKey && e.keyCode === 83) {
switchMode()
}
}
// eslint-disable-next-line no-undef
window.addEventListener('keydown', switchModeHander.bind(_, this.switchMode))
},
destroyed () {
taskInfo.destroyed(this.deviceList)
for (const chart in this.chartData) {
this.removeChart(chart)
this.removeChart(chart, false)
}
clearInterval(this.dataRefreshTimer)
this.pageMqttUnSub(taskInfo.getTaskInfo().controllerID)
for (var interval in this.batteryInterval) {
clearInterval(this.batteryInterval[interval])
}
},
}
+170 -84
View File
@@ -3,10 +3,13 @@
<va-card>
<template slot="header">
<div class="row flex sm12 xl12 md12 xs12 align--center my-0 py-0">
<div class="flex sm5 xl5 md5 xs5 px-0 mx-0">
<h5 class="mt-0 mb-0"><va-icon name="fa fa-area-chart mr-3" color="primary"/>{{nameCard}}</h5>
<div class="flex sm1 xl1 md1 xs1 px-0 mx-0">
<h5 class="mt-0 mb-0" style="">{{ nameCard }}</h5>
</div>
<div class="flex sm7 xl7 md7 xs7 pa-0 ma-0" style="text-align: right;">
<div class="flex sm9 xl9 md9 xs9 px-0 " style="margin-left: -5px; color: #9aa4af;">
<p class="mt-0 mb-0">{{ chartInfo }}</p>
</div>
<div class="flex sm2 xl2 md2 xs2 pa-0 ma-0" style="text-align: right;">
<va-button class="pa-0 ma-0 circle-button" small color="dark" @click="remove()">
<va-icon
name="fa fa-times"
@@ -18,81 +21,103 @@
</template>
<va-tabs v-model="tabValue" class="mb-3" style="width: 100%; min-width: 100px;">
<va-tab>
{{'CHART'}}
{{ 'CHART' }}
</va-tab>
<va-tab>
{{'SOURCE'}}
{{ 'SOURCE' }}
</va-tab>
</va-tabs>
<div v-if="tabValue == 0" >
<div v-if="chartData[chartID].legend.data.length != 0">
<chart :key="taskContentChartKey" :ref="'chart_ref'" :style="'width: '+ cardwidth + '; height: ' + cardheight + ';'" :options="data" :auto-resize="true"></chart>
<div class="row flex xl12 lg12 sm12 xs12 ma-0 pa-0">
<!-- <div class="flex xl1 lg1 sm0 xs0 ma-0 pa-0"> -->
<div class="flex ma-0 pa-0">
</div>
<!-- <div class="flex xl7 lg7 sm7 xs7 ma-0 pa-0"> -->
<div class="flex ma-0 pa-0">
<canvas-chart-real-time-display
:chartID="chartID" ref="CanvasChartRealTimeDisplay"
/>
</div>
<!-- <div class="flex xl4 lg4 sm4 xs4 ma-0 pa-0"> -->
<div class="flex ma-0 pa-0">
<canvas-chart-real-time-calculation :chartID="chartID" @refreshData="refreshData" @switchModeButton="switchModeButton" @getClicked="getClicked" @captureChart="captureChart" ref="'cal_ref'" />
</div>
</div>
<div class="flex" v-if="developerMode">
<div v-for="(data, device) in dataStreamBuffer.getByChartID(chartID)" :key="device">
<div v-for="(i, channel) in data" :key="channel">
{{ device }} {{ channel }} {{ i.length }} first data: {{ (i[0] !== undefined) && i[0][0] }} last data: {{ (i[i.length-1] !== undefined) && i[i.length-1][i[i.length-1].length-1]}}
</div>
</div>
</div>
<!-- <div class="row flex align--left ma-0 pa-0">
<va-input
v-if="chartData[chartID].chartXMode === 'time'"
class="mx-1"
@keyup.enter="timeIntervalChange(timeIntervalInput)"
@blur="timeIntervalChange(timeIntervalInput)"
v-model="timeIntervalInput"
:label="'time-grid'"
>
<p slot="append" style="margin-right: 0;" small>
ms
</p>
</va-input>
<va-input
v-if="chartData[chartID].chartXMode === 'value'"
class="mx-1"
@keyup.enter="xIntervalChange(xIntervalInput)"
@blur="xIntervalChange(xIntervalInput)"
v-model="xIntervalInput"
:label="'x-grid'"
>
<p slot="append" style="margin-right: 0;" small>
{{chartData[chartID].chartXUnit}}
</p>
</va-input>
<va-input
class="mx-1"
@keyup.enter="yIntervalChange(yIntervalInput)"
@blur="yIntervalChange(yIntervalInput)"
v-model="yIntervalInput"
:label="'y-grid'"
>
<p slot="append" style="margin-right: 0;" small>
{{chartData[chartID].chartYUnit}}
</p>
</va-input>
<va-input
v-if="chartData[chartID].chartDevice === 'neulive'"
class="mx-1"
@keyup.enter="threeAxisIntervalChange(threeAxisIntervalInput)"
@blur="threeAxisIntervalChange(threeAxisIntervalInput)"
v-model="threeAxisIntervalInput"
:label="'3axis-grid'"
>
<p slot="append" style="margin-right: 0;" small>
g
</p>
</va-input>
</div> -->
<!-- chart -->
<chart :key="taskContentChartKey" :ref="'chart_ref'" :style="'width: '+ cardwidth + '; height: ' + cardheight + ';'" :option="data" @dataZoom="updateZoom" :auto-resize="true"></chart>
</div>
</div>
<div v-else-if="tabValue == 1" :style="'width: '+ cardwidth + '; height: ' + cardheight + ';'" >
<canvas-chart-source :chartID="chartID" />
</div>
<div v-else :style="'width: '+ cardwidth + '; height: ' + cardheight + ';'" >
<!-- <canvas-chart-setting :chartID="chartID"></canvas-chart-setting> -->
</div>
<div v-if="this.$refs.chart_ref != null">
<!-- <div v-if="this.$refs.chart_ref != null">
<va-button small class="mb-3" @click="selectAllSeries">
SELECT ALL
</va-button>
<va-button small class="mb-3" @click="inverseSelectAllSeries">
INVERSE SELECT
</va-button>
</div>
<div class="row flex align--left ma-0 pa-0">
<va-input
v-if="chartData[chartID].chartXMode === 'time'"
class="mx-1"
@keyup.enter="timeIntervalChange(timeIntervalInput)"
@blur="timeIntervalChange(timeIntervalInput)"
v-model="timeIntervalInput"
:label="'time-grid'"
>
<p slot="append" style="margin-right: 0;" small>
ms
</p>
</va-input>
<va-input
v-if="chartData[chartID].chartXMode === 'value'"
class="mx-1"
@keyup.enter="xIntervalChange(xIntervalInput)"
@blur="xIntervalChange(xIntervalInput)"
v-model="xIntervalInput"
:label="'x-grid'"
>
<p slot="append" style="margin-right: 0;" small>
{{chartData[chartID].chartXUnit}}
</p>
</va-input>
<va-input
class="mx-1"
@keyup.enter="yIntervalChange(yIntervalInput)"
@blur="yIntervalChange(yIntervalInput)"
v-model="yIntervalInput"
:label="'y-grid'"
>
<p slot="append" style="margin-right: 0;" small>
{{chartData[chartID].chartYUnit}}
</p>
</va-input>
<va-input
v-if="chartData[chartID].chartDevice === 'neulive'"
class="mx-1"
@keyup.enter="threeAxisIntervalChange(threeAxisIntervalInput)"
@blur="threeAxisIntervalChange(threeAxisIntervalInput)"
v-model="threeAxisIntervalInput"
:label="'3axis-grid'"
>
<p slot="append" style="margin-right: 0;" small>
g
</p>
</va-input>
</div>
<div class="row flex ma-0 pa-0" v-if="developer_mode === true">
</div> -->
<div class="row flex ma-0 pa-0" v-if="developerMode === true">
<canvas-chart-filter :chartID="chartID" :filterIndex="0" />
<canvas-chart-filter :chartID="chartID" :filterIndex="1" />
<canvas-chart-filter :chartID="chartID" :filterIndex="2" />
@@ -108,8 +133,12 @@ import CanvasChartFilterPopup from './CanvasChartFilterPopup.vue'
import CanvasChartSource from './CanvasChartSource'
import { taskInfo } from '../../../../data/task/TaskInfo'
import { mapFields } from 'vuex-map-fields'
import CanvasChartRealTimeDisplay from '@/components/task/content/chart/CanvasChartRealTimeDisplay'
import { mapActions } from 'vuex'
import taskTypes from '@/store/modules/task/content/types'
import CanvasChartRealTimeCalculation from './CanvasChartRealTimeCalculation.vue'
import { dataStreamBuffer } from '@/data/task/DataStreamBuffer'
import configTable from '@/data/config-table/index.js'
export default {
name: 'CanvasChart',
@@ -118,10 +147,12 @@ export default {
CanvasChartSource,
CanvasChartFilter,
CanvasChartFilterPopup,
CanvasChartRealTimeDisplay,
CanvasChartRealTimeCalculation,
},
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
cardclass: {
@@ -140,17 +171,27 @@ export default {
},
},
computed: {
chartInfo () {
if (this.data === undefined || this.data === null) return ''
if (this.data.mappingID === undefined || this.data.mappingID === '-1') return ''
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
const deviceMode = configTable.getModeConfig(device.library_name, device.configuration.MODE).name
return `${device.name}_[${device.memory_board}] | MAC_${device.mac_address.toUpperCase()} | ${this.data.createdBy} chart: ${deviceMode}`
},
...mapFields('', [
'developer_mode',
'developerMode',
]),
...mapFields('taskContent', [
'chartData',
'taskContentChartKey',
'deviceListNew',
'taskContentChartPanelKey',
]),
},
data () {
return {
data: null,
rawData: null,
tabValue: 0,
resizeTimer: null,
mappingSelect: '',
@@ -161,10 +202,39 @@ export default {
threeAxisIntervalInput: 'auto',
xIntervalInput: 'auto',
yIntervalInput: 'auto',
dataZoomStart: 0,
dataZoomEnd: 100,
captured: false,
calClicked: false,
dataStreamBuffer: dataStreamBuffer,
}
},
methods: {
timeIntervalChange: function (val) {
getClicked: function (clicked) {
this.calClicked = clicked
},
captureChart: function () {
// count same ID in chartData
const captureTimes = String(Object.keys(this.chartData).filter(ele => ele.includes(String(this.data.chartID))).length)
const newData = Object.assign({}, this.data)
this.chartData[String(this.data.chartID) + '-' + captureTimes] = newData
this.chartData[String(this.data.chartID) + '-' + captureTimes].captured = true
this.chartData[String(this.data.chartID) + '-' + captureTimes].cardName += ' - captured -' + captureTimes
this.chartData[String(this.data.chartID) + '-' + captureTimes].createdBy = 'capture'
this.chartData[String(this.data.chartID) + '-' + captureTimes].chartID = String(this.data.chartID) + '-' + captureTimes
this.taskContentChartPanelKey++
},
updateZoom: function (e) {
// console.log(e)
if (e.batch !== undefined && e.dataZoomId !== '\u0000series\u00002\u00000') {
this.dataZoomStart = e.batch[0].start
this.dataZoomEnd = e.batch[0].end
} else if (e.dataZoomId !== '\u0000series\u00002\u00000') {
this.dataZoomStart = e.start
this.dataZoomEnd = e.end
}
},
timeIntervalChange: async function (val) {
if (!isNaN(parseInt(val))) {
this.chartData[this.chartID].xAxis.forEach(x => {
if (x.type === 'time') {
@@ -175,10 +245,11 @@ export default {
this.timeIntervalInput = 'auto'
this.chartData[this.chartID].xAxis.forEach(x => {
if (x.type === 'time') {
x.interval = 500 * 1000
x.interval = null
}
})
}
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
},
xIntervalChange: async function (val) {
if (!isNaN(parseInt(val))) {
@@ -195,7 +266,7 @@ export default {
}
})
}
await this.taskContentChartSaveToCache()
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
},
yIntervalChange: async function (val) {
if (!isNaN(parseInt(val))) {
@@ -203,36 +274,34 @@ export default {
if (parseInt(y.channel) <= 255) {
if (this.chartData[this.chartID].chartYUnit === 'uV') {
y.interval = parseInt(val)
// console.log(y.interval)
} else {
y.interval = val * 1000
}
const maxList = []
const minList = []
y.seriesIndex.forEach(i => {
maxList.push(Math.max(...this.chartData[this.chartID].series[i].data.map(p => p[1])))
minList.push(Math.min(...this.chartData[this.chartID].series[i].data.map(p => p[1])))
})
const max = Math.max(maxList)
const min = Math.min(minList)
const center = (max + min) / 2
y.max = center + (max - min)
y.min = center - (max - min)
y.max = (parseInt(y.max / y.interval) + 1) * y.interval
y.min = (parseInt(y.min / y.interval) - 1) * y.interval
// TODO: follow this way to iterate the deviceID
// const maxList = []
// const minList = []
// y.seriesIndex.forEach(i => {
// maxList.push(Math.max(...this.chartData[this.chartID].series[i].data.map(p => p[1])))
// minList.push(Math.min(...this.chartData[this.chartID].series[i].data.map(p => p[1])))
// })
// const max = Math.max(maxList)
// const min = Math.min(minList)
// const center = (max + min) / 2
// y.max = center + (max - min)
// y.min = center - (max - min)
// y.max = (parseInt(y.max / y.interval) + 1) * y.interval
// y.min = (parseInt(y.min / y.interval) - 1) * y.interval
}
})
} else {
this.timeIntervalInput = 'auto'
this.yIntervalInput = 'auto'
this.chartData[this.chartID].yAxis.forEach(y => {
if (parseInt(y.channel) <= 255) {
y.interval = null
y.max = 'dataMax'
y.min = 'dataMin'
}
})
}
await this.taskContentChartSaveToCache()
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
},
threeAxisIntervalChange: function (val) {
if (!isNaN(parseInt(val))) {
@@ -275,9 +344,10 @@ export default {
},
refreshMappingSelect: async function () {
this.setMappingSelect(this.chartData[this.chartID].mappingID)
if (this.chartData[this.chartID].mappingID !== -1 && this.chartData[this.chartID].mappingID != null) {
if (this.chartData[this.chartID].mappingID !== '-1' && this.chartData[this.chartID].mappingID != null) {
taskInfo.getMappingList().forEach(item => {
if (item.id === this.chartData[this.chartID].mappingID) {
// console.log('item.name: ', item.name)
this.setChartName(item.name)
}
})
@@ -322,13 +392,29 @@ export default {
type: 'legendInverseSelect',
})
},
refreshData: function (chartData, rawData) {
this.data = chartData
this.rawData = rawData
// save the start & end of previous dataZoom setting to avoid reset dataZoom
this.data.dataZoom[0].start = this.dataZoomStart
this.data.dataZoom[0].end = this.dataZoomEnd
this.data.dataZoom[1].start = this.data.dataZoom[0].start
this.data.dataZoom[1].end = this.data.dataZoom[0].end
this.$refs.CanvasChartRealTimeDisplay.matchData(this.data)
},
switchModeButton: function (dataMode, gridIndex, channelIndex) {
// console.log('switchModeBtn')
this.$refs.CanvasChartRealTimeDisplay.matchFunctional(String(dataMode), gridIndex, channelIndex)
},
...mapActions('taskContent', [
taskTypes.chart.saveToCache,
]),
},
async mounted () {
this.data = this.chartData[this.chartID]
// this.data = this.chartData[this.chartID]
// this.data.xAxis[0].boundaryGap = [0, '5%']
// this.data.yAxis[0].boundaryGap = ['10%', '10%']
this.resizeTimer = setInterval(this.resize, 1000)
this.nameCard = this.chartData[this.chartID].cardName
await this.refreshMappingSelect()
@@ -17,7 +17,7 @@
/>
<va-input
v-if="[1, 2, 3].indexOf(selectFilter.id) >= 0"
:label="'FREQ'"
:label="'EIS_FREQ'"
class="mx-1 freq-input"
v-model="freq2"
>
@@ -65,7 +65,7 @@ export default {
name: 'canvas-chart-filter',
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
filterIndex: {
@@ -29,7 +29,7 @@ export default {
},
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
chartRef: {
@@ -17,7 +17,7 @@
/>
<va-input
v-if="[1, 2, 3].indexOf(selectFilter.id) >= 0"
:label="'FREQ'"
:label="'EIS_FREQ'"
class="mx-1 freq-input"
v-model="freq2"
>
@@ -66,7 +66,7 @@ export default {
name: 'canvas-chart-filter-individual-filter',
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
seriesIndex: {
@@ -0,0 +1,455 @@
<template>
<div>
<div class="xs12 sm12 lg12 xl12" style="text-align: end;">
<!-- <img v-if="!integralClicked && (mode_name==='Chronoamperometric' || mode_name==='I-T Graph' || mode_name==='I-V Curve')" src='@/assets/img/toolbox/integral.svg' @click="clickIntegral"> -->
<va-button :flat="true" class="pa-0 ma-0 mr-2" v-if="xlogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" @click="clickXLog" small>
<!-- To Raw Mode -->
<img src='@/assets/img/toolbox/LogX_clicked.svg'>
</va-button>
<va-button :flat="true" class="pa-0 ma-0 mr-2" :disabled="disableLog" v-if="!xlogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="#ffffff" @click="clickXLog" small>
<!-- To log Mode (x-axis) -->
<img src='@/assets/img/toolbox/LogX.svg'>
</va-button>
<va-button :flat="true" class="pa-0 ma-0 mr-2" v-if="ylogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" @click="clickYLog" small>
<!-- To Raw Mode -->
<img src='@/assets/img/toolbox/LogY_clicked.svg'>
</va-button>
<va-button :flat="true" :disabled="disableLog" class="pa-0 ma-0 mr-2" v-if="!ylogClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="#ffffff" @click="clickYLog" small>
<!-- To log Mode (y-axis) -->
<img src='@/assets/img/toolbox/LogY.svg'>
</va-button>
<va-button :flat="true" class="pa-0 ma-0 mr-2" v-if="integralClicked && (mode_name==='Chronoamperometric' || mode_name==='I-T Graph' || mode_name==='I-V Curve')" color="danger" @click="clickIntegral" small>
<!-- To Raw Mode -->
<img src='@/assets/img/toolbox/integral_clicked.svg'>
</va-button>
<va-button class="pa-0 ma-0 mr-2" :flat="true" :disabled="disableInt" v-if="!integralClicked && (mode_name==='Chronoamperometric' || mode_name==='I-T Graph' || mode_name==='I-V Curve')" color="#ffffff" @click="clickIntegral" small>
<!-- To Integral Mode -->
<img src='@/assets/img/toolbox/integral.svg'>
</va-button>
<va-button :flat="true" class="pa-0 ma-0 mr-2" v-if="diffClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="danger" @click="clickDiff" small>
<!-- To Raw Mode -->
<img src='@/assets/img/toolbox/dx_clicked.svg'>
</va-button>
<va-button :flat="true" :disabled="disableDiff" class="pa-0 ma-0 mr-2" v-if="!diffClicked && (mode_name==='Linear Sweep Voltammetry' || mode_name==='I-V Curve')" color="#ffffff" @click="clickDiff" small>
<!-- To Differential Mode -->
<img src='@/assets/img/toolbox/dx.svg'>
</va-button>
<va-button :flat="true" :disabled="calClicked" class="pa-0 ma-0" color="#ffffff" @click="captureChart" small>
<!-- CAPTURE -->
<img src='@/assets/img/toolbox/capture.svg'>
</va-button>
</div>
<div class="row xs12 sm12 lg6 xl6 pa-2" v-if="diffClicked">
<div>
<span>Window-size: </span>
<input class="mx-2" size="5" v-model="sgFilterArgument.windowSize" @blur="watchHandler"/>
</div>
<div>
<span>Polynomial: </span>
<input class="mx-2" size="5" v-model="sgFilterArgument.polynomial" @blur="watchHandler"/>
</div>
</div>
</div>
</template>
<script>
// import CanvasChartFilter from './CanvasChartFilter.vue'
// import CanvasChartFilterPopup from './CanvasChartFilterPopup.vue'
// import CanvasChartSource from './CanvasChartSource'
// import { taskInfo } from '../../../../data/task/TaskInfo'
import { mapFields } from 'vuex-map-fields'
import { mapActions } from 'vuex'
import taskTypes from '@/store/modules/task/content/types'
import configTable from '@/data/config-table/index'
// import newTooltip from '@/factories/chart/tooltipFactory'
import { getTimeFormatter } from '@/store/modules/task/content/actions/chartAct'
import sgFilter from '@/data/SGFilter'
export default {
name: 'CanvasChartRealTimeCalculation',
components: {
},
props: {
chartID: {
type: [Number, String],
required: true,
},
},
computed: {
...mapFields('', [
'developerMode',
]),
...mapFields('taskContent', [
'chartData',
'taskContentChartPanelKey',
'deviceListNew',
]),
},
data () {
return {
info: null,
rawData: null,
mode_name: '',
xName: '',
yName: '',
obj: null,
integralClicked: false,
xlogClicked: false,
ylogClicked: false,
diffClicked: false,
disableDiff: false,
disableLog: false,
disableInt: false,
calClicked: false,
sgFilterArgument: {
windowSize: 5,
polynomial: 3,
},
}
},
// watch rawData is use for detect whether the chartData is changed
watch: {
rawData: {
deep: true,
handler: function () {
// avoid getting null data
if (this.rawData.series.length > 0) {
this.watchHandler()
}
},
},
},
methods: {
captureChart: function () {
this.$emit('captureChart')
},
getClicked: function (clicked) {
this.calClicked = clicked
},
// Do arithmetic operations triggered by button(raw, integral, log)
watchHandler: function () {
// this.data need to be deep copy from rawData, since we don't want to modify the source(chartData[])
// this.data = Object.assign({}, this.rawData)
this.data = JSON.parse(JSON.stringify(this.rawData))
this.addSource()
var curXData = 0
var curYData = 0
// var prevXData = 0
var prevYData = 0
var deltaX = 0
var deltaTime = 0
var curTime = 0
var integralResult = 0
// var diffResult = 0
var index = 0
var timeIndex = this.getTimeIndex()
var _data = []
const dataLength = this.data.series[0].data.length
const seriesData = this.data.series[0].data
if (this.integralClicked) {
for (index = 0; index < dataLength; index++) {
// console.log('x: ', seriesData[index][0])
// console.log('y: ', seriesData[index][1])
if (index === 0) {
// TODO: need to change the series[deviceID]
// TODO: change the time index(dynamic changing)
curYData = parseFloat(seriesData[index][1])
// deltaX = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curXData = parseFloat(seriesData[index][0])
curTime = seriesData[index][timeIndex]
if (this.mode_name === 'I-T Graph') {
_data.push([curTime, 0])
} else {
_data.push([curXData, 0, 0])
}
} else {
prevYData = parseFloat(seriesData[index - 1][1])
curYData = parseFloat(seriesData[index][1])
curXData = parseFloat(seriesData[index][0])
deltaX = seriesData[index][0] - seriesData[index - 1][0]
deltaTime = seriesData[index][timeIndex] - seriesData[index - 1][timeIndex]
integralResult += parseFloat((Math.abs(curYData) + Math.abs(prevYData)) * Math.abs(deltaX) / 2)
curTime += deltaTime
if (this.mode_name === 'I-T Graph') {
_data.push([curTime, integralResult])
} else {
_data.push([curXData, integralResult, curTime])
}
}
}
} else if (this.xlogClicked || this.ylogClicked) {
if (this.xlogClicked && this.ylogClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
deltaX = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curXData !== 0 && curYData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), Math.log10(Math.abs(curYData)), curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += deltaX
if (curXData !== 0 && curYData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), Math.log10(Math.abs(curYData)), curTime])
}
}
}
} else if (this.xlogClicked && !(this.ylogClicked)) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
deltaX = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curXData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), curYData, curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += deltaX
if (curXData !== 0) {
_data.push([Math.log10(Math.abs(curXData)), curYData, curTime])
}
}
}
} else if (!(this.xlogClicked) && this.ylogClicked) {
for (index = 0; index < dataLength; index++) {
if (index === 0) {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
deltaX = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
curTime = seriesData[index][timeIndex]
if (curYData !== 0) {
_data.push([curXData, Math.log10(Math.abs(curYData)), curTime])
}
} else {
curXData = parseFloat(seriesData[index][0])
curYData = parseFloat(seriesData[index][1])
curTime += deltaX
if (curYData !== 0) {
_data.push([curXData, Math.log10(Math.abs(curYData)), curTime])
}
}
}
}
} else if (this.diffClicked) {
const dataX = []
const dataY = []
const time = []
const dsample = 1
const m = parseInt((this.sgFilterArgument.windowSize - 1) / 2)
for (index = 0; index < dataLength; index += dsample) {
dataX.push(seriesData[index][0])
dataY.push(seriesData[index][1] * 1e-9)
time.push(seriesData[index][2])
}
// console.log(time[time.length - 1], time[0])
// console.log(dataX.length, time[time.length - 1] - time[0], dataX.length * 1e6 / (time[time.length - 1] - time[0]))
// console.log('dataX', dataX)
// console.log('dataY', dataY)
// console.log('time', time)
const filteredData = sgFilter(dataY, this.sgFilterArgument.windowSize, this.sgFilterArgument.polynomial, this.getSampleRate())
for (index = 0; index < filteredData.length; index++) {
_data.push([dataX[index + m], filteredData[index], time[index + m]])
}
// for (index = 0; index < dataLength; index++) {
// if (index === 0) {
// // TODO: need to change the series[deviceID]
// // TODO: change the time index(dynamic changing)
// curXData = parseFloat(seriesData[index][0])
// curYData = parseFloat(seriesData[index][1])
// deltaX = seriesData[index + 1][timeIndex] - seriesData[index][timeIndex]
// curTime = seriesData[index][timeIndex]
// // _data.push([curTime, 0, curTime])
// } else {
// curXData = parseFloat(seriesData[index][0])
// curYData = parseFloat(seriesData[index][1])
// prevXData = parseFloat(seriesData[index - 1][0])
// prevYData = parseFloat(seriesData[index - 1][1])
// curTime += deltaX
// diffResult = parseFloat((curYData - prevYData) / (curXData - prevXData))
// _data.push([curXData, diffResult, curTime])
// }
// }
}
// console.log(this.data.dataZoom[1])
// decide feed in raw data / modified one
const dataRaw = this.data.series[0].data
if (this.integralClicked || this.xlogClicked || this.ylogClicked || this.diffClicked) {
this.data.series[0].data = _data
this.getClicked(true)
// console.log(this.data.series[0].data[this.data.series[0].data.length - 1])
} else {
this.getClicked(false)
}
this.data.xAxis[0].type = 'value'
if (this.xName !== 'TIME') {
// console.log('not time')
this.data.xAxis[0].max = (value) => {
if (value.max < 0) {
return value.max - 0.05 * value.max
}
return value.max + 0.05 * value.max
}
this.data.yAxis[0].max = (value) => {
if (value.max < 0) {
return value.max - 0.05 * value.max
}
return value.max + 0.05 * value.max
}
}
if (this.integralClicked) {
this.$emit('switchModeButton', 'integral', 0, 0)
} else if (this.diffClicked) {
this.$emit('switchModeButton', 'differential', 0, 0)
} else {
this.$emit('switchModeButton', 'default', 0, 0)
}
// TODO: modify the redundant code
if (this.xName === 'TIME') {
this.data.xAxis[0].axisLabel.formatter = function (val) {
return getTimeFormatter(val)
}
}
// this.data.yAxis[0].boundaryGap = [String(this.yBottomBoundary) + '%', '10%']
// console.log(this.data.yAxis[0].boundaryGap)
this.$emit('refreshData', this.data, dataRaw)
},
clickIntegral: function () {
this.integralClicked = !(this.integralClicked)
this.disableDiff = !(this.disableDiff)
this.disableLog = !(this.disableLog)
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0 || device.status === 1) {
this.watchHandler()
}
}
},
clickXLog: function () {
if (this.xlogClicked) {
this.xlogClicked = false
if (this.ylogClicked) {
this.disableDiff = true
this.disableInt = true
} else {
this.disableDiff = false
this.disableInt = false
}
} else {
this.xlogClicked = true
this.disableDiff = true
this.disableInt = true
}
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0 || device.status === 1) {
this.watchHandler()
}
}
},
clickYLog: function () {
if (this.ylogClicked) {
this.ylogClicked = false
if (this.xlogClicked) {
this.disableDiff = true
this.disableInt = true
} else {
this.disableDiff = false
this.disableInt = false
}
} else {
this.ylogClicked = true
this.disableDiff = true
this.disableInt = true
}
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0 || device.status === 1) {
this.watchHandler()
}
}
},
clickDiff: function () {
this.diffClicked = !(this.diffClicked)
this.disableLog = !(this.disableLog)
this.disableInt = !(this.disableInt)
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.data.mappingID))
if (device !== undefined) {
if (device.status === 0 || device.status === 1) {
this.watchHandler()
}
}
},
addSource () {
if (this.data.gridSource.length > 0) {
const xAxisName = this.data.gridSource[0][0].xAxis
const yAxisName = this.data.gridSource[0][0].yAxis
this.xName = (xAxisName.split(' ')).pop()
this.yName = (yAxisName.split(' ')).pop()
if ((this.xName === 'VOLTAGE' && this.yName === 'CURRENT') || (this.xName === 'CURRENT' && this.yName === 'VOLTAGE')) {
this.mode_name = 'I-V Curve' // integration
} else if (this.xName === 'TIME' && this.yName === 'CURRENT') {
this.mode_name = 'I-T Graph' // differential and log
}
}
},
// index 0 is for the mode which x-axis is represent time, 2 is for the other mode(s)
getTimeIndex: function () {
let xAxisName = this.rawData.gridSource[0][0].xAxis
xAxisName = (xAxisName.split(' ')).pop()
return (xAxisName === 'TIME') ? 0 : 2
},
// these function below are using for print out the data (debug)
getAlldata: function () {
return this.data.series[0].data[(this.data.series[0].data).length - 1]
},
getXdata: function () {
var value = this.data.series[0].data[(this.data.series[0].data).length - 1][0]
return this.xName + ': ' + value + ' ' + this.xUnit
},
getYdata: function () {
var value = this.data.series[0].data[(this.data.series[0].data).length - 1][1]
return this.yName + ': ' + value + ' ' + this.yUnit
},
getSampleRate: function () {
try {
const deviceMappingID = this.chartData[this.chartID].mappingID
const device = this.deviceListNew.find(ele => ele.memory_board === deviceMappingID)
const deviceConfig = configTable.getConfig(deviceMappingID)
const voltStep = deviceConfig.VOLT_STEP.outputReadabilityData(device.configuration.VOLT_STEP)
const sampleRate = deviceConfig.SAMPLE_RATE.outputReadabilityData(device.configuration.SAMPLE_RATE)
return (1 / (voltStep / 1000)) * sampleRate
} catch (e) {
console.log('getSampleRateERROR', e)
return 1
}
},
...mapActions('taskContent', [
taskTypes.chart.saveToCache,
]),
},
async mounted () {
this.rawData = this.chartData[this.chartID]
// const test = [3.0, 12.9, 22.6, 32.10000000000001, 41.4, 50.5, 59.400000000000006, 68.1, 76.6, 84.9, 93.0, 100.9, 108.60000000000001, 116.1, 123.39999999999999, 130.5, 137.4, 144.10000000000002, 150.6, 156.9, 163.0, 168.9, 174.60000000000002, 180.10000000000002, 185.4, 190.5, 195.39999999999998, 200.1, 204.59999999999997, 208.90000000000003, 213.0, 216.89999999999998, 220.59999999999997, 224.09999999999997, 227.40000000000003, 230.5, 233.39999999999998, 236.1, 238.6, 240.90000000000003, 243.0, 244.9, 246.6, 248.10000000000002, 249.40000000000003, 250.5, 251.40000000000003, 252.09999999999997, 252.6, 252.9, 253.0, 252.90000000000003, 252.59999999999997, 252.10000000000002, 251.39999999999998, 250.5, 249.39999999999992, 248.09999999999997, 246.60000000000002, 244.89999999999998, 243.0, 240.89999999999992, 238.59999999999997, 236.10000000000002, 233.39999999999992, 230.5, 227.39999999999992, 224.10000000000002, 220.60000000000002, 216.89999999999992, 213.0, 208.89999999999986, 204.5999999999999, 200.10000000000002, 195.39999999999998, 190.5, 185.39999999999998, 180.0999999999999, 174.60000000000002, 168.89999999999998, 163.0, 156.89999999999998, 150.5999999999999, 144.10000000000002, 137.39999999999998, 130.5, 123.40000000000009, 116.10000000000002, 108.60000000000002, 100.89999999999986, 93.0, 84.90000000000009, 76.60000000000002, 68.10000000000002, 59.399999999999864, 50.5, 41.399999999999864, 32.09999999999991, 22.59999999999991, 12.899999999999977]
// console.log('sgFilter', sgFilter(test, 5, 2, 10))
// console.log('x', this.rawData.xAxis.length)
// if (this.mode_name === 'I-V Curve') {
// this.rawData.xAxis[0].boundaryGap = [0, '5%']
// this.rawData.yAxis[0].boundaryGap = [0, '10%']
// } else {
// this.rawData.xAxis[0].boundaryGap = [0, '5%']
// this.rawData.yAxis[0].boundaryGap = ['10%', '10%']
// }
},
}
</script>
@@ -0,0 +1,340 @@
<template>
<div>
<!-- Whole Real-time Display Tool here -->
<div v-for="(plot, plotIndex) in realTime" :key="plotIndex">
<div v-for="(curve, curveIndex) in plot" :key="plotIndex + '-' + curveIndex" class="row ma-0 pa-0">
<!-- cycle -->
<div class="mt-1" style="width: 75px;" v-show="data !== null && data.cycle > 0">
<va-input
label="cycle no."
v-model="data.cycle"
disabled
/>
</div>
<!-- y-axis -->
<div class="d-flex flex-row mt-1 ml-1">
<!-- value (y-axis) -->
<div style="width: 75px;">
<va-input
label="y-axis"
v-model="curve.yValue"
disabled
/>
</div>
<!-- unit (y-axis) -->
<div style="width: 75px;">
<va-select
v-model="curve.yUnit"
:options="curve.yUnitOption"
@input="changeUnit('y', plotIndex, curveIndex)"
noClear
/>
</div>
</div>
<!-- x-axis -->
<div class="d-flex flex-row mt-1 ml-1">
<!-- value (x-axis) -->
<div style="width: 75px;">
<va-input
label="x-axis"
v-model="curve.xValue"
disabled
/>
</div>
<!-- unit (x-axis) -->
<div style="width: 75px;">
<va-select
v-model="curve.xUnit"
:options="curve.xUnitOption"
@input="changeUnit('x', plotIndex, curveIndex)"
noClear
/>
</div>
</div>
<!-- intervel -->
<div class="d-flex flex-row mt-1 ml-1">
<!-- interval (y-axis) -->
<div class="ml-1" style="width: 80px;">
<va-input
v-show="!curveIndex"
v-model="curve.yInterval"
label="y-grid"
@focus="$event.target.select()"
@keyup.enter="setInterval('y', plotIndex, curveIndex, curve.yInterval)"
@blur="setInterval('y', plotIndex, curveIndex, curve.yInterval)"
>
<p slot="append" style="margin-right: 0;" small>
{{ curve.yUnit }}
</p>
</va-input>
</div>
<!-- interval (x-axis) -->
<div class="ml-1" style="width: 80px;">
<va-input
v-show="!curveIndex"
v-model="curve.xInterval"
label="x-grid"
@focus="$event.target.select()"
@keyup.enter="setInterval('x', plotIndex, curveIndex, curve.xInterval)"
@blur="setInterval('x', plotIndex, curveIndex, curve.xInterval)"
>
<p slot="append" style="margin-right: 0;" small>
{{ curve.xUnit }}
</p>
</va-input>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapFields } from 'vuex-map-fields'
import { chartRouter } from './CanvasChartTable'
import configTable from '@/data/config-table/index.js'
import newTooltip from '@/factories/chart/tooltipFactory'
import { mapActions } from 'vuex'
import { taskInfo } from '../../../../data/task/TaskInfo'
import taskTypes from '@/store/modules/task/content/types'
export default {
name: 'CanvasChartRealTimeDisplay',
props: {
chartID: {
type: [Number, String],
required: true,
},
},
computed: {
...mapFields('taskContent', [
'chartData',
'deviceListNew',
]),
},
data () {
return {
data: null,
configTable: configTable,
chartRouter: chartRouter,
realTime: [[]],
}
},
methods: {
// store the setting in cache
...mapActions('taskContent', [
taskTypes.chart.saveToCache,
]),
getDeviceMode: function () {
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.chartData[this.chartID].mappingID))
if (device === undefined) return
return device.configuration.MODE
},
// set a new display tool
setRealTime: function (plotIndex, curveIndex) {
// construct realTime object, i.e., record the coressponding value and unit
// the formate imitates the data.gridSource
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)
// Potential
if (_xPhysicsQuantity === 'P') _xPhysicsQuantity = 'V'
if (_yPhysicsQuantity === 'P') _yPhysicsQuantity = 'V'
const [_xAxis, _yAxis] = this.chartRouter.getChartTable(_xPhysicsQuantity, _yPhysicsQuantity)
const _realTime = JSON.parse(JSON.stringify(this.realTime))
const _newCurve = {}
// set name, sourceIndex in data.series
_newCurve.name = this.data.gridSource[plotIndex][curveIndex].name
_newCurve.seriesSource = this.data.series.findIndex((ele) => ele.name === _newCurve.name)
// set x-axis
_newCurve.xValue = 0
_newCurve.xUnit = (typeof _xAxis.default.defaultUnit === 'function') ? _xAxis.default.defaultUnit(this.getDeviceMode()) : _xAxis.default.defaultUnit
_newCurve.xScaleOption = _xAxis.default.unit
_newCurve.xUnitOption = Object.keys(_xAxis.default.unit)
_newCurve.xName = _xAxis.default.name
_newCurve.xInterval = 'auto'
// set y-axis
_newCurve.yValue = 0
_newCurve.yUnit = (typeof _yAxis.default.defaultUnit === 'function') ? _yAxis.default.defaultUnit(this.getDeviceMode()) : _yAxis.default.defaultUnit
_newCurve.yScaleOption = _yAxis.default.unit
_newCurve.yUnitOption = Object.keys(_yAxis.default.unit)
_newCurve.yName = _yAxis.default.name
_newCurve.yInterval = 'auto'
// set functional
_newCurve.functional = 'default'
// padding
while (plotIndex >= _realTime.length) {
_realTime.push([])
}
while (curveIndex >= _realTime[plotIndex].length) {
_realTime[plotIndex].push({})
}
// merge the additional part into original part
_realTime[plotIndex][curveIndex] = _newCurve
this.realTime = _realTime
}
},
// set the interval size keyed by user
setInterval: async function (axis, plotIndex, curveIndex, val) {
if (!isNaN(val)) {
const scaleOption = this.realTime[plotIndex][curveIndex][axis + 'ScaleOption']
const unit = this.realTime[plotIndex][curveIndex][axis + 'Unit']
this.chartData[this.chartID][axis + 'Axis'][plotIndex].interval = val * scaleOption[unit]
} else {
this.chartData[this.chartID][axis + 'Axis'][plotIndex].interval = 'hi' // I know it looks weird, but this one is necessesary
this.chartData[this.chartID][axis + 'Axis'][plotIndex].interval = null
this.realTime[plotIndex][curveIndex][axis + 'Interval'] = 'auto'
}
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
},
// record the latest data as the real time value
updateValue: function () {
if ((this.realTime.length === 0)) {
return
}
for (let plotIndex = 0; plotIndex < this.realTime.length; plotIndex++) {
for (let curveIndex = 0; curveIndex < this.realTime[plotIndex].length; curveIndex++) {
// miss the source of data -> try to find the source
if (this.realTime[plotIndex][curveIndex].seriesSource === -1) {
this.realTime[plotIndex][curveIndex].seriesSource = this.data.series.findIndex((ele) => ele.name === this.realTime[plotIndex][curveIndex].name)
}
// the device is active now --> update the real time value
if (this.data.series[this.realTime[plotIndex][curveIndex].seriesSource] !== undefined &&
this.data.series[this.realTime[plotIndex][curveIndex].seriesSource].data !== undefined &&
this.data.series[this.realTime[plotIndex][curveIndex].seriesSource].data.length > 0) {
this.realTime[plotIndex][curveIndex].xValue = (this.data.series[this.realTime[plotIndex][curveIndex].seriesSource].data.at(-1)[0] / this.realTime[plotIndex][curveIndex].xScaleOption[this.realTime[plotIndex][curveIndex].xUnit]).toFixed(3)
this.realTime[plotIndex][curveIndex].yValue = (this.data.series[this.realTime[plotIndex][curveIndex].seriesSource].data.at(-1)[1] / this.realTime[plotIndex][curveIndex].yScaleOption[this.realTime[plotIndex][curveIndex].yUnit]).toFixed(3)
}
}
}
},
// match the formatter to current unit and functional
updateFormatter: function () {
for (let plotIndex = 0; plotIndex < this.realTime.length; plotIndex++) {
for (let curveIndex = 0; curveIndex < this.realTime[plotIndex].length; curveIndex++) {
if (curveIndex === 0) {
const _xUnit = this.realTime[plotIndex][curveIndex].xUnit
const _yUnit = this.realTime[plotIndex][curveIndex].yUnit
const _xScale = this.realTime[plotIndex][curveIndex].xScaleOption[this.realTime[plotIndex][curveIndex].xUnit]
const _yScale = this.realTime[plotIndex][curveIndex].yScaleOption[this.realTime[plotIndex][curveIndex].yUnit]
// update xAxis.formatter
if (this.realTime[plotIndex][curveIndex].xName === 'Time') {
this.data.xAxis[plotIndex].axisLabel.formatter = this.timeFormatter
} else {
this.data.xAxis[plotIndex].axisLabel.formatter = function (val) {
return parseFloat(val / _xScale).toFixed(3) + _xUnit
}
}
// update yAxis.formatter
if (this.realTime[plotIndex][curveIndex].yName === 'Time') {
this.data.yAxis[plotIndex].axisLabel.formatter = this.timeFormatter
} else {
this.data.yAxis[plotIndex].axisLabel.formatter = function (val) {
return parseFloat(val / _yScale).toFixed(3) + _yUnit
}
}
// update tooltip.formatter
this.data.tooltip.formatter = newTooltip(this.realTime).formatter
}
}
}
},
changeUnit: function (axis, plotIndex, curveIndex) {
this.updateValue()
this.updateFormatter()
this.setInterval(axis, plotIndex, curveIndex, 'auto')
},
// match the number of real time display bar to data.gridSource
matchChart: function () {
for (let plotIndex = 0; plotIndex < this.data.gridSource.length; plotIndex++) {
if (this.data.gridSource[plotIndex] !== undefined) {
for (let curveIndex = 0; curveIndex < this.data.gridSource[plotIndex].length; curveIndex++) {
if (plotIndex >= this.realTime.length) {
this.setRealTime(plotIndex, curveIndex)
} else if (curveIndex >= this.realTime[plotIndex].length) {
this.setRealTime(plotIndex, curveIndex)
}
}
}
}
},
// match the data to operated data in CanvasChart.vue
matchData: function (canvasChartData) {
this.data = canvasChartData
},
// match the functional to operated data in CanvasChart.vue
matchFunctional: function (newFunctional, plotIndex, curveIndex) {
if (this.realTime[plotIndex][curveIndex] === undefined) return
if (this.realTime[plotIndex][curveIndex].functional === newFunctional) return
const _currCurve = this.realTime[plotIndex][curveIndex]
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)
// Potential
if (_xPhysicsQuantity === 'P') _xPhysicsQuantity = 'V'
if (_yPhysicsQuantity === 'P') _yPhysicsQuantity = 'V'
const [_xAxis, _yAxis] = this.chartRouter.getChartTable(_xPhysicsQuantity, _yPhysicsQuantity)
_currCurve.functional = newFunctional
// set x-axis
_currCurve.xUnit = (typeof _xAxis.default.defaultUnit === 'function') ? _xAxis.default.defaultUnit(this.getDeviceMode()) : _xAxis.default.defaultUnit
_currCurve.xScaleOption = _xAxis.default.unit
_currCurve.xUnitOption = Object.keys(_xAxis.default.unit)
_currCurve.xName = _xAxis.default.name
// set y-axis
_currCurve.yUnit = (typeof _yAxis[newFunctional].defaultUnit === 'function') ? _yAxis[newFunctional].defaultUnit(this.getDeviceMode()) : _yAxis[newFunctional].defaultUnit
_currCurve.yScaleOption = _yAxis[newFunctional].unit
_currCurve.yUnitOption = Object.keys(_yAxis[newFunctional].unit)
_currCurve.yName = _yAxis[newFunctional].name
},
timeFormatter: function (val) {
let label = ''
const hour = Math.floor(val / 3.6e9)
const minute = Math.floor((val % 3.6e9) / 1000000 / 60)
const second = Math.floor((val % 6e7) / 1000000)
const millisecond = Math.floor((val % 1e6) / 1000)
const microsecond = Math.floor(val % 1e6) - 1000 * millisecond
if (hour > 0) {
label += hour + ' h '
}
if (minute > 0) {
label += minute + ' m '
}
if (second > 0) {
label += second + ' s '
}
if (millisecond > 0) {
label += millisecond + ' ms '
}
if (microsecond >= 0 && hour === 0 && minute === 0 && second === 0) {
label += microsecond + ' µs '
}
return label
},
},
mounted () {
this.data = this.chartData[this.chartID]
},
watch: {
'data.series': {
handler: function () {
this.updateValue()
},
deep: true,
},
'data.gridSource': {
handler: function () {
this.matchChart()
this.updateFormatter()
},
deep: true,
},
},
}
</script>
@@ -30,7 +30,7 @@ export default {
name: 'canvas-chart-setting',
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
},
@@ -90,12 +90,13 @@ import { taskInfo } from '../../../../data/task/TaskInfo'
import { mapFields } from 'vuex-map-fields'
import { mapActions } from 'vuex'
import taskTypes from '@/store/modules/task/content/types'
import configTable from '../../../../data/config-table'
export default {
name: 'canvas-chart-source',
props: {
chartID: {
type: Number,
type: [Number, String],
required: true,
},
},
@@ -140,7 +141,8 @@ export default {
deviceSelectX: function () {
const channelOptions = []
const deviceInfo = this.deviceListNew.find(ele => ele.id === this.deviceSelectX.id)
// console.log(val)
// console.log('deviceInfo', deviceInfo.library_name, deviceInfo.configuration.MODE)
// console.log('sourceObj', Object.keys(sourceObj))
if (deviceInfo == null) {
this.channelSelectDisableX = true
} else if (deviceInfo.library_name.includes('Neulive')) {
@@ -182,11 +184,19 @@ export default {
})
this.channelSelectDisableX = false
} 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 === 'EliteEIS' && deviceInfo.configuration.MODE === 0) {
if (deviceInfo.library_name.includes('EIS') && deviceInfo.configuration.MODE === 0) {
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++) {
const item = keys[i]
if (sourceObj[item].name !== 'Time' && sourceObj[item].name !== 'Cycle number') {
channelSet.push(String(sourceObj[item].name))
}
}
}
// console.log(channelSet)
channelSet.forEach((element, index) => {
@@ -250,11 +260,19 @@ export default {
})
this.channelSelectDisableY = false
} 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 === 'EliteEIS' && deviceInfo.configuration.MODE === 0) {
if (deviceInfo.library_name.includes('EIS') && deviceInfo.configuration.MODE === 0) {
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++) {
const item = keys[i]
if (sourceObj[item].name !== 'Time' && sourceObj[item].name !== 'Cycle number') {
channelSet.push(String(sourceObj[item].name))
}
}
}
// console.log(channelSet)
channelSet.forEach((element, index) => {
@@ -310,7 +328,7 @@ export default {
if (this.deviceSelectX.name.indexOf('Neulive') >= 0) {
deviceNameX = 'Neulive'
} else if (this.deviceSelectX.name.indexOf('Elite') >= 0) {
if (deviceXInfo.library_name === 'EliteEIS') {
if (deviceXInfo.library_name.includes('EIS')) {
deviceNameX = 'EliteEIS'
} else {
deviceNameX = 'Elite'
@@ -321,7 +339,7 @@ export default {
if (this.deviceSelectY.name.indexOf('Neulive') >= 0) {
deviceNameY = 'Neulive'
} else if (this.deviceSelectY.name.indexOf('Elite') >= 0) {
if (deviceYInfo.library_name === 'EliteEIS') {
if (deviceYInfo.library_name.includes('EIS')) {
deviceNameY = 'EliteEIS'
} else {
deviceNameY = 'Elite'
@@ -329,7 +347,6 @@ export default {
} else if (this.deviceSelectY.name.indexOf('Time') >= 0) {
deviceNameY = 'Time'
}
this.taskContentChartRegister({
chartID: this.chartID,
gridIndex: gridIndex,
@@ -350,7 +367,8 @@ export default {
}
this.sourceAddStatus = true
this.clearSelectOptions()
await this.taskContentChartSaveToCache()
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
this.$emit('addSource')
},
async addGrid () {
this.taskContentChartUpdateGridList({
@@ -358,7 +376,7 @@ export default {
length: this.chartData[this.chartID].grid.length + 1,
})
this.updateGridOptions()
await this.taskContentChartSaveToCache()
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
},
checkSourceAddStatus () {
if (this.sourceList.indexOf([this.deviceSelectX.name, this.deviceSelectX.id, this.channelSelectX.id].toString()) >= 0) {
@@ -0,0 +1,306 @@
const chartTable = {
// split 'A-B' by '-',
// then A-B[0] is about 'A' and A-B[1] is about 'B'
T_V: [
// 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: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
],
T_I: [
// 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',
},
},
],
T_R: [
// 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: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
},
],
V_V: [
// 0
{
default: {
name: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
// 1
{
default: {
name: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
],
V_I: [
// 0
{
default: {
name: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
// 𝜡 = dV/dI
differential: {
name: 'Impedance',
unit: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
// Power = ∫ V di
integral: {
name: 'Power',
unit: {
mW: 1e12,
W: 1e15,
kW: 1e18,
},
defaultUnit: 'W',
downloadUnit: 'W',
},
},
// 1
{
default: {
name: 'Current',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
A: 1e9,
},
defaultUnit: (Mode) => { return (Mode === 10 || Mode === 11) ? 'nA' : 'mA' },
downloadUnit: 'mA',
},
// Gm = dI/dV
differential: {
name: 'Transconductance',
unit: {
'mA/mV': 1e-3,
'A/mV': 1,
},
defaultUnit: 'mA/mV',
downloadUnit: 'A',
},
// Power = ∫ I dv
integral: {
name: 'Power',
unit: {
mW: 1e12,
W: 1e15,
kW: 1e18,
},
defaultUnit: 'W',
downloadUnit: 'W',
},
},
],
V_R: [
// 0
{
default: {
name: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
// 1
{
default: {
name: 'Resistance',
unit: {
: 1,
Ω: 1e3,
: 1e6,
: 1e9,
},
defaultUnit: 'Ω',
downloadUnit: 'Ω',
},
},
],
I_R: [
// 0
{
default: {
name: 'Voltage',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
// 1
{
default: {
name: 'Current',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
A: 1e9,
},
defaultUnit: (Mode) => { return (Mode === 10) ? 'nA' : 'mA' },
downloadUnit: 'mA',
},
},
],
ZReal_ZImag: [
// 0
{
default: {
name: 'Z_real',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
},
// 1
{
default: {
name: 'Z_imag',
unit: {
: 1e-3,
Ω: 1,
: 1e3,
: 1e6,
},
downloadUnit: 'Ω',
defaultUnit: 'Ω',
},
},
],
}
export const chartRouter = {
getChartTable: (xAxis, yAxis) => {
const name1 = xAxis + '_' + yAxis
const name2 = yAxis + '_' + xAxis
if (chartTable[name1] !== undefined) return [chartTable[name1][0], chartTable[name1][1]]
else if (chartTable[name2] !== undefined) return [chartTable[name2][1], chartTable[name2][0]]
else return 'idiot'
},
}
@@ -21,11 +21,28 @@
</va-item-section>
<va-item-section class="ml-3" caption>
<va-item-label>
{{ `[${device.memory_board}]` }} {{ device.name }}
<!-- <va-button @click="getBattery(device)"> get battery </va-button> -->
<!-- <pre> {{ device.battery }} </pre> -->
<va-item-label v-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">
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-three-quarters" color="#5BC236"/> {{ parseInt((device.battery - 2900) / 10) + '%' }}
</va-item-label>
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) >= 25">
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-half" color="#F6B431"/> {{ parseInt((device.battery - 2900) / 10) + '%' }}
</va-item-label>
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) > 10">
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-quarter" color="#DA244B"/> {{ parseInt((device.battery - 2900) / 10) + '%' }}
</va-item-label>
<va-item-label v-else>
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-empty" color="#DA244B"/> <span style="color: red;"> low battery </span>
</va-item-label>
<!-- <va-item-label v-else>
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-empty" color="#DA244B"/> {{ '0%' }}
</va-item-label> -->
<va-item-label caption>
{{ device.mac_address }}
{{ device.mac_address.toUpperCase() }}
</va-item-label>
</va-item-section>
</va-item>
@@ -36,16 +53,19 @@
<va-button @click.stop="start(device)" v-if="device.library_name.includes('Elite') && device.status !== 1" class="px-2 py-0 mr-0" color="success" small>START</va-button>
<va-button @click.stop="stop(device)" v-if="device.library_name.includes('Elite') && device.status === 1" class="px-2 py-0 mr-0" color="danger" small>STOP</va-button>
<va-button id="detectButton" @click.stop="detect(device)" v-if="device.library_name.includes('Elite')" color="primary" class="px-2 py-0 mr-0" small>DETECT</va-button>
<va-button @click.stop="show($event, device)" v-if="developerMode" color="warning" class="px-2 py-0 mr-0" small>Show</va-button>
</va-item-label>
</va-item-section>
</va-item>
</span>
<div slot="body">
<div>
<file-control-window :ref="'fcwindow_ref'" :device="device" class="pl-0 pr-0" />
</div>
<div v-if="device.library_name.includes('Elite')">
<elite-parameter-window :ref="'epwindow_ref'" :device="device" class="pl-0 pr-0" />
<div class="mt-0 mb-0" style="height: 60vh; overflow-y: scroll; overflow-x: hidden;" :key="'detail' + device.id">
<div>
<file-control-window :ref="`fcwindow_ref_${device.memory_board}`" :device="device" class="pl-0 pr-0" />
</div>
<div>
<device-parameter-window :device="device" class="pl-0 pr-0" />
</div>
</div>
</div>
</va-collapse>
@@ -54,18 +74,22 @@
</template>
<script>
import EliteParameterWindow from '../parameter/EliteParameterWindow'
import DeviceParameterWindow from '../parameter/DeviceParameterWindow'
// import EliteParameterWindow from '../parameter/EliteParameterWindow'
// import NeuliveParameterWindow from '../parameter/NeuliveParameterWindow'
import FileControlWindow from '../meta/FileControlWindow'
import { mapActions } from 'vuex'
import types from '@/store/modules/task/content/types'
import { taskInfo } from '../../../../data/task/TaskInfo'
import api from '@/data/api'
// import CanvasChart from '../chart/CanvasChart'
import { mapFields } from 'vuex-map-fields'
export default {
name: 'TaskDeviceList',
components: {
EliteParameterWindow,
DeviceParameterWindow,
// EliteParameterWindow,
// NeuliveParameterWindow,
FileControlWindow,
},
@@ -83,6 +107,9 @@ export default {
}
},
computed: {
...mapFields('', [
'developerMode',
]),
},
methods: {
mqttPub: function (topic, mes) {
@@ -90,7 +117,7 @@ export default {
},
start: async function (device) {
if (device.status === 0) {
await this.setArchiveSettings()
await this.setArchiveSettings(device.memory_board)
const isDPVMode = device.configuration.MODE === 15
if (isDPVMode) {
@@ -120,14 +147,15 @@ export default {
api.task.update({
device_config: taskInfo.getTaskInfo().deviceListNew,
})
// CanvasChart.methods.resetClicked()
}
},
stop: function (device) {
this.$emit('stop', device)
this.pageToast('The device ' + device.name + ' has been stopped.')
},
setArchiveSettings: async function () {
await this.$refs.fcwindow_ref[0].setArchiveSettings()
setArchiveSettings: async function (deviceID) {
await this.$refs[`fcwindow_ref_${deviceID}`][0].setArchiveSettings()
},
refresh: function () {
},
@@ -145,6 +173,12 @@ export default {
this.$emit('detect', device)
this.pageToast('The device ' + device.name + ' has been detect.')
},
show: function (event, device) {
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'show_device_data/0',
device: device.memory_board,
}))
},
recoverDetectButton () {
document.getElementById('detectButton').className += ' no-dark-style-va-button'
},
@@ -16,7 +16,7 @@
/>
</div>
<div class="flex sm2 xl2 md2 xs2 px-0 mx-0 my-0 py-0 pl-2">
<va-button class="pa-0 ma-0 mt-2 circle-button" small color="dark" @click="showModal=true">
<va-button v-if="place != 'scheduler'" class="pa-0 ma-0 mt-2 circle-button" small color="dark" @click="showModal=true">
<va-icon
name="fa fa-info"
color="white"
@@ -36,7 +36,7 @@
:withHeader="true"
:parameterName="name"
:inputValue="parameter[name]"
:disable="name === 'CTRL_HIGH_Z_15' && device.status === 0"
:disable="name === 'CTRL_HIGH_Z_15' && device && device.status === 0"
v-bind="parameterTable[name]"
@parameterChange="parameterChange"
@getParameter="getParameter"
@@ -71,7 +71,7 @@
v-for="name in parameterArrayInMode"
:key="name"
:label="`${typeof parameterTable[name].showName === 'function'
? parameterTable[name].showName(parameter.MODE)
? parameterTable[name].showName(modeSelection)
: parameterTable[name].showName} ${parameterValue(name)}`"
style="font-size: 20px;"
>
@@ -80,7 +80,8 @@
:is="parameterTable[name].componentType"
:parameterName="name"
:inputValue="parameter[name]"
:disable="name === 'CTRL_HIGH_Z_15' && device.status === 0"
:disable="name === 'CTRL_HIGH_Z_15' && device && device.status === 0"
:syncParameter="parameterTable[name].syncParameter"
v-bind="parameterTable[name]"
@parameterChange="parameterChange"
@getParameter="getParameter"
@@ -93,7 +94,7 @@
<!-- guide picture button -->
<div>
<vue-final-modal
v-if="library.includes('ZM15')"
v-if="library.includes('Elite_EDC')"
v-model="showModal"
classes="modal-container"
content-class="modal-content"
@@ -126,7 +127,7 @@ import DevMode from '../parameter/itemNew/DevMode'
import EliteParameterRecordingElitePulseSensing from '../parameter/itemNew/PulseSensingNew/EliteParameterRecordingElitePulseSensing'
import { VueFinalModal } from 'vue-final-modal'
import { mapFields } from 'vuex-map-fields'
import parameterTable from '@/data/param-table/index.js'
import configTable from '@/data/config-table/index'
export default {
name: 'EliteParameterRecordingElitezm15',
@@ -148,17 +149,44 @@ export default {
},
library: {
type: String,
required: true,
},
serialNumber: {
type: [String, Array],
},
device: {
type: Object,
default: null,
},
place: {
type: String,
default: '',
},
},
computed: {
parameterTable () {
if (this.library !== undefined) {
const config = configTable.getConfig(this.library)
if (config !== undefined) {
return config
}
}
if (this.serialNumber !== undefined) {
const config = configTable.getConfig(this.serialNumber)
if (config !== undefined) {
return config
}
}
return null
},
parameterArrayInMode () {
return this.workingModeSelect && this.parameterTable.MODE[this.workingModeSelect.id].parameter
},
modeSelection () {
if (this.parameter.MODE) {
return this.parameter.MODE
}
return this.workingModeSelect.id
},
getImageUrl () {
if (this.workingModeSelect === null) {
return 'IV-Wire'
@@ -174,7 +202,7 @@ export default {
}
},
...mapFields('', [
'developer_mode',
'developerMode',
]),
...mapFields('taskContent', [
'deviceListNew',
@@ -184,7 +212,6 @@ export default {
},
data () {
return {
parameterTable: parameterTable[this.library],
showModal: false,
workingModeSelect: null,
workingModeOptions: [],
@@ -197,11 +224,13 @@ export default {
this.$mqtt.publish(topic, mes)
},
parameterValue (name) {
const value = this.parameter[name]
if (this.parameterTable[name].type === 'number') {
if (this.parameterTable[name].defaultUnit === undefined) return ''
const scale = this.parameterTable[name].unit[this.parameterTable[name].defaultUnit]
return ` ( ${this.parameterTable[name].outputReadabilityData(this.parameter[name], scale)} ${this.parameterTable[name].defaultUnit} )`
return ` ( ${this.parameterTable[name].outputReadabilityData(value, scale)} ${this.parameterTable[name].defaultUnit} )`
} else if (this.parameterTable[name].type === 'array') {
return ` ( ${this.parameterTable[name].outputReadabilityData(this.parameter[name])} )`
return ` ( ${this.parameterTable[name].outputReadabilityData(value)} )`
} else if (this.parameterTable[name].type === 'none') {
return ''
}
@@ -225,11 +254,18 @@ export default {
this.parameterChange('MODE', this.workingModeSelect.id)
// if device is idle, then setting highz when mode switch
if (this.deviceStatus === true && this.workingModeSelect.highz !== undefined) {
this.parameterChange('CTRL_HIGH_Z_15', this.workingModeSelect.highz)
if (this.deviceStatus === true) {
if (this.workingModeSelect.highz !== undefined) {
this.parameterChange('CTRL_HIGH_Z_15', this.workingModeSelect.highz)
}
}
}
},
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)
},
@@ -239,15 +275,21 @@ export default {
},
mounted () {
// dev mode
// this.developer_mode === true
// this.developerMode === true
// ? this.workingModeOptions = this.workingModeDevOptions
// : this.workingModeOptions = this.workingModeNoDevOptions
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
// init mode
this.workingModeSelect = this.workingModeOptions.find(ele => ele.id === this.parameter.MODE)
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
},
watch: {
parameter: {
deep: true,
handler: function () {
// refresh real time parameter
this.workingModeSelect = (this.parameter.MODE !== undefined) ? this.workingModeOptions.find(ele => ele.id === this.parameter.MODE) : this.workingModeOptions[0]
},
},
},
destroyed () {
},
@@ -0,0 +1,78 @@
<template>
<div v-if="device">
<device-parameter-recording
:parameter="device.configuration"
:library="device.library_name"
:serialNumber="device.serial_number"
:device="device"
@sendInstruction="sendInstruction"
@getParameter="getParameter"
@setParameter="setParameter"
@setParameterWithDebounce="setParameterWithDebounce"
/>
</div>
</template>
<script>
import DeviceParameterRecording from './DeviceParameterRecording'
import { taskInfo } from '../../../../data/task/TaskInfo'
import _ from 'lodash'
export default {
name: 'EliteParameterWindow',
components: {
DeviceParameterRecording,
},
props: {
device: {
type: Object,
},
},
data () {
return {
}
},
mqtt: {
},
methods: {
mqttPublish: function (topic, mes) {
this.$mqtt.publish(topic, mes)
},
sendInstruction: function (instruction) {
this.mqttPublish(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_instruction/0',
device: this.device.mac_address,
instruction: instruction,
}))
},
getParameter: function (parameterName) {
this.mqttPublish(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_parameter_value/0',
device: this.device.mac_address,
parameter: parameterName,
}))
},
setParameter: function (parameterName, parameterValue) {
this.mqttPublish(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_parameter/0',
device: this.device.mac_address,
parameter: parameterName,
content: parameterValue,
}))
},
setParameterWithDebounce: _.debounce(function (parameterName, parameterValue) {
this.mqttPublish(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
header: 'device_parameter/0',
device: this.device.mac_address,
parameter: parameterName,
content: parameterValue,
}))
}, 100),
},
mounted () {
},
watch: {
},
}
</script>
@@ -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)
}
@@ -120,7 +120,7 @@ import DevMode from '../parameter/itemNew/DevMode'
import EliteParameterRecordingElitePulseSensing from '../parameter/itemNew/PulseSensingNew/EliteParameterRecordingElitePulseSensing'
import { VueFinalModal } from 'vue-final-modal'
import { mapFields } from 'vuex-map-fields'
import parameterTable from '@/data/param-table/index.js'
import parameterTable from '@/data/config-table/index.js'
export default {
name: 'EliteParameterRecordingElitezm15',
@@ -168,7 +168,7 @@ export default {
}
},
...mapFields('', [
'developer_mode',
'developerMode',
]),
...mapFields('taskContent', [
'deviceListNew',
@@ -233,7 +233,7 @@ export default {
},
mounted () {
// dev mode
// this.developer_mode === true
// this.developerMode === true
// ? this.workingModeOptions = this.workingModeDevOptions
// : this.workingModeOptions = this.workingModeNoDevOptions
this.workingModeOptions = this.parameterTable.MODE_OPTIONS
@@ -75,6 +75,10 @@ export default {
type: Boolean,
default: false,
},
syncParameter: {
type: Object,
default: () => {},
},
},
created () {
},
@@ -87,6 +91,13 @@ export default {
methods: {
buttonSelectChange (value) {
this.$emit('parameterChange', this.parameterName, value)
this.syncParameter && Object.keys(this.syncParameter).forEach(element => {
if (String(element) === String(value)) {
this.syncParameter[value].forEach(element => {
this.$emit('parameterChange', element[0], element[1])
})
}
})
},
},
async mounted () {
+129
View File
@@ -0,0 +1,129 @@
import { matrix, inv, multiply, transpose, row, range } from 'mathjs'
// eslint-disable-next-line no-unused-vars
function sgFilter (data, windowSize, k) {
// self
const arr = []
const m = parseInt((windowSize - 1) / 2)
console.log('m', m)
for (const i of range(0, windowSize)) {
console.log('windowSize', i)
const a = []
for (const j of range(0, k)) {
console.log('k', j)
const yVal = Math.pow(-m + i.value, j.value)
a.push(yVal)
}
arr.push(a)
}
console.log(arr)
const X = matrix(arr)
console.log(X, transpose(X), multiply(transpose(X), X))
const B = multiply(multiply(X, inv(multiply(transpose(X), X))), transpose(X))
// B = X * (X.T * X).I * X.T
console.log('B', B)
const a = row(B, m)._data[0]
console.log(a)
// a = a.reshape(windowSize)
// for (const )
const start = []
const end = []
const list = []
for (const i of range(0, m)) {
console.log('i', i)
start.push(data[0])
end.push(data[data.length - 1])
}
console.log('start, end', start, end)
const _data = [...start, ...data, ...end]
console.log('m,', m, _data.length)
for (const i of range(m, _data.length - m)) {
const arra = []
for (const j of range(-m, m + 1)) {
arra.push(_data[i.value + j.value])
}
console.log('arr', arra)
let sum = 0
console.log('aaa', arra, a)
for (const index in arra) {
console.log('index', index)
sum += (arra[index] * a[index])
}
// const b = np.sum(np.array(arra) * a)
list.push(sum)
}
return list
// data = np.insert(data, 0, [data[0] for i in range(m)])
// data = np.append(data, [data[-1] for i in range(m)])
// list = []
// for i in range(m, data.shape[0] - m){
// arra = []
// for j in range(-m, m+1)
// arra.append(data[i +j])
// b = np.sum(np.array(arra) * a)
// list.append(b)
// }
// return list
}
function sgFilterGetDifferential (data, windowSize, polynomial, sampleRate = 1) {
// self
const arr = []
const m = parseInt((windowSize - 1) / 2)
// create polynomial matrix
for (const i of range(0, windowSize)) {
const a = []
for (const j of range(0, polynomial)) {
const yVal = Math.pow(-m + i.value, j.value)
a.push(yVal)
}
arr.push(a)
}
const X = matrix(arr)
// B = (X.T * X).I * X.T
const B = multiply(inv(multiply(transpose(X), X)), transpose(X))
// use index 1 row in matrix
const rowOneInB = row(B, 1)._data[0]
// const start = []
// const end = []
const list = []
// eslint-disable-next-line no-unused-vars
// for (const _ of range(0, m)) {
// start.push(data[0])
// end.push(data[data.length - 1])
// }
// const _data = [...start, ...data, ...end]
// const _data = [...data]
// m ... data_length - m - 1
for (const i of range(m, data.length - m)) {
const arra = []
// -m ... 0 ... m
for (const j of range(-m, m + 1)) {
arra.push(data[i.value + j.value])
}
let sum = 0
for (const index in arra) {
sum += (arra[index] * rowOneInB[index])
}
list.push(sum * sampleRate)
}
return list
}
export default sgFilterGetDifferential
-1
View File
@@ -79,7 +79,6 @@ async function getAll () {
}
async function getByParentName (collectionType, parent, name) {
console.log(collectionType, parent, name)
const _header = auth.getHeader()
try {
return await api.axios.get(`/api/file/collection/get_by_parent_name/${collectionType}/${parent}/${name}`, { headers: _header })
-1
View File
@@ -13,7 +13,6 @@ async function create (_data) {
async function getAll () {
const _header = auth.getHeader()
console.log(_header)
try {
return await api.axios.get('/api/controller/get/all', { headers: _header })
} catch (e) {
-1
View File
@@ -13,7 +13,6 @@ async function create (_data) {
async function getAll () {
const _header = auth.getHeader()
console.log(_header)
try {
return await api.axios.get('/api/task/get/all', { headers: _header })
} catch (e) {
@@ -1,7 +1,8 @@
export default {
name: 'Cali ADC - test',
parameter: ['DAC_VOLT', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'ADC_DAC_CHANNEL_15'], // 這個mode用到的參數
showParameter: ['DAC_VOLT', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'ADC_DAC_CHANNEL_15'], // 有要秀給user看的參數
name: 'Cali Mode - test',
parameter: ['ADC_DAC_CHANNEL_15', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'DAC_LEVEL_V_OUT_15', 'DAC_VOLT_BUTTON'], // 這個mode用到的參數
showParameter: ['ADC_DAC_CHANNEL_15', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'DAC_LEVEL_V_OUT_15', 'DAC_VOLT_BUTTON'], // 有要秀給user看的參數
headerParameter: () => ['ADC_DAC_CHANNEL_15', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'DAC_LEVEL_V_OUT_15', 'DAC_VOLT_BUTTON'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -25,7 +26,7 @@ export default {
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
defaultUnit: 'us',
},
0: {
name: 'I_in',
@@ -52,7 +53,7 @@ export default {
charts: {
default: [
{
name: 'Cali ADC - test',
name: 'Cali Mode - test',
description: '',
subplot: [
{
@@ -25,7 +25,7 @@ export default {
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
defaultUnit: 'us',
},
0: {
name: 'I_in',
@@ -1,8 +1,8 @@
export default {
name: 'Chronoamperometric',
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'], // 有要秀給user看的參數
headerParameter: () => ['VOLT_VSCAN', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // 有要秀給user看的參數
name: 'Chronoamperometry',
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) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -1,8 +1,8 @@
export default {
name: 'Chronopotentiometry',
parameter: ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN'], // 有要秀給user看的參數
headerParameter: () => ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // 有要秀給user看的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -57,6 +56,47 @@ export default {
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
3: {
name: 'sum_cnt',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'uV',
},
4: {
name: 'sum_adc_delta_Iin',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'uV',
},
5: {
name: 'sum_adc_delta_Voutin',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'uV',
},
6: {
name: 'resis',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'uV',
},
},
charts: {
@@ -1,8 +1,8 @@
export default {
name: 'Constant Current',
parameter: ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN'], // 有要秀給user看的參數
headerParameter: () => ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // 有要秀給user看的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'Charge', 'Const_Current_value', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['Charge', 'Const_Current_value', 'SAMPLE_RATE', 'VOLTSTOP_MAX', 'VOLTSTOP_MIN', 'CC_CP_SPEED', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 有要秀給user看的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -24,9 +24,8 @@ export default {
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -27,11 +27,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -41,7 +40,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -1,8 +1,8 @@
export default {
name: 'Function Generator',
parameter: ['DAC_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', 'DAC_VOLT', 'SAMPLE_RATE'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // export header的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'DAC_VOLT', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -1,8 +1,8 @@
export default {
name: 'I-T Graph',
parameter: ['DAC_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', 'DAC_VOLT', 'SAMPLE_RATE'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // export header的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'DAC_VOLT', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -1,8 +1,8 @@
export default {
name: 'Open Circuit Potential',
parameter: ['SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'SAMPLE_RATE'], // 有要秀給user看的參數
headerParameter: () => ['SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // export header的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -38,31 +38,30 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
name: 'pul1_I_in',
name: 'I_in_pul1',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
name: 'pul2_I_in',
name: 'I_in_pul2',
unit: {
nA: 1,
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
},
@@ -1,8 +1,8 @@
export default {
name: 'R-T Graph',
parameter: ['DAC_VOLT', 'SAMPLE_RATE', 'CTRL_HIGH_Z_15', 'TIME_DURATION'], // 這個mode用到的參數
showParameter: ['CTRL_HIGH_Z_15', 'DAC_VOLT', 'SAMPLE_RATE'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // export header的參數
showParameter: ['CTRL_HIGH_Z_15', 'DAC_VOLT', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['DAC_VOLT', 'SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
@@ -50,7 +49,7 @@ export default {
downloadUnit: 'mV',
},
2: {
name: 'Resister',
name: 'Resistor',
unit: {
: 1,
mohm: 1,
@@ -1,8 +1,8 @@
export default {
name: 'V-T Graph',
parameter: ['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', 'SAMPLE_RATE'], // 有要秀給user看的參數
headerParameter: () => ['SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15'], // export header的參數
showParameter: ['ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'CTRL_HIGH_Z_15', 'SAMPLE_RATE', 'TIME_DURATION'], // 有要秀給user看的參數
headerParameter: () => ['SAMPLE_RATE', 'ADC_LEVEL_I_15', 'ADC_LEVEL_V_IN_15', 'TIME_DURATION'], // export header的參數
valScales: {
linear: {
func: (val) => {
@@ -22,11 +22,10 @@ export default {
us: 1,
ms: 1e3,
s: 1e6,
m: 60 * 1e6,
h: 60 * 60 * 1e6,
auto: 1,
minute: 60 * 1e6,
hour: 60 * 60 * 1e6,
},
defaultUnit: 'auto',
defaultUnit: 'ms',
downloadUnit: 'ms',
},
0: {
@@ -36,7 +35,7 @@ export default {
uA: 1e3,
mA: 1e6,
},
defaultUnit: 'uA',
defaultUnit: 'mA',
downloadUnit: 'mA',
},
1: {
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,97 @@
export default {
name: 'Chronoamperometry',
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) => {
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: 'Potential',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
2: {
name: 'V_out',
unit: {
uV: 1,
mV: 1e3,
V: 1e6,
},
defaultUnit: 'mV',
downloadUnit: 'mV',
},
},
charts: {
default: [
{
name: 'Chronoamperometric',
description: '',
subplot: [
{
x1: {
type: 'time',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
y1: {
type: 'value',
valScale: 'linear',
min: 'dataMin',
max: 'dataMax',
},
data: [
{
legend: 'chrono',
x1: {
channel: 'time',
},
y1: {
channel: 0,
},
},
],
},
],
},
],
},
}

Some files were not shown because too many files have changed in this diff Show More