├── .github └── workflows │ ├── pullFromShare.yml │ └── pushToShare.yml ├── .gitignore ├── LICENSE ├── Project status ├── profect status 1 │ ├── december-report.pdf │ └── progress-video-december.txt ├── profect status 2 │ ├── january-report.pdf │ └── progress-video-january.txt ├── profect status 3 │ ├── february-report.pdf │ └── progress-video-february.txt ├── profect status 4 │ ├── april-report.pdf │ └── progress-video-april.txt ├── profect status 5 │ ├── may-report.pdf │ └── progress-video-may.txt └── qualifications │ ├── march-report.pdf │ └── progress-video-march.txt ├── README.md ├── historyFile.txt ├── main.py ├── monitoring ├── Architecture.pdf └── project-plan.md ├── newComponent.py ├── requirement.txt └── src ├── dashboard ├── frontend │ ├── .angular │ │ └── cache │ │ │ └── 18.2.9 │ │ │ └── dashboard │ │ │ ├── .tsbuildinfo │ │ │ └── vite │ │ │ └── deps │ │ │ ├── @angular_animations.js │ │ │ ├── @angular_animations.js.map │ │ │ ├── @angular_cdk_platform.js │ │ │ ├── @angular_cdk_platform.js.map │ │ │ ├── @angular_common.js │ │ │ ├── @angular_common.js.map │ │ │ ├── @angular_core.js │ │ │ ├── @angular_core.js.map │ │ │ ├── @angular_forms.js │ │ │ ├── @angular_forms.js.map │ │ │ ├── @angular_material_icon.js │ │ │ ├── @angular_material_icon.js.map │ │ │ ├── @angular_platform-browser.js │ │ │ ├── @angular_platform-browser.js.map │ │ │ ├── @angular_platform-browser_animations_async.js │ │ │ ├── @angular_platform-browser_animations_async.js.map │ │ │ ├── _metadata.json │ │ │ ├── browser-FNJJZADP.js │ │ │ ├── browser-FNJJZADP.js.map │ │ │ ├── chunk-6XISFZPP.js │ │ │ ├── chunk-6XISFZPP.js.map │ │ │ ├── chunk-7GOANPIK.js │ │ │ ├── chunk-7GOANPIK.js.map │ │ │ ├── chunk-DUSABYAR.js │ │ │ ├── chunk-DUSABYAR.js.map │ │ │ ├── chunk-OGW7HQS4.js │ │ │ ├── chunk-OGW7HQS4.js.map │ │ │ ├── chunk-QBTITOSU.js │ │ │ ├── chunk-QBTITOSU.js.map │ │ │ ├── chunk-STG3CASR.js │ │ │ ├── chunk-STG3CASR.js.map │ │ │ ├── chunk-W2XXILQY.js │ │ │ ├── chunk-W2XXILQY.js.map │ │ │ ├── chunk-WNPMEE2K.js │ │ │ ├── chunk-WNPMEE2K.js.map │ │ │ ├── chunk-ZF4KMJ7N.js │ │ │ ├── chunk-ZF4KMJ7N.js.map │ │ │ ├── crypto-js.js │ │ │ ├── crypto-js.js.map │ │ │ ├── ngx-socket-io.js │ │ │ ├── ngx-socket-io.js.map │ │ │ ├── package.json │ │ │ ├── rxjs.js │ │ │ ├── rxjs.js.map │ │ │ ├── rxjs_operators.js │ │ │ └── rxjs_operators.js.map │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.config.ts │ │ │ ├── cluster │ │ │ │ ├── battery-level │ │ │ │ │ ├── battery-level.component.css │ │ │ │ │ ├── battery-level.component.html │ │ │ │ │ ├── battery-level.component.spec.ts │ │ │ │ │ └── battery-level.component.ts │ │ │ │ ├── car │ │ │ │ │ ├── car.component.css │ │ │ │ │ ├── car.component.html │ │ │ │ │ ├── car.component.spec.ts │ │ │ │ │ └── car.component.ts │ │ │ │ ├── cluster.component.css │ │ │ │ ├── cluster.component.html │ │ │ │ ├── cluster.component.spec.ts │ │ │ │ ├── cluster.component.ts │ │ │ │ ├── cluster.service.spec.ts │ │ │ │ ├── cluster.service.ts │ │ │ │ ├── hardware-data │ │ │ │ │ ├── hardware-data.component.css │ │ │ │ │ ├── hardware-data.component.html │ │ │ │ │ ├── hardware-data.component.spec.ts │ │ │ │ │ ├── hardware-data.component.ts │ │ │ │ │ └── indicator │ │ │ │ │ │ ├── indicator.component.css │ │ │ │ │ │ ├── indicator.component.html │ │ │ │ │ │ ├── indicator.component.spec.ts │ │ │ │ │ │ └── indicator.component.ts │ │ │ │ ├── instant-consumption │ │ │ │ │ ├── instant-consumption.component.css │ │ │ │ │ ├── instant-consumption.component.html │ │ │ │ │ ├── instant-consumption.component.spec.ts │ │ │ │ │ └── instant-consumption.component.ts │ │ │ │ ├── kl-switch │ │ │ │ │ ├── kl-switch.component.css │ │ │ │ │ ├── kl-switch.component.html │ │ │ │ │ ├── kl-switch.component.spec.ts │ │ │ │ │ └── kl-switch.component.ts │ │ │ │ ├── live-camera │ │ │ │ │ ├── live-camera.component.css │ │ │ │ │ ├── live-camera.component.html │ │ │ │ │ ├── live-camera.component.spec.ts │ │ │ │ │ └── live-camera.component.ts │ │ │ │ ├── map │ │ │ │ │ ├── map-cursor │ │ │ │ │ │ ├── map-cursor.component.css │ │ │ │ │ │ ├── map-cursor.component.html │ │ │ │ │ │ ├── map-cursor.component.spec.ts │ │ │ │ │ │ └── map-cursor.component.ts │ │ │ │ │ ├── map-semaphore │ │ │ │ │ │ ├── map-semaphore.component.css │ │ │ │ │ │ ├── map-semaphore.component.html │ │ │ │ │ │ ├── map-semaphore.component.spec.ts │ │ │ │ │ │ └── map-semaphore.component.ts │ │ │ │ │ ├── map.component.css │ │ │ │ │ ├── map.component.html │ │ │ │ │ ├── map.component.spec.ts │ │ │ │ │ └── map.component.ts │ │ │ │ ├── record │ │ │ │ │ ├── record.component.css │ │ │ │ │ ├── record.component.html │ │ │ │ │ ├── record.component.spec.ts │ │ │ │ │ └── record.component.ts │ │ │ │ ├── side-marker │ │ │ │ │ ├── side-marker.component.css │ │ │ │ │ ├── side-marker.component.html │ │ │ │ │ ├── side-marker.component.spec.ts │ │ │ │ │ └── side-marker.component.ts │ │ │ │ ├── speedometer │ │ │ │ │ ├── speedometer.component.css │ │ │ │ │ ├── speedometer.component.html │ │ │ │ │ ├── speedometer.component.spec.ts │ │ │ │ │ └── speedometer.component.ts │ │ │ │ ├── state-switch │ │ │ │ │ ├── state-switch.component.css │ │ │ │ │ ├── state-switch.component.html │ │ │ │ │ ├── state-switch.component.spec.ts │ │ │ │ │ └── state-switch.component.ts │ │ │ │ ├── steering │ │ │ │ │ ├── steering.component.css │ │ │ │ │ ├── steering.component.html │ │ │ │ │ ├── steering.component.spec.ts │ │ │ │ │ └── steering.component.ts │ │ │ │ ├── time-speed-steer │ │ │ │ │ ├── time-speed-steer.component.css │ │ │ │ │ ├── time-speed-steer.component.html │ │ │ │ │ ├── time-speed-steer.component.spec.ts │ │ │ │ │ └── time-speed-steer.component.ts │ │ │ │ └── warning-light │ │ │ │ │ ├── warning-light.component.css │ │ │ │ │ ├── warning-light.component.html │ │ │ │ │ ├── warning-light.component.spec.ts │ │ │ │ │ ├── warning-light.component.ts │ │ │ │ │ └── warningLightDictionary.ts │ │ │ ├── table │ │ │ │ ├── table.component.css │ │ │ │ ├── table.component.html │ │ │ │ ├── table.component.spec.ts │ │ │ │ └── table.component.ts │ │ │ └── webSocket │ │ │ │ ├── web-socket.service.spec.ts │ │ │ │ └── web-socket.service.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── Car.svg │ │ │ ├── Track.svg │ │ │ ├── all-colors-light.svg │ │ │ ├── bfmc.png │ │ │ ├── green-light.svg │ │ │ ├── red-light.svg │ │ │ ├── warningLights │ │ │ │ ├── bumpy_road.png │ │ │ │ ├── car_ahead.png │ │ │ │ ├── car_parking.png │ │ │ │ ├── crosswalk.png │ │ │ │ ├── forbidden.png │ │ │ │ ├── highway_entrance.png │ │ │ │ ├── highway_exit.png │ │ │ │ ├── intersection.png │ │ │ │ ├── oneway.png │ │ │ │ ├── parking.png │ │ │ │ ├── ped_on_crosswalk.png │ │ │ │ ├── ped_on_road.png │ │ │ │ ├── priority.png │ │ │ │ ├── road_block.png │ │ │ │ ├── roundabout.png │ │ │ │ ├── speed_limit_15_in.png │ │ │ │ ├── speed_limit_15_out.png │ │ │ │ ├── speed_limit_30_in.png │ │ │ │ ├── speed_limit_30_out.png │ │ │ │ ├── stop.png │ │ │ │ └── traffic_light.png │ │ │ └── yellow-light.svg │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── package-lock.json ├── processDashboard.py └── threads │ └── threadStartFrontend.py ├── data ├── .github │ └── workflows │ │ └── triggerPullData.yml ├── Semaphores │ ├── Semaphores.py │ └── threads │ │ ├── threadSemaphores.py │ │ └── udpListener.py └── TrafficCommunication │ ├── processTrafficCommunication.py │ ├── threads │ ├── tcpClient.py │ ├── threadTrafficCommunicaiton.py │ └── udpListener.py │ └── useful │ ├── keyDealer.py │ ├── periodicTask.py │ ├── publickey_server.pem │ ├── publickey_server_test.pem │ └── sharedMem.py ├── gateway ├── processGateway.py └── threads │ └── threadGateway.py ├── hardware ├── camera │ ├── processCamera.py │ └── threads │ │ └── threadCamera.py └── serialhandler │ ├── historyFile.txt │ ├── processSerialHandler.py │ └── threads │ ├── filehandler.py │ ├── messageconverter.py │ ├── threadRead.py │ └── threadWrite.py ├── templates ├── threadwithstop.py └── workerprocess.py └── utils ├── ipManager └── IpReplacement.py ├── messages ├── allMessages.py ├── messageHandlerSender.py └── messageHandlerSubscriber.py └── table_state.json /.github/workflows/pullFromShare.yml: -------------------------------------------------------------------------------- 1 | name: Pull Data From Shared 2 | 3 | on: 4 | repository_dispatch: 5 | types: [Pull-Data-Changes-Brain] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | pull: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Set up SSH 14 | run: | 15 | mkdir -p ~/.ssh 16 | echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa 17 | chmod 600 ~/.ssh/id_rsa 18 | ssh-keyscan github.com >> ~/.ssh/known_hosts 19 | 20 | - name: Check out code 21 | uses: actions/checkout@v3 22 | with: 23 | fetch-depth: 0 24 | ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | 26 | - name: Set Git identity 27 | run: | 28 | git config --global user.email "rares.lemnariu@ro.bosch.com" 29 | git config --global user.name "BFMC - Rares Lemnariu" 30 | 31 | - name: Add source to the commit. 32 | run: | 33 | git subtree pull --prefix=src/data git@github.com:ECC-BFMC/Shared.git data 34 | git commit --amend -m "Traceback: FromPull" 35 | git push 36 | 37 | -------------------------------------------------------------------------------- /.github/workflows/pushToShare.yml: -------------------------------------------------------------------------------- 1 | name: Push changes to subtree 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | workflow_dispatch: 8 | 9 | jobs: 10 | push: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Set up SSH 15 | run: | 16 | mkdir -p ~/.ssh 17 | echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa 18 | chmod 600 ~/.ssh/id_rsa 19 | ssh-keyscan github.com >> ~/.ssh/known_hosts 20 | 21 | - name: Check out code 22 | uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | 27 | - name: Set Git identity 28 | run: | 29 | git config --global user.email "rares.lemnariu@ro.bosch.com" 30 | git config --global user.name "BFMC - Rares Lemnariu" 31 | 32 | - name: Check commit message 33 | id: commit_message 34 | run: | 35 | commit_message=$(git log -1 --pretty=%B) 36 | echo "Commit message: $commit_message" 37 | if [[ "$commit_message" == *"Traceback: FromPull"* ]]; then 38 | echo "Commit message contains 'Traceback: FromPull'. Exiting." 39 | # exit 0 40 | else 41 | # Add the commands you want to execute if the commit message does not contain "Traceback: FromPull" 42 | echo "Commit message does not contain 'Traceback: FromPull'. Proceeding with the rest of the script." 43 | # Your commands go here 44 | fi 45 | 46 | - name: Fetch changes from remote 47 | run: | 48 | git remote add shared git@github.com:ECC-BFMC/Shared.git 49 | git fetch shared data 50 | git merge -s ours FETCH_HEAD 51 | 52 | - name: Add source to the commit. 53 | run: | 54 | git add src/data 55 | git commit --amend -m "Traceback: project_name=Brain" 56 | 57 | - name: Push merged changes to remote data branch 58 | run: | 59 | git subtree push --prefix=src/data shared data 60 | 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | docs/build/ 2 | .vscode/ 3 | __pycache__ 4 | **/*.pyc 5 | /src/dashboard/frontend/node_modules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Project status/profect status 1/december-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 1/december-report.pdf -------------------------------------------------------------------------------- /Project status/profect status 1/progress-video-december.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 1/progress-video-december.txt -------------------------------------------------------------------------------- /Project status/profect status 2/january-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 2/january-report.pdf -------------------------------------------------------------------------------- /Project status/profect status 2/progress-video-january.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 2/progress-video-january.txt -------------------------------------------------------------------------------- /Project status/profect status 3/february-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 3/february-report.pdf -------------------------------------------------------------------------------- /Project status/profect status 3/progress-video-february.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 3/progress-video-february.txt -------------------------------------------------------------------------------- /Project status/profect status 4/april-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 4/april-report.pdf -------------------------------------------------------------------------------- /Project status/profect status 4/progress-video-april.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 4/progress-video-april.txt -------------------------------------------------------------------------------- /Project status/profect status 5/may-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 5/may-report.pdf -------------------------------------------------------------------------------- /Project status/profect status 5/progress-video-may.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/profect status 5/progress-video-may.txt -------------------------------------------------------------------------------- /Project status/qualifications/march-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/qualifications/march-report.pdf -------------------------------------------------------------------------------- /Project status/qualifications/progress-video-march.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/Project status/qualifications/progress-video-march.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BFMC - Brain Project 2 | 3 | The project contains all the provided code for the RPi, more precisely: 4 | - Firmware for communicating with the Nucleo and control the robot movements (Speed with constant current consumption, speed with constant speed, braking, moving and steering); 5 | - Firmware for gathering data from the sensors (IMU and Camera); 6 | - API's for communicating with the environmental servers at Bosch location; 7 | - Simulated servers for the API's. 8 | 9 | ## The documentation is available in more details here: 10 | [Documentation](https://bosch-future-mobility-challenge-documentation.readthedocs-hosted.com/) 11 | -------------------------------------------------------------------------------- /historyFile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/historyFile.txt -------------------------------------------------------------------------------- /monitoring/Architecture.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/monitoring/Architecture.pdf -------------------------------------------------------------------------------- /monitoring/project-plan.md: -------------------------------------------------------------------------------- 1 | Your plan goes here. >_< -------------------------------------------------------------------------------- /requirement.txt: -------------------------------------------------------------------------------- 1 | python3-flask=2.2.2 2 | python3-flask-socketio=5.3.2 3 | python3-flask-cors=3.0.10 4 | python3-psutil=5.9.4 5 | python3-picamera2=0.3.21 6 | python3-libcamera 7 | python3-eventlet=0.33.1 8 | python3-twisted=22.4.0 9 | python3-cryptography=38.0.4 10 | python3-opencv 11 | python3-serial 12 | xdg-utils 13 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_animations.js: -------------------------------------------------------------------------------- 1 | import { 2 | AUTO_STYLE, 3 | AnimationBuilder, 4 | AnimationFactory, 5 | AnimationGroupPlayer, 6 | AnimationMetadataType, 7 | BrowserAnimationBuilder, 8 | NoopAnimationPlayer, 9 | animate, 10 | animateChild, 11 | animation, 12 | group, 13 | keyframes, 14 | query, 15 | sequence, 16 | stagger, 17 | state, 18 | style, 19 | transition, 20 | trigger, 21 | useAnimation, 22 | ɵPRE_STYLE 23 | } from "./chunk-QBTITOSU.js"; 24 | import "./chunk-DUSABYAR.js"; 25 | import "./chunk-W2XXILQY.js"; 26 | import "./chunk-6XISFZPP.js"; 27 | import "./chunk-WNPMEE2K.js"; 28 | import "./chunk-OGW7HQS4.js"; 29 | import "./chunk-7GOANPIK.js"; 30 | export { 31 | AUTO_STYLE, 32 | AnimationBuilder, 33 | AnimationFactory, 34 | AnimationMetadataType, 35 | NoopAnimationPlayer, 36 | animate, 37 | animateChild, 38 | animation, 39 | group, 40 | keyframes, 41 | query, 42 | sequence, 43 | stagger, 44 | state, 45 | style, 46 | transition, 47 | trigger, 48 | useAnimation, 49 | AnimationGroupPlayer as ɵAnimationGroupPlayer, 50 | BrowserAnimationBuilder as ɵBrowserAnimationBuilder, 51 | ɵPRE_STYLE 52 | }; 53 | //# sourceMappingURL=@angular_animations.js.map 54 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_animations.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_cdk_platform.js: -------------------------------------------------------------------------------- 1 | import { 2 | Platform, 3 | PlatformModule, 4 | RtlScrollAxisType, 5 | _getEventTarget, 6 | _getFocusedElementPierceShadowDom, 7 | _getShadowRoot, 8 | _isTestEnvironment, 9 | _supportsShadowDom, 10 | getRtlScrollAxisType, 11 | getSupportedInputTypes, 12 | normalizePassiveListenerOptions, 13 | supportsPassiveEventListeners, 14 | supportsScrollBehavior 15 | } from "./chunk-ZF4KMJ7N.js"; 16 | import "./chunk-DUSABYAR.js"; 17 | import "./chunk-W2XXILQY.js"; 18 | import "./chunk-6XISFZPP.js"; 19 | import "./chunk-WNPMEE2K.js"; 20 | import "./chunk-OGW7HQS4.js"; 21 | import "./chunk-7GOANPIK.js"; 22 | export { 23 | Platform, 24 | PlatformModule, 25 | RtlScrollAxisType, 26 | _getEventTarget, 27 | _getFocusedElementPierceShadowDom, 28 | _getShadowRoot, 29 | _isTestEnvironment, 30 | _supportsShadowDom, 31 | getRtlScrollAxisType, 32 | getSupportedInputTypes, 33 | normalizePassiveListenerOptions, 34 | supportsPassiveEventListeners, 35 | supportsScrollBehavior 36 | }; 37 | //# sourceMappingURL=@angular_cdk_platform.js.map 38 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_cdk_platform.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_common.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_core.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_platform-browser.js: -------------------------------------------------------------------------------- 1 | import { 2 | BrowserDomAdapter, 3 | BrowserGetTestability, 4 | BrowserModule, 5 | By, 6 | DomEventsPlugin, 7 | DomRendererFactory2, 8 | DomSanitizer, 9 | DomSanitizerImpl, 10 | EVENT_MANAGER_PLUGINS, 11 | EventManager, 12 | EventManagerPlugin, 13 | HAMMER_GESTURE_CONFIG, 14 | HAMMER_LOADER, 15 | HammerGestureConfig, 16 | HammerGesturesPlugin, 17 | HammerModule, 18 | HydrationFeatureKind, 19 | INTERNAL_BROWSER_PLATFORM_PROVIDERS, 20 | KeyEventsPlugin, 21 | Meta, 22 | REMOVE_STYLES_ON_COMPONENT_DESTROY, 23 | SharedStylesHost, 24 | Title, 25 | VERSION, 26 | bootstrapApplication, 27 | createApplication, 28 | disableDebugTools, 29 | enableDebugTools, 30 | initDomAdapter, 31 | platformBrowser, 32 | provideClientHydration, 33 | provideProtractorTestingSupport, 34 | withEventReplay, 35 | withHttpTransferCacheOptions, 36 | withI18nSupport, 37 | withNoHttpTransferCache 38 | } from "./chunk-STG3CASR.js"; 39 | import { 40 | getDOM 41 | } from "./chunk-DUSABYAR.js"; 42 | import "./chunk-W2XXILQY.js"; 43 | import "./chunk-6XISFZPP.js"; 44 | import "./chunk-WNPMEE2K.js"; 45 | import "./chunk-OGW7HQS4.js"; 46 | import "./chunk-7GOANPIK.js"; 47 | export { 48 | BrowserModule, 49 | By, 50 | DomSanitizer, 51 | EVENT_MANAGER_PLUGINS, 52 | EventManager, 53 | EventManagerPlugin, 54 | HAMMER_GESTURE_CONFIG, 55 | HAMMER_LOADER, 56 | HammerGestureConfig, 57 | HammerModule, 58 | HydrationFeatureKind, 59 | Meta, 60 | REMOVE_STYLES_ON_COMPONENT_DESTROY, 61 | Title, 62 | VERSION, 63 | bootstrapApplication, 64 | createApplication, 65 | disableDebugTools, 66 | enableDebugTools, 67 | platformBrowser, 68 | provideClientHydration, 69 | provideProtractorTestingSupport, 70 | withEventReplay, 71 | withHttpTransferCacheOptions, 72 | withI18nSupport, 73 | withNoHttpTransferCache, 74 | BrowserDomAdapter as ɵBrowserDomAdapter, 75 | BrowserGetTestability as ɵBrowserGetTestability, 76 | DomEventsPlugin as ɵDomEventsPlugin, 77 | DomRendererFactory2 as ɵDomRendererFactory2, 78 | DomSanitizerImpl as ɵDomSanitizerImpl, 79 | HammerGesturesPlugin as ɵHammerGesturesPlugin, 80 | INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, 81 | KeyEventsPlugin as ɵKeyEventsPlugin, 82 | SharedStylesHost as ɵSharedStylesHost, 83 | getDOM as ɵgetDOM, 84 | initDomAdapter as ɵinitDomAdapter 85 | }; 86 | //# sourceMappingURL=@angular_platform-browser.js.map 87 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/@angular_platform-browser.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/_metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "c7de817a", 3 | "configHash": "77f32e48", 4 | "lockfileHash": "1ccc7693", 5 | "browserHash": "ddf3cfa5", 6 | "optimized": { 7 | "@angular/animations": { 8 | "src": "../../../../../../node_modules/@angular/animations/fesm2022/animations.mjs", 9 | "file": "@angular_animations.js", 10 | "fileHash": "8129db02", 11 | "needsInterop": false 12 | }, 13 | "@angular/cdk/platform": { 14 | "src": "../../../../../../node_modules/@angular/cdk/fesm2022/platform.mjs", 15 | "file": "@angular_cdk_platform.js", 16 | "fileHash": "0df020c1", 17 | "needsInterop": false 18 | }, 19 | "@angular/common": { 20 | "src": "../../../../../../node_modules/@angular/common/fesm2022/common.mjs", 21 | "file": "@angular_common.js", 22 | "fileHash": "92edb696", 23 | "needsInterop": false 24 | }, 25 | "@angular/core": { 26 | "src": "../../../../../../node_modules/@angular/core/fesm2022/core.mjs", 27 | "file": "@angular_core.js", 28 | "fileHash": "d4f241c5", 29 | "needsInterop": false 30 | }, 31 | "@angular/forms": { 32 | "src": "../../../../../../node_modules/@angular/forms/fesm2022/forms.mjs", 33 | "file": "@angular_forms.js", 34 | "fileHash": "aa310703", 35 | "needsInterop": false 36 | }, 37 | "@angular/material/icon": { 38 | "src": "../../../../../../node_modules/@angular/material/fesm2022/icon.mjs", 39 | "file": "@angular_material_icon.js", 40 | "fileHash": "2e33e3a1", 41 | "needsInterop": false 42 | }, 43 | "@angular/platform-browser": { 44 | "src": "../../../../../../node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs", 45 | "file": "@angular_platform-browser.js", 46 | "fileHash": "26b4224e", 47 | "needsInterop": false 48 | }, 49 | "@angular/platform-browser/animations/async": { 50 | "src": "../../../../../../node_modules/@angular/platform-browser/fesm2022/animations/async.mjs", 51 | "file": "@angular_platform-browser_animations_async.js", 52 | "fileHash": "76a97fd2", 53 | "needsInterop": false 54 | }, 55 | "crypto-js": { 56 | "src": "../../../../../../node_modules/crypto-js/index.js", 57 | "file": "crypto-js.js", 58 | "fileHash": "38f76861", 59 | "needsInterop": true 60 | }, 61 | "ngx-socket-io": { 62 | "src": "../../../../../../node_modules/ngx-socket-io/fesm2022/ngx-socket-io.mjs", 63 | "file": "ngx-socket-io.js", 64 | "fileHash": "296769c1", 65 | "needsInterop": false 66 | }, 67 | "rxjs": { 68 | "src": "../../../../../../node_modules/rxjs/dist/esm5/index.js", 69 | "file": "rxjs.js", 70 | "fileHash": "6ba34296", 71 | "needsInterop": false 72 | }, 73 | "rxjs/operators": { 74 | "src": "../../../../../../node_modules/rxjs/dist/esm5/operators/index.js", 75 | "file": "rxjs_operators.js", 76 | "fileHash": "174b8a3c", 77 | "needsInterop": false 78 | } 79 | }, 80 | "chunks": { 81 | "browser-FNJJZADP": { 82 | "file": "browser-FNJJZADP.js" 83 | }, 84 | "chunk-QBTITOSU": { 85 | "file": "chunk-QBTITOSU.js" 86 | }, 87 | "chunk-ZF4KMJ7N": { 88 | "file": "chunk-ZF4KMJ7N.js" 89 | }, 90 | "chunk-STG3CASR": { 91 | "file": "chunk-STG3CASR.js" 92 | }, 93 | "chunk-DUSABYAR": { 94 | "file": "chunk-DUSABYAR.js" 95 | }, 96 | "chunk-W2XXILQY": { 97 | "file": "chunk-W2XXILQY.js" 98 | }, 99 | "chunk-6XISFZPP": { 100 | "file": "chunk-6XISFZPP.js" 101 | }, 102 | "chunk-WNPMEE2K": { 103 | "file": "chunk-WNPMEE2K.js" 104 | }, 105 | "chunk-OGW7HQS4": { 106 | "file": "chunk-OGW7HQS4.js" 107 | }, 108 | "chunk-7GOANPIK": { 109 | "file": "chunk-7GOANPIK.js" 110 | } 111 | } 112 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/chunk-7GOANPIK.js: -------------------------------------------------------------------------------- 1 | var __defProp = Object.defineProperty; 2 | var __defProps = Object.defineProperties; 3 | var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 4 | var __getOwnPropNames = Object.getOwnPropertyNames; 5 | var __getOwnPropSymbols = Object.getOwnPropertySymbols; 6 | var __hasOwnProp = Object.prototype.hasOwnProperty; 7 | var __propIsEnum = Object.prototype.propertyIsEnumerable; 8 | var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 9 | var __spreadValues = (a, b) => { 10 | for (var prop in b ||= {}) 11 | if (__hasOwnProp.call(b, prop)) 12 | __defNormalProp(a, prop, b[prop]); 13 | if (__getOwnPropSymbols) 14 | for (var prop of __getOwnPropSymbols(b)) { 15 | if (__propIsEnum.call(b, prop)) 16 | __defNormalProp(a, prop, b[prop]); 17 | } 18 | return a; 19 | }; 20 | var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 21 | var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { 22 | get: (a, b) => (typeof require !== "undefined" ? require : a)[b] 23 | }) : x)(function(x) { 24 | if (typeof require !== "undefined") return require.apply(this, arguments); 25 | throw Error('Dynamic require of "' + x + '" is not supported'); 26 | }); 27 | var __objRest = (source, exclude) => { 28 | var target = {}; 29 | for (var prop in source) 30 | if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 31 | target[prop] = source[prop]; 32 | if (source != null && __getOwnPropSymbols) 33 | for (var prop of __getOwnPropSymbols(source)) { 34 | if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 35 | target[prop] = source[prop]; 36 | } 37 | return target; 38 | }; 39 | var __commonJS = (cb, mod) => function __require2() { 40 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 41 | }; 42 | var __export = (target, all) => { 43 | for (var name in all) 44 | __defProp(target, name, { get: all[name], enumerable: true }); 45 | }; 46 | var __async = (__this, __arguments, generator) => { 47 | return new Promise((resolve, reject) => { 48 | var fulfilled = (value) => { 49 | try { 50 | step(generator.next(value)); 51 | } catch (e) { 52 | reject(e); 53 | } 54 | }; 55 | var rejected = (value) => { 56 | try { 57 | step(generator.throw(value)); 58 | } catch (e) { 59 | reject(e); 60 | } 61 | }; 62 | var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); 63 | step((generator = generator.apply(__this, __arguments)).next()); 64 | }); 65 | }; 66 | 67 | export { 68 | __spreadValues, 69 | __spreadProps, 70 | __require, 71 | __objRest, 72 | __commonJS, 73 | __export, 74 | __async 75 | }; 76 | //# sourceMappingURL=chunk-7GOANPIK.js.map 77 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/chunk-7GOANPIK.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/chunk-WNPMEE2K.js: -------------------------------------------------------------------------------- 1 | import { 2 | __read, 3 | __spreadArray, 4 | argsOrArgArray, 5 | filter, 6 | not, 7 | raceWith 8 | } from "./chunk-OGW7HQS4.js"; 9 | 10 | // node_modules/rxjs/dist/esm5/internal/operators/partition.js 11 | function partition(predicate, thisArg) { 12 | return function(source) { 13 | return [filter(predicate, thisArg)(source), filter(not(predicate, thisArg))(source)]; 14 | }; 15 | } 16 | 17 | // node_modules/rxjs/dist/esm5/internal/operators/race.js 18 | function race() { 19 | var args = []; 20 | for (var _i = 0; _i < arguments.length; _i++) { 21 | args[_i] = arguments[_i]; 22 | } 23 | return raceWith.apply(void 0, __spreadArray([], __read(argsOrArgArray(args)))); 24 | } 25 | 26 | export { 27 | partition, 28 | race 29 | }; 30 | //# sourceMappingURL=chunk-WNPMEE2K.js.map 31 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/chunk-WNPMEE2K.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": ["../../../../../../node_modules/rxjs/dist/esm5/internal/operators/partition.js", "../../../../../../node_modules/rxjs/dist/esm5/internal/operators/race.js"], 4 | "sourcesContent": ["import { not } from '../util/not';\nimport { filter } from './filter';\nexport function partition(predicate, thisArg) {\n return function (source) {\n return [filter(predicate, thisArg)(source), filter(not(predicate, thisArg))(source)];\n };\n}\n", "import { __read, __spreadArray } from \"tslib\";\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { raceWith } from './raceWith';\nexport function race() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return raceWith.apply(void 0, __spreadArray([], __read(argsOrArgArray(args))));\n}\n"], 5 | "mappings": ";;;;;;;;;;AAEO,SAAS,UAAU,WAAW,SAAS;AAC5C,SAAO,SAAU,QAAQ;AACvB,WAAO,CAAC,OAAO,WAAW,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,WAAW,OAAO,CAAC,EAAE,MAAM,CAAC;AAAA,EACrF;AACF;;;ACHO,SAAS,OAAO;AACrB,MAAI,OAAO,CAAC;AACZ,WAAS,KAAK,GAAG,KAAK,UAAU,QAAQ,MAAM;AAC5C,SAAK,EAAE,IAAI,UAAU,EAAE;AAAA,EACzB;AACA,SAAO,SAAS,MAAM,QAAQ,cAAc,CAAC,GAAG,OAAO,eAAe,IAAI,CAAC,CAAC,CAAC;AAC/E;", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/rxjs.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/.angular/cache/18.2.9/dashboard/vite/deps/rxjs_operators.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": [], 4 | "sourcesContent": [], 5 | "mappings": "", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/dashboard/frontend/README.md: -------------------------------------------------------------------------------- 1 | # Dashboard 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /src/dashboard/frontend/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "dashboard": { 7 | "projectType": "application", 8 | "schematics": {}, 9 | "root": "", 10 | "sourceRoot": "src", 11 | "prefix": "app", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:application", 15 | "options": { 16 | "outputPath": "dist/dashboard", 17 | "index": "src/index.html", 18 | "browser": "src/main.ts", 19 | "polyfills": [ 20 | "zone.js" 21 | ], 22 | "tsConfig": "tsconfig.app.json", 23 | "assets": [ 24 | "src/favicon.ico", 25 | "src/assets" 26 | ], 27 | "styles": [ 28 | "@angular/material/prebuilt-themes/pink-bluegrey.css", 29 | "src/styles.css" 30 | ], 31 | "scripts": [] 32 | }, 33 | "configurations": { 34 | "production": { 35 | "budgets": [ 36 | { 37 | "type": "initial", 38 | "maximumWarning": "500kb", 39 | "maximumError": "1mb" 40 | }, 41 | { 42 | "type": "anyComponentStyle", 43 | "maximumWarning": "2kb", 44 | "maximumError": "4kb" 45 | } 46 | ], 47 | "outputHashing": "all" 48 | }, 49 | "development": { 50 | "optimization": false, 51 | "extractLicenses": false, 52 | "sourceMap": true 53 | } 54 | }, 55 | "defaultConfiguration": "production" 56 | }, 57 | "serve": { 58 | "builder": "@angular-devkit/build-angular:dev-server", 59 | "configurations": { 60 | "production": { 61 | "buildTarget": "dashboard:build:production" 62 | }, 63 | "development": { 64 | "buildTarget": "dashboard:build:development" 65 | } 66 | }, 67 | "defaultConfiguration": "development" 68 | }, 69 | "extract-i18n": { 70 | "builder": "@angular-devkit/build-angular:extract-i18n", 71 | "options": { 72 | "buildTarget": "dashboard:build" 73 | } 74 | }, 75 | "test": { 76 | "builder": "@angular-devkit/build-angular:karma", 77 | "options": { 78 | "polyfills": [ 79 | "zone.js", 80 | "zone.js/testing" 81 | ], 82 | "tsConfig": "tsconfig.spec.json", 83 | "assets": [ 84 | "src/favicon.ico", 85 | "src/assets" 86 | ], 87 | "styles": [ 88 | "@angular/material/prebuilt-themes/pink-bluegrey.css", 89 | "src/styles.css" 90 | ], 91 | "scripts": [] 92 | } 93 | } 94 | } 95 | } 96 | }, 97 | "cli": { 98 | "analytics": false 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/dashboard/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dashboard", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve -o --host 0.0.0.0", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^18.2.3", 14 | "@angular/cdk": "^17.3.10", 15 | "@angular/common": "^18.2.3", 16 | "@angular/compiler": "^18.2.3", 17 | "@angular/core": "^18.2.3", 18 | "@angular/forms": "^18.2.3", 19 | "@angular/material": "^17.3.10", 20 | "@angular/platform-browser": "^18.2.3", 21 | "@angular/platform-browser-dynamic": "^18.2.3", 22 | "@angular/router": "^18.2.3", 23 | "crypto-js": "^4.2.0", 24 | "ngx-socket-io": "^4.7.0", 25 | "rollup": "^4.22.4", 26 | "rxjs": "~7.8.0", 27 | "tslib": "^2.3.0", 28 | "vite": "^5.4.8", 29 | "zone.js": "~0.14.10" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/build-angular": "^18.2.6", 33 | "@angular/cli": "^18.2.3", 34 | "@angular/compiler-cli": "^18.2.3", 35 | "@types/crypto-js": "^4.2.2", 36 | "@types/jasmine": "~5.1.0", 37 | "jasmine-core": "~5.1.0", 38 | "karma": "~6.4.0", 39 | "karma-chrome-launcher": "~3.2.0", 40 | "karma-coverage": "~2.2.0", 41 | "karma-jasmine": "~5.1.0", 42 | "karma-jasmine-html-reporter": "~2.1.0", 43 | "typescript": "~5.4.2" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .main-container { 30 | width: 100%; 31 | height: 100%; 32 | } 33 | 34 | .cluster-container { 35 | width: var(--cluster-width); 36 | height: calc(var(--cluster-width) / var(--aspect-ratio)); 37 | display: flex; 38 | position: relative; 39 | justify-content: center; 40 | align-items: center; 41 | } 42 | 43 | .cluster { 44 | width: 100%; 45 | height: 100%; 46 | background-color: rgb(45, 54, 58); 47 | } 48 | 49 | .table { 50 | width: 100%; 51 | height: 100%; 52 | } 53 | 54 | .modal { 55 | display: flex; 56 | justify-content: center; 57 | align-items: center; 58 | position: fixed; 59 | top: 0; 60 | left: 0; 61 | height: 100%; 62 | width: 100%; 63 | background-color: rgba(0, 0, 0, 0.5); 64 | } 65 | 66 | .modal-content { 67 | background-color: rgb(45, 54, 58); 68 | padding: 20px; 69 | border-radius: 5px; 70 | width: 300px; 71 | text-align: center; 72 | color: white; 73 | } 74 | 75 | .modal input { 76 | margin-bottom: 10px; 77 | padding: 5px; 78 | width: 100%; 79 | } 80 | 81 | .modal button { 82 | padding: 10px; 83 | width: 100%; 84 | border-radius: 10px; 85 | background-color: #007bff; 86 | color: white; 87 | border: none; 88 | cursor: pointer; 89 | } 90 | 91 | .modal button:hover { 92 | background-color: #0056b3; 93 | } 94 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 37 | 38 | 39 |
40 |
41 | 47 |
48 | 49 | 50 |
51 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have the 'dashboard' title`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('dashboard'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('h1')?.textContent).toContain('Hello, dashboard'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig } from '@angular/core'; 2 | import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; 3 | 4 | export const appConfig: ApplicationConfig = { 5 | providers: [provideAnimationsAsync()] 6 | }; 7 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/battery-level/battery-level.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .battery-level { 30 | width: 100%; 31 | height: 100%; 32 | position: relative; 33 | } 34 | 35 | .battery-level-body { 36 | width: 100%; 37 | height: 100%; 38 | position: relative; 39 | } 40 | 41 | .battery-level-indicator-svg { 42 | display: flex; 43 | position: absolute; 44 | width: 100%; 45 | height: 100%; 46 | } 47 | 48 | #battery-level-needle-group { 49 | mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%); 50 | -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%); 51 | mask-size: 100% 100%; 52 | mask-repeat: no-repeat; 53 | } 54 | 55 | .battery-level-text { 56 | font-size: 25px; 57 | text-anchor: middle; 58 | fill: white; 59 | } 60 | 61 | .battery-level-unit-text { 62 | font-size: 15px; 63 | opacity: 0.5; 64 | text-anchor: middle; 65 | fill: white; 66 | } 67 | 68 | .battery-level-big-lines { 69 | stroke: rgb(188, 188, 188); 70 | stroke-width: 2px; 71 | stroke-opacity: 0.8; 72 | mask-image: linear-gradient(200deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 73 | -webkit-mask-image: linear-gradient(200deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 74 | mask-size: 110% 110%; 75 | mask-repeat: no-repeat; 76 | } 77 | 78 | .battery-level-small-lines { 79 | stroke: rgb(191, 191, 191); 80 | stroke-width: 1px; 81 | stroke-opacity: 0.6; 82 | mask-image: linear-gradient(200deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 83 | -webkit-mask-image: linear-gradient(200deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 84 | mask-size: 110% 110%; 85 | mask-repeat: no-repeat; 86 | } 87 | 88 | #battery-level-path { 89 | stroke: rgb(188, 188, 188); 90 | stroke-width: 8px; 91 | fill: transparent; 92 | stroke-linecap: round; 93 | filter: drop-shadow(-3px 3px 3px rgb(0, 0, 0, 0.5)); 94 | } 95 | 96 | #battery-level-needle { 97 | position: relative; 98 | stroke: red; 99 | stroke-width: 3px; 100 | stroke-linecap: round; 101 | filter: drop-shadow(0px 0px 2px rgb(255, 0, 0, 0.8)); 102 | } 103 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/battery-level/battery-level.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 20 48 | 40 49 | 60 50 | 80 51 | 100 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | % 60 | 61 |
62 |
63 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/battery-level/battery-level.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BatteryLevelComponent } from './battery-level.component'; 4 | 5 | describe('BatteryLevelComponent', () => { 6 | let component: BatteryLevelComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [BatteryLevelComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(BatteryLevelComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/car/car.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .car { 30 | width: 100%; 31 | height: 100%; 32 | } 33 | 34 | .car-body { 35 | display: flex; 36 | position: relative; 37 | justify-content: center; 38 | width: 100%; 39 | height: 100%; 40 | } 41 | 42 | .car-road-svg { 43 | position: absolute; 44 | width: 100%; 45 | height: 100%; 46 | } 47 | 48 | .car-road-lines { 49 | stroke: rgb(191, 191, 191); 50 | stroke-width: 3%; 51 | mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 100%); 52 | -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 20% rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 100%); 53 | mask-size: 100% 100%; 54 | mask-repeat: repeat-x; 55 | filter: drop-shadow(0 0 0.5vw rgb(0, 0, 0, 0.8)); 56 | } 57 | 58 | #car-image-svg { 59 | position: absolute; 60 | top: 15%; 61 | width: 35%; 62 | height: auto; 63 | filter: drop-shadow(0 0.6vw 0.2vw rgb(0, 0, 0, 0.2)); 64 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/car/car.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | 32 | 33 | 34 | 35 | Car 36 |
37 |
38 | 39 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/car/car.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CarComponent } from './car.component'; 4 | 5 | describe('CarComponent', () => { 6 | let component: CarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CarComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CarComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/car/car.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; 30 | 31 | @Component({ 32 | selector: 'app-car', 33 | standalone: true, 34 | imports: [], 35 | templateUrl: './car.component.html', 36 | styleUrl: './car.component.css' 37 | }) 38 | export class CarComponent implements OnChanges { 39 | @Input() position: number = 0; 40 | @Input() leftLaneOn: boolean = false; 41 | @Input() rightLaneOn: boolean = false; 42 | 43 | ngOnChanges(changes: SimpleChanges): void { 44 | if (changes['position'] || changes['leftLaneOn'] || changes['rightLaneOn']) { 45 | this.updateCar(); 46 | } 47 | } 48 | 49 | updateCar(): void { 50 | const car = document.getElementById("car-image-svg") as HTMLElement; 51 | if (car) { 52 | const xTranslation = this.position * 0.70; 53 | car.style.transform = `translateX(${xTranslation}%)`; 54 | 55 | const leftLine = document.getElementById("car-road-line-left") as HTMLElement; 56 | const rightLine = document.getElementById("car-road-line-right") as HTMLElement; 57 | 58 | if (this.rightLaneOn) 59 | if (xTranslation > 55) 60 | rightLine.style.stroke = "red"; 61 | else if (xTranslation > 30) 62 | rightLine.style.stroke = "orange"; 63 | else 64 | rightLine.style.stroke = "green"; 65 | else 66 | rightLine.style.stroke = "white"; 67 | 68 | if (this.leftLaneOn) 69 | if (xTranslation < -55) 70 | leftLine.style.stroke = "red"; 71 | else if (xTranslation < -30) 72 | leftLine.style.stroke = "orange"; 73 | else 74 | leftLine.style.stroke = "green"; 75 | else 76 | leftLine.style.stroke = "white"; 77 | } 78 | } 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/cluster.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 | 32 |
33 |
34 |

{{battery}}

35 |

%

36 |
37 |
38 |

{{speed}}

39 |

cm/s

40 |
41 |
42 | 43 |
44 |
45 | 46 | 47 |
48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
-------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/cluster.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ClusterComponent } from './cluster.component'; 4 | 5 | describe('ClusterComponent', () => { 6 | let component: ClusterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ClusterComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ClusterComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/cluster.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ClusterService } from './cluster.service'; 4 | 5 | describe('ClusterService', () => { 6 | let service: ClusterService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ClusterService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/cluster.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject, combineLatest } from 'rxjs'; 3 | import { map } from 'rxjs/operators'; 4 | import { Platform } from '@angular/cdk/platform'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class ClusterService { 10 | 11 | constructor(private platform: Platform) {} 12 | 13 | private klSubject = new BehaviorSubject(''); 14 | kl$ = this.klSubject.asObservable(); 15 | 16 | private drivingModeSubject = new BehaviorSubject(''); 17 | drivingMode$ = this.drivingModeSubject.asObservable(); 18 | 19 | private isMobileDevice(): boolean { 20 | const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera; 21 | return /android|iPad|iPhone|iPod/i.test(userAgent) && !(window as any).MSStream; 22 | } 23 | 24 | isMobileDriving$ = combineLatest([this.kl$, this.drivingMode$]).pipe( 25 | map(([kl, drivingMode]) => 26 | kl === '30' && drivingMode === 'manual' && this.isMobileDevice() 27 | ) 28 | ); 29 | 30 | updateKL(value: string) { 31 | this.klSubject.next(value); 32 | } 33 | 34 | updateDrivingMode(value: string) { 35 | this.drivingModeSubject.next(value); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/hardware-data.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .hardware-data { 30 | width: 100%; 31 | height: 100%; 32 | display: flex; 33 | gap: 4%; 34 | flex-direction: row; 35 | } 36 | 37 | .hardware-data-raspberry { 38 | display: flex; 39 | flex-direction: column; 40 | width: 70%; 41 | height: 100%; 42 | } 43 | 44 | .hardware-data-nucleo { 45 | display: flex; 46 | flex-direction: column; 47 | width: 23.3%; 48 | height: 100%; 49 | } 50 | 51 | .hardware-data-raspberry-title, .hardware-data-nucleo-title { 52 | width: 100%; 53 | height: 20%; 54 | } 55 | 56 | .hardware-data-raspberry-title-text, .hardware-data-nucleo-title-text { 57 | position: relative; 58 | bottom: 25%; 59 | color: white; 60 | font-size: 0.6vw; 61 | text-align: center; 62 | } 63 | 64 | .hardware-data-raspberry-title-text { 65 | left: 3.7%; 66 | } 67 | 68 | .hardware-data-nucleo-title-text { 69 | left: 12%; 70 | } 71 | 72 | .hardware-data-raspberry-indicators, .hardware-data-nucleo-indicators { 73 | width: 100%; 74 | height: 80%; 75 | } 76 | 77 | .hardware-data-raspberry-indicators, .hardware-data-nucleo-indicators { 78 | display: flex; 79 | flex-direction: row; 80 | gap: 1%; 81 | } 82 | 83 | .cpu-temp, .cpu-usage, .memory-usage { 84 | width: 16.66%; 85 | height: 100%; 86 | } 87 | 88 | .heap-usage, .stack-usage { 89 | width: 50%; 90 | height: 100%; 91 | } 92 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/hardware-data.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 |
32 |

Raspberry PI

33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 45 |
46 |
47 |

Nucleo

48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 |
56 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/hardware-data.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HardwareDataComponent } from './hardware-data.component'; 4 | 5 | describe('HardwareDataComponent', () => { 6 | let component: HardwareDataComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [HardwareDataComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(HardwareDataComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/indicator/indicator.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .indicator { 30 | display: flex; 31 | flex-direction: row; 32 | width: 100%; 33 | height: 100%; 34 | gap: 10%; 35 | } 36 | 37 | .indicator-slider { 38 | width: 30%; 39 | height: 85%; 40 | background-color: rgba(0, 0, 0, 0.363); 41 | } 42 | 43 | .indicator-slider-value { 44 | position: relative; 45 | top: 100%; 46 | transform: rotatex(180deg); 47 | transform-origin: top; 48 | background-color: rgb(81, 180, 81); 49 | } 50 | 51 | .indicator-text { 52 | display: flex; 53 | flex-direction: column; 54 | position: relative; 55 | width: 50%; 56 | height: 100%; 57 | } 58 | 59 | .indicator-text label { 60 | position: absolute; 61 | font-size: 0.6vw; 62 | right: 0%; 63 | transition: opacity 0.2s; 64 | } 65 | 66 | .indicator-text-max-value { 67 | top: 0%; 68 | } 69 | 70 | .indicator-text-min-value { 71 | bottom: 15%; 72 | } 73 | 74 | .indicator-text-indicator { 75 | bottom: 0%; 76 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/indicator/indicator.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | 32 | 33 |
34 | 35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/indicator/indicator.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { IndicatorComponent } from './indicator.component'; 4 | 5 | describe('IndicatorComponent', () => { 6 | let component: IndicatorComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [IndicatorComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(IndicatorComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/hardware-data/indicator/indicator.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; 30 | 31 | @Component({ 32 | selector: 'app-indicator', 33 | standalone: true, 34 | imports: [], 35 | templateUrl: './indicator.component.html', 36 | styleUrl: './indicator.component.css' 37 | }) 38 | export class IndicatorComponent implements OnChanges { 39 | @Input() value: number | undefined; 40 | @Input() minValue: number = 0; 41 | @Input() maxValue: number = 100; 42 | @Input() title: string = ""; 43 | @Input() titleOffset: number = 0; 44 | @Input() symbol: string = ""; 45 | public valuePos: number = 0; 46 | public maxValueOpacity: number = 1; 47 | public minValueOpacity: number = 1; 48 | 49 | ngOnChanges(changes: SimpleChanges): void { 50 | if (changes['value']) { 51 | this.update(); 52 | } 53 | } 54 | 55 | update(): void { 56 | if (this.value) { 57 | const currentValue = this.value * 100 / this.maxValue; 58 | this.valuePos = 80 - (currentValue * 0.85); // * 0.85 because we use only 85% 59 | 60 | if (this.valuePos >= 74) { 61 | this.valuePos = 74; 62 | } 63 | 64 | if (this.valuePos <= 0) { 65 | this.valuePos = 0; 66 | } 67 | 68 | if (this.valuePos <= 16) { 69 | this.maxValueOpacity = 0; 70 | } 71 | else { 72 | this.maxValueOpacity = 1; 73 | } 74 | 75 | if (this.valuePos >= 59) { 76 | this.minValueOpacity = 0; 77 | } 78 | else { 79 | this.minValueOpacity = 1; 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/instant-consumption/instant-consumption.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 | 0 37 | 40000 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | mAh 46 | 47 |
48 |
49 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/instant-consumption/instant-consumption.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InstantConsumptionComponent } from './instant-consumption.component'; 4 | 5 | describe('InstantConsumptionComponent', () => { 6 | let component: InstantConsumptionComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [InstantConsumptionComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(InstantConsumptionComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/kl-switch/kl-switch.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .kl-switch { 30 | width: 100%; 31 | height: 100%; 32 | position: relative; 33 | display: flex; 34 | flex-direction: column; 35 | gap: 5%; 36 | } 37 | 38 | .kl-switch-text { 39 | color: white; 40 | opacity: 0.8; 41 | font-size: 0.6vw; 42 | } 43 | 44 | .kl-switch-body { 45 | width: 100%; 46 | height: 100%; 47 | display: flex; 48 | position: relative; 49 | font-family: Arial, sans-serif; 50 | overflow: hidden; 51 | background-color: rgba(21, 23, 24, 0.3); 52 | border-radius: 0.3vw; 53 | filter: drop-shadow(0 0 0.3vw rgb(0, 0, 0, 0.2)); 54 | } 55 | 56 | .kl-switch-body input[type="radio"] { 57 | display: none; 58 | } 59 | 60 | .kl-switch-body label { 61 | width: 100%; 62 | height: 100%; 63 | display: flex; 64 | position: relative; 65 | user-select: none; 66 | z-index: 1; 67 | justify-content: center; 68 | align-items: center; 69 | font-size: 0.9vw; 70 | text-shadow: 0 0 0.3vw rgba(0, 0, 0, 1); 71 | } 72 | 73 | .kl-switch-body .slide { 74 | position: absolute; 75 | width: 100%; 76 | height: 100%; 77 | top: 0; 78 | left: 0; 79 | background-color: #2b8fd1; 80 | transition: left 0.3s ease-in-out; 81 | z-index: 0; 82 | border-radius: 0.3vw; 83 | filter: drop-shadow(0 0 0.3vw rgb(0, 0, 0, 0.4)); 84 | } 85 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/kl-switch/kl-switch.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 |
32 | 33 | 39 | 40 | 41 | 42 | 47 |
48 |
-------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/kl-switch/kl-switch.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { KlSwitchComponent } from './kl-switch.component'; 4 | 5 | describe('KlSwitchComponent', () => { 6 | let component: KlSwitchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [KlSwitchComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(KlSwitchComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/live-camera/live-camera.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .image-container { 30 | width: 100%; 31 | height: auto; 32 | position: relative; 33 | } 34 | 35 | .scaled-image { 36 | width: 100%; 37 | height: auto; 38 | position: relative; 39 | object-fit: cover; 40 | border: 0.2vw solid rgb(188, 188, 188); 41 | filter: drop-shadow(0 0 0.3vw rgb(0, 0, 0, 0.5)) 42 | } 43 | 44 | .loader { 45 | width: 10.93%; 46 | height: 20%; 47 | position: absolute; 48 | top: 40%; 49 | left: 45%; 50 | 51 | border: 0.2vw solid rgb(188, 188, 188); 52 | border-bottom-color: transparent; 53 | border-radius: 50%; 54 | box-sizing: border-box; 55 | animation: rotation 2s linear infinite; 56 | } 57 | 58 | @keyframes rotation { 59 | 0% { 60 | transform: rotate(0deg); 61 | } 62 | 100% { 63 | transform: rotate(360deg); 64 | } 65 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/live-camera/live-camera.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 | 32 |
33 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/live-camera/live-camera.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LiveCameraComponent } from './live-camera.component'; 4 | 5 | describe('LiveCameraComponent', () => { 6 | let component: LiveCameraComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [LiveCameraComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(LiveCameraComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/live-camera/live-camera.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { CommonModule } from '@angular/common'; 30 | import { Component } from '@angular/core'; 31 | import { Subscription } from 'rxjs'; 32 | import { WebSocketService} from '../../webSocket/web-socket.service' 33 | 34 | @Component({ 35 | selector: 'app-live-camera', 36 | standalone: true, 37 | imports: [CommonModule], 38 | templateUrl: './live-camera.component.html', 39 | styleUrl: './live-camera.component.css' 40 | }) 41 | export class LiveCameraComponent { 42 | public image: string | undefined; 43 | public loading: boolean = true; 44 | private canvasSize: number[] = [512, 270]; 45 | private cameraSubscription: Subscription | undefined; 46 | 47 | constructor( private webSocketService: WebSocketService) { } 48 | 49 | ngOnInit() 50 | { 51 | this.image = this.createBlackImage(); 52 | 53 | this.cameraSubscription = this.webSocketService.receiveCamera().subscribe( 54 | (message) => { 55 | this.image = `data:image/png;base64,${message.value}`; 56 | this.loading = false; 57 | }, 58 | (error) => { 59 | this.image = this.createBlackImage(); 60 | this.loading = true; 61 | console.error('Error receiving disk usage:', error); 62 | } 63 | ); 64 | } 65 | 66 | ngOnDestroy() { 67 | if (this.cameraSubscription) { 68 | this.cameraSubscription.unsubscribe(); 69 | } 70 | this.webSocketService.disconnectSocket(); 71 | } 72 | 73 | createBlackImage(): string { 74 | const canvas = document.createElement('canvas'); 75 | canvas.width = this.canvasSize[0]; 76 | canvas.height = this.canvasSize[1]; 77 | const ctx = canvas.getContext('2d'); 78 | if (ctx) { 79 | ctx.fillStyle = 'black'; 80 | ctx.fillRect(0, 0, canvas.width, canvas.height); 81 | } 82 | return canvas.toDataURL('image/png'); 83 | }; 84 | } 85 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-cursor/map-cursor.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | #map-cursor-arrow { 30 | width: 100%; 31 | height: 100%; 32 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-cursor/map-cursor.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-cursor/map-cursor.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MapCursorComponent } from './map-cursor.component'; 4 | 5 | describe('MapCursorComponent', () => { 6 | let component: MapCursorComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [MapCursorComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(MapCursorComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-cursor/map-cursor.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component, Input, OnChanges, SimpleChanges, Output, EventEmitter } from '@angular/core'; 30 | 31 | @Component({ 32 | selector: 'app-map-cursor', 33 | standalone: true, 34 | imports: [], 35 | templateUrl: './map-cursor.component.html', 36 | styleUrl: './map-cursor.component.css' 37 | }) 38 | export class MapCursorComponent implements OnChanges { 39 | @Input() cursorRotation: number = 0; 40 | @Output() cursorLoaded = new EventEmitter(); 41 | 42 | ngOnInit(): void { 43 | this.cursorLoaded.emit(); 44 | } 45 | 46 | ngOnChanges(changes: SimpleChanges): void { 47 | if (changes['cursorRotation']) { 48 | this.updateRotation(); 49 | } 50 | } 51 | 52 | updateRotation(): void { 53 | const cursor = document.getElementById("map-cursor-arrow") as HTMLElement; 54 | if (cursor) { 55 | cursor.style.transform = `rotate(${this.cursorRotation}deg)`; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-semaphore/map-semaphore.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .semaphore { 30 | width: 100%; 31 | height: 100%; 32 | } -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-semaphore/map-semaphore.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-semaphore/map-semaphore.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MapSemaphoreComponent } from './map-semaphore.component'; 4 | 5 | describe('MapSemaphoreComponent', () => { 6 | let component: MapSemaphoreComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [MapSemaphoreComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(MapSemaphoreComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map-semaphore/map-semaphore.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component, Input, OnChanges, SimpleChanges, Output, EventEmitter } from '@angular/core'; 30 | 31 | @Component({ 32 | selector: 'app-map-semaphore', 33 | standalone: true, 34 | imports: [], 35 | templateUrl: './map-semaphore.component.html', 36 | styleUrl: './map-semaphore.component.css' 37 | }) 38 | export class MapSemaphoreComponent implements OnChanges { 39 | @Input() state: string = ''; 40 | @Output() semaphoreLoaded = new EventEmitter(); 41 | 42 | public imagePath = "/assets/all-colors-light.svg" 43 | 44 | ngOnInit(): void { 45 | this.semaphoreLoaded.emit(); 46 | } 47 | 48 | ngOnChanges(changes: SimpleChanges): void { 49 | if (changes['state']) { 50 | this.updateState(); 51 | } 52 | } 53 | 54 | updateState(): void { 55 | if (this.state == "green") { 56 | this.imagePath = "/assets/green-light.svg"; 57 | } 58 | else if (this.state == "yellow") { 59 | this.imagePath = "/assets/yellow-light.svg"; 60 | } 61 | else if (this.state == "red") { 62 | this.imagePath = "/assets/red-light.svg"; 63 | } 64 | else { 65 | this.imagePath = "/assets/all-colors-light.svg"; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .map-container { 30 | display: flex; 31 | position: relative; 32 | justify-content: center; 33 | align-items: center; 34 | width: 100%; 35 | height: 100%; 36 | } 37 | 38 | .map-track-container { 39 | display: flex; 40 | position: relative; 41 | justify-content: center; 42 | align-items: center; 43 | width: 100%; 44 | height: 100%; 45 | overflow: hidden; 46 | mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 90%); 47 | -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 90%); 48 | mask-size: 100% 100%; 49 | mask-repeat: no-repeat; 50 | mask-position: center; 51 | -webkit-mask-size: 100% 100%; 52 | -webkit-mask-repeat: no-repeat; 53 | -webkit-mask-position: center; 54 | } 55 | 56 | #map-track-image-container { 57 | display: flex; 58 | position: relative; 59 | } 60 | 61 | #map-track-image { 62 | position: absolute; 63 | } 64 | 65 | #map-cursor { 66 | position: absolute; 67 | filter: drop-shadow(0 0 0.5vw rgba(0, 0, 0, 0.5)); 68 | } 69 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 |
32 | BFMC Track 33 |
34 | 35 |
36 | 37 |
38 |
39 | 40 |
41 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/map/map.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MapComponent } from './map.component'; 4 | 5 | describe('MapComponent', () => { 6 | let component: MapComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [MapComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(MapComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/record/record.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .record-container { 30 | width: 100%; 31 | height: 100%; 32 | } 33 | 34 | .record-button { 35 | width: 100%; 36 | height: 100%; 37 | background-color: #d9534f; 38 | z-index: 10; 39 | border-radius: 0.3vw; 40 | color: white; 41 | font-size: 0.9vw; 42 | text-shadow: 0 0 0.3vw rgba(0, 0, 0, 1); 43 | filter: drop-shadow(0 0 0.3vw rgb(0, 0, 0, 0.3)); 44 | user-select: none; 45 | text-align: center; 46 | text-decoration: none; 47 | -webkit-user-select: none; 48 | border: none; 49 | } 50 | 51 | .record-button:hover { 52 | opacity: 85%; 53 | } 54 | 55 | .record-button:active { 56 | opacity: 70%; 57 | } 58 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/record/record.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 33 |
-------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/record/record.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RecordComponent } from './record.component'; 4 | 5 | describe('RecordComponent', () => { 6 | let component: RecordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [RecordComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(RecordComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/record/record.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { WebSocketService } from './../../webSocket/web-socket.service'; 30 | import { Component } from '@angular/core'; 31 | import { CommonModule } from '@angular/common' 32 | 33 | @Component({ 34 | selector: 'app-record', 35 | standalone: true, 36 | imports: [CommonModule], 37 | templateUrl: './record.component.html', 38 | styleUrl: './record.component.css' 39 | }) 40 | export class RecordComponent { 41 | recording: boolean = false; 42 | text: string = "start record" 43 | 44 | constructor( private webSocketService: WebSocketService) { } 45 | 46 | changeState() { 47 | if (this.recording == false) { 48 | this.recording = true; 49 | this.text = "stop record" 50 | } 51 | else { 52 | this.recording = false; 53 | this.text = "start record" 54 | } 55 | 56 | this.webSocketService.sendMessageToFlask(`{"Name": "Record", "Value": "${this.recording}"}`); 57 | } 58 | 59 | getButtonColor() { 60 | if (this.recording === true) { 61 | return "#5cb85c"; 62 | } 63 | 64 | return "#d9534f"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/side-marker/side-marker.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .side-marker-body { 30 | width: 100%; 31 | height: 100%; 32 | position: absolute; 33 | } 34 | 35 | .side-marker-right, .side-marker-right-background, .side-marker-left, .side-marker-left-background { 36 | width: 10%; 37 | height: auto; 38 | } 39 | 40 | .side-marker-left, .side-marker-left-background { 41 | position: absolute; 42 | left: 0%; 43 | } 44 | 45 | .side-marker-right, .side-marker-right-background { 46 | position: absolute; 47 | left: 90%; 48 | } 49 | 50 | .side-marker-left, .side-marker-right { 51 | animation: pulse 1.5s infinite ease-in-out; 52 | } 53 | 54 | .side-marker-left-background, .side-marker-right-background { 55 | opacity: 0.3; 56 | } 57 | 58 | @keyframes pulse { 59 | 0% { 60 | opacity: 0; 61 | } 62 | 50% { 63 | opacity: 1; 64 | } 65 | 100% { 66 | opacity: 0; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/side-marker/side-marker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SideMarkerComponent } from './side-marker.component'; 4 | 5 | describe('SideMarkerComponent', () => { 6 | let component: SideMarkerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [SideMarkerComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SideMarkerComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/side-marker/side-marker.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component } from '@angular/core'; 30 | import { CommonModule } from '@angular/common'; 31 | import { Subscription } from 'rxjs'; 32 | import { WebSocketService} from '../../webSocket/web-socket.service' 33 | 34 | 35 | @Component({ 36 | selector: 'app-side-marker', 37 | standalone: true, 38 | imports: [CommonModule], 39 | templateUrl: './side-marker.component.html', 40 | styleUrl: './side-marker.component.css' 41 | }) 42 | export class SideMarkerComponent { 43 | public enableLeft: boolean = false; 44 | public enableRight: boolean = false; 45 | private steerSubscription: Subscription | undefined; 46 | 47 | constructor( private webSocketService: WebSocketService) { } 48 | 49 | ngOnInit() 50 | { 51 | // Listen for steer 52 | this.steerSubscription = this.webSocketService.receiveCurrentSteer().subscribe( 53 | (message) => { 54 | const angle = message.value / 10; 55 | 56 | if (angle > 15) { 57 | this.enableLeft = false; 58 | this.enableRight = true; 59 | } 60 | else if (angle < -15) { 61 | this.enableLeft = true; 62 | this.enableRight = false; 63 | } 64 | else { 65 | this.enableLeft = false; 66 | this.enableRight = false; 67 | } 68 | }, 69 | (error) => { 70 | console.error('Error receiving disk usage:', error); 71 | } 72 | ); 73 | } 74 | 75 | ngOnDestroy() { 76 | if (this.steerSubscription) { 77 | this.steerSubscription.unsubscribe(); 78 | } 79 | this.webSocketService.disconnectSocket(); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/speedometer/speedometer.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .speedometer { 30 | width: 100%; 31 | height: 100%; 32 | position: relative; 33 | } 34 | 35 | .speedometer-body { 36 | width: 100%; 37 | height: 100%; 38 | position: relative; 39 | } 40 | 41 | .speedometer-indicator-svg { 42 | display: flex; 43 | position: absolute; 44 | width: 100%; 45 | height: 100%; 46 | } 47 | 48 | #speedometer-needle-group { 49 | mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%); 50 | -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%); 51 | mask-size: 100% 100%; 52 | mask-repeat: no-repeat; 53 | } 54 | 55 | .speedometer-text { 56 | font-size: 25px; 57 | text-anchor: middle; 58 | fill: white; 59 | } 60 | 61 | .speedometer-unit-text { 62 | font-size: 15px; 63 | opacity: 0.5; 64 | text-anchor: middle; 65 | fill: white; 66 | } 67 | 68 | .speedometer-big-lines { 69 | stroke: rgb(188, 188, 188); 70 | stroke-width: 2px; 71 | stroke-opacity: 0.9; 72 | mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 73 | -webkit-mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 74 | mask-size: 110% 110%; 75 | mask-repeat: no-repeat; 76 | } 77 | 78 | .speedometer-small-lines { 79 | stroke: rgb(191, 191, 191); 80 | stroke-width: 1px; 81 | stroke-opacity: 0.6; 82 | mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 83 | -webkit-mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 40%); 84 | mask-size: 110% 110%; 85 | mask-repeat: no-repeat; 86 | } 87 | 88 | #speedometer-path { 89 | stroke: rgb(188, 188, 188); 90 | stroke-width: 8px; 91 | fill: transparent; 92 | stroke-linecap: round; 93 | filter: drop-shadow(3px 3px 3px rgb(0, 0, 0, 0.5)); 94 | } 95 | 96 | #speedometer-needle { 97 | position: relative; 98 | stroke: red; 99 | stroke-width: 3px; 100 | stroke-linecap: round; 101 | filter: drop-shadow(0px 0px 2px rgb(255, 0, 0, 0.8)); 102 | } 103 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/speedometer/speedometer.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 0 48 | 10 49 | 20 50 | 30 51 | 40 52 | 50 53 | 60 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | cm/s 62 | 63 |
64 |
65 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/speedometer/speedometer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SpeedometerComponent } from './speedometer.component'; 4 | 5 | describe('SpeedometerComponent', () => { 6 | let component: SpeedometerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [SpeedometerComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SpeedometerComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 |
32 | 33 | 39 | 40 | 41 | 42 | 47 |
48 | 49 |
50 | 53 | 56 | 59 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StateSwitchComponent } from './state-switch.component'; 4 | 5 | describe('StateSwitchComponent', () => { 6 | let component: StateSwitchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [StateSwitchComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(StateSwitchComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/steering/steering.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .steering-container { 30 | width: 100%; 31 | height: 100%; 32 | position: relative; 33 | } 34 | 35 | #steering-slider { 36 | position: absolute; 37 | width: 100%; 38 | height: 100%; 39 | -webkit-appearance: none; 40 | appearance: none; 41 | background: transparent; 42 | } 43 | 44 | #steering-slider::-webkit-slider-runnable-track { 45 | background: rgb(188, 188, 188); 46 | border-radius: 0.25vw; 47 | box-shadow: 0 0 1vw #00000057; 48 | height: 50%; 49 | } 50 | 51 | #steering-slider::-moz-range-track { 52 | background: rgb(188, 188, 188); 53 | height: 70%; 54 | } 55 | 56 | #steering-slider::-webkit-slider-thumb { 57 | -webkit-appearance: none; 58 | appearance: none; 59 | width: 10%; 60 | height: 100%; 61 | border-radius: 0.25vw; 62 | background-color: red; 63 | } 64 | 65 | #steering-slider::-moz-range-thumb { 66 | width: 10%; 67 | height: 100%; 68 | border-radius: 0.25vw; 69 | background-color: red; 70 | } 71 | 72 | .steering-container label { 73 | position: absolute; 74 | top: 100%; 75 | left: 0; 76 | width: 100%; 77 | height: 100%; 78 | display: flex; 79 | justify-content: center; 80 | align-items: center; 81 | font-size: 1vw; 82 | color: white; 83 | opacity: 0.7; 84 | filter: drop-shadow(0 0 1.7vw rgba(0, 0, 0, 0.7)); 85 | } 86 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/steering/steering.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 | 32 |
-------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/steering/steering.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SteeringComponent } from './steering.component'; 4 | 5 | describe('SteeringComponent', () => { 6 | let component: SteeringComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [SteeringComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SteeringComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/steering/steering.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component } from '@angular/core'; 30 | import { Subscription } from 'rxjs'; 31 | import { WebSocketService} from '../../webSocket/web-socket.service' 32 | 33 | 34 | @Component({ 35 | selector: 'app-steering', 36 | standalone: true, 37 | imports: [], 38 | templateUrl: './steering.component.html', 39 | styleUrl: './steering.component.css' 40 | }) 41 | export class SteeringComponent { 42 | public angle: number = 0; 43 | private steerSubscription: Subscription | undefined; 44 | 45 | constructor( private webSocketService: WebSocketService) { } 46 | 47 | ngOnInit() 48 | { 49 | // Listen for camera 50 | this.steerSubscription = this.webSocketService.receiveCurrentSteer().subscribe( 51 | (message) => { 52 | this.angle = message.value/10; 53 | }, 54 | (error) => { 55 | console.error('Error receiving disk usage:', error); 56 | } 57 | ); 58 | } 59 | 60 | ngOnDestroy() { 61 | if (this.steerSubscription) { 62 | this.steerSubscription.unsubscribe(); 63 | } 64 | this.webSocketService.disconnectSocket(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/time-speed-steer/time-speed-steer.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .input-section { 30 | display: flex; 31 | width: 100%; 32 | height: 100%; 33 | flex-direction: column; 34 | align-items: flex-start; 35 | } 36 | 37 | .input-section label { 38 | font-size: 0.6vw; 39 | color: white; 40 | opacity: 0.8; 41 | padding-bottom: 1%; 42 | } 43 | 44 | .input-section input { 45 | width: 100%; 46 | height: 12%; 47 | margin-bottom: 4%; 48 | padding-left: 5%; 49 | border-radius: 0.3vw; 50 | font-size: 0.7vw; 51 | background-color: rgba(21, 23, 24, 0.3); 52 | color: white; 53 | text-shadow: 0 0 0.3vw rgba(0, 0, 0, 1); 54 | border: none; 55 | outline: none; 56 | } 57 | 58 | .input-section input[type="number"]::-webkit-outer-spin-button, 59 | .input-section input[type="number"]::-webkit-inner-spin-button { 60 | -webkit-appearance: none; 61 | margin: 0; 62 | } 63 | 64 | .input-section input[type="number"] { 65 | -moz-appearance: textfield; 66 | } 67 | 68 | .input-section button { 69 | width: 50%; 70 | height: 20%; 71 | font-size: 0.7vw; 72 | background-color: #2b8fd1; 73 | color: white; 74 | border-radius: 0.3vw; 75 | margin: auto; 76 | user-select: none; 77 | text-align: center; 78 | text-decoration: none; 79 | -webkit-user-select: none; 80 | border: none; 81 | filter: drop-shadow(0 0 0.3vw rgb(0, 0, 0, 0.3)); 82 | } 83 | 84 | .input-section button:hover { 85 | opacity: 90%; 86 | } 87 | 88 | .input-section button:active { 89 | opacity: 70%; 90 | } 91 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/time-speed-steer/time-speed-steer.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
-------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/time-speed-steer/time-speed-steer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TimeSpeedSteerComponent } from './time-speed-steer.component'; 4 | 5 | describe('TimeSpeedSteerComponent', () => { 6 | let component: TimeSpeedSteerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TimeSpeedSteerComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TimeSpeedSteerComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/time-speed-steer/time-speed-steer.component.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | import { Component } from '@angular/core'; 30 | import { WebSocketService } from './../../webSocket/web-socket.service'; 31 | import { FormsModule } from '@angular/forms'; 32 | 33 | @Component({ 34 | selector: 'app-time-speed-steer', 35 | standalone: true, 36 | imports: [FormsModule], 37 | templateUrl: './time-speed-steer.component.html', 38 | styleUrl: './time-speed-steer.component.css' 39 | }) 40 | export class TimeSpeedSteerComponent { 41 | time: number = 0; 42 | speed: number = 0; 43 | steer: number = 0; 44 | 45 | constructor( private webSocketService: WebSocketService) { } 46 | 47 | activateFunction() { 48 | this.webSocketService.sendMessageToFlask(`{"Name": "Control", "Value": {"Time":"${this.time*10}","Speed":"${this.speed*10}","Steer":"${this.steer*10}"}}`) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/warning-light/warning-light.component.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 28 | 29 | .warning-light-container { 30 | width: 100%; 31 | height: 100%; 32 | display: grid; 33 | grid-template-columns: repeat(6, 1fr); 34 | grid-gap: 5%; 35 | } 36 | 37 | .warning-light-items { 38 | width: 100%; 39 | height: 100%; 40 | display: flex; 41 | justify-content: center; 42 | align-items: center; 43 | } 44 | 45 | .warning-light-image { 46 | width: 100%; 47 | height: auto; 48 | filter: drop-shadow(0 0 0.05vw rgba(255, 255, 255)); 49 | } 50 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/warning-light/warning-light.component.html: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 |
31 | Warning Light 36 |
37 |
38 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/warning-light/warning-light.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WarningLightComponent } from './warning-light.component'; 4 | 5 | describe('WarningLightComponent', () => { 6 | let component: WarningLightComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [WarningLightComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(WarningLightComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/cluster/warning-light/warningLightDictionary.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | // All rights reserved. 3 | 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | 7 | // 1. Redistributions of source code must retain the above copyright notice, this 8 | // list of conditions and the following disclaimer. 9 | 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | type warningLightDictionaryModel = { [key: string]: string }; 30 | export const warningLightDictionary: warningLightDictionaryModel = { 31 | "1": "bumpy_road", 32 | "2": "car_ahead", 33 | "3": "car_parking", 34 | "4": "crosswalk", 35 | "5": "forbidden", 36 | "6": "highway_entrance", 37 | "7": "highway_exit", 38 | "8": "intersection", 39 | "9": "oneway", 40 | "10": "parking", 41 | "11": "ped_on_crosswalk", 42 | "12": "ped_on_road", 43 | "13": "priority", 44 | "14": "road_block", 45 | "15": "roundabout", 46 | "16": "speed_limit_15_in", 47 | "17": "speed_limit_15_out", 48 | "18": "speed_limit_30_in", 49 | "19": "speed_limit_30_out", 50 | "20": "stop", 51 | "21": "traffic_light", 52 | }; 53 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/table/table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TableComponent } from './table.component'; 4 | 5 | describe('TableComponent', () => { 6 | let component: TableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TableComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TableComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/app/webSocket/web-socket.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { WebSocketService } from './web-socket.service'; 4 | 5 | describe('WebSocketService', () => { 6 | let service: WebSocketService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(WebSocketService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/Car.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/bfmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/bfmc.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/green-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/bumpy_road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/bumpy_road.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/car_ahead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/car_ahead.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/car_parking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/car_parking.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/crosswalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/crosswalk.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/forbidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/forbidden.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/highway_entrance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/highway_entrance.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/highway_exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/highway_exit.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/intersection.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/oneway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/oneway.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/parking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/parking.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/ped_on_crosswalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/ped_on_crosswalk.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/ped_on_road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/ped_on_road.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/priority.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/priority.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/road_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/road_block.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/roundabout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/roundabout.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/speed_limit_15_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/speed_limit_15_in.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/speed_limit_15_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/speed_limit_15_out.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/speed_limit_30_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/speed_limit_30_in.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/speed_limit_30_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/speed_limit_30_out.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/stop.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/assets/warningLights/traffic_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/assets/warningLights/traffic_light.png -------------------------------------------------------------------------------- /src/dashboard/frontend/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/dashboard/frontend/src/favicon.ico -------------------------------------------------------------------------------- /src/dashboard/frontend/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dashboard 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /src/dashboard/frontend/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | :root { 4 | --aspect-ratio: 1.777777777777778; 5 | --cluster-width: 80vw; 6 | } 7 | 8 | * { 9 | box-sizing: border-box; 10 | } 11 | 12 | html, body { 13 | height: 100%; 14 | } 15 | 16 | body { 17 | font-family: "poppins", sans-serif; 18 | /* background: radial-gradient(circle at bottom, #151618, #222831); */ 19 | background: #222831; 20 | color: #f0e5fe; 21 | margin: 0; 22 | padding: 0; 23 | display: flex; 24 | justify-content: center; 25 | align-items: center; 26 | } 27 | 28 | .app-root { 29 | width: auto; 30 | height: 100%; 31 | } 32 | 33 | /* 34 | html, body { height: 100%; } 35 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } */ 36 | -------------------------------------------------------------------------------- /src/dashboard/frontend/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/dashboard/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "strict": true, 6 | "noImplicitOverride": true, 7 | "noPropertyAccessFromIndexSignature": true, 8 | "noImplicitReturns": true, 9 | "noFallthroughCasesInSwitch": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "sourceMap": true, 13 | "declaration": false, 14 | "experimentalDecorators": true, 15 | "moduleResolution": "node", 16 | "importHelpers": true, 17 | "target": "ES2022", 18 | "module": "ES2022", 19 | "useDefineForClassFields": false, 20 | "lib": [ 21 | "ES2022", 22 | "dom" 23 | ] 24 | }, 25 | "angularCompilerOptions": { 26 | "enableI18nLegacyMessageIdFormat": false, 27 | "strictInjectionParameters": true, 28 | "strictInputAccessModifiers": true, 29 | "strictTemplates": true 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/dashboard/frontend/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/dashboard/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dashboard", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": {} 6 | } 7 | -------------------------------------------------------------------------------- /src/dashboard/threads/threadStartFrontend.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC orginazers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | if __name__ == "__main__": 30 | import sys 31 | sys.path.insert(0, "../../..") 32 | 33 | import subprocess 34 | import os 35 | from src.templates.threadwithstop import ThreadWithStop 36 | 37 | class ThreadStartFrontend(ThreadWithStop): 38 | 39 | # ================================ INIT =============================================== 40 | 41 | def __init__(self, logger, project_path=os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "frontend")): 42 | """Thread for managing an Angular development server. 43 | 44 | Args: 45 | project_path (str): The file path to the Angular project directory. 46 | """ 47 | 48 | self.project_path = project_path 49 | self.logger= logger 50 | super().__init__() 51 | 52 | # ================================= RUN =============================================== 53 | 54 | def run(self): 55 | """Overrides the Thread.run. Starts the Angular server and monitors the _running flag.""" 56 | 57 | try: 58 | subprocess.run(f"cd {self.project_path} && npm start", shell=True, check=True) 59 | self.logger.info("Angular server started successfully.") 60 | except subprocess.CalledProcessError as e: 61 | self.logger.warning(f"Failed to start the Angular development server: {e}") 62 | 63 | # ================================ STOP =============================================== 64 | 65 | def stop(self): 66 | """Stops the Angular development server if running.""" 67 | 68 | self.logger.warning("Angular server stopped.") 69 | 70 | # ================================= EXAMPLE =============================================== 71 | 72 | if __name__ == "__main__": 73 | # Replace '../frontend/' with the actual path to your Angular project 74 | angular_thread = ThreadStartFrontend("../frontend/") 75 | angular_thread.start() 76 | input("Press Enter to stop the server...") 77 | angular_thread.stop() 78 | angular_thread.join() 79 | -------------------------------------------------------------------------------- /src/data/.github/workflows/triggerPullData.yml: -------------------------------------------------------------------------------- 1 | name: Propagate changes to data projects 2 | 3 | on: 4 | push: 5 | 6 | jobs: 7 | identify-and-print: 8 | runs-on: ubuntu-latest 9 | outputs: 10 | project_origin: ${{ steps.check-project-name.outputs.project_origin }} 11 | 12 | 13 | steps: 14 | - name: Check for project_name in push payload 15 | id: check-project-name 16 | run: | 17 | if [[ "${{ github.event.head_commit.message }}" == *"project_name="* ]]; then 18 | project_name=$(echo "${{ github.event.head_commit.message }}" | sed -n 's/.*project_name=\([^ ]*\).*/\1/p') 19 | echo "Project Name from commit message: $project_name" 20 | echo "project_origin=$project_name" >> $GITHUB_OUTPUT 21 | else 22 | echo "No project_name found in commit message." 23 | echo "project_origin=None" >> $GITHUB_OUTPUT 24 | fi 25 | 26 | dispatch: 27 | needs: identify-and-print 28 | runs-on: ubuntu-latest 29 | if: success() 30 | env: 31 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | steps: 33 | - name: Use project_origin output 34 | run: | 35 | project_origin="${{ needs.identify-and-print.outputs.project_origin }}" 36 | 37 | 38 | repositories=(Brain CompetitionPCing) 39 | 40 | # Remove the project_origin from the repositories array 41 | for i in "${!repositories[@]}"; do 42 | if [[ "${repositories[$i]}" == "$project_origin" ]]; then 43 | unset 'repositories[i]' 44 | fi 45 | done 46 | 47 | echo "Repos to update: ${repositories[@]}" 48 | 49 | # Uncomment the following block to perform the actual dispatch 50 | #test 51 | for repo in "${repositories[@]}"; do 52 | project_origin_name="ECC-BFMC/$repo" 53 | echo "Prepared to dispatch event to repository: $project_origin_name" 54 | dispatch_name="Pull-Data-Changes-$repo" 55 | echo "Event type: $dispatch_name" 56 | 57 | gh api repos/"$project_origin_name"/dispatches \ 58 | -f event_type=$dispatch_name \ 59 | -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" 60 | done 61 | -------------------------------------------------------------------------------- /src/data/Semaphores/threads/threadSemaphores.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | 29 | from src.templates.threadwithstop import ThreadWithStop 30 | from twisted.internet import reactor 31 | from src.data.Semaphores.threads.udpListener import udpListener 32 | 33 | 34 | class threadSemaphores(ThreadWithStop): 35 | """Thread which will handle processCarsAndSemaphores functionalities 36 | 37 | Args: 38 | queueList (dictionary of multiprocessing.queues.Queue): Dictionary of queues where the ID is the type of messages. 39 | listenPort (int, optional): Listening port. Defaults to 5007. 40 | """ 41 | 42 | # ====================================== INIT ========================================== 43 | def __init__(self, queueList, logger, debugging, listenPort=5007): 44 | super(threadSemaphores, self).__init__() 45 | self.listenPort = listenPort 46 | self.queueList = queueList 47 | self.logger = logger 48 | self.debugging = debugging 49 | self.udp_factory = udpListener(self.queueList, self.logger, self.debugging) 50 | self.reactor = reactor 51 | self.reactor.listenUDP(self.listenPort, self.udp_factory) 52 | 53 | # ======================================= RUN ========================================== 54 | def run(self): 55 | """ 56 | Run the thread. 57 | """ 58 | self.reactor.run(installSignalHandlers=False) 59 | 60 | # ====================================== STOP ========================================== 61 | def stop(self): 62 | """ 63 | Stop the thread. 64 | """ 65 | self.reactor.stop() 66 | super(threadSemaphores, self).stop() 67 | -------------------------------------------------------------------------------- /src/data/Semaphores/threads/udpListener.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived Owner 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | 29 | import json 30 | from src.utils.messages.allMessages import Semaphores 31 | from twisted.internet import protocol 32 | from src.utils.messages.messageHandlerSender import messageHandlerSender 33 | 34 | class udpListener(protocol.DatagramProtocol): 35 | """This class is used to receive the information from the servers. 36 | 37 | Args: 38 | queue (multiprocessing.queues.Queue): the queue to send the info 39 | """ 40 | 41 | def __init__(self, queuesList, logger, debugging): 42 | self.semaphoresSender = messageHandlerSender(queuesList, Semaphores) 43 | self.logger = logger 44 | self.debugging = debugging 45 | 46 | def datagramReceived(self, datagram, addr): 47 | """Specific function for receiving the information. It will select and create different dictionary for each type of data we receive(car or semaphore) 48 | 49 | Args: 50 | datagram (dictionary): In this we store the data we get from servers. 51 | """ 52 | dat = datagram.decode("utf-8") 53 | dat = json.loads(dat) 54 | 55 | if dat["device"] == "semaphore": 56 | tmp = {"id": dat["id"], "state": dat["state"], "x": dat["x"], "y": dat["y"]} 57 | 58 | elif dat["device"] == "car": 59 | tmp = {"id": dat["id"], "x": dat["x"], "y": dat["y"]} 60 | if self.debugging: 61 | self.logger.info(tmp) 62 | self.semaphoresSender.send(tmp) 63 | 64 | def stopListening(self): 65 | super().stopListening() 66 | -------------------------------------------------------------------------------- /src/data/TrafficCommunication/threads/udpListener.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | 29 | from twisted.internet import protocol 30 | import src.data.TrafficCommunication.useful.keyDealer as keyDealer 31 | 32 | class udpListener(protocol.DatagramProtocol): 33 | """This class will handle the connection. 34 | 35 | Args: 36 | decrypt_key (String): A path to the decripting key. 37 | serverfound (function): This function will be called if the server will be found. 38 | """ 39 | 40 | def __init__(self, decrypt_key, serverfound): 41 | decrypt_key = decrypt_key 42 | self.pub_key = keyDealer.load_public_key(decrypt_key) 43 | self.serverfoundCllback = serverfound 44 | 45 | def startProtocol(self): 46 | print("Looking for Traffic Communicaiton Server") 47 | 48 | def datagramReceived(self, datagram, address): 49 | """In this function we split the receive data and we call the callbackfunction""" 50 | 51 | try: 52 | dat = datagram.split(b"(-.-)") 53 | if len(dat) != 2: 54 | raise Exception("Plaintext or signature not present") 55 | a = keyDealer.verify_data(self.pub_key, dat[1], dat[0]) 56 | if not a: 57 | raise Exception("signature not valid") 58 | msg = dat[1].decode().split(":") 59 | port = int(msg[1]) 60 | self.serverfoundCllback(address[0], port) 61 | except Exception as e: 62 | print("TrafficCommunication -> udpListener -> datagramReceived:") 63 | print(e) 64 | 65 | def stopListening(self): 66 | self.transport.stopListening() 67 | -------------------------------------------------------------------------------- /src/data/TrafficCommunication/useful/periodicTask.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | from twisted.internet import task 29 | 30 | 31 | class periodicTask(task.LoopingCall): 32 | def __init__(self, interval, shrd_mem, tcp_factory): 33 | super().__init__(self.periodicCheck) 34 | self.interval = interval 35 | self.shrd_mem = shrd_mem 36 | self.tcp_factory = tcp_factory 37 | 38 | def start(self): 39 | """ 40 | Start the periodic task with the specified interval. 41 | """ 42 | super().start(self.interval) 43 | 44 | def periodicCheck(self): 45 | """ 46 | Perform the periodic check and send data to the server. 47 | """ 48 | tosend = self.shrd_mem.get() 49 | for mem in tosend: 50 | self.tcp_factory.send_data_to_server(mem) 51 | -------------------------------------------------------------------------------- /src/data/TrafficCommunication/useful/publickey_server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBrc289KPp+9N69JWyP7mk3 3 | nSMTQS/pMNDPy94AjffcSk6WTSXYtJJfZjXD0gmCwMWZtuU3Suaj0TnvUZ33GcN+ 4 | HHbPuc6N3Rk9fximAyGJ4rbZH0zwlK6OzbwWlN5WWQh12tYrVJGe9UvwlBzcBMiG 5 | Lkd0iYCRAEkixkWAB9q8rzj/NXOy00wQIiaIe7tdKgtv26C/FyqyiVILwWnsOmRm 6 | /2J5odlTTCMtwbB7qsxpTYpqRYNZY6EE4gQL/beXZUC8FRFyvgTEA/9WdWuEiTKS 7 | VjWfxnFenEJ8VJeQ1yjBFOp137xh82Ia/OfCDU/XxJRvEZRvTtGM5mFEqG4P8yGp 8 | AgMBAAE= 9 | -----END PUBLIC KEY----- -------------------------------------------------------------------------------- /src/data/TrafficCommunication/useful/publickey_server_test.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PUBLIC KEY----- 2 | MIIBCgKCAQEApzKiiV4o2B+GXBajua5hA0sshk1EdoIaQO/59jwpY1BakoSsY1zu 3 | h/EKEKGWLYbXMZ6rxcdMg3hX6xEAqSHpYIx50Od4s3YqwcEcTIRsX5iFKIW/EBO7 4 | oyLXYWU7YGGFGvTNFCH0ge8e+8C9gteMxRJfg0FRZ+cuBAJWpQkjUi9o0LgOnCw2 5 | HJb8fJJtOct6pUbq1K1NQc7sOdDLYZ1jLiwcoit8J8mBkHZrFbnHX/Pq+siSn/Bx 6 | /P9iatzPE596ZmR9XStzJLVSy5kYabZ7jRhmC4M+5TWIsDwLv+Vw8aF41lKV5wGp 7 | klwzBUzae/uOdVinHTr1H7vmGNR7IrvDEQIDAQAB 8 | -----END RSA PUBLIC KEY----- 9 | -------------------------------------------------------------------------------- /src/hardware/serialhandler/historyFile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ECC-BFMC/Brain/535975d4e1aa4adc47ae28f7ce46787f63937b82/src/hardware/serialhandler/historyFile.txt -------------------------------------------------------------------------------- /src/hardware/serialhandler/threads/filehandler.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | from threading import Lock 29 | 30 | 31 | class FileHandler: 32 | def __init__(self, f_fileName): 33 | self.outFile = open(f_fileName, "w") 34 | self.lock = Lock() 35 | 36 | def write(self, f_str): 37 | self.lock.acquire() 38 | self.outFile.write(f_str) 39 | self.lock.release() 40 | 41 | def close(self): 42 | self.outFile.close() 43 | -------------------------------------------------------------------------------- /src/templates/threadwithstop.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | 29 | from threading import Thread 30 | from functools import partial 31 | 32 | 33 | class ThreadWithStop(Thread): 34 | def __init__(self, *args, **kwargs): 35 | """An extended version of the thread superclass, it contains a new attribute (_running) and a new method (stop). 36 | The '_running' flag can be used to control the state of the 'run' method and the 'stop' method can stop the running by changing its value. 37 | 38 | Raises 39 | ------ 40 | ValueError 41 | the 'target' parameter of the constructor have to be a unbounded function 42 | 43 | Examples 44 | -------- 45 | Creating a new subclass of 'ThreadWithStop' superclass: 46 | 47 | class AThread(ThreadWithStop): 48 | def run(self): 49 | while sel._running: 50 | ... 51 | 52 | th1 = AThread() 53 | th1.start() 54 | ... 55 | th1.stop() 56 | th1.join() 57 | 58 | 59 | An example with local function and witouth subclass definition: 60 | 61 | def examplesFunc(self,param): 62 | while self._running 63 | ... 64 | 65 | th1 = ThreadWithStop(target = examplesFunc, args = (param,)) 66 | th1.start() 67 | ... 68 | th1.stop() 69 | th1.join() 70 | 71 | """ 72 | 73 | # Check the target parameter definition. If it isn't a bounded method, then we have to give like the first parameter the new object. Thus the run method can access the object's field, (like self._running). 74 | if "target" in kwargs: 75 | if not hasattr(kwargs["target"], "__self__"): 76 | kwargs["target"] = partial(kwargs["target"], self) 77 | else: 78 | raise ValueError("target parameter must be a unbounded function") 79 | super(ThreadWithStop, self).__init__(*args, **kwargs) 80 | self._running = True 81 | 82 | def stop(self): 83 | """This method has role to stop the thread by setting the '_running' flag to false value.""" 84 | self._running = False 85 | -------------------------------------------------------------------------------- /src/utils/messages/messageHandlerSender.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers 2 | # All rights reserved. 3 | 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | 7 | # 1. Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | 14 | # 3. Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 28 | 29 | class messageHandlerSender: 30 | """Class which will handle sender functionalities.\n 31 | Args: 32 | queuesList (dictionary of multiprocessing.queues.Queue): Dictionary of queues where the ID is the type of messages. 33 | message (enum): A specific message 34 | """ 35 | 36 | def __init__(self, queuesList, message): 37 | self.queuesList = queuesList 38 | self.message = message 39 | 40 | def send(self, value): 41 | """ 42 | Puts a value into the queuesList 43 | 44 | Args: 45 | value (any type): The value to be put into the queue. This can be of any type 46 | """ 47 | self.queuesList[self.message.Queue.value].put( 48 | { 49 | "Owner": self.message.Owner.value, 50 | "msgID": self.message.msgID.value, 51 | "msgType": self.message.msgType.value, 52 | "msgValue": value 53 | } 54 | ) -------------------------------------------------------------------------------- /src/utils/table_state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "channel": "ToggleInstant", 4 | "value": "True", 5 | "initialValue": "True", 6 | "interval": 0, 7 | "type": "dropdown", 8 | "values": [ 9 | "True", 10 | "False" 11 | ], 12 | "command": "instant", 13 | "checked": true, 14 | "hasChanged": false 15 | }, 16 | { 17 | "channel": "ToggleBatteryLvl", 18 | "value": "True", 19 | "initialValue": "True", 20 | "interval": 0, 21 | "type": "dropdown", 22 | "values": [ 23 | "True", 24 | "False" 25 | ], 26 | "command": "battery", 27 | "checked": true, 28 | "hasChanged": false 29 | }, 30 | { 31 | "channel": "ToggleImuData", 32 | "value": "True", 33 | "initialValue": "True", 34 | "interval": 0, 35 | "type": "dropdown", 36 | "values": [ 37 | "True", 38 | "False" 39 | ], 40 | "command": "imu", 41 | "checked": true, 42 | "hasChanged": false 43 | }, 44 | { 45 | "channel": "ToggleResourceMonitor", 46 | "value": "True", 47 | "initialValue": "True", 48 | "interval": 0, 49 | "type": "dropdown", 50 | "values": [ 51 | "True", 52 | "False" 53 | ], 54 | "command": "resourceMonitor", 55 | "checked": true, 56 | "hasChanged": false 57 | }, 58 | { 59 | "channel": "Brightness", 60 | "value": 50, 61 | "initialValue": 50, 62 | "interval": 0, 63 | "type": "slider", 64 | "values": [ 65 | 0, 66 | 100 67 | ], 68 | "checked": false, 69 | "hasChanged": false 70 | }, 71 | { 72 | "channel": "Contrast", 73 | "value": 0, 74 | "initialValue": 0, 75 | "interval": 0, 76 | "type": "slider", 77 | "values": [ 78 | 0, 79 | 3200 80 | ], 81 | "checked": false, 82 | "hasChanged": false 83 | }, 84 | { 85 | "channel": "init", 86 | "type": "Config", 87 | "batteryCapacity": { 88 | "capacity": 9000 89 | }, 90 | "hasChanged": false 91 | } 92 | ] --------------------------------------------------------------------------------