diff --git a/DBC_Converter_RX.py b/DBC_Converter_RX.py index 970a1ab..09f4bea 100644 --- a/DBC_Converter_RX.py +++ b/DBC_Converter_RX.py @@ -8,7 +8,7 @@ def generate_globals(signals, C_file, header_file): return with open(C_file, 'w') as f: - f.write("#include \n") + f.write("#include \n") for message_name, message_info in signals.items(): for signal in message_info["Signals"]: @@ -193,11 +193,11 @@ if __name__ == "__main__": dbc_file_path = sys.argv[1] output_dir = sys.argv[2] - output_globals_C_file = f"{output_dir}/generated_globals.c" - output_globals_header_file = f"{output_dir}/generated_globals.h" - output_c_file = f"{output_dir}/generated_receive.c" - output_input_file = f"{output_dir}/generated_input.c" - output_initialization_file = f"{output_dir}/generated_init.c" + output_globals_C_file = f"{output_dir}/generated_RX_globals.c" + output_globals_header_file = f"{output_dir}/generated_RX_globals.h" + output_c_file = f"{output_dir}/generated_RX_receive.c" + output_input_file = f"{output_dir}/generated_RX_input.c" + output_initialization_file = f"{output_dir}/generated_RX_init.c" signals = load_dbc_file(dbc_file_path) diff --git a/DBC_Converter_TX.py b/DBC_Converter_TX.py index 252d68d..5850e0b 100644 --- a/DBC_Converter_TX.py +++ b/DBC_Converter_TX.py @@ -171,13 +171,13 @@ if __name__ == "__main__": dbc_file_path = sys.argv[1] output_dir = sys.argv[2] - output_structs_file = f"{output_dir}/generated_tx_structs.h" - output_globals_file = f"{output_dir}/generated_tx_globals.c" - output_globals_header = f"{output_dir}/generated_tx_globals.h" - output_tx_functions_file = f"{output_dir}/generated_tx_functions.c" - output_tx_initialization = f"{output_dir}/generated_tx_initialization.c" - output_enum_file = f"{output_dir}/generated_tx_enum.h" - output_c_file = f"{output_dir}/Transmit_All_VCU_Messages.c" # Replace with your desired output file name + output_structs_file = f"{output_dir}/generated_TX_structs.h" + output_globals_file = f"{output_dir}/generated_TX_globals.c" + output_globals_header = f"{output_dir}/generated_TX_globals.h" + output_tx_functions_file = f"{output_dir}/generated_TX_output.c" + output_tx_initialization = f"{output_dir}/generated_TX_init.c" + output_enum_file = f"{output_dir}/generated_TX_enum.h" + output_c_file = f"{output_dir}/generated_TX_transmit.c" # Replace with your desired output file name cycle_time = "10ms" signals = load_dbc_file(dbc_file_path) diff --git a/README.md b/README.md index 4eae6b8..1087c5e 100644 --- a/README.md +++ b/README.md @@ -1 +1,144 @@ -# DBC_Converter \ No newline at end of file +## πŸ“ Program Name +**DBC Converter** + +![Program Logo](icon/icon.png) + +## πŸ“‘Table of Contents +- [πŸ“‚ Introduction](#introduction) +- [🎭 Features](#features) +- [πŸ’» Code Structure](#code-structure) +- [🎒 Development](#development) + * [Prerequisites](#prerequisites) +- [βš™ How to use](#How-to-use) + +## πŸ“‚Introduction +`DBC Converter`λŠ” DBC (Database CAN) νŒŒμΌμ„ C μ½”λ“œλ‘œ λ³€ν™˜ν•˜λŠ” λ„κ΅¬μž…λ‹ˆλ‹€. 이 λ„κ΅¬λŠ” μ°¨λŸ‰ λ„€νŠΈμ›Œν¬μ—μ„œ μ‚¬μš©λ˜λŠ” CAN (Controller Area Network) λ©”μ‹œμ§€μ™€ μ‹ ν˜Έλ₯Ό μ •μ˜ν•˜λŠ” DBC νŒŒμΌμ„ νŒŒμ‹±ν•˜μ—¬, 이λ₯Ό C μ½”λ“œλ‘œ λ³€ν™˜ν•˜μ—¬ μž„λ² λ””λ“œ μ‹œμŠ€ν…œμ—μ„œ μ‚¬μš©ν•  수 μžˆλ„λ‘ ν•©λ‹ˆλ‹€. + +## 🎭Features +- **DBC 파일 νŒŒμ‹±** + + DBC νŒŒμΌμ„ 읽고 νŒŒμ‹±ν•˜μ—¬ CAN λ©”μ‹œμ§€μ™€ μ‹ ν˜Έ 정보λ₯Ό μΆ”μΆœν•©λ‹ˆλ‹€. + +- **C μ½”λ“œ 생성** + + νŒŒμ‹±λœ 정보λ₯Ό 기반으둜 CAN λ©”μ‹œμ§€μ™€ μ‹ ν˜Έλ₯Ό μ²˜λ¦¬ν•˜λŠ” C μ½”λ“œλ₯Ό μƒμ„±ν•©λ‹ˆλ‹€. + +- **GUI 지원** + + μ‚¬μš©μžκ°€ μ‰½κ²Œ νŒŒμΌμ„ μΆ”κ°€, μ‚­μ œ 및 경둜λ₯Ό μ„€μ •ν•  수 μžˆλŠ” κ·Έλž˜ν”½ μ‚¬μš©μž μΈν„°νŽ˜μ΄μŠ€(GUI)λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. + +- **채널 선택 및 μ„€μ •** + + λ‹€μ–‘ν•œ CAN 채널을 μ„ νƒν•˜κ³  μ„€μ •ν•  수 μžˆλŠ” κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€. + +- **λ³€ν™˜ μƒνƒœ ν‘œμ‹œ** + + 파일 λ³€ν™˜ μƒνƒœ 및 μ§„ν–‰λ₯ μ„ μ‹€μ‹œκ°„μœΌλ‘œ ν‘œμ‹œν•©λ‹ˆλ‹€. + +- **파일 관리** + + 파일 λ³€ν™˜ μ‹œ λ³€ν™˜ μ‹œμž‘ λ‚ μ§œμ™€ μ‹œκ°„λ³„λ‘œ 폴더가 μƒμ„±λ˜λ©°, DBC 파일과 C 파일이 μžλ™μœΌλ‘œ μƒμ„±λ˜μ–΄ νžˆμŠ€ν† λ¦¬ 관리가 μš©μ΄ν•©λ‹ˆλ‹€. + +## πŸ’»Code Structure + +```bash +README.md +DBC_Converter +β”œβ”€β”€ DBC_Converter.py +β”œβ”€β”€ DBC_Converter_Data_Parsing.py +β”œβ”€β”€ DBC_Converter_Common.py +β”œβ”€β”€ DBC_Converter_TX.py +└── DBC_Converter_RX.py +icon +└── icon.png +img +β”œβ”€β”€ add_file.png +β”œβ”€β”€ add_folder.png +β”œβ”€β”€ converter.png +β”œβ”€β”€ delete_all.png +β”œβ”€β”€ delete_description.png +└── delete_file.png +``` + +## 🎒Development +### Prerequisites +- **Python 3.6+**: Python μ„€μΉ˜κ°€ ν•„μš”ν•©λ‹ˆλ‹€. +- **PyQt5**: GUIλ₯Ό μœ„ν•œ PyQt5 λΌμ΄λΈŒλŸ¬λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€. +- **Git**: 버전 관리λ₯Ό μœ„ν•œ Git이 ν•„μš”ν•©λ‹ˆλ‹€. + +## βš™How to Use +1. **UI** + + ![UI Image](img/HowToUse/1.Main(no).png) + + 1. 파일 μΆ”κ°€ + + 2. 파일 μ‚­μ œ + + 3. 전체 파일 μ‚­μ œ + + 4. λ©”μ‹œμ§€ μ°½ λ‚΄μš© μ‚­μ œ + + 5. λ³€ν™˜ μ‹œμž‘ + + 6. 파일 리슀트 μ°½ + + 7. μ €μž₯ 경둜 + + 8. 경둜 선택 + + 9. μ €μž₯ 경둜 폴더 μ—΄κΈ° + + 10. λ©”μ‹œμ§€ μ°½ + + 11. 채널 μ„€μ • μ°½ + +2. **파일 μΆ”κ°€** + + ![add file](img/HowToUse/2.AddFiile.png) + + - GUIμ—μ„œ `파일 μΆ”κ°€` λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ λ³€ν™˜ν•  DBC νŒŒμΌμ„ μΆ”κ°€ν•©λ‹ˆλ‹€. + +3. **파일 μ‚­μ œ** + + ![delete file](img/HowToUse/3.DeleteFile.png) + + - GUIμ—μ„œ `파일 μ‚­μ œ` λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ μ„ νƒν•œ DBC νŒŒμΌμ„ μ‚­μ œν•©λ‹ˆλ‹€. + +4. **μ €μž₯ 경둜 μ„€μ •** + + ![repository selection](img/HowToUse/4.RepositorySelection.png) + + - GUIμ—μ„œ `경둜 μ„€μ •` λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ λ³€ν™˜λœ C νŒŒμΌμ„ μ €μž₯ν•  경둜λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. + +5. **채널 선택 및 μ„€μ •** + + ![channel selection](img/HowToUse/5.ChannelSelection.png) + + - GUIμ—μ„œ CAN 채널을 μ„ νƒν•˜κ³  μ„€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +6. **λ³€ν™˜ μ‹œμž‘** + + ![convert](img/HowToUse/6.Convert.png) + + - GUIμ—μ„œ `λ³€ν™˜ μ‹œμž‘` λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ DBC νŒŒμΌμ„ C 파일둜 λ³€ν™˜ν•©λ‹ˆλ‹€. + +7. **λ³€ν™˜ μƒνƒœ 확인** + + ![complete](img/HowToUse/7.Complete.png) + + - GUIμ—μ„œ λ³€ν™˜ μƒνƒœ 및 μ§„ν–‰λ₯ μ„ μ‹€μ‹œκ°„μœΌλ‘œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€. + +8. **λ³€ν™˜ κ²°κ³Ό** + + - 경둜 + + μ €μž₯ 경둜/DBC λ³€ν™˜/λ…„-μ›”-일-μš”μΌ μ‹œκ°„:λΆ„:초 + + - DBC 파일 + + #DBC 폴더 λ‚΄ DBC 파일이 λ³΅μ‚¬λ˜μ–΄ μƒμ„±λ©λ‹ˆλ‹€. + + - C 파일 + + DBC 파일 λͺ… 폴더 λ‚΄ Common, RX, TX ν΄λ”λ‘œ κ΅¬λΆ„λ˜μ–΄ μƒμ„±λ©λ‹ˆλ‹€. \ No newline at end of file diff --git a/img/HowToUse/0.Main.png b/img/HowToUse/0.Main.png new file mode 100644 index 0000000..c196802 Binary files /dev/null and b/img/HowToUse/0.Main.png differ diff --git a/img/HowToUse/1.Main(no).png b/img/HowToUse/1.Main(no).png new file mode 100644 index 0000000..d32bb5b Binary files /dev/null and b/img/HowToUse/1.Main(no).png differ diff --git a/img/HowToUse/2.AddFiile.png b/img/HowToUse/2.AddFiile.png new file mode 100644 index 0000000..f039a3a Binary files /dev/null and b/img/HowToUse/2.AddFiile.png differ diff --git a/img/HowToUse/3.DeleteFile.png b/img/HowToUse/3.DeleteFile.png new file mode 100644 index 0000000..01d0b62 Binary files /dev/null and b/img/HowToUse/3.DeleteFile.png differ diff --git a/img/HowToUse/4.RepositorySelection.png b/img/HowToUse/4.RepositorySelection.png new file mode 100644 index 0000000..ab53e49 Binary files /dev/null and b/img/HowToUse/4.RepositorySelection.png differ diff --git a/img/HowToUse/5.ChannelSelection.png b/img/HowToUse/5.ChannelSelection.png new file mode 100644 index 0000000..5d0c922 Binary files /dev/null and b/img/HowToUse/5.ChannelSelection.png differ diff --git a/img/HowToUse/6.Convert.png b/img/HowToUse/6.Convert.png new file mode 100644 index 0000000..0d462ec Binary files /dev/null and b/img/HowToUse/6.Convert.png differ diff --git a/img/HowToUse/7.Complete.png b/img/HowToUse/7.Complete.png new file mode 100644 index 0000000..1d23aa8 Binary files /dev/null and b/img/HowToUse/7.Complete.png differ diff --git a/img/HowToUse/main.pptx b/img/HowToUse/main.pptx new file mode 100644 index 0000000..55cc0a8 Binary files /dev/null and b/img/HowToUse/main.pptx differ diff --git a/settings.json b/settings.json index 656cc45..3771384 100644 --- a/settings.json +++ b/settings.json @@ -2,6 +2,6 @@ "theme": "light", "default_save_path": "C:/Users/MSI/Desktop", "file_paths": [], - "last_opened_dir": "C:/Users/MSI/SynologyDrive/3min_be/ν•œμžμ—°/!과제/μ΄ˆμ•ˆμ „/#Debug/DBC", + "last_opened_dir": "C:/Users/MSI/Desktop/python/motorola_tx", "channel_info": {} } \ No newline at end of file