Repository navigation
COR-6291: support export and query record - #244
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Unity SimpleExample scene and script to demonstrate record export + record querying, and redesigns the message log UI into a scrollable text box.
Changes:
- Added UI controls for querying records and entering a record ID for exporting.
- Switched record export to an async flow and added a
QueryRecords(...)example using a JSON query object. - Reworked the message log UI to be scrollable (via an
InputField/ScrollRect setup) and reduced log overwrites by only syncing when the underlying plugin log changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
unity/Assets/SimpleExample.unity |
Adds new query/export-related UI elements and replaces the message log with a scrollable text field setup. |
unity/Assets/SimpleExample.cs |
Adds query/export record handlers, updates message log binding logic, and wires new UI elements into interactable-state logic. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The change still has unresolved issues that can hide query results, allow overlapping async operations, and leave the message log invisible or truncated.
4 open issues
5 resolved since last review
licenseIdis hard-coded to a placeholder value, but license IDs are typically…CheckButtonsInteractable()is called fromUpdate()and repeatedly uses… UI object namecomToogleis misspelled; since there are no code references to this name in the… Placeholder text has a typo/grammar issue (double period). Consider a clearer prompt; this is… Commented-out example assigns tomsgLogTextField, but there is no such field in this script…
Review effort: Lite
| m_AnchorMin: {x: 0, y: 0} | ||
| m_AnchorMax: {x: 0, y: 0} | ||
| m_AnchoredPosition: {x: 0, y: 0} | ||
| m_SizeDelta: {x: 0, y: 0} |
|
|
||
| try | ||
| { | ||
| List<Record> records = await _eItf.QueryRecords(query, null, 100, 0, true, true); |
| _exportRecordBtn.interactable = _eItf.IsAuthorizedOK && !_eItf.IsRecording; | ||
| _queryRecordBtn.interactable = _eItf.IsAuthorizedOK; |
| m_HorizontalOverflow: 0 | ||
| m_VerticalOverflow: 0 | ||
| m_LineSpacing: 1 |
| ### Test Notes | ||
|
|
||
| - The query uses a rolling range from the current UTC time back three months. To change the range, edit `queryStart` in `onQueryRecordBtnClick()` in `Assets/SimpleExample.cs` (for example, change the `AddMonths(-3)` value). | ||
| - The export request currently includes only EEG and MOTION and uses CSV V2; these options are not configurable from the UI. |
There was a problem hiding this comment.
@khanhle1993 , i think we should mention that not configurable from the UI but you can change at the example at function...
| - **Export Record** takes a record ID entered in the UI and calls Cortex `exportRecord` for EEG and MOTION streams in CSV V2 format. The result log reports successful and failed record IDs. | ||
| - Export is enabled after authorization and while not recording. Query is enabled after authorization. | ||
|
|
||
| ### Manual Test |
There was a problem hiding this comment.
@khanhle1993 , i think no need to mention about manual test here, i think they follow above guideline, so can query and export record
thamha-emotiv
left a comment
There was a problem hiding this comment.
@khanhle1993 tested this pull.



The PR include:
Please help to review. Thanks