Skip to content

Feature #656: Add Open Data UI to Cloud Computing tab - #690

Open
ArsalanAnwer0 wants to merge 3 commits into
3C-SCSU:mainfrom
ArsalanAnwer0:feature-open-data-ui-656
Open

Feature #656: Add Open Data UI to Cloud Computing tab#690
ArsalanAnwer0 wants to merge 3 commits into
3C-SCSU:mainfrom
ArsalanAnwer0:feature-open-data-ui-656

Conversation

@ArsalanAnwer0

@ArsalanAnwer0 ArsalanAnwer0 commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Issue

Closes #656

Summary

This PR implements the UI/UX interface for the Open Data publishing procedure, integrated into the Cloud Computing tab. Users can now augment their BCI datasets by 60% through a user friendly interface that validates directory structure, shows real time progress, and provides clear success/error feedback.

Changes

Backend (opendata_api.py)

  • Created OpenDataAPI class following shuffler_api.py pattern
  • Implemented directory validation with structure checking
  • Implemented augmentation execution with output capture
  • Comprehensive error handling for common failure modes

Integration (GUI5.py)

  • Imported and initialized OpenDataAPI
  • Registered API with QML context

UI (CloudComputing.qml)

  • Added "Open Data Publishing" section below existing Upload functionality
  • Directory selection with Browse button and FolderDialog
  • Validation feedback (green checkmark or red error message)
  • Open Data button with state management:
    • Normal: Gray
    • Running: Yellow (during processing)
    • Success: Green (completed successfully)
    • Error: Red (failed)
  • Console log display (250px height, scrollable, monospace font)
  • Status text for completion feedback
  • Confirmation dialog showing:
    • Current file count
    • Estimated new files (60% increase)
    • Total after augmentation
    • Warning about in place modification
    • Operation steps

Technical Implementation

Directory Structure Expected:

parent_directory/
└── brainwaves/
    └── brainwave_rawdata_YEAR/
        ├── forward/
        ├── backward/
        ├── land/
        ├── takeoff/
        ├── right/
        └── left/

Execution Flow:

  1. User selects parent directory (contains brainwaves/)
  2. Validation checks for proper structure
  3. Confirmation dialog shows file counts
  4. User confirms operation
  5. Button turns yellow, console shows progress
  6. opendata.py executes (rename → replicate 60% → shuffle)
  7. Button turns green, status shows success

Error Handling:

  • Invalid directory structure: Red validation message
  • Missing files/permissions: Error displayed in console
  • User cancellation: No changes made
  • Script crashes: Full error shown with troubleshooting tips

Testing

  • Tested with mock directory structure (12 files)
  • Validated error handling for missing directories
  • Verified button state transitions
  • Confirmed console output display
  • Tested user cancellation flow
  • Verified integration with existing Cloud Computing UI

Files Modified

  • opendata_api.py
  • GUI5.py (4 lines added)
  • CloudComputing.qml (332 lines added)

Acceptance Criteria Met

  • New section added to Cloud Computing tab
  • Interface matches design requirements
  • Button changes to yellow during processing, green on success
  • Folder selection opens file management window
  • Console log displays opendata.py output
  • UI elements linked to backend (file-opendata)
  • Users can initiate brainwave data publishing procedure
  • Appropriate feedback during/after publishing (success/error messages)

Additional Context

This follows established patterns from FileShuffler.qml and shuffler_api.py for consistency with the existing codebase. The UI matches the Cloud Computing tab's styling and integrates seamlessly with existing functionality.

Implements OpenDataAPI class with directory validation and augmentation execution.

- validate_directory(): Pre-flight check for proper directory structure
- run_open_data(): Execute opendata.py and capture console output
- Comprehensive error handling for file/permission errors
- Cross-platform path handling (Windows/Mac/Linux)

Integration point for Issue 3C-SCSU#656 Open Data UI.
- Import OpenDataAPI
- Initialize API instance
- Register with QML engine context

Prepares backend for Cloud Computing UI integration.
Implements comprehensive UI for BCI dataset augmentation:

- Directory selection with validation feedback
- Open Data button with state management (normal/running/success/error)
- Console log display for real-time progress
- Confirmation dialog with file counts and operation details
- Integrated into existing Cloud Computing tab layout

UI Components:
- FolderDialog for directory selection
- TextArea for console output display
- Dialog for pre-execution confirmation
- Visual state indicators (color-coded buttons)

Acceptance Criteria:
- User can select parent directory containing brainwaves/
- Validation checks directory structure before execution
- Console log shows opendata.py output
- Button changes color based on execution state
- Success/error feedback displayed prominently

Closes 3C-SCSU#656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open Data: Cloud Integration

1 participant