Commit 6c486b3
committed
feat: Major UI/UX improvements and data parsing fixes
## Web Interface Enhancements
### UI Layout Redesign
- Implemented responsive two-column layout with left column for visuals (connection/grid/chart) and right column for controls (terminal/commands)
- Added CSS Grid layout with auto-sizing right column to match grid width
- Improved responsive breakpoint at 900px with proper column stacking order
- Reduced padding and spacing for more compact, efficient layout
### Grid Visualization Improvements
- Fixed grid orientation to match Mac app by reversing capacitance array before grid update
- Implemented golden gradient visualization (rgba(0,0,0,0) to #dca32f) for better visual feedback
- Added corner position exclusion from gradient calculation for more accurate scaling
- Improved grid cell styling with rounded corners and better typography
### Performance Optimizations
- Added auto-clearing logs (max 1000 entries, emergency clear at 2000) to prevent browser lockup
- Implemented adaptive timeout system for JCP stream (30s when touch detected, 15s default)
- Temporarily disabled chart updates and excessive logging for better performance
- Added null checks in updateConnectionStatus to prevent DOM errors
### Data Parsing Fixes
- Fixed pressure data parsing to match Mac app byte indices and big-endian Float32 format
- Added fallback to little-endian parsing if big-endian values are corrupted
- Improved capacitive data processing with better validation and error handling
- Enhanced packet framing with dual magic bytes and CRC-16 support
### Error Handling
- Added comprehensive error handling for corrupted float values and invalid data
- Implemented sanity checks for packet length, buffer size, and data alignment
- Added adaptive timeout mechanism to handle high data rates during touchpad use
## Technical Details
- Reverted byte order changes that caused invalid cell values
- Added array reversal only at grid update stage to maintain data integrity
- Enhanced packet fragmentation handling with increased timeouts
- Improved CSS responsive design with better mobile experience
## Files Modified
- web_interface/script.js: Core data processing and UI logic
- web_interface/index.html: HTML structure for two-column layout
- web_interface/styles.css: Responsive CSS Grid layout and styling
- central_uart/prj.conf: Configuration updates
- central_uart/src/main.c: Firmware updates1 parent c651af6 commit 6c486b3
5 files changed
Lines changed: 1524 additions & 225 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
70 | 89 | | |
71 | 90 | | |
72 | 91 | | |
| |||
152 | 171 | | |
153 | 172 | | |
154 | 173 | | |
155 | | - | |
156 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
157 | 190 | | |
158 | 191 | | |
159 | 192 | | |
160 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
161 | 198 | | |
162 | 199 | | |
163 | 200 | | |
| |||
453 | 490 | | |
454 | 491 | | |
455 | 492 | | |
456 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
457 | 496 | | |
| 497 | + | |
458 | 498 | | |
459 | 499 | | |
460 | 500 | | |
| |||
487 | 527 | | |
488 | 528 | | |
489 | 529 | | |
| 530 | + | |
490 | 531 | | |
491 | 532 | | |
492 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
42 | 31 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
50 | 42 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| |||
0 commit comments