-
Notifications
You must be signed in to change notification settings - Fork 810
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
feat: initialized Oscilloscope Screen #2612
base: flutter
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request initializes the Oscilloscope Screen in the Flutter app. It includes the basic layouts and integrates necessary providers for managing the board and oscilloscope states. The changes also involve updating dependencies and configuring USB device filters for Android. Class diagram for the Oscilloscope Screen componentsclassDiagram
class OscilloscopeScreen {
+build()
-setLandscapeOrientation()
}
class OscilloscopeStateProvider {
-selectedIndex: int
-yAxisScale: double
-timebaseDivisions: int
+timebaseSlider: double
+isCH1Selected: bool
+isCH2Selected: bool
+isCH3Selected: bool
+isMICSelected: bool
+initialize()
+setYAxisScale()
+setTimebaseDivisions()
+setTimebase()
+createLineBarsData()
}
class ChannelParametersWidget {
+build()
}
class TimebaseTriggerWidget {
+build()
}
class DataAnalysisWidget {
+build()
}
class XYPlotWidget {
+build()
}
class OscilloscopeGraph {
+build()
}
OscilloscopeScreen --> OscilloscopeStateProvider
OscilloscopeScreen --> ChannelParametersWidget
OscilloscopeScreen --> TimebaseTriggerWidget
OscilloscopeScreen --> DataAnalysisWidget
OscilloscopeScreen --> XYPlotWidget
OscilloscopeScreen --> OscilloscopeGraph
Class diagram for the Communication componentsclassDiagram
class ScienceLab {
+connect()
+isConnected()
+getVersion()
+captureTraces()
+fetchTrace()
+setGain()
+loadEquation()
}
class PacketHandler {
-buffer: Uint8List
-connected: bool
+getVersion()
+sendByte()
+sendInt()
+getAcknowledgement()
+getByte()
+getInt()
}
class AnalogAcquisitionChannel {
-resolution: int
-timebase: double
+length: int
+bufferIndex: int
+yAxis: List~double~
+fixValue()
+setParams()
+regenerateXAxis()
}
class DigitalChannel {
+channelName: String
+channelNumber: int
+length: int
+loadData()
+generateAxes()
}
ScienceLab --> PacketHandler
ScienceLab --> AnalogAcquisitionChannel
ScienceLab --> DigitalChannel
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
eab7d3a
to
7917e13
Compare
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/13139653631/artifacts/2535042799 |
9c12e80
to
900b663
Compare
@marcnause This PR now sets up communication with the PSLab device, and basic initialisation of the board. You should be able to see the version string when you connect to the board 🥳. |
7b72171
to
2a37948
Compare
00255a1
to
86b5191
Compare
This was my fault. I still had the UART-hack FW running on my PSLab v6. |
721fac7
to
9ef1018
Compare
Just installed the legacy firmware on my v6 device. Everything works perfectly. All these observations are pointing towards a single thing: the USB Serial driver that we are using may not properly support the MCP2200 USB-UART (CDC-ACM driver) converter that the v5 uses, the same issue which we had in our native app. |
2ff3227
to
b47cd9b
Compare
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 found some issues that need to be addressed.
Blocking issues:
- numBytesRead is never incremented in read() method (link)
Overall Comments:
- Consider adding error handling and loading states for device communication operations to improve reliability and user experience
- The signal processing algorithms would benefit from documentation explaining the mathematical approaches being used
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 1 other issue
- 🟢 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.
b47cd9b
to
d98be69
Compare
@adityastic @marcnause This PR is now ready from my side for a final review. What works
What doesn't work as of yet
These features would be added soon in upcoming PRs. Demo of the OscilloscopeScreen_recording_20250204_211716.mp4@marcnause Can you please test the Oscilloscope and confirm if it works fine ? As usual, you can use the APK from the comment pipeline. |
Slowly and steadily, we would get there 🥹.
This is currently a Work In Progress.
Initializes the Oscilloscope Screen in our flutter app.
Screenshots / Recordings
N/A
The layouts are done, functionality coming soon.
Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.@marcnause Would you like to test these layouts 😉 ?
Summary by Sourcery
Initialize the oscilloscope screen layouts.
New Features:
Tests: