Macro can't set the scope reference level on Icom: nothing sent on a receiver with a cached value, negative levels fail on the other (v3.0-beta5)

Brief summary of problem (put in title as well): Macro can’t set the scope reference level on Icom: nothing sent on a receiver with a cached value, negative levels fail on the other (v3.0-beta5)
Radio Model: Icom IC-7610
Connectivity (USB/Ethernet/Wifi/Other): Ethernet (native Icom LAN)
Operating System: Windows 10 22H2 (x64)
wfview version (press “About”): v3.0-beta5, built from source (Qt 6.10.3, MSVC 2022, x64). The same code is in v3.0-beta3, so this predates the recent macro level fixes.
Checked the wfview manual (Y/N): Y
Checked the wfview FAQ (Y/N): Y
Tried to google it (Y/N/NA): Y

What I did:

Made a macro “Test 1” with one step, Scope Ref = 0 (0 dB), and ran it with Main selected, then with Sub selected. Then changed the value to -100 (-10.0 dB; the value is in tenths of a dB, as on the Ref slider) and ran it on both again.

Expected behavior:

The selected receiver’s scope reference level changes to the macro’s value.

Observed behavior:

With Main selected, nothing happens, and every run logs:

rig: "Scope Ref" Got unknown value type "short"

With Sub selected, 0 dB works, but only by chance (see below); a negative level can’t be sent.

Cause:

A macro step that isn’t a level takes its value type from the cached value (executeMacroRadioStep() in MainController.cpp). For Scope Ref these three places disagree:

  • the Icom reply parser (icomcommander.cpp, case funcScopeRef) caches the value as short;
  • the Ref slider (ReceiverController::setRef) sends int;
  • the Icom encoder only accepts int for funcScopeRef (‘!strcmp(value.typeName(),“int”) && func == funcScopeRef’).

So on a receiver with a cached Scope Ref (here Main), the macro sends a short, which the encoder rejects, and nothing goes to the radio. On a receiver with nothing cached (here Sub), the macro falls back to uchar (the rig file’s Max is 100), which goes out through the generic one-byte path: 0 happens to be accepted as 0 dB, but negative values can’t be represented at all.

Fix (attached, J-macro-scope-ref-patch.txt, 1 commit, apply with “git am”; 2 files, +11 / -2):

  • icomcommander.cpp: cache the Scope Ref reply as int, matching the slider and the encoder.
  • MainController.cpp: macro Scope Ref steps always use int instead of guessing from the cache.
    Yaesu and Kenwood encode Scope Ref with value.toInt(), so they accept any number type and aren’t affected but given that I got this wrong on my other macro patch, please look at this carefully, since I can’t test it. It’s an Icom shop here.

Tested on my IC-7610: 0 and -100 now set 0 dB and -10.0 dB on both Main and Sub, the cache holds int -100 for both receivers, and the “unknown value type” line no longer appears.

AI disclosure: diagnosed and fixed with Claude Code (Anthropic, Claude Opus 5.5), using wfview’s MCP diagnostics (log and cache) and the source. I tested the fix on my IC-7610.

Thanks,

WD9U / Mark

J-macro-scope-ref-patch.txt (2.9 KB)