Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bfc347ab4e | |||
| 6c9cb65d28 | |||
| e980207645 | |||
| 3508caede2 | |||
| edc9b67e0a | |||
| a89ac32e9c | |||
| 8522c20383 | |||
| 197dc3cefc | |||
| e110da9bce | |||
| f86407f8e6 | |||
| 679750613c | |||
| 6838a54088 | |||
| 6ab5dd8f99 | |||
| 97fed46124 | |||
| d0df337b7b | |||
| 621ae30fab | |||
| 8146e53dcc | |||
| fa2f45dbce | |||
| eb686c7a11 | |||
| 27c1dc6044 | |||
| 49458ab441 | |||
| 07ba97c1b0 | |||
| 1f377b7a0a | |||
| 9a80d7eceb | |||
| 74d64c1234 | |||
| 0eb35f35ec | |||
| 7073734c0d | |||
| 23d68aa880 | |||
| 6098d9b84c | |||
| a170b9ae1d | |||
| ec23eff0b5 | |||
| 6a9ad8d554 | |||
| 674a88460d | |||
| 8dd8cb52e6 | |||
| a206479d08 | |||
| a0315a4e56 | |||
| 644887a151 | |||
| d7ad076dbe | |||
| 4c24b08d92 | |||
| 753248826d | |||
| 57c9972855 | |||
| ba7145be76 | |||
| f0fe12bc84 | |||
| 096ecb4a7e | |||
| 5614bf69ed | |||
| d60438e952 | |||
| 55dde2a4e4 | |||
| 0b1afd6f29 | |||
| 74f755a966 | |||
| 1072b37139 | |||
| 030e63b8c6 | |||
| 1aa6cc6d31 | |||
| 30db3a9232 | |||
| 0d2b97b87e | |||
| b4169367aa | |||
| 820d59cb2f | |||
| c58ec8c907 | |||
| dcf9d1b98c | |||
| fd4ff2d99d | |||
| 8bf7a893ae | |||
| ce4cf4078b | |||
| cbd45415bd | |||
| 140a564ee7 | |||
| 8d24a93f6d | |||
| 98135d6ce2 | |||
| a3ccb942e5 | |||
| eacc0d9547 | |||
| 9cc653b761 | |||
| 0cfc02c939 | |||
| 60252b5cfe | |||
| cc5207ae07 | |||
| 4ad2b51161 | |||
| 0f32263d12 | |||
| 52db5b818c | |||
| 507718e3a3 | |||
| 1c02ffb934 | |||
| 5d594eff06 |
@@ -0,0 +1,4 @@
|
||||
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="13.5" cy="13.5" r="12.5" fill="#37E893" stroke="#37E893" stroke-width="2"/>
|
||||
<path d="M21.5 12.634C22.1667 13.0189 22.1667 13.9811 21.5 14.366L10.25 20.8612C9.58333 21.2461 8.75 20.765 8.75 19.9952V7.00481C8.75 6.23501 9.58333 5.75388 10.25 6.13878L21.5 12.634Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 392 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="13.5" cy="13.5" r="12.5" fill="#E6E6E6" stroke="#E6E6E6" stroke-width="2"/>
|
||||
<path d="M21.5 12.634C22.1667 13.0189 22.1667 13.9811 21.5 14.366L10.25 20.8612C9.58333 21.2461 8.75 20.765 8.75 19.9952V7.00481C8.75 6.23501 9.58333 5.75388 10.25 6.13878L21.5 12.634Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 392 B |
@@ -0,0 +1,7 @@
|
||||
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="13.5" cy="13.5" r="12.5" fill="#FF8D8D" stroke="#FF8D8D" stroke-width="2"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="15" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="15" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 441 B |
@@ -0,0 +1,9 @@
|
||||
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="13.5" cy="13.5" r="12.5" fill="#E6E6E6" stroke="#E6E6E6" stroke-width="2"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="15" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="15" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
<rect x="8" y="7" width="4" height="13" rx="2" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 565 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13 14.0833V9.74996M22.75 6.49996L20.5833 4.33329M10.8333 2.16663H15.1666M13 22.75C10.7014 22.75 8.49704 21.8369 6.87172 20.2116C5.24641 18.5862 4.33331 16.3818 4.33331 14.0833C4.33331 11.7847 5.24641 9.58035 6.87172 7.95503C8.49704 6.32972 10.7014 5.41663 13 5.41663C15.2985 5.41663 17.5029 6.32972 19.1282 7.95503C20.7536 9.58035 21.6666 11.7847 21.6666 14.0833C21.6666 16.3818 20.7536 18.5862 19.1282 20.2116C17.5029 21.8369 15.2985 22.75 13 22.75Z" stroke="#2C4052" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 648 B |
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="640.000000pt" height="320.000000pt" viewBox="0 0 1280.000000 640.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.15, written by Peter Selinger 2001-2017
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,640.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M9638 6075 c-772 -93 -1504 -467 -2317 -1184 -198 -174 -334 -303
|
||||
-657 -624 -230 -229 -264 -258 -281 -249 -11 6 -100 93 -199 194 -1144 1171
|
||||
-1886 1664 -2745 1822 -560 103 -1141 38 -1669 -186 -885 -376 -1533 -1167
|
||||
-1714 -2093 -41 -207 -51 -318 -51 -565 0 -392 54 -719 176 -1065 338 -964
|
||||
1145 -1627 2164 -1779 634 -95 1337 26 1957 335 243 121 448 250 703 441 321
|
||||
239 556 450 1061 950 176 175 327 318 334 318 8 0 77 -66 154 -146 172 -179
|
||||
592 -584 770 -743 820 -731 1442 -1055 2226 -1163 58 -8 194 -12 350 -12 213
|
||||
0 279 4 400 23 650 100 1205 379 1659 832 457 457 742 1045 823 1699 19 155
|
||||
16 563 -6 720 -78 561 -275 1067 -568 1457 -95 128 -294 332 -425 435 -364
|
||||
290 -837 486 -1378 570 -172 26 -594 34 -767 13z m-6331 -1199 c336 -71 676
|
||||
-233 1010 -481 119 -88 297 -234 413 -339 146 -133 880 -850 880 -860 0 -16
|
||||
-640 -649 -795 -788 -492 -438 -947 -715 -1375 -839 -202 -58 -321 -74 -565
|
||||
-74 -190 0 -235 3 -334 23 -590 119 -1022 504 -1210 1077 -160 489 -130 953
|
||||
90 1385 252 496 706 824 1266 915 63 10 146 13 293 10 172 -3 225 -8 327 -29z
|
||||
m6863 19 c327 -46 605 -171 841 -378 439 -384 649 -1063 517 -1677 -134 -625
|
||||
-615 -1131 -1229 -1295 -148 -39 -279 -55 -454 -55 -310 0 -559 62 -870 215
|
||||
-327 160 -642 391 -1037 761 -248 232 -743 719 -746 734 -3 16 466 495 668
|
||||
681 682 630 1221 933 1800 1014 130 18 382 18 510 0z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="270" height="110" viewBox="0 0 270 110" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="270" height="110" rx="55" fill="#A4A3A3"/>
|
||||
<path d="M84.9 88.9C80.4 88.9 76.41 88 72.93 86.2C69.45 84.34 66.75 81.73 64.83 78.37C62.97 75.01 62.04 71.14 62.04 66.76V46.24C62.04 41.92 63 38.11 64.92 34.81C66.84 31.45 69.51 28.87 72.93 27.07C76.41 25.21 80.4 24.28 84.9 24.28C89.46 24.28 93.45 25.21 96.87 27.07C100.35 28.87 103.05 31.45 104.97 34.81C106.89 38.11 107.85 41.92 107.85 46.24V66.76C107.85 71.14 106.89 75.01 104.97 78.37C103.05 81.73 100.35 84.34 96.87 86.2C93.45 88 89.46 88.9 84.9 88.9ZM84.9 79.9C88.68 79.9 91.71 78.73 93.99 76.39C96.27 74.05 97.41 70.96 97.41 67.12V46.15C97.41 42.25 96.27 39.13 93.99 36.79C91.71 34.45 88.68 33.28 84.9 33.28C81.18 33.28 78.18 34.45 75.9 36.79C73.62 39.13 72.48 42.25 72.48 46.15V67.12C72.48 70.96 73.62 74.05 75.9 76.39C78.18 78.73 81.18 79.9 84.9 79.9ZM162.038 32.92C162.038 33.22 161.918 33.49 161.678 33.73C161.498 33.91 161.258 34 160.958 34H130.358C130.058 34 129.908 34.15 129.908 34.45V51.28C129.908 51.58 130.058 51.73 130.358 51.73H150.968C151.268 51.73 151.508 51.85 151.688 52.09C151.928 52.27 152.048 52.51 152.048 52.81V59.65C152.048 59.95 151.928 60.22 151.688 60.46C151.508 60.64 151.268 60.73 150.968 60.73H130.358C130.058 60.73 129.908 60.88 129.908 61.18V86.92C129.908 87.22 129.788 87.49 129.548 87.73C129.368 87.91 129.128 88 128.828 88H120.548C120.248 88 119.978 87.91 119.738 87.73C119.558 87.49 119.468 87.22 119.468 86.92V26.08C119.468 25.78 119.558 25.54 119.738 25.36C119.978 25.12 120.248 25 120.548 25H160.958C161.258 25 161.498 25.12 161.678 25.36C161.918 25.54 162.038 25.78 162.038 26.08V32.92ZM212.751 32.92C212.751 33.22 212.631 33.49 212.391 33.73C212.211 33.91 211.971 34 211.671 34H181.071C180.771 34 180.621 34.15 180.621 34.45V51.28C180.621 51.58 180.771 51.73 181.071 51.73H201.681C201.981 51.73 202.221 51.85 202.401 52.09C202.641 52.27 202.761 52.51 202.761 52.81V59.65C202.761 59.95 202.641 60.22 202.401 60.46C202.221 60.64 201.981 60.73 201.681 60.73H181.071C180.771 60.73 180.621 60.88 180.621 61.18V86.92C180.621 87.22 180.501 87.49 180.261 87.73C180.081 87.91 179.841 88 179.541 88H171.261C170.961 88 170.691 87.91 170.451 87.73C170.271 87.49 170.181 87.22 170.181 86.92V26.08C170.181 25.78 170.271 25.54 170.451 25.36C170.691 25.12 170.961 25 171.261 25H211.671C211.971 25 212.211 25.12 212.391 25.36C212.631 25.54 212.751 25.78 212.751 26.08V32.92Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="65" height="65" rx="32.5" fill="#CDCDCD"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 159 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="65" height="65" rx="32.5" fill="#2CE9A4"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 159 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="270" height="110" viewBox="0 0 270 110" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="270" height="110" rx="55" fill="#FF8989"/>
|
||||
<path d="M84.9 88.9C80.4 88.9 76.41 88 72.93 86.2C69.45 84.34 66.75 81.73 64.83 78.37C62.97 75.01 62.04 71.14 62.04 66.76V46.24C62.04 41.92 63 38.11 64.92 34.81C66.84 31.45 69.51 28.87 72.93 27.07C76.41 25.21 80.4 24.28 84.9 24.28C89.46 24.28 93.45 25.21 96.87 27.07C100.35 28.87 103.05 31.45 104.97 34.81C106.89 38.11 107.85 41.92 107.85 46.24V66.76C107.85 71.14 106.89 75.01 104.97 78.37C103.05 81.73 100.35 84.34 96.87 86.2C93.45 88 89.46 88.9 84.9 88.9ZM84.9 79.9C88.68 79.9 91.71 78.73 93.99 76.39C96.27 74.05 97.41 70.96 97.41 67.12V46.15C97.41 42.25 96.27 39.13 93.99 36.79C91.71 34.45 88.68 33.28 84.9 33.28C81.18 33.28 78.18 34.45 75.9 36.79C73.62 39.13 72.48 42.25 72.48 46.15V67.12C72.48 70.96 73.62 74.05 75.9 76.39C78.18 78.73 81.18 79.9 84.9 79.9ZM162.038 32.92C162.038 33.22 161.918 33.49 161.678 33.73C161.498 33.91 161.258 34 160.958 34H130.358C130.058 34 129.908 34.15 129.908 34.45V51.28C129.908 51.58 130.058 51.73 130.358 51.73H150.968C151.268 51.73 151.508 51.85 151.688 52.09C151.928 52.27 152.048 52.51 152.048 52.81V59.65C152.048 59.95 151.928 60.22 151.688 60.46C151.508 60.64 151.268 60.73 150.968 60.73H130.358C130.058 60.73 129.908 60.88 129.908 61.18V86.92C129.908 87.22 129.788 87.49 129.548 87.73C129.368 87.91 129.128 88 128.828 88H120.548C120.248 88 119.978 87.91 119.738 87.73C119.558 87.49 119.468 87.22 119.468 86.92V26.08C119.468 25.78 119.558 25.54 119.738 25.36C119.978 25.12 120.248 25 120.548 25H160.958C161.258 25 161.498 25.12 161.678 25.36C161.918 25.54 162.038 25.78 162.038 26.08V32.92ZM212.751 32.92C212.751 33.22 212.631 33.49 212.391 33.73C212.211 33.91 211.971 34 211.671 34H181.071C180.771 34 180.621 34.15 180.621 34.45V51.28C180.621 51.58 180.771 51.73 181.071 51.73H201.681C201.981 51.73 202.221 51.85 202.401 52.09C202.641 52.27 202.761 52.51 202.761 52.81V59.65C202.761 59.95 202.641 60.22 202.401 60.46C202.221 60.64 201.981 60.73 201.681 60.73H181.071C180.771 60.73 180.621 60.88 180.621 61.18V86.92C180.621 87.22 180.501 87.49 180.261 87.73C180.081 87.91 179.841 88 179.541 88H171.261C170.961 88 170.691 87.91 170.451 87.73C170.271 87.49 170.181 87.22 170.181 86.92V26.08C170.181 25.78 170.271 25.54 170.451 25.36C170.691 25.12 170.961 25 171.261 25H211.671C211.971 25 212.211 25.12 212.391 25.36C212.631 25.54 212.751 25.78 212.751 26.08V32.92Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="270" height="110" viewBox="0 0 270 110" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="270" height="110" rx="55" fill="#41DBA2"/>
|
||||
<path d="M104.9 88.9C100.4 88.9 96.41 88 92.93 86.2C89.45 84.34 86.75 81.73 84.83 78.37C82.97 75.01 82.04 71.14 82.04 66.76V46.24C82.04 41.92 83 38.11 84.92 34.81C86.84 31.45 89.51 28.87 92.93 27.07C96.41 25.21 100.4 24.28 104.9 24.28C109.46 24.28 113.45 25.21 116.87 27.07C120.35 28.87 123.05 31.45 124.97 34.81C126.89 38.11 127.85 41.92 127.85 46.24V66.76C127.85 71.14 126.89 75.01 124.97 78.37C123.05 81.73 120.35 84.34 116.87 86.2C113.45 88 109.46 88.9 104.9 88.9ZM104.9 79.9C108.68 79.9 111.71 78.73 113.99 76.39C116.27 74.05 117.41 70.96 117.41 67.12V46.15C117.41 42.25 116.27 39.13 113.99 36.79C111.71 34.45 108.68 33.28 104.9 33.28C101.18 33.28 98.18 34.45 95.9 36.79C93.62 39.13 92.48 42.25 92.48 46.15V67.12C92.48 70.96 93.62 74.05 95.9 76.39C98.18 78.73 101.18 79.9 104.9 79.9ZM176.098 26.08C176.098 25.78 176.188 25.54 176.368 25.36C176.608 25.12 176.878 25 177.178 25H185.458C185.758 25 185.998 25.12 186.178 25.36C186.418 25.54 186.538 25.78 186.538 26.08V86.92C186.538 87.22 186.418 87.49 186.178 87.73C185.998 87.91 185.758 88 185.458 88H177.448C176.848 88 176.428 87.76 176.188 87.28L150.268 44.8C150.148 44.62 150.028 44.56 149.908 44.62C149.788 44.62 149.728 44.74 149.728 44.98L149.908 86.92C149.908 87.22 149.788 87.49 149.548 87.73C149.368 87.91 149.128 88 148.828 88H140.548C140.248 88 139.978 87.91 139.738 87.73C139.558 87.49 139.468 87.22 139.468 86.92V26.08C139.468 25.78 139.558 25.54 139.738 25.36C139.978 25.12 140.248 25 140.548 25H148.558C149.158 25 149.578 25.24 149.818 25.72L175.648 68.2C175.768 68.38 175.888 68.47 176.008 68.47C176.128 68.41 176.188 68.26 176.188 68.02L176.098 26.08Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 632 KiB |
@@ -25,12 +25,12 @@
|
||||
>
|
||||
<!-- *** icon -->
|
||||
<!-- <va-icon-vuestic /> -->
|
||||
<img src='@/assets/img/bps_logo.png'>
|
||||
<!-- <img src='@/assets/img/bps_logo.png'> -->
|
||||
</router-link>
|
||||
</div>
|
||||
<!-- <img style="height: 40px;" v-bind:src="'https://www.bioproweb.com/wp-content/uploads/2020/01/BPS-LOGO_60.png'"> -->
|
||||
<div class="app-navbar__center lg5 md4">
|
||||
<span
|
||||
<!-- <span
|
||||
class="app-navbar__text"
|
||||
:style="{color: this.$themes.gray}"
|
||||
>
|
||||
@@ -43,7 +43,7 @@
|
||||
>
|
||||
contact@bioproweb.com
|
||||
</a>
|
||||
</span>
|
||||
</span> -->
|
||||
</div>
|
||||
<app-navbar-actions
|
||||
class="app-navbar__actions md5 lg4"
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row flex sm12 xl12 md12 xs12" style="height: 100vh;">
|
||||
<div class="flex-center spinner-box mt-4 mb-5">
|
||||
<fulfilling-bouncing-circle-spinner
|
||||
:animation-duration="3000"
|
||||
:color="'#6c7fee'"
|
||||
:size="60"
|
||||
>
|
||||
</fulfilling-bouncing-circle-spinner>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +7,6 @@
|
||||
import api from '@/data/api/index'
|
||||
import types from '@/store/modules/download/types'
|
||||
import { mapActions, mapMutations } from 'vuex'
|
||||
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import newDownload from '@/factories/file/downloadFactory'
|
||||
import newChannel from '@/factories/file/channelFactory'
|
||||
@@ -27,11 +16,17 @@ import configTable from '@/data/config-table/index'
|
||||
export default {
|
||||
name: 'Download',
|
||||
components: {
|
||||
FulfillingBouncingCircleSpinner,
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
controllerList: [],
|
||||
downloadList: [],
|
||||
format: 'excel',
|
||||
channel: '',
|
||||
metaListNew: [],
|
||||
downloading: false,
|
||||
fileNums: 0,
|
||||
count: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -67,6 +62,187 @@ export default {
|
||||
}
|
||||
return results
|
||||
},
|
||||
writeFiles: async function () {
|
||||
if (this.metaListNew.length !== 0 && this.downloading === false) {
|
||||
this.downloading = true
|
||||
let meta
|
||||
const metaID = this.metaListNew.pop()
|
||||
const ret = await api.meta.getByID(metaID)
|
||||
|
||||
if (ret.status === 200) {
|
||||
meta = ret.data[0]
|
||||
}
|
||||
|
||||
if (meta !== undefined) {
|
||||
this.metaInfo = meta
|
||||
const channelParamObj = configTable.getModeConfig(meta.device.library_name, meta.parameter_set.MODE).channels
|
||||
const channelArray = this.channel === 'all' ? JSON.parse(this.metaInfo.channels) : Object.keys(channelParamObj).filter(ele => ele !== 'time')
|
||||
channelArray.filter(el => Object.keys(channelParamObj).includes(el))
|
||||
if (channelParamObj[channelArray[0]].order) {
|
||||
channelArray.sort((a, b) => channelParamObj[a].order - channelParamObj[b].order)
|
||||
}
|
||||
const channelList = []
|
||||
|
||||
// split to different subfile by channel
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
if (channelArray.some(el => el >= 256)) {
|
||||
channelList.push(channelArray.filter(el => (el >= 256 && el <= 259)))
|
||||
channelList.push(channelArray.filter(el => el < 256))
|
||||
} else {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0 || meta.device.library_name.indexOf('PEL') >= 0) {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
|
||||
while (channelList.length > 0) {
|
||||
const channels = channelList.pop()
|
||||
|
||||
let maxSplitFiles = 1
|
||||
let fileIndex = 0
|
||||
|
||||
// find max raw data need sub file
|
||||
for (const rawDataIndex of channels) {
|
||||
if (meta.raw_data[rawDataIndex] !== undefined) {
|
||||
const dataLength = meta.raw_data[rawDataIndex].length
|
||||
|
||||
maxSplitFiles = Math.max(maxSplitFiles, Math.ceil(meta.raw_data[rawDataIndex].length / dataLength))
|
||||
meta.raw_data[rawDataIndex] = this.chunkArray(meta.raw_data[rawDataIndex], dataLength)
|
||||
}
|
||||
}
|
||||
|
||||
while (fileIndex < maxSplitFiles) {
|
||||
// create new download info & add channel
|
||||
if (this.downloadInfo === null) {
|
||||
this.downloadInfo = newDownload()
|
||||
}
|
||||
this.downloadInfo.channel = channels
|
||||
|
||||
// download format
|
||||
this.downloadInfo.format = this.format
|
||||
|
||||
// download device and filename
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 7), meta.device.library_name.slice(7)]
|
||||
if (this.downloadInfo.channel.some(el => el >= 256 && el <= 259)) {
|
||||
this.downloadInfo.filename = meta.name + '-accerlate'
|
||||
this.downloadInfo.size = parseInt(parseInt(meta.size) / (76 * (maxSplitFiles)))
|
||||
} else {
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 5), meta.device.library_name.slice(5)]
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
} else if (meta.device.library_name.indexOf('PEL') >= 0) {
|
||||
this.downloadInfo.device = ['Elite', 'PEL']
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
}
|
||||
|
||||
// create new channel info & get sample rate
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (this.downloadInfo.channelInfo[channel] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel] = {
|
||||
...newChannel(),
|
||||
...channelParamObj[channel],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set download ID list
|
||||
this.clearIDListDownload()
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (channelParamObj[channel].type !== 'formula') {
|
||||
this.setSampleRateDownload({ channel: channel })
|
||||
this.setIDListDownload({ channel: channel, fileIndex: fileIndex })
|
||||
}
|
||||
}
|
||||
|
||||
// if create writer
|
||||
this.clearStreamDownload()
|
||||
this.setStreamDownload()
|
||||
|
||||
// set Header
|
||||
if (this.downloadInfo.format !== 'csv-edf') {
|
||||
await this.setHeaderExport()
|
||||
}
|
||||
await this.setTitleExport()
|
||||
|
||||
// start download data
|
||||
let rowIndex = 0
|
||||
let columnNum = 0
|
||||
|
||||
const requestArray = []
|
||||
console.time('download')
|
||||
console.log(this.downloadInfo)
|
||||
|
||||
while (rowIndex - 10 < this.downloadInfo.maxRows) {
|
||||
// console.log('rowIndex < this.downloadInfo.maxRows', rowIndex, this.downloadInfo.maxRows)
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
columnNum = Math.max(this.downloadInfo.channelInfo[channel].downloadIDList.length, columnNum)
|
||||
for (const idx in this.downloadInfo.channelInfo[channel].downloadIDList) {
|
||||
const _idx = parseInt(idx)
|
||||
if (this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] = []
|
||||
}
|
||||
// const rawID = this.downloadInfo.channelInfo[channel].downloadIDList[_idx][rowIndex]
|
||||
const rawIDList = this.downloadInfo.channelInfo[channel].downloadIDList[_idx].slice(rowIndex, rowIndex + 10)
|
||||
// console.log(channel, rawIDList)
|
||||
rawIDList.length > 0 && requestArray.push(api.raw.getAttrByIDs(channel, rawIDList, 'id-channel-size-serial_number-start_time-end_time-data'))
|
||||
if (rawIDList.length === 0) columnNum -= 1
|
||||
}
|
||||
}
|
||||
const responseArray = await Promise.all(requestArray)
|
||||
for (const responseIndex in responseArray) {
|
||||
const response = responseArray[responseIndex]
|
||||
// console.log('response', response)
|
||||
const idx = responseIndex % columnNum
|
||||
|
||||
for (const data of response.data) {
|
||||
const timeUnitScale = channelParamObj.time.unit[channelParamObj.time.downloadUnit]
|
||||
const channelUnitScale = channelParamObj[data.channel]?.unit[channelParamObj[data.channel]?.downloadUnit]
|
||||
// console.log('data', data)
|
||||
const dataArray = data.data.split('"***"').slice(0, -1)
|
||||
// console.log('dataArray', dataArray)
|
||||
for (const raw of dataArray) {
|
||||
const rawArray = raw.split(' ')
|
||||
const newArray = rawArray[0] === '' ? [] : rawArray.map((ele, index) => {
|
||||
// console.log((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale)))
|
||||
return (index % 2 === 0) ? String((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale))) : channelUnitScale ? String((ele / channelUnitScale)) : ele
|
||||
})
|
||||
this.downloadInfo.channelInfo[data.channel].downloadDataBuffer[idx].push(...newArray)
|
||||
// console.log('rawArray', rawArray)
|
||||
}
|
||||
}
|
||||
}
|
||||
requestArray.length = 0
|
||||
// console.log('this.downloadInfo.channelInfo', this.downloadInfo.channelInfo)
|
||||
// console.log('this.downloadInfo.maxRows', this.downloadInfo.maxRows)
|
||||
await this.setDataExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
rowIndex += 10
|
||||
}
|
||||
this.closeWriterDownload()
|
||||
fileIndex += 1
|
||||
}
|
||||
console.timeEnd('download')
|
||||
}
|
||||
}
|
||||
this.count += 1
|
||||
this.downloading = false
|
||||
this.$emit('download-finish')
|
||||
if (this.fileNums === 1) {
|
||||
this.showToast('Download Finish', {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
} else {
|
||||
this.showToast(`${this.count} / ${this.fileNums} Finish`, {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
...mapActions('download',
|
||||
[
|
||||
types.raw.rawDataByID,
|
||||
@@ -93,169 +269,13 @@ export default {
|
||||
async mounted () {
|
||||
await this.getControllerList()
|
||||
// TODO authorization
|
||||
const format = this.$route.params.format.split('-')[0]
|
||||
const allChannel = this.$route.params.format.split('-')[1]
|
||||
this.metaList = this.$route.params.metaList.split('-')
|
||||
const sd = this.$route.params.sd
|
||||
|
||||
while (this.metaList.length !== 0) {
|
||||
let meta
|
||||
const metaID = this.metaList.pop()
|
||||
const ret = await api.meta.getByID(metaID)
|
||||
|
||||
if (ret.status === 200) {
|
||||
meta = ret.data[0]
|
||||
}
|
||||
if (meta !== undefined) {
|
||||
this.metaInfo = meta
|
||||
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 = []
|
||||
|
||||
// split to different subfile by channel
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
if (channelArray.some(el => el >= 256)) {
|
||||
channelList.push(channelArray.filter(el => (el >= 256 && el <= 259)))
|
||||
channelList.push(channelArray.filter(el => el < 256))
|
||||
} else {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
|
||||
while (channelList.length > 0) {
|
||||
const channels = channelList.pop()
|
||||
|
||||
let maxSplitFiles = 1
|
||||
let fileIndex = 0
|
||||
|
||||
// find max raw data need sub file
|
||||
for (const rawDataIndex of channels) {
|
||||
const dataLength = meta.raw_data[rawDataIndex].length
|
||||
|
||||
maxSplitFiles = Math.max(maxSplitFiles, Math.ceil(meta.raw_data[rawDataIndex].length / dataLength))
|
||||
meta.raw_data[rawDataIndex] = this.chunkArray(meta.raw_data[rawDataIndex], dataLength)
|
||||
}
|
||||
|
||||
while (fileIndex < maxSplitFiles) {
|
||||
// create new download info & add channel
|
||||
if (this.downloadInfo === null) {
|
||||
this.downloadInfo = newDownload()
|
||||
}
|
||||
this.downloadInfo.channel = channels
|
||||
|
||||
// download format
|
||||
this.downloadInfo.format = format
|
||||
|
||||
// download device and filename
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 7), meta.device.library_name.slice(7)]
|
||||
if (this.downloadInfo.channel.some(el => el >= 256 && el <= 259)) {
|
||||
this.downloadInfo.filename = meta.name + '-accerlate'
|
||||
this.downloadInfo.filename += (sd !== undefined) ? '-sd' : ''
|
||||
this.downloadInfo.size = parseInt(parseInt(meta.size) / (76 * (maxSplitFiles)))
|
||||
} else {
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.filename += (sd !== undefined) ? '-sd' : ''
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 5), meta.device.library_name.slice(5)]
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
}
|
||||
|
||||
// create new channel info & get sample rate
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (this.downloadInfo.channelInfo[channel] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel] = newChannel()
|
||||
this.setSampleRateDownload({ channel: channel })
|
||||
}
|
||||
}
|
||||
|
||||
// set download ID list
|
||||
this.clearIDListDownload()
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
this.setIDListDownload({ channel: channel, fileIndex: fileIndex })
|
||||
}
|
||||
|
||||
// if create writer
|
||||
this.clearStreamDownload()
|
||||
this.setStreamDownload()
|
||||
|
||||
// set Header
|
||||
if (this.downloadInfo.format !== 'csv-edf') {
|
||||
await this.setHeaderExport()
|
||||
}
|
||||
await this.setTitleExport()
|
||||
|
||||
// start download data
|
||||
let rowIndex = 0
|
||||
let columnNum = 0
|
||||
|
||||
const requestArray = []
|
||||
console.time('download')
|
||||
// console.log(this.downloadInfo)
|
||||
|
||||
while (rowIndex - 10 < this.downloadInfo.maxRows) {
|
||||
// console.log('rowIndex < this.downloadInfo.maxRows', rowIndex, this.downloadInfo.maxRows)
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
columnNum = this.downloadInfo.channelInfo[channel].downloadIDList.length
|
||||
for (const idx in this.downloadInfo.channelInfo[channel].downloadIDList) {
|
||||
const _idx = parseInt(idx)
|
||||
if (this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] = []
|
||||
}
|
||||
// const rawID = this.downloadInfo.channelInfo[channel].downloadIDList[_idx][rowIndex]
|
||||
const rawIDList = this.downloadInfo.channelInfo[channel].downloadIDList[_idx].slice(rowIndex, rowIndex + 10)
|
||||
// console.log(channel, rawIDList)
|
||||
rawIDList.length > 0 && requestArray.push(api.raw.getAttrByIDs(channel, rawIDList, 'id-channel-size-serial_number-start_time-end_time-data'))
|
||||
if (rawIDList.length === 0) columnNum -= 1
|
||||
}
|
||||
}
|
||||
const responseArray = await Promise.all(requestArray)
|
||||
// console.log('responseArray', responseArray)
|
||||
for (const responseIndex in responseArray) {
|
||||
const response = responseArray[responseIndex]
|
||||
// console.log('response', response)
|
||||
const idx = responseIndex % columnNum
|
||||
|
||||
for (const data of response.data) {
|
||||
const timeUnitScale = channelParamObj.time.unit[channelParamObj.time.downloadUnit]
|
||||
const channelUnitScale = channelParamObj[data.channel]?.unit[channelParamObj[data.channel]?.downloadUnit]
|
||||
// console.log('data', data)
|
||||
const dataArray = data.data.split('"***"').slice(0, -1)
|
||||
// console.log('dataArray', dataArray)
|
||||
for (const raw of dataArray) {
|
||||
const rawArray = raw.split(' ')
|
||||
const newArray = rawArray[0] === '' ? [] : rawArray.map((ele, index) => {
|
||||
// console.log((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale)))
|
||||
return (index % 2 === 0) ? String((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale))) : channelUnitScale ? String((parseInt(ele) / channelUnitScale).toFixed(Math.log10(channelUnitScale))) : ele
|
||||
})
|
||||
this.downloadInfo.channelInfo[data.channel].downloadDataBuffer[idx].push(...newArray)
|
||||
// console.log('rawArray', rawArray)
|
||||
}
|
||||
}
|
||||
}
|
||||
requestArray.length = 0
|
||||
// console.log('this.downloadInfo.channelInfo', this.downloadInfo.channelInfo)
|
||||
// console.log('this.downloadInfo.maxRows', this.downloadInfo.maxRows)
|
||||
await this.setDataExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
rowIndex += 10
|
||||
}
|
||||
this.closeWriterDownload()
|
||||
fileIndex += 1
|
||||
}
|
||||
console.timeEnd('download')
|
||||
}
|
||||
}
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 2000)) // sleep 2s prevent window close
|
||||
window.close()
|
||||
// await new Promise(resolve => setTimeout(resolve, 2000)) // sleep 2s prevent window close
|
||||
// window.close()
|
||||
setInterval(this.writeFiles, 1000)
|
||||
},
|
||||
destroyed () {
|
||||
this.pageMqttUnSub()
|
||||
// this.pageMqttUnSub()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,18 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row flex sm12 xl12 md12 xs12" style="height: 100vh;">
|
||||
<div class="flex-center spinner-box mt-4 mb-5">
|
||||
<fulfilling-bouncing-circle-spinner
|
||||
:animation-duration="3000"
|
||||
:color="'#6c7fee'"
|
||||
:size="60"
|
||||
>
|
||||
</fulfilling-bouncing-circle-spinner>
|
||||
<progress-modal
|
||||
:ref="'progressModalRef'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<progress-modal
|
||||
:ref="'progressModalRef'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -20,7 +10,6 @@
|
||||
import api from '@/data/api/index'
|
||||
import types from '@/store/modules/download/types'
|
||||
import { mapActions, mapMutations } from 'vuex'
|
||||
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import newDownload from '@/factories/file/downloadFactory'
|
||||
import newChannel from '@/factories/file/channelFactory'
|
||||
@@ -31,12 +20,18 @@ import configTable from '@/data/config-table/index'
|
||||
export default {
|
||||
name: 'DownloadOffline',
|
||||
components: {
|
||||
FulfillingBouncingCircleSpinner,
|
||||
progressModal,
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
controllerList: [],
|
||||
downloadList: [],
|
||||
format: 'excel',
|
||||
channel: '',
|
||||
metaListNew: [],
|
||||
downloading: false,
|
||||
fileNums: 0,
|
||||
count: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -72,6 +67,170 @@ export default {
|
||||
}
|
||||
return results
|
||||
},
|
||||
writeFiles: async function () {
|
||||
if (this.metaListNew.length !== 0 && this.downloading === false) {
|
||||
let meta
|
||||
const metaID = this.metaListNew.pop()
|
||||
const ret = await api.meta.getByID(metaID)
|
||||
|
||||
if (ret.status === 200) {
|
||||
meta = ret.data[0]
|
||||
}
|
||||
if (meta !== undefined) {
|
||||
this.metaInfo = meta
|
||||
const channelParamObj = configTable.getModeConfig(meta.device.library_name, meta.parameter_set.MODE).channels
|
||||
const channelArray = this.channel === 'all' ? JSON.parse(this.metaInfo.channels) : Object.keys(channelParamObj).filter(ele => ele !== 'time')
|
||||
channelArray.filter(el => Object.keys(channelParamObj).includes(el))
|
||||
if (channelParamObj[channelArray[0]].order) {
|
||||
channelArray.sort((a, b) => channelParamObj[a].order - channelParamObj[b].order)
|
||||
}
|
||||
const channelList = []
|
||||
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
if (channelArray.some(el => el >= 256)) {
|
||||
channelList.push(channelArray.filter(el => (el >= 256 && el <= 259)))
|
||||
channelList.push(channelArray.filter(el => el < 256))
|
||||
} else {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0 || meta.device.library_name.indexOf('PEL') >= 0) {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
console.log(channelList)
|
||||
|
||||
this.$refs.progressModalRef.show()
|
||||
|
||||
while (channelList.length > 0) {
|
||||
const channels = channelList.pop()
|
||||
|
||||
let maxSplitFiles = 1
|
||||
let fileIndex = 0
|
||||
|
||||
// find max raw data need sub file
|
||||
for (const rawDataIndex of Object.keys(meta.raw_data)) {
|
||||
if (meta.raw_data[rawDataIndex] !== undefined) {
|
||||
let dataLength = 0
|
||||
if (rawDataIndex >= 256) {
|
||||
dataLength = meta.raw_data[rawDataIndex].length
|
||||
} else {
|
||||
dataLength = 10000
|
||||
}
|
||||
|
||||
maxSplitFiles = Math.max(maxSplitFiles, Math.ceil(meta.raw_data[rawDataIndex].length / dataLength))
|
||||
meta.raw_data[rawDataIndex] = this.chunkArray(meta.raw_data[rawDataIndex], dataLength)
|
||||
}
|
||||
}
|
||||
|
||||
while (fileIndex < maxSplitFiles) {
|
||||
if (this.downloadInfo === null) {
|
||||
this.downloadInfo = newDownload()
|
||||
}
|
||||
this.downloadInfo.channel = channels
|
||||
// download format
|
||||
this.downloadInfo.format = this.format
|
||||
|
||||
// download device and filename
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 7), meta.device.library_name.slice(7)]
|
||||
if (this.downloadInfo.channel.some(el => el >= 256 && el <= 259)) {
|
||||
this.downloadInfo.filename = meta.name + '-accerlate-' + this.format
|
||||
this.downloadInfo.size = parseInt(parseInt(meta.size) / 76)
|
||||
} else {
|
||||
this.downloadInfo.filename = meta.name + '-' + this.format
|
||||
this.downloadInfo.size = parseInt(meta.size)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 5), meta.device.library_name.slice(5)]
|
||||
this.downloadInfo.filename = meta.name + '-' + (fileIndex + 1).toString()
|
||||
this.downloadInfo.size = parseInt(meta.size)
|
||||
} else if (meta.device.library_name.indexOf('PEL') >= 0) {
|
||||
this.downloadInfo.device = ['Elite', 'PEL']
|
||||
this.downloadInfo.filename = meta.name
|
||||
this.downloadInfo.size = parseInt(meta.size / (maxSplitFiles))
|
||||
}
|
||||
|
||||
this.$refs.progressModalRef.setTitle(this.downloadInfo.filename)
|
||||
|
||||
// get sampleRate && downloadList
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (this.downloadInfo.channelInfo[channel] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel] = {
|
||||
...newChannel(),
|
||||
...channelParamObj[channel],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.clearIDListDownload()
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (channelParamObj[channel].type !== 'formula') {
|
||||
this.setSampleRateDownload({ channel: channel })
|
||||
this.setIDListDownload({ channel: channel, fileIndex: fileIndex })
|
||||
}
|
||||
}
|
||||
console.log(this.downloadInfo)
|
||||
|
||||
// start download data
|
||||
fileIndex += 1
|
||||
let rowIndex = 0
|
||||
let columnNum = 0
|
||||
|
||||
const requestArray = []
|
||||
console.time('download')
|
||||
|
||||
while (rowIndex - 10 < this.downloadInfo.maxRows) {
|
||||
this.$refs.progressModalRef.setValue(parseInt((rowIndex / this.downloadInfo.maxRows) * 100))
|
||||
// console.log('rowIndex < this.downloadInfo.maxRows', rowIndex, this.downloadInfo.maxRows)
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
columnNum = Math.max(this.downloadInfo.channelInfo[channel].downloadIDList.length, columnNum)
|
||||
for (const idx in this.downloadInfo.channelInfo[channel].downloadIDList) {
|
||||
const _idx = parseInt(idx)
|
||||
if (this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] = []
|
||||
}
|
||||
// const rawID = this.downloadInfo.channelInfo[channel].downloadIDList[_idx][rowIndex]
|
||||
const rawIDList = this.downloadInfo.channelInfo[channel].downloadIDList[_idx].slice(rowIndex, rowIndex + 10)
|
||||
// console.log(channel, rawIDList)
|
||||
rawIDList.length > 0 && requestArray.push(api.raw.getAttrByIDs(channel, rawIDList, 'id-channel-size-serial_number-start_time-end_time-data'))
|
||||
if (rawIDList.length === 0) columnNum -= 1
|
||||
}
|
||||
}
|
||||
const responseArray = await Promise.all(requestArray)
|
||||
// console.log('responseArray', responseArray)
|
||||
for (const responseIndex in responseArray) {
|
||||
const response = responseArray[responseIndex]
|
||||
// console.log('response', response)
|
||||
const idx = responseIndex % columnNum
|
||||
// console.log('response', response)
|
||||
for (const data of response.data) {
|
||||
const timeUnitScale = channelParamObj.time.unit[channelParamObj.time.downloadUnit]
|
||||
const channelUnitScale = channelParamObj[data.channel]?.unit[channelParamObj[data.channel]?.downloadUnit]
|
||||
// console.log('data', data)
|
||||
const dataArray = data.data.split('"***"').slice(0, -1)
|
||||
// console.log('dataArray', dataArray)
|
||||
for (const raw of dataArray) {
|
||||
const rawArray = raw.split(' ')
|
||||
const newArray = rawArray[0] === '' ? [] : rawArray.map((ele, index) => {
|
||||
return (index % 2 === 0) ? String((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale))) : channelUnitScale ? String((ele / channelUnitScale)) : ele
|
||||
})
|
||||
this.downloadInfo.channelInfo[data.channel].downloadDataBuffer[idx].push(...newArray)
|
||||
// console.log('rawArray', rawArray)
|
||||
}
|
||||
}
|
||||
}
|
||||
requestArray.length = 0
|
||||
// console.log('this.downloadInfo.channelInfo', this.downloadInfo.channelInfo)
|
||||
// console.log('this.downloadInfo.maxRows', this.downloadInfo.maxRows)
|
||||
// await this.setDataExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
rowIndex += 10
|
||||
}
|
||||
await this.setAllExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
this.$refs.progressModalRef.setValue(100)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
...mapActions('download',
|
||||
[
|
||||
types.raw.rawDataByID,
|
||||
@@ -97,161 +256,7 @@ export default {
|
||||
},
|
||||
async mounted () {
|
||||
await this.getControllerList()
|
||||
// TODO authorization
|
||||
const format = this.$route.params.format.split('-')[0]
|
||||
const allChannel = this.$route.params.format.split('-')[1]
|
||||
this.metaList = this.$route.params.metaList.split('-')
|
||||
const sd = this.$route.params.sd
|
||||
|
||||
while (this.metaList.length !== 0) {
|
||||
let meta
|
||||
const metaID = this.metaList.pop()
|
||||
const ret = await api.meta.getByID(metaID)
|
||||
|
||||
if (ret.status === 200) {
|
||||
meta = ret.data[0]
|
||||
}
|
||||
if (meta !== undefined) {
|
||||
this.metaInfo = meta
|
||||
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 = []
|
||||
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
if (channelArray.some(el => el >= 256)) {
|
||||
channelList.push(channelArray.filter(el => (el >= 256 && el <= 259)))
|
||||
channelList.push(channelArray.filter(el => el < 256))
|
||||
} else {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
channelList.push(channelArray)
|
||||
}
|
||||
|
||||
this.$refs.progressModalRef.show()
|
||||
|
||||
while (channelList.length > 0) {
|
||||
const channels = channelList.pop()
|
||||
|
||||
let maxSplitFiles = 1
|
||||
let fileIndex = 0
|
||||
|
||||
// find max raw data need sub file
|
||||
for (const rawDataIndex of Object.keys(meta.raw_data)) {
|
||||
let dataLength = 0
|
||||
if (rawDataIndex >= 256) {
|
||||
dataLength = meta.raw_data[rawDataIndex].length
|
||||
} else {
|
||||
dataLength = 10000
|
||||
}
|
||||
|
||||
maxSplitFiles = Math.max(maxSplitFiles, Math.ceil(meta.raw_data[rawDataIndex].length / dataLength))
|
||||
meta.raw_data[rawDataIndex] = this.chunkArray(meta.raw_data[rawDataIndex], dataLength)
|
||||
}
|
||||
|
||||
while (fileIndex < maxSplitFiles) {
|
||||
if (this.downloadInfo === null) {
|
||||
this.downloadInfo = newDownload()
|
||||
}
|
||||
this.downloadInfo.channel = channels
|
||||
// download format
|
||||
this.downloadInfo.format = format
|
||||
|
||||
// download device and filename
|
||||
if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 7), meta.device.library_name.slice(7)]
|
||||
if (this.downloadInfo.channel.some(el => el >= 256 && el <= 259)) {
|
||||
this.downloadInfo.filename = meta.name + '-accerlate-' + format
|
||||
this.downloadInfo.filename += (sd !== undefined) ? '-sd' : ''
|
||||
this.downloadInfo.size = parseInt(parseInt(meta.size) / 76)
|
||||
} else {
|
||||
this.downloadInfo.filename = meta.name + '-' + format
|
||||
this.downloadInfo.filename += (sd !== undefined) ? '-sd' : ''
|
||||
this.downloadInfo.size = parseInt(meta.size)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
this.downloadInfo.device = [meta.device.library_name.slice(0, 5), meta.device.library_name.slice(5)]
|
||||
this.downloadInfo.filename = meta.name + '-' + (fileIndex + 1).toString()
|
||||
this.downloadInfo.size = parseInt(meta.size)
|
||||
}
|
||||
|
||||
this.$refs.progressModalRef.setTitle(this.downloadInfo.filename)
|
||||
|
||||
// get sampleRate && downloadList
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
if (this.downloadInfo.channelInfo[channel] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel] = newChannel()
|
||||
this.setSampleRateDownload({ channel: channel })
|
||||
}
|
||||
}
|
||||
|
||||
this.clearIDListDownload()
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
this.setIDListDownload({ channel: channel, fileIndex: fileIndex })
|
||||
}
|
||||
|
||||
// start download data
|
||||
fileIndex += 1
|
||||
let rowIndex = 0
|
||||
let columnNum = 0
|
||||
|
||||
const requestArray = []
|
||||
console.time('download')
|
||||
|
||||
while (rowIndex - 10 < this.downloadInfo.maxRows) {
|
||||
this.$refs.progressModalRef.setValue(parseInt((rowIndex / this.downloadInfo.maxRows) * 100))
|
||||
// console.log('rowIndex < this.downloadInfo.maxRows', rowIndex, this.downloadInfo.maxRows)
|
||||
for (const channel of this.downloadInfo.channel) {
|
||||
columnNum = this.downloadInfo.channelInfo[channel].downloadIDList.length
|
||||
for (const idx in this.downloadInfo.channelInfo[channel].downloadIDList) {
|
||||
const _idx = parseInt(idx)
|
||||
if (this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] === undefined) {
|
||||
this.downloadInfo.channelInfo[channel].downloadDataBuffer[idx] = []
|
||||
}
|
||||
// const rawID = this.downloadInfo.channelInfo[channel].downloadIDList[_idx][rowIndex]
|
||||
const rawIDList = this.downloadInfo.channelInfo[channel].downloadIDList[_idx].slice(rowIndex, rowIndex + 10)
|
||||
// console.log(channel, rawIDList)
|
||||
rawIDList.length > 0 && requestArray.push(api.raw.getAttrByIDs(channel, rawIDList, 'id-channel-size-serial_number-start_time-end_time-data'))
|
||||
if (rawIDList.length === 0) columnNum -= 1
|
||||
}
|
||||
}
|
||||
const responseArray = await Promise.all(requestArray)
|
||||
// console.log('responseArray', responseArray)
|
||||
for (const responseIndex in responseArray) {
|
||||
const response = responseArray[responseIndex]
|
||||
// console.log('response', response)
|
||||
const idx = responseIndex % columnNum
|
||||
// console.log('response', response)
|
||||
for (const data of response.data) {
|
||||
const timeUnitScale = channelParamObj.time.unit[channelParamObj.time.downloadUnit]
|
||||
const channelUnitScale = channelParamObj[data.channel]?.unit[channelParamObj[data.channel]?.downloadUnit]
|
||||
// console.log('data', data)
|
||||
const dataArray = data.data.split('"***"').slice(0, -1)
|
||||
// console.log('dataArray', dataArray)
|
||||
for (const raw of dataArray) {
|
||||
const rawArray = raw.split(' ')
|
||||
const newArray = rawArray[0] === '' ? [] : rawArray.map((ele, index) => {
|
||||
return (index % 2 === 0) ? String((parseInt(ele) / timeUnitScale).toFixed(Math.log10(timeUnitScale))) : channelUnitScale ? String((parseInt(ele) / channelUnitScale).toFixed(Math.log10(channelUnitScale))) : ele
|
||||
})
|
||||
this.downloadInfo.channelInfo[data.channel].downloadDataBuffer[idx].push(...newArray)
|
||||
// console.log('rawArray', rawArray)
|
||||
}
|
||||
}
|
||||
}
|
||||
requestArray.length = 0
|
||||
// console.log('this.downloadInfo.channelInfo', this.downloadInfo.channelInfo)
|
||||
// console.log('this.downloadInfo.maxRows', this.downloadInfo.maxRows)
|
||||
// await this.setDataExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
rowIndex += 10
|
||||
}
|
||||
await this.setAllExport({ last: (rowIndex >= this.downloadInfo.maxRows - 1) })
|
||||
this.$refs.progressModalRef.setValue(100)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 2000)) // sleep
|
||||
window.close()
|
||||
setInterval(this.writeFiles, 1000)
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<div class="file-list">
|
||||
<div class="file-list" @mousedown="unSelectAll">
|
||||
<!-- Move Folder Modal -->
|
||||
<download ref="download_ref"></download>
|
||||
<download-offline ref="download_offline_ref"></download-offline>
|
||||
<folder-modal ref="folder_modal_ref" @refreshPage="refreshPage"></folder-modal>
|
||||
<!-- Create Folder Modal -->
|
||||
<va-modal
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="showModal.createFolder"
|
||||
@@ -20,7 +25,7 @@
|
||||
removable
|
||||
/>
|
||||
</va-modal>
|
||||
|
||||
<!-- Edit File Modal -->
|
||||
<va-modal
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="showModal.editFile"
|
||||
@@ -48,6 +53,7 @@
|
||||
removable
|
||||
/>
|
||||
</va-modal>
|
||||
<!-- Delete File Modal-->
|
||||
<va-modal
|
||||
v-model="showModal.deleteFile"
|
||||
size="small"
|
||||
@@ -64,6 +70,7 @@
|
||||
<p>Delete File {{ deleteInfo.name }} ? <input type="text" :ref="'delete_input'" style="opacity: 0; line-height: 0;"/></p>
|
||||
</va-modal>
|
||||
|
||||
<!-- Delete MultiFiles Modal -->
|
||||
<va-modal
|
||||
v-model="showModal.deleteMultiFiles"
|
||||
size="small"
|
||||
@@ -81,17 +88,6 @@
|
||||
</va-modal>
|
||||
|
||||
<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>
|
||||
DOWNLOAD
|
||||
</va-button>
|
||||
<va-button class="" color="danger" v-if="selected.length" @click="deleteMultiFilesConfirm" target="_blank" small>
|
||||
DELETE
|
||||
</va-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- SearchField & perPageSelect-->
|
||||
<div class="row align--center">
|
||||
<div class="flex xs12 md6">
|
||||
@@ -116,32 +112,46 @@
|
||||
</div>
|
||||
|
||||
<!-- CreateFolder & FilePath -->
|
||||
<div class="flex mb-4">
|
||||
<va-icon
|
||||
name="fa fa-plus"
|
||||
size="1rem"
|
||||
class="mr-2"
|
||||
style="cursor: pointer;"
|
||||
:color="'primary'"
|
||||
@click.native="createFolderConfirm"
|
||||
/>
|
||||
<va-icon
|
||||
name="fa fa-folder-open"
|
||||
size="0.9rem"
|
||||
class="mr-2"
|
||||
style="cursor: pointer;"
|
||||
:color="(currentPathIndex === -1)?'primary':'dark'"
|
||||
@click.native="openHome"
|
||||
/>
|
||||
<span
|
||||
class="mt-0 mb-0 mr-2"
|
||||
v-for="(item, index) in pathLists" :key="index"
|
||||
:style="{ color:(currentPathIndex === index)?'#6c7fee':'#34495e', cursor:'pointer'}"
|
||||
@click="openPath(item,index)"
|
||||
>
|
||||
<span class="mr-1" style="color: #34495e; cursor: default;">/</span>
|
||||
{{ item.name }}
|
||||
</span>
|
||||
<div class="row">
|
||||
<div class="flex d-flex xl8 lg8 sm8 xs8" style="align-items: center;">
|
||||
<div>
|
||||
<va-icon
|
||||
name="fa fa-plus"
|
||||
size="1rem"
|
||||
class="mr-2"
|
||||
style="cursor: pointer;"
|
||||
:color="'primary'"
|
||||
@click.native="createFolderConfirm"
|
||||
/>
|
||||
<va-icon
|
||||
name="fa fa-folder-open"
|
||||
size="0.9rem"
|
||||
class="mr-2"
|
||||
style="cursor: pointer;"
|
||||
:color="(currentPathIndex === -1)?'primary':'dark'"
|
||||
/>
|
||||
<span
|
||||
class="mt-0 mb-0 mr-2"
|
||||
v-for="(item, index) in pathLists" :key="index"
|
||||
:style="{ color:(currentPathIndex === index)?'#6c7fee':'#34495e', cursor:'pointer'}"
|
||||
@click="openPath(item,index)"
|
||||
>
|
||||
<span class="mr-1" style="color: #34495e; cursor: default;">/</span>
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex xl4 lg4 sm4 xs4" style="text-align: end;">
|
||||
<va-button class="" color="primary" @mousedown.stop="showFolderModal" target="_blank" small>
|
||||
MOVE
|
||||
</va-button>
|
||||
<va-button class="" color="success" @mousedown.stop="downloadSelected" target="_blank" small>
|
||||
DOWNLOAD
|
||||
</va-button>
|
||||
<va-button class="" color="danger" @mousedown.stop="deleteMultiFilesConfirm" target="_blank" small>
|
||||
DELETE
|
||||
</va-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- FileListTable -->
|
||||
@@ -160,14 +170,16 @@
|
||||
:fields="fields"
|
||||
:data="filteredData"
|
||||
:per-page="parseInt(perPage)"
|
||||
@row-clicked="openFile"
|
||||
@row-clicked="clickRow"
|
||||
@mouseup.native="mouseUp"
|
||||
@mousedown.native.stop="mouseDown"
|
||||
hoverable
|
||||
clickable
|
||||
v-else
|
||||
:ref="'datatable_ref'"
|
||||
v-else
|
||||
>
|
||||
<template slot="select" slot-scope="props">
|
||||
<va-checkbox :value="props.rowData.checked" @input="select(props.rowData)"/>
|
||||
<va-checkbox :value="props.rowData.checked"/>
|
||||
</template>
|
||||
<template slot="name" slot-scope="props">
|
||||
<va-icon
|
||||
@@ -195,7 +207,7 @@
|
||||
{{transDeviceInfo(props.rowData.device)}}
|
||||
</template>
|
||||
<template slot="actions" slot-scope="props" >
|
||||
<va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
|
||||
<!-- <va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
|
||||
<sd-card-button
|
||||
v-if="(props.rowData.type !== 'folder') && (props.rowData.device.library_name.indexOf('Neulive') >= 0) && (props.rowData.sd_data_record === true)"
|
||||
:meta="props.rowData"
|
||||
@@ -204,26 +216,29 @@
|
||||
@refreshPage="refreshPage"
|
||||
@downloadSdCard="downloadSdCard"
|
||||
/>
|
||||
</va-popover>
|
||||
<va-popover :message="`download ${props.rowData.name} in csv format`" placement="top">
|
||||
</va-popover> -->
|
||||
<va-popover :message="`Download csv`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" @click.stop="downloadCsv(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`download ${props.rowData.name} in excel format`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Elite') >= 0" @click.stop="downloadExcel(props.rowData)"/>
|
||||
<va-popover :message="`Download excel`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Elite') >= 0" @click.stop="newDownload(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`download ${props.rowData.name} in csv-edf format`" placement="top">
|
||||
<va-popover :message="`Download excel`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('PEL') >= 0" @click.stop="newDownload(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`Download edf`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-download" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" @click.stop="downloadExcel(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`replay ${props.rowData.name}`" placement="top">
|
||||
<va-popover :message="`Replay`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-eye" v-if="props.rowData.type !== 'folder'" @click.stop="replay(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`spike ${props.rowData.name}`" placement="top">
|
||||
<va-popover :message="`Spike`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-filter" v-if="props.rowData.type !== 'folder' && props.rowData.device.library_name.indexOf('Neulive') >= 0" @click.stop="spike(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`edit ${props.rowData.name}`" placement="top">
|
||||
<va-popover :message="`Edit`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-pencil" @click.stop="editFileConfirm(props.rowData)"/>
|
||||
</va-popover>
|
||||
<va-popover :message="`delete ${props.rowData.name}`" placement="top">
|
||||
<va-popover :message="`Delete`" placement="top">
|
||||
<va-button flat small color="gray" icon="fa fa-trash" @click.stop="deleteFileConfirm(props.rowData)"/>
|
||||
</va-popover>
|
||||
</template>
|
||||
@@ -237,19 +252,25 @@ import { debounce } from 'lodash'
|
||||
import { file } from '../../../data/file/File'
|
||||
import { FulfillingBouncingCircleSpinner } from 'epic-spinners'
|
||||
import api from '../../../data/api/index'
|
||||
import SdCardButton from '../sdcard/SdCardButton.vue'
|
||||
// import SdCardButton from '../sdcard/SdCardButton.vue'
|
||||
import configTable from '@/data/config-table/index.js'
|
||||
import FolderModal from './FolderModal.vue'
|
||||
import Download from '../../download/Download.vue'
|
||||
import DownloadOffline from '../../download/DownloadOffline.vue'
|
||||
|
||||
export default {
|
||||
name: 'FileTable',
|
||||
components: {
|
||||
FulfillingBouncingCircleSpinner,
|
||||
SdCardButton,
|
||||
// SdCardButton,
|
||||
FolderModal,
|
||||
Download,
|
||||
DownloadOffline,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
term: null,
|
||||
perPage: '80',
|
||||
perPage: '40',
|
||||
perPageOptions: ['20', '40', '80', '160'],
|
||||
|
||||
fileLists: [],
|
||||
@@ -296,6 +317,18 @@ export default {
|
||||
},
|
||||
SDuuidList: [],
|
||||
controllerList: [],
|
||||
|
||||
// mouse click times
|
||||
clickCounter: 0,
|
||||
// record the selected index
|
||||
clickRecord: [],
|
||||
// record the target
|
||||
clickTarget: null,
|
||||
// mouseup or not
|
||||
clickStatus: false,
|
||||
// record shift+click target
|
||||
shiftIndexRecord: null,
|
||||
downloadIDList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -372,6 +405,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
selectedNumber () {
|
||||
return this.fileLists.filter(file => file.checked).length
|
||||
},
|
||||
selected () {
|
||||
return this.fileLists.filter(file => file.checked)
|
||||
},
|
||||
@@ -380,20 +416,28 @@ export default {
|
||||
mqttPub: function (topic, mes) {
|
||||
this.$mqtt.publish(topic, mes)
|
||||
},
|
||||
// stopEvent: function (e) {
|
||||
// console.log(e)
|
||||
// e.stopPropagation()
|
||||
// },
|
||||
select: function (file) {
|
||||
event.stopPropagation()
|
||||
const idx = this.fileLists.findIndex(f => f.id === file.id)
|
||||
showFolderModal: async function () {
|
||||
this.$refs.folder_modal_ref.selected = this.selected
|
||||
await this.$refs.folder_modal_ref.refreshCollection()
|
||||
this.$refs.folder_modal_ref.showModal = true
|
||||
},
|
||||
unSelectAll: function () {
|
||||
this.fileLists.forEach(element => {
|
||||
element.checked = false
|
||||
})
|
||||
},
|
||||
selectConcat: function (idx) {
|
||||
this.fileLists[idx].checked = !this.fileLists[idx].checked
|
||||
},
|
||||
select: function (idx) {
|
||||
this.unSelectAll()
|
||||
this.fileLists[idx].checked = true
|
||||
},
|
||||
search: debounce(function (term) {
|
||||
this.term = term
|
||||
}, 400),
|
||||
transFileSize: function (fileSize) {
|
||||
if (fileSize === undefined) {
|
||||
if (fileSize === undefined || fileSize === -1) {
|
||||
return '--'
|
||||
} else {
|
||||
return this.GLOBAL.transFileSize(fileSize)
|
||||
@@ -416,7 +460,98 @@ export default {
|
||||
return device.device_name + '\n' + this.GLOBAL.transMac(device.device_address)
|
||||
}
|
||||
},
|
||||
clickRow: async function (rowData) {
|
||||
this.clickCounter += 1
|
||||
setTimeout(() => { this.clickCounter = 0 }, 500)
|
||||
if (window.getSelection().toString() !== '' && this.clickEvent.shiftKey === false && this.clickCounter !== 2) return true
|
||||
window.getSelection().removeAllRanges()
|
||||
// click target id
|
||||
const idx = this.fileLists.findIndex(f => f.id === rowData.id)
|
||||
setTimeout(async () => {
|
||||
let timeOutTimer
|
||||
// single click
|
||||
if (this.clickCounter === 1) {
|
||||
// meta key or ctrl key
|
||||
if (this.clickEvent.metaKey === true || this.clickEvent.ctrlKey === true) {
|
||||
this.selectConcat(idx)
|
||||
if (this.clickRecord.includes(idx) === false) {
|
||||
this.clickRecord.push(idx)
|
||||
}
|
||||
this.shiftIndexRecord = null
|
||||
} else if (this.clickEvent.shiftKey === true) {
|
||||
// shift key
|
||||
const start = this.clickRecord[this.clickRecord.length - 1]
|
||||
const end = idx
|
||||
// if has shift event has trigger before then reset the checked
|
||||
if (this.shiftIndexRecord !== null) {
|
||||
if (start > this.shiftIndexRecord) {
|
||||
for (let i = start; i >= this.shiftIndexRecord; i--) {
|
||||
this.fileLists[i].checked = false
|
||||
}
|
||||
}
|
||||
if (start < this.shiftIndexRecord) {
|
||||
for (let i = start; i <= this.shiftIndexRecord; i++) {
|
||||
this.fileLists[i].checked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (start > end) {
|
||||
for (let i = start; i >= end; i--) {
|
||||
this.fileLists[i].checked = true
|
||||
}
|
||||
}
|
||||
if (start < end) {
|
||||
for (let i = start; i <= end; i++) {
|
||||
this.fileLists[i].checked = true
|
||||
}
|
||||
}
|
||||
this.shiftIndexRecord = idx
|
||||
} else {
|
||||
// without any hotKey
|
||||
this.shiftIndexRecord = null
|
||||
this.clickRecord.length = 0
|
||||
this.selectConcat(idx)
|
||||
if (this.clickRecord.includes(idx) === false) {
|
||||
this.clickRecord.push(idx)
|
||||
}
|
||||
}
|
||||
timeOutTimer = setTimeout(() => {
|
||||
this.clickCounter = 0
|
||||
}, 300)
|
||||
} else if (this.clickCounter === 2) {
|
||||
clearTimeout(timeOutTimer)
|
||||
this.clickCounter = 0
|
||||
await this.openFile(rowData)
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
mouseDown: async function (e) {
|
||||
this.clickEvent = e
|
||||
this.clickStatus = true
|
||||
},
|
||||
mouseUp: function () {
|
||||
this.clickStatus = false
|
||||
},
|
||||
mouseMove: async function (e, rowData) {
|
||||
const idx = this.fileLists.findIndex(f => f.id === rowData.id)
|
||||
if (e.metaKey === true || e.ctrlKey === true) {
|
||||
if (this.clickStatus === true) {
|
||||
const indexOfRecord = this.clickRecord.indexOf(idx)
|
||||
// if (indexOfRecord === this.clickRecord.length - 1) return
|
||||
// console.log('indexOfRecord', indexOfRecord)
|
||||
if (indexOfRecord !== -1) {
|
||||
console.log(idx, 'false')
|
||||
this.clickRecord.splice(indexOfRecord, 1)
|
||||
this.fileLists[idx].checked = false
|
||||
} else {
|
||||
console.log(idx, 'true')
|
||||
this.clickRecord.push(idx)
|
||||
this.fileLists[idx].checked = true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
openFile: async function (info) {
|
||||
if (info.type === 'folder') {
|
||||
this.currentInfo = info
|
||||
@@ -529,56 +664,67 @@ export default {
|
||||
}, 100)
|
||||
},
|
||||
editFile: async function () {
|
||||
// TODO editFile
|
||||
if (this.editInfo.type !== 'folder') {
|
||||
await api.meta.update(this.editInfo.info.id, { name: this.editInfo.changedName })
|
||||
} else {
|
||||
}
|
||||
await this.editFileDone()
|
||||
},
|
||||
checkFileNameValidate: debounce(function (term) {
|
||||
const illegalChar = term.match(/[^(\w\-)]+/gm)
|
||||
this.editInfo.changedName = term
|
||||
if (term.length === 0) {
|
||||
// input text empty
|
||||
this.editInfo.error = true
|
||||
this.editInfo.success = false
|
||||
this.editInfo.errorMessages.pop()
|
||||
this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[1])
|
||||
} else if (illegalChar !== null) {
|
||||
// input text illegal
|
||||
this.editInfo.error = true
|
||||
this.editInfo.success = false
|
||||
this.editInfo.errorMessages.pop()
|
||||
this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[0] + ' ' + illegalChar[0])
|
||||
} else {
|
||||
const existedFile = this.fileLists.filter((file) => {
|
||||
if (file.name != null) {
|
||||
return file.name.replace('/', '') === term
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (existedFile.length === 0) {
|
||||
this.editInfo.error = false
|
||||
this.editInfo.success = true
|
||||
} else {
|
||||
// file name exist
|
||||
this.editInfo.error = true
|
||||
this.editInfo.success = false
|
||||
this.editInfo.errorMessages.pop()
|
||||
this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[2])
|
||||
}
|
||||
}
|
||||
}, 200),
|
||||
editFileDone: async function () {
|
||||
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
await this.refreshPage()
|
||||
this.$refs.datatable_ref.currentPage = tmpCurrentPage
|
||||
this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
this.showToast(`${this.editInfo.info.name} -> ${this.editInfo.changedName}`, {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
// TODO editFile
|
||||
if (this.editInfo.info.type === 'folder') {
|
||||
await api.collection.update(this.editInfo.info.id, { name: this.editInfo.changedName })
|
||||
const folder = this.fileLists.find((file) => {
|
||||
if (file.type === 'folder' && this.editInfo.info.id === file.id) return true
|
||||
})
|
||||
folder.name = this.editInfo.changedName
|
||||
} else {
|
||||
await api.meta.update(this.editInfo.info.id, { name: this.editInfo.changedName })
|
||||
const meta = this.fileLists.find((file) => {
|
||||
if (file.type === undefined && this.editInfo.info.id === file.id) return true
|
||||
})
|
||||
meta.name = this.editInfo.changedName
|
||||
}
|
||||
// await this.editFileDone()
|
||||
},
|
||||
checkFileNameValidate: debounce(function (term) {
|
||||
// const illegalChar = term.match(/[^(\w\-)]+/gm)
|
||||
this.editInfo.changedName = term
|
||||
// if (term.length === 0) {
|
||||
// // input text empty
|
||||
// this.editInfo.error = true
|
||||
// this.editInfo.success = false
|
||||
// this.editInfo.errorMessages.pop()
|
||||
// this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[1])
|
||||
// } else if (illegalChar !== null) {
|
||||
// // input text illegal
|
||||
// this.editInfo.error = true
|
||||
// this.editInfo.success = false
|
||||
// this.editInfo.errorMessages.pop()
|
||||
// this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[0] + ' ' + illegalChar[0])
|
||||
// } else {
|
||||
// const existedFile = this.fileLists.filter((file) => {
|
||||
// if (file.name != null) {
|
||||
// return file.name.replace('/', '') === term
|
||||
// } else {
|
||||
// return false
|
||||
// }
|
||||
// })
|
||||
// if (existedFile.length === 0) {
|
||||
// this.editInfo.error = false
|
||||
// this.editInfo.success = true
|
||||
// } else {
|
||||
// // file name exist
|
||||
// this.editInfo.error = true
|
||||
// this.editInfo.success = false
|
||||
// this.editInfo.errorMessages.pop()
|
||||
// this.editInfo.errorMessages.push(this.editInfo.errorMessagesAll[2])
|
||||
// }
|
||||
// }
|
||||
}, 200),
|
||||
editFileDone: async function () {
|
||||
// const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
// await this.refreshPage()
|
||||
// if (this.$refs.datatable_ref) {
|
||||
// this.$refs.datatable_ref.currentPage = tmpCurrentPage
|
||||
// this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
// }
|
||||
},
|
||||
undoEdit: function () {
|
||||
this.editInfo.success = false
|
||||
@@ -602,10 +748,19 @@ export default {
|
||||
},
|
||||
deleteFolder: async function (id) {
|
||||
await api.collection.update(id, { deleted: true })
|
||||
const childrenCollection = await api.collection.getByParent('folder', id)
|
||||
const childrenMeta = await api.meta.getByParent('folder', id)
|
||||
for (const collection of childrenCollection.data) {
|
||||
await this.deleteFolder(collection.id)
|
||||
}
|
||||
for (const meta of childrenMeta.data) {
|
||||
await this.deleteSingleFileByDeleteInfo(meta.id)
|
||||
}
|
||||
await api.collection.clearDel()
|
||||
},
|
||||
deleteSingleFileByDeleteInfo: async function () {
|
||||
await api.meta.update(this.deleteInfo.metaID, { deleted: true })
|
||||
deleteSingleFileByDeleteInfo: async function (metaID) {
|
||||
if (metaID === undefined) metaID = this.deleteInfo.metaID
|
||||
await api.meta.update(metaID, { deleted: true })
|
||||
await api.meta.clearDel()
|
||||
},
|
||||
deleteFileConfirm: function (info) {
|
||||
@@ -629,9 +784,19 @@ export default {
|
||||
deleteFileDone: async function () {
|
||||
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
// rebuild table
|
||||
this.fileLists = this.fileLists.filter(file => {
|
||||
return file.id !== this.deleteInfo.metaID
|
||||
})
|
||||
if (this.deleteInfo.metaID) {
|
||||
this.fileLists = this.fileLists.filter(file => {
|
||||
return file.id !== this.deleteInfo.metaID
|
||||
})
|
||||
}
|
||||
if (this.deleteInfo.folderID) {
|
||||
this.fileLists = this.fileLists.filter(file => {
|
||||
if (file.type === 'folder') {
|
||||
return file.id !== this.deleteInfo.folderID
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
// await this.refreshPage()
|
||||
await this.$refs.datatable_ref.inputPage(1)
|
||||
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
@@ -651,7 +816,7 @@ export default {
|
||||
this.showToast('deleting file...', {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
this.deleteSelected()
|
||||
await this.deleteSelected()
|
||||
},
|
||||
inputFieldReset: function (info) {
|
||||
info.name = ''
|
||||
@@ -689,23 +854,66 @@ 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.downloadExcel(meta)
|
||||
getAllChildrenByParent: async function (collection) {
|
||||
const childrenCollection = await api.collection.getByParent('folder', collection)
|
||||
const childrenMeta = await api.meta.getByParent('folder', collection)
|
||||
for (const collection of childrenCollection.data) {
|
||||
await this.getAllChildrenByParent(collection.id)
|
||||
}
|
||||
for (const meta of childrenMeta.data) {
|
||||
this.downloadIDList.push(meta.id)
|
||||
}
|
||||
},
|
||||
async deleteSelected () {
|
||||
downloadSelected: async function () {
|
||||
this.downloadIDList.length = 0
|
||||
const meta = this.selected
|
||||
if (Array.isArray(meta) === true) {
|
||||
for (const ele of meta) {
|
||||
if (ele.type === 'folder') {
|
||||
await this.getAllChildrenByParent(ele.id)
|
||||
} else {
|
||||
this.downloadIDList.push(ele.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
const connectCheck = await api.connection.check()
|
||||
if (connectCheck.status === 200) {
|
||||
this.$refs.download_ref.count = 0
|
||||
this.$refs.download_ref.fileNums = this.downloadIDList.length
|
||||
this.$refs.download_ref.metaListNew.push(...this.downloadIDList)
|
||||
} else {
|
||||
this.$refs.download_offline_ref.count = 0
|
||||
this.$refs.download_offline_ref.fileNums = this.downloadIDList.length
|
||||
this.$refs.download_offline_ref.metaListNew.push(...this.downloadIDList)
|
||||
}
|
||||
},
|
||||
newDownload: async function (data) {
|
||||
const connectCheck = await api.connection.check()
|
||||
if (connectCheck.status === 200) {
|
||||
this.$refs.download_ref.fileNums = 1
|
||||
this.$refs.download_ref.metaListNew.push(data.id)
|
||||
} else {
|
||||
this.$refs.download_offline_ref.fileNums = 1
|
||||
this.$refs.download_offline_ref.metaListNew.push(data.id)
|
||||
}
|
||||
},
|
||||
deleteSelected: async function () {
|
||||
for (let i = 0; i < this.selected.length; i++) {
|
||||
const meta = this.selected[i]
|
||||
this.fillDeleteInfo(meta)
|
||||
await this.deleteSingleFileByDeleteInfo()
|
||||
if (this.deleteInfo.metaID === undefined) {
|
||||
await this.deleteFolder(this.deleteInfo.folderID)
|
||||
} else {
|
||||
await this.deleteSingleFileByDeleteInfo()
|
||||
}
|
||||
this.showToast(`deleted ${this.deleteInfo.name}`, {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
}
|
||||
const tmpCurrentPage = this.$refs.datatable_ref.currentPage
|
||||
await this.refreshPage()
|
||||
// filter the checked files
|
||||
this.fileLists = this.fileLists.filter((file) => { return file.checked === false })
|
||||
await this.$refs.datatable_ref.inputPage(1)
|
||||
await this.$refs.datatable_ref.inputPage(tmpCurrentPage)
|
||||
},
|
||||
downloadCsv: async function (meta) {
|
||||
@@ -718,20 +926,26 @@ export default {
|
||||
}
|
||||
},
|
||||
downloadExcel: async function (meta) {
|
||||
this.downloadIDList.length = 0
|
||||
const href = location.href.split('/')[2]
|
||||
const connectCheck = await api.connection.check()
|
||||
if (meta.device.library_name.indexOf('Elite') >= 0) {
|
||||
if (connectCheck.status === 200) {
|
||||
window.open('http://' + href + '/#/download/online/excel/' + meta.id)
|
||||
} else {
|
||||
window.open('http://' + href + '/#/download/offline/excel/' + meta.id)
|
||||
}
|
||||
} else if (meta.device.library_name.indexOf('Neulive') >= 0) {
|
||||
if (connectCheck.status === 200) {
|
||||
window.open('http://' + href + '/#/download/online/csv-edf/' + meta.id)
|
||||
} else {
|
||||
window.open('http://' + href + '/#/download/offline/csv-edf/' + meta.id)
|
||||
let metaID = ''
|
||||
if (Array.isArray(meta) === true) {
|
||||
for (const ele of meta) {
|
||||
if (ele.type === 'folder') {
|
||||
await this.getAllChildrenByParent(ele.id)
|
||||
} else {
|
||||
this.downloadIDList.push(ele.id)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.downloadIDList.push(meta.id)
|
||||
}
|
||||
metaID = this.downloadIDList.join('-')
|
||||
if (connectCheck.status === 200) {
|
||||
window.open('http://' + href + '/#/download/online/excel/' + metaID)
|
||||
} else {
|
||||
window.open('http://' + href + '/#/download/offline/excel/' + metaID)
|
||||
}
|
||||
},
|
||||
downloadSdCard: async function (meta) {
|
||||
@@ -792,8 +1006,16 @@ export default {
|
||||
const controllerList = await api.controller.getAll()
|
||||
this.controllerList = controllerList.data
|
||||
this.getSDuuidList()
|
||||
window.addEventListener('keypress', (e) => {
|
||||
this.keyboardEvent = e
|
||||
})
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.text-not-select {
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<va-modal
|
||||
class="flex sm12 xl12 md12 xs12"
|
||||
v-model="showModal"
|
||||
size="small"
|
||||
:title="'MOVE'"
|
||||
:okText=" $t('modal.confirm') "
|
||||
@ok="moveFolder()"
|
||||
@cancel="cancel()"
|
||||
>
|
||||
<div class="row flex sm12 xl12 md12 xs12">
|
||||
<va-select
|
||||
v-model="destination"
|
||||
:options="option"
|
||||
class="va-select-without-margin"
|
||||
searchable
|
||||
/>
|
||||
</div>
|
||||
</va-modal>
|
||||
</template>
|
||||
<script>
|
||||
import api from '@/data/api/index'
|
||||
|
||||
export default {
|
||||
name: 'aaa',
|
||||
data: () => {
|
||||
return {
|
||||
showModal: false,
|
||||
option: [],
|
||||
destination: '',
|
||||
selected: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel: function () {
|
||||
this.destination = ''
|
||||
this.selected = []
|
||||
},
|
||||
refreshCollection: async function () {
|
||||
await this.getAllCollection()
|
||||
},
|
||||
moveFolder: async function () {
|
||||
for (const e of this.selected) {
|
||||
if (e.type === 'folder') {
|
||||
await api.collection.update(e.id, {
|
||||
parent: {
|
||||
folder: [this.destination.id],
|
||||
},
|
||||
})
|
||||
}
|
||||
if (e.type === undefined) {
|
||||
await api.meta.update(e.id, {
|
||||
parent: {
|
||||
folder: [this.destination.id],
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
this.cancel()
|
||||
this.$emit('refreshPage')
|
||||
},
|
||||
getAllCollection: async function () {
|
||||
// get all collections by api
|
||||
const collectionResponse = await api.collection.getAll()
|
||||
// filter the root folder & select folder itself
|
||||
const allCollection = collectionResponse.data.filter((ele) => {
|
||||
return ele.name !== 'root' && this.selected.findIndex(v => v.id === ele.id && v.type === 'folder') === -1
|
||||
})
|
||||
// create a new list of collection contain text for display
|
||||
const newCollection = allCollection.map((ele) => {
|
||||
let parentName = ''
|
||||
// if has parent
|
||||
if (Object.keys(ele.parent).length > 0) {
|
||||
// get parent name
|
||||
for (const id of ele.parent.folder) {
|
||||
const parent = allCollection.find((v) => {
|
||||
return v.id === id
|
||||
})
|
||||
if (parent) {
|
||||
parentName = parent.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if parent name is admin then the name is remain origin
|
||||
if (ele.name === 'admin' || parentName === 'admin') {
|
||||
ele.text = ele.name
|
||||
} else {
|
||||
// if not the name contain it's parent
|
||||
ele.text = parentName + ' / ' + ele.name
|
||||
}
|
||||
return ele
|
||||
})
|
||||
this.option = newCollection
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
@@ -15,6 +15,7 @@
|
||||
:mask-color="'rgba(0, 0, 0, 0)'"
|
||||
:visible.sync="taskViewPanel.show"
|
||||
:title="(taskViewPanel.type === 1) ? 'Device' : (taskViewPanel.type === 3) ? 'Condition' : (taskViewPanel.type === 4) ? 'Parameter' : ''"
|
||||
@closed="onClosing"
|
||||
resizable
|
||||
>
|
||||
<project-task/>
|
||||
@@ -100,6 +101,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClosing: async function () {
|
||||
await this.saveProject(this.getSelectProject)
|
||||
},
|
||||
pageToast: function (mes) {
|
||||
this.showToast(
|
||||
mes,
|
||||
@@ -163,14 +167,6 @@ export default {
|
||||
},
|
||||
saveProject: async function (project) {
|
||||
this.updateProject({ project: project, api: this.API })
|
||||
this.showToast(
|
||||
'project update finish',
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 5000,
|
||||
},
|
||||
)
|
||||
},
|
||||
detect: async function (device) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
|
||||
@@ -40,13 +40,20 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
configList () {
|
||||
if (this.filterText === '') return this.projectConfigList
|
||||
return this.projectConfigList.filter(ele => ele.name.includes(this.filterText))
|
||||
const projectList = this.projectConfigList
|
||||
projectList.sort((a, b) => {
|
||||
const date1 = new Date(a.created_at).getTime()
|
||||
const date2 = new Date(b.created_at).getTime()
|
||||
return date2 - date1
|
||||
})
|
||||
if (this.filterText === '') return projectList
|
||||
return projectList.filter(ele => ele.name.includes(this.filterText))
|
||||
},
|
||||
|
||||
...mapFields('project', [
|
||||
'projectConfigList',
|
||||
'projectSelectIndex',
|
||||
'projectTableSelectIndex',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
@@ -83,6 +90,7 @@ export default {
|
||||
select: function (index) {
|
||||
this.selectProjectIndex = index
|
||||
this.selectDeleteIndex = -1
|
||||
this.projectTableSelectIndex = -1
|
||||
this.selectProject({ index: index })
|
||||
},
|
||||
|
||||
|
||||
@@ -61,7 +61,10 @@ export default {
|
||||
},
|
||||
|
||||
taskDevice () {
|
||||
return this.getSelectTask.device
|
||||
if (this.getSelectTask.device) {
|
||||
return this.getSelectTask.device
|
||||
}
|
||||
return null
|
||||
},
|
||||
...mapGetters('project', [
|
||||
types.project.getSelect,
|
||||
|
||||
@@ -67,7 +67,8 @@ export default {
|
||||
condition.select = !condition.select
|
||||
},
|
||||
setParameter: function (name, value) {
|
||||
this.parameter = Object.assign({}, this.parameter)
|
||||
// this.parameter = Object.assign({}, this.parameter)
|
||||
this.parameter[name] = value
|
||||
|
||||
if (this.parameterUUID === '') {
|
||||
this.parameterUUID = this.GLOBAL.getUUID()
|
||||
@@ -106,7 +107,7 @@ export default {
|
||||
this.parameterUUID = Object.keys(parameterSet)[0]
|
||||
const param = Object.values(parameterSet)[0]
|
||||
const modeOption = this.$refs.device_parameter_ref.workingModeOptions.find(ele => ele.id === param.MODE)
|
||||
this.$refs.device_parameter_ref.workingModeSelectChange(modeOption)
|
||||
this.$refs.device_parameter_ref.workingModeSelectChange(modeOption, false)
|
||||
this.parameter = Object.assign(this.parameter, Object.values(parameterSet)[0])
|
||||
} else {
|
||||
const defaultMode = this.config.MODE_OPTIONS.find(ele => ele.description === 'Idle')
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<project-menu @detect="detect" @save_project="save"/>
|
||||
<project-table/>
|
||||
<project-table @save="save"/>
|
||||
<div align="right" v-if="lockMode === false">
|
||||
<button class="project-start-btn" @click="start">
|
||||
<div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<project-device @showDeviceModal="showDeviceModal" @save="saveProject"></project-device>
|
||||
<div class="flex d-flex sm12 xs12 md6 xl4 px-0">
|
||||
<add-task/>
|
||||
<add-task @save="saveProject"/>
|
||||
<div>
|
||||
<button class="add-cycle-btn" @click="showCycleModal">
|
||||
<div class="add-cycle-text">
|
||||
@@ -10,23 +11,28 @@
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="copy-project-btn" @click="copyTask({ project: getSelectProject, index: projectTableSelectIndex})">
|
||||
<button class="copy-project-btn" @click="() => {
|
||||
copyTask({ project: getSelectProject, index: projectTableSelectIndex})
|
||||
saveProject()
|
||||
}">
|
||||
<img class="img-vertical-center" src="@/assets/img/project/copy.svg">
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="copy-project-btn" @click="saveProject">
|
||||
<button class="copy-project-btn" @click="saveProject(true)">
|
||||
<img class="img-vertical-center" src="@/assets/img/project/save.svg">
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="copy-project-btn" @click="deleteTask({ project: getSelectProject, index: projectTableSelectIndex})">
|
||||
<button class="copy-project-btn" @click="() => {
|
||||
deleteTask({ project: getSelectProject, index: projectTableSelectIndex})
|
||||
saveProject()
|
||||
}">
|
||||
<img class="img-vertical-center" src="@/assets/img/project/delete.svg">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<project-device @showDeviceModal="showDeviceModal"></project-device>
|
||||
<new-device-modal ref="device_modal_ref" @detect="detect"></new-device-modal>
|
||||
<new-device-modal ref="device_modal_ref" @detect="detect" @save="saveProject"></new-device-modal>
|
||||
<cycle-modal ref="cycle_modal_ref" @createCycle="createCycle"></cycle-modal>
|
||||
</div>
|
||||
</template>
|
||||
@@ -82,7 +88,17 @@ export default {
|
||||
this.$refs.cycle_modal_ref.show()
|
||||
this.$refs.cycle_modal_ref.reset()
|
||||
},
|
||||
saveProject: function () {
|
||||
saveProject: function (showMessage = false) {
|
||||
if (showMessage === true) {
|
||||
this.showToast(
|
||||
'project update finish',
|
||||
{
|
||||
icon: 'fa-bell',
|
||||
position: 'bottom-right',
|
||||
duration: 5000,
|
||||
},
|
||||
)
|
||||
}
|
||||
this.$emit('save_project', this.getSelectProject)
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<button class="add-task-btn" @click="createTask">
|
||||
<button class="add-task-btn" @click="() => {
|
||||
createTask()
|
||||
save()
|
||||
}">
|
||||
<div class="add-task-text">
|
||||
<p>Add Task</p>
|
||||
</div>
|
||||
@@ -22,13 +25,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save: function () {
|
||||
this.$emit('save')
|
||||
},
|
||||
...mapActions('project',
|
||||
[
|
||||
types.task.init,
|
||||
types.task.create,
|
||||
types.task.save,
|
||||
types.task.delete,
|
||||
types.task.select,
|
||||
],
|
||||
),
|
||||
},
|
||||
|
||||
@@ -135,7 +135,6 @@ export default {
|
||||
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)
|
||||
@@ -182,7 +181,8 @@ export default {
|
||||
await this.swapTask({ project: project, originIndex: originEndIndex, newIndex: newEndIndex + 1 })
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('save')
|
||||
this.showModal = false
|
||||
return true
|
||||
},
|
||||
removeCycle: async function () {
|
||||
@@ -199,6 +199,7 @@ export default {
|
||||
const originEndIndex = await this.getIndexTask({ project: project, uuid: this.cycleInfo.range[1] })
|
||||
await this.deleteTask({ project: project, index: originEndIndex })
|
||||
|
||||
this.$emit('save')
|
||||
this.showModal = false
|
||||
return true
|
||||
},
|
||||
|
||||
@@ -101,10 +101,12 @@ export default {
|
||||
if (this.deviceList[this.deviceSelect]) {
|
||||
this.device.pair = this.deviceList[this.deviceSelect].macAddress
|
||||
}
|
||||
this.$emit('save')
|
||||
this.hide()
|
||||
},
|
||||
removeDevice: function () {
|
||||
this.deleteDeviceProject({ deviceKey: this.key })
|
||||
this.$emit('save')
|
||||
this.hide()
|
||||
},
|
||||
getDeviceList: async function (device) {
|
||||
|
||||
@@ -92,6 +92,7 @@ export default {
|
||||
pairStatus: 1,
|
||||
order: this.getDeviceMaxOrderProject,
|
||||
})
|
||||
this.$emit('save')
|
||||
return true
|
||||
},
|
||||
clickShowDevice: async function (library) {
|
||||
@@ -103,6 +104,7 @@ export default {
|
||||
pairStatus: 0,
|
||||
order: this.getDeviceMaxOrderProject,
|
||||
})
|
||||
this.$emit('save')
|
||||
return false
|
||||
},
|
||||
cancelSelectDevice: function () {
|
||||
@@ -113,6 +115,7 @@ export default {
|
||||
},
|
||||
deleteDevice: function (deviceIndex) {
|
||||
this.deleteDeviceProject({ index: deviceIndex })
|
||||
this.$emit('save')
|
||||
},
|
||||
handleMove (e) {
|
||||
const { index, futureIndex } = e.draggedContext
|
||||
@@ -131,6 +134,7 @@ export default {
|
||||
deviceList[keyOld][key] = deviceListTemp[this.futureIndex][1][key]
|
||||
deviceList[keyNew][key] = deviceListTemp[this.index][1][key]
|
||||
}
|
||||
this.$emit('save')
|
||||
},
|
||||
...mapActions('project',
|
||||
[
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- <tbody> -->
|
||||
<vuedraggable :disabled="lockMode === true || inputMode === true" class="draggable" :list="getSelectProject.task" @end="rearrangeTask({ project: getSelectProject })" tag="tbody" animation="500">
|
||||
<vuedraggable :disabled="lockMode === true || inputMode === true" class="draggable" :list="getSelectProject.task" @end="()=> {
|
||||
rearrangeTask({ project: getSelectProject })
|
||||
saveProject()
|
||||
}" tag="tbody" animation="500">
|
||||
<template class="item" v-for="(task, taskIndex) in getSelectProject.task">
|
||||
<tr
|
||||
v-if="task.type === 'cycle'"
|
||||
@@ -204,7 +207,10 @@
|
||||
<template slot="popover">
|
||||
<div>
|
||||
<div v-for="(parameter) in parameterShow(parameterSet.MODE, deviceUUID)" :key="parameter + parameterSet.MODE">
|
||||
<p>
|
||||
<p v-if="getConfig(deviceUUID).includes('TRIG') === true">
|
||||
{{ parameterPair(parameter, parameterSet, deviceUUID) }}
|
||||
</p>
|
||||
<p v-else>
|
||||
{{ parameterName(parameter, deviceUUID) }} : {{ parameterValue(parameter, parameterSet[parameter], deviceUUID) }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -251,7 +257,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<cycle-modal ref="cycle_modal_ref"></cycle-modal>
|
||||
<cycle-modal ref="cycle_modal_ref" @save="saveProject"></cycle-modal>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -357,6 +363,7 @@ export default {
|
||||
if (a === undefined) return
|
||||
newTaskList.filter(ele => ele != null)
|
||||
this.rearrangeTask({ project: this.getSelectProject })
|
||||
this.saveProject()
|
||||
},
|
||||
swapTask: function (taskIndex, upDown) {
|
||||
taskIndex = parseInt(taskIndex)
|
||||
@@ -370,11 +377,13 @@ export default {
|
||||
this.getSelectProject.task.splice(taskIndex + 1, 1, a)
|
||||
}
|
||||
this.rearrangeTask({ project: this.getSelectProject })
|
||||
this.saveProject()
|
||||
},
|
||||
delSelected: function () {
|
||||
for (const indexSelected of this.tableColumn.checked) {
|
||||
this.deleteTask({ project: this.getSelectProject, index: indexSelected })
|
||||
}
|
||||
this.saveProject()
|
||||
},
|
||||
delAction: function (task, actionKey, conditionKey) {
|
||||
const _action = JSON.parse(JSON.stringify(task.action))
|
||||
@@ -385,6 +394,12 @@ export default {
|
||||
|
||||
task.action = _action
|
||||
task.condition = _condition
|
||||
|
||||
this.saveProject()
|
||||
},
|
||||
saveProject: function () {
|
||||
console.log('saveProject')
|
||||
this.$emit('save', this.getSelectProject)
|
||||
},
|
||||
trigger_button: function (projectID) {
|
||||
console.log('project', projectID)
|
||||
@@ -407,6 +422,8 @@ export default {
|
||||
this.inputMode = false
|
||||
this.tableColumn[tag] = -1
|
||||
}
|
||||
|
||||
this.saveProject()
|
||||
},
|
||||
switchCycle: function (tag, index, projectID, task) {
|
||||
this.switchInput(tag, index)
|
||||
@@ -419,6 +436,7 @@ export default {
|
||||
index: cycleInfo[0],
|
||||
content: { id: this.inputSaved },
|
||||
}))
|
||||
this.$emit('save', this.getSelectProject)
|
||||
},
|
||||
selectAll: function (selectedArray) {
|
||||
const totalRange = [...Array(this.getSelectProject.task.length).keys()].map(idx => String(idx))
|
||||
@@ -448,9 +466,44 @@ export default {
|
||||
parameterShow (mode, deviceKey) {
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) return config.MODE[mode].showParameter
|
||||
return config.MODE[mode].parameter
|
||||
}
|
||||
},
|
||||
parameterPair (name, valueSet, deviceKey) {
|
||||
let _name, _value
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
if (this.getDeviceLibraryProject(deviceKey).includes('TRIG')) {
|
||||
if (name.includes('ACC_a_out')) {
|
||||
const accName = name + '_current'
|
||||
if (Boolean(valueSet[name]) === true) {
|
||||
_name = 'Channel' + String((parseInt(name.replace('ACC_a_out', '')) + 1))
|
||||
const scale = config[accName].unit[config[accName].defaultUnit]
|
||||
_value = `${config[accName].outputReadabilityData(valueSet[accName], scale)} ${config[accName].defaultUnit}`
|
||||
} else return ''
|
||||
} else if (name.includes('TRIG')) {
|
||||
if (Boolean(valueSet[name]) === true) {
|
||||
const optionTrigger = [
|
||||
'RISING',
|
||||
'FALLING',
|
||||
'BOTH',
|
||||
]
|
||||
const trigName = name.replace('en', '') + 'edge_type'
|
||||
_name = 'TRIG' + String((parseInt(name.replace('TRIG', '').replace('_en', '')) + 1))
|
||||
_value = optionTrigger[valueSet[trigName]]
|
||||
} else return ''
|
||||
} else if (name.includes('TIME_DURATION')) {
|
||||
if (valueSet.TIME_DURATION && parseInt(valueSet.TIME_DURATION) > 0) {
|
||||
const scale = config[name].unit[config[name].defaultUnit]
|
||||
_name = 'Timer'
|
||||
_value = `${config[name].outputReadabilityData(valueSet[name], scale)} ${config[name].defaultUnit}`
|
||||
} else return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
return _name + ': ' + _value
|
||||
},
|
||||
parameterName (name, deviceKey) {
|
||||
const config = configTable.getConfig(this.getDeviceLibraryProject(deviceKey))
|
||||
if (config !== undefined && Object.keys(config) !== 0) {
|
||||
@@ -498,6 +551,10 @@ export default {
|
||||
return cycleInfo[1]
|
||||
},
|
||||
|
||||
getConfig: function (deviceKey) {
|
||||
return this.getDeviceLibraryProject(deviceKey)
|
||||
},
|
||||
|
||||
handleMove (e) {
|
||||
const { index, futureIndex } = e.draggedContext
|
||||
this.index = index
|
||||
|
||||
@@ -248,6 +248,11 @@ export default {
|
||||
let device
|
||||
// let content
|
||||
switch (mes[0]) {
|
||||
case 'device_refresh':
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'get_device_info_all/0',
|
||||
}))
|
||||
break
|
||||
case 'state':
|
||||
switch (mes[1]) {
|
||||
case 'device_available':
|
||||
@@ -312,7 +317,7 @@ export default {
|
||||
device: parseInt(mes[1]),
|
||||
instruction: 'interrupt',
|
||||
}))
|
||||
this.pageToast('The device [' + taskInfo.getDeviceIDByRaw(parseInt(mes[1])) + '] mission is done.')
|
||||
this.pageToast('The device [' + taskInfo.getDeviceIDByRaw(parseInt(mes[1])) + '] mission done.')
|
||||
break
|
||||
case 'project':
|
||||
// refresh real-time page when going to next task
|
||||
@@ -436,7 +441,7 @@ export default {
|
||||
if (!isDefault) {
|
||||
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
|
||||
}
|
||||
this.pageToast('The chart has been added.')
|
||||
// this.pageToast('The chart has been added.')
|
||||
|
||||
return newChart.chartID
|
||||
},
|
||||
@@ -454,7 +459,7 @@ export default {
|
||||
mappingID: null,
|
||||
cardName: null,
|
||||
})
|
||||
this.pageToast('The chart has been Initialized.')
|
||||
// this.pageToast('The chart has been Initialized.')
|
||||
},
|
||||
removeChartCheck: function (chartID) {
|
||||
this.selectChartID = chartID
|
||||
@@ -490,7 +495,7 @@ export default {
|
||||
if (saveCache === true) {
|
||||
await this.taskContentChartSaveToCache({ controllerID: taskInfo.getTaskInfo().controllerID })
|
||||
}
|
||||
this.pageToast('The chart has been removed.')
|
||||
// this.pageToast('The chart has been removed.')
|
||||
},
|
||||
showDeviceSettingClick: function () {
|
||||
this.showDeviceSetting = true
|
||||
@@ -531,8 +536,9 @@ export default {
|
||||
_itemID: deviceID,
|
||||
_chartID: null,
|
||||
_type: 'device',
|
||||
_reset: false,
|
||||
})
|
||||
this.pageToast('The device [' + deviceID + '] has been registered.')
|
||||
// this.pageToast('The device [' + deviceID + '] has been registered.')
|
||||
},
|
||||
removeDevice: function (deviceID) {
|
||||
this.mqttUnSub(taskInfo.getTaskInfo().controllerID + '/data_server/device_data_stream/' + deviceID + '/+')
|
||||
@@ -542,7 +548,7 @@ export default {
|
||||
this.removeChart(chart)
|
||||
}
|
||||
}
|
||||
this.pageToast('The device [' + deviceID + '] has been removed.')
|
||||
// this.pageToast('The device [' + deviceID + '] has been removed.')
|
||||
},
|
||||
addFormula: async function (formulaID) {
|
||||
const chart = await this.addChart(true)
|
||||
|
||||
@@ -130,17 +130,66 @@ export default {
|
||||
if (device === undefined) return
|
||||
return device.configuration.MODE
|
||||
},
|
||||
getChannelConfiguration: function () {
|
||||
const device = this.deviceListNew.find(ele => String(ele.memory_board) === String(this.chartData[this.chartID].mappingID))
|
||||
if (device === undefined) return
|
||||
return configTable.getChannelConfig(device.configuration._LIBRARY_, 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
|
||||
const channelInfo = this.getChannelConfiguration()
|
||||
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 x = this.data.gridSource[plotIndex][curveIndex].xSource
|
||||
const y = this.data.gridSource[plotIndex][curveIndex].ySource
|
||||
|
||||
let _xAxis
|
||||
let _yAxis
|
||||
if (channelInfo) {
|
||||
if (x.name === 'Time') {
|
||||
_xAxis = { default: channelInfo.time }
|
||||
} else {
|
||||
let xInfo = channelInfo[x.channel - 1]
|
||||
if (xInfo === undefined) {
|
||||
xInfo = {
|
||||
name: '',
|
||||
defaultUnit: '',
|
||||
unit: {},
|
||||
}
|
||||
}
|
||||
_xAxis = { default: xInfo }
|
||||
}
|
||||
if (y.name === 'Time') {
|
||||
_yAxis = { default: channelInfo.time }
|
||||
} else {
|
||||
let yInfo = channelInfo[y.channel - 1]
|
||||
if (yInfo === undefined) {
|
||||
yInfo = {
|
||||
name: '',
|
||||
defaultUnit: '',
|
||||
unit: {},
|
||||
}
|
||||
}
|
||||
_yAxis = { default: yInfo }
|
||||
}
|
||||
} else {
|
||||
_xAxis = {
|
||||
default: {
|
||||
name: '',
|
||||
defaultUnit: '',
|
||||
unit: {},
|
||||
},
|
||||
}
|
||||
_yAxis = {
|
||||
default: {
|
||||
name: '',
|
||||
defaultUnit: '',
|
||||
unit: {},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
const _realTime = JSON.parse(JSON.stringify(this.realTime))
|
||||
const _newCurve = {}
|
||||
// set name, sourceIndex in data.series
|
||||
@@ -276,6 +325,16 @@ export default {
|
||||
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.includes('ZReal') && !_xPhysicsQuantity.includes('ZImag')) {
|
||||
_xPhysicsQuantity = _xPhysicsQuantity.substring(0, 1)
|
||||
} else {
|
||||
_xPhysicsQuantity = _xPhysicsQuantity.substring(0, 5)
|
||||
}
|
||||
if (!_yPhysicsQuantity.includes('ZReal') && !_yPhysicsQuantity.includes('ZImag')) {
|
||||
_yPhysicsQuantity = _yPhysicsQuantity.substring(0, 1)
|
||||
} else {
|
||||
_yPhysicsQuantity = _yPhysicsQuantity.substring(0, 5)
|
||||
}
|
||||
if (_xPhysicsQuantity === 'P') _xPhysicsQuantity = 'V'
|
||||
if (_yPhysicsQuantity === 'P') _yPhysicsQuantity = 'V'
|
||||
const [_xAxis, _yAxis] = this.chartRouter.getChartTable(_xPhysicsQuantity, _yPhysicsQuantity)
|
||||
|
||||
@@ -1,36 +1,6 @@
|
||||
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
|
||||
{
|
||||
@@ -74,168 +44,6 @@ const chartTable = {
|
||||
},
|
||||
},
|
||||
],
|
||||
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: {
|
||||
mΩ: 1,
|
||||
Ω: 1e3,
|
||||
kΩ: 1e6,
|
||||
MΩ: 1e9,
|
||||
},
|
||||
defaultUnit: 'Ω',
|
||||
downloadUnit: 'Ω',
|
||||
},
|
||||
},
|
||||
],
|
||||
T_Impedance: [
|
||||
// 0
|
||||
{
|
||||
default: {
|
||||
name: 'Time',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
min: 60 * 1e6,
|
||||
hour: 60 * 60 * 1e6,
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
},
|
||||
// 1
|
||||
{
|
||||
default: {
|
||||
name: 'Resistance',
|
||||
unit: {
|
||||
mΩ: 1e-3,
|
||||
Ω: 1,
|
||||
kΩ: 1e3,
|
||||
MΩ: 1e6,
|
||||
},
|
||||
defaultUnit: 'Ω',
|
||||
downloadUnit: 'Ω',
|
||||
},
|
||||
},
|
||||
],
|
||||
T_Phase: [
|
||||
// 0
|
||||
{
|
||||
default: {
|
||||
name: 'Time',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
min: 60 * 1e6,
|
||||
hour: 60 * 60 * 1e6,
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
},
|
||||
// 1
|
||||
{
|
||||
default: {
|
||||
name: 'degree',
|
||||
unit: {
|
||||
'°': 1e3,
|
||||
},
|
||||
defaultUnit: '°',
|
||||
downloadUnit: '°',
|
||||
},
|
||||
},
|
||||
],
|
||||
T_Current: [
|
||||
// 0
|
||||
// 0
|
||||
{
|
||||
default: {
|
||||
name: 'Time',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
min: 60 * 1e6,
|
||||
hour: 60 * 60 * 1e6,
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
},
|
||||
// 1
|
||||
{
|
||||
default: {
|
||||
name: 'Current',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
mA: 1e6,
|
||||
A: 1e9,
|
||||
},
|
||||
defaultUnit: (Mode) => { return (Mode === 10 || Mode === 11) ? 'nA' : 'mA' },
|
||||
downloadUnit: 'mA',
|
||||
},
|
||||
// Q = ∫ I dt
|
||||
integral: {
|
||||
name: 'Charge',
|
||||
unit: {
|
||||
nAh: 3600 * 1e6,
|
||||
uAh: 1600 * 1e9,
|
||||
mAh: 3600 * 1e12,
|
||||
Ah: 3600 * 1e15,
|
||||
},
|
||||
defaultUnit: 'mAh',
|
||||
downloadUnit: 'mAh',
|
||||
},
|
||||
},
|
||||
],
|
||||
V_V: [
|
||||
// 0
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -309,94 +117,6 @@ const chartTable = {
|
||||
},
|
||||
},
|
||||
],
|
||||
V_R: [
|
||||
// 0
|
||||
{
|
||||
default: {
|
||||
name: 'Voltage',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
V: 1e6,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
},
|
||||
// 1
|
||||
{
|
||||
default: {
|
||||
name: 'Resistance',
|
||||
unit: {
|
||||
mΩ: 1,
|
||||
Ω: 1e3,
|
||||
kΩ: 1e6,
|
||||
MΩ: 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: {
|
||||
mΩ: 1e-3,
|
||||
Ω: 1,
|
||||
kΩ: 1e3,
|
||||
MΩ: 1e6,
|
||||
},
|
||||
downloadUnit: 'Ω',
|
||||
defaultUnit: 'Ω',
|
||||
},
|
||||
},
|
||||
// 1
|
||||
{
|
||||
default: {
|
||||
name: 'Z_imag',
|
||||
unit: {
|
||||
mΩ: 1e-3,
|
||||
Ω: 1,
|
||||
kΩ: 1e3,
|
||||
MΩ: 1e6,
|
||||
},
|
||||
downloadUnit: 'Ω',
|
||||
defaultUnit: 'Ω',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
export const chartRouter = {
|
||||
getChartTable: (xAxis, yAxis) => {
|
||||
@@ -404,6 +124,6 @@ export const chartRouter = {
|
||||
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'
|
||||
else return []
|
||||
},
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
// const status = checkParam.status
|
||||
// const message = checkParam.message
|
||||
// if (status === true) {
|
||||
this.setArchiveSettings()
|
||||
await this.setArchiveSettings()
|
||||
// this.$emit('start', device)
|
||||
setTimeout(() => {
|
||||
this.$emit('start', device)
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
// const message = checkParam.message
|
||||
// if (status === true) {
|
||||
// device.stopping = false
|
||||
this.setArchiveSettings()
|
||||
await this.setArchiveSettings()
|
||||
setTimeout(() => {
|
||||
this.$emit('record', device)
|
||||
}, 500)
|
||||
@@ -176,9 +176,9 @@ export default {
|
||||
generateChart: function (device) {
|
||||
this.$emit('generate', device)
|
||||
},
|
||||
setArchiveSettings: function () {
|
||||
this.$refs.fcwindow_ref.forEach(ref => {
|
||||
ref.setArchiveSettings()
|
||||
setArchiveSettings: async function () {
|
||||
this.$refs.fcwindow_ref.forEach(async (ref) => {
|
||||
await ref.setArchiveSettings()
|
||||
})
|
||||
},
|
||||
refresh: function () {
|
||||
|
||||
@@ -22,9 +22,12 @@
|
||||
<va-item-section class="ml-3" caption>
|
||||
<!-- <va-button @click="getBattery(device)"> get battery </va-button> -->
|
||||
<!-- <pre> {{ device.battery }} </pre> -->
|
||||
<va-item-label v-if="device.library_name.includes('EIS')">
|
||||
{{ `[${device.memory_board}]` }} {{ device.name }}
|
||||
<va-item-label v-if="!device.library_name.includes('EDC')">
|
||||
{{ `[${device.memory_board}]` }} {{ device.name === 'Elite-CPG' ? 'Current Pulse Generator' : device.name }}
|
||||
</va-item-label>
|
||||
<!-- <va-item-label v-if="device.status !== 0">
|
||||
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-full" color="rgb(178 180 178)"/>
|
||||
</va-item-label> -->
|
||||
<va-item-label v-else-if="parseInt((device.battery - 2900) / 10) >= 75">
|
||||
{{ `[${device.memory_board}]` }} {{ device.name }} <va-icon class="ml-3 fa fa-battery-full" color="#5BC236"/> {{ (parseInt((device.battery - 2900) / 10) > 100 ? 100 : parseInt((device.battery - 2900) / 10)) + '%' }}
|
||||
</va-item-label>
|
||||
@@ -52,6 +55,9 @@
|
||||
<va-item class="pa-0 ma-0 mt-2">
|
||||
<va-item-section class="ml-3">
|
||||
<va-item-label>
|
||||
<va-button @click.stop="quickstart(device)" v-if="device.library_name.includes('PEL') && device.status !== 1" class="px-2 py-0 mr-0" color="success" small>START</va-button>
|
||||
<va-button @click.stop="quickstop(device)" v-if="device.library_name.includes('PEL') && device.status === 1" class="px-2 py-0 mr-0" color="danger" small>STOP</va-button>
|
||||
<!-- <va-button @click.stop="quickstart(device)" v-if="device.library_name.includes('CPG')" class="px-2 py-0 mr-0" color="success" small>START</va-button> -->
|
||||
<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>
|
||||
@@ -61,8 +67,8 @@
|
||||
</va-item>
|
||||
</span>
|
||||
<div slot="body">
|
||||
<div class="mt-0 mb-0" style="height: 60vh; overflow-y: scroll; overflow-x: hidden;" :key="'detail' + device.id">
|
||||
<div>
|
||||
<div class="mt-0 mb-0" style="height: 60vh; overflow-y: scroll; overflow-x: hidden; scrollbar-width: none;" :key="'detail' + device.id">
|
||||
<div v-if="device.library_name.includes('Elite') || device.library_name.includes('PEL')">
|
||||
<file-control-window :ref="`fcwindow_ref_${device.memory_board}`" :device="device" class="pl-0 pr-0" />
|
||||
</div>
|
||||
<div>
|
||||
@@ -152,6 +158,22 @@ export default {
|
||||
// CanvasChart.methods.resetClicked()
|
||||
}
|
||||
},
|
||||
quickstart: async function (device) {
|
||||
await this.setArchiveSettings(device.memory_board)
|
||||
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'device_instruction/0',
|
||||
device: device.mac_address,
|
||||
instruction: 'start',
|
||||
}))
|
||||
},
|
||||
quickstop: function (device) {
|
||||
this.mqttPub(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'device_instruction/0',
|
||||
device: device.mac_address,
|
||||
instruction: 'stop',
|
||||
}))
|
||||
},
|
||||
stop: function (device) {
|
||||
this.$emit('stop', device)
|
||||
this.pageToast('The device ' + device.name + ' has been stopped.')
|
||||
@@ -197,4 +219,9 @@ export default {
|
||||
filter: brightness(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.va-collapse__body {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -129,9 +129,9 @@ export default {
|
||||
generateChart: function (device) {
|
||||
this.$emit('add', device.id)
|
||||
},
|
||||
setArchiveSettings: function () {
|
||||
setArchiveSettings: async function () {
|
||||
if (this.$refs.pdlist_ref != null) {
|
||||
this.$refs.pdlist_ref.setArchiveSettings()
|
||||
await this.$refs.pdlist_ref.setArchiveSettings()
|
||||
}
|
||||
},
|
||||
refresh: function () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="flex row mt-0 pt-0 sm12 xl12 md12 xs12">
|
||||
<div class="flex sm6 xl6 md6 xs6">
|
||||
<va-select
|
||||
:on-change="directorySelect(directory)"
|
||||
@input="directorySelect(directory)"
|
||||
:label="'DIRECTORY'"
|
||||
v-model="directory"
|
||||
textBy="name"
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
}
|
||||
},
|
||||
directorySelect: function (directoryInfo) {
|
||||
if (typeof directoryInfo === 'object') {
|
||||
if (directoryInfo.parent) {
|
||||
if (this.device.parent.folder === undefined || this.device.parent.folder.indexOf(directoryInfo.id) === -1) {
|
||||
if (this.device.status === 0) {
|
||||
this.device.parent.folder = []
|
||||
@@ -122,9 +122,9 @@ export default {
|
||||
// directory init
|
||||
const collection = await api.collection.getAll()
|
||||
this.directoryOptions = collection.data.filter(el => el.name !== 'root')
|
||||
|
||||
if (Object.keys(this.device.parent).length === 0) {
|
||||
this.directory = this.directoryOptions[0]
|
||||
this.directory = this.directoryOptions.find(ele => ele.name === 'admin')
|
||||
this.directorySelect(this.directory)
|
||||
} else {
|
||||
for (const directory of this.directoryOptions) {
|
||||
if (this.device.parent.folder.includes(directory.id)) {
|
||||
@@ -143,8 +143,8 @@ export default {
|
||||
pageInit: async function () {
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.setArchiveSettings()
|
||||
async mounted () {
|
||||
await this.setArchiveSettings()
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
|
||||
@@ -28,7 +28,23 @@
|
||||
<!-- split because of styling problem(treenode), combine together furture -->
|
||||
<!-- Trigger -->
|
||||
<div v-if="library && library.includes('TRIG')">
|
||||
<Trigger :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></Trigger>
|
||||
<Trigger v-if="parameter.MODE === 0" :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></Trigger>
|
||||
<div v-if="parameter.MODE === 2">
|
||||
<component
|
||||
v-for="name in parameterArrayInMode"
|
||||
:key="name"
|
||||
:is="parameterTable[name].componentType"
|
||||
:templateType=1
|
||||
:withHeader="true"
|
||||
:parameterName="name"
|
||||
:inputValue="parameter[name]"
|
||||
v-bind="parameterTable[name]"
|
||||
@parameterChange="parameterChange"
|
||||
@getParameter="getParameter"
|
||||
@sendInstruction="sendInstruction"
|
||||
/>
|
||||
</div>
|
||||
<TriggerNew v-if="parameter.MODE === 3" :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></TriggerNew>
|
||||
</div>
|
||||
<!-- EIS -->
|
||||
<div v-if="library && library.includes('EIS')">
|
||||
@@ -48,7 +64,7 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- ZM15-PulseSensingMode -->
|
||||
<div v-else-if="library && library.includes('EDC') && parameter.MODE === 14">
|
||||
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT')) && parameter.MODE === 14">
|
||||
<EliteParameterRecordingElitePulseSensing
|
||||
:parameter="parameter"
|
||||
:device="device"
|
||||
@@ -59,7 +75,7 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- ZM15-DPVMode -->
|
||||
<div v-else-if="library && library.includes('EDC') && parameter.MODE === 15">
|
||||
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT')) && parameter.MODE === 15">
|
||||
<EliteParameterRecordingEliteDPV
|
||||
:parameter="parameter"
|
||||
:device="device"
|
||||
@@ -70,7 +86,7 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- ZM15-OtherModes -->
|
||||
<div v-else-if="library && library.includes('EDC')">
|
||||
<div v-else-if="library && (library.includes('EDC') || library.includes('BAT'))">
|
||||
<va-tree-category
|
||||
v-for="name in parameterArrayInMode"
|
||||
:key="name"
|
||||
@@ -94,11 +110,64 @@
|
||||
</va-tree-node>
|
||||
</va-tree-category>
|
||||
</div>
|
||||
<!-- PEL-->
|
||||
<div v-if="library && library.includes('PEL')">
|
||||
<div v-if="[0,1].includes(parameter.MODE)">
|
||||
<PEL :device="device"></PEL>
|
||||
</div>
|
||||
<div v-else-if="[3, 4].includes(parameter.MODE)">
|
||||
<PEL_1 :device="device"></PEL_1>
|
||||
</div>
|
||||
<div v-else>
|
||||
<component
|
||||
v-for="name in parameterArrayInMode"
|
||||
:key="name"
|
||||
:is="parameterTable[name].componentType"
|
||||
:templateType=1
|
||||
:withHeader="true"
|
||||
:parameterName="name"
|
||||
:inputValue="parameter[name]"
|
||||
:disable="name === 'CTRL_HIGH_Z_15' && device && device.status === 0"
|
||||
v-bind="parameterTable[name]"
|
||||
@parameterChange="parameterChange"
|
||||
@getParameter="getParameter"
|
||||
@sendInstruction="sendInstruction"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- CPG -->
|
||||
<div v-if="library && library.includes('CPG')">
|
||||
<div v-if="parameter.MODE === 0">
|
||||
<ElectricalStimulation
|
||||
:parameter="parameter"
|
||||
:parameterTable="parameterTable"
|
||||
@parameterChange="parameterChange"
|
||||
@getParameter="getParameter"
|
||||
@sendInstruction="sendInstruction"
|
||||
></ElectricalStimulation>
|
||||
</div>
|
||||
<div v-else>
|
||||
<component
|
||||
v-for="name in parameterArrayInMode"
|
||||
:key="name"
|
||||
:is="parameterTable[name].componentType"
|
||||
:templateType=1
|
||||
:withHeader="true"
|
||||
:parameterName="name"
|
||||
:inputValue="parameter[name]"
|
||||
:disable="name === 'CTRL_HIGH_Z_15' && device && device.status === 0"
|
||||
v-bind="parameterTable[name]"
|
||||
@parameterChange="parameterChange"
|
||||
@getParameter="getParameter"
|
||||
@sendInstruction="sendInstruction"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</va-tree-root>
|
||||
<!-- guide picture button -->
|
||||
<div>
|
||||
<vue-final-modal
|
||||
v-if="library && library.includes('EDC')"
|
||||
v-if="library"
|
||||
v-model="showModal"
|
||||
classes="modal-container"
|
||||
content-class="modal-content"
|
||||
@@ -112,7 +181,8 @@
|
||||
<!-- <va-icon class='fa fa-close modal__close' @click="showModal=false"></va-icon>
|
||||
<span class="modal__title"></span> -->
|
||||
<div class="modal__content">
|
||||
<img :src="require('@/assets/img/elite-wire/' + getImageUrl + '.svg')" class="modal_img" alt="No Pic" draggable="false" >
|
||||
<img v-if="library.includes('EDC')" :src="require('@/assets/img/elite-wire/' + getImageUrl + '.svg')" class="modal_img" alt="No Pic" draggable="false" >
|
||||
<img v-if="library.includes('CPG')" :src="require('@/assets/img/elite-wire/CPG_UI_infomation_figure.png')" class="modal_img" alt="No Pic" draggable="false" >
|
||||
<!-- <img :src="`${pat}`" class="imgaa" alt="No Pic" draggable="false"> -->
|
||||
</div>
|
||||
</vue-final-modal>
|
||||
@@ -129,10 +199,14 @@ import MultiInputField from '../parameter/itemNew/MultiInputField'
|
||||
import EliteParameterRecordingEliteDPV from '../parameter/itemNew/DPVNew/EliteParameterRecordingEliteDPV'
|
||||
import DevMode from '../parameter/itemNew/DevMode'
|
||||
import Trigger from '../parameter/itemNew/TriggerNew/Trigger'
|
||||
import TriggerNew from '../parameter/itemNew/TriggerNew/TriggerNew'
|
||||
import EliteParameterRecordingElitePulseSensing from '../parameter/itemNew/PulseSensingNew/EliteParameterRecordingElitePulseSensing'
|
||||
import { VueFinalModal } from 'vue-final-modal'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
import configTable from '@/data/config-table/index'
|
||||
import ElectricalStimulation from '../parameter/itemNew/ElectricalStimulation/ElectricalStimulation'
|
||||
import PEL from './itemNew/PEL'
|
||||
import PEL_1 from './itemNew/PEL_1'
|
||||
|
||||
export default {
|
||||
name: 'EliteParameterRecordingElitezm15',
|
||||
@@ -147,6 +221,10 @@ export default {
|
||||
MultiInputField,
|
||||
DevMode,
|
||||
Trigger,
|
||||
TriggerNew,
|
||||
ElectricalStimulation,
|
||||
PEL,
|
||||
PEL_1,
|
||||
},
|
||||
props: {
|
||||
parameter: {
|
||||
@@ -246,9 +324,9 @@ export default {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
parameterChange: function (name, value, debounce = false) {
|
||||
parameterChange: function (name, value, debounce = false, force = false) {
|
||||
/** if parameter is equal to value, then don't change, JSON.stringify is for array & object compare */
|
||||
if (JSON.stringify(value) !== JSON.stringify(this.parameter[name])) {
|
||||
if (JSON.stringify(value) !== JSON.stringify(this.parameter[name]) || force === true) {
|
||||
this.parameter[name] = value
|
||||
debounce === false
|
||||
? this.$emit('setParameter', name, value)
|
||||
@@ -257,16 +335,18 @@ export default {
|
||||
},
|
||||
refresh () {
|
||||
},
|
||||
workingModeSelectChange (val) {
|
||||
if (val === undefined) return
|
||||
workingModeSelectChange (val, reset = true) {
|
||||
if (val === undefined || this.parameter.MODE === undefined) return
|
||||
this.workingModeSelect = val
|
||||
// console.log('workingModeSelectChange', this.workingModeSelect, this.parameter.MODE)
|
||||
|
||||
if (this.workingModeSelect.id !== this.parameter.MODE) {
|
||||
this.parameterChange('MODE', this.workingModeSelect.id)
|
||||
if (this.resetParameterModeChange === true) {
|
||||
for (const parameter of this.parameterTable.MODE[this.workingModeSelect.id].parameter) {
|
||||
this.$emit('setParameter', parameter, this.parameterTable[parameter].defaultValue)
|
||||
if (reset === true) {
|
||||
for (const parameter of this.parameterTable.MODE[this.workingModeSelect.id].parameter) {
|
||||
this.$emit('setParameter', parameter, this.parameterTable[parameter].defaultValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,19 +14,18 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="flex sm12 xl12 md12 xs12">
|
||||
<div class="flex row align--center">
|
||||
<va-input
|
||||
@keyup.enter="instruParameterChange(inputWrite)"
|
||||
@blur="instruParameterChange(inputWrite)"
|
||||
class="mb-0"
|
||||
v-model="inputWrite"
|
||||
label="Write value (0x3000FF ... )"
|
||||
style="width: 100px;"
|
||||
maxlength="34"
|
||||
/>
|
||||
<va-button slot="append" class="mr-2 pa-1 shrink" style="width: 2em; height: 2em; border-radius: 50%; font-size: 20px;" small @click="sendInstr('ble_instru_send')">
|
||||
W
|
||||
</va-button>
|
||||
<div>
|
||||
<h1>
|
||||
Write
|
||||
</h1>
|
||||
</div>
|
||||
<div class="flex row">
|
||||
<div>
|
||||
<textarea class="hexStringArea" v-model="hexInput" @input="formatHexInput" placeholder="Enter hex string..." ref="textarea" maxlength="731"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<va-icon class="ml-3 fa fa-check-circle custom-icon" size="30px" @click.native="sendInstr('ble_instru_send')"></va-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,6 +92,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
hexInput: '',
|
||||
inputWrite: '',
|
||||
inputNotify: '',
|
||||
}
|
||||
@@ -100,6 +100,34 @@ export default {
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
formatHexInput () {
|
||||
const textarea = this.$refs.textarea
|
||||
let cursorPosition = textarea.selectionStart
|
||||
|
||||
// Remove any non-hex characters (if necessary)
|
||||
const cleanInput = this.hexInput.replace(/[^A-Fa-f0-9]/g, '')
|
||||
|
||||
// Calculate spaces that will be added
|
||||
const spacesBefore = (this.hexInput.slice(0, cursorPosition).match(/ /g) || []).length
|
||||
|
||||
// Add space after every two characters
|
||||
const formattedInput = cleanInput.match(/.{1,2}/g)?.join(' ') || ''
|
||||
|
||||
// Set the formatted input
|
||||
this.hexInput = formattedInput.toUpperCase()
|
||||
|
||||
// Calculate new cursor position
|
||||
const spacesAfter = (formattedInput.slice(0, cursorPosition).match(/ /g) || []).length
|
||||
cursorPosition = cursorPosition + (spacesAfter - spacesBefore)
|
||||
|
||||
// Set the new cursor position
|
||||
this.$nextTick(() => {
|
||||
textarea.setSelectionRange(cursorPosition, cursorPosition)
|
||||
})
|
||||
|
||||
const instructionArray = this.hexInput.split(' ').map(hex => parseInt(hex, 16))
|
||||
this.$emit('parameterChange', 'BLE_WRITE', instructionArray, true)
|
||||
},
|
||||
sendInstr (instr) {
|
||||
this.$emit('sendInstruction', instr)
|
||||
},
|
||||
@@ -112,20 +140,6 @@ export default {
|
||||
readCisData () {
|
||||
this.$emit('getParameter', 'ADC_VALUE_I')
|
||||
},
|
||||
instruParameterChange (instruction) {
|
||||
while (instruction.length <= 33) {
|
||||
instruction += '0'
|
||||
}
|
||||
|
||||
const sendIns = new Array(17).fill(0)
|
||||
for (let i = 0; i <= 16; i++) {
|
||||
const startIndex = i * 2
|
||||
sendIns[i] = instruction.substring(startIndex, startIndex + 2)
|
||||
sendIns[i] = parseInt(sendIns[i], 16)
|
||||
}
|
||||
|
||||
this.$emit('parameterChange', 'BLE_WRITE', '0:16=' + String(sendIns))
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
},
|
||||
@@ -136,3 +150,27 @@ export default {
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.hexStringArea {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.va-tree-category__list-internal-container {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.custom-icon {
|
||||
color: #007bff; /* Default color */
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.custom-icon:hover {
|
||||
color: #0056b3; /* Color when hovering */
|
||||
}
|
||||
|
||||
.custom-icon:active {
|
||||
color: #003580; /* Color when clicked */
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- Main container for the pulse output section -->
|
||||
<div class="pulse-output" style="width: 95%; justify-content: space-between;">
|
||||
|
||||
<!-- PULSE OUTPUT label section -->
|
||||
<div>
|
||||
<p style="font-family: 'Inter-Bold';">Pulse Output</p>
|
||||
</div>
|
||||
|
||||
<!-- Timer section, clicking on this triggers setTimer() -->
|
||||
<div style="display: flex;">
|
||||
<div class="timer" @click="setTimer" style="cursor: pointer;">
|
||||
<img src="@/assets/icons/ES_Mode/button-timer.svg">
|
||||
<p
|
||||
v-if="parameter.CONTINUE_MODE === 0"
|
||||
style="font-family: 'Inter'; font-size: 1rem;"
|
||||
>{{ formattedTime }}</p>
|
||||
<p v-if="parameter.CONTINUE_MODE === 1"
|
||||
style="font-family: 'Inter'; font-size: 1.5rem; font-style: normal;"
|
||||
>∞</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Buttons for controlling electrode activation -->
|
||||
<div style="min-width: 80px; text-align: end;">
|
||||
<!-- Output button visible when electrode is not activated -->
|
||||
<va-button
|
||||
:class="isElectrodeActivated ? 'not-visible' : ''"
|
||||
color="#5cd699"
|
||||
style="padding: 0.125rem 0.5rem;"
|
||||
@click="activateElectrode"
|
||||
small
|
||||
>output</va-button>
|
||||
|
||||
<!-- Stop button visible when electrode is activated -->
|
||||
<va-button
|
||||
:class="!isElectrodeActivated ? 'not-visible' : ''"
|
||||
color="danger"
|
||||
style="padding: 0.125rem 0.5rem;"
|
||||
@click="deactiveElectrode"
|
||||
small
|
||||
>stop</va-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test component to handle parameters -->
|
||||
<PulseOutputSettings
|
||||
:parameter="parameter"
|
||||
:parameterTable="parameterTable"
|
||||
@parameterChange="parameterChange"
|
||||
@sendInstruction="sendInstruction"
|
||||
></PulseOutputSettings>
|
||||
|
||||
<!-- Timer modal component to handle timer settings -->
|
||||
<TimerModal :ref="'timer_modal_ref'" :parameter="parameter" :parameterTable="parameterTable" @parameterChange="parameterChange"></TimerModal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import PulseOutputSettings from './PulseOutputSettings'
|
||||
import TimerModal from './TimerModal'
|
||||
|
||||
export default {
|
||||
name: 'ElectricalStimulation',
|
||||
components: {
|
||||
PulseOutputSettings,
|
||||
TimerModal,
|
||||
},
|
||||
props: {
|
||||
parameter: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
parameterTable: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
isElectrodeActivated () {
|
||||
return this.parameter.ACTIVATE_ELECTRODE === 1
|
||||
},
|
||||
formattedTime () {
|
||||
let totalSeconds = this.parameter.STOP_TIME
|
||||
|
||||
const hh = Math.floor(totalSeconds / 3600)
|
||||
totalSeconds %= 3600
|
||||
|
||||
const mm = Math.floor(totalSeconds / 60)
|
||||
const ss = totalSeconds % 60
|
||||
|
||||
// Now conditionally format the output:
|
||||
let formatted = ''
|
||||
|
||||
if (hh > 0) {
|
||||
formatted += `${hh} h `
|
||||
}
|
||||
|
||||
if (mm > 0) {
|
||||
formatted += `${mm} m `
|
||||
}
|
||||
|
||||
if (ss > 0 || formatted === '') {
|
||||
formatted += `${ss} s`
|
||||
}
|
||||
|
||||
return formatted.trim() // Ensure there are no trailing spaces
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
selectedValue: null,
|
||||
radioItems: [
|
||||
{ value: 1 },
|
||||
{ value: 2 },
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setTimer () {
|
||||
this.$refs.timer_modal_ref.show()
|
||||
},
|
||||
activateElectrode () {
|
||||
this.parameter.ACTIVATE_ELECTRODE = !this.parameter.ACTIVATE_ELECTRODE
|
||||
this.parameter.WORKING_ELECTRODE.map((item, index) => {
|
||||
this.parameter.WORKING_ELECTRODE[index] = 1
|
||||
})
|
||||
this.parameterChange('WORKING_ELECTRODE', this.parameter.WORKING_ELECTRODE)
|
||||
this.parameterChange('ACTIVATE_ELECTRODE', this.parameter.ACTIVATE_ELECTRODE)
|
||||
this.sendInstruction('output')
|
||||
},
|
||||
deactiveElectrode () {
|
||||
this.parameter.ACTIVATE_ELECTRODE = !this.parameter.ACTIVATE_ELECTRODE
|
||||
this.parameter.WORKING_ELECTRODE.map((item, index) => {
|
||||
this.parameter.WORKING_ELECTRODE[index] = 0
|
||||
})
|
||||
this.parameterChange('WORKING_ELECTRODE', this.parameter.WORKING_ELECTRODE)
|
||||
this.parameterChange('ACTIVATE_ELECTRODE', this.parameter.ACTIVATE_ELECTRODE)
|
||||
this.sendInstruction('deactive_electrode')
|
||||
},
|
||||
parameterChange (key, value) {
|
||||
this.$emit('parameterChange', key, value, false, true)
|
||||
},
|
||||
sendInstruction: function (instr) {
|
||||
this.$emit('sendInstruction', instr)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.underline {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #2c3e50;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.pulse-output {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.timer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 10px;
|
||||
font-style: italic;
|
||||
transition: opacity 0.3s ease; /* Smooth transition effect */
|
||||
}
|
||||
|
||||
.timer:hover {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.timer-icon {
|
||||
font-size: 16px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.output-button {
|
||||
background-color: #5cd699;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.output-button:hover {
|
||||
background-color: #45bf7d;
|
||||
}
|
||||
|
||||
.not-visible {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,423 @@
|
||||
<template>
|
||||
<!-- Main container div -->
|
||||
<div class="container">
|
||||
<!-- Row for electrode and pulse pattern controls -->
|
||||
<div class="row flex xl12 lg12 my-3" style="padding: 0 0.25rem;">
|
||||
|
||||
<!-- Left side: Electrode section -->
|
||||
<div class="flex xl6 lg6 py-0 px-0">
|
||||
<div class="centered-item">
|
||||
<span>Electrode</span>
|
||||
<div class="underline"></div>
|
||||
</div>
|
||||
|
||||
<!-- Looping over electrode options to render checkboxes -->
|
||||
<div class="radio-item" style="padding: 0.25rem; line-height: 30px; justify-content: space-evenly;" v-for="(option, index) in channelOption" :key="'electrode-1-' + option">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<!-- Checkbox input for electrode selection -->
|
||||
<input
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
style="margin-right: 0.25rem; cursor: pointer;"
|
||||
type="checkbox"
|
||||
v-model="parameter.ELECTRODE_SELECTOR[index]"
|
||||
@click="selectedElectrode(index)"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
/>
|
||||
<span class="number">{{ option }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Play button (active or inactive depending on conditions) -->
|
||||
<div style="min-width: 30px;">
|
||||
<div
|
||||
v-if="parameter.ACTIVATE_ELECTRODE === 1 && parameter.WORKING_ELECTRODE[index] === 1 && parameter.ELECTRODE_SELECTOR[index] === true"
|
||||
style="display: flex;"
|
||||
>
|
||||
<img src="@/assets/icons/ES_Mode/button-play-active.svg">
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
style="display: flex; cursor: pointer;"
|
||||
@click="startElectrode(index)"
|
||||
>
|
||||
<img src="@/assets/icons/ES_Mode/button-play.svg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stop button (active or inactive depending on conditions) -->
|
||||
<div style="min-width: 30px;">
|
||||
<div
|
||||
style="display: flex;"
|
||||
v-if="parameter.ACTIVATE_ELECTRODE === 1 && parameter.WORKING_ELECTRODE[index] === 0 && parameter.ELECTRODE_SELECTOR[index] === true"
|
||||
>
|
||||
<img src="@/assets/icons/ES_Mode/button-stop-active.svg">
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
style="display: flex; cursor: pointer;"
|
||||
@click="stopElectrode(index)"
|
||||
>
|
||||
<img src="@/assets/icons/ES_Mode/button-stop.svg">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right side: Pulse Pattern section -->
|
||||
<div class="flex xl6 lg6 py-0" style="padding-right: 0;">
|
||||
<div class="centered-item">
|
||||
<span>Pulse Pattern</span>
|
||||
<div class="underline"></div>
|
||||
</div>
|
||||
|
||||
<!-- Looping over pulse pattern options to render radio buttons -->
|
||||
<div class="radio-item" style="padding: 0.25rem; line-height: 30px; justify-content: space-evenly;" v-for="(option, index) in channelOption" :key="'electrode-2-' + option">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<!-- Radio button for pattern 1 -->
|
||||
<input
|
||||
style="margin-right: 0.25rem; cursor: pointer;"
|
||||
type="radio"
|
||||
:name="'pulse-pattern-' + index"
|
||||
:value="0"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
v-model="parameter.PATTERN_SELECTOR[index]"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@click="bindingPattern(index, 0)"
|
||||
/>
|
||||
<span class="number">1</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<!-- Radio button for pattern 2 -->
|
||||
<input
|
||||
style="margin-right: 0.25rem; cursor: pointer;"
|
||||
type="radio"
|
||||
:name="'pulse-pattern-' + index"
|
||||
:value="1"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
v-model="parameter.PATTERN_SELECTOR[index]"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@click="bindingPattern(index, 1)"
|
||||
/>
|
||||
<span class="number">2</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Section for Pulse Patterns 1 and 2 -->
|
||||
<div v-for="(value, index) in [1,2]" class="controls" style="width: 100%; margin-bottom: 1rem;" :key="'pattern-' + index">
|
||||
<p style="font-size: 18px; font-family: 'Inter-Bold';">Pulse Pattern {{ value }}</p>
|
||||
<div class="row flex xl12 lg12" style="margin-top: 0.5rem; padding: 0 0.25rem; font-family: 'Inter';" >
|
||||
|
||||
<!-- Left column: Input fields for Amplitude and Pulse Width -->
|
||||
<div class="flex xl6 lg6 py-0">
|
||||
<div>
|
||||
<p>Amplitude</p>
|
||||
<!-- Amplitude input field -->
|
||||
<va-input
|
||||
v-model="parameter.AMPLITUDE[index]"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@blur="valueChecked('AMPLITUDE', index)"
|
||||
@keyup.enter="valueChecked('AMPLITUDE', index)"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
mA
|
||||
</p>
|
||||
</va-input>
|
||||
|
||||
<p>Pulse Width</p>
|
||||
<!-- Pulse Width input field -->
|
||||
<va-input
|
||||
v-model="parameter.PULSE_WIDTH[index]"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@blur="valueChecked('PULSE_WIDTH', index)"
|
||||
@keyup.enter="valueChecked('PULSE_WIDTH', index)"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
µs
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column: Radio buttons for Mode selection and Frequency input -->
|
||||
<div class="flex xl6 lg6 py-0" style="align-content: flex-end;">
|
||||
<!-- Radio button for Burst Mode -->
|
||||
<div class="radio-item" style="margin-bottom: 2rem; gap: 8px;">
|
||||
<input
|
||||
type="radio"
|
||||
style="cursor: pointer;"
|
||||
:value="0"
|
||||
v-model="parameter.PATTERN_MODE[index]"
|
||||
:name="'pulse-mode-' + index"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@click="patternModeChange(index, 0)"
|
||||
/>
|
||||
<span class="number">Burst Mode</span>
|
||||
</div>
|
||||
|
||||
<!-- Radio button for Frequency Mode -->
|
||||
<div class="radio-item" style="gap: 8px;">
|
||||
<input
|
||||
type="radio"
|
||||
style="cursor: pointer;"
|
||||
:value="1"
|
||||
v-model="parameter.PATTERN_MODE[index]"
|
||||
:name="'pulse-mode-' + index"
|
||||
:class="parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
:disabled="parameter.ACTIVATE_ELECTRODE === 1"
|
||||
@click="patternModeChange(index, 1)"
|
||||
/>
|
||||
<span class="number">Frequency</span>
|
||||
</div>
|
||||
|
||||
<!-- Frequency input field (enabled only in Frequency mode) -->
|
||||
<div>
|
||||
<va-input
|
||||
v-model="parameter.FREQUENCY[index]"
|
||||
@keyup.enter="valueChecked('FREQUENCY', index)"
|
||||
@blur="valueChecked('FREQUENCY', index)"
|
||||
:class="parameter.PATTERN_MODE[index] === 0 || parameter.ACTIVATE_ELECTRODE === 1 ? 'disable-input': ''"
|
||||
:disabled="parameter.PATTERN_MODE[index] === 0 || parameter.ACTIVATE_ELECTRODE === 1"
|
||||
>
|
||||
<p slot="append" style="margin-right: 0;" small>
|
||||
Hz
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PulseOutputSettings',
|
||||
|
||||
// Props passed from the parent component
|
||||
props: {
|
||||
parameter: {
|
||||
type: Object,
|
||||
default: () => {}, // Default to an empty object if no parameter is provided
|
||||
},
|
||||
parameterTable: {
|
||||
type: Object,
|
||||
default: () => {}, // Default to an empty object for parameterTable
|
||||
},
|
||||
order: Number, // Numerical order for the component (could be used to track different instances)
|
||||
pulsePattern: Number, // Indicates the pulse pattern selected (1 or 2)
|
||||
status: String, // Status indicator (could be used for component state, e.g., active/inactive)
|
||||
},
|
||||
|
||||
computed: {
|
||||
// No computed properties defined in this component
|
||||
},
|
||||
|
||||
// Component's local data
|
||||
data () {
|
||||
return {
|
||||
selectedValue: [], // Stores selected values for the UI components
|
||||
selectedPattern: null, // Stores the currently selected pattern
|
||||
channelOption: [1, 2, 3, 4], // Available channel options (4 channels for example)
|
||||
pulsePatternItems: [ // List of pulse pattern items (1 and 2)
|
||||
{ value: 1 },
|
||||
{ value: 2 },
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
// Methods that define behavior
|
||||
methods: {
|
||||
// Toggles the electrode selector for a given index and emits the change
|
||||
selectedElectrode (index) {
|
||||
// Toggle the boolean value in ELECTRODE_SELECTOR
|
||||
this.parameter.ELECTRODE_SELECTOR[index] = !this.parameter.ELECTRODE_SELECTOR[index]
|
||||
// Emit the change to the parent component
|
||||
this.parameterChange('ELECTRODE_SELECTOR', this.parameter.ELECTRODE_SELECTOR)
|
||||
},
|
||||
|
||||
// Handles the change of pulse pattern mode (either Frequency or Burst mode)
|
||||
patternModeChange (index, value) {
|
||||
// Set the frequency based on the selected mode
|
||||
if (value === 1) {
|
||||
this.parameter.FREQUENCY[index] = 1 // Set frequency to 1 for Frequency mode
|
||||
} else {
|
||||
this.parameter.FREQUENCY[index] = 0 // Set frequency to 0 for Burst mode
|
||||
}
|
||||
// Update PATTERN_MODE and emit the change
|
||||
this.parameter.PATTERN_MODE[index] = value
|
||||
this.parameterChange('PATTERN_MODE', this.parameter.PATTERN_MODE)
|
||||
this.parameterChange('FREQUENCY', this.parameter.FREQUENCY)
|
||||
},
|
||||
|
||||
// Binds the selected pattern to the specified electrode groups
|
||||
bindingPattern (index, value) {
|
||||
const temp = value
|
||||
// Set the pattern for the first two electrodes if index is 0 or 1
|
||||
if (index === 0 || index === 1) {
|
||||
this.parameter.PATTERN_SELECTOR[0] = temp
|
||||
this.parameter.PATTERN_SELECTOR[1] = temp
|
||||
// Set the pattern for the second group of electrodes if index is 2 or 3
|
||||
} else if (index === 2 || index === 3) {
|
||||
this.parameter.PATTERN_SELECTOR[2] = temp
|
||||
this.parameter.PATTERN_SELECTOR[3] = temp
|
||||
}
|
||||
// Emit the updated PATTERN_SELECTOR
|
||||
this.parameterChange('PATTERN_SELECTOR', this.parameter.PATTERN_SELECTOR)
|
||||
},
|
||||
|
||||
// Starts the electrode for the specified index
|
||||
startElectrode (index) {
|
||||
// Check if the electrode can be activated
|
||||
if (this.parameter.ACTIVATE_ELECTRODE === 0 || this.parameter.ELECTRODE_SELECTOR[index] === false) {
|
||||
return // Do nothing if the electrode is not selected or activation is off
|
||||
}
|
||||
// Toggle the WORKING_ELECTRODE state and emit the change
|
||||
this.parameter.WORKING_ELECTRODE[index] = !this.parameter.WORKING_ELECTRODE[index]
|
||||
this.parameterChange('WORKING_ELECTRODE', this.parameter.WORKING_ELECTRODE)
|
||||
// Send an instruction to start the electrode (external function call)
|
||||
this.sendInstruction('resume_electrode_' + index)
|
||||
},
|
||||
|
||||
// Stops the electrode for the specified index
|
||||
stopElectrode (index) {
|
||||
// Check if the electrode can be deactivated
|
||||
if (this.parameter.ACTIVATE_ELECTRODE === 0 || this.parameter.ELECTRODE_SELECTOR[index] === false) {
|
||||
return // Do nothing if the electrode is not selected or activation is off
|
||||
}
|
||||
// Toggle the WORKING_ELECTRODE state and emit the change
|
||||
this.parameter.WORKING_ELECTRODE[index] = !this.parameter.WORKING_ELECTRODE[index]
|
||||
this.parameterChange('WORKING_ELECTRODE', this.parameter.WORKING_ELECTRODE)
|
||||
// Send an instruction to stop the electrode (external function call)
|
||||
this.sendInstruction('suspend_electrode_' + index)
|
||||
},
|
||||
|
||||
// Ensures the value is within the acceptable range, rounded to the grid
|
||||
valueChecked (parameterName, index) {
|
||||
// Get the grid, minimum, and maximum values from the parameter table
|
||||
const grid = this.parameterTable[parameterName].grid
|
||||
const min = this.parameterTable[parameterName].range[0]
|
||||
const max = this.parameterTable[parameterName].range[1]
|
||||
|
||||
// Round the value to the nearest grid and ensure it is within bounds
|
||||
let value = Number(this.parameter[parameterName][index])
|
||||
value = Math.round(value / grid) * grid
|
||||
if (value < min) {
|
||||
value = min // Set to min if it's too small
|
||||
} else if (value > max) {
|
||||
value = max // Set to max if it's too large
|
||||
}
|
||||
|
||||
// Update the parameter and emit the change
|
||||
this.parameter[parameterName][index] = value
|
||||
this.parameterChange(parameterName, this.parameter[parameterName])
|
||||
},
|
||||
|
||||
// Emits the parameter change event to the parent component
|
||||
parameterChange (parameterName, value) {
|
||||
this.$emit('parameterChange', parameterName, value)
|
||||
},
|
||||
|
||||
// Sends instructions (e.g., start/stop electrode) to the parent component or external system
|
||||
sendInstruction: function (instr) {
|
||||
this.$emit('sendInstruction', instr)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.centered-container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.centered-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered-item span {
|
||||
display: block;
|
||||
font-family: 'Inter';
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.container {
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.radio-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.radio-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.disable-input {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
input[type="radio"] {
|
||||
/* remove standard background appearance */
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
/* create custom radiobutton appearance */
|
||||
display: inline-block;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
padding: 2px;
|
||||
|
||||
/* background-color only for content */
|
||||
background-clip: content-box;
|
||||
border: 2px solid #bbbbbb;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* appearance for checked radiobutton */
|
||||
input[type="radio"]:checked {
|
||||
background-color: #858dd5;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
/* remove standard background appearance */
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
/* create custom radiobutton appearance */
|
||||
display: inline-block;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
padding: 2px;
|
||||
|
||||
/* background-color only for content */
|
||||
background-clip: content-box;
|
||||
border: 2px solid #bbbbbb;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* appearance for checked radiobutton */
|
||||
input[type="checkbox"]:checked {
|
||||
background-color: #858dd5;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div>
|
||||
<va-modal
|
||||
v-model="showModal"
|
||||
hideDefaultActions
|
||||
noOutsideDismiss
|
||||
>
|
||||
<div class="timer-container">
|
||||
<h2 style="font-size: 20px;">Timer</h2>
|
||||
<div class="timer-inputs">
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="hours"
|
||||
min="0"
|
||||
class="time-input"
|
||||
@click="mode = null"
|
||||
/><span style="padding-left: 10px;">h</span>
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="minutes"
|
||||
min="0"
|
||||
class="time-input"
|
||||
@click="mode = null"
|
||||
/><span style="padding-left: 10px;">m</span>
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="seconds"
|
||||
min="0"
|
||||
class="time-input"
|
||||
@click="mode = null"
|
||||
/><span style="padding-left: 10px;">s</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mode-selection">
|
||||
<input
|
||||
type="radio"
|
||||
id="continueMode"
|
||||
:value="'infinity'"
|
||||
:checked="mode === 'infinity'"
|
||||
@click="toggleMode"
|
||||
/>
|
||||
<label
|
||||
for="continueMode"
|
||||
class="radio-text"
|
||||
>continuous mode, ∞</label>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-end;">
|
||||
<p class="time-text">{{ formattedTime }}</p>
|
||||
<va-button @click="setTimer" small>SET</va-button>
|
||||
</div>
|
||||
</div>
|
||||
</va-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'TimerModal',
|
||||
props: {
|
||||
parameter: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
formattedTime () {
|
||||
let totalSeconds = 0
|
||||
totalSeconds += (parseInt(this.seconds) || 0)
|
||||
totalSeconds += (parseInt(this.minutes) || 0) * 60
|
||||
totalSeconds += (parseInt(this.hours) || 0) * 3600
|
||||
|
||||
const hh = Math.floor(totalSeconds / 3600)
|
||||
totalSeconds %= 3600
|
||||
const mm = Math.floor(totalSeconds / 60)
|
||||
const ss = totalSeconds % 60
|
||||
|
||||
// Now conditionally format the output:
|
||||
let formatted = ''
|
||||
if (hh > 0) {
|
||||
formatted += `${hh} h `
|
||||
}
|
||||
if (mm > 0) {
|
||||
formatted += `${mm} m `
|
||||
}
|
||||
if (ss > 0) {
|
||||
formatted += `${ss} s`
|
||||
}
|
||||
|
||||
return formatted.trim() // Ensure there are no trailing spaces
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
hours: '',
|
||||
minutes: '',
|
||||
seconds: '',
|
||||
mode: null,
|
||||
showModal: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleMode () {
|
||||
// If the mode is already selected, uncheck it (set it to null)
|
||||
if (this.mode === 'infinity') {
|
||||
this.mode = null
|
||||
} else {
|
||||
this.mode = 'infinity' // Otherwise, select the 'infinity' mode
|
||||
this.hours = ' '
|
||||
this.minutes = ' '
|
||||
this.seconds = ' '
|
||||
}
|
||||
},
|
||||
setTimer () {
|
||||
// Your logic to handle timer setting, like validation or starting the timer
|
||||
console.log('Timer set with', this.hours, this.minutes, this.seconds, this.mode)
|
||||
|
||||
let totalSeconds = 0
|
||||
|
||||
if (this.seconds > 0) {
|
||||
totalSeconds += parseInt(this.seconds)
|
||||
}
|
||||
|
||||
if (this.minutes > 0) {
|
||||
totalSeconds += parseInt(this.minutes) * 60
|
||||
}
|
||||
|
||||
if (this.hours > 0) {
|
||||
totalSeconds += parseInt(this.hours) * 3600
|
||||
}
|
||||
|
||||
this.$emit('parameterChange', 'STOP_TIME', totalSeconds)
|
||||
this.$emit('parameterChange', 'CONTINUE_MODE', this.mode === 'infinity' ? 1 : 0)
|
||||
this.hide()
|
||||
},
|
||||
initParameter () {
|
||||
this.mode = this.parameter.CONTINUE_MODE === 1 ? 'infinity' : null
|
||||
if (this.parameter.CONTINUE_MODE === 1) return
|
||||
|
||||
let totalSeconds = this.parameter.STOP_TIME
|
||||
const hh = Math.floor(totalSeconds / 3600)
|
||||
totalSeconds %= 3600
|
||||
|
||||
const mm = Math.floor(totalSeconds / 60)
|
||||
const ss = totalSeconds % 60
|
||||
|
||||
this.hours = hh > 0 ? hh : ''
|
||||
this.minutes = mm > 0 ? mm : ''
|
||||
this.seconds = ss > 0 ? ss : ''
|
||||
},
|
||||
show () {
|
||||
this.initParameter()
|
||||
this.showModal = true
|
||||
},
|
||||
hide () {
|
||||
this.showModal = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.timer-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
/* align-items: center; */
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.timer-inputs {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.time-input {
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
text-align: right;
|
||||
font-size: 1.2em;
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.mode-selection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
input[type="radio"] {
|
||||
/* remove standard background appearance */
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
/* create custom radiobutton appearance */
|
||||
display: inline-block;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
padding: 2px;
|
||||
|
||||
/* background-color only for content */
|
||||
background-clip: content-box;
|
||||
border: 2px solid #bbbbbb;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* appearance for checked radiobutton */
|
||||
input[type="radio"]:checked {
|
||||
background-color: #858dd5;
|
||||
}
|
||||
|
||||
.radio-text {
|
||||
font-family: Inter;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.time-text {
|
||||
font-family: Inter;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 19.36px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.disable-infinite-input {
|
||||
color: #bdbdbd;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="height: 60vh; overflow-y: scroll; overflow-x: hidden; scrollbar-width: none;">
|
||||
<va-toggle v-model="switchInput" @click.native="setSwitch" flat small></va-toggle>
|
||||
<div class="px-2">
|
||||
<div v-if="switchInput === true">
|
||||
<div>
|
||||
<h1 style="font-size: 20px;">Manual</h1>
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 0.5rem; margin-bottom: 1rem; width: 90%; justify-content: flex-start;">
|
||||
<input type="text" class="flex-item" v-model="input1" @blur="setPulse">
|
||||
<input type="text" class="flex-item" v-model="input2" @blur="setPulse">
|
||||
<input type="text" class="flex-item" v-model="input3" @blur="setPulse">
|
||||
<va-button class="pa-0 ma-0 mt-1 circle-button" @click="tag" small color="dark">S
|
||||
</va-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="switchInput === false">
|
||||
<div>
|
||||
<h1 style="font-size: 20px;">Pattern</h1>
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 0.5rem; margin-bottom: 1rem; width: 90%; justify-content: flex-start;">
|
||||
<input type="text" class="flex-item" v-model.lazy="input5" @blur="setPattern">
|
||||
<va-button id="" class="pa-0 ma-0 mt-1 circle-button" @click="tag" small color="dark">S
|
||||
</va-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { taskInfo } from '@/data/task/TaskInfo'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'PEL',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
device: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
input1: '0',
|
||||
input2: '0',
|
||||
input3: '0',
|
||||
input4: '0',
|
||||
input5: '0',
|
||||
switchInput: false,
|
||||
clickEvent: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapFields('', [
|
||||
'developerMode',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
setPulse: function () {
|
||||
this.setParameter('PULSE', [this.hexToInt(this.input1), this.hexToInt(this.input2), this.hexToInt(this.input3)])
|
||||
},
|
||||
setPulseWithSendInstruction: function (e) {
|
||||
const activeElement = document.activeElement
|
||||
if (activeElement && activeElement.tagName === 'INPUT') {
|
||||
activeElement.blur()
|
||||
}
|
||||
this.setParameter('PULSE', [this.hexToInt(this.input1), this.hexToInt(this.input2), this.hexToInt(this.input3)])
|
||||
this.tag()
|
||||
},
|
||||
setPattern: function () {
|
||||
this.setParameter('PATTERN', this.input5)
|
||||
},
|
||||
setPatternWithSendInstruction: function (e) {
|
||||
const activeElement = document.activeElement
|
||||
if (activeElement && activeElement.tagName === 'INPUT') {
|
||||
activeElement.blur()
|
||||
}
|
||||
this.setParameter('PATTERN', this.input5)
|
||||
this.tag()
|
||||
},
|
||||
setSwitch: function () {
|
||||
this.setParameter('PATTERN_SWITCH', this.switchInput)
|
||||
},
|
||||
intToHex: function (int) {
|
||||
return int.toString(2).padStart(4, '0')
|
||||
},
|
||||
hexToInt (hex) {
|
||||
return parseInt(hex, 2)
|
||||
},
|
||||
mqttPublish: function (topic, mes) {
|
||||
this.$mqtt.publish(topic, mes)
|
||||
},
|
||||
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,
|
||||
}))
|
||||
},
|
||||
tag: function () {
|
||||
this.mqttPublish(taskInfo.getTaskInfo().controllerID + '_user', JSON.stringify({
|
||||
header: 'device_instruction/0',
|
||||
device: this.device.mac_address,
|
||||
instruction: 'get_data',
|
||||
}))
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.input1 = this.intToHex(this.device.configuration.PULSE[0])
|
||||
this.input2 = this.intToHex(this.device.configuration.PULSE[1])
|
||||
this.input3 = this.intToHex(this.device.configuration.PULSE[2])
|
||||
this.input5 = this.device.configuration.PATTERN
|
||||
this.switchInput = Boolean(this.device.configuration.PATTERN_SWITCH)
|
||||
// add event listener for enter key
|
||||
this.clickEvent = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
if ([0, 1].includes(this.device.configuration.MODE)) {
|
||||
if (this.device.status === 1) {
|
||||
if (this.switchInput) {
|
||||
this.setPulseWithSendInstruction()
|
||||
} else {
|
||||
this.setPatternWithSendInstruction()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', this.clickEvent)
|
||||
},
|
||||
destroyed () {
|
||||
document.removeEventListener('keydown', this.clickEvent)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.no-dark-style-va-button {
|
||||
&:focus {
|
||||
filter: brightness(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
width: 55px; /* Max width of 75px */
|
||||
padding: 5px;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="height: 60vh; overflow-y: scroll; overflow-x: hidden; scrollbar-width: none;">
|
||||
<div>
|
||||
<h1 style="font-size: 20px;">Pattern Set</h1>
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 0.5rem; margin-bottom: 1rem; width: 90%; justify-content: flex-start; align-items: center;">
|
||||
<span>From</span> <input type="text" class="flex-item mx-2" v-model="inputMin" @blur="setPatternMin">
|
||||
<span>To</span> <input type="text" class="flex-item mx-2" v-model="inputMax" @blur="setPatternMax">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { taskInfo } from '@/data/task/TaskInfo'
|
||||
import { mapFields } from 'vuex-map-fields'
|
||||
|
||||
export default {
|
||||
name: 'PEL_1',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
device: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
input1: '0',
|
||||
input2: '0',
|
||||
input3: '0',
|
||||
input4: '0',
|
||||
input5: '0',
|
||||
inputMax: '0',
|
||||
inputMin: '0',
|
||||
switchInput: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapFields('', [
|
||||
'developerMode',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
setPulse: function () {
|
||||
this.setParameter('PULSE', [this.hexToInt(this.input1), this.hexToInt(this.input2), this.hexToInt(this.input3)])
|
||||
},
|
||||
setPattern: function () {
|
||||
this.setParameter('PATTERN', this.input5)
|
||||
},
|
||||
setPatternMax: function () {
|
||||
if (this.inputMax < this.inputMin) {
|
||||
this.inputMax = this.inputMin + 1
|
||||
} else if (this.inputMax > 100) {
|
||||
this.inputMax = 100
|
||||
}
|
||||
|
||||
this.setParameter('PATTERN_MAX', this.inputMax)
|
||||
},
|
||||
setPatternMin: function () {
|
||||
if (this.inputMax < this.inputMin) {
|
||||
this.inputMin = this.inputMax - 1
|
||||
} else if (this.inputMax < 1) {
|
||||
this.inputMin = 1
|
||||
}
|
||||
|
||||
this.setParameter('PATTERN_MIN', this.inputMin)
|
||||
},
|
||||
setSwitch: function () {
|
||||
this.setParameter('PATTERN_SWITCH', this.switchInput)
|
||||
},
|
||||
intToHex: function (int) {
|
||||
return int.toString(2).padStart(4, '0')
|
||||
},
|
||||
hexToInt (hex) {
|
||||
return parseInt(hex, 2)
|
||||
},
|
||||
mqttPublish: function (topic, mes) {
|
||||
this.$mqtt.publish(topic, mes)
|
||||
},
|
||||
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,
|
||||
}))
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.inputMax = this.device.configuration.PATTERN_MAX
|
||||
this.inputMin = this.device.configuration.PATTERN_MIN
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.no-dark-style-va-button {
|
||||
&:focus {
|
||||
filter: brightness(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
width: 55px; /* Max width of 75px */
|
||||
padding: 5px;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
|
||||
<div class="row">
|
||||
<div class="flex sm4 xl4 md4 xs4 my-1 py-0">
|
||||
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
|
||||
<p class="display-6"> CHANNEL {{ Number(channel) + 1 }} <p/>
|
||||
</div>
|
||||
<div class="flex sm3 xl3 md3 xs3 px-0 mx-0 my-0 py-0">
|
||||
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-0 py-0">
|
||||
<va-input
|
||||
class="mb-0 small-va-input"
|
||||
v-model="inputStringText"
|
||||
@@ -17,8 +17,8 @@
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="flex sm5 xl5 md5 xs5 px-0 mx-0 my-0 py-0">
|
||||
<va-toggle class="mb-0" v-model="channelToggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-0 py-0">
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sm11 xl12 md12 xs12 my-1 py-1">
|
||||
@@ -28,8 +28,8 @@
|
||||
:max="outputReadabilityData(range.max)"
|
||||
value-visible
|
||||
:step="10"
|
||||
:color="channelToggle === true ? 'primary' : 'gray'"
|
||||
:disabled="!channelToggle"
|
||||
:color="toggle === true ? 'primary' : 'gray'"
|
||||
:disabled="!toggle"
|
||||
v-model="inputSlider"
|
||||
/>
|
||||
</div>
|
||||
@@ -42,6 +42,14 @@ export default {
|
||||
components: {
|
||||
},
|
||||
computed: {
|
||||
toggle: {
|
||||
get () {
|
||||
return Boolean(this.inputValue[this.toggleName])
|
||||
},
|
||||
set (val) {
|
||||
this.channelToggle = val
|
||||
},
|
||||
},
|
||||
inputStringText: {
|
||||
get () {
|
||||
return String(this.outputReadabilityData(this.inputValue[this.parameterName]))
|
||||
@@ -98,7 +106,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
inputString: '',
|
||||
channelToggle: Boolean(this.inputValue[this.toggleName]),
|
||||
channelToggle: false,
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div :class="disabled === true ? 'flex d-flex py-1 disabled-text' : 'flex d-flex py-1'" style="align-items: center;">
|
||||
<div style="flex-basis: 25%;">
|
||||
<span>{{ showName }}</span>
|
||||
</div>
|
||||
<div v-if="onlyButton === true && disabled === true" style="flex-basis: 50%; display: flex; align-items: center; justify-content: center;">
|
||||
<img class="button-flat" src="@/assets/icons/button-disable.svg"/>
|
||||
</div>
|
||||
<div v-else-if="onlyButton === true && inputValue === false" style="flex-basis: 50%; display: flex; align-items: center; justify-content: center;" @click="inputChange(true)">
|
||||
<img class="button-flat" src="@/assets/icons/button-off.svg"/>
|
||||
</div>
|
||||
<div v-else-if="onlyButton === true && inputValue === true" style="flex-basis: 50%; display: flex; align-items: center; justify-content: center;" @click="inputChange(false)">
|
||||
<img class="button-flat" src="@/assets/icons/button-on.svg"/>
|
||||
</div>
|
||||
<div v-else style="flex-basis: 50%; align-items: center; text-align: -webkit-right;">
|
||||
<va-input class="mr-2" style="margin-bottom: 0; width: 100px; color: green;"
|
||||
@keyup.enter="inputChange(inputString)"
|
||||
@blur="inputChange(inputString)"
|
||||
v-model="inputStringModel"
|
||||
:disabled="disabled">
|
||||
<p v-if="withToggleButton === true" slot="append" style="margin-right: 0;" small>
|
||||
{{ unitSelect }}
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div v-if="withToggleButton === false" style="flex-basis: 25%; align-items: center;">
|
||||
{{ unitSelect }}
|
||||
</div>
|
||||
<div v-if="withToggleButton === true && disabled === true" style="flex-basis: 25%; align-items: center; display: inline-flex;">
|
||||
<img class="button-dot" src="@/assets/icons/button-dot-off.svg">
|
||||
</div>
|
||||
<div v-else-if="withToggleButton === true && toggleValue === false" style="flex-basis: 25%; align-items: center; display: inline-flex;" @click="toggleChange(true)">
|
||||
<img class="button-dot" src="@/assets/icons/button-dot-off.svg">
|
||||
</div>
|
||||
<div v-else-if="withToggleButton === true && toggleValue === true" style="flex-basis: 25%; align-items: center; display: inline-flex;" @click="toggleChange(false)">
|
||||
<img class="button-dot" src="@/assets/icons/button-dot-on.svg">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'InputFieldWithHeader',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
templateType: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
onlyButton: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
withHeader: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
withUnitButton: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
withToggleButton: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
parameterName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
showName: {
|
||||
type: String,
|
||||
},
|
||||
range: {
|
||||
type: Object,
|
||||
},
|
||||
inputValue: {
|
||||
type: [Number, String, Boolean],
|
||||
required: true,
|
||||
},
|
||||
referenceValue: {
|
||||
type: Object,
|
||||
},
|
||||
defaultUnit: {
|
||||
type: String,
|
||||
},
|
||||
unit: {
|
||||
type: Object,
|
||||
},
|
||||
outputReadabilityData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
outputRawData: {
|
||||
type: Function,
|
||||
default: (val) => val,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
},
|
||||
toggleParameter: {
|
||||
type: String,
|
||||
},
|
||||
toggleValue: {
|
||||
type: [Number, Boolean],
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
computed: {
|
||||
inputStringModel: {
|
||||
get () {
|
||||
return String(this.outputReadabilityData(this.inputValue))
|
||||
},
|
||||
set (val) {
|
||||
this.inputString = val
|
||||
},
|
||||
},
|
||||
unitLength () {
|
||||
return Object.keys(this.unit).length
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
unitSelect: this.defaultUnit,
|
||||
unitButtonClicked: '',
|
||||
inputString: '',
|
||||
size: {
|
||||
12: 'flex sm12 xl12 md12 xs12 px-0 mx-0',
|
||||
6: 'flex sm6 xl6 md6 xs6 px-0 mx-0',
|
||||
5: 'flex sm5 xl5 md5 xs5 px-0 mx-0 my-0 py-0',
|
||||
4: 'flex sm4 xl4 md4 xs4 px-0 mx-0 my-0 py-0',
|
||||
3: 'flex sm3 xl3 md3 xs3 px-0 mx-0 my-0 py-0',
|
||||
},
|
||||
style: {
|
||||
header: '',
|
||||
content: '',
|
||||
unitButton: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
},
|
||||
methods: {
|
||||
inputChange: function (val) {
|
||||
/** */
|
||||
let scale = 1
|
||||
if (this.unitSelect) {
|
||||
scale = this.unit[this.unitSelect]
|
||||
}
|
||||
// if change from input field
|
||||
if (typeof (val) === 'string') {
|
||||
if (isNaN(val) || val === '') {
|
||||
return false
|
||||
}
|
||||
val = this.outputRawData(val, scale)
|
||||
if (parseFloat(val) < this.range.min) {
|
||||
val = this.range.min
|
||||
} else if (parseFloat(val) > this.range.max) {
|
||||
val = this.range.max
|
||||
}
|
||||
}
|
||||
/** if parameter is array with index needs to return */
|
||||
if (this.index === -1) {
|
||||
this.$emit('parameterChange', this.parameterName, val)
|
||||
} else {
|
||||
this.$emit('parameterChangeByIndex', this.parameterName, val, this.index)
|
||||
}
|
||||
},
|
||||
unitChange: function () {
|
||||
this.unitButtonClicked += 1
|
||||
this.unitSelect = Object.keys(this.unit)[this.unitButtonClicked % this.unitLength]
|
||||
},
|
||||
toggleChange: function (val) {
|
||||
this.$emit('parameterChangeByIndex', this.toggleParameter, val, this.index)
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
if (this.withHeader === true && this.withUnitButton === true) {
|
||||
this.style.header = this.size[5]
|
||||
this.style.content = this.size[4]
|
||||
this.style.unitButton = this.size[3]
|
||||
} else if (this.withHeader === true) {
|
||||
this.style.header = this.size[6]
|
||||
this.style.content = this.size[6]
|
||||
} else {
|
||||
this.style.content = this.size[12]
|
||||
}
|
||||
},
|
||||
destroyed () {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.button-dot {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.button-flat {
|
||||
height: 20px;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
.disabled-text {
|
||||
color: #c2c2c2;
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="flex sm12 xl12 md12 xs12 mb-2 pb-1 align--center">
|
||||
<div class="row">
|
||||
<div class="flex sm4 xl4 md4 xs4 my-1 py-0">
|
||||
<div class="flex sm12 xl5 md5 xs12 my-1 py-0">
|
||||
<p class="display-6 my-2"> Timer <p/>
|
||||
</div>
|
||||
<div class="flex sm3 xl3 md3 xs3 px-0 mx-0 my-2 py-0">
|
||||
<div class="flex sm12 xl3 md3 xs12 px-0 mx-0 my-2 py-0">
|
||||
<va-input
|
||||
class="mb-0 small-va-input"
|
||||
v-model="inputStringText"
|
||||
:disabled="!timerToggle"
|
||||
:disabled="!toggle"
|
||||
@keyup.enter="inputChange(inputString)"
|
||||
@blur="inputChange(inputString)"
|
||||
>
|
||||
@@ -17,8 +17,8 @@
|
||||
</p>
|
||||
</va-input>
|
||||
</div>
|
||||
<div class="flex sm5 xl5 md5 xs5 px-0 mx-0 my-2 py-0">
|
||||
<va-toggle class="mb-0" v-model="timerToggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
<div class="flex sm12 xl4 md4 xs12 px-0 mx-0 my-2 py-0">
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="sm11 xl12 md12 xs12 my-1 py-1">
|
||||
@@ -58,6 +58,14 @@ export default {
|
||||
this.inputChange(val)
|
||||
},
|
||||
},
|
||||
toggle: {
|
||||
get () {
|
||||
return !(this.inputValue[this.parameterName] === 0)
|
||||
},
|
||||
set (val) {
|
||||
this.timerToggle = val
|
||||
},
|
||||
},
|
||||
},
|
||||
props: {
|
||||
inputValue: {
|
||||
@@ -90,7 +98,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
inputString: '',
|
||||
timerToggle: !(this.inputValue[this.parameterName] === 0),
|
||||
timerToggle: false,
|
||||
}
|
||||
},
|
||||
mqtt: {
|
||||
|
||||
@@ -1,37 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="channel in channelList" :key="channel">
|
||||
<ChannelBlock
|
||||
:channel="channel"
|
||||
:inputValue="parameter"
|
||||
:parameterName="channelBlockCurrent(channel)"
|
||||
:toggleName="channelBlockToggle(channel)"
|
||||
v-bind="parameterTable[channelBlockCurrent()]"
|
||||
@parameterChange="parameterChange"
|
||||
></ChannelBlock>
|
||||
</div>
|
||||
<div class="row px-0 mx-0">
|
||||
<p class="my-2 mr-2 display-5"> ADVANCED SETTING </p>
|
||||
<!-- <va-toggle class="mb-0" flat small color="success" v-model="openAdvanced"/> -->
|
||||
</div>
|
||||
<div>
|
||||
<TimerBlock
|
||||
:inputValue="parameter"
|
||||
:parameterName="'TIME_DURATION'"
|
||||
v-bind="parameterTable.TIME_DURATION"
|
||||
@parameterChange="parameterChange"
|
||||
></TimerBlock>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="triggerIndex in triggerList" :key="'trigger_' + triggerIndex">
|
||||
<TriggerBlock
|
||||
:triggerIndex="triggerIndex"
|
||||
<div v-if="parameter.MODE === 0">
|
||||
<div v-for="channel in channelList" :key="channel">
|
||||
<ChannelBlock
|
||||
:channel="channel"
|
||||
:inputValue="parameter"
|
||||
:parameterName="triggerBlockType(triggerIndex)"
|
||||
:toggleName="triggerBlockEnable(triggerIndex)"
|
||||
v-bind="parameterTable[triggerBlockType()]"
|
||||
:parameterName="channelBlockCurrent(channel)"
|
||||
:toggleName="channelBlockToggle(channel)"
|
||||
v-bind="parameterTable[channelBlockCurrent(channel)]"
|
||||
@parameterChange="parameterChange"
|
||||
></TriggerBlock>
|
||||
></ChannelBlock>
|
||||
</div>
|
||||
<div class="row px-0 mx-0">
|
||||
<p class="my-2 mr-2 display-5"> ADVANCED SETTING </p>
|
||||
<!-- <va-toggle class="mb-0" flat small color="success" v-model="openAdvanced"/> -->
|
||||
</div>
|
||||
<div>
|
||||
<TimerBlock
|
||||
:inputValue="parameter"
|
||||
:parameterName="'TIME_DURATION'"
|
||||
v-bind="parameterTable.TIME_DURATION"
|
||||
@parameterChange="parameterChange"
|
||||
></TimerBlock>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="triggerIndex in triggerList" :key="'trigger_' + triggerIndex">
|
||||
<TriggerBlock
|
||||
:triggerIndex="triggerIndex"
|
||||
:inputValue="parameter"
|
||||
:parameterName="triggerBlockType(triggerIndex)"
|
||||
:toggleName="triggerBlockEnable(triggerIndex)"
|
||||
v-bind="parameterTable[triggerBlockType()]"
|
||||
@parameterChange="parameterChange"
|
||||
></TriggerBlock>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<div class="row flex sm12 xl12 md12 xs12 ma-0 pa-0">
|
||||
<div class="d-flex sm12 xl12 md12 xs12 my-0 py-0">
|
||||
<div class="flex sm8 xl8 md8 xs8 my-1 py-0">
|
||||
<p class="display-6 my-2"> TRIGGER IN {{ triggerIndex }} <p/>
|
||||
<p class="display-6 my-2"> TRIGGER IN {{ triggerIndex + 1 }} <p/>
|
||||
</div>
|
||||
<div class="flex sm4 xl4 md4 xs4 ma-0 pa-0 my-2">
|
||||
<va-toggle class="mb-0" v-model="triggerToggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
<va-toggle class="mb-0" v-model="toggle" color="success" style="float: right;" flat small @click.native="switchToggle()"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex sm12 xl12 md12 xs12 pa-0 ma-0">
|
||||
@@ -16,7 +16,7 @@
|
||||
v-model="selectTrigger"
|
||||
:option="optionTrigger[index]"
|
||||
:label="optionTrigger[index]"
|
||||
:disabled="!triggerToggle"
|
||||
:disabled="!toggle"
|
||||
@click.native.stop="inputChange(index)"
|
||||
/>
|
||||
</div>
|
||||
@@ -62,6 +62,16 @@ export default {
|
||||
default: (val) => val,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
toggle: {
|
||||
get () {
|
||||
return Boolean(this.inputValue[this.toggleName])
|
||||
},
|
||||
set (val) {
|
||||
this.triggerToggle = val
|
||||
},
|
||||
},
|
||||
},
|
||||
created () {
|
||||
},
|
||||
data () {
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="channel of [0,1,2,3,4,5,6,7]" :key="channel">
|
||||
<button class="accordion">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div class="d-flex align--center">
|
||||
<i v-if="panelSpread.includes(channel) === false" class="va-icon fa fa-angle-right mr-1" style="width: 15px;"></i>
|
||||
<i v-if="panelSpread.includes(channel) === true" class="va-icon fa fa-angle-down mr-1" style="width: 15px;"></i>
|
||||
<span>{{ channelName[channel] }}</span>
|
||||
</div>
|
||||
<div class="d-flex align--center">
|
||||
<va-toggle class="mb-0" color="#2CE9A4" :value="parameter.USED[channel]" style="float: right;" flat small @click.native.stop="parameterChangeByIndex('USED', !parameter.USED[channel], channel)"/>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
<div class="panel">
|
||||
<InputFieldWithToggle
|
||||
v-if="[2,3].indexOf(channel) >= 0"
|
||||
style="margin-bottom: 0.5rem;"
|
||||
:index="channel"
|
||||
:parameterName="'OUTPUT_5V'"
|
||||
:inputValue="parameter.OUTPUT_5V[channel]"
|
||||
:onlyButton="true"
|
||||
:disabled="channel === 2 ? true: !parameter.USED[channel]"
|
||||
v-bind="parameterTable.OUTPUT_5V"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
v-if="[4,5,6,7].indexOf(channel) >= 0"
|
||||
:index="channel"
|
||||
:parameterName="'CURRENT'"
|
||||
:inputValue="parameter.CURRENT[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.CURRENT"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<!-- pre-T -->
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_EARLY'"
|
||||
:inputValue="parameter.T_EARLY[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_EARLY'"
|
||||
:toggleValue="parameter.V_EARLY[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_EARLY"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'CYCLE'"
|
||||
:inputValue="parameter.CYCLE[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.CYCLE"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_MID0'"
|
||||
:inputValue="parameter.T_MID0[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_MID0'"
|
||||
:toggleValue="parameter.V_MID0[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_MID0"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_MID1'"
|
||||
:inputValue="parameter.T_MID1[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_MID1'"
|
||||
:toggleValue="parameter.V_MID1[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_MID1"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_MID2'"
|
||||
:inputValue="parameter.T_MID2[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_MID2'"
|
||||
:toggleValue="parameter.V_MID2[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_MID2"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_MID3'"
|
||||
:inputValue="parameter.T_MID3[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_MID3'"
|
||||
:toggleValue="parameter.V_MID3[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_MID3"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
<InputFieldWithToggle
|
||||
:index="channel"
|
||||
:parameterName="'T_LATE'"
|
||||
:inputValue="parameter.T_LATE[channel]"
|
||||
:withToggleButton="true"
|
||||
:toggleParameter="'V_LATE'"
|
||||
:toggleValue="parameter.V_LATE[channel]"
|
||||
:disabled="!parameter.USED[channel]"
|
||||
v-bind="parameterTable.T_LATE"
|
||||
@parameterChange="parameterChange"
|
||||
@parameterChangeByIndex="parameterChangeByIndex"
|
||||
></InputFieldWithToggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import InputFieldWithToggle from './InputFieldWithToggle.vue'
|
||||
export default {
|
||||
name: 'Trigger',
|
||||
components: {
|
||||
InputFieldWithToggle,
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
props: {
|
||||
parameter: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
parameterTable: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
panelSpread: [],
|
||||
channelName: [
|
||||
'Gas valve 1',
|
||||
'Gas valve 2',
|
||||
'Gas valve 3',
|
||||
'5V TTL',
|
||||
'LED 1',
|
||||
'LED 2',
|
||||
'LED 3',
|
||||
'LED 4',
|
||||
],
|
||||
channelList: [0, 1, 2, 3],
|
||||
triggerList: [0, 1],
|
||||
openAdvanced: Boolean(this.parameter.TRIG0_en || this.parameter.TRIG1_en),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
channelBlockToggle (channelIndex) {
|
||||
let name = 'ACC_a_out'
|
||||
if (channelIndex !== undefined) {
|
||||
name += channelIndex
|
||||
}
|
||||
return name
|
||||
},
|
||||
channelBlockCurrent (channelIndex) {
|
||||
let name = 'ACC_a_out'
|
||||
if (channelIndex !== undefined) {
|
||||
name += channelIndex
|
||||
}
|
||||
name += '_current'
|
||||
return name
|
||||
},
|
||||
triggerBlockEnable (triggerIndex) {
|
||||
let name = 'TRIG'
|
||||
if (triggerIndex !== undefined) {
|
||||
name += triggerIndex
|
||||
}
|
||||
name += '_en'
|
||||
return name
|
||||
},
|
||||
triggerBlockType (triggerIndex) {
|
||||
let name = 'TRIG'
|
||||
if (triggerIndex !== undefined) {
|
||||
name += triggerIndex
|
||||
}
|
||||
name += '_edge_type'
|
||||
return name
|
||||
},
|
||||
parameterChange: function (name, value, debounce) {
|
||||
this.$emit('parameterChange', name, value, debounce)
|
||||
},
|
||||
parameterChangeByIndex: function (name, value, index) {
|
||||
if (name.indexOf('V_MID') >= 0) {
|
||||
console.log('sadsaasdadadad')
|
||||
if (name === 'V_MID0' || name === 'V_MID2') {
|
||||
this.parameter.V_MID0.splice(index, 1, value)
|
||||
this.parameter.V_MID2.splice(index, 1, value)
|
||||
this.parameter.V_MID1.splice(index, 1, !value)
|
||||
this.parameter.V_MID3.splice(index, 1, !value)
|
||||
}
|
||||
if (name === 'V_MID1' || name === 'V_MID3') {
|
||||
this.parameter.V_MID1.splice(index, 1, value)
|
||||
this.parameter.V_MID3.splice(index, 1, value)
|
||||
this.parameter.V_MID0.splice(index, 1, !value)
|
||||
this.parameter.V_MID2.splice(index, 1, !value)
|
||||
}
|
||||
this.$emit('parameterChange', 'V_MID0', this.parameter.V_MID0, false, true)
|
||||
this.$emit('parameterChange', 'V_MID1', this.parameter.V_MID1, false, true)
|
||||
this.$emit('parameterChange', 'V_MID2', this.parameter.V_MID2, false, true)
|
||||
this.$emit('parameterChange', 'V_MID3', this.parameter.V_MID3, false, true)
|
||||
}
|
||||
const _value = [...this.parameter[name]]
|
||||
_value[index] = value
|
||||
this.$emit('parameterChange', name, _value)
|
||||
},
|
||||
test: function (index) {
|
||||
console.log('index', index)
|
||||
// this.triggerUsed.splice(index, 1, !this.triggerUsed[index])
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
const acc = document.getElementsByClassName('accordion')
|
||||
const panelSpread = this.panelSpread
|
||||
|
||||
for (let i = 0; i < acc.length; i++) {
|
||||
acc[i].addEventListener('click', function () {
|
||||
this.classList.toggle('active')
|
||||
var panel = this.nextElementSibling
|
||||
if (panel.style.display === 'block') {
|
||||
panel.style.display = 'none'
|
||||
panelSpread.splice(panelSpread.indexOf(i), 1)
|
||||
} else {
|
||||
panel.style.display = 'block'
|
||||
panelSpread.push(i)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.accordion {
|
||||
background-color: white;
|
||||
cursor: pointer;
|
||||
padding: 18px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.panel {
|
||||
padding: 0 18px;
|
||||
display: none;
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.button-dot {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,98 @@
|
||||
export default {
|
||||
name: 'Dev Mode',
|
||||
parameter: ['ADC_VALUE_I'],
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
m: 60 * 1e6,
|
||||
h: 60 * 60 * 1e6,
|
||||
auto: 1,
|
||||
},
|
||||
defaultUnit: 'auto',
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Dev Mode',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
x1: {
|
||||
type: 'time',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
y1: {
|
||||
type: 'value',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
data: [
|
||||
{
|
||||
legend: 'dev',
|
||||
x1: {
|
||||
channel: 'time',
|
||||
},
|
||||
y1: {
|
||||
channel: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export default {
|
||||
name: 'Electrial Stimulation',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import EletricalStimulation from './EletricalStimulation'
|
||||
import DevMode from './DevMode'
|
||||
|
||||
/**
|
||||
* Number-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param range component-range
|
||||
* @param defaultValue default-value
|
||||
* @param defaultUnit default-unit
|
||||
* @param downloadUnit download-unit
|
||||
* @param unit unit-table
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Array-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param options select-options
|
||||
* @param range select-range
|
||||
* @param defaultValue default-value
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
const CPG = {
|
||||
ADC_VALUE_I: {
|
||||
type: 'none',
|
||||
showName: 'Instruction',
|
||||
componentType: 'dev-mode',
|
||||
},
|
||||
|
||||
PULSE_WIDTH: {
|
||||
type: 'number',
|
||||
showName: 'Pulse Width',
|
||||
componentType: 'input',
|
||||
range: [1, 10000],
|
||||
grid: 1,
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'us',
|
||||
downloadUnit: 'us',
|
||||
},
|
||||
|
||||
AMPLITUDE: {
|
||||
type: 'number',
|
||||
showName: 'Amplititude',
|
||||
componentType: 'input',
|
||||
range: [0.5, 50],
|
||||
grid: 0.5,
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: 'mA',
|
||||
},
|
||||
|
||||
FREQUENCY: {
|
||||
type: 'number',
|
||||
showName: 'Frequency',
|
||||
componentType: 'input',
|
||||
range: [1, 10000],
|
||||
grid: 1,
|
||||
defaultValue: 1,
|
||||
defaultUnit: 'Hz',
|
||||
downloadUnit: 'Hz',
|
||||
},
|
||||
|
||||
BurstMode: {
|
||||
type: 'bool',
|
||||
showName: 'Burst Mode',
|
||||
},
|
||||
|
||||
MODE_OPTIONS: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'Eletrical Stimulation',
|
||||
img_src: 'CPG_UI_infomation_figure',
|
||||
highz: 1,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'Dev Mode',
|
||||
img_src: 'DevM-Wire',
|
||||
},
|
||||
],
|
||||
MODE: {
|
||||
0: EletricalStimulation,
|
||||
1: DevMode,
|
||||
},
|
||||
}
|
||||
|
||||
export default CPG
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
},
|
||||
@@ -37,6 +39,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in/V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
},
|
||||
@@ -44,6 +47,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'Gain',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -29,6 +30,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
},
|
||||
@@ -36,6 +38,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in/V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -60,6 +64,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: 'sum_cnt',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -70,6 +75,7 @@ export default {
|
||||
},
|
||||
4: {
|
||||
name: 'sum_adc_delta_Iin',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -80,6 +86,7 @@ export default {
|
||||
},
|
||||
5: {
|
||||
name: 'sum_adc_delta_Voutin',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -90,6 +97,7 @@ export default {
|
||||
},
|
||||
6: {
|
||||
name: 'resis',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -60,6 +64,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: 'Cycle number',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
cycle: 1,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -60,6 +64,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: 'Cycle number',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
cycle: 1,
|
||||
},
|
||||
|
||||
@@ -23,6 +23,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -35,6 +36,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -45,6 +47,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -55,6 +58,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -65,6 +69,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: 'Cycle number',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
cycle: 1,
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -28,6 +29,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -35,6 +37,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -42,6 +45,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -49,6 +53,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -34,6 +34,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -46,6 +47,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in_pul1',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -56,6 +58,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'I_in_pul2',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'Resistor',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mΩ: 1,
|
||||
mohm: 1,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -520,7 +520,7 @@ const EliteZM15 = {
|
||||
return parseInt((parseFloat(val) - 25000) / 5) / scale
|
||||
},
|
||||
},
|
||||
VOLT_VSCAN: {
|
||||
CA_VOLT: {
|
||||
type: 'number',
|
||||
showName: 'Volt (v.s. ref)',
|
||||
componentType: 'input-range',
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Potential',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -31,6 +32,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'Z_Imag_Raw',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
ohm: 1,
|
||||
},
|
||||
@@ -39,14 +41,16 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Z_Real_Raw',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
default: 1,
|
||||
ohm: 1,
|
||||
},
|
||||
downloadUnit: 'ohm',
|
||||
defaultUnit: 'ohm',
|
||||
},
|
||||
2: {
|
||||
name: 'Frequency',
|
||||
physicalQuantity: 'Hz',
|
||||
unit: {
|
||||
mHz: 1,
|
||||
Hz: 1e3,
|
||||
@@ -65,6 +69,7 @@ export default {
|
||||
// },
|
||||
4: {
|
||||
name: 'Z_Imag',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -80,6 +85,7 @@ export default {
|
||||
},
|
||||
5: {
|
||||
name: 'Z_Real',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -95,6 +101,7 @@ export default {
|
||||
},
|
||||
6: {
|
||||
name: 'Impedance',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -110,6 +117,7 @@ export default {
|
||||
},
|
||||
7: {
|
||||
name: 'Phase',
|
||||
physicalQuantity: 'Degree',
|
||||
unit: {
|
||||
millidegree: 1,
|
||||
'°': 1e3,
|
||||
@@ -119,6 +127,7 @@ export default {
|
||||
},
|
||||
8: {
|
||||
name: 'Current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -129,6 +138,7 @@ export default {
|
||||
},
|
||||
9: {
|
||||
name: 'Level gain',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -137,6 +147,7 @@ export default {
|
||||
},
|
||||
10: {
|
||||
name: 'notify_one',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -145,6 +156,7 @@ export default {
|
||||
},
|
||||
11: {
|
||||
name: 'notify_two',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -153,6 +165,7 @@ export default {
|
||||
},
|
||||
12: {
|
||||
name: 'notify_three',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -161,11 +174,14 @@ export default {
|
||||
},
|
||||
13: {
|
||||
name: 'debug_amp[mV]',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
default: 1,
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
V: 1e6,
|
||||
},
|
||||
downloadUnit: null,
|
||||
defaultUnit: 'default',
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -31,6 +32,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -41,6 +43,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out-V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -51,6 +54,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -61,6 +65,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: 'Cycle',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
cycle: 1,
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -28,6 +29,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -35,6 +37,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -42,6 +45,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -49,6 +53,7 @@ export default {
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -31,6 +32,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'Z_Imag_Raw',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
ohm: 1,
|
||||
},
|
||||
@@ -39,14 +41,16 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'Z_Real_Raw',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
default: 1,
|
||||
ohm: 1,
|
||||
},
|
||||
downloadUnit: 'ohm',
|
||||
defaultUnit: 'ohm',
|
||||
},
|
||||
2: {
|
||||
name: 'Frequency',
|
||||
physicalQuantity: 'Hz',
|
||||
unit: {
|
||||
mHz: 1,
|
||||
Hz: 1e3,
|
||||
@@ -65,6 +69,7 @@ export default {
|
||||
// },
|
||||
4: {
|
||||
name: 'Z_Imag',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -80,6 +85,7 @@ export default {
|
||||
},
|
||||
5: {
|
||||
name: 'Z_Real',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -95,6 +101,7 @@ export default {
|
||||
},
|
||||
6: {
|
||||
name: 'Impedance',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mohm: 1e-3,
|
||||
mΩ: 1e-3,
|
||||
@@ -110,6 +117,7 @@ export default {
|
||||
},
|
||||
7: {
|
||||
name: 'Phase',
|
||||
physicalQuantity: 'Degree',
|
||||
unit: {
|
||||
millidegree: 1,
|
||||
'°': 1e3,
|
||||
@@ -119,6 +127,7 @@ export default {
|
||||
},
|
||||
8: {
|
||||
name: 'Current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -129,6 +138,7 @@ export default {
|
||||
},
|
||||
9: {
|
||||
name: 'Level gain',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -137,6 +147,7 @@ export default {
|
||||
},
|
||||
10: {
|
||||
name: 'notify_one',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -145,6 +156,7 @@ export default {
|
||||
},
|
||||
11: {
|
||||
name: 'notify_two',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -153,6 +165,7 @@ export default {
|
||||
},
|
||||
12: {
|
||||
name: 'notify_three',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
@@ -161,6 +174,7 @@ export default {
|
||||
},
|
||||
13: {
|
||||
name: 'debug_amp[mV]',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_out',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
@@ -50,6 +53,7 @@ export default {
|
||||
},
|
||||
2: {
|
||||
name: 'Resistor',
|
||||
physicalQuantity: 'R',
|
||||
unit: {
|
||||
mΩ: 1,
|
||||
mohm: 1,
|
||||
|
||||
@@ -18,6 +18,7 @@ export default {
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
},
|
||||
0: {
|
||||
name: 'I_in',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
nA: 1,
|
||||
uA: 1e3,
|
||||
@@ -40,6 +42,7 @@ export default {
|
||||
},
|
||||
1: {
|
||||
name: 'V_in',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
uV: 1,
|
||||
mV: 1e3,
|
||||
|
||||
@@ -93,16 +93,20 @@ const EliteEIS = {
|
||||
{ value: 1, label: '2' },
|
||||
{ value: 2, label: '3' },
|
||||
{ value: 3, label: '4' },
|
||||
{ value: 4, label: 'Auto' },
|
||||
{ value: 4, label: '5' },
|
||||
{ value: 5, label: '6' },
|
||||
{ value: 6, label: '7' },
|
||||
{ value: 7, label: '8' },
|
||||
{ value: 8, label: 'Auto' },
|
||||
],
|
||||
range: ['1', '2', '3', '4', 'Auto'],
|
||||
defaultValue: 4,
|
||||
range: ['1', '2', '3', '4', '5', '6', '7', '8', 'Auto'],
|
||||
defaultValue: 8,
|
||||
outputRawData: (val) => {
|
||||
const numArr = ['1', '2', '3', '4', 'Auto']
|
||||
const numArr = ['1', '2', '3', '4', '5', '6', '7', '8', 'Auto']
|
||||
return numArr.indexOf(val.toString())
|
||||
},
|
||||
outputReadabilityData: (idx) => {
|
||||
const numArr = ['1', '2', '3', '4', 'Auto']
|
||||
const numArr = ['1', '2', '3', '4', '5', '6', '7', '8', 'Auto']
|
||||
return numArr[parseInt(idx)]
|
||||
},
|
||||
},
|
||||
@@ -158,7 +162,7 @@ const EliteEIS = {
|
||||
outputReadabilityData: (val, scale = 1) => {
|
||||
return Math.round(parseInt(val) / 2047 * 800) / scale
|
||||
},
|
||||
defaultValue: 25,
|
||||
defaultValue: 26,
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
unit: {
|
||||
@@ -289,7 +293,7 @@ const EliteEIS = {
|
||||
outputReadabilityData: (val, scale = 1) => {
|
||||
return Math.round(parseInt(val) / 2047 * 800) / scale
|
||||
},
|
||||
defaultValue: 25,
|
||||
defaultValue: 26,
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
unit: {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
name: 'ACC',
|
||||
parameter: ['TIME_DURATION', 'ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'ACC_a_out0_current', 'ACC_a_out1_current', 'ACC_a_out2_current', 'ACC_a_out3_current', 'TRIG0_en', 'TRIG1_en', 'TRIG0_edge_type', 'TRIG1_edge_type'], // 這個mode用到的參數
|
||||
showParameter: ['ACC_a_out0', 'ACC_a_out1', 'ACC_a_out2', 'ACC_a_out3', 'TRIG0_en', 'TRIG1_en', 'TIME_DURATION'], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
export default {
|
||||
name: 'Dev Mode',
|
||||
parameter: ['ADC_VALUE_I'],
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
m: 60 * 1e6,
|
||||
h: 60 * 60 * 1e6,
|
||||
auto: 1,
|
||||
},
|
||||
defaultUnit: 'us',
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Dev Mode',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
x1: {
|
||||
type: 'time',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
y1: {
|
||||
type: 'value',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
data: [
|
||||
{
|
||||
legend: 'dev',
|
||||
x1: {
|
||||
channel: 'time',
|
||||
},
|
||||
y1: {
|
||||
channel: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,374 @@
|
||||
import Idle from '../Common/Idle'
|
||||
import ACC from './ACC'
|
||||
import DevMode from './DevMode'
|
||||
|
||||
const EliteTrigger = {
|
||||
USED: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_EARLY: {
|
||||
type: 'number-array',
|
||||
showName: 'pre-T',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_EARLY: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
CYCLE: {
|
||||
type: 'number-array',
|
||||
showName: 'cycle no.',
|
||||
range: Object.freeze({ min: 1, max: 50000 }),
|
||||
defaultValue: [1, 1, 1, 1, 1, 1, 1, 1],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(val)
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_MID0: {
|
||||
type: 'number-array',
|
||||
showName: 'T1',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_MID0: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_MID1: {
|
||||
type: 'number-array',
|
||||
showName: 'T2',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_MID1: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_MID2: {
|
||||
type: 'number-array',
|
||||
showName: 'T3',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_MID2: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_MID3: {
|
||||
type: 'number-array',
|
||||
showName: 'T4',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_MID3: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
T_LATE: {
|
||||
type: 'number-array',
|
||||
showName: 'post-T',
|
||||
range: Object.freeze({ min: 0, max: 86400 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 1000 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number((val / 1000 / scale).toFixed(1))
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 's',
|
||||
downloadUnit: 's',
|
||||
unit: {
|
||||
ms: 1e-3,
|
||||
s: 1,
|
||||
m: 60,
|
||||
h: 3600,
|
||||
},
|
||||
},
|
||||
V_LATE: {
|
||||
type: 'boolean-array',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
CURRENT: {
|
||||
type: 'number-array',
|
||||
showName: 'current',
|
||||
range: Object.freeze({ min: 0, max: 50000 }),
|
||||
defaultValue: [0, 0, 0, 0, 0, 0, 0, 0],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return Number(Number(val).toFixed(1)) * 250 * scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val / 250 / scale
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: 'mA',
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
},
|
||||
OUTPUT_5V: {
|
||||
type: 'boolean-array',
|
||||
showName: '5V output',
|
||||
range: Object.freeze({ min: false, max: true }),
|
||||
defaultValue: [false, false, false, false, false, false, false, false],
|
||||
outputRawData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
outputReadabilityData: (val, scale = 1, index = -1) => {
|
||||
if (index === -1) {
|
||||
return val
|
||||
} else {
|
||||
return val[index]
|
||||
}
|
||||
},
|
||||
},
|
||||
TIME_DURATION: {
|
||||
type: 'number',
|
||||
showName: 'Time duration',
|
||||
@@ -22,9 +390,9 @@ const EliteTrigger = {
|
||||
return parseInt(parseFloat(val))
|
||||
},
|
||||
},
|
||||
ACC_a_out: {
|
||||
ACC_a_out0: {
|
||||
type: 'number',
|
||||
showName: 'ACC OUT enable',
|
||||
showName: 'Channel 1 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
@@ -38,9 +406,57 @@ const EliteTrigger = {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out_current: {
|
||||
ACC_a_out1: {
|
||||
type: 'number',
|
||||
showName: 'ACC OUT CURRENT',
|
||||
showName: 'Channel 2 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out2: {
|
||||
type: 'number',
|
||||
showName: 'Channel 3 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out3: {
|
||||
type: 'number',
|
||||
showName: 'Channel 4 Enable',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ACC_a_out0_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 1 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
@@ -56,9 +472,63 @@ const EliteTrigger = {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
TRIG_en: {
|
||||
ACC_a_out1_current: {
|
||||
type: 'number',
|
||||
showName: 'trigger enable',
|
||||
showName: 'Channel 2 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
ACC_a_out2_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 3 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
ACC_a_out3_current: {
|
||||
type: 'number',
|
||||
showName: 'Channel 4 Current',
|
||||
componentType: 'channelBlock',
|
||||
range: Object.freeze({ min: 0, max: 50000 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: 'mA',
|
||||
downloadUnit: null,
|
||||
unit: {
|
||||
mA: 1,
|
||||
},
|
||||
outputRawData: (val) => {
|
||||
return val * 250
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return val / 250
|
||||
},
|
||||
},
|
||||
TRIG0_en: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 0 Enable',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
@@ -72,9 +542,25 @@ const EliteTrigger = {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG_edge_type: {
|
||||
TRIG1_en: {
|
||||
type: 'number',
|
||||
showName: 'trigger type',
|
||||
showName: 'Trigger 1 Enable',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 1 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG0_edge_type: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 0 Type',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
@@ -88,19 +574,50 @@ const EliteTrigger = {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
TRIG1_edge_type: {
|
||||
type: 'number',
|
||||
showName: 'Trigger 1 Type',
|
||||
componentType: 'triggerBlock',
|
||||
range: Object.freeze({ min: 0, max: 2 }), // UI上能輸入的最大最小值
|
||||
defaultValue: 0,
|
||||
defaultUnit: null,
|
||||
downloadUnit: null,
|
||||
unit: {},
|
||||
outputRawData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
outputReadabilityData: (val) => {
|
||||
return parseInt(val)
|
||||
},
|
||||
},
|
||||
ADC_VALUE_I: {
|
||||
type: 'none',
|
||||
showName: 'Instruction',
|
||||
componentType: 'dev-mode',
|
||||
},
|
||||
MODE_OPTIONS: [
|
||||
{
|
||||
id: 1,
|
||||
description: 'Idle',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'Trigger',
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
description: 'Analog Current Control (ACC)',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'Idle',
|
||||
id: 2,
|
||||
description: 'DEV MODE',
|
||||
},
|
||||
],
|
||||
MODE: {
|
||||
0: null,
|
||||
0: ACC,
|
||||
1: Idle,
|
||||
2: DevMode,
|
||||
3: ACC,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
export default {
|
||||
name: 'Dev Mode',
|
||||
parameter: ['ADC_VALUE_I'],
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
m: 60 * 1e6,
|
||||
h: 60 * 60 * 1e6,
|
||||
auto: 1,
|
||||
},
|
||||
defaultUnit: 'auto',
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Dev Mode',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
x1: {
|
||||
type: 'time',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
y1: {
|
||||
type: 'value',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
data: [
|
||||
{
|
||||
legend: 'dev',
|
||||
x1: {
|
||||
channel: 'time',
|
||||
},
|
||||
y1: {
|
||||
channel: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'IOPH',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'R1',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'R2',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mV: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
2: {
|
||||
order: 2,
|
||||
name: 'output_vo',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
3: {
|
||||
order: 3,
|
||||
name: 'output_vc',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
4: {
|
||||
order: 4,
|
||||
name: 'output_ve',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
// 5: {
|
||||
// order: 5,
|
||||
// name: 'R1 Float',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
6: {
|
||||
order: 6,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
7: {
|
||||
order: 7,
|
||||
name: 'VO Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 8,
|
||||
name: 'VCC Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
9: {
|
||||
order: 9,
|
||||
name: 'VEE Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
10: {
|
||||
order: 5,
|
||||
name: 'Pattern',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 11: {
|
||||
// order: 11,
|
||||
// name: 'Pattern Manual',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
12: {
|
||||
order: 12,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 13,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 14,
|
||||
name: 'VO-VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'IOPL',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'R1',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'R2',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mV: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
2: {
|
||||
order: 2,
|
||||
name: 'output_vo',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
3: {
|
||||
order: 3,
|
||||
name: 'output_vc',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
4: {
|
||||
order: 4,
|
||||
name: 'output_ve',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
// 5: {
|
||||
// order: 5,
|
||||
// name: 'R1 Float',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
6: {
|
||||
order: 6,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
7: {
|
||||
order: 7,
|
||||
name: 'VO Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 8,
|
||||
name: 'VCC Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
9: {
|
||||
order: 9,
|
||||
name: 'VEE Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
10: {
|
||||
order: 5,
|
||||
name: 'Pattern',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 11: {
|
||||
// order: 11,
|
||||
// name: 'Pattern Manual',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
12: {
|
||||
order: 12,
|
||||
name: 'VCC-VO',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 13,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 14,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'R-external calibration',
|
||||
parameter: [],
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'R1',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'R2',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mV: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
2: {
|
||||
order: 2,
|
||||
name: 'output_vo',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
3: {
|
||||
order: 3,
|
||||
name: 'output_vc',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
4: {
|
||||
order: 4,
|
||||
name: 'output_ve',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
// 5: {
|
||||
// order: 5,
|
||||
// name: 'R1 Float',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
6: {
|
||||
order: 6,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
7: {
|
||||
order: 7,
|
||||
name: 'VO Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 8,
|
||||
name: 'VCC Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
9: {
|
||||
order: 9,
|
||||
name: 'VEE Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
// 10: {
|
||||
// order: 5,
|
||||
// name: 'Pattern',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 5,
|
||||
name: 'Pattern Manual',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
12: {
|
||||
order: 12,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 13,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 14,
|
||||
name: 'VO-VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
export default {
|
||||
name: 'Electrial Stimulation',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
10: {
|
||||
order: 10,
|
||||
name: 'Pattern',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
11: {
|
||||
order: 11,
|
||||
name: 'Pattern Manual',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
0: {
|
||||
order: 0,
|
||||
name: 'R1',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
1: {
|
||||
order: 1,
|
||||
name: 'R2',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mV: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
2: {
|
||||
order: 2,
|
||||
name: 'VO',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mV: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
3: {
|
||||
order: 3,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mV: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
4: {
|
||||
order: 4,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mV: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
5: {
|
||||
order: 5,
|
||||
name: 'R1 Float',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
6: {
|
||||
order: 6,
|
||||
name: 'R2 Float',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
7: {
|
||||
order: 7,
|
||||
name: 'VO Float',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
8: {
|
||||
order: 8,
|
||||
name: 'VCC Float',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
9: {
|
||||
order: 9,
|
||||
name: 'VEE Float',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mv: 1,
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
12: {
|
||||
order: 12,
|
||||
type: 'formula',
|
||||
name: '∆VO',
|
||||
physicalQuantity: 'mV',
|
||||
unit: {
|
||||
mV: 1,
|
||||
},
|
||||
formulaTarget: [2, 4],
|
||||
formula: (data1, data2) => {
|
||||
return data1 - data2
|
||||
},
|
||||
defaultUnit: 'mV',
|
||||
downloadUnit: 'mV',
|
||||
},
|
||||
// 13: {
|
||||
// type: 'formula',
|
||||
// name: 'Current [A]',
|
||||
// physicalQuantity: 'A',
|
||||
// unit: {
|
||||
// A: 1,
|
||||
// },
|
||||
// formula: (data) => {
|
||||
// return (data[2] - data[4])
|
||||
// },
|
||||
// defaultUnit: 'A',
|
||||
// downloadUnit: 'A',
|
||||
// },
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
export default {
|
||||
name: 'Electrial Stimulation',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'mem_board_id',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'packet_seq',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 2: {
|
||||
// order: 2,
|
||||
// name: 'notify_time',
|
||||
// physicalQuantity: 'ms',
|
||||
// unit: {
|
||||
// ms: 1,
|
||||
// },
|
||||
// defaultUnit: 'ms',
|
||||
// downloadUnit: 'ms',
|
||||
// },
|
||||
3: {
|
||||
order: 4,
|
||||
name: 'ACS37030_VREF',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
4: {
|
||||
order: 5,
|
||||
name: 'ACS37030_OUT',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
5: {
|
||||
order: 6,
|
||||
name: 'OUT (VO)',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
6: {
|
||||
order: 7,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
7: {
|
||||
order: 8,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 9,
|
||||
name: 'ACS37030_current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
9: {
|
||||
order: 2,
|
||||
name: 'Pattern id',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 10: {
|
||||
// order: 10,
|
||||
// name: 'Pattern mask',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 3,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import SelectResistor from './SelectResistor'
|
||||
import SelectResistorFull from './SelectResistorFull'
|
||||
import DevMode from './DevMode'
|
||||
import IOPH from './IOPH'
|
||||
import IOPL from './IOPL'
|
||||
import RC from './RC'
|
||||
|
||||
/**
|
||||
* Number-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param range component-range
|
||||
* @param defaultValue default-value
|
||||
* @param defaultUnit default-unit
|
||||
* @param downloadUnit download-unit
|
||||
* @param unit unit-table
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Array-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param options select-options
|
||||
* @param range select-range
|
||||
* @param defaultValue default-value
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
const PEL20 = {
|
||||
ADC_VALUE_I: {
|
||||
type: 'none',
|
||||
showName: 'Instruction',
|
||||
componentType: 'dev-mode',
|
||||
},
|
||||
|
||||
MODE_OPTIONS: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'SELECT RESISTOR',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'SELECT RESISTOR FULL DATA',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'IOPH',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'IOPL',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Dev Mode',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'R-external calibration',
|
||||
},
|
||||
],
|
||||
MODE: {
|
||||
0: SelectResistor,
|
||||
1: SelectResistorFull,
|
||||
2: DevMode,
|
||||
3: IOPH,
|
||||
4: IOPL,
|
||||
5: RC,
|
||||
},
|
||||
}
|
||||
|
||||
export default PEL20
|
||||
@@ -0,0 +1,98 @@
|
||||
export default {
|
||||
name: 'Dev Mode',
|
||||
parameter: ['ADC_VALUE_I'],
|
||||
valScales: {
|
||||
linear: {
|
||||
func: (val) => {
|
||||
return val
|
||||
},
|
||||
},
|
||||
log: {
|
||||
func: (val) => {
|
||||
return Math.log10(Math.abs(val))
|
||||
},
|
||||
},
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 's',
|
||||
unit: {
|
||||
us: 1,
|
||||
ms: 1e3,
|
||||
s: 1e6,
|
||||
m: 60 * 1e6,
|
||||
h: 60 * 60 * 1e6,
|
||||
auto: 1,
|
||||
},
|
||||
defaultUnit: 'auto',
|
||||
},
|
||||
0: {
|
||||
name: '0',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
1: {
|
||||
name: '1',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
2: {
|
||||
name: '2',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
3: {
|
||||
name: '3',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
default: 1,
|
||||
},
|
||||
defaultUnit: 'default',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
{
|
||||
name: 'Dev Mode',
|
||||
description: '',
|
||||
subplot: [
|
||||
{
|
||||
x1: {
|
||||
type: 'time',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
y1: {
|
||||
type: 'value',
|
||||
valScale: 'linear',
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
},
|
||||
data: [
|
||||
{
|
||||
legend: 'dev',
|
||||
x1: {
|
||||
channel: 'time',
|
||||
},
|
||||
y1: {
|
||||
channel: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'IOPH',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'mem_board_id',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'packet_seq',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 2: {
|
||||
// order: 2,
|
||||
// name: 'notify_time',
|
||||
// physicalQuantity: 'ms',
|
||||
// unit: {
|
||||
// ms: 1,
|
||||
// },
|
||||
// defaultUnit: 'ms',
|
||||
// downloadUnit: 'ms',
|
||||
// },
|
||||
3: {
|
||||
order: 4,
|
||||
name: 'ACS37030_VREF',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
4: {
|
||||
order: 5,
|
||||
name: 'ACS37030_OUT',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
5: {
|
||||
order: 6,
|
||||
name: 'OUT (VO)',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
6: {
|
||||
order: 7,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
7: {
|
||||
order: 8,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 9,
|
||||
name: 'ACS37030_current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
9: {
|
||||
order: 2,
|
||||
name: 'Pattern id',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 10: {
|
||||
// order: 10,
|
||||
// name: 'Pattern mask',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 3,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
12: {
|
||||
order: 10,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 11,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 12,
|
||||
name: 'VO-VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'IOPL',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'mem_board_id',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'packet_seq',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 2: {
|
||||
// order: 2,
|
||||
// name: 'notify_time',
|
||||
// physicalQuantity: 'ms',
|
||||
// unit: {
|
||||
// ms: 1,
|
||||
// },
|
||||
// defaultUnit: 'ms',
|
||||
// downloadUnit: 'ms',
|
||||
// },
|
||||
3: {
|
||||
order: 4,
|
||||
name: 'ACS37030_VREF',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
4: {
|
||||
order: 5,
|
||||
name: 'ACS37030_OUT',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
5: {
|
||||
order: 6,
|
||||
name: 'OUT (VO)',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
6: {
|
||||
order: 7,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
7: {
|
||||
order: 8,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 9,
|
||||
name: 'ACS37030_current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
9: {
|
||||
order: 2,
|
||||
name: 'Pattern id',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 10: {
|
||||
// order: 10,
|
||||
// name: 'Pattern mask',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 3,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
12: {
|
||||
order: 10,
|
||||
name: 'VCC-VO',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 11,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 12,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export default {
|
||||
name: 'R-external calibration',
|
||||
parameter: [],
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'R1',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'R2',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mV: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
2: {
|
||||
order: 2,
|
||||
name: 'output_vo',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
3: {
|
||||
order: 3,
|
||||
name: 'output_vc',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
4: {
|
||||
order: 4,
|
||||
name: 'output_ve',
|
||||
physicalQuantity: 'raw',
|
||||
unit: {
|
||||
raw: 1,
|
||||
},
|
||||
defaultUnit: 'raw',
|
||||
downloadUnit: 'raw',
|
||||
},
|
||||
// 5: {
|
||||
// order: 5,
|
||||
// name: 'R1 Float',
|
||||
// physicalQuantity: 'mV',
|
||||
// unit: {
|
||||
// mv: 1,
|
||||
// },
|
||||
// defaultUnit: 'mV',
|
||||
// downloadUnit: 'mV',
|
||||
// },
|
||||
6: {
|
||||
order: 6,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
7: {
|
||||
order: 7,
|
||||
name: 'VO Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 8,
|
||||
name: 'VCC Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
9: {
|
||||
order: 9,
|
||||
name: 'VEE Float',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
// 10: {
|
||||
// order: 5,
|
||||
// name: 'Pattern',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 5,
|
||||
name: 'Pattern Manual',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
12: {
|
||||
order: 12,
|
||||
name: 'VO-VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
13: {
|
||||
order: 13,
|
||||
name: 'current (VxG) ',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
14: {
|
||||
order: 14,
|
||||
name: 'VO-VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
export default {
|
||||
name: 'Electrial Stimulation',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'mem_board_id',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'packet_seq',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 2: {
|
||||
// order: 2,
|
||||
// name: 'notify_time',
|
||||
// physicalQuantity: 'ms',
|
||||
// unit: {
|
||||
// ms: 1,
|
||||
// },
|
||||
// defaultUnit: 'ms',
|
||||
// downloadUnit: 'ms',
|
||||
// },
|
||||
3: {
|
||||
order: 4,
|
||||
name: 'ACS37030_VREF',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
4: {
|
||||
order: 5,
|
||||
name: 'ACS37030_OUT',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
5: {
|
||||
order: 6,
|
||||
name: 'OUT (VO)',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
6: {
|
||||
order: 7,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
7: {
|
||||
order: 8,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 9,
|
||||
name: 'ACS37030_current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
9: {
|
||||
order: 2,
|
||||
name: 'Pattern id',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 10: {
|
||||
// order: 10,
|
||||
// name: 'Pattern mask',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 3,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
export default {
|
||||
name: 'Electrial Stimulation',
|
||||
parameter: [], // 這個mode用到的參數
|
||||
showParameter: [], // 有要秀給user看的參數
|
||||
headerParameter: () => [], // export header的參數
|
||||
valScales: {
|
||||
},
|
||||
channels: {
|
||||
time: {
|
||||
name: 'Time',
|
||||
physicalQuantity: 'ms',
|
||||
unit: {
|
||||
ms: 1,
|
||||
s: 1e3,
|
||||
minute: 60 * 1e3,
|
||||
hour: 60 * 60 * 1e3,
|
||||
},
|
||||
defaultUnit: 'ms',
|
||||
downloadUnit: 'ms',
|
||||
},
|
||||
// 0: {
|
||||
// order: 0,
|
||||
// name: 'mem_board_id',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 1: {
|
||||
// order: 1,
|
||||
// name: 'packet_seq',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
// 2: {
|
||||
// order: 2,
|
||||
// name: 'notify_time',
|
||||
// physicalQuantity: 'ms',
|
||||
// unit: {
|
||||
// ms: 1,
|
||||
// },
|
||||
// defaultUnit: 'ms',
|
||||
// downloadUnit: 'ms',
|
||||
// },
|
||||
3: {
|
||||
order: 4,
|
||||
name: 'ACS37030_VREF',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
4: {
|
||||
order: 5,
|
||||
name: 'ACS37030_OUT',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
5: {
|
||||
order: 6,
|
||||
name: 'OUT (VO)',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
6: {
|
||||
order: 7,
|
||||
name: 'VCC',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
7: {
|
||||
order: 8,
|
||||
name: 'VEE',
|
||||
physicalQuantity: 'V',
|
||||
unit: {
|
||||
V: 1,
|
||||
},
|
||||
defaultUnit: 'V',
|
||||
downloadUnit: 'V',
|
||||
},
|
||||
8: {
|
||||
order: 9,
|
||||
name: 'ACS37030_current',
|
||||
physicalQuantity: 'A',
|
||||
unit: {
|
||||
A: 1,
|
||||
},
|
||||
defaultUnit: 'A',
|
||||
downloadUnit: 'A',
|
||||
},
|
||||
9: {
|
||||
order: 2,
|
||||
name: 'Pattern id',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
// 10: {
|
||||
// order: 10,
|
||||
// name: 'Pattern mask',
|
||||
// physicalQuantity: '',
|
||||
// unit: {
|
||||
// '': 1,
|
||||
// },
|
||||
// defaultUnit: '',
|
||||
// downloadUnit: '',
|
||||
// },
|
||||
11: {
|
||||
order: 3,
|
||||
name: 'G',
|
||||
physicalQuantity: '',
|
||||
unit: {
|
||||
'': 1,
|
||||
},
|
||||
defaultUnit: '',
|
||||
downloadUnit: '',
|
||||
},
|
||||
},
|
||||
charts: {
|
||||
default: [
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import SelectResistor from './SelectResistor'
|
||||
import SelectResistorFull from './SelectResistorFull'
|
||||
import DevMode from './DevMode'
|
||||
import IOPH from './IOPH'
|
||||
import IOPL from './IOPL'
|
||||
import RC from './RC'
|
||||
|
||||
/**
|
||||
* Number-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param range component-range
|
||||
* @param defaultValue default-value
|
||||
* @param defaultUnit default-unit
|
||||
* @param downloadUnit download-unit
|
||||
* @param unit unit-table
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Array-type-parameter
|
||||
* PARAMETER_TITLE :{
|
||||
* @param type value-type
|
||||
* @param showName name
|
||||
* @param componentType component-type
|
||||
* @param options select-options
|
||||
* @param range select-range
|
||||
* @param defaultValue default-value
|
||||
* @param outputRawData function return raw data
|
||||
* @param outputReadabilityData function return user data
|
||||
* }
|
||||
*/
|
||||
|
||||
const PEL30 = {
|
||||
ADC_VALUE_I: {
|
||||
type: 'none',
|
||||
showName: 'Instruction',
|
||||
componentType: 'dev-mode',
|
||||
},
|
||||
|
||||
MODE_OPTIONS: [
|
||||
{
|
||||
id: 0,
|
||||
description: 'SELECT RESISTOR',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
description: 'SELECT RESISTOR FULL DATA',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
description: 'IOPH',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
description: 'IOPL',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
description: 'Dev Mode',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
description: 'R-external calibration',
|
||||
},
|
||||
],
|
||||
MODE: {
|
||||
0: SelectResistor,
|
||||
1: SelectResistorFull,
|
||||
2: DevMode,
|
||||
3: IOPH,
|
||||
4: IOPL,
|
||||
5: RC,
|
||||
},
|
||||
}
|
||||
|
||||
export default PEL30
|
||||
@@ -1,6 +1,9 @@
|
||||
import EliteEDC from './EliteEDC/index'
|
||||
import EliteEIS from './EliteEIS/index'
|
||||
import EliteTrigger from './EliteTrigger/index'
|
||||
import CPG from './CPG/index'
|
||||
import PEL20 from './PEL_2_0/index'
|
||||
import PEL30 from './PEL_3_0/index'
|
||||
import store from '@/store/index'
|
||||
|
||||
// object saving library name mapping table
|
||||
@@ -11,6 +14,7 @@ const libraryNameMappingTable = {
|
||||
'Elite_EDC_1.5': EliteEDC,
|
||||
'Elite_EDC_1.5re': EliteEDC,
|
||||
'Elite_EDC_1.5r2': EliteEDC,
|
||||
'Elite_EDC_2.0': EliteEDC,
|
||||
'Elite_BAT_1.0': EliteEDC,
|
||||
EIS: EliteEIS,
|
||||
'Elite_EIS_1.0': EliteEIS,
|
||||
@@ -18,6 +22,9 @@ const libraryNameMappingTable = {
|
||||
'Elite_EIS_MINI_1.0': EliteEIS,
|
||||
'Elite_TRIG_0.1': EliteTrigger,
|
||||
'Elite_MEGAFLY_0.1': null,
|
||||
CPG: CPG,
|
||||
'PEL_2.0': PEL20,
|
||||
'PEL_3.0': PEL30,
|
||||
}
|
||||
|
||||
// object saving serial number mapping table
|
||||
@@ -29,18 +36,20 @@ const serialNumberMappingTable = {
|
||||
6: EliteEDC, // EDC1.5
|
||||
7: EliteEDC, // EDC1.5re
|
||||
8: EliteEDC, // EDC1.5r2
|
||||
9: EliteEDC, // EDC2.0
|
||||
},
|
||||
},
|
||||
3: {
|
||||
1: {
|
||||
0: EliteEDC, // BAT1.0
|
||||
0: EliteEDC, // BAT0.1
|
||||
1: EliteEDC, // BAT1.0
|
||||
},
|
||||
},
|
||||
4: {
|
||||
1: {
|
||||
0: EliteEIS, // EIS1.0
|
||||
1: EliteEIS, // EIS1.1
|
||||
2: EliteEIS, // EIS1.1mini
|
||||
2: EliteEIS, // EIS mini1.0
|
||||
},
|
||||
},
|
||||
5: {
|
||||
@@ -53,6 +62,19 @@ const serialNumberMappingTable = {
|
||||
0: null, // MEAGFLY0.1
|
||||
},
|
||||
},
|
||||
7: {
|
||||
0: {
|
||||
0: PEL20,
|
||||
1: PEL20,
|
||||
2: PEL30,
|
||||
},
|
||||
},
|
||||
8: {
|
||||
0: {
|
||||
0: CPG,
|
||||
1: CPG,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,12 @@ export const file = {
|
||||
item.checked = false
|
||||
item.hovered = false
|
||||
})
|
||||
_fileList.push(...mes.data)
|
||||
const data = mes.data.sort((a, b) => {
|
||||
const date1 = new Date(a.created_at).getTime()
|
||||
const date2 = new Date(b.created_at).getTime()
|
||||
return date2 - date1
|
||||
})
|
||||
_fileList.push(...data)
|
||||
},
|
||||
getFileList: () => {
|
||||
return _fileList
|
||||
|
||||
@@ -27,7 +27,7 @@ const hasCycleMode = (mode, lib) => {
|
||||
}
|
||||
|
||||
const getDefaultChartTypeByMode = (mode, lib) => {
|
||||
if (lib === 'EliteZM15' || lib.includes('Elite_EDC')) {
|
||||
if (lib === 'EliteZM15' || lib.includes('Elite_EDC') || lib.includes('Elite_BAT')) {
|
||||
const settings = {}
|
||||
settings[0] = ['Elite', 2, 'Elite', 1]
|
||||
settings[1] = ['Elite', 2, 'Elite', 1]
|
||||
@@ -100,16 +100,17 @@ const transFileSize = (fileSize) => {
|
||||
}
|
||||
|
||||
const transTime = (microsecond) => {
|
||||
const radix = 1e6 // 1s = 1e6 microsecond
|
||||
if (microsecond === undefined || microsecond === 'None') {
|
||||
return '0 s'
|
||||
}
|
||||
|
||||
let result = ''
|
||||
|
||||
if (microsecond < 1000000) {
|
||||
if (microsecond < radix) {
|
||||
result = '~ 1 s'
|
||||
} else {
|
||||
let seconds = parseInt(microsecond / 1000000)
|
||||
let seconds = parseInt(microsecond / radix)
|
||||
|
||||
if (seconds < 60) {
|
||||
result = `${seconds} s`
|
||||
|
||||
@@ -36,6 +36,7 @@ function newSeries (type, legendName, xAxisIndex, yAxisIndex, xAxisSource, yAxis
|
||||
showSymbol: false,
|
||||
showAllSymbol: false,
|
||||
symbolSize: 4,
|
||||
sampling: 'lttb',
|
||||
// [modified 2021/08/10] sampling method managed by vuex
|
||||
// sampling: 'average',
|
||||
// sampling: function (frame) {
|
||||
|
||||
@@ -64,7 +64,12 @@ $icon-font-path: './../fonts/';
|
||||
src: url('~@/fonts/inter/Inter-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
// @font-face {
|
||||
// font-family: 'Inter';
|
||||
// src: url('~@/fonts/inter/Inter-Regular.ttf') format('truetype');
|
||||
// }
|
||||
@font-face {
|
||||
font-family: 'Inter-Medium';
|
||||
src: url('~@/fonts/inter/Inter-Medium.ttf') format('truetype');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('~@/fonts/inter/Inter-Medium.ttf') format('truetype');
|
||||
}
|
||||
|
||||
@@ -26,7 +26,10 @@ const downloadActs = {
|
||||
const meta = state.metaInfo
|
||||
const device = state.downloadInfo.device
|
||||
const channel = payload.channel
|
||||
const timeRatio = 1e6
|
||||
const timeRatio = (device[1] === 'PEL') ? 1e3 : 1e6
|
||||
|
||||
// console.log('timeRatio', timeRatio)
|
||||
// console.log('meta.configuration.SAMPLE_RATE', meta.configuration.SAMPLE_RATE)
|
||||
|
||||
let sampleRate = null
|
||||
let channelNum = 1
|
||||
@@ -47,6 +50,8 @@ const downloadActs = {
|
||||
} else {
|
||||
sampleRate = parseInt(meta.configuration.SAMPLE_RATE) / 10
|
||||
}
|
||||
} else if (device[1] === 'PEL') {
|
||||
sampleRate = 1
|
||||
} else {
|
||||
sampleRate = parseInt(meta.configuration.SAMPLE_RATE) / 10
|
||||
}
|
||||
@@ -85,7 +90,10 @@ const downloadActs = {
|
||||
const idNums = rawData.length
|
||||
|
||||
// estimate per raw_data contains x of samples
|
||||
const samplePerRawData = parseInt(sampleNums / idNums)
|
||||
let samplePerRawData = parseInt(sampleNums / idNums)
|
||||
if (samplePerRawData === 0) {
|
||||
samplePerRawData = 1
|
||||
}
|
||||
|
||||
// estimate 9e5 rows need how many ID
|
||||
const rawDataPerColumnTemp = parseInt((9e5 / parseInt(samplePerRawData)))
|
||||
|
||||