genicam / harvesters_gui

Harvester-based GUI
Apache License 2.0
59 stars 25 forks source link

Multiple issues with GUI, not correctly shown Features/gui Elements #20

Open Halcom1979 opened 4 years ago

Halcom1979 commented 4 years ago

Hello Mr. Kazunarikudo,

i developing a GenTL Producer that is a wrapper around our Camera Software SDK. That SDK can access about multiple different Camera Families. To be honest i am absolutely Python beginner, but i already do some tests of the Producer with Halcon and Dessign Assistant (MIL) and are able to get images and set/get parameters from the devices. For automatic testing purposes i like the idea of writing scripts with phyton.

I have also implemented a Virtual Device so i don't need real camera hardware. I am able to provide that producer for testing purposes.

i have multiple issues:

The XML part is:

<Enumeration Name="PixelFormat" NameSpace="Standard">
  <ToolTip>Format of the pixels provided by the device.</ToolTip>
  <Description>Format of the pixels provided by the device. It represents all the information provided by PixelSize, PixelColorFilter combined in a single feature.</Description>
  <DisplayName>Pixel Format</DisplayName>
  <Visibility>Beginner</Visibility>
  <Streamable>Yes</Streamable>
  <EnumEntry Name="Mono8" NameSpace="Standard">
    <ToolTip>Monochrome 8-bit</ToolTip>
    <Description>Monochrome 8-bit</Description>
    <DisplayName>Mono8</DisplayName>
    <pIsImplemented>Swiss_Mono8IsImplemented</pIsImplemented>
    <Value>0x01080001</Value>
  </EnumEntry>
  <EnumEntry Name="Mono10" NameSpace="Standard">
    <ToolTip>Monochrome 10-bit</ToolTip>
    <Description>Monochrome 10-bit</Description>
    <DisplayName>Mono10</DisplayName>
    <pIsImplemented>Swiss_Mono10IsImplemented</pIsImplemented>
    <Value>0x01100003</Value>
  </EnumEntry>
  <EnumEntry Name="Mono12" NameSpace="Standard">
    <ToolTip>Monochrome 12-bit</ToolTip>
    <Description>Monochrome 12-bit</Description>
    <DisplayName>Mono12</DisplayName>
    <pIsImplemented>Swiss_Mono12IsImplemented</pIsImplemented>
    <Value>0x01100005</Value>
  </EnumEntry>
  <EnumEntry Name="Mono14" NameSpace="Standard">
    <ToolTip>Monochrome 142-bit</ToolTip>
    <Description>Monochrome 14-bit</Description>
    <DisplayName>Mono14</DisplayName>
    <pIsImplemented>Swiss_Mono14IsImplemented</pIsImplemented>
    <Value>0x01100025</Value>
  </EnumEntry>
  <EnumEntry Name="RGB8" NameSpace="Standard">
    <ToolTip>Red-Green-Blue 8-bit</ToolTip>
    <Description>Red-Green-Blue 8-bit</Description>
    <DisplayName>RGB8</DisplayName>
    <pIsImplemented>Swiss_RGB8IsImplemented</pIsImplemented>
    <Value>0x02180014</Value>
  </EnumEntry>
  <EnumEntry Name="RGB10" NameSpace="Standard">
    <ToolTip>Red-Green-Blue 10-bit</ToolTip>
    <Description>Red-Green-Blue 10-bit</Description>
    <DisplayName>RGB10</DisplayName>
    <pIsImplemented>Swiss_RGB10IsImplemented</pIsImplemented>
    <Value>0x02300018</Value>
  </EnumEntry>
  <EnumEntry Name="RGB12" NameSpace="Standard">
    <ToolTip>Red-Green-Blue 12-bit</ToolTip>
    <Description>Red-Green-Blue 12-bit</Description>
    <DisplayName>RGB12</DisplayName>
    <pIsImplemented>Swiss_RGB12IsImplemented</pIsImplemented>
    <Value>0x0230001A</Value>
  </EnumEntry>
  <EnumEntry Name="RGB14" NameSpace="Standard">
    <ToolTip>Red-Green-Blue 14-bit</ToolTip>
    <Description>Red-Green-Blue 14-bit</Description>
    <DisplayName>RGB14</DisplayName>
    <pIsImplemented>Swiss_RGB14IsImplemented</pIsImplemented>
    <Value>0x0230005E</Value>
  </EnumEntry>
  <EnumEntry Name="Coord3D&#95;ABC32f" NameSpace="Standard">
    <ToolTip>3D pixel cloud each component a float 32 bit</ToolTip>
    <Description>3D pixel cloud each component a float 32 bit</Description>
    <DisplayName>Coord3D_ABC32f</DisplayName>
    <pIsImplemented>Swiss_PointcloudIsImplemented</pIsImplemented>
    <Value>0x026000C0</Value>
  </EnumEntry>
  <pValue>Reg_PixelFormatValue</pValue>
</Enumeration>

<IntSwissKnife Name="Swiss_Mono8IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x01) = 0x01</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_Mono10IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x02) = 0x02</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_Mono12IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x04) = 0x04</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_Mono14IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x08) = 0x08</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_RGB8IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x100) = 0x100</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_RGB10IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x200) = 0x200</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_RGB12IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x400) = 0x400</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_RGB14IsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x800) = 0x800</Formula>
</IntSwissKnife>
<IntSwissKnife Name="Swiss_PointcloudIsImplemented" NameSpace="Standard">
  <Visibility>Invisible</Visibility>
  <pVariable Name="PIX_IMPL">Reg_PxTypeIsImplemented</pVariable>
  <Formula>(PIX_IMPL &amp; 0x010000) = 0x010000</Formula>
</IntSwissKnife>

Reg_PxTypeIsImplemented returned is: 0x00010005, so only Mono8, Mono10, Coord3D_ABC32f should be available. That works in Halcon, for example, correctly.

The xml that i currently implement look like:

<Enumeration Name="FirstBox" NameSpace="Custom">
  <DisplayName>Detection mode</DisplayName>
  <Visibility>Expert</Visibility>
  <pIsImplemented>Swiss_TriscanDetectionModeIsImplemented</pIsImplemented>
  <Streamable>Yes</Streamable>
  <EnumEntry Name="A" NameSpace="Custom">
    <DisplayName>A</DisplayName>
    <Value>0x1</Value>
  </EnumEntry>
  <EnumEntry Name="B" NameSpace="Custom">
    <DisplayName>B</DisplayName>
    <Value>0x2</Value>
  </EnumEntry>
  <pValue>Reg_FirstBoxValue</pValue>
</Enumeration>

<Enumeration Name="SecondBox" NameSpace="Custom">
  <DisplayName>Filter mode</DisplayName>
  <Visibility>Expert</Visibility>
  <Streamable>Yes</Streamable>
  <EnumEntry Name="A1" NameSpace="Custom">
    <DisplayName>A1</DisplayName>
    <pIsAvailable>A1IsAvailable</pIsAvailable>
    <Value>0x01</Value>
  </EnumEntry>
  <EnumEntry Name="A2" NameSpace="Custom">
    <DisplayName>A2</DisplayName>
    <pIsAvailable>A1IsAvailable</pIsAvailable>
    <Value>0x02</Value>
  </EnumEntry>
  <EnumEntry Name="B1" NameSpace="Custom">
    <DisplayName>B1</DisplayName>
    <pIsAvailable>A1IsAvailable</pIsAvailable>
    <Value>0x04</Value>
  </EnumEntry>
  <EnumEntry Name="B2" NameSpace="Custom">
    <DisplayName>B2</DisplayName>
    <pIsAvailable>A1IsAvailable</pIsAvailable>
    <Value>0x08</Value>
  </EnumEntry>
  <pValue>Reg_SecondBoxValue</pValue>
</Enumeration>
<IntSwissKnife Name="A1IsAvailable" NameSpace="Custom">
  <Visibility>Invisible</Visibility>
  <pVariable Name="IMPLEMENTED">Reg_SecondBoxAvailable</pVariable>
  <Formula>IMPLEMENTED &amp; 1 = 1</Formula>
</IntSwissKnife>
<IntSwissKnife Name="A2IsAvailable" NameSpace="Custom">
  <Visibility>Invisible</Visibility>
  <pVariable Name="IMPLEMENTED">Reg_SecondBoxAvailable</pVariable>
  <Formula>IMPLEMENTED &amp; 2 = 2</Formula>
</IntSwissKnife>
<IntSwissKnife Name="B1IsAvailable" NameSpace="Custom">
  <Visibility>Invisible</Visibility>
  <pVariable Name="IMPLEMENTED">Reg_SecondBoxAvailable</pVariable>
  <Formula>IMPLEMENTED &amp; 4 = 4</Formula>
</IntSwissKnife>
<IntSwissKnife Name="B1IsAvailable" NameSpace="Custom">
  <Visibility>Invisible</Visibility>
  <pVariable Name="IMPLEMENTED">Reg_SecondBoxAvailable</pVariable>
  <Formula>IMPLEMENTED &amp; 8 = 8</Formula>
</IntSwissKnife>

<IntReg Name="Reg_FirstBoxValue">
  <Address>0x50000520</Address>
  <Length>4</Length>
  <AccessMode>RW</AccessMode>
  <pPort>Device</pPort>
  <Sign>Unsigned</Sign>
  <Endianess>LittleEndian</Endianess>
</IntReg>

<IntReg Name="Reg_SecondBoxAvailable">
  <Address>0x5000061C</Address>
  <Length>4</Length>
  <AccessMode>RO</AccessMode>
  <pPort>Device</pPort>
  <pInvalidator>Reg_FirstBoxValue</pInvalidator>
  <Sign>Unsigned</Sign>
  <Endianess>LittleEndian</Endianess>
</IntReg>
<IntReg Name="Reg_SecondBoxValue">
  <Address>0x50000620</Address>
  <Length>4</Length>
  <AccessMode>RW</AccessMode>
  <pPort>Device</pPort>
  <pInvalidator>Reg_FirstBoxValue</pInvalidator>
  <Sign>Unsigned</Sign>
  <Endianess>LittleEndian</Endianess>
</IntReg>

That is all. Thank you for your time an effort to implement a GenICam Phyton interface.

Edit: xml is not shown correctly, github task removed, typo