HLA access to Binary/Decimal/Hexadecimal/Ascii analyzer setting

All analyzers, including HLAs, have a nice drop-down to select formatting options (Binary/Decimal/Hexadecimal/Ascii), but as far as I know, there doesn’t seem to be a (documented) way to access these settings from within an HLA. Does this already exist, or would it be a new feature request? I would like to plug into this existing selection mechanism rather than code up my own, duplicate ChoicesSetting.

I know that I asked about this at some point. I believe, that at least at that time an HLA could not get access to this.

So my HLA’s have soemthing like:

class Hla(HighLevelAnalyzer):
    # List of settings that a user can set for this High Level Analyzer.
    DisplayFormat = ChoicesSetting(
        label='Display Format',
        choices=('Dec', 'Hex')
    )

    DisplayLevel = ChoicesSetting(
        label='Outputs',
        choices=('Data', 'All')
    )

And then in the init I have:

    def __init__(self):
        '''
        Initialize HLA.
        '''
        self.base = 10 # commands choose. 
        if self.DisplayFormat == 'Hex':
            self.base = 16
        elif self.DisplayFormat == 'Dec':
            self.base = 10
        self.HCIChannelFixed = int(self.HCIChannel)

What I have not found, is if suppose I want the default to be Hex, if there is some option in the
underlying class to set the default (either value or index)

Thanks @KurtE for sharing your workaround. I do remember you and some other users requesting support for this some time ago.

@TDHolmes I don’t think we added support for respecting the radix setting for an HLA yet, however, I’m happy to dig into this and double check. It’s been awhile since I looked at this.

If my memory serves me right, the decoded bubbles above the waveform are not able to respect the radix setting for the HLA, but the data table entries might be able to.

That would be great, thanks. Ideally in my opinion, this would be exposed to the HLA like an automatically made Choices option, and then the HLA can decide how to encode their payload based on the radix setting. For example, my HLA would always decode the header the same way and format, but the payload formatting would vary based on radix