diff --git a/.env b/.env index bb26009..ce28ec9 100644 --- a/.env +++ b/.env @@ -1,4 +1,6 @@ NPM_GITHUB_TOKEN= +REACT_APP_WEB_URL=http://localhost:3000 +REACT_APP_SENTRY_DSN= REACT_APP_FIREBASE_APP_SENTRY_DSN= REACT_APP_FIREBASE_API_KEY= REACT_APP_FIREBASE_AUTH_DOMAIN= diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..b68d6ad --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,61 @@ +# Development guide + +This guide will help you set up this project. + +## Requirements + +- [Node](https://nodejs.org/) 16.x.x (Node Version Manager: [nvm](https://github.com/nvm-sh/nvm)) +- [Firebase](https://console.firebase.google.com/) + - Authentication + - Storage + - Firestore Database +- [Firebase CLI](https://firebase.google.com/docs/cli) +- [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) (`brew install --cask google-cloud-sdk`) + +### Setup local environment variables + +```bash +cp .env .env.local +``` + +### Authenticate to GitHub Packages + +Project uses shared packages (`@speedy-tuner/...`). + +They are hosted using `GitHub Packages`, to install them you need to [authenticate to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages) first. + +#### Personal access token + +Generate GitHub [Personal access token](https://github.com/settings/tokens). + +Private token can be assign to ENV when running `npm install` in the same shell: + +```bash +export NPM_GITHUB_TOKEN=YOUR_PRIVATE_GITHUB_TOKEN +``` + +### Install dependencies and run in development mode + +```bash +# install packages +npm install + +# run development server +npm start +``` + +## Firebase + +### Storage + +Authenticate: + +```bash +gcloud auth login +``` + +Set up CORS: + +```bash +gsutil cors set cors.json gs:// +``` diff --git a/README.md b/README.md index 7fa53e8..eb7388f 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,6 @@ Share your [Speeduino](https://speeduino.com/) tune and logs. ![Screenshot](https://speedytuner.cloud/img/screen.png) -## Project main goals - -- ๐Ÿš€ always free and open source (FOSS) -- ๐Ÿ’ป Cloud based web app with CDN -- ๐Ÿ”ฅ `60 FPS` animations and fast load times -- ๐Ÿ‘ good user experience - - ๐Ÿ’Ž intuitive, modern and responsive UI - - ๐Ÿ‘ถ easy for newcomers with tips, tools and simple diagnostics - - ๐Ÿ“ฑ touch screen friendly - ## ECU firmware - Documentation: [wiki.speeduino.com](https://wiki.speeduino.com/) @@ -32,39 +22,12 @@ Share your [Speeduino](https://speeduino.com/) tune and logs. There are many ways in which you can participate in the project and every bit of help is greatly appreciated. -- ๐Ÿ‘‹ Say Hi and start a conversation over at [Discussions](https://github.com/karniv00l/speedy-tuner/discussions) -- ๐Ÿž [Submit bugs and feature requests](https://github.com/karniv00l/speedy-tuner/issues) +- ๐Ÿ‘‹ Say Hi and start a conversation over at [Discussions](https://github.com/speedy-tuner/speedy-tuner-cloud/discussions) +- ๐Ÿž [Submit bugs and feature requests](https://github.com/speedy-tuner/speedy-tuner-cloud/issues) - ๐Ÿงช Test on different platforms, hardware and Speeduino firmware - ๐Ÿ‘“ Review source code - โŒจ๏ธ Write tests and refactor code according to best practices ## Development -### Recommended dev environment - -- [Node](https://nodejs.org/) 16.x.x - -### Authenticate to GitHub Packages - -Project uses shared packages (`@speedy-tuner/...`). - -They are hosted using `GitHub Packages`, to install them you need to [authenticate to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages) first. - -Private token can be assing to ENV like so when running `npm install` in the same shell: - -```bash -export NPM_GITHUB_TOKEN=YOUR_PRIVATE_GITHUB_TOKEN -``` - -### Install and run - -```bash -# install packages -npm install - -# run development server -npm start - -# open in browser -open http://localhost:3000 -``` +Please see [Developer guide](https://github.com/speedy-tuner/speedy-tuner-cloud/blob/master/DEVELOPMENT.md) diff --git a/firebase/cors.json b/firebase/cors.json new file mode 100644 index 0000000..9461191 --- /dev/null +++ b/firebase/cors.json @@ -0,0 +1,11 @@ +[ + { + "origin": [ + "*" + ], + "method": [ + "GET" + ], + "maxAgeSeconds": 3600 + } +] diff --git a/public/tunes/202012.msq b/public/tunes/202012.msq deleted file mode 100644 index d83147b..0000000 --- a/public/tunes/202012.msq +++ /dev/null @@ -1,2150 +0,0 @@ - - - - - -"0" -"CAN ID 0" -8000.0 -3000.0 -5000.0 -255.0 -200.0 -245.0 - - -2.0 - -1.5 - -1.2 - -1.0 - -0.8 - -0.6 - -0.4 - -0.2 - -0.1 - 0.0 - - - 110.0 - 110.0 - 110.0 - 110.0 - 107.0 - 106.0 - 101.0 - 100.0 - 100.0 - 100.0 - - - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 6.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - - - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 6.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - - - 511.0 - 100.0 - 511.0 - 511.0 - 100.0 - 100.0 - 100.0 - 100.0 - -"1" -255.0 -255.0 -VSS_RAW -Clutch_RAW -Alternator_Disable -"GPS Speed" -450.0 -"cc/min" -"Log HP & Tq" -"Off" -"Liters" -"Kilometers Per Hour" -1000.0 -"kg" -0.34 -32.0 -19.3 -"sqft" -25.5 -1.0 -3.7 -0.0 - - -5.0 -120.0 -0.0 -"TPS" -"Open Time only" -"Fixed" -"On" -"PW Adder" -"Baro" - - 110.0 - 110.0 - 110.0 - 110.0 - 107.0 - 106.0 - 101.0 - 100.0 - 100.0 - 100.0 - -20.0 -"Speeduino v0.4" -"Board Default" -"Normal" -3.0 -10.0 -30.0 -0.0 -"Unused" -"VE" -"CPU" -"TPS" -"Mem" -"RPM" -"RPM" -"RPM" -6.4 -2.0 -"Alternating" -"No" -"No" -"Full" -"MAP" -"Disabled" -1.0 - - 355.0 - 355.0 - 355.0 - 355.0 - -"Instantaneous" -"Four-stroke" -"Port" -"4" -"MAP" -"Off" -"4" -"Even fire" -"Off" -"No" -"Off" -"Sequential" -"Yes" -"On" -60.0 -90.0 -50.0 -150.0 -50.0 -27.0 -186.0 -10.0 -260.0 -2.0 -14.7 -0.0 -0.0 -0.0 -"36" -"Normal" -"On" -20.0 -1500.0 -2000.0 -0.0 -50.0 -0.0 -16.0 -14610.0 --1.0 -65535.0 -"No" -"No" -"30" -"No" - - 10.0 - 10.0 - 5.0 - 5.0 - - - 10.0 - 10.0 - 5.0 - 2.0 - - - -20.0 - 10.0 - 40.0 - 85.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 33.0 - 60.0 - 95.0 - -"Board Default" -"Inverted" -"On" -"Added" -"TPS" -"0" -900.0 -5.0 - - 500.0 - 2000.0 - 4500.0 - 6500.0 - -4.5 -25.0 -70.0 -"Off" -"A15" -65535.0 -255.0 -6553.5 -6553.5 -6553.5 -6553.5 -6553.5 -6553.5 -"On" -"No" -"Board Default" -7000.0 -1.0 -255.0 -2550.0 - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - 255.0 - 10.0 - - - - - 70.0 70.0 70.0 70.0 67.0 63.0 56.0 62.0 55.0 54.0 53.0 56.0 51.0 52.0 59.0 66.0 - 70.0 72.0 72.0 75.0 72.0 73.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 78.0 - 70.0 72.0 72.0 73.0 71.0 69.0 77.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 83.0 - 69.0 73.0 75.0 73.0 66.0 68.0 74.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 82.0 - 71.0 70.0 72.0 70.0 66.0 69.0 74.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 83.0 - 72.0 72.0 73.0 71.0 67.0 70.0 75.0 81.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 82.0 - 73.0 73.0 70.0 74.0 68.0 66.0 75.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 87.0 - 73.0 74.0 75.0 75.0 71.0 68.0 80.0 82.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 93.0 - 75.0 77.0 77.0 76.0 78.0 79.0 82.0 86.0 85.0 85.0 85.0 85.0 85.0 85.0 85.0 100.0 - 75.0 76.0 77.0 80.0 86.0 90.0 93.0 94.0 97.0 92.0 92.0 92.0 92.0 101.0 102.0 105.0 - 75.0 76.0 75.0 82.0 85.0 97.0 99.0 100.0 99.0 95.0 93.0 92.0 92.0 101.0 104.0 107.0 - 75.0 78.0 73.0 81.0 85.0 99.0 100.0 103.0 102.0 99.0 97.0 97.0 94.0 99.0 103.0 109.0 - 81.0 82.0 74.0 84.0 96.0 99.0 106.0 108.0 104.0 104.0 103.0 101.0 102.0 106.0 109.0 114.0 - 90.0 91.0 86.0 97.0 111.0 109.0 114.0 117.0 117.0 116.0 117.0 114.0 114.0 111.0 113.0 115.0 - 96.0 91.0 93.0 98.0 119.0 118.0 119.0 120.0 121.0 121.0 122.0 122.0 122.0 119.0 120.0 119.0 - 96.0 101.0 102.0 107.0 119.0 121.0 123.0 124.0 124.0 123.0 123.0 124.0 121.0 119.0 122.0 122.0 - - - 500.0 - 700.0 - 900.0 - 1400.0 - 2100.0 - 2800.0 - 3600.0 - 4600.0 - 5300.0 - 5600.0 - 5900.0 - 6100.0 - 6400.0 - 6700.0 - 6800.0 - 7200.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 46.0 - 56.0 - 66.0 - 76.0 - 86.0 - 96.0 - 100.0 - 120.0 - 140.0 - 160.0 - 180.0 - 200.0 - - - - - 18.0 14.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 - 12.0 10.0 10.0 18.0 25.0 38.0 39.0 38.0 37.0 37.0 17.0 20.0 25.0 29.0 34.0 39.0 - 12.0 10.0 10.0 19.0 26.0 38.0 39.0 38.0 37.0 37.0 30.0 32.0 34.0 36.0 38.0 41.0 - 12.0 10.0 10.0 21.0 28.0 38.0 39.0 38.0 37.0 37.0 36.0 37.0 38.0 38.0 39.0 41.0 - 12.0 12.0 12.0 25.0 28.0 36.0 37.0 37.0 36.0 36.0 37.0 37.0 38.0 38.0 39.0 40.0 - 11.0 11.0 11.0 23.0 26.0 32.0 33.0 35.0 36.0 36.0 36.0 37.0 37.0 38.0 39.0 40.0 - 11.0 11.0 11.0 22.0 25.0 28.0 30.0 32.0 35.0 35.0 35.0 35.0 36.0 37.0 38.0 40.0 - 10.0 10.0 10.0 19.0 23.0 23.0 27.0 29.0 30.0 30.0 31.0 32.0 34.0 35.0 37.0 39.0 - 9.0 9.0 9.0 19.0 22.0 20.0 24.0 25.0 27.0 27.0 28.0 29.0 31.0 33.0 35.0 38.0 - 8.0 8.0 8.0 18.0 19.0 18.0 20.0 21.0 23.0 24.0 24.0 26.0 28.0 30.0 33.0 36.0 - 7.0 7.0 7.0 15.0 16.0 17.0 18.0 18.0 18.0 19.0 20.0 22.0 25.0 27.0 30.0 34.0 - 6.0 6.0 6.0 11.0 12.0 16.0 16.0 16.0 17.0 18.0 18.0 20.0 22.0 25.0 28.0 31.0 - 4.0 4.0 4.0 6.0 8.0 10.0 12.0 12.0 13.0 13.0 14.0 16.0 19.0 21.0 25.0 28.0 - 2.0 2.0 2.0 3.0 4.0 8.0 9.0 9.0 10.0 10.0 10.0 13.0 16.0 19.0 22.0 26.0 - 2.0 2.0 2.0 2.0 4.0 6.0 8.0 8.0 8.0 8.0 8.0 11.0 13.0 16.0 19.0 23.0 - 2.0 2.0 2.0 2.0 2.0 4.0 5.0 6.0 6.0 7.0 7.0 9.0 11.0 13.0 16.0 19.0 - - - 500.0 - 800.0 - 1000.0 - 1500.0 - 1800.0 - 2300.0 - 2900.0 - 3400.0 - 3900.0 - 4300.0 - 4800.0 - 5300.0 - 5900.0 - 6500.0 - 7200.0 - 8000.0 - - - 10.0 - 24.0 - 36.0 - 56.0 - 66.0 - 76.0 - 84.0 - 100.0 - 110.0 - 126.0 - 140.0 - 160.0 - 180.0 - 200.0 - 220.0 - 250.0 - - - -0.0 -10.0 -20.0 -0.0 -"FALLING" -"Crank Speed" -"Going Low" -"Miata 99-05" -"FALLING" -"Board Default" -"Yes" -1.0 -"Single tooth cam" -0.0 -"Serial Command" -"Board Default" -0.0 -"Closed Loop" -"On" -"Sequential" -"Weak" -"On" -3.5 -3.2 -36.0 -1.0 -400.0 -50.0 -7000.0 -0.0 -0.5 -7200.0 - - 30.0 - 160.0 - 430.0 - 790.0 - - - 10.0 - 40.0 - 60.0 - 80.0 - - - -40.0 - -28.0 - -12.0 - 5.0 - 25.0 - 38.0 - 50.0 - 64.0 - 74.0 - 87.0 - -5.0 - - 121.0 - 110.0 - 100.0 - 89.0 - 82.0 - 71.0 - - - 40.0 - 48.0 - 64.0 - 80.0 - 96.0 - 120.0 - - - 0.0 - 1.0 - 3.0 - 5.0 - 7.0 - 10.0 - -1500.0 -200.0 -5.0 -"Off" -"3" -"LOW" -10.0 -0.0 -0.0 -120.0 -160.0 -20.0 -64.0 - - -20.0 - 10.0 - 30.0 - 45.0 - 60.0 - 80.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 10.0 - 40.0 - 300.0 - - - 0.0 - 10.0 - 15.0 - 20.0 - -0.5 - - 87.0 - 93.0 - 97.0 - 99.0 - 101.0 - 102.0 - 103.0 - 107.0 - - - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - - - -300.0 - -100.0 - -50.0 - 10.0 - 60.0 - 200.0 - - - 0.0 - 0.0 - 0.0 - 4.0 - 5.0 - 7.0 - -400.0 - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - - - 14.7 14.7 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 - 14.7 14.7 14.7 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.7 14.7 14.7 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.5 14.5 14.5 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.4 14.4 14.4 14.6 14.7 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 - 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 - 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 - 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 - 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 - 13.1 13.1 13.1 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 - 13.0 13.0 13.0 13.0 13.0 13.0 13.0 12.8 12.7 12.7 12.7 12.7 12.7 12.7 12.7 12.7 - 12.3 12.3 12.3 12.3 12.3 12.3 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 - 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 - 11.8 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 - 11.9 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 - 11.8 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 - - - 500.0 - 700.0 - 900.0 - 1400.0 - 2100.0 - 2800.0 - 3600.0 - 4600.0 - 5300.0 - 5600.0 - 5900.0 - 6100.0 - 6400.0 - 6700.0 - 6800.0 - 7200.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 46.0 - 56.0 - 68.0 - 76.0 - 86.0 - 96.0 - 100.0 - 120.0 - 140.0 - 160.0 - 180.0 - 200.0 - - - -"PID" -"Wide Band" -"On" -"Off" -"Spark Only" -100.0 -20.0 -0.0 -70.0 -16.0 -"On/Off" -"MAP" -"Advance" -"Yes" -"No" -"On" -15.0 -10.0 -18.0 -15.0 -100.0 -70.0 -"Board Default" -"No" -"Simple" -"Board Default" -"No" -"No" - - 9.0 - 10.0 - 12.0 - 13.0 - 14.0 - 14.5 - - - 139.0 - 114.0 - 74.0 - 62.0 - 50.0 - 46.0 - - - -40.0 - -20.0 - 0.0 - 15.0 - 35.0 - 50.0 - 60.0 - 90.0 - 120.0 - - - 126.0 - 116.0 - 107.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - -34.0 -300.0 -496.0 -"51" -"No" -"LOW" -2800.0 --10.0 -3000.0 -15.0 -0.78125 -1.0625 -0.83567 -192.0 -30.0 -15.0 -9.0 -"Pullup" -"Yes" -"No" -"A0" -800.0 -0.0 -5000.0 - - 1100.0 - 1100.0 - 1100.0 - 1100.0 - 1000.0 - 900.0 - 850.0 - 850.0 - 850.0 - 850.0 - - - 369.0 - 327.0 - 291.0 - 246.0 - 213.0 - 168.0 - 123.0 - 87.0 - 45.0 - 0.0 - - - 32.0 - 32.0 - 32.0 - 31.0 - 29.0 - 27.0 - 22.0 - 19.0 - 19.0 - 19.0 - - - -38.0 - -19.0 - 1.0 - 17.0 - 35.0 - 41.0 - 65.0 - 70.0 - 80.0 - 105.0 - - - 123.0 - 579.0 - 390.0 - 300.0 - - - 40.0 - 40.0 - 40.0 - 33.0 - - - -15.0 - 1.0 - 16.0 - 70.0 - -"PWM Closed loop" -"3" -"1" -"Normal" -20.0 -240.0 -4.0 -"No" -"On/Off" -"Board Default" -90.0 -2.0 -6.0 - - 60.0 - -20.0 - -40.0 - 158.0 - - - - - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - - - 1000.0 - 2000.0 - 3000.0 - 3800.0 - 4500.0 - 5300.0 - 6000.0 - 7200.0 - - - 0.0 - 10.0 - 20.0 - 40.0 - 50.0 - 60.0 - 80.0 - 100.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 11.0 10.0 6.0 6.0 6.0 6.0 7.0 7.0 - 24.0 22.0 20.0 18.0 18.0 18.0 19.0 20.0 - 32.0 30.0 29.0 28.0 27.0 27.0 27.0 29.0 - 39.0 39.0 38.0 38.0 37.0 37.0 36.0 36.0 - 46.0 47.0 47.0 46.0 46.0 45.0 45.0 43.0 - 56.0 56.0 56.0 55.0 55.0 55.0 55.0 56.0 - 68.0 68.0 69.0 69.0 69.0 69.0 69.0 69.0 - - - 1000.0 - 2000.0 - 3000.0 - 3800.0 - 4500.0 - 5300.0 - 6000.0 - 6800.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 7.0 15.0 30.0 41.0 - 55.0 70.0 60.0 50.0 40.0 33.0 25.0 18.0 - 6.0 6.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - - - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - -"Disable" -"Disable" -"Enable" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Digital_local" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"7" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"7" -"7" -"7" -"7" -"7" -"7" -"7" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -255.0 -255.0 -"On" -"On" -"On" -"On" -"On" -"On" -"On" -"On" -"On" - - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - -"7" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -255.0 -255.0 -255.0 -255.0 -"CAN ID 0" -"0x101" -"0x201" -"0x2FF" -"A15" -"A0" -"A0" -"A0" -"A0" -"A0" -"A4" -"A0" -"A1" -"A6" -"A10" -"A10" -"A3" -"A3" -"A3" -"A8" -"30" -"51" -"1" -"8" -"11" -"8" -"12" -"8" -"1" -"8" -"26" -"8" -"46" -"8" -"7" -"8" -"Yes" -"0" -"" -"" -765.0 - - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - - - - - -15.0 - 1.0 - 16.0 - 70.0 - - - 105.0 - 105.0 - 105.0 - 90.0 - -"FC" -"On" -"Table" -"A0" - - 255.0 - 7.0 - 255.0 - 7.0 - 255.0 - 7.0 - 255.0 - 7.0 - - - 510.0 - 14.0 - 510.0 - 14.0 - 510.0 - 14.0 - 510.0 - 14.0 - -5000.0 -30.0 -64775.0 -64010.0 -70.0 - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 50.0 - 50.0 - 50.0 - 50.0 - 50.0 - 50.0 - - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 4.0 - 4.0 - 3.0 - 3.0 - 2.0 - 1.0 - - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 15.0 - 29.0 - 43.0 - 57.0 - 71.0 - 85.0 - -"2 stage" -"30" -60.0 -250.0 -50.0 -17.0 -"31" -"LOW" -"Yes" -3000.0 -6000.0 -6.0 -3.0 -5.0 -"32" -"No" -6000.0 -7000.0 -3.0 -2.0 -5.0 -"Analog" -"3" -"LOW" -"Off" -"No" -"3" -"3" -7.5 -100.0 -1000.0 - - 2000.0 - 3000.0 - 4000.0 - 6000.0 - 5000.0 - 5000.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - -20.0 - -20.0 - - - 30.0 - 30.0 - 30.0 - 30.0 - 15.0 - 3.0 - -1.0 -2.0 -20.0 -0.2 -0.1 -0.0 -0.0 -"MAP" -"Multiplied %" -"MAP" -102.0 -"21" -"LOW" -"Yes" -41.0 -6.0 -1.0 -0.0 -342.0 --1.0 -1.0 -"Off" -"Off" -"Off" -"A15" -"A15" --1.0 -255.0 --1.0 -255.0 - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - -"On" -"Closedloop" -"On" -255.0 -25500.0 -510.0 -510.0 -215.0 -0.0 -"Off" -"63" -"Inverted" -"Off" -"63" -"Inverted" -"63" - - 0.0 - 100.0 - 200.0 - 300.0 - 400.0 - 500.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - -255.0 -255.0 -"Board Default" - - 215.0 - 215.0 - 215.0 - 215.0 - 215.0 - 215.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - -"MAP" -"Added" -"ETH%" -65535.0 -"3" -"HIGH" -"Yes" - - 2000.0 - 500.0 - - - 255.0 - 255.0 - - - - - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - - - 500.0 - 700.0 - 900.0 - 1500.0 - 2100.0 - 2900.0 - 3800.0 - 4700.0 - 5500.0 - 5700.0 - 5900.0 - 6100.0 - 6300.0 - 6500.0 - 6600.0 - 6600.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 40.0 - 46.0 - 50.0 - 56.0 - 60.0 - 66.0 - 70.0 - 76.0 - 86.0 - 90.0 - 96.0 - 100.0 - - - - - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - -"Active high" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -255.0 - - 3.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - -"3" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" - - 0.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - - - 14.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - -"RPM" - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 32.0 - - - 800.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - - - 3.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -">=" -">=" -"AND" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" - - 19043.0 - 19018.0 - 19274.0 - 19275.0 - 19532.0 - 19532.0 - 19789.0 - 20045.0 - - - 78.0 - 78.0 - 78.0 - 79.0 - 79.0 - 79.0 - 80.0 - 80.0 - 80.0 - 81.0 - 81.0 - 81.0 - 81.0 - 82.0 - 82.0 - 82.0 - 83.0 - 83.0 - 83.0 - 83.0 - 84.0 - 84.0 - - - - - 45.0 45.0 46.0 46.0 46.0 46.0 47.0 47.0 47.0 48.0 48.0 48.0 48.0 49.0 49.0 49.0 - 50.0 50.0 50.0 51.0 51.0 51.0 51.0 52.0 52.0 52.0 53.0 53.0 53.0 53.0 54.0 54.0 - 54.0 55.0 55.0 55.0 56.0 56.0 56.0 56.0 57.0 57.0 57.0 58.0 58.0 58.0 58.0 59.0 - 59.0 59.0 60.0 60.0 60.0 61.0 61.0 61.0 61.0 62.0 62.0 62.0 63.0 63.0 63.0 63.0 - 64.0 64.0 64.0 65.0 65.0 65.0 66.0 66.0 66.0 66.0 67.0 67.0 67.0 68.0 68.0 68.0 - 68.0 69.0 69.0 69.0 70.0 70.0 70.0 71.0 71.0 71.0 71.0 72.0 72.0 72.0 73.0 73.0 - 73.0 73.0 74.0 74.0 74.0 75.0 75.0 75.0 76.0 76.0 76.0 76.0 77.0 77.0 77.0 78.0 - 78.0 78.0 78.0 79.0 79.0 79.0 80.0 80.0 80.0 81.0 81.0 81.0 81.0 82.0 82.0 82.0 - 83.0 83.0 83.0 83.0 84.0 84.0 84.0 85.0 85.0 85.0 85.0 86.0 86.0 86.0 87.0 87.0 - 87.0 88.0 88.0 88.0 88.0 89.0 89.0 89.0 90.0 90.0 90.0 90.0 91.0 91.0 91.0 92.0 - 92.0 92.0 93.0 93.0 93.0 93.0 94.0 94.0 94.0 95.0 95.0 95.0 95.0 96.0 96.0 96.0 - 97.0 97.0 97.0 98.0 98.0 98.0 98.0 99.0 99.0 99.0 100.0 100.0 100.0 100.0 101.0 101.0 - 101.0 102.0 102.0 102.0 103.0 103.0 103.0 103.0 104.0 104.0 104.0 105.0 105.0 105.0 105.0 106.0 - 106.0 106.0 107.0 107.0 107.0 108.0 108.0 108.0 108.0 109.0 109.0 109.0 110.0 110.0 110.0 110.0 - 111.0 111.0 111.0 112.0 112.0 112.0 113.0 113.0 113.0 113.0 114.0 114.0 114.0 115.0 115.0 115.0 - 115.0 116.0 116.0 116.0 117.0 117.0 117.0 118.0 118.0 118.0 118.0 119.0 119.0 119.0 120.0 120.0 - - - 16000.0 - 16000.0 - 16100.0 - 16100.0 - 16100.0 - 16200.0 - 16200.0 - 16200.0 - 16300.0 - 16300.0 - 16300.0 - 16300.0 - 16400.0 - 16400.0 - 16400.0 - 16500.0 - - - 338.0 - 338.0 - 338.0 - 336.0 - 336.0 - 336.0 - 336.0 - 334.0 - 334.0 - 334.0 - 332.0 - 332.0 - 332.0 - 330.0 - 330.0 - 330.0 - - - - - - - - - - - - - - - - - - - diff --git a/public/tunes/202103.msq b/public/tunes/202103.msq deleted file mode 100644 index 1e0c7c3..0000000 --- a/public/tunes/202103.msq +++ /dev/null @@ -1,2370 +0,0 @@ - - - - - -"0" -"CAN ID 0" -8000.0 -3000.0 -5000.0 -255.0 -200.0 -245.0 - - -2.0 - -1.5 - -1.2 - -1.0 - -0.8 - -0.6 - -0.4 - -0.2 - -0.1 - 0.0 - - - 110.0 - 110.0 - 110.0 - 110.0 - 107.0 - 106.0 - 101.0 - 100.0 - 100.0 - 100.0 - - - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 6.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - - - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 6.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 8.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - 4.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 6.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 8.0 - 0.0 - 0.0 - 0.0 - 0.0 - 8.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - 511.0 - 100.0 - 511.0 - 511.0 - 100.0 - 100.0 - 100.0 - 100.0 - -"1" -255.0 -255.0 -255.0 -255.0 -VSS_RAW -Clutch_RAW -Alternator_Disable -"GPS Speed" -0.0 -"cc/min" -"Log HP & Tq" -"Off" -"US Gallons" -"Miles Per Hour" -3450.0 -"lbs" -0.34 -32.0 -19.3 -"sqft" -25.5 -1.0 -3.7 -0.0 - - -5.0 -120.0 -0.0 -"TPS" -"Open Time only" -"Fixed" -"On" -"PW Adder" -"Baro" - - 110.0 - 110.0 - 110.0 - 110.0 - 107.0 - 106.0 - 101.0 - 100.0 - 100.0 - 100.0 - -20.0 -"Speeduino v0.4" -"Board Default" -"Normal" -3.0 -10.0 -30.0 -0.0 -"Unused" -"VE" -"CPU" -"TPS" -"Mem" -"RPM" -"RPM" -"RPM" -6.4 -2.0 -"Alternating" -"No" -"No" -"Full" -"MAP" -"Disabled" -1.0 - - 355.0 - 355.0 - 355.0 - 355.0 - -"Instantaneous" -"Four-stroke" -"Port" -"4" -"MAP" -"Off" -"4" -"Even fire" -"Off" -"No" -"Off" -"Sequential" -"Yes" -"On" -60.0 -90.0 -50.0 -150.0 -50.0 -27.0 -186.0 -10.0 -260.0 -2.0 -14.7 -0.0 -0.0 -0.0 -"36" -"Normal" -"On" -20.0 -1500.0 -2000.0 -0.0 -50.0 -0.0 -16.0 -14610.0 --1.0 -65535.0 -"No" -"No" -"Yes" -"2" -"Off" -"No" - - 10.0 - 10.0 - 5.0 - 5.0 - - - 10.0 - 10.0 - 5.0 - 2.0 - - - -20.0 - 10.0 - 40.0 - 85.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 33.0 - 60.0 - 95.0 - -"Board Default" -"Inverted" -"On" -"Added" -"TPS" -"0" -900.0 -5.0 - - 500.0 - 2000.0 - 4500.0 - 6500.0 - -4.5 -25.0 -70.0 -"Pulses per KM" -"A15" -0.0 -255.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -"On" -"No" -"Board Default" -7000.0 -1.0 -255.0 -2550.0 -0.0 -0.0 - - 255.0 - 255.0 - 255.0 - - - - - 70.0 70.0 70.0 70.0 67.0 63.0 56.0 62.0 55.0 54.0 53.0 56.0 51.0 52.0 59.0 66.0 - 70.0 72.0 72.0 75.0 72.0 73.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 78.0 - 70.0 72.0 72.0 73.0 71.0 69.0 77.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 83.0 - 69.0 73.0 75.0 73.0 66.0 68.0 74.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 82.0 - 71.0 70.0 72.0 70.0 66.0 69.0 74.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 83.0 - 72.0 72.0 73.0 71.0 67.0 70.0 75.0 81.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 82.0 - 73.0 73.0 70.0 74.0 68.0 66.0 75.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 87.0 - 73.0 74.0 75.0 75.0 71.0 68.0 80.0 82.0 80.0 80.0 80.0 80.0 80.0 80.0 80.0 93.0 - 75.0 77.0 77.0 76.0 78.0 79.0 82.0 86.0 85.0 85.0 85.0 85.0 85.0 85.0 85.0 100.0 - 75.0 76.0 77.0 80.0 86.0 90.0 93.0 94.0 97.0 92.0 92.0 92.0 92.0 101.0 102.0 105.0 - 75.0 76.0 75.0 82.0 85.0 97.0 99.0 100.0 99.0 95.0 93.0 92.0 92.0 101.0 104.0 107.0 - 75.0 78.0 73.0 81.0 85.0 99.0 100.0 103.0 102.0 99.0 97.0 97.0 94.0 99.0 103.0 109.0 - 81.0 82.0 74.0 84.0 96.0 99.0 106.0 108.0 104.0 104.0 103.0 101.0 102.0 106.0 109.0 114.0 - 90.0 91.0 86.0 97.0 111.0 109.0 114.0 117.0 117.0 116.0 117.0 114.0 114.0 111.0 113.0 115.0 - 96.0 91.0 93.0 98.0 119.0 118.0 119.0 120.0 121.0 121.0 122.0 122.0 122.0 119.0 120.0 119.0 - 96.0 101.0 102.0 107.0 119.0 121.0 123.0 124.0 124.0 123.0 123.0 124.0 121.0 119.0 122.0 122.0 - - - 500.0 - 700.0 - 900.0 - 1400.0 - 2100.0 - 2800.0 - 3600.0 - 4600.0 - 5300.0 - 5600.0 - 5900.0 - 6100.0 - 6400.0 - 6700.0 - 6800.0 - 7200.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 46.0 - 56.0 - 66.0 - 76.0 - 86.0 - 96.0 - 100.0 - 120.0 - 140.0 - 160.0 - 180.0 - 200.0 - - - - - 18.0 14.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 - 12.0 10.0 10.0 18.0 25.0 38.0 39.0 38.0 37.0 37.0 17.0 20.0 25.0 29.0 34.0 39.0 - 12.0 10.0 10.0 19.0 26.0 38.0 39.0 38.0 37.0 37.0 30.0 32.0 34.0 36.0 38.0 41.0 - 12.0 10.0 10.0 21.0 28.0 38.0 39.0 38.0 37.0 37.0 36.0 37.0 38.0 38.0 39.0 41.0 - 12.0 12.0 12.0 25.0 28.0 36.0 37.0 37.0 36.0 36.0 37.0 37.0 38.0 38.0 39.0 40.0 - 11.0 11.0 11.0 23.0 26.0 32.0 33.0 35.0 36.0 36.0 36.0 37.0 37.0 38.0 39.0 40.0 - 11.0 11.0 11.0 22.0 25.0 28.0 30.0 32.0 35.0 35.0 35.0 35.0 36.0 37.0 38.0 40.0 - 10.0 10.0 10.0 19.0 23.0 23.0 27.0 29.0 30.0 30.0 31.0 32.0 34.0 35.0 37.0 39.0 - 9.0 9.0 9.0 19.0 22.0 20.0 24.0 25.0 27.0 27.0 28.0 29.0 31.0 33.0 35.0 38.0 - 8.0 8.0 8.0 18.0 19.0 18.0 20.0 21.0 23.0 24.0 24.0 26.0 28.0 30.0 33.0 36.0 - 7.0 7.0 7.0 15.0 16.0 17.0 18.0 18.0 18.0 19.0 20.0 22.0 25.0 27.0 30.0 34.0 - 6.0 6.0 6.0 11.0 12.0 16.0 16.0 16.0 17.0 18.0 18.0 20.0 22.0 25.0 28.0 31.0 - 4.0 4.0 4.0 6.0 8.0 10.0 12.0 12.0 13.0 13.0 14.0 16.0 19.0 21.0 25.0 28.0 - 2.0 2.0 2.0 3.0 4.0 8.0 9.0 9.0 10.0 10.0 10.0 13.0 16.0 19.0 22.0 26.0 - 2.0 2.0 2.0 2.0 4.0 6.0 8.0 8.0 8.0 8.0 8.0 11.0 13.0 16.0 19.0 23.0 - 2.0 2.0 2.0 2.0 2.0 4.0 5.0 6.0 6.0 7.0 7.0 9.0 11.0 13.0 16.0 19.0 - - - 500.0 - 800.0 - 1000.0 - 1500.0 - 1800.0 - 2300.0 - 2900.0 - 3400.0 - 3900.0 - 4300.0 - 4800.0 - 5300.0 - 5900.0 - 6500.0 - 7200.0 - 8000.0 - - - 10.0 - 24.0 - 36.0 - 56.0 - 66.0 - 76.0 - 84.0 - 100.0 - 110.0 - 126.0 - 140.0 - 160.0 - 180.0 - 200.0 - 220.0 - 250.0 - - - -0.0 -10.0 -20.0 -0.0 -"RISING" -"Crank Speed" -"Going Low" -"Miata 99-05" -"RISING" -"Board Default" -"Yes" -1.0 -"Single tooth cam" -"Low" -0.0 -"Serial Command" -"Board Default" -0.0 -"Closed Loop" -"On" -"Sequential" -"Weak" -"On" -3.5 -3.2 -36.0 -1.0 -400.0 -50.0 -7000.0 -0.0 -0.5 -7200.0 - - 30.0 - 160.0 - 430.0 - 790.0 - - - 10.0 - 40.0 - 60.0 - 80.0 - - - -40.0 - -28.0 - -12.0 - 5.0 - 25.0 - 38.0 - 50.0 - 64.0 - 74.0 - 87.0 - -5.0 - - 121.0 - 110.0 - 103.0 - 89.0 - 82.0 - 71.0 - - - 40.0 - 48.0 - 64.0 - 80.0 - 96.0 - 120.0 - - - 0.0 - 1.0 - 3.0 - 5.0 - 7.0 - 10.0 - -1500.0 -200.0 -5.0 -"Off" -"3" -"LOW" -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 - - -20.0 - 10.0 - 30.0 - 45.0 - 60.0 - 80.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 10.0 - 40.0 - 300.0 - - - 0.0 - 10.0 - 15.0 - 20.0 - -0.5 - - 87.0 - 93.0 - 97.0 - 99.0 - 101.0 - 102.0 - 103.0 - 107.0 - - - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - 100.0 - - - -300.0 - -100.0 - -50.0 - 10.0 - 60.0 - 200.0 - - - 0.0 - 0.0 - 0.0 - 4.0 - 5.0 - 7.0 - -400.0 - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - - - 14.7 14.7 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 - 14.7 14.7 14.7 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.7 14.7 14.7 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.5 14.5 14.5 14.5 14.7 15.0 15.0 15.0 15.0 15.0 15.0 15.0 14.9 14.9 14.9 14.9 - 14.4 14.4 14.4 14.6 14.7 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 14.8 - 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 - 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 14.5 - 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 - 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 - 13.1 13.1 13.1 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 13.0 - 13.0 13.0 13.0 13.0 13.0 13.0 13.0 12.8 12.7 12.7 12.7 12.7 12.7 12.7 12.7 12.7 - 12.3 12.3 12.3 12.3 12.3 12.3 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 12.2 - 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 12.0 - 11.8 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 11.6 - 11.9 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 11.4 - 11.8 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 11.3 - - - 500.0 - 700.0 - 900.0 - 1400.0 - 2100.0 - 2800.0 - 3600.0 - 4600.0 - 5300.0 - 5600.0 - 5900.0 - 6100.0 - 6400.0 - 6700.0 - 6800.0 - 7200.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 46.0 - 56.0 - 68.0 - 76.0 - 86.0 - 96.0 - 100.0 - 120.0 - 140.0 - 160.0 - 180.0 - 200.0 - - - -"PID" -"Wide Band" -"On" -"Off" -"Spark Only" -100.0 -20.0 -0.0 -70.0 -16.0 -"On/Off" -"MAP" -"Advance" -"Yes" -"No" -"On" -15.0 -10.0 -18.0 -15.0 -100.0 -70.0 -"Board Default" -"No" -"Simple" -"Board Default" -"No" -"No" - - 9.0 - 10.0 - 11.8 - 13.0 - 14.0 - 14.5 - - - 139.0 - 114.0 - 74.0 - 62.0 - 50.0 - 46.0 - - - -40.0 - -20.0 - 0.0 - 15.0 - 35.0 - 50.0 - 60.0 - 90.0 - 215.0 - - - 175.0 - 175.0 - 0.0 - 175.0 - 175.0 - 175.0 - 175.0 - 175.0 - 175.0 - -34.0 -300.0 -496.0 -"51" -"No" -"LOW" -2800.0 --10.0 -3000.0 -15.0 -0.78125 -1.0625 -0.83567 -192.0 -30.0 -15.0 -9.0 -"Pullup" -"No" -"Yes" -"No" -"A0" -800.0 -0.0 -5000.0 - - 1100.0 - 1100.0 - 1100.0 - 1100.0 - 1000.0 - 900.0 - 850.0 - 850.0 - 850.0 - 850.0 - - - 369.0 - 327.0 - 291.0 - 246.0 - 213.0 - 168.0 - 123.0 - 87.0 - 45.0 - 0.0 - - - 32.0 - 32.0 - 32.0 - 31.0 - 29.0 - 27.0 - 22.0 - 19.0 - 19.0 - 19.0 - - - -38.0 - -19.0 - 1.0 - 17.0 - 35.0 - 41.0 - 65.0 - 70.0 - 80.0 - 105.0 - - - 123.0 - 579.0 - 390.0 - 300.0 - - - 40.0 - 40.0 - 40.0 - 33.0 - - - -15.0 - 1.0 - 16.0 - 70.0 - -"PWM Closed loop" -"3" -"1" -"Normal" -20.0 -240.0 -4.0 -"No" -"On/Off" -"Board Default" -90.0 -2.0 -6.0 - - 60.0 - -20.0 - -40.0 - 158.0 - - - - - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 - - - 1000.0 - 2000.0 - 3000.0 - 3800.0 - 4500.0 - 5300.0 - 6000.0 - 7200.0 - - - 0.0 - 10.0 - 20.0 - 40.0 - 50.0 - 60.0 - 80.0 - 100.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 11.0 10.0 6.0 6.0 6.0 6.0 7.0 7.0 - 24.0 22.0 20.0 18.0 18.0 18.0 19.0 20.0 - 32.0 30.0 29.0 28.0 27.0 27.0 27.0 29.0 - 39.0 39.0 38.0 38.0 37.0 37.0 36.0 36.0 - 46.0 47.0 47.0 46.0 46.0 45.0 45.0 43.0 - 56.0 56.0 56.0 55.0 55.0 55.0 55.0 56.0 - 68.0 68.0 69.0 69.0 69.0 69.0 69.0 69.0 - - - 1000.0 - 2000.0 - 3000.0 - 3800.0 - 4500.0 - 5300.0 - 6000.0 - 6800.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 7.0 15.0 30.0 41.0 - 55.0 70.0 60.0 50.0 40.0 33.0 25.0 18.0 - 6.0 6.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - - - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - 12800.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 - - - 700.0 - 1500.0 - 3000.0 - 4100.0 - 5500.0 - 7000.0 - - - 36.0 - 50.0 - 66.0 - 80.0 - 100.0 - 120.0 - - - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - 127.0 127.0 127.0 127.0 127.0 127.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - -"Disable" -"Disable" -"Enable" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Digital_local" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"Off" -"Digital_local" -"Via Secondary Serial" -"Via Internal CAN" -"Via Internal CAN" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"0x100" -"7" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"7" -"7" -"7" -"7" -"7" -"7" -"7" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -255.0 -255.0 -"On" -"On" -"On" -"On" -"On" -"On" -"On" -"On" -"On" - - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - 65535.0 - -"7" -"0" -"0" -"0" -"0" -"0" -"0" -"0" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -"1" -255.0 -255.0 -255.0 -255.0 -"CAN ID 0" -"0x101" -"0x201" -"0x2FF" -"A15" -"A0" -"A0" -"A0" -"A0" -"A0" -"A4" -"A0" -"A1" -"A6" -"A10" -"A10" -"A3" -"A3" -"A3" -"A8" -"30" -"51" -"1" -"8" -"11" -"8" -"12" -"8" -"1" -"8" -"26" -"8" -"46" -"8" -"7" -"8" -"Yes" -"0" -"" -"" -765.0 - - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - 7.0 - - - - - -15.0 - 1.0 - 16.0 - 70.0 - - - 105.0 - 105.0 - 105.0 - 90.0 - -"FC" -"On" -"Table" -"A0" - - 255.0 - 7.0 - 255.0 - 7.0 - 255.0 - 7.0 - 255.0 - 7.0 - - - 510.0 - 14.0 - 510.0 - 14.0 - 510.0 - 14.0 - 510.0 - 14.0 - -5000.0 -30.0 -64775.0 -64010.0 -70.0 - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 50.0 - 50.0 - 50.0 - 50.0 - 50.0 - 50.0 - - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 4.0 - 4.0 - 3.0 - 3.0 - 2.0 - 1.0 - - - 0.0 - 20.0 - 40.0 - 60.0 - 80.0 - 100.0 - - - 15.0 - 29.0 - 43.0 - 57.0 - 71.0 - 85.0 - -"2 stage" -"30" -60.0 -250.0 -50.0 -17.0 -"31" -"LOW" -"Yes" -3000.0 -6000.0 -6.0 -3.0 -5.0 -"32" -"No" -6000.0 -7000.0 -3.0 -2.0 -5.0 -"Analog" -"3" -"LOW" -"Off" -"No" -"3" -"3" -7.5 -100.0 -1000.0 - - 2000.0 - 3000.0 - 4000.0 - 6000.0 - 5000.0 - 5000.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - -20.0 - -20.0 - - - 30.0 - 30.0 - 30.0 - 30.0 - 15.0 - 3.0 - -1.0 -2.0 -20.0 -0.2 -0.1 -0.0 -0.0 -"MAP" -"Multiplied %" -"MAP" -102.0 -"21" -"LOW" -"Yes" -41.0 -6.0 -1.0 -0.0 -342.0 --1.0 -1.0 -"Off" -"Off" -"Off" -"A15" -"A15" --1.0 -255.0 --1.0 -255.0 - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - -"On" -"Closedloop" -"On" -255.0 -25500.0 -510.0 -510.0 -215.0 -0.0 -"Off" -"63" -"Inverted" -"Off" -"63" -"Inverted" -"63" - - 0.0 - 100.0 - 200.0 - 300.0 - 400.0 - 500.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - -255.0 -255.0 -"Board Default" - - 215.0 - 215.0 - 215.0 - 215.0 - 215.0 - 215.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - -"MAP" -"Added" -"ETH%" -65535.0 -"3" -"HIGH" -"Yes" - - 2000.0 - 500.0 - - - - - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - - - 500.0 - 700.0 - 900.0 - 1500.0 - 2100.0 - 2900.0 - 3800.0 - 4700.0 - 5500.0 - 5700.0 - 5900.0 - 6100.0 - 6300.0 - 6500.0 - 6600.0 - 6600.0 - - - 16.0 - 26.0 - 30.0 - 36.0 - 40.0 - 46.0 - 50.0 - 56.0 - 60.0 - 66.0 - 70.0 - 76.0 - 86.0 - 90.0 - 96.0 - 100.0 - - - - - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 - - - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - 25500.0 - - - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - 510.0 - - - 2.0 2.0 2.0 2.0 - 2.0 2.0 2.0 2.0 - 2.0 2.0 2.0 2.0 - 2.0 2.0 2.0 2.0 - - - 500.0 - 2100.0 - 6100.0 - 7200.0 - - - 16.0 - 66.0 - 100.0 - 200.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - -"Active high" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -"Active low" -255.0 - - 3.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - -"3" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" -"Disabled" - - 0.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - 25.5 - - - 14.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - -"RPM" - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - - - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 255.0 - 32.0 - - - 800.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - - - 3.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -1.0 - -">=" -">=" -"AND" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" -"==" -"==" -"XOR" - - 19043.0 - 19018.0 - 19274.0 - 19275.0 - 19532.0 - 19532.0 - 19789.0 - 20045.0 - - - 78.0 - 78.0 - 78.0 - 79.0 - 79.0 - 79.0 - 80.0 - 80.0 - 80.0 - 81.0 - 81.0 - 81.0 - 81.0 - 82.0 - 82.0 - 82.0 - 83.0 - 83.0 - 83.0 - 83.0 - 84.0 - 84.0 - - - - - 45.0 45.0 46.0 46.0 46.0 46.0 47.0 47.0 47.0 48.0 48.0 48.0 48.0 49.0 49.0 49.0 - 50.0 50.0 50.0 51.0 51.0 51.0 51.0 52.0 52.0 52.0 53.0 53.0 53.0 53.0 54.0 54.0 - 54.0 55.0 55.0 55.0 56.0 56.0 56.0 56.0 57.0 57.0 57.0 58.0 58.0 58.0 58.0 59.0 - 59.0 59.0 60.0 60.0 60.0 61.0 61.0 61.0 61.0 62.0 62.0 62.0 63.0 63.0 63.0 63.0 - 64.0 64.0 64.0 65.0 65.0 65.0 66.0 66.0 66.0 66.0 67.0 67.0 67.0 68.0 68.0 68.0 - 68.0 69.0 69.0 69.0 70.0 70.0 70.0 71.0 71.0 71.0 71.0 72.0 72.0 72.0 73.0 73.0 - 73.0 73.0 74.0 74.0 74.0 75.0 75.0 75.0 76.0 76.0 76.0 76.0 77.0 77.0 77.0 78.0 - 78.0 78.0 78.0 79.0 79.0 79.0 80.0 80.0 80.0 81.0 81.0 81.0 81.0 82.0 82.0 82.0 - 83.0 83.0 83.0 83.0 84.0 84.0 84.0 85.0 85.0 85.0 85.0 86.0 86.0 86.0 87.0 87.0 - 87.0 88.0 88.0 88.0 88.0 89.0 89.0 89.0 90.0 90.0 90.0 90.0 91.0 91.0 91.0 92.0 - 92.0 92.0 93.0 93.0 93.0 93.0 94.0 94.0 94.0 95.0 95.0 95.0 95.0 96.0 96.0 96.0 - 97.0 97.0 97.0 98.0 98.0 98.0 98.0 99.0 99.0 99.0 100.0 100.0 100.0 100.0 101.0 101.0 - 101.0 102.0 102.0 102.0 103.0 103.0 103.0 103.0 104.0 104.0 104.0 105.0 105.0 105.0 105.0 106.0 - 106.0 106.0 107.0 107.0 107.0 108.0 108.0 108.0 108.0 109.0 109.0 109.0 110.0 110.0 110.0 110.0 - 111.0 111.0 111.0 112.0 112.0 112.0 113.0 113.0 113.0 113.0 114.0 114.0 114.0 115.0 115.0 115.0 - 115.0 116.0 116.0 116.0 117.0 117.0 117.0 118.0 118.0 118.0 118.0 119.0 119.0 119.0 120.0 120.0 - - - 16000.0 - 16000.0 - 16100.0 - 16100.0 - 16100.0 - 16200.0 - 16200.0 - 16200.0 - 16300.0 - 16300.0 - 16300.0 - 16300.0 - 16400.0 - 16400.0 - 16400.0 - 16500.0 - - - 338.0 - 338.0 - 338.0 - 336.0 - 336.0 - 336.0 - 336.0 - 334.0 - 334.0 - 334.0 - 332.0 - 332.0 - 332.0 - 330.0 - 330.0 - 330.0 - - - - - - - - - - - - - - - - - - - diff --git a/src/App.tsx b/src/App.tsx index 69362c8..5aa5e5d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,8 @@ import { Switch, Route, - Redirect, + useLocation, + matchPath, } from 'react-router-dom'; import { Layout, @@ -15,21 +16,25 @@ import { Suspense, useCallback, useEffect, + useMemo, } from 'react'; -import { - AppState, - UIState, - Config as ConfigType, -} from '@speedy-tuner/types'; +import useBrowserStorage from './hooks/useBrowserStorage'; import TopBar from './components/TopBar'; import StatusBar from './components/StatusBar'; import { Routes } from './routes'; -import useStorage from './hooks/useStorage'; -import { loadAll } from './utils/api'; +import { loadTune } from './utils/api'; +import store from './store'; import Log from './pages/Log'; import 'react-perfect-scrollbar/dist/css/styles.css'; import './App.less'; +import { + AppState, + NavigationState, + UIState, +} from './types/state'; +import useDb from './hooks/useDb'; +import useServerStorage from './hooks/useServerStorage'; // TODO: fix this // lazy loading this component causes a weird Curve canvas scaling @@ -47,17 +52,41 @@ const { Content } = Layout; const mapStateToProps = (state: AppState) => ({ ui: state.ui, status: state.status, - config: state.config, + navigation: state.navigation, }); -const App = ({ ui, config }: { ui: UIState, config: ConfigType }) => { +const App = ({ ui, navigation }: { ui: UIState, navigation: NavigationState }) => { const margin = ui.sidebarCollapsed ? 80 : 250; + const { getTune } = useDb(); + const { getFile } = useServerStorage(); + const { storageSet } = useBrowserStorage(); + // const [lastDialogPath, setLastDialogPath] = useState(); - const { storageGetSync } = useStorage(); - const lastDialogPath = storageGetSync('lastDialog'); + // const lastDialogPath = storageGetSync('lastDialog'); + + const { pathname } = useLocation(); + const matchedTunePath = useMemo(() => matchPath(pathname, { + path: Routes.TUNE_ROOT, + }), [pathname]); useEffect(() => { - loadAll(); + const tuneId = (matchedTunePath?.params as any)?.tuneId; + if (tuneId) { + + getTune(tuneId).then(async (tuneData) => { + const [tuneRaw, iniRaw] = await Promise.all([ + await getFile(tuneData.tuneFile!), + await getFile(tuneData.customIniFile!), + ]); + + loadTune(tuneRaw, iniRaw); + }); + + + storageSet('lastTuneId', tuneId); + store.dispatch({ type: 'navigation/tuneId', payload: tuneId }); + } + // storageGet('lastDialog') // .then((path) => setLastDialogPath(path)); @@ -95,42 +124,51 @@ const App = ({ ui, config }: { ui: UIState, config: ConfigType }) => { return ( <> - + - + {/* + + */} + + + - + - + - + - + - + - + - + diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index 3d90ad4..15890d5 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -17,8 +17,6 @@ import { import { Config as ConfigType, Menus as MenusType, - AppState, - UIState, Tune as TuneType, } from '@speedy-tuner/types'; import store from '../store'; @@ -26,6 +24,11 @@ import Icon from './SideBar/Icon'; import { evaluateExpression } from '../utils/tune/expression'; import { Routes } from '../routes'; import useConfig from '../hooks/useConfig'; +import { + AppState, + NavigationState, + UIState, +} from '../types/state'; const { Sider } = Layout; const { SubMenu } = Menu; @@ -42,6 +45,7 @@ const mapStateToProps = (state: AppState) => ({ config: state.config, tune: state.tune, ui: state.ui, + navigation: state.navigation, }); const SKIP_MENUS = [ @@ -62,11 +66,13 @@ const SideBar = ({ config, tune, ui, + navigation, matchedPath, }: { config: ConfigType, tune: TuneType, ui: UIState, + navigation: NavigationState, matchedPath: DialogMatchedPathType, }) => { const sidebarWidth = 250; @@ -79,10 +85,11 @@ const SideBar = ({ } as any; const { isConfigReady } = useConfig(config); const checkCondition = useCallback((condition: string) => evaluateExpression(condition, tune.constants, config), [tune.constants, config]); - const buildLink = useCallback((main: string, sub: string) => generatePath(Routes.DIALOG, { + const buildUrl = useCallback((main: string, sub: string) => generatePath(Routes.TUNE_DIALOG, { + tuneId: navigation.tuneId || 'not-ready', category: main, dialog: sub, - }), []); + }), [navigation.tuneId]); const [menus, setMenus] = useState([]); const menusList = useCallback((types: MenusType) => ( @@ -99,7 +106,7 @@ const SideBar = ({ > {Object.keys(types[menuName].subMenus).map((subMenuName: string) => { if (subMenuName === 'std_separator') { - return ; + return ; } if (SKIP_SUB_MENUS.includes(`${menuName}/${subMenuName}`)) { @@ -114,11 +121,11 @@ const SideBar = ({ } return (} disabled={!enabled} > - + {subMenu.title} ); @@ -126,7 +133,7 @@ const SideBar = ({ ); }) - ), [buildLink, checkCondition]); + ), [buildUrl, checkCondition]); useEffect(() => { if (Object.keys(tune.constants).length) { diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx index a96f45f..78bc6e4 100644 --- a/src/components/TopBar.tsx +++ b/src/components/TopBar.tsx @@ -3,7 +3,10 @@ import { useLocation, useHistory, } from 'react-router'; -import { Link } from 'react-router-dom'; +import { + Link, + generatePath, +} from 'react-router-dom'; import { Layout, Space, @@ -60,12 +63,15 @@ const { Header } = Layout; const { useBreakpoint } = Grid; const { SubMenu } = Menu; -const TopBar = () => { +const TopBar = ({ tuneId }: { tuneId: string | null }) => { const { sm, lg } = useBreakpoint(); const { pathname } = useLocation(); const { currentUser, logout } = useAuth(); const history = useHistory(); - const matchedTabPath = useMemo(() => matchPath(pathname, { path: Routes.TAB }), [pathname]); + const buildTuneUrl = (route: string) => tuneId ? generatePath(route, { tuneId }) : null; + const matchedTabPath = useMemo(() => matchPath(pathname, { + path: Routes.TUNE_TAB, + }), [pathname]); const logoutClick = useCallback(async () => { try { await logout(); @@ -96,38 +102,42 @@ const TopBar = () => { return () => document.removeEventListener('keydown', handleGlobalKeyboard); }); + const tabs = ( + + history.push(e.target.value)} + > + + + + {sm && 'Tune'} + + + + + + {sm && 'Log'} + + + + + + {sm && 'Diagnose'} + + + + + ); + return (
- - history.push(e.target.value)} - > - - - - {sm && 'Tune'} - - - - - - {sm && 'Log'} - - - - - - {sm && 'Diagnose'} - - - - + {tuneId ? tabs : } { diff --git a/src/components/Tune/Dialog.tsx b/src/components/Tune/Dialog.tsx index 19bc53b..60e6b0b 100644 --- a/src/components/Tune/Dialog.tsx +++ b/src/components/Tune/Dialog.tsx @@ -39,7 +39,7 @@ import { } from '../../utils/tune/table'; import Map from './Dialog/Map'; import { evaluateExpression } from '../../utils/tune/expression'; -import useStorage from '../../hooks/useStorage'; +import useBrowserStorage from '../../hooks/useBrowserStorage'; import useConfig from '../../hooks/useConfig'; interface DialogsAndCurves { @@ -107,7 +107,7 @@ const Dialog = ({ url: string, }) => { const isDataReady = Object.keys(tune.constants).length && Object.keys(config.constants).length; - const { storageSet } = useStorage(); + const { storageSet } = useBrowserStorage(); const { findConstantOnPage } = useConfig(config); const [panelsComponents, setPanelsComponents] = useState([]); const containerRef = useRef(null); diff --git a/src/firebase.ts b/src/firebase.ts index c92c2dd..b362692 100644 --- a/src/firebase.ts +++ b/src/firebase.ts @@ -18,6 +18,7 @@ import { uploadBytes, uploadBytesResumable, deleteObject, + getBytes, } from 'firebase/storage'; import { getFirestore, @@ -62,6 +63,7 @@ export { uploadBytes, uploadBytesResumable, deleteObject, + getBytes, doc as fireStoreDoc, collection as fireStoreCollection, setDoc, diff --git a/src/utils/storage/BrowserStorage.ts b/src/hooks/useBrowserStorage.ts similarity index 58% rename from src/utils/storage/BrowserStorage.ts rename to src/hooks/useBrowserStorage.ts index 27cdfc1..1ea5aae 100644 --- a/src/utils/storage/BrowserStorage.ts +++ b/src/hooks/useBrowserStorage.ts @@ -1,6 +1,6 @@ -import { StorageInterface } from '../StorageInterface'; +import { useMemo } from 'react'; -class BrowserStorage implements StorageInterface { +class BrowserStorage { private storage: Storage; public constructor() { @@ -30,4 +30,15 @@ class BrowserStorage implements StorageInterface { } } -export default BrowserStorage; +const useBrowserStorage = () => { + const storage = useMemo(() => new BrowserStorage(), []); + + return { + storageGet: (key: string) => storage.get(key), + storageGetSync: (key: string) => storage.getSync(key), + storageSet: (key: string, value: string) => storage.set(key, value), + storageDelete: (key: string) => storage.delete(key), + }; +}; + +export default useBrowserStorage; diff --git a/src/hooks/useDb.ts b/src/hooks/useDb.ts new file mode 100644 index 0000000..8d84782 --- /dev/null +++ b/src/hooks/useDb.ts @@ -0,0 +1,48 @@ +import { notification } from 'antd'; +import * as Sentry from '@sentry/browser'; +import { + fireStoreDoc, + getDoc, + setDoc, + db, +} from '../firebase'; +import { TuneDbData } from '../types/dbData'; + +const genericError = (error: Error) => notification.error({ message: 'Database Error', description: error.message }); + +const useDb = () => { + const getData = async (tuneId: string, collection: string) => { + try { + const tune = (await getDoc(fireStoreDoc(db, collection, tuneId))).data() as TuneDbData; + + return Promise.resolve(tune); + } catch (error) { + Sentry.captureException(error); + console.error(error); + genericError(error as Error); + + return Promise.reject(error); + } + }; + + const updateData = async (tuneId: string, collection: string, data: TuneDbData) => { + try { + await setDoc(fireStoreDoc(db, collection, tuneId), data, { merge: true }); + + return Promise.resolve(); + } catch (error) { + Sentry.captureException(error); + console.error(error); + genericError(error as Error); + + return Promise.reject(error); + } + }; + + return { + getTune: (tuneId: string): Promise => getData(tuneId, 'tunes'), + updateData: (tuneId: string, data: TuneDbData): Promise => updateData(tuneId, 'tunes', data), + }; +}; + +export default useDb; diff --git a/src/hooks/useServerStorage.ts b/src/hooks/useServerStorage.ts new file mode 100644 index 0000000..1a16da1 --- /dev/null +++ b/src/hooks/useServerStorage.ts @@ -0,0 +1,31 @@ +import { notification } from 'antd'; +import * as Sentry from '@sentry/browser'; +import { + storage, + storageRef, + getBytes, +} from '../firebase'; + +const genericError = (error: Error) => notification.error({ message: 'Database Error', description: error.message }); + +const useServerStorage = () => { + const getFile = async (path: string) => { + try { + const buffer = await getBytes(storageRef(storage, path)); + + return Promise.resolve(buffer); + } catch (error) { + Sentry.captureException(error); + console.error(error); + genericError(error as Error); + + return Promise.reject(error); + } + }; + + return { + getFile: (path: string): Promise => getFile(path), + }; +}; + +export default useServerStorage; diff --git a/src/hooks/useStorage.ts b/src/hooks/useStorage.ts deleted file mode 100644 index 599822f..0000000 --- a/src/hooks/useStorage.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { useMemo } from 'react'; -import Storage from '../utils/Storage'; - -const useStorage = () => { - const storage = useMemo(() => new Storage(), []); - - return { - storageGet: (key: string) => storage.get(key), - storageGetSync: (key: string) => storage.getSync(key), - storageSet: (key: string, value: string) => storage.set(key, value), - storageDelete: (key: string) => storage.delete(key), - }; -}; - -export default useStorage; diff --git a/src/pages/Diagnose.tsx b/src/pages/Diagnose.tsx index 452aa40..668a602 100644 --- a/src/pages/Diagnose.tsx +++ b/src/pages/Diagnose.tsx @@ -19,6 +19,7 @@ import { FileTextOutlined, GlobalOutlined, } from '@ant-design/icons'; +import * as Sentry from '@sentry/browser'; import pako from 'pako'; import useBreakpoint from 'antd/lib/grid/hooks/useBreakpoint'; import { connect } from 'react-redux'; @@ -121,6 +122,7 @@ const Diagnose = ({ ui, config, loadedLogs }: { ui: UIState, config: Config, loa setStep(2); } catch (error) { setFetchError(error as Error); + Sentry.captureException(error); console.error(error); } }; diff --git a/src/pages/Tune.tsx b/src/pages/Tune.tsx index ea6926f..ec4997f 100644 --- a/src/pages/Tune.tsx +++ b/src/pages/Tune.tsx @@ -7,30 +7,30 @@ import { } from 'react-router-dom'; import { connect } from 'react-redux'; import { useMemo } from 'react'; -import { - AppState, - UIState, - Config as ConfigType, -} from '@speedy-tuner/types'; +import { Config as ConfigType } from '@speedy-tuner/types'; import Dialog from '../components/Tune/Dialog'; import SideBar, { DialogMatchedPathType } from '../components/SideBar'; import { Routes } from '../routes'; -import useStorage from '../hooks/useStorage'; +import useBrowserStorage from '../hooks/useBrowserStorage'; import useConfig from '../hooks/useConfig'; +import { + AppState, + NavigationState, +} from '../types/state'; const mapStateToProps = (state: AppState) => ({ - ui: state.ui, + navigation: state.navigation, status: state.status, config: state.config, }); -const Tune = ({ ui, config }: { ui: UIState, config: ConfigType }) => { +const Tune = ({ navigation, config }: { navigation: NavigationState, config: ConfigType }) => { const { pathname } = useLocation(); - const { storageGetSync } = useStorage(); + const { storageGetSync } = useBrowserStorage(); const lastDialogPath = storageGetSync('lastDialog'); const { isConfigReady } = useConfig(config); const dialogMatchedPath: DialogMatchedPathType = useMemo(() => matchPath(pathname, { - path: Routes.DIALOG, + path: Routes.TUNE_DIALOG, exact: true, }) || { url: '', params: { category: '', dialog: '' } }, [pathname]); @@ -41,12 +41,16 @@ const Tune = ({ ui, config }: { ui: UIState, config: ConfigType }) => { const firstCategory = Object.keys(config.menus)[0]; const firstDialog = Object.keys(config.menus[firstCategory].subMenus)[0]; - return generatePath(Routes.DIALOG, { category: firstCategory, dialog: firstDialog }); - }, [config.menus, isConfigReady]); + return generatePath(Routes.TUNE_DIALOG, { + tuneId: navigation.tuneId || 'not-ready', + category: firstCategory, + dialog: firstDialog, + }); + }, [config.menus, isConfigReady, navigation.tuneId]); return ( <> - + {firstDialogPath && } diff --git a/src/pages/Upload.tsx b/src/pages/Upload.tsx index e874007..2d951fa 100644 --- a/src/pages/Upload.tsx +++ b/src/pages/Upload.tsx @@ -29,6 +29,7 @@ import { ShareAltOutlined, FileTextOutlined, } from '@ant-design/icons'; +import * as Sentry from '@sentry/browser'; import { INI } from '@speedy-tuner/ini'; import { UploadRequestOption } from 'rc-upload/lib/interface'; import { UploadFile } from 'antd/lib/upload/interface'; @@ -46,19 +47,17 @@ import { import { useAuth } from '../contexts/AuthContext'; import { Routes } from '../routes'; import { - fireStoreDoc, - setDoc, - getDoc, storage, storageRef, uploadBytesResumable, deleteObject, - db, } from '../firebase'; -import useStorage from '../hooks/useStorage'; +import useBrowserStorage from '../hooks/useBrowserStorage'; import TuneParser from '../utils/tune/TuneParser'; import TriggerLogsParser from '../utils/logs/TriggerLogsParser'; import LogParser from '../utils/logs/LogParser'; +import { TuneDbData } from '../types/dbData'; +import useDb from '../hooks/useDb'; enum MaxFiles { TUNE_FILES = 1, @@ -67,36 +66,6 @@ enum MaxFiles { CUSTOM_INI_FILES = 1, } -interface TuneDataDetails { - readme?: string | null; - make?: string | null; - model?: string | null; - displacement?: string | null; - year?: number | null; - hp?: number | null; - stockHp?: number | null; - engineCode?: string | null; - cylinders?: number | null; - aspiration?: string | null; - fuel?: string | null; - injectors?: string | null; - coils?: string | null; -} - -interface TuneDbData { - userUid?: string; - createdAt?: Date; - updatedAt?: Date; - isPublished?: boolean; - isListed?: boolean; - isPublic?: boolean; - tuneFile?: string | null; - logFiles?: string[]; - toothLogFiles?: string[]; - customIniFile?: string | null; - details?: TuneDataDetails; -} - type Path = string; interface UploadedFile { @@ -150,7 +119,8 @@ const UploadPage = () => { const hasNavigatorShare = navigator.share !== undefined; const { currentUser, refreshToken } = useAuth(); const history = useHistory(); - const { storageSet, storageGet, storageDelete } = useStorage(); + const { storageSet, storageGet, storageDelete } = useBrowserStorage(); + const { updateData, getTune } = useDb(); // details const [readme, setReadme] = useState('# My Tune\n\ndescription'); @@ -179,26 +149,6 @@ const UploadPage = () => { const genericError = (error: Error) => notification.error({ message: 'Error', description: error.message }); - const updateDbData = (tuneId: string, dbData: TuneDbData) => { - try { - return setDoc(fireStoreDoc(db, 'tunes', tuneId), dbData, { merge: true }); - } catch (error) { - console.error(error); - genericError(error as Error); - return Promise.reject(error); - } - }; - - const getDbData = (tuneId: string) => { - try { - return getDoc(fireStoreDoc(db, 'tunes', tuneId)); - } catch (error) { - console.error(error); - genericError(error as Error); - return Promise.reject(error); - } - }; - const removeFile = async (path: string) => { try { return await deleteObject(storageRef(storage, path)); @@ -209,7 +159,7 @@ const UploadPage = () => { const publish = async () => { setIsLoading(true); - await updateDbData(newTuneId!, { + await updateData(newTuneId!, { updatedAt: new Date(), isPublished: true, isPublic, @@ -272,6 +222,7 @@ const UploadPage = () => { }, ); } catch (error) { + Sentry.captureException(error); console.error('Upload error:', error); notification.error({ message: 'Upload error', description: (error as Error).message }); onError!(error as Error); @@ -301,8 +252,8 @@ const UploadPage = () => { }); const uploadTune = async (options: UploadRequestOption) => { - const found = await getDbData(newTuneId!); - if (!found.exists()) { + const found = await getTune(newTuneId!); + if (found) { const tuneData: TuneDbData = { userUid: currentUser!.uid, createdAt: new Date(), @@ -316,15 +267,15 @@ const UploadPage = () => { customIniFile: null, details: {}, }; - await updateDbData(newTuneId!, tuneData); + await updateData(newTuneId!, tuneData); } - setShareUrl(`https://speedytuner.cloud/#/t/${newTuneId}`); + setShareUrl(`${process.env.REACT_APP_WEB_URL}/#/t/${newTuneId}`); const { path } = (options.data as unknown as UploadFileData); const tune: UploadedFile = {}; tune[(options.file as UploadFile).uid] = path; upload(path, options, () => { - updateDbData(newTuneId!, { tuneFile: path }); + updateData(newTuneId!, { tuneFile: path }); }, async (file) => { const { result, message } = await validateSize(file); if (!result) { @@ -353,7 +304,7 @@ const UploadPage = () => { tune[uuid] = path; const newValues = { ...logFiles, ...tune }; upload(path, options, () => { - updateDbData(newTuneId!, { logFiles: Object.values(newValues) }); + updateData(newTuneId!, { logFiles: Object.values(newValues) }); }, async (file) => { const { result, message } = await validateSize(file); if (!result) { @@ -394,7 +345,7 @@ const UploadPage = () => { tune[(options.file as UploadFile).uid] = path; const newValues = { ...toothLogFiles, ...tune }; upload(path, options, () => { - updateDbData(newTuneId!, { toothLogFiles: Object.values(newValues) }); + updateData(newTuneId!, { toothLogFiles: Object.values(newValues) }); }, async (file) => { const { result, message } = await validateSize(file); if (!result) { @@ -420,7 +371,7 @@ const UploadPage = () => { const tune: UploadedFile = {}; tune[(options.file as UploadFile).uid] = path; upload(path, options, () => { - updateDbData(newTuneId!, { customIniFile: path }); + updateData(newTuneId!, { customIniFile: path }); }, async (file) => { const { result, message } = await validateSize(file); if (!result) { @@ -428,6 +379,7 @@ const UploadPage = () => { } // TODO: change to common interface, add some validation method + // Create INI parser const parser = new INI((new TextDecoder()).decode(await file.arrayBuffer())); const valid = parser.parse().megaTune.signature.length > 0; @@ -447,7 +399,7 @@ const UploadPage = () => { removeFile(tuneFile[file.uid]); } setTuneFile(null); - updateDbData(newTuneId!, { tuneFile: null }); + updateData(newTuneId!, { tuneFile: null }); }; const removeLogFile = async (file: UploadFile) => { @@ -458,7 +410,7 @@ const UploadPage = () => { const newValues = { ...logFiles }; delete newValues[uid]; setLogFiles(newValues); - updateDbData(newTuneId!, { logFiles: Object.values(newValues) }); + updateData(newTuneId!, { logFiles: Object.values(newValues) }); }; const removeToothLogFile = async (file: UploadFile) => { @@ -469,7 +421,7 @@ const UploadPage = () => { const newValues = { ...toothLogFiles }; delete newValues[uid]; setToothLogFiles(newValues); - updateDbData(newTuneId!, { toothLogFiles: Object.values(newValues) }); + updateData(newTuneId!, { toothLogFiles: Object.values(newValues) }); }; const removeCustomIniFile = async (file: UploadFile) => { @@ -477,7 +429,7 @@ const UploadPage = () => { removeFile(customIniFile![file.uid]); } setCustomIniFile(null); - updateDbData(newTuneId!, { customIniFile: null }); + updateData(newTuneId!, { customIniFile: null }); }; const prepareData = useCallback(async () => { @@ -498,6 +450,7 @@ const UploadPage = () => { } setIsUserAuthorized(true); } catch (error) { + Sentry.captureException(error); storageDelete(newTuneIdKey); console.error(error); genericError(error as Error); @@ -524,7 +477,7 @@ const UploadPage = () => { const shareSection = ( <> Publish & Share - + {isPublished && { /> )} - + } - + Publish + : } ); diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index 8cac096..283d510 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -39,30 +39,31 @@ const Login = () => { const { login, googleAuth, githubAuth } = useAuth(); const history = useHistory(); const isAnythingLoading = isEmailLoading || isGoogleLoading || isGithubLoading; + const redirectAfterLogin = useCallback(() => history.push(Routes.UPLOAD), [history]); const googleLogin = useCallback(async () => { setIsGoogleLoading(true); try { await googleAuth(); logInSuccessful(); - history.push(Routes.ROOT); + redirectAfterLogin(); } catch (error) { logInFailed(error as Error); setIsGoogleLoading(false); } - }, [googleAuth, history]); + }, [googleAuth, redirectAfterLogin]); const githubLogin = useCallback(async () => { setIsGithubLoading(true); try { await githubAuth(); logInSuccessful(); - history.push(Routes.ROOT); + redirectAfterLogin(); } catch (error) { logInFailed(error as Error); setIsGithubLoading(false); } - }, [githubAuth, history]); + }, [githubAuth, redirectAfterLogin]); const emailLogin = async ({ email, password }: { form: any, email: string, password: string }) => { setIsEmailLoading(true); @@ -74,7 +75,7 @@ const Login = () => { emailNotVerified(); } - history.push(Routes.ROOT); + redirectAfterLogin(); } catch (error) { form.resetFields(); console.warn(error); diff --git a/src/routes.ts b/src/routes.ts index f7c0eb2..476cf65 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -1,11 +1,14 @@ // eslint-disable-next-line import/prefer-default-export export enum Routes { ROOT = '/', - TAB = '/:tab', - TUNE = '/tune', - DIALOG = '/tune/:category/:dialog', - LOG = '/log', - DIAGNOSE = '/diagnose', + + TUNE_ROOT = '/t/:tuneId', + TUNE_TAB = '/t/:tuneId/:tab', + TUNE_TUNE = '/t/:tuneId/tune', + TUNE_DIALOG = '/t/:tuneId/tune/:category/:dialog', + TUNE_LOG = '/t/:tuneId/log', + TUNE_DIAGNOSE = '/t/:tuneId/diagnose', + LOGIN = '/auth/login', LOGOUT = '/auth/logout', SIGN_UP = '/auth/sign-up', diff --git a/src/store.ts b/src/store.ts index b401d4c..e97a648 100644 --- a/src/store.ts +++ b/src/store.ts @@ -5,15 +5,24 @@ import { createAction, createReducer, } from '@reduxjs/toolkit'; -import * as Types from '@speedy-tuner/types'; +import { + AppState, + ConfigState, + LogsState, + TuneState, + UpdateTunePayload, +} from './types/state'; // tune and config -const updateTune = createAction('tune/update'); -const loadTune = createAction('tune/load'); -const loadConfig = createAction('config/load'); +const updateTune = createAction('tune/update'); +const loadTune = createAction('tune/load'); +const loadConfig = createAction('config/load'); + +// navigation +const setTuneId = createAction('navigation/tuneId'); // logs -const loadLogs = createAction('logs/load'); +const loadLogs = createAction('logs/load'); // status bar const setStatus = createAction('status'); @@ -22,7 +31,7 @@ const setStatus = createAction('status'); const setSidebarCollapsed = createAction('ui/sidebarCollapsed'); const toggleSidebar = createAction('ui/toggleSidebar'); -const initialState: Types.AppState = { +const initialState: AppState = { tune: { constants: {}, }, @@ -34,30 +43,36 @@ const initialState: Types.AppState = { status: { text: null, }, + navigation: { + tuneId: null, + }, }; const rootReducer = createReducer(initialState, (builder) => { builder - .addCase(loadConfig, (state: Types.AppState, action) => { + .addCase(loadConfig, (state: AppState, action) => { state.config = action.payload; }) - .addCase(loadTune, (state: Types.AppState, action) => { + .addCase(loadTune, (state: AppState, action) => { state.tune = action.payload; }) - .addCase(loadLogs, (state: Types.AppState, action) => { + .addCase(loadLogs, (state: AppState, action) => { state.logs = action.payload; }) - .addCase(updateTune, (state: Types.AppState, action) => { + .addCase(updateTune, (state: AppState, action) => { state.tune.constants[action.payload.name].value = action.payload.value; }) - .addCase(setSidebarCollapsed, (state: Types.AppState, action) => { + .addCase(setSidebarCollapsed, (state: AppState, action) => { state.ui.sidebarCollapsed = action.payload; }) - .addCase(toggleSidebar, (state: Types.AppState) => { + .addCase(toggleSidebar, (state: AppState) => { state.ui.sidebarCollapsed = !state.ui.sidebarCollapsed; }) - .addCase(setStatus, (state: Types.AppState, action) => { + .addCase(setStatus, (state: AppState, action) => { state.status.text = action.payload; + }) + .addCase(setTuneId, (state: AppState, action) => { + state.navigation.tuneId = action.payload; }); }); diff --git a/src/types/dbData.ts b/src/types/dbData.ts new file mode 100644 index 0000000..40a31b5 --- /dev/null +++ b/src/types/dbData.ts @@ -0,0 +1,29 @@ +export interface TuneDataDetails { + readme?: string | null; + make?: string | null; + model?: string | null; + displacement?: string | null; + year?: number | null; + hp?: number | null; + stockHp?: number | null; + engineCode?: string | null; + cylinders?: number | null; + aspiration?: string | null; + fuel?: string | null; + injectors?: string | null; + coils?: string | null; +} + +export interface TuneDbData { + userUid?: string; + createdAt?: Date; + updatedAt?: Date; + isPublished?: boolean; + isListed?: boolean; + isPublic?: boolean; + tuneFile?: string | null; + logFiles?: string[]; + toothLogFiles?: string[]; + customIniFile?: string | null; + details?: TuneDataDetails; +} diff --git a/src/types/state.ts b/src/types/state.ts new file mode 100644 index 0000000..b96f8eb --- /dev/null +++ b/src/types/state.ts @@ -0,0 +1,37 @@ +import { + Config, + Logs, + Tune, +} from '@speedy-tuner/types'; + +export interface ConfigState extends Config {} + +export interface TuneState extends Tune {} + +export interface LogsState extends Logs {} + +export interface UIState { + sidebarCollapsed: boolean; +} + +export interface StatusState { + text: string | null; +} + +export interface NavigationState { + tuneId: string | null; +} + +export interface AppState { + tune: TuneState; + config: ConfigState; + logs: LogsState, + ui: UIState; + status: StatusState; + navigation: NavigationState; +} + +export interface UpdateTunePayload { + name: string; + value: string | number; +} diff --git a/src/utils/Storage.ts b/src/utils/Storage.ts deleted file mode 100644 index 5c21d30..0000000 --- a/src/utils/Storage.ts +++ /dev/null @@ -1,28 +0,0 @@ -import BrowserStorage from './storage/BrowserStorage'; -import { StorageInterface } from './StorageInterface'; - -class Storage { - private storage: StorageInterface; - - public constructor() { - this.storage = new BrowserStorage(); - } - - public get(key: string) { - return this.storage.get(key); - } - - public getSync(key: string) { - return this.storage.getSync(key); - } - - public set(key: string, value: string) { - return this.storage.set(key, value); - } - - public delete(key: string) { - return this.storage.delete(key); - } -} - -export default Storage; diff --git a/src/utils/StorageInterface.ts b/src/utils/StorageInterface.ts deleted file mode 100644 index 68a448f..0000000 --- a/src/utils/StorageInterface.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface StorageInterface { - get(key: string): Promise; - getSync(key: string): string | null; - set(key: string, value: string): Promise; - delete(key: string): void; - isAvailable(): Promise; -} diff --git a/src/utils/api.ts b/src/utils/api.ts index b409f1d..b541b02 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -1,4 +1,5 @@ -import { Config as ConfigType } from '@speedy-tuner/types'; +import { INI } from '@speedy-tuner/ini'; +import pako from 'pako'; import store from '../store'; import stdDialogs from '../data/standardDialogs'; import help from '../data/help'; @@ -9,22 +10,19 @@ import { } from './http'; import TuneParser from './tune/TuneParser'; -export const loadAll = async () => { +export const loadTune = async (tuneRaw: ArrayBuffer, iniRaw: ArrayBuffer) => { const started = new Date(); - // const version = 202012; - const version = 202103; - const json: ConfigType = await fetch(`./tunes/${version}.json`) - .then((response) => response.json()); - - const tuneRaw = await fetch(`./tunes/${version}.msq`); - const tuneParser = new TuneParser().parse(await tuneRaw.arrayBuffer()); + const tuneParser = new TuneParser() + .parse(pako.inflate(new Uint8Array(tuneRaw))); if (!tuneParser.isValid()) { + // TODO: capture exception console.error('Invalid tune'); } - const config = json; + const buff = pako.inflate(new Uint8Array(iniRaw)); + const config = new INI((new TextDecoder()).decode(buff)).parse(); // override / merge standard dialogs, constants and help config.dialogs = {