+ + Coding Period Week 13: Aug 21 ~ Aug 26 + + +
+ + + + + +This is the final evaluation week, where ongoing and new errors were resolved, a demo video was created, and the summary report for the final evaluation of G...
+diff --git a/README.md b/README.md
index 62745e0..6e5bddc 100644
--- a/README.md
+++ b/README.md
@@ -17,8 +17,10 @@ This GSoC Project focuses on adding a global block composition feature, resolvin
- [Toshan Luktuke](https://github.com/toshan-luktuke)
-**Official Repository:** [VisualCircuit](https://github.com/JdeRobot/VisualCircuit/)
-**Github Issues**: [Summary](https://github.com/JdeRobot/VisualCircuit/issues?q=author%3ABkPankaj+)
-**Pull Requests:** [Summary](https://github.com/JdeRobot/VisualCircuit/pulls?q=author%3ABkPankaj+)
+**Official Repository:** [VisualCircuit](https://github.com/JdeRobot/VisualCircuit/)
+**Project Summary:** [Explore Summary](https://theroboticsclub.github.io/gsoc2024-Pankaj_Borade/summary/)
+**About:** [Explore About](https://theroboticsclub.github.io/gsoc2024-Pankaj_Borade/About/)
+**Github Issues**: [View Issues](https://github.com/JdeRobot/VisualCircuit/issues?q=author%3ABkPankaj+)
+**Pull Requests:** [See Pull Requests](https://github.com/JdeRobot/VisualCircuit/pulls?q=author%3ABkPankaj+)
Thank you for your interest, and feel free to reach out via email if you have any questions, comments, or suggestions. I hope you find my work engaging!
diff --git a/docs/_config.yml b/docs/_config.yml
index 2cecb78..964a0ea 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -99,7 +99,6 @@ defaults:
author_profile: true
read_time: true
comments: true
- share: true
related: true
# _pages
- scope:
diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml
index 9dc4fd3..a6a04b9 100644
--- a/docs/_data/navigation.yml
+++ b/docs/_data/navigation.yml
@@ -39,6 +39,8 @@ docs:
url: /coding-week10/
- title: "Coding Period - Week 11 & 12"
url: /coding-week11-12/
+ - title: "Coding Period - Week 13"
+ url: /coding-week13/
- title: "Project Summary"
url: /summary/
\ No newline at end of file
diff --git a/docs/_posts/2024-06-03-code-w1.md b/docs/_posts/2024-06-03-code-w1.md
index 11ba717..11781f4 100644
--- a/docs/_posts/2024-06-03-code-w1.md
+++ b/docs/_posts/2024-06-03-code-w1.md
@@ -17,14 +17,14 @@ From here onwards Coding period begins, During the Monday meeting, mentors discu
## Accomplishment and Challenges
-* #### First yaml file for Github Actions
+* ### First yaml file for Github Actions
First of all, it was my first time writing a YAML file for GitHub Actions. I used resources such as YouTube videos [1] and GitHub Actions documentation [2] to help me write the initial script. From the discussions, it was clear that testing should trigger when there is a pull request to the master branch, so I started with that and followed the VisualCircuit documentation for the frontend installation.
First failure of coding period:
![one](../assets/images/one.png)
-* #### Creating workflow for installation process
+* ### Creating workflow for installation process
The initial idea was to create a separate workflow for the installation process. This installation workflow would be reused for every test and other workflows. I worked on this and resolved the above issue by including '--legacy-peer-deps' at the end of the 'npm install' command.
```shell
@@ -73,12 +73,12 @@ jobs:
- name: Generate static files
run: python backend/manage.py collectstatic
```
-* #### Research and modifying the workflow
+* ### Research and modifying the workflow
I reviewed some open source projects such as RocketChat and Volto by the Plone Foundation to understand the CI pipeline workflow. I realized that creating a separate workflow for installation is uncommon and not a best practice. Instead, I created a setup job and stored the results in artifacts for use in different tests (jobs).
Initially, I encountered a "MODULE NOT FOUND" frontend error because I stored node modules in artifacts. Storing node modules in artifacts is not ideal since artifacts are typically used for build files. Stack Overflow and GitHub Actions documentation [3] suggested using Action Cache instead. After switching to Action Cache, the issue was resolved, and I proceeded to the next step of basic frontend testing.
-* #### CI Workflow with basic frontend test
+* ### CI Workflow with basic frontend test
For basic frontend testing, I researched Jest and React testing frameworks commonly used for unit tests on the React side. I used prebuilt React tests and initially printed the rendered HTML in the terminal. Based on this, I identified the menubar elements and added a basic test to find and verify that the "File" text is present in the rendered App.
CI Workflow tested in forked repo:
diff --git a/docs/_posts/2024-06-10-code-w2.md b/docs/_posts/2024-06-10-code-w2.md
index 75378a7..997529e 100644
--- a/docs/_posts/2024-06-10-code-w2.md
+++ b/docs/_posts/2024-06-10-code-w2.md
@@ -17,23 +17,23 @@ Welcome to the second week of Coding Week progress. In the Monday meeting, we di
## Accomplishment and Challenges
-* #### Learning tools for Automation - Selenium
+* ### Learning tools for Automation - Selenium
To create a global test, I needed a tool that could automatically click respective options in the VisualCircuit application. I explored several technologies such as Puppeteer, Playwright, and Selenium. I chose Selenium as it is widely used for automation. I learned how Selenium works and how to use it.
-* #### Integreation of Selenium with Github Action
+* ### Integreation of Selenium with Github Action
From my research, I observed that there are two ways to use Selenium with GitHub Actions: one involves the standard installation of Chrome and ChromeDriver, and the other uses the selenium/standalone-chrome Docker image. I chose the second method as it includes the latest Chrome and ChromeDriver, eliminating the need for a separate ChromeDriver. Additionally, it contains all the functionalities of the Chrome browser. Initially, the browser was not displaying correctly on the Selenium Grid, only showing the logo. To view the live action of the process, I opted for noVNC.
-* #### Automating clicking File and Open buttons in the Menubar
+* ### Automating clicking File and Open buttons in the Menubar
After successfully running selenium/standalone-chrome on my local machine, I automated the process of clicking the menubar buttons. I needed the XPATH to locate and perform the respective actions. I found the XPATH for the File and Open buttons from the Developer Console. Below is a GIF showing the automation process of opening the browser, launching VC, and clicking the respective buttons.
Automating clicking File and Open buttons in the Menubar:
![](../assets/images/five.gif)
-* #### Research about Block Composition
+* ### Research about Block Composition
The first step was to understand the issue created by David Tapiador. I researched the data flow of opening prebuilt VC projects, adding as a block, and the build options. When the project is built, the dependency section includes package and design key-value pairs. The dependencies were not included, which may be the reason for this nested issue.
-* #### Adding interdependencies
+* ### Adding interdependencies
For nested blocks, I modified the Dependency interface to include the interdependencies element. I also modified the package-model and converter for dependencies. Successfully, interdependencies appeared inside dependencies, but they were blank. This blank state is a great checkpoint as modifying internal structures introduced many errors. I am happy with the progress of this blank interdependencies issue.
diff --git a/docs/_posts/2024-06-10-code-w3.md b/docs/_posts/2024-06-17-code-w3.md
similarity index 93%
rename from docs/_posts/2024-06-10-code-w3.md
rename to docs/_posts/2024-06-17-code-w3.md
index 111ebee..e8b4fe7 100644
--- a/docs/_posts/2024-06-10-code-w3.md
+++ b/docs/_posts/2024-06-17-code-w3.md
@@ -17,20 +17,20 @@ On the 10th of June, during Monday's meeting, Dr. JoseMaria explained the Global
## Accomplishment and Challenges
-* #### Understanding the VC Block Composition
+* ### Understanding the VC Block Composition
I went through some frontend files such as `menu/index.tsx`, `project-info-dialog.tsx`, and `editor.ts`. These files are responsible for editing the project information on the frontend side. Initially, I thought of adding Global Input Output functionality within the existing project editing interface. However, as I began implementing it, I realized that it was more difficult than anticipated since it required changing the Project Info interface in every file. Therefore, I decided to build a new dialog box that can be opened from the "Save Block" option in the menu bar.
-* #### Implementation of Global Input Output on frontend
+* ### Implementation of Global Input Output on frontend
For choosing the Global Input Output, all inputs and outputs can be shown, and from there, the Global Input Output can be assigned. I created a new script for the dialog box and modified `editor.ts` and `menu/index.tsx`. Currently, all inputs and outputs are displayed. Next week, I will work on assigning the inputs and outputs as Global for the block.
Checkbox for global input output - dialog box:
![](../assets/images/five.png)
-* #### Solving the nested block with different approach
+* ### Solving the nested block with different approach
In this approach, I didn't use `node.dependencies` but instead created blocks and wires for internal dependencies. This solution was suggested by ChatGPT, so I tried it. It involved creating internal wires for dependencies and making the linkages. I spent around two days on this, but it didn't yield the desired results. Additionally, it was suggesting editing many internal components, so I dropped this idea and returned to my nested block solution.
-* #### Solving the nested block with last week approach
+* ### Solving the nested block with last week approach
In the previous week, I encountered blank dependencies. I noticed that the interface dependencies contained a single dependency, so I modified it to include an array and used recursive calls to add internal dependencies. Additionally, `factory.tsx` had not been changed, so I modified that as well. However, the issue of blank dependencies still persists. I need to consult the mentors regarding this issue, as I feel it can be resolved with some more effort.
## Previous PR Updates
diff --git a/docs/_posts/2024-06-10-code-w4.md b/docs/_posts/2024-06-24-code-w4.md
similarity index 92%
rename from docs/_posts/2024-06-10-code-w4.md
rename to docs/_posts/2024-06-24-code-w4.md
index bb5be3d..0fe3628 100644
--- a/docs/_posts/2024-06-10-code-w4.md
+++ b/docs/_posts/2024-06-24-code-w4.md
@@ -16,26 +16,26 @@ In the fourth week's Monday meeting, I showed a working demo and discussed the p
## Accomplishment and Challenges
-* #### Pasting .vc3 file and opening the file in VC
+* ### Pasting .vc3 file and opening the file in VC
I first tried putting the circuit file in the Selenium Docker container through a Python script, but it wasn't a great solution, so I decided to put the circuit file through YAML using Docker commands. After solving this, I needed to open the file from a particular directory in the file manager dialog box. For this, OS-level control was needed, so I used the pyautogui library for opening the file in Visual Circuit.
-* #### Building and solving inseure download issue
+* ### Building and solving inseure download issue
There were many errors when building the project as the backend was running on localhost on the local machine and had to be accessed from the Docker container, resulting in fetch errors. These were resolved after modifying setting.py and .env. After that, the browser wasn't allowing downloads as Chrome considered the HTTP frontend insecure. After some Googling and searching on StackOverflow, I found a solution. Finally, the whole process was completed automatically by Selenium. The complete process is shown in the GIF below.
Selenium based first automated global test:
![](../assets/images/six.gif)
-* #### Improving fetch Global Input and Output function
+* ### Improving fetch Global Input and Output function
In the previous week, I was able to fetch the port data from all blocks, but it was using more iterations and not proper internal functions for fetching the data. So I improved the global input/output function and also added the submit and checklist handlers to pass data to other scripts.
-* #### Creating input output blocks automatically from checkbox data
+* ### Creating input output blocks automatically from checkbox data
Depending on the port chosen by the user, the particular global input/output block is generated automatically. It checks the port type, and according to that, the input or output block is generated with the same name. Initially, the global input/output block position is the same as the initial position, and the links are null.
-* #### Modification of Links and creating respective input output block
+* ### Modification of Links and creating respective input output block
I researched the internal structure of the model and tried to access the links and respective link IDs of each block. After this, I wrote down all possible cases for creating a circuit by the user. One case is where the global input/output has zero links, so one link has to be created, and the source and target assigned. Another case is that there is already a link connected with the block, so according to the port type, the particular source or target has to be removed and a new one assigned. Apart from that, there are other cases that need to be tested in the future, such as if there are two links at the same port, which one to choose. I want to ask the mentors about these cases.
-* #### Saving and retriving old blocks function
+* ### Saving and retriving old blocks function
Before generating the .vc3 composed block file, the old model has to be saved so the user can continue working on the circuit without worrying about the blocks global input/output. The model and project info are saved in the stack, and whenever the build is completed, the old model is loaded. There were constant errors, such as storing the data in the stack but it was changing with changes, as I was storing this.activModel directly in the stack, causing changes in the stack. For that, I tried several methods using deepCopy, custom functions, and cloneDeep. Both deepCopy and custom functions didn't work, so I used the cloneDeep library, which worked without any errors. Similar to the "Save as" functionality, I used that part of the code for generating .vc3 file.
diff --git a/docs/_posts/2024-06-10-code-w5.md b/docs/_posts/2024-07-01-code-w5.md
similarity index 93%
rename from docs/_posts/2024-06-10-code-w5.md
rename to docs/_posts/2024-07-01-code-w5.md
index 9849aa1..bf37bdf 100644
--- a/docs/_posts/2024-06-10-code-w5.md
+++ b/docs/_posts/2024-07-01-code-w5.md
@@ -17,10 +17,10 @@ On Monday's meeting, we discussed possible cases for a composed block. Last week
## Accomplishment and Challenges
-* #### Solving the global block input links issue and extending block composition for every block
+* ### Solving the global block input links issue and extending block composition for every block
As discussed above, we should not have more than one link at the input port, and we need to hide input ports with internal wiring from the block composition dialog box. I modified the globalInputOutput function to segregate ports based on links and port types. In last week's code, only code blocks were supported, so I made changes to support every block. I also observed an issue with the text being fetched from the package, which was taking a 40-character name. I modified it to take the name port from the labels of the blocks.
-* #### Solving the global block output links issue and refining existing code
+* ### Solving the global block output links issue and refining existing code
For blocks with multiple wiring at the output side, a new link needs to be added with the respective global input/output attached. Unlike the global input block issue, this requires the parent global output block ID and the respective link ID so that the existing link is not modified. These changes were extensive and altered last week's code, so I refined the overall code. After refinement, the entire global input/output block was tested with all cases and is working as expected.
diff --git a/docs/_posts/2024-06-10-code-w6-7.md b/docs/_posts/2024-07-15-code-w6-7.md
similarity index 100%
rename from docs/_posts/2024-06-10-code-w6-7.md
rename to docs/_posts/2024-07-15-code-w6-7.md
diff --git a/docs/_posts/2024-06-10-code-w8.md b/docs/_posts/2024-07-22-code-w8.md
similarity index 95%
rename from docs/_posts/2024-06-10-code-w8.md
rename to docs/_posts/2024-07-22-code-w8.md
index 1769704..170c53c 100644
--- a/docs/_posts/2024-06-10-code-w8.md
+++ b/docs/_posts/2024-07-22-code-w8.md
@@ -27,13 +27,13 @@ Modules directory with all nested python files:
## Accomplishment and Challenges
-* #### Analyzing the Week 3 Code for the Nested Issue
+* ### Analyzing the Week 3 Code for the Nested Issue
Dr. Jose Maria suggested in the meeting to revisit the basics and look for solutions in the internal architecture. Therefore, I recreated the issue from week 3. I wrote two codes: one where a new node is created according to dependencies and new wiring was made. However, this approach was not sustainable due to the potential complexity from multiple dependencies. I dropped that idea. The second approach was recursion-based on frontend side, aimed at getting all dependencies, but it resulted in blank dependencies. After analyzing this solution, I changed the recursion solution from the package level.
-* #### Blank dependicies issue
+* ### Blank dependicies issue
Upon deeper analyzing into PackageBlockModel and factory.tsx, I observed that I had created nested dependencies that were not present in the interface of PackageBlockModel. I modified the dependency array for every script and added internal dependencies to the respective interface and methods. The solution was close to being resolve, but I took a different approach in week 3.
-* #### Python script in modules directory issue
+* ### Python script in modules directory issue
Initially, the circuit was not building, but the Save as function was working. Due to nested dependencies, the synthesis file could not be processed. I added a recursive solution to get the nested dependencies from the frontend, which was very challenging. The files were being created but not at all levels. After debugging, I found that the issue was the missing internal dependencies at each level and the improper assignment of keys. The above images attached show the progress made this week.
## PR Created
diff --git a/docs/_posts/2024-06-10-code-w9.md b/docs/_posts/2024-07-29-code-w9.md
similarity index 95%
rename from docs/_posts/2024-06-10-code-w9.md
rename to docs/_posts/2024-07-29-code-w9.md
index 83dfe34..bb54afe 100644
--- a/docs/_posts/2024-06-10-code-w9.md
+++ b/docs/_posts/2024-07-29-code-w9.md
@@ -54,17 +54,17 @@ Output including printing at every level and code block:
## Accomplishment and Challenges
-* #### Modifying the Current Version to Support Multi Code Block Dependency
+* ### Modifying the Current Version to Support Multi Code Block Dependency
When I completed writing the entire logic, I found that multiple codes were not supported, and extra wires were created that couldn't connect. Additionally, other code blocks of inter-dependency were not included in data.json, leading to improper linkage. I modified synthesize_modules and changed the logic for adding internal blocks, so they were not treated as whole dependencies. This way, the blocks were added at one level.
-* #### Understanding Backend Processing by Creating Sample Tests
+* ### Understanding Backend Processing by Creating Sample Tests
To understand the process, I created a sample test and added blocks and wires in data.json. This helped me see how the internal file structure of the zip file works after building. I drew the whole connection and tried to replicate it by modifying synthesis.py using recursive and iterative techniques until level 1 was achieved.
-* #### Fixing the Issue of Missing Nested Blocks After Backend Processing
+* ### Fixing the Issue of Missing Nested Blocks After Backend Processing
I created the process_dependency function, which is called inside synthesize_modules. This function iterates over all blocks of a dependency and creates module Python scripts depending on the block type. Only code block type modules and block values are included in data.json. If there is a dependency inside a dependency, process_dependency is called recursively until no nested dependencies are left. This method ensures that only code blocks are included in the modules directory, while other blocks such as global input/output, dependencies, and constants are filtered out.
-* #### Writing code for filtering and mapping the wires in backend
+* ### Writing code for filtering and mapping the wires in backend
After obtaining the proper blocks in data.json, I focused on the wires. In the current version, level 1 blocks were being added to data.json, so I modified process_dependency to include every wire. There were wires for packages and global input/output, which required proper filtering and the creation of new links between the required blocks. I iterated over all wires selected from process_dependency and segregated them based on the wire's source and target block ID. After that, in another iteration, I checked each wire with the filtered blocks in data.json to determine if the block was present, adding the key pair of ob:absent. Then, I created process_wire, where all wire mappings were handled. This function contains nested iterations:
1. The first internal iteration iterates over all valid wires, checks for global input and output, and either saves the wire in a dictionary or removes the entire source-target link based on the presence of the absent value.
diff --git a/docs/_posts/2024-07-05-code-w10.md b/docs/_posts/2024-08-05-code-w10.md
similarity index 96%
rename from docs/_posts/2024-07-05-code-w10.md
rename to docs/_posts/2024-08-05-code-w10.md
index 9bc0e0b..2f4cb50 100644
--- a/docs/_posts/2024-07-05-code-w10.md
+++ b/docs/_posts/2024-08-05-code-w10.md
@@ -49,16 +49,16 @@ Single port - Multiple IN and Multiple OUT issue:
## Accomplishment and Challenges
-* #### Replicating David's FSM Circuit
+* ### Replicating David's FSM Circuit
The nested issue was opened by David around a year ago when he faced this problem while creating the FSM circuit with VC. My first goal was to recreate the nested FSM circuit. You may wonder why recreate it? The circuit was made with an earlier version, and the internal blocks will not have interdependency if I build with the older .vc3. So, I had to recreate every block and circuit. There was an issue when I ran the parameters; they were missing, so I checked with data.json and found missing parameters.
-* #### Parameter Issue in Nested Code
+* ### Parameter Issue in Nested Code
The earlier code was developed for one code block dependency, similar to nested blocks. The parameter IDs depended on the "type ID" of the dependency, but if multiple blocks are inside the dependency, this method will have the same type ID, and the parameters cannot map to the correct block. This type_ID needed to be changed in nested code. All blocks in data.json are at a single level, so the types are basic blocks. Initially, I thought to create a random alphanumeric string of 30 characters as the parameter ID. After implementing it, many issues were found, such as if parameters are used in input and output, leading to more confusion in wire mapping. Then, I implemented a new ID not dependent on type_ID, and particular wires will map with blocks, so the issue of mapping extra wires also won't occur.
-* #### Single level FSM Circuit
+* ### Single level FSM Circuit
After solving the parameters issue, I proceeded with the single-level FSM circuit. The blocks such as laser_ROS2, motor_ROS2, and screen used by David were not from the block library. Initially, it didn't work, and finding the issue took more time. After analyzing the internal code of the above blocks, they were customized. After modifying and recreating, the whole logic ran without any issue. I ran turtlebot3 in an empty world inside my local machine and ran the FSM logic with VC.
-* #### Issue in multi level FSM Circuit (Major issue)
+* ### Issue in multi level FSM Circuit (Major issue)
After running the single level, I was confident it would run with nested, but as the saying goes, things don't always go as planned. David used single port multiple OUT to different blocks and took input outside of the composed block from multiple blocks. However, I wrote for single IN - OUT, so it could not map the multiple blocks; it was taking one block and connecting to another block. This is a big issue as it requires looking again at the mapping of wires and adding conditions for such situations.
diff --git a/docs/_posts/2024-07-05-code-w11-12.md b/docs/_posts/2024-08-20-code-w11-12.md
similarity index 100%
rename from docs/_posts/2024-07-05-code-w11-12.md
rename to docs/_posts/2024-08-20-code-w11-12.md
diff --git a/docs/_posts/2024-08-25-code-w13.md b/docs/_posts/2024-08-25-code-w13.md
new file mode 100644
index 0000000..97dcd5e
--- /dev/null
+++ b/docs/_posts/2024-08-25-code-w13.md
@@ -0,0 +1,54 @@
+---
+title: "Coding Period Week 13: Aug 21 ~ Aug 26"
+categories:
+ - Blog
+permalink: /coding-week13/
+toc_label: Table of Content
+toc: true
+sidebar:
+ nav: "docs"
+---
+
+This is the final evaluation week, where ongoing and new errors were resolved, a demo video was created, and the summary report for the final evaluation of GSoC was written. New blocks, such as a generic PID and person detector, were also developed and tested by creating demo circuits. Although there are some loose ends left that I plan to address after GSoC, everything in the current version works perfectly. The remaining loose ends are additional features that need to be added.
+
+
+
+## Goals
+- [x] Develop generic PID and person detector blocks
+- [x] Test new blocks by creating demo circuits
+- [x] Refine the code and add comments
+- [ ] Resolve the issue with multiple instances of prebuilt package blocks
+- [x] Create and edit demo video for final evaluation
+- [x] Complete summary report and publish the video on youtube
+
+
+
+
+## Accomplishment and Challenges
+
+* ### Generic PID and person detector block
+ Now it's time to add some blocks. First on the list is the Generic PID. A question that might arise is why we need this if there is already a PID block. Like you, I asked this question to my mentors, and they explained that the current PID block is designed for a particular use case where the PID is applied to angular velocity, while linear velocity remains constant. This PID block cannot be used for every case, which is why a generic PID block is needed that takes the error and provides a resulting value for both linear and angular velocity, not just angular. The generic PID can be used in any application.
+
+ For the person detector block, I took reference from the Object Detector block. According to my mentor, we need a simple block that outputs an image with a selected box, indicating the detected person along with their coordinates, width, and height. Both blocks were tested by creating a demo application.
+
+ Generic PID and person detector block:
+ ![](../assets/images/thirtyseven.png)
+
+ Inside person detector block:
+ ![](../assets/images/thirtyeight.png)
+
+
+* ### Multiple Instances Issue with Prebuilt Package Block
+ This unexpected error occurred in the code for handling multiple instances from the previous week when blocks were added from the prebuilt collection block. Upon verification, it was observed that the code I wrote was correct and should work for every package block since it was running in loadPackage, which is also called in the collection block. Therefore, the issue is not with the code itself, but rather with the debugging process. It was observed that when one collection block is added, the ID changes, but when adding another identical collection block, the ID changes again, altering the previous block ID. This seems to be modifying the entire model, and the reason is still unclear but needs to be investigated further.
+
+* ### Demo video and summary report
+ Almost everything was aligned correctly for the demo video, with some loose ends that are extra features and minor unexpected errors that can be resolved in the future. Apart from that, everything is functioning as expected. It was time to create the demo video showcasing the features that will be released in v3.6. In the video, I demonstrated the state before v3.6, the modifications made in v3.6, and how to use the composed and nested block features. After verification from my mentors, I published the video on YouTube and also wrote the summary report required for the final evaluation of GSoC.
+
+ [Composed and Nested Blocks Feature Demo - v3.6](https://www.youtube.com/watch?v=xvceQL8AgQ4)
+
+
+## Final Note
+With this, my GSoC work is complete, but I believe this is just the beginning of a new chapter with JdeRobot and open source. I will continue contributing as time allows, alongside my other commitments.
+
+If you’ve been following from the beginning, thank you for reading up to week 13—I truly appreciate your time. If you started with this blog or any intermediate blog, you can read all the posts from day 0 to the present. A summary blog is also available, which covers the entire GSoC project progress. If you have any questions or comments, feel free to reach out to me through my social media handles provided in the sidebar. Again, thank you for visiting my blog and reading about my GSoC journey.
+
diff --git a/docs/_posts/2024-07-05-summary.md b/docs/_posts/2024-08-26-summary.md
similarity index 98%
rename from docs/_posts/2024-07-05-summary.md
rename to docs/_posts/2024-08-26-summary.md
index 1bf5ed1..5906092 100644
--- a/docs/_posts/2024-07-05-summary.md
+++ b/docs/_posts/2024-08-26-summary.md
@@ -25,9 +25,10 @@ This blog post will be a quick summary of what I worked on during the GSOC perio
- [Toshan Luktuke](https://github.com/toshan-luktuke)
-**Official Repository:** [VisualCircuit](https://github.com/JdeRobot/VisualCircuit/)
-**Github Issues**: [Summary](https://github.com/JdeRobot/VisualCircuit/issues?q=author%3ABkPankaj+)
-**Pull Requests:** [Summary](https://github.com/JdeRobot/VisualCircuit/pulls?q=author%3ABkPankaj+)
+**Official Repository:** [VisualCircuit](https://github.com/JdeRobot/VisualCircuit/)
+**About:** [ℹ️ Explore About](https://theroboticsclub.github.io/gsoc2024-Pankaj_Borade/About/)
+**Github Issues**: [View Issues](https://github.com/JdeRobot/VisualCircuit/issues?q=author%3ABkPankaj+)
+**Pull Requests:** [See Pull Requests](https://github.com/JdeRobot/VisualCircuit/pulls?q=author%3ABkPankaj+)
## Goals
diff --git a/docs/_site/feed.xml b/docs/_site/feed.xml
index f4ba3e5..33a7db6 100644
--- a/docs/_site/feed.xml
+++ b/docs/_site/feed.xml
@@ -1,119 +1,4 @@
-
Older version FSM single level circuit: -
- -Recreated working FSM circuit with nested code: - -
- -Output of single level: - -
- -Parameter issue: -
- -Single port - Multiple IN and Multiple OUT issue: -
- -The nested issue was opened by David around a year ago when he faced this problem while creating the FSM circuit with VC. My first goal was to recreate the nested FSM circuit. You may wonder why recreate it? The circuit was made with an earlier version, and the internal blocks will not have interdependency if I build with the older .vc3. So, I had to recreate every block and circuit. There was an issue when I ran the parameters; they were missing, so I checked with data.json and found missing parameters.
-The earlier code was developed for one code block dependency, similar to nested blocks. The parameter IDs depended on the “type ID” of the dependency, but if multiple blocks are inside the dependency, this method will have the same type ID, and the parameters cannot map to the correct block. This type_ID needed to be changed in nested code. All blocks in data.json are at a single level, so the types are basic blocks. Initially, I thought to create a random alphanumeric string of 30 characters as the parameter ID. After implementing it, many issues were found, such as if parameters are used in input and output, leading to more confusion in wire mapping. Then, I implemented a new ID not dependent on type_ID, and particular wires will map with blocks, so the issue of mapping extra wires also won’t occur.
-After solving the parameters issue, I proceeded with the single-level FSM circuit. The blocks such as laser_ROS2, motor_ROS2, and screen used by David were not from the block library. Initially, it didn’t work, and finding the issue took more time. After analyzing the internal code of the above blocks, they were customized. After modifying and recreating, the whole logic ran without any issue. I ran turtlebot3 in an empty world inside my local machine and ran the FSM logic with VC.
-After running the single level, I was confident it would run with nested, but as the saying goes, things don’t always go as planned. David used single port multiple OUT to different blocks and took input outside of the composed block from multiple blocks. However, I wrote for single IN - OUT, so it could not map the multiple blocks; it was taking one block and connecting to another block. This is a big issue as it requires looking again at the mapping of wires and adding conditions for such situations.
-Composed circuit of line follower: -
- -Internal perception composed block: -
- -Global Input Output dialog box: -
- -In the line follower demo, Dr. Jose Maria suggested using two generic PID blocks, which led to the issue of identical IDs across multiple instances. While the line follower worked with a single PID, using two PID instances is more appropriate as it minimizes errors in linear and angular velocities. The issue arose because multiple levels were converted into a single level after backend processing, resulting in identical IDs for both internal blocks, causing incorrect wire and block mapping. To resolve this, I added an extra script in the “Add as Block” function before the jsonModel.design is appended. This script iterates to modify the IDs with random IDs, and not only the block but also the design’s wire and layer block IDs need to be changed, which was achieved in this extra script.
-After solving the issue with identical IDs across multiple instances, another issue arose where, upon entering a package, the ID and internal data of the block remained the same as they were at the time of importing. This issue was due to the node layers in the editor, as the model of the editor was appended in the higher-level block stack. The code I wrote to solve the multiple instance issue involved modifying the IDs of the design model. To fix this, I added an extra iteration in the loadPackage function. In the editor, there were two objects—one for links and one for blocks—so both IDs needed to be changed along with the earlier design IDs.
-This issue occurred when David’s FSM circuit was created using the composed block feature. In David’s circuit, multiple blocks were attached to a single port. My approach was to use a queue operation to map all blocks, but there were many cases where the number of inputs and outputs was not the same, requiring the creation of extra links. The issue with equal numbers of input/output blocks was resolved using the queue approach.
-This GSoC project focuses on adding a global block composition feature, resolving nested issues, modifying the current version’s single dependency codebase to a multi-level dependency, implementing two or more demo robotics applications, expanding the block library, automating the testing of VisualCircuit and its documentation using GitHub Actions, and releasing the new version with all issue fixes.
The last 16 weeks have been an incredible and exhilarating journey filled with learning, challenges, and accomplishments. It was a great experience to work on such an exciting project, applying my web development skills to the field of Robotics, a domain I’m deeply passionate about, and learning more about both areas along the way. These past few months were exciting and memorable, with late nights, early mornings, and sometimes not sleeping at all. The joy of completing tasks is hard to describe in words (though my weekly blog attempts to capture some of that emotion).
@@ -316,183 +201,286 @@Person Detector Block testing: -
]]>To create a global test, I needed a tool that could automatically click respective options in the VisualCircuit application. I explored several technologies such as Puppeteer, Playwright, and Selenium. I chose Selenium as it is widely used for automation. I learned how Selenium works and how to use it.
-From my research, I observed that there are two ways to use Selenium with GitHub Actions: one involves the standard installation of Chrome and ChromeDriver, and the other uses the selenium/standalone-chrome Docker image. I chose the second method as it includes the latest Chrome and ChromeDriver, eliminating the need for a separate ChromeDriver. Additionally, it contains all the functionalities of the Chrome browser. Initially, the browser was not displaying correctly on the Selenium Grid, only showing the logo. To view the live action of the process, I opted for noVNC.
-After successfully running selenium/standalone-chrome on my local machine, I automated the process of clicking the menubar buttons. I needed the XPATH to locate and perform the respective actions. I found the XPATH for the File and Open buttons from the Developer Console. Below is a GIF showing the automation process of opening the browser, launching VC, and clicking the respective buttons.
-Now it’s time to add some blocks. First on the list is the Generic PID. A question that might arise is why we need this if there is already a PID block. Like you, I asked this question to my mentors, and they explained that the current PID block is designed for a particular use case where the PID is applied to angular velocity, while linear velocity remains constant. This PID block cannot be used for every case, which is why a generic PID block is needed that takes the error and provides a resulting value for both linear and angular velocity, not just angular. The generic PID can be used in any application.
-Automating clicking File and Open buttons in the Menubar:
+For the person detector block, I took reference from the Object Detector block. According to my mentor, we need a simple block that outputs an image with a selected box, indicating the detected person along with their coordinates, width, and height. Both blocks were tested by creating a demo application.
- +Generic PID and person detector block: +
-Inside person detector block: +
+The first step was to understand the issue created by David Tapiador. I researched the data flow of opening prebuilt VC projects, adding as a block, and the build options. When the project is built, the dependency section includes package and design key-value pairs. The dependencies were not included, which may be the reason for this nested issue.
+This unexpected error occurred in the code for handling multiple instances from the previous week when blocks were added from the prebuilt collection block. Upon verification, it was observed that the code I wrote was correct and should work for every package block since it was running in loadPackage, which is also called in the collection block. Therefore, the issue is not with the code itself, but rather with the debugging process. It was observed that when one collection block is added, the ID changes, but when adding another identical collection block, the ID changes again, altering the previous block ID. This seems to be modifying the entire model, and the reason is still unclear but needs to be investigated further.
For nested blocks, I modified the Dependency interface to include the interdependencies element. I also modified the package-model and converter for dependencies. Successfully, interdependencies appeared inside dependencies, but they were blank. This blank state is a great checkpoint as modifying internal structures introduced many errors. I am happy with the progress of this blank interdependencies issue.
+Almost everything was aligned correctly for the demo video, with some loose ends that are extra features and minor unexpected errors that can be resolved in the future. Apart from that, everything is functioning as expected. It was time to create the demo video showcasing the features that will be released in v3.6. In the video, I demonstrated the state before v3.6, the modifications made in v3.6, and how to use the composed and nested block features. After verification from my mentors, I published the video on YouTube and also wrote the summary report required for the final evaluation of GSoC.
+ + +Integreation of interdependencies inside dependencies:
+With this, my GSoC work is complete, but I believe this is just the beginning of a new chapter with JdeRobot and open source. I will continue contributing as time allows, alongside my other commitments.
--
+If you’ve been following from the beginning, thank you for reading up to week 13—I truly appreciate your time. If you started with this blog or any intermediate blog, you can read all the posts from day 0 to the present. A summary blog is also available, which covers the entire GSoC project progress. If you have any questions or comments, feel free to reach out to me through my social media handles provided in the sidebar. Again, thank you for visiting my blog and reading about my GSoC journey.
]]>Composed circuit of line follower: +
+ +Internal perception composed block: +
+ +Global Input Output dialog box: +
+I went through some frontend files such as menu/index.tsx
, project-info-dialog.tsx
, and editor.ts
. These files are responsible for editing the project information on the frontend side. Initially, I thought of adding Global Input Output functionality within the existing project editing interface. However, as I began implementing it, I realized that it was more difficult than anticipated since it required changing the Project Info interface in every file. Therefore, I decided to build a new dialog box that can be opened from the “Save Block” option in the menu bar.
In the line follower demo, Dr. Jose Maria suggested using two generic PID blocks, which led to the issue of identical IDs across multiple instances. While the line follower worked with a single PID, using two PID instances is more appropriate as it minimizes errors in linear and angular velocities. The issue arose because multiple levels were converted into a single level after backend processing, resulting in identical IDs for both internal blocks, causing incorrect wire and block mapping. To resolve this, I added an extra script in the “Add as Block” function before the jsonModel.design is appended. This script iterates to modify the IDs with random IDs, and not only the block but also the design’s wire and layer block IDs need to be changed, which was achieved in this extra script.
For choosing the Global Input Output, all inputs and outputs can be shown, and from there, the Global Input Output can be assigned. I created a new script for the dialog box and modified editor.ts
and menu/index.tsx
. Currently, all inputs and outputs are displayed. Next week, I will work on assigning the inputs and outputs as Global for the block.
After solving the issue with identical IDs across multiple instances, another issue arose where, upon entering a package, the ID and internal data of the block remained the same as they were at the time of importing. This issue was due to the node layers in the editor, as the model of the editor was appended in the higher-level block stack. The code I wrote to solve the multiple instance issue involved modifying the IDs of the design model. To fix this, I added an extra iteration in the loadPackage function. In the editor, there were two objects—one for links and one for blocks—so both IDs needed to be changed along with the earlier design IDs.
This issue occurred when David’s FSM circuit was created using the composed block feature. In David’s circuit, multiple blocks were attached to a single port. My approach was to use a queue operation to map all blocks, but there were many cases where the number of inputs and outputs was not the same, requiring the creation of extra links. The issue with equal numbers of input/output blocks was resolved using the queue approach.
+Checkbox for global input output - dialog box:
+Older version FSM single level circuit: +
+ +Recreated working FSM circuit with nested code: + +
+ +Output of single level: + +
+ +Parameter issue: +
+ +Single port - Multiple IN and Multiple OUT issue: +
+ +In this approach, I didn’t use node.dependencies
but instead created blocks and wires for internal dependencies. This solution was suggested by ChatGPT, so I tried it. It involved creating internal wires for dependencies and making the linkages. I spent around two days on this, but it didn’t yield the desired results. Additionally, it was suggesting editing many internal components, so I dropped this idea and returned to my nested block solution.
The nested issue was opened by David around a year ago when he faced this problem while creating the FSM circuit with VC. My first goal was to recreate the nested FSM circuit. You may wonder why recreate it? The circuit was made with an earlier version, and the internal blocks will not have interdependency if I build with the older .vc3. So, I had to recreate every block and circuit. There was an issue when I ran the parameters; they were missing, so I checked with data.json and found missing parameters.
In the previous week, I encountered blank dependencies. I noticed that the interface dependencies contained a single dependency, so I modified it to include an array and used recursive calls to add internal dependencies. Additionally, factory.tsx
had not been changed, so I modified that as well. However, the issue of blank dependencies still persists. I need to consult the mentors regarding this issue, as I feel it can be resolved with some more effort.
The earlier code was developed for one code block dependency, similar to nested blocks. The parameter IDs depended on the “type ID” of the dependency, but if multiple blocks are inside the dependency, this method will have the same type ID, and the parameters cannot map to the correct block. This type_ID needed to be changed in nested code. All blocks in data.json are at a single level, so the types are basic blocks. Initially, I thought to create a random alphanumeric string of 30 characters as the parameter ID. After implementing it, many issues were found, such as if parameters are used in input and output, leading to more confusion in wire mapping. Then, I implemented a new ID not dependent on type_ID, and particular wires will map with blocks, so the issue of mapping extra wires also won’t occur.
+After solving the parameters issue, I proceeded with the single-level FSM circuit. The blocks such as laser_ROS2, motor_ROS2, and screen used by David were not from the block library. Initially, it didn’t work, and finding the issue took more time. After analyzing the internal code of the above blocks, they were customized. After modifying and recreating, the whole logic ran without any issue. I ran turtlebot3 in an empty world inside my local machine and ran the FSM logic with VC.
+After running the single level, I was confident it would run with nested, but as the saying goes, things don’t always go as planned. David used single port multiple OUT to different blocks and took input outside of the composed block from multiple blocks. However, I wrote for single IN - OUT, so it could not map the multiple blocks; it was taking one block and connecting to another block. This is a big issue as it requires looking again at the mapping of wires and adding conditions for such situations.
Level1 Sample Circuit: +
+ +Level2 Inside test_second_block Block (nested level 1): +
+ +Level3 Inside test_first_block Block (nested level 2): +
+ +Before modification of nested issue - data.json: +
+ +After modification of nested issue - data.json: +
+ +Python Modules Scripts after processing: +
+ +Output including printing at every level and code block: +
+I first tried putting the circuit file in the Selenium Docker container through a Python script, but it wasn’t a great solution, so I decided to put the circuit file through YAML using Docker commands. After solving this, I needed to open the file from a particular directory in the file manager dialog box. For this, OS-level control was needed, so I used the pyautogui library for opening the file in Visual Circuit.
-There were many errors when building the project as the backend was running on localhost on the local machine and had to be accessed from the Docker container, resulting in fetch errors. These were resolved after modifying setting.py and .env. After that, the browser wasn’t allowing downloads as Chrome considered the HTTP frontend insecure. After some Googling and searching on StackOverflow, I found a solution. Finally, the whole process was completed automatically by Selenium. The complete process is shown in the GIF below. -Selenium based first automated global test:
+When I completed writing the entire logic, I found that multiple codes were not supported, and extra wires were created that couldn’t connect. Additionally, other code blocks of inter-dependency were not included in data.json, leading to improper linkage. I modified synthesize_modules and changed the logic for adding internal blocks, so they were not treated as whole dependencies. This way, the blocks were added at one level.
In the previous week, I was able to fetch the port data from all blocks, but it was using more iterations and not proper internal functions for fetching the data. So I improved the global input/output function and also added the submit and checklist handlers to pass data to other scripts.
-Depending on the port chosen by the user, the particular global input/output block is generated automatically. It checks the port type, and according to that, the input or output block is generated with the same name. Initially, the global input/output block position is the same as the initial position, and the links are null.
+To understand the process, I created a sample test and added blocks and wires in data.json. This helped me see how the internal file structure of the zip file works after building. I drew the whole connection and tried to replicate it by modifying synthesis.py using recursive and iterative techniques until level 1 was achieved.
I researched the internal structure of the model and tried to access the links and respective link IDs of each block. After this, I wrote down all possible cases for creating a circuit by the user. One case is where the global input/output has zero links, so one link has to be created, and the source and target assigned. Another case is that there is already a link connected with the block, so according to the port type, the particular source or target has to be removed and a new one assigned. Apart from that, there are other cases that need to be tested in the future, such as if there are two links at the same port, which one to choose. I want to ask the mentors about these cases.
+I created the process_dependency function, which is called inside synthesize_modules. This function iterates over all blocks of a dependency and creates module Python scripts depending on the block type. Only code block type modules and block values are included in data.json. If there is a dependency inside a dependency, process_dependency is called recursively until no nested dependencies are left. This method ensures that only code blocks are included in the modules directory, while other blocks such as global input/output, dependencies, and constants are filtered out.
Before generating the .vc3 composed block file, the old model has to be saved so the user can continue working on the circuit without worrying about the blocks global input/output. The model and project info are saved in the stack, and whenever the build is completed, the old model is loaded. There were constant errors, such as storing the data in the stack but it was changing with changes, as I was storing this.activModel directly in the stack, causing changes in the stack. For that, I tried several methods using deepCopy, custom functions, and cloneDeep. Both deepCopy and custom functions didn’t work, so I used the cloneDeep library, which worked without any errors. Similar to the “Save as” functionality, I used that part of the code for generating .vc3 file.
+After obtaining the proper blocks in data.json, I focused on the wires. In the current version, level 1 blocks were being added to data.json, so I modified process_dependency to include every wire. There were wires for packages and global input/output, which required proper filtering and the creation of new links between the required blocks. I iterated over all wires selected from process_dependency and segregated them based on the wire’s source and target block ID. After that, in another iteration, I checked each wire with the filtered blocks in data.json to determine if the block was present, adding the key pair of ob:absent. Then, I created process_wire, where all wire mappings were handled. This function contains nested iterations:
Normal circuit to be converted for block: -
- -Global input ouput port selection : -
+Generated block: -
+This way, new links are created, and the absent value helps the code decide whether to loop again or exit process_wire.
-Internal block structure: -
+Nested dependencies in .vc3/ .json file Level 2: +
+ +Nested dependencies in .vc3/ .json file Level 3: +
+ +Modules directory with all nested python files: +
+As discussed above, we should not have more than one link at the input port, and we need to hide input ports with internal wiring from the block composition dialog box. I modified the globalInputOutput function to segregate ports based on links and port types. In last week’s code, only code blocks were supported, so I made changes to support every block. I also observed an issue with the text being fetched from the package, which was taking a 40-character name. I modified it to take the name port from the labels of the blocks.
+Dr. Jose Maria suggested in the meeting to revisit the basics and look for solutions in the internal architecture. Therefore, I recreated the issue from week 3. I wrote two codes: one where a new node is created according to dependencies and new wiring was made. However, this approach was not sustainable due to the potential complexity from multiple dependencies. I dropped that idea. The second approach was recursion-based on frontend side, aimed at getting all dependencies, but it resulted in blank dependencies. After analyzing this solution, I changed the recursion solution from the package level.
For blocks with multiple wiring at the output side, a new link needs to be added with the respective global input/output attached. Unlike the global input block issue, this requires the parent global output block ID and the respective link ID so that the existing link is not modified. These changes were extensive and altered last week’s code, so I refined the overall code. After refinement, the entire global input/output block was tested with all cases and is working as expected.
+Upon deeper analyzing into PackageBlockModel and factory.tsx, I observed that I had created nested dependencies that were not present in the interface of PackageBlockModel. I modified the dependency array for every script and added internal dependencies to the respective interface and methods. The solution was close to being resolve, but I took a different approach in week 3.
+Initially, the circuit was not building, but the Save as function was working. Due to nested dependencies, the synthesis file could not be processed. I added a recursive solution to get the nested dependencies from the frontend, which was very challenging. The files were being created but not at all levels. After debugging, I found that the issue was the missing internal dependencies at each level and the improper assignment of keys. The above images attached show the progress made this week.
Blank script and no internal script in the modules directory issue image: -
]]>Nested dependencies in .vc3/ .json file Level 2: -
- -Nested dependencies in .vc3/ .json file Level 3: -
- -Modules directory with all nested python files: -
-Dr. Jose Maria suggested in the meeting to revisit the basics and look for solutions in the internal architecture. Therefore, I recreated the issue from week 3. I wrote two codes: one where a new node is created according to dependencies and new wiring was made. However, this approach was not sustainable due to the potential complexity from multiple dependencies. I dropped that idea. The second approach was recursion-based on frontend side, aimed at getting all dependencies, but it resulted in blank dependencies. After analyzing this solution, I changed the recursion solution from the package level.
-Upon deeper analyzing into PackageBlockModel and factory.tsx, I observed that I had created nested dependencies that were not present in the interface of PackageBlockModel. I modified the dependency array for every script and added internal dependencies to the respective interface and methods. The solution was close to being resolve, but I took a different approach in week 3.
+As discussed above, we should not have more than one link at the input port, and we need to hide input ports with internal wiring from the block composition dialog box. I modified the globalInputOutput function to segregate ports based on links and port types. In last week’s code, only code blocks were supported, so I made changes to support every block. I also observed an issue with the text being fetched from the package, which was taking a 40-character name. I modified it to take the name port from the labels of the blocks.
Initially, the circuit was not building, but the Save as function was working. Due to nested dependencies, the synthesis file could not be processed. I added a recursive solution to get the nested dependencies from the frontend, which was very challenging. The files were being created but not at all levels. After debugging, I found that the issue was the missing internal dependencies at each level and the improper assignment of keys. The above images attached show the progress made this week.
+For blocks with multiple wiring at the output side, a new link needs to be added with the respective global input/output attached. Unlike the global input block issue, this requires the parent global output block ID and the respective link ID so that the existing link is not modified. These changes were extensive and altered last week’s code, so I refined the overall code. After refinement, the entire global input/output block was tested with all cases and is working as expected.
I first tried putting the circuit file in the Selenium Docker container through a Python script, but it wasn’t a great solution, so I decided to put the circuit file through YAML using Docker commands. After solving this, I needed to open the file from a particular directory in the file manager dialog box. For this, OS-level control was needed, so I used the pyautogui library for opening the file in Visual Circuit.
+There were many errors when building the project as the backend was running on localhost on the local machine and had to be accessed from the Docker container, resulting in fetch errors. These were resolved after modifying setting.py and .env. After that, the browser wasn’t allowing downloads as Chrome considered the HTTP frontend insecure. After some Googling and searching on StackOverflow, I found a solution. Finally, the whole process was completed automatically by Selenium. The complete process is shown in the GIF below. +Selenium based first automated global test:
+Level1 Sample Circuit: -
+ -Level2 Inside test_second_block Block (nested level 1): -
+In the previous week, I was able to fetch the port data from all blocks, but it was using more iterations and not proper internal functions for fetching the data. So I improved the global input/output function and also added the submit and checklist handlers to pass data to other scripts.
+Depending on the port chosen by the user, the particular global input/output block is generated automatically. It checks the port type, and according to that, the input or output block is generated with the same name. Initially, the global input/output block position is the same as the initial position, and the links are null.
+I researched the internal structure of the model and tried to access the links and respective link IDs of each block. After this, I wrote down all possible cases for creating a circuit by the user. One case is where the global input/output has zero links, so one link has to be created, and the source and target assigned. Another case is that there is already a link connected with the block, so according to the port type, the particular source or target has to be removed and a new one assigned. Apart from that, there are other cases that need to be tested in the future, such as if there are two links at the same port, which one to choose. I want to ask the mentors about these cases.
+Before generating the .vc3 composed block file, the old model has to be saved so the user can continue working on the circuit without worrying about the blocks global input/output. The model and project info are saved in the stack, and whenever the build is completed, the old model is loaded. There were constant errors, such as storing the data in the stack but it was changing with changes, as I was storing this.activModel directly in the stack, causing changes in the stack. For that, I tried several methods using deepCopy, custom functions, and cloneDeep. Both deepCopy and custom functions didn’t work, so I used the cloneDeep library, which worked without any errors. Similar to the “Save as” functionality, I used that part of the code for generating .vc3 file.
+Level3 Inside test_first_block Block (nested level 2): -
+Normal circuit to be converted for block: +
-Before modification of nested issue - data.json: -
+Global input ouput port selection : +
-After modification of nested issue - data.json: -
+Generated block: +
-Python Modules Scripts after processing: -
+Internal block structure: +
-Output including printing at every level and code block: -
+I went through some frontend files such as menu/index.tsx
, project-info-dialog.tsx
, and editor.ts
. These files are responsible for editing the project information on the frontend side. Initially, I thought of adding Global Input Output functionality within the existing project editing interface. However, as I began implementing it, I realized that it was more difficult than anticipated since it required changing the Project Info interface in every file. Therefore, I decided to build a new dialog box that can be opened from the “Save Block” option in the menu bar.
For choosing the Global Input Output, all inputs and outputs can be shown, and from there, the Global Input Output can be assigned. I created a new script for the dialog box and modified editor.ts
and menu/index.tsx
. Currently, all inputs and outputs are displayed. Next week, I will work on assigning the inputs and outputs as Global for the block.
When I completed writing the entire logic, I found that multiple codes were not supported, and extra wires were created that couldn’t connect. Additionally, other code blocks of inter-dependency were not included in data.json, leading to improper linkage. I modified synthesize_modules and changed the logic for adding internal blocks, so they were not treated as whole dependencies. This way, the blocks were added at one level.
+Checkbox for global input output - dialog box:
+ +To understand the process, I created a sample test and added blocks and wires in data.json. This helped me see how the internal file structure of the zip file works after building. I drew the whole connection and tried to replicate it by modifying synthesis.py using recursive and iterative techniques until level 1 was achieved.
-I created the process_dependency function, which is called inside synthesize_modules. This function iterates over all blocks of a dependency and creates module Python scripts depending on the block type. Only code block type modules and block values are included in data.json. If there is a dependency inside a dependency, process_dependency is called recursively until no nested dependencies are left. This method ensures that only code blocks are included in the modules directory, while other blocks such as global input/output, dependencies, and constants are filtered out.
+In this approach, I didn’t use node.dependencies
but instead created blocks and wires for internal dependencies. This solution was suggested by ChatGPT, so I tried it. It involved creating internal wires for dependencies and making the linkages. I spent around two days on this, but it didn’t yield the desired results. Additionally, it was suggesting editing many internal components, so I dropped this idea and returned to my nested block solution.
After obtaining the proper blocks in data.json, I focused on the wires. In the current version, level 1 blocks were being added to data.json, so I modified process_dependency to include every wire. There were wires for packages and global input/output, which required proper filtering and the creation of new links between the required blocks. I iterated over all wires selected from process_dependency and segregated them based on the wire’s source and target block ID. After that, in another iteration, I checked each wire with the filtered blocks in data.json to determine if the block was present, adding the key pair of ob:absent. Then, I created process_wire, where all wire mappings were handled. This function contains nested iterations:
+In the previous week, I encountered blank dependencies. I noticed that the interface dependencies contained a single dependency, so I modified it to include an array and used recursive calls to add internal dependencies. Additionally, factory.tsx
had not been changed, so I modified that as well. However, the issue of blank dependencies still persists. I need to consult the mentors regarding this issue, as I feel it can be resolved with some more effort.
This way, new links are created, and the absent value helps the code decide whether to loop again or exit process_wire.
- -Official Repository: VisualCircuit
-Github Issues: Summary
-Pull Requests: Summary
Official Repository: VisualCircuit
+Project Summary: 🔍 Explore Summary
+About: ℹ️ Explore About
+Github Issues: View Issues
+Pull Requests: See Pull Requests
This is the final evaluation week, where ongoing and new errors were resolved, a demo video was created, and the summary report for the final evaluation of G...
+