0

This is my implementation of this C# interface:

// Assembly location: D:\Others\PROJECTS\Strahlerdauretest\NewFirmware\FilamentEnduranceTest\dlls\Fischer.Devices.Dpp.Sdk.dll
using Filament.Standard.hightemperature;
using Filament.Standard.highvoltage;
using Fiona;
using System.Runtime.InteropServices;

#nullable disable
namespace Filament.Standard
{
  [Guid("ee59bf8b-06a4-4633-8ec6-06ad9fb1a4e2")]
  public interface IErrorCallback : IObject, IRefCountable
  {
    Status OnHvDeviation([In] HvDeviationData recordData);

    Status OnAnodeCurrentDeviation([In] DeviationTime[] recordData);

    Status OnHtDeviation([In] DeviationSeverity level);
  }
}

in Python as:

class DoErrorCallbacks(IErrorCallback):
    __namespace__ = "Filament.Standard"

    def OnHvDeviation(self, recordData):
        recordTime = recordData.timestamp
        print(f"Voltage drop begin {recordTime.day}.{recordTime.month}.{recordTime.year} {recordTime.hour}:{recordTime.minute}:{recordTime.second}.{recordTime.subseconds}")

        for seg in recordData.deviationSegments:
            if seg.category == recordData.deviationSegments.Invalid:
                break
            print(f"Category: {seg.category} Count: {seg.samplesInCategory}")

        return status.Ok

    def OnHtDeviation(self, level):
        if level == DeviationSeverity.Warning:
            print("\n-----------------------")
            print("Warning! Tube temperature reached high level.")
            print("-----------------------")
        elif level == DeviationSeverity.Critical:
            print("\n-----------------------")
            print("Error! Tube temperature reached critical level. -> Tube got disabled")
            print("-----------------------")
        return status.Ok

    def OnAnodeCurrentDeviation(self, recordData):
        recordBegin = recordData[0]
        recordEnd = recordData[1]

        print(f"\nOver current begin {recordBegin.day}.{recordBegin.month}.{recordBegin.year} {recordBegin.hour}:{recordBegin.minute}:{recordBegin.second}.{recordBegin.subseconds}")
        print(f"Over current end   {recordEnd.day}.{recordEnd.month}.{recordEnd.year} {recordEnd.hour}:{recordEnd.minute}:{recordEnd.second}.{recordEnd.subseconds}")

        return status.Ok

    def QueryInterface(self, id):
        return status.NotImplemented

I call the method:

error_callback  = DoErrorCallbacks()
self._ifilament_device.SetErrorCallback(error_callback)

and I get this error:

class DoErrorCallbacks(IErrorCallback):
TypeError: Die Methode "QueryInterface" im Typ "Filament.Standard.DoErrorCallbacks" der Assembly "Python.Runtime.Dynamic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" hat keine Implementierung.

For reference:

// Assembly location: D:\Others\PROJECTS\Strahlerdauretest\NewFirmware\FilamentEnduranceTest\dlls\FiONA.dll
using System;
using System.Runtime.InteropServices;

#nullable disable
namespace Fiona
{
  [Guid("53f23da3-51f2-4804-a315-30150216905a")]
  public interface IObject : IRefCountable
  {
    Status QueryInterface(Guid interfaceId, out object o);
  }
}
// Assembly location: D:\Others\PROJECTS\Strahlerdauretest\NewFirmware\FilamentEnduranceTest\dlls\FiONA.dll
#nullable disable
namespace Fiona
{
  public interface IRefCountable
  {
    long AddRef();

    long Release();
  }
}
3
  • stackoverflow.com/questions/49736531/… this is the reference for my code. Commented Mar 8, 2024 at 12:48
  • if don'T use __namespace__ = "Filament.Standard" in the class DoErrorCallbacks then I get same error mentioned in stackoverflow.com/questions/49736531/…. Commented Mar 8, 2024 at 12:50
  • Same code when running on RasPi , I get error as : class DoErrorCallbacks(IErrorCallback): TypeError: VTable setup of type Filament.Standard.DoErrorCallbacks failed Commented Mar 8, 2024 at 14:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.