clj / kom2

Interface KiCad database libraries with non-ODBC systems using magic
MIT License
6 stars 1 forks source link

Crashes on MacOS when using PK as reference #3

Closed matmair closed 1 year ago

matmair commented 1 year ago

When using pk as key the pk is not rendered:

grafik

When using IPN as key the IPN is rendered as name. The part can be added in that case. Note: Only one part has an IPN set

grafik

Once I click on an item without a label KiCad goes away.

Version KiCad:

Application: KiCad Schematic Editor arm64 on arm64
Version: 7.0.5-0, release build
Libraries:
    wxWidgets 3.2.2
    FreeType 2.12.1
    HarfBuzz 5.3.1
    FontConfig 2.14.0
    libcurl/7.88.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0
Platform: macOS Ventura Version 13.4 (Build 22F66), 64 bit, Little endian, wxMac
Build Info:
    Date: May 26 2023 08:14:40
    wxWidgets: 3.2.2 (wchar_t,wx containers)
    Boost: 1.80.0
    OCC: 7.6.3
    Curl: 7.77.0
    ngspice: 38
    Compiler: Clang 13.0.0 with C++ ABI 1002
Build settings:
    KICAD_SPICE=ON

Version kom2:

[release-20230522](https://github.com/clj/kom2/releases/tag/release-20230522)
clj commented 1 year ago

Thanks for testing this!

No pk rendered when using pk as the key

I had a look at this, and it has something to do with the fact that the PK is a numeric type. Either:

I'm just trying to figure out which one it is. Looking at the KiCad code and the nanodbc code I think perhaps all data should just be returned as strings, regardless of the underlying type (int, float, string, bool).

Once I click on an item without a label (IPN) KiCad goes away.

Ideally I'd be filtering out rows without a value for the column that is being used as the 'key'. This one is difficult, without some form of config.

I don't think I can tell up front whether IPN or pk is being used as the key, this only becomes apparent when selecting individual rows. Naively removing all rows without an IPN would mean that using pk as the key no longer works. Perhaps this just needs to be something that is configured in the connection string as well.

I don't get a consistent crash from KiCad when selecting those rows, but it is still not ideal that they are being shown.

matmair commented 1 year ago

Hit me up if you need any debug info - I have no idea what might be useful for go.

clj commented 1 year ago

Thanks for offer. I was able to reproduce the issue with the missing PKs and eventually have managed to pinpoint what my ipmlemenmtation did wrong so that integers were not passed correctly to KiCad. I have a fix and will try to push that later tonight.

clj commented 1 year ago

I made a new issue #5 to track the issue of rows without an IPN