PMKS-Web / PMKSWeb

An educational web-based tool designed for comprehensive 2D linkage analysis developed at WPI (Worcester Polytechnic Institute)
https://pmksplus.com
3 stars 2 forks source link

Adjusted rpm and deg/s to rad/s #212

Open AlexG1031 opened 6 months ago

AlexG1031 commented 6 months ago

This PR resolves multiple issues:

  1. The input speed (in yellow) should always show rpm even if another unit is entered (used to have no units). This box should not allow negative numbers.
  2. The angular velocity (in red) should changed between deg/s and rad/s based on the angle unit set on the setting panel.
  3. Changing input direction should change the analysis graphs. For example angular velocity of the crank should be positive when CCW.
  4. Fix error messages caused by graph subscriptions that were not properly unsubscribed.

Screenshot 2024-02-19 at 3 20 28 PM

netlify[bot] commented 6 months ago

Deploy Preview for pmksprod ready!

Name Link
Latest commit 53a7b2fca6b7f891502645deb120595e06682149
Latest deploy log https://app.netlify.com/sites/pmksprod/deploys/65dce5ab78736d0008af899e
Deploy Preview https://deploy-preview-212--pmksprod.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

KohmeiK commented 6 months ago

The text box looks really good! One small issue I see is when you type a invalid value in, it results in the original number populated but the unit is gone. Also, any rounding is gone. Try '1dps' then 'random'. It first correctly shows 0.17 rpm but reverts to 1.6666 after

AlexG1031 commented 6 months ago

I corrected the error regarding showcasing the unit if someone types something incorrectly.

I am not 100% sure what you mean by 'reverts to 1.666 after'. From playing around with this, I think this acts how I would expect this to act.

Also, I am not sure what the error is regarding rounding. From my observation, the rounding appears to happen properly.

Do let me know if this fixes all the issues that you had found on your side.

KohmeiK commented 6 months ago

Looks great! I don't want to add more than the original spec but I noticed that the clockwise / counter clockwise doesn't switch the input speed

KohmeiK commented 6 months ago

Super close to being done! Can you make a couple minor changes?

  1. When a negative number is entered into the input box, change the value to the positive number and flip the input direction automatically. So if you have it as CCW and the user puts in -30 rpm, set the input speed to 30 rpm and change it to CW. The error message should be more clear and user-friendly. Something like: "The input speed must be positive. The input direction has been reversed."
  2. I still see the subscriber errors by loading a mechanism, opening and closing a graph, then changing the angle unit or the global (length units). I think the solution you suggested will work to fix this.
  3. Can you double check the data correctness? For example if I put in 20 rpm as the input speed, and look at the graph for the speed of the crank, I see it shown as 20 deg/sec. Instead it should be 1200 deg/sec right? It might be just be a scaling problem but can you find a way to use Jessica's Matlab script (or the old PMKS) to verify that a couple of graphs are at least in the right ballpark number? I don't want this PR to become the verification task all over again but we just need to make sure the value is no egregiously wrong