JdeRobot / VisualCircuit

Visual programming of robots using hardware blocks composition and Python
https://jderobot.github.io/VisualCircuit/
13 stars 14 forks source link

Issue with inputs of constant and frequency input of internal code blocks cannot convert k,M (thousands, mega) to respective value #271

Closed BkPankaj closed 8 months ago

BkPankaj commented 8 months ago

Summary:

In VisualCircuit, there is an issue where short forms of units (such as thousands, mega, milli) in input and frequency are not automatically converted when passed to JSON and subsequently to the overall output. This behavior can be considered both a feature request and an issue.

Steps to Reproduce:

  1. Set up the VisualCircuit frontend and backend for setup refer this.
  2. Run both frontend and backend with RADI.
  3. Create a simple example in the canvas. (If using a PID block, there is a need for Ki, Kp, Kd values inside for tuning. Writing 0.08 is not preferable; we often use 80m.) or (In the code internal block, in the frequency, write numbers with alphabets like k, M.)
  4. Examine the data.json generated by the build.

Expected Behavior:

The values should be automatically converted to their respective units according to the alphabet specified for each input.

Actual Behavior:

The alphabet remains unchanged in data.json and also verified inside the code after data.json, does not convert to respective value.

Screenshots:

(Width and height are not possible for large values, but they are included here for example purposes.)

Normal values with both canvas and data.json

Value in thousand just for example with both canvas and data.json

Value with alphabets like k with both canvas and data.json

BkPankaj commented 8 months ago

Hi @jmplaza , I've noticed this issue and would appreciate your verification. If it checks out, I'm eager to contribute and would be grateful if you could assign it to me.

jmplaza commented 8 months ago

Hi @BkPankaj ,

nice issue! Let @toshan-luktuke and @siddheshsingh26 also comment on it. Do you have VisualCircuit running on your machine?

There is no booking mechanism with the issues. Just work on any you are interested in and submit your PR solving it. The first working solution we receive and review will be merged into the master branch, so all the community has a better release of the project :-)

BkPankaj commented 8 months ago

Thank you for your reply, @jmplaza

Yes, I have VisualCircuit running on my machine, and all the screenshots are from my machine. I've been working on it for an hour now, but I wanted to verify this issue, so I added a comment. I understand now, and from this point forward, I will focus on working on the issue.

BkPankaj commented 8 months ago

I've created PR that is ready for review and merge. @jmplaza , could you please verify and merge the changes?

Thank you!