Skip to Content
CTech Digital
  • Home
  • Odoo services
  • AI services
  • Contact us
  • 0
  • Nederlands (BE) English (UK) Français
CTech Digital
  • 0
    • Home
    • Odoo services
    • AI services
    • Contact us
  • Nederlands (BE) English (UK) Français

Working on the Leica Proxy

  • All Blogs
  • Daily blog
  • Working on the Leica Proxy
  • 30 June 2025 by
    CTech Metrology, Luc Wens

    Using the template driver as example we need to do a couple of changes

    In the main everything is fine, but for the driver I face the problem that I need to combine:

    • CTrack::Subscriber : unmanaged baseclass that keeps subscriptions
    • LMF::Tracker::Tracker : managed driver class from Leica's LMF SDK

    .. and that seems to be a problem because:

    • managed classes don't know multiple inheritance
    • you cannot add an unmanaged class as member to a managed, all members of a managed class must be managed as well
    • you cannot add a managed class as a member to an unmanaged.

    Great!

    But then, we don't need to inherit from CTrack::Subscriber, this is just a way to track and release subscriptions. We can track these subscriptions also by an external array.


    Another question mark is if we can feed a managed class instance with one of its functions to Subscribe.

    Answer is yes,...through lambda's.

    Here is an example for Hardware detection

    CLeicaLMFDriver ^ driver          = gcnew  CLeicaLMFDriver();
    msclr::gcroot<CLeicaLMFDriver ^>  driverHandle = driver;
    std::vector<CTrack::Subscription> subscriptions;
    ...
    subscriptions.emplace_back(std::move(TCPServer.GetMessageResponder()->Subscribe(
            ​TAG_COMMAND_HARDWAREDETECT,

    ​ ​[&driverHandle](const CTrack::Message &message) -> CTrack::Reply
    ​ ​{
    ​ ​ ​return driverHandle->HardwareDetect(message);
    ​ ​})));

    Explanation:

    1. Creation of managed driver class
    2. Can't pass driver as capture, so we need a handle that we can pass
    3. Keep our subscription in a separate vector
    4. Subsribe with TCPServer.GetMessageResponder, we pass the handle to the driver (remember, we can't pass a managed class) which is used to call the HardwareDetect from the driver.




    in Daily blog
    # CTrack
    Plug in design for 5G Alert
    Copyright © CTech
    Nederlands (BE) | English (UK) | Français
    Powered by Odoo - The #1 Open Source eCommerce