Skip to content
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

Draft
wants to merge 2 commits into
base: flutter
Choose a base branch
from

Conversation

AsCress
Copy link
Collaborator

@AsCress AsCress commented Jan 17, 2025

Slowly and steadily, we would get there 🥹.
This is currently a Work In Progress.
Initializes the Oscilloscope Screen in our flutter app.

Screenshots / Recordings

Here's what we have as of now:

Screen_recording_20250118_232441.mp4

The layouts are done, functionality coming soon.

Checklist:

  • No hard coding: I have used resources from strings.xml, dimens.xml and colors.xml without hard coding any value.
  • No end of file edits: No modifications done at end of resource files strings.xml, dimens.xml or colors.xml.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • No extra space: My code does not contain any extra lines or extra spaces than the ones that are necessary.

@marcnause Would you like to test these layouts 😉 ?

@AsCress AsCress added Feature New addition to the existing app flutter labels Jan 17, 2025
@AsCress AsCress self-assigned this Jan 17, 2025
Copy link

sourcery-ai bot commented Jan 17, 2025

Reviewer's Guide by Sourcery

This PR initializes the Oscilloscope screen UI, including layouts for channel parameters, timebase/trigger settings, data analysis, and XY plotting. It also refactors the navigation drawer and application list items.

Class diagram for the Oscilloscope screen components

classDiagram
    class OscilloscopeScreen {
        +initState()
        +build()
        -_setLandscapeOrientation()
    }
    class OscilloscopeStateProvider {
        -int _selectedIndex
        +int selectedIndex
        +updateSelectedIndex(int)
    }
    class ChannelParametersWidget {
        +build()
    }
    class TimebaseTriggerWidget {
        +build()
    }
    class DataAnalysisWidget {
        +build()
    }
    class XYPlotWidget {
        +build()
    }
    class OscilloscopeScreenTabs {
        +String channelParametersImage
        +String dataAnalysisImage
        +String timebaseTriggerImage
        +String xyPlotImage
        +build()
    }
    OscilloscopeScreen --> OscilloscopeStateProvider
    OscilloscopeScreen --> ChannelParametersWidget
    OscilloscopeScreen --> TimebaseTriggerWidget
    OscilloscopeScreen --> DataAnalysisWidget
    OscilloscopeScreen --> XYPlotWidget
    OscilloscopeScreen --> OscilloscopeScreenTabs
Loading

State diagram for Oscilloscope screen tabs

stateDiagram-v2
    [*] --> Channels
    Channels --> Timebase: Tab switch
    Timebase --> DataAnalysis: Tab switch
    DataAnalysis --> XYPlot: Tab switch
    XYPlot --> Channels: Tab switch

    state Channels {
        [*] --> ChannelParameters
        ChannelParameters: CH1/CH2/CH3/MIC settings
    }

    state Timebase {
        [*] --> TimebaseTrigger
        TimebaseTrigger: Trigger and timebase settings
    }

    state DataAnalysis {
        [*] --> Analysis
        Analysis: Fourier transforms
        Analysis: Signal analysis
    }

    state XYPlot {
        [*] --> XYPlotting
        XYPlotting: XY plot configuration
    }
Loading

File-Level Changes

Change Details Files
Initialized Oscilloscope Screen UI
  • Created the Oscilloscope screen layout.
  • Added LineChart widget for displaying waveforms.
  • Integrated state management using Provider for handling tab selection and UI updates.
  • Implemented UI for channel parameters, timebase/trigger, data analysis, and XY plot.
lib/view/oscilloscope_screen.dart
Refactored Navigation
  • Updated navigation to use named routes for the Oscilloscope screen.
  • Removed index parameter from CommonScaffold.
  • Added a back button to CommonScaffold to navigate back from Oscilloscope screen.
  • Added a new MainScaffold widget to handle navigation drawer and app bar actions.
lib/view/widgets/common_scaffold_widget.dart
lib/view/instruments_screen.dart
lib/main.dart
Updated Application List Item Interactions
  • Made application list items tappable to navigate to the corresponding instrument screen.
  • Removed GestureDetector from ApplicationsListItem and added it to the ListView.builder in InstrumentsScreen.
lib/view/widgets/applications_list_item.dart
lib/view/instruments_screen.dart
Modified Navigation Drawer
  • Removed Google Fonts dependency.
  • Updated styling of navigation drawer items.
  • Added minLeadingWidth to ListTile widgets for better alignment.
lib/view/widgets/navigation_drawer.dart
Added New Widgets and Dependencies
  • Created new widgets for channel parameters, data analysis, oscilloscope tabs, timebase/trigger, and XY plot.
  • Added fl_chart and provider dependencies.
  • Created OscilloscopeStateProvider for managing state in the Oscilloscope screen.
lib/view/widgets/channel_parameters_widget.dart
lib/view/widgets/data_analysis_widget.dart
lib/view/widgets/oscilloscope_screen_tabs.dart
lib/view/widgets/timebase_trigger_widget.dart
lib/view/widgets/xyplot_widget.dart
lib/providers/OscilloscopeStateProvider.dart
pubspec.yaml
pubspec.lock
Updated gitignore
  • Updated .gitignore file to include generated files and directories.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@AsCress AsCress force-pushed the flutter_oscilloscope branch 2 times, most recently from eab7d3a to 7917e13 Compare January 17, 2025 11:35
Copy link

github-actions bot commented Jan 17, 2025

@AsCress AsCress force-pushed the flutter_oscilloscope branch from 9c12e80 to 900b663 Compare January 18, 2025 17:56
@marcnause
Copy link
Contributor

Looks good on my device!

Screenshot_20250118-234215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New addition to the existing app flutter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants