Working on a Python API

  • 4
  • Question
  • Updated 3 years ago
I've had some success in using the  FlexLib API .DLLs with Python 2.7.9 and PythonDotNet (not IronPython), but have come up against two issues:

1) I am trying to set the Panadapter Band property, but it doesn't seem to work.

2) I am trying to write a callback handler for the DataReady event on the IQStream and can't figure out the parameter calling convention in Python. I have successfully written other callback routines, but I think this is the first one that passes and array of data from the C# side. No matter how I declare the Python parameters to the callback, the Python program crashes with a Python exception. It may be that the Python Dot Net add-on is not capable of handling arrays in parameter passing.

I don't think these are issues with the FlexLib API, but rather with Python Dot Net. Hopefully, someone on the forum has some experience with this.
Photo of Mark Erbaugh

Mark Erbaugh

  • 371 Posts
  • 32 Reply Likes

Posted 3 years ago

  • 4
Photo of Steve - N5AC

Steve - N5AC, VP Engineering

  • 1003 Posts
  • 965 Reply Likes
Official Response
Things operate differently with SmartSDR on Windows than with other clients because of how the GUI needs to operate.   Now that we have some folks wanting to do the same things and create GUI clients of their own, we discussed this thread and made a change today to support this.  Before calling API.Init() you will want to set IsGUI to true:
API.ProgramName = "your program";
API.IsGUI = true;
API.Init();
At this time, there will be only a single GUI allowed so you will not be able to run your application along side SmartSDR if you have used IsGUI (there can be only one).  This change has been checked into the v1.4 codebase so it will be available starting with v1.4.