Skip to content

[PcellDeclarationHelper] callback_impl & coerce_parameters_impl parameter display issue #1953

@dimchrist89

Description

@dimchrist89

Hi, Matthias.

I am using klayout v.0.29.8 and I am seeing issues with visibility parameter display. I have implemented a dummy pcell code, which triggers this behavior:

`import pya

class Foo(pya.PCellDeclarationHelper):

def __init__(self):

    super(pya.PCellDeclarationHelper, self).__init__()

    self.param( 'ListParam',
        self.TypeList,
        "ListParam",
        choices = [['Choice1', 'Choice1'], ['Choice2', 'Choice2']],
        default = 'Choice1'
    )

    self.param( 'StringParam',
        self.TypeString,
        "StringParam",
        default = 'Dummy'
    )


def coerce_parameters_impl(self):

    if self.ListParam == 'Choice2':
        self.ListParam = 'Choice1'


def callback_impl(self, name):

    self.StringParam.visible = self.ListParam.value == 'Choice1'


def produce_impl(self) -> None:

    text_obj  = pya.DText('FOO', 0, 0)
    self.cell.shapes(0).insert(text_obj)`

This issue here is that when i select 'Choice2' as a value for 'ListParam', then this value properly reverts to 'Choice1' (based on coerce_parameters_impl implementation), but 'StringParam' remains hidden, which based on callback_impl should only happen with value 'Choice2'. This may be alleviated by checking/unchecking 'Show Parameter Names' button (which I assume that triggers some state refresh).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions