OrloDavid / Anycubic_Kobra_Go_Neo_Marlin_Firmware

Aycubic Kobra Go Firmware Modifications and Fixes w\ support for XSymmetry
GNU General Public License v3.0
0 stars 0 forks source link

Decide on and finalize an IDE environment for this build. #3

Closed OrloDavid closed 9 months ago

OrloDavid commented 9 months ago

Dealing with new projects in this software could really test your patience. Every time, it was the same song and dance: manually connecting directories, then creating groups and linking files. It felt like running in circles, starting from the workspace directory and navigating through a labyrinth of folders - source, marlin, src, gcode, feature, digipot, and so forth. Thankfully, I've cracked a few shortcuts that streamline this entire process. I'll detail these solutions in the upcoming sections. First up is dealing with the directory linking in C++ section. I wrote a script that automatically retrieves and formats the folder names, provided your directory structure is organized and all folders should be included. You can also modify the script to ignore certain folders if you know they are not needed. This script generates a text file: the first list is in a human-readable format, and the second list is formatted for pasting into Keil.

  1. Open the project options dialog and go to the groups tab.

  2. Right-click in the "include paths" area, select all, and copy the data.

  3. Paste the copied data into a text editor like Notepad++.

  4. Edit the data to add or remove directories as needed.

  5. In Notepad++, use the search and replace function to replace ";." with a line return followed by ";..", making the directories easier to read.

  6. Delete the old data from the "include paths" field in the project options dialog.

  7. Paste the newly edited data back into the field.

  8. Close the dialog, then reopen it to confirm the changes are correct by clicking the browse button. Next, I tackled the group/file process, which is quite complex. This step is not for beginners, as it requires knowledge of which files are essential. Including unnecessary files can lead to a multitude of compiler errors, and unfortunately, these errors won't point out superfluous files. Within the Marlin directory, the Anycubic release generally omits any non-essential files. However, for other locations, you might need to manually compare files or hope there are no dependencies on the excluded files. To address this issue, I did what seemed logical: I wrote more programs. This time, a PowerShell script handles the backend work, while an AutoIT script manages the GUI interaction. Here's an overview of how it functions

  9. Powershell Script Functionality: • Gathers all folder names from a specified starting directory. • Formats these folder names into short, usable group names, typically incorporating underscores. • Outputs the list of these formatted names to a file, the format and location of which are determined by the script's settings.

  10. AutoIt Application Process: • Takes the list generated by the PowerShell script. • Manually enters this list into Keil, line by line. • Confirms that Keil is open and the correct window is active; if not, it opens the required window. • Navigates to the correct entry location in Keil and starts creating groups based on the list. • Allows for a break (e.g., you can have a coffee) while it works in the background. • Upon completion, it enables the removal of any unwanted groups, which can also be pre-edited in the text file before running the script. • Significantly speeds up the process of adding files and creating groups in Keil, reducing manual effort and the risk of repetitive strain.

This significantly accelerated development because the original file distribution had them organized into groups that seemed like an afterthought. Keeping track of which files were in which groups, especially when they didn't align with expectations, was a tedious task. However, I discovered a method to speed up the process. If you copy a folder path close to your target location, such as the Marlin Src root or the last folder from which you added files, you can paste it into the file name box and press enter to jump directly to that directory. A similar trick works when adding folder paths manually to the C++ tab. Before clicking the browse button to start a new group, paste any folder location into the new line. Don't press enter; just click the browse button. Interestingly, it doesn’t take you to the pasted location, but rather one level up from the last folder you visited, which is often more convenient since you can simply paste in any desired path each time. I'm currently determining the most effective way to set up these repositories and plan to upload them to the most suitable platform. It seems the Orlo 3D printer repository will be the best fit, likely evolving into a comprehensive hub for the various sub-projects related to this overarching project."

OrloDavid commented 9 months ago

Completed