Skip to content

Commit

Permalink
added week 2,3 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BkPankaj committed Jun 17, 2024
1 parent 6426cd4 commit be562c7
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 2 deletions.
51 changes: 51 additions & 0 deletions docs/_posts/2024-06-10-code-w2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Coding Period Week 2: June 04 ~ June 10"
categories:
- Blog
permalink: /coding-week2/
toc_label: Table of Content
toc: true
sidebar:
nav: "docs"
---

Welcome to the second week of Coding Week progress. In the Monday meeting, we discussed the minimum tasks required for the midterm evaluation, reviewed the previous tasks, and assigned tasks for the next week. One of the issues in VisualCircuit is that it doesn't generate internal scripts for nested blocks. This issue prevents the creation of complex robotics applications. To address this, I will be modifying the block composition this week. Additionally, I created a basic frontend test and installation process within GitHub Actions. This week, I will work on the first global test with GitHub Actions.

## Goals
- [ ] Create first global test workflow [In Progress]
- [ ] Solve the issue of nested block [In Progress]

## Accomplishment and Challenges

* #### 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
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
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
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
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.


Integreation of interdependencies inside dependencies:

![](../assets/images/three.png)
![](../assets/images/four.png)


## Commits
1. [https://github.com/JdeRobot/VisualCircuit/commit/7ccbea013a311fe1d0af6e71408b84b3b7594f15](https://github.com/JdeRobot/VisualCircuit/commit/7ccbea013a311fe1d0af6e71408b84b3b7594f15)
2. [https://github.com/JdeRobot/VisualCircuit/commit/8ea1c0d35e1ee11f282a7407635ff899c538f34f](https://github.com/JdeRobot/VisualCircuit/commit/8ea1c0d35e1ee11f282a7407635ff899c538f34f)

## Previous PR Updates
1. Merged - [https://github.com/JdeRobot/VisualCircuit/pull/309](https://github.com/JdeRobot/VisualCircuit/pull/309)
37 changes: 37 additions & 0 deletions docs/_posts/2024-06-10-code-w3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Coding Period Week 3: June 11 ~ June 17"
categories:
- Blog
permalink: /coding-week3/
toc_label: Table of Content
toc: true
sidebar:
nav: "docs"
---

On the 10th of June, during Monday's meeting, Dr. JoseMaria explained the Global Input Output issue. Whenever the user creates a Robotics Application circuit, if it needs to generate a block, the user needs to modify the circuit, which is very time-consuming. Therefore, we need to implement the functionality for generating both the block and the circuit without modifying the circuit. This functionality will improve user performance on VC. Additionally, the tasks from the previous week were only partially completed, so they have been reassigned for this week.
## Goals
- [ ] Modification of VC block compostion for Global Input Output [In Progress]
- [ ] Create first global test workflow [In Progress]
- [ ] Solve the issue of nested block [In Progress]

## Accomplishment and Challenges

* #### 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
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
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
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
1. Merged - [https://github.com/JdeRobot/VisualCircuit-resources/pull/12](https://github.com/JdeRobot/VisualCircuit-resources/pull/12)
Loading

0 comments on commit be562c7

Please sign in to comment.