-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed errors in Power Source values #2559
base: development
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThe changes fix duplicate command issues in the Power Source functionality by restructuring when power values are updated and sent to the PSLab device. The implementation separates display updates from power setting commands and moves the power setting logic to occur only when user interaction is complete. Sequence diagram for Power Source value update processsequenceDiagram
actor User
participant App
participant PSLab
User->>App: Change Power Source value
App->>App: Update display with new value
App->>PSLab: Send command to set power value
PSLab-->>App: Acknowledge command
App-->>User: Display updated value
Updated class diagram for PowerSourceActivityclassDiagram
class PowerSourceActivity {
- TextView displayPV1
- TextView displayPV2
- TextView displayPV3
- TextView displayPCS
- Croller controllerPV1
- Croller controllerPV2
- Croller controllerPV3
- Croller controllerPCS
- float voltagePV1
- float voltagePV2
- float voltagePV3
- float currentPCS
+ updatePower(TextView display, float value, Pin pin)
+ updateDisplay(TextView display, float value, Pin pin)
+ setMappedPower(Pin pin, int progress)
}
note for PowerSourceActivity "updatePower method now handles both display and power setting"
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AsCress - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/11654736125/artifacts/2138505143 |
Works much better now! I noticed that the value in the |
@marcnause Yes that has been kept intentionally by me. What are your views on this? |
I find it a tad confusing if the TextViews are not updated when the controller is changed. I guess the reason for the change was to avoid sending too many commands, right? |
@marcnause I think yes you are right. Probably, I should think about another fix for this issue rather than updating the |
Fixes #2549
Changes
Screenshots / Recordings
N/A
Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.@marcnause Could you please check and confirm if the values being set now are accurate ?
Summary by Sourcery
Bug Fixes: