From eb18ae934bf203268b38b3e99d5313bb5af01972 Mon Sep 17 00:00:00 2001 From: Jules Atchoglo Date: Mon, 23 Sep 2024 09:48:08 +0200 Subject: [PATCH] Completed project setup phase --- .devcontainer/devcontainer.json | 61 +++++++++++++++++++++++++++++++++ .vscode/tasks.json | 12 +++++++ Dockerfile | 12 +++++++ Pipfile | 3 +- README.md | 9 +++++ can_explorer/gui/main_window.py | 2 +- can_explorer/transport/isotp.py | 0 7 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/tasks.json create mode 100644 can_explorer/transport/isotp.py diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ec88154 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,61 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "CanExplorer Container", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "../Dockerfile", + "args": { + "network": "host", + "xhost": "+" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--privileged", + "--network=host" + ], + "appPort": [ + "69:69" + ], + "settings" : { + "git.path": "/usr/bin/git" + }, + "mounts": [ + "type=bind,source=/dev/bus/usb,target=/dev/bus/usb", // Make Debugger available. + "source=${localEnv:HOME}/.ssh,target=/home/devuser/.ssh,type=bind,consistency=cached", // Make ssh key available + "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached" // Mount graphic inside container to run GUIs + ], + "containerEnv": { + "DISPLAY": "${localEnv:DISPLAY}" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "can_explorer", + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker", + "ms-python.python", + "ms-python.debugpy", + "donjayamanne.python-environment-manager" + ] + } + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..6c28385 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "echo", + "type": "shell", + "command": "echo Hello" + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e69de29..c16f080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:noble + +ENV TZ="Europe/Berlin" +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt -y update +RUN apt -y install git vim python3 python3-pip pipenv + +RUN apt -y update +RUN apt -y install libglib2.0-0 libglu1-mesa-dev libxkbcommon-x11-0 build-essential libgl1-mesa-dev libdbus-1-dev libxcb-* + +RUN useradd -ms /bin/bash can_explorer \ No newline at end of file diff --git a/Pipfile b/Pipfile index c8989ae..c3bfca8 100644 --- a/Pipfile +++ b/Pipfile @@ -5,7 +5,6 @@ name = "pypi" [packages] pyqt6 = "*" -pyqt6-tools = "*" python-can = "*" cantools = "*" pyinstaller = "*" @@ -21,7 +20,7 @@ pytest = "*" pylint = "*" [requires] -python_version = "3.10" +python_version = "3.12" [scripts] main = "python -m can_explorer" diff --git a/README.md b/README.md index 65abca7..13edf41 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # CANExplorer A CANbus-Analyse Tool for all platform. + +## Roadmap +1. Project Setup + - [ ] Initialize git project + - [ ] Set basic project structure + - [ ] Set package manager and install packages + - [ ] Set docker and vscode devcontainer + - [ ] Add basic working code +2. \ No newline at end of file diff --git a/can_explorer/gui/main_window.py b/can_explorer/gui/main_window.py index 665ee90..de16415 100644 --- a/can_explorer/gui/main_window.py +++ b/can_explorer/gui/main_window.py @@ -6,4 +6,4 @@ class MainWindow(QMainWindow): def __init__(self): super().__init__() - loadUi("gui/qt/main_window.ui", self) + loadUi("can_explorer/gui/qt/main_window.ui", self) diff --git a/can_explorer/transport/isotp.py b/can_explorer/transport/isotp.py new file mode 100644 index 0000000..e69de29