Skip to content

[1669] Enable Device Info Rename button for PSOC boards - #131

Merged
hangzqcom merged 2 commits into
developfrom
fix/rename-button
Oct 26, 2026
Merged

hangzqcom merged 2 commits into
developfrom
fix/rename-button

Conversation

@hangzqcom

@hangzqcom hangzqcom commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Rename... button on the Device Info tab was permanently disabled in TACFrame.ui and had no click handler, so a connected board could not be renamed from the GUI.

Renaming a PIC32CX board through the API also silently did nothing. TACPIC32CXDriveThread::setName() validated the new name, then only waited for completion. It never sent the set-name command.

Root cause

The button was added in the initial import as a disabled placeholder with no slot connected, and was never implemented.

TACPIC32CXCommand::setName() builds the set-name command, but nothing called it. The PIC32CX drive thread skipped the send step that the PSOC drive thread performs.

Fix

Two commits.

1. Enable Device Info Rename button for PSOC boards (TACFrame.{h,cpp}; the .ui file is not touched)

  • The button is enabled only when the connected device is a PSOC board. On other boards it stays disabled, with a tooltip explaining why.
  • The click handler prompts for the new name, pre-filled with the current name.
  • It checks the name against the firmware rules: 1-32 characters, alphanumeric only. Invalid names get a warning; before this change they were rejected silently.
  • It then calls setName(), which blocks until the board replies, and refreshes the Device Name label.
  • The enable state is refreshed where the Device Info page is populated (on__tabs_tabBarClicked). setDevice() and setPlatformConfiguration() are not touched, so this does not conflict with [1589] Hide Reset Count controls unless the device supports it #130.

2. Send the set-name command from the PIC32CX drive thread (TACPIC32CXDriveThread.cpp)

  • After validation, the drive thread now sends setName through TACPIC32CXCommand, the same way the PSOC drive thread does.
  • Rename stays PSOC-only in the GUI. The PIC32CX path has no reply handling that refreshes the cached name, so the Device Name label would not update after a rename.
  • The code comment explaining the PSOC-only rule was corrected.

Testing

Before/after harness (no hardware)

  • Builds against the real TACFrame and libraries from each tree: develop 31f3d72 vs this branch.
  • Runs offscreen.
  • Uses a fake device subclass with no drive thread, so nothing is sent to hardware.
# Case develop this PR
1 No device: Rename disabled OK OK
2 PSOC device: Rename enabled WRONG OK
3 FTDI device: Rename disabled OK OK
4 FTDI device: tooltip explains why WRONG OK
5 Click handler exists WRONG OK
6 PSOC click opens the rename dialog WRONG OK
7 Valid name Bench01: no warning OK OK
8 Invalid chars bad name!: warning WRONG OK
9 33-character name: warning WRONG OK
10 Forced click on FTDI: no dialog OK OK

Result: develop gets 6 cases wrong; this PR gets 0 wrong, before and after the PIC32CX commit.

Build

  • Windows Release build of the TAC and TAC Configuration Editor targets succeeds.

Not yet tested

  • The actual write of a new name to a real PSOC or PIC32CX board was not exercised. It is a persistent write to the device, and that verification is pending.

The Rename... button on the Device Info tab was permanently disabled
and had no click handler, so a connected board could not be renamed
from the GUI.

Enable the button only when the connected device is a PSOC board,
since that is the only drive thread that implements the set-name
command; the PIC32CX, STM32 and FTDI drive threads ignore setName().
For other boards the button stays disabled with a tooltip explaining
why.

The click handler prompts for a new name, validates it against the
firmware rules (1-32 alphanumeric characters) with a clear warning
instead of the previous silent rejection, then refreshes the Device
Name label from the device.

The enable state is refreshed where the Device Info page is
populated, leaving setDevice() and setPlatformConfiguration()
untouched.

Signed-off-by: hangzqcom <hangz@qti.qualcomm.com>
TACPIC32CXDriveThread::setName() validated the new name (length,
changed, alphanumeric) and then only waited for completion; it never
sent anything, so renaming a PIC32CX board through the API silently
did nothing. TACPIC32CXCommand::setName() already builds the command
but had no caller. Send it the same way the PSOC drive thread does.

The PIC32CX path still has no reply handling that refreshes the cached
name, so the Device Info Rename button stays PSOC-only; update the
comment that claimed the other drive threads ignore setName().

Signed-off-by: hangzqcom <hangz@qti.qualcomm.com>
@hangzqcom
hangzqcom merged commit 8054ca8 into develop Oct 26, 2026
37 checks passed
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.

2 participants