add+panadapter

  • 2
  • Question
  • Updated 3 years ago
In the PanadapterAdded event, I have the following code:


private void radio_PanadapterAdded(Panadapter pan, Waterfall fall)
        {
         
            _thisPanadapter = pan;
           _thisPanadapter.DataReady +=new Panadapter.DataReadyEventHandler(_thisPanadapter_DataReady);
           
            Console.WriteLine("radio_PanadapterAdded fired\n");
          
 
         

        }
If I put a Breakpoint at _thisPanadapter.DataReady += new Panadapter.DataReadyEventHandler(_thisPanadapter_DataReady);

And then run the app, I can connect to the radio, hear audio (WWV) and once the breakpoint is reached, I can hover the mouse pointer over _thisPanadapter.DataReady and get a nice dropdown of all the different values being sent to the radio. But, they are all static values that are set when the Panadapter is first requested. (when I connect) Things like lowdBm, highdBm, band, bandwidth, etc. are all shown correctly. But, still,  DataReady = Null ! I can see FPS and a whole slew of info.


This is the actual DataReady handler I have so far:


 private void _thisPanadapter_DataReady(Panadapter pan, ushort[] data)
        {

          

            lblData.Text = data.Length.ToString();


        }


I know it's probably a "Forest , Trees" issues, (aka Pilot error) but, what exactly I do not know for sure. I have done nothing beyond attempting to see if any data for the Panadapter that can be used for a Spectrum display, is being sent to the radio and it's always Null. So, the array data never has any length. (cannot copy what's not there!)


_thisPanadapter is defined here:


public partial class Form1 : Form
    {
         private Radio _thisRadio;
        private Slice _thisSlice;
        private Panadapter _thisPanadapter;
   


I get no errors. Just no value for DataReady.
Any "pointers" or even some examples?
(not someones full codebase, just something to use as a guideline in C Sharp)
Thanks,

james
WD5GWY

Happy 4th everyone!!!!!!!!!!!
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes

Posted 3 years ago

  • 2
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Could not setting the Size property for the Panadapter be causing my problems?
I found this in the Meta Data of Flexlib:


public Panadapter CreatePanadapter(System.Windows.Size size);

But, I'm not sure how to set the size property correctly. Or even in what portion of my code to do it. I thought I should be able to do this when I connect to the radio and Request a Panafall from the radio. But, Intellisense keeps complaining when I attempt to set the size property here:


 private void btnConnect_Click(object sender, EventArgs e)
        {

            _thisRadio.Connect();
            double freq = 10.000d;
            string RXA = "Ant 1";
            string Mode = "AM";
            //RequestPanafall gets the radio to send data to the client

            Slice Slice0 = new Slice(_thisRadio);
            Slice0 = _thisRadio.CreateSlice(freq, RXA, Mode);
        
              
         

            _thisRadio.RequestPanafall();
             Slice0.RequestSliceFromRadio();


        }


I get an error that says I cannot set the Size property before the Panafall is instantiated.
So, where to set it and what is the correct Syntax?
james
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Changed my Panadapter test program to a WPF application and managed to set the Size of the Panadapter, Since SSDR is a WPF application, it makes sense why I could not set the size of the panadapter before( my original test app is a WinForms app). BUT, still no changes to the DataReady event at all. So, that is not the issue either.

Interestingly enough (to me anyway) if I set API.IsGUI = false;
And then run SSDR, and then run my test app, the Panadapter is properly created in SSDR.
Changing   API.IsGUI=  true;
Prevents SSDR from running. The connect box shows that my radio is in use. And no Connect button appears. (expected action from reading other posts)
So, the data for the Panadapter is going somewhere, just not to my test app.!
This is turning into a real headache. I get absolutely no errors when I run the code that is "supposed" to Subscribe to the PanadapterDataReady event. BUT, it only returns Static values and nothing more. The description in the Object Browser for the event shows that "data" is a Unsigned Short and is an Array []. I should at the very least, be able to get the length of the array if it contains any values at all. As it is, and if what I have done so far is correct, ( and I think it's not correct) the array never receives any data at all.
   So, what is missing??? Is this just something I'm going to have to give up on? The perception is that Flexlib is supposed to make interacting with the radio easier. Besides me not being a super C# programmer, I would still think it could be a bit easier than it's turning out to be.
  Maybe I should switch tactics and go after the Vita data directly and parse it and use that to build
a panadapter/ panafall. (certainly worked for William) Instead of beating my head against a wall trying to find out what is happening with Flexlib. I can do everything else, (so far) but, create a working panadapter/panafall. Makes no sense at all.
james
WD5GWY

Sorry for venting. Ignore whatever I've wrote here.
 
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
I'm still open to suggestions!
:-)
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 661 Posts
  • 203 Reply Likes
James,

Sorry for the delayed response.  Lots of work following the holiday weekend.

Definitely do not give up!  It appears that you are really close.  A few comments based on the code that you have posted.  First, note that the events like the DataReady event will fire from a network thread or a processing thread and NOT the UI thread.  This means that you should not change GUI components like the label from within your handler unless you use Invoke.  The syntax is a little different depending on whether you are using Windows Forms or WPF, but the concept is the same -- you must change GUI components from the main UI thread.

I would recommend that if you are just doing debug work, compile the application in debug and use Debug.WriteLine() to output statements while running.  This should help you figure out what is working and what isn't.

Hang in there.  You're making great progress.
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Thank you Eric for the encouraging words. I won't give up. I just get a bit frustrated at times. (Old age setting in) It didn't occur to me that the label would not receive values from another thread, other than the UI.
I'll do the recompiling in debug mode with writeline statements as you suggest. I'm in California heading back to Texas. I will reattack my issues again this weekend.
james
WD5GWY
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Here's the latest listing running in Debug mode, but, using Console.WriteLine:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using System.Threading.Tasks; 
using Flex.Smoothlake.FlexLib;

namespace PanadapterTest
{
    public partial class Form1 : Form
    {
         private Radio _thisRadio;
     
      

   
        public Form1()
           
        {
            InitializeComponent();
           
            API.RadioAdded += API_RadioAdded;
            API.RadioRemoved += API_RadioRemoved;
            API.ProgramName = "PanadapterTest";
            API.IsGUI = true;
           
            API.Init();
           
           
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            CheckForIllegalCrossThreadCalls = true;        
        
        

        }


        private void API_RadioAdded(Radio radio)
        {
           
            _thisRadio = radio;

            radio.SliceAdded += radio_SliceAdded;
            radio.SliceRemoved += radio_SliceRemoved;
            radio.PanadapterAdded += radio_PanadapterAdded;
            radio.PropertyChanged += radio_PropertyChanged;
            radio.PanadapterRemoved += radio_PanadapterRemoved;
          

        }
        private void API_RadioRemoved(Radio radio)
        {

            Console.WriteLine("API_RadioRemoved fired\n");
        }

        private void radio_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {


            Console.WriteLine("radio_PropertyChanged fired\n");

        }
       

        private void radio_PanadapterRemoved(Panadapter pan)
        {
            Console.WriteLine("radio_PanadapterRemoved fired\n");
        }

        private void radio_PanadapterAdded(Panadapter pan, Waterfall fall)
        {
           
          
           
         
            Console.WriteLine("radio_PanadapterAdded fired\n");

           

           

 
         

        }
        private void panadapter_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {

           
           
           
            Console.WriteLine("panadapter_PropertyChanged fired\n");
           
            
        }

        private void radio_SliceRemoved(Slice slice)
        {
            Console.WriteLine("radio_SliceRemoved fired\n");
        }

       

        private void _thisPanadapter_DataReady(Panadapter pan, ushort[] data)
        {

            Console.WriteLine("panadapter_DataReady fired\n");

                  
        


        }
        private void radio_SliceAdded(Slice slice)
        {

          
        

            Console.WriteLine("radio_SliceAdded fired\n");
          


        }

        private void slice_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
           
            {

                Console.WriteLine("Slice_PropertyChanged fired\n");
              
            }
        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            API.CloseSession();
            _thisRadio.Disconnect();
            Application.Exit();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
           
            _thisRadio.Connect();
            double freq = 10.000d;
            string RXA = "Ant 1";
            string Mode = "AM";
            //RequestPanafall gets the radio to send data to the client

            Slice Slice0 = new Slice(_thisRadio);
            Slice0 = _thisRadio.CreateSlice(freq, RXA, Mode);

            Slice0.RequestSliceFromRadio();

           

     

       
       
        }

       
       

    }
}



Clicking the Connect button on my form tunes the radio to WWV @ 10Mhz.

Exiting the program using the Exit button get this listing from the Output window:

 
radio_PanadapterAdded fired

radio_SliceAdded fired

API_RadioRemoved fired

radio_SliceRemoved fired

radio_PanadapterRemoved fired

So, those events are being fired properly. None of the other events are fired.
I'm "assuming" that is because I am not making any changes that would cause the
other events to fire. As of yet, I have not added anything in the PanadapterAdded event to call (subscribe to) the "dataReady" event. But, I'm getting there! (ever so slowly)

I'm going to try to Subscribe to the Panadapter's DataReady event next to see if it gets called.
james
WD5GWY
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
More interesting stuff:

Putting this :

_thisPanadapter = pan;

            _thisPanadapter.DataReady +=new Panadapter.DataReadyEventHandler(_thisPanadapter_DataReady);





 in the panadapter_PropertyChanged event. Or in the

radio_PanadapterAdded event, causes a huge bunch of entries in the Output Window in Visual Studio showing that the :

radio_PropertyChanged fired

Event has fired! And that's just starting the program and clicking Connect and then once audio is heard (WWV) clicking Exit and stopping the program. Something is happening but, I'm not sure what as I have yet to see:  " _thisPanadapter.DataReady event fired" in the output window.
So, maybe, I'm getting close and maybe not. But, it's certainly fun trying!
james
WD5GWY
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Ok, got Debug going properly with Debug.WriteLine.
And I'm seeing some interesting stuff. And still getting a "Null Reference" error from Visual Studio when Subscribing to the Panadapter.DataReady event in Panadapter.cs. from within the PanadapterAdded event handler. (Eric's suggestion)
In the Immediate Window I keep seeing this:

(hope this is not too much to post, but, maybe someone will see the ERROR of MY ways here!)



A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Discovered 192.168.0.2 FLEX-6300: 1814-4020-6300-4474 (0x16CEAF69)
Radio::ParseATUStatus: Error - Invalid status (NONE)
Radio::ParseStatus: Unparsed status (S40124950|daxiq 1 pan=0x0 rate=48000 capacity=16 available=16)
ParseInterlockStatus: Error - Invalid reason ()
ParseInterlockStatus: Error - Invalid PTT Source ()
Radio::ParseATUStatus: Error - Invalid status (NONE)
ParseInterlockStatus: Error - Invalid reason ()
ParseInterlockStatus: Error - Invalid PTT Source ()
Radio::ParseATUStatus: Error - Invalid status (NONE)
Slice::UpdateIndex-Error parsing Index ()
Radio::ParseATUStatus: Error - Invalid status (NONE)
Panadapter::StatusUpdate: Key not parsed (daxiq_rate=0)
Panadapter::StatusUpdate: Key not parsed (capacity=16)
Panadapter::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (bandwidth=0.2)
Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Waterfall::StatusUpdate: Key not parsed (rxant=ANT1)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (loopa=0)
Waterfall::StatusUpdate: Key not parsed (loopb=0)
Waterfall::StatusUpdate: Key not parsed (band=34)
Waterfall::StatusUpdate: Key not parsed (daxiq=0)
Waterfall::StatusUpdate: Key not parsed (daxiq_rate=0)
Waterfall::StatusUpdate: Key not parsed (capacity=16)
Waterfall::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (xvtr=)
radio_PanadapterAdded fired

Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Panadapter::StatusUpdate: Key not parsed (daxiq_rate=0)
Panadapter::StatusUpdate: Key not parsed (capacity=16)
Panadapter::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (daxiq=0)
Waterfall::StatusUpdate: Key not parsed (daxiq_rate=0)
Waterfall::StatusUpdate: Key not parsed (capacity=16)
Waterfall::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (rxant=ANT1)
Waterfall::StatusUpdate: Key not parsed (loopa=0)
Waterfall::StatusUpdate: Key not parsed (loopb=0)
Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Radio::ParseATUStatus: Error - Invalid status (NONE)
Radio::ParseATUStatus: Error - Invalid status (NONE)
Slice::StatusUpdate: Key not parsed (dax_clients=0)
Slice::StatusUpdate: Key not parsed (dax_tx=0)
Slice::StatusUpdate: Key not parsed (record_time=0.0)
Slice::StatusUpdate: Key not parsed (diversity_parent=0)
radio_SliceAdded fired

ParseInterlockStatus: Error - Invalid PTT Source ()
Radio::ParseATUStatus: Error - Invalid status (NONE)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Radio::ParseATUStatus: Error - Invalid status (NONE)
Panadapter::StatusUpdate: Key not parsed (daxiq_rate=0)
Panadapter::StatusUpdate: Key not parsed (capacity=16)
Panadapter::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (bandwidth=0.2)
Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Waterfall::StatusUpdate: Key not parsed (rxant=ANT1)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (loopa=0)
Waterfall::StatusUpdate: Key not parsed (loopb=0)
Waterfall::StatusUpdate: Key not parsed (band=34)
Waterfall::StatusUpdate: Key not parsed (daxiq=0)
Waterfall::StatusUpdate: Key not parsed (daxiq_rate=0)
Waterfall::StatusUpdate: Key not parsed (capacity=16)
Waterfall::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (xvtr=)
radio_PanadapterAdded fired

Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Radio::ParseATUStatus: Error - Invalid status (NONE)
Slice::StatusUpdate: Key not parsed (dax_clients=0)
Slice::StatusUpdate: Key not parsed (dax_tx=0)
Slice::StatusUpdate: Key not parsed (record_time=0.0)
Slice::StatusUpdate: Key not parsed (diversity_parent=0)
radio_SliceAdded fired

Slice::StatusUpdate: Key not parsed (dax_clients=1)
Slice::StatusUpdate: Key not parsed (dax_tx=0)
Slice::StatusUpdate: Invalid key/value pair ()
Panadapter::StatusUpdate: Key not parsed (daxiq_rate=0)
Panadapter::StatusUpdate: Key not parsed (capacity=16)
Panadapter::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (bandwidth=0.2)
Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Waterfall::StatusUpdate: Key not parsed (rxant=ANT1)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (loopa=0)
Waterfall::StatusUpdate: Key not parsed (loopb=0)
Waterfall::StatusUpdate: Key not parsed (band=34)
Waterfall::StatusUpdate: Key not parsed (daxiq=0)
Waterfall::StatusUpdate: Key not parsed (daxiq_rate=0)
Waterfall::StatusUpdate: Key not parsed (capacity=16)
Waterfall::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (xvtr=)
Panadapter::StatusUpdate: Key not parsed (daxiq_rate=0)
Panadapter::StatusUpdate: Key not parsed (capacity=16)
Panadapter::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (bandwidth=0.2)
Waterfall::StatusUpdate: Key not parsed (rfgain=0)
Waterfall::StatusUpdate: Key not parsed (rxant=ANT1)
Waterfall::StatusUpdate: Key not parsed (wide=0)
Waterfall::StatusUpdate: Key not parsed (loopa=0)
Waterfall::StatusUpdate: Key not parsed (loopb=0)
Waterfall::StatusUpdate: Key not parsed (band=34)
Waterfall::StatusUpdate: Key not parsed (daxiq=0)
Waterfall::StatusUpdate: Key not parsed (daxiq_rate=0)
Waterfall::StatusUpdate: Key not parsed (capacity=16)
Waterfall::StatusUpdate: Key not parsed (available=16)
Waterfall::StatusUpdate: Key not parsed (xvtr=)
Slice::StatusUpdate: Key not parsed (dax_clients=0)
Slice::StatusUpdate: Key not parsed (dax_tx=0)
Slice::StatusUpdate: Key not parsed (record_time=0.0)
Slice::StatusUpdate: Key not parsed (diversity_parent=0)
Slice::StatusUpdate: Key not parsed (dax_clients=1)
Slice::StatusUpdate: Key not parsed (dax_tx=0)
Slice::StatusUpdate: Key not parsed (record_time=0.0)
Slice::StatusUpdate: Key not parsed (diversity_parent=0)
API_RadioRemoved fired

A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
radio_SliceRemoved fired

radio_SliceRemoved fired

radio_PanadapterRemoved fired

radio_PanadapterRemoved fired

FindOpusStream():: Opus Stream not found
FindOpusStream():: Opus Stream not found
FindOpusStream():: Opus Stream not found


Lots of things to digest and not sure what I'm looking at. I "think" the "Key not parsed" entries are related to events and static values that my program currently does not set.  I also see the same statement for some items like Band = 34, which is for 10Mhz and WWV.
Still no Panadapter Data Ready though. Should I be including the StreamID for the Panadapter in my "subscription to the DataReady event? I do not see how to add the StreamID within Flexlib. I had "assumed" that Flexlib was handling that in some manner.
Gets stranger and stranger.
james
WD5GWY
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 661 Posts
  • 203 Reply Likes
James,

You are correct.  FlexLib hides the details of having to send the StreamID along with the display.  That step is only necessary if you are using the ethernet API directly.

All of the Key not parsed outputs can be ignored.  This is just data that the radio is spitting out that FlexLib is not paying attention to.  The latest version of FlexLib source helps to suppress those.

Can you share the code you are using to subscribe to the DataReady event along with the function that it calls?

I see that the "radio_PanadapterAdded fired" shows up.
(Edited)
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
Thanks for your help Eric. The code I am using inside the PanadapterAdded event to subscribe to the PanadapterDataReady event is in my first post in this thread. As well as the event handler which (only for now) fires a Debug.Writeline.(which never gets called.) I'm on my way to Arizona at the moment.(again, I've been going there for several weeks now)
Otherwise, I would post exactly the code you wish to see here, in this post. This thread has become a bit long and probably hard to see what I'm doing. I will try to clear that up when I get home Friday.
james
WD5GWY
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
I compiled v 1.4.16 Flexlib dll's yesterday and removed the references to the previous version 1.4.11 and added references to the new dll's. I did notice a slight reduction in the Key not parsed statements. But not much.
Otherwise, no changes. I've tried to keep this test project as simple as I can to help Debugging and general clutter. Just trying to get PanadapterDataReady event to fire. That would be quit a feat right now. I feel like I need to add other settings like you mentioned earlier. (lowdBm highdBm) but that throws an error when I try to pass that to Flexlib. I try to pass them as doubles and get errors in the output window.
still learning.
james
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
I think I've beat this horse almost to death. And still no joy. I have even removed references to the Flexlib dll's that I compiled from the source code( v1.4.16) that I downloaded from the Flex website.
And copied the dll's from the SmartSDR install (v1.4.16) in Windows. And then referenced those dll's in my test project. Same results. Whenever I add:

 pan.DataReady +=new Panadapter.DataReadyEventHandler(pan_DataReady);

to the PanadapterAdded event, nothing happens. BUT, if I add a breakpoint to that line: I can put the cursor over : pan.DataReady and get a nice dropdown box showing all the Panadapter properties. Most of which are static and from the Presistance database. Others, such as the Panadapter.DataReady show NULL. Here is the code as I have it in the PanadapterAdded event:


 private void radio_PanadapterAdded(Panadapter pan, Waterfall fall)
 {
 pan.DataReady +=new Panadapter.DataReadyEventHandler(pan_DataReady); Console.WriteLine("radio_PanadapterAdded fired\n");
}
 Here is the event handler:

 void pan_DataReady(Panadapter pan, ushort[] data)
{

Console.WriteLine("PanadapterDataReady Event Fired\n");
}


(no code yet to handle the actual data, as there is no data coming in )


Output from the Debug Window:

Radio Added fired
radio_PanadapterAdded fired
 Radio Slice Added Event Fired.
 Radio Removed fired
radio_SliceRemoved fired
radio_PanadapterRemoved fired
Program ended

Every event except the DataReady event fires. (and yes, I do have :
 API.isGUI = true set)

 I even created a UDP listener in another console app and got almost the same results. So, wits end is fast approaching! I may yet have to forgo adding a panafall to my test program. If ANYONE who has used Flexlib with C# to create a panadapter/panafall, I would really like to know about it. (besides Flex Radio, as that's a given since SSDR is written in C# and uses Flexlib) NOT to ask for code, or code samples, but, just to know IF anyone has done it. William did it (not with C#) and Stu did it, (again not with C# but, with a Library he translated from Flexlib) and Walt says he has done it similar to Stu. (haven't seen it yet) So, how about all the C# programmers out there? Anyone willing to admit they have done it? Again, I'm not asking for code samples, just a "Hey, I did it" thing. Nothing more. If it's true that another C# programmer outside of Flex Radio has done it, I think I would be surprised. Walt alluded to the fact that none have in a post some time ago. So, I'm inclined to believe him. Oh, one more thing, (you knew there had to be one more!) The Dll's in SmartSDR are "smaller" in size than those compiled from the source code provided on Flex's download page. (all v 1.4.16) Kind of a mystery to me. I've compiled dll's from source code in the past from others and the compiled versions from my system matched size for size with the provider. But, not in this case. And not sure why. It probably does not have anything to do with my issues in getting data from the radio for a panadapter. Then again, it might.
 james
WD5GWY
(Edited)
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
After thinking about it more, I'm almost certain that the smaller file size is from compiling the dll's in Release mode instead of debug mode.
And I've also decided to set this part of my project aside and finish up the basic version I have working.
I feel as though no one outside of those I've mentioned previously, have actually got a panafall working. And none in C Sharp. Or, this "Community" is not like other Developer communities, including MSDN, where open sharing and helping each other, is the norm and not the exception.
It seems to me some here are here only for financial gain. Nothing wrong with that. But, as Stu probably knows by now, hams are tight fisted and will pass up a quality paid program, for a free one if a free one will do the same or less. Bugs and all.
And still demand support for the freeware.
I do appreciate all the help and advice I've received here from Eric and others. I know everyone's time is limited and valuable and I try not to waste it.
So, from now on, I'll try to keep my questions ,if I post more, brief and to the point. Otherwise, I will not post in the API Forum.
james
WD5GWY
Photo of William

William

  • 1 Post
  • 0 Reply Likes
James, I've read nearly all of your posts and they've been very helpful. It seems like you transitioned to receiving data packets from the radio, but I am still stuck on this panadapter.DataReady event not firing. Any insight into how you passed that hurdle? Thanks! 
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 661 Posts
  • 203 Reply Likes
We eventually figured out that there is a requirement to set the Size property in the Panadapter object before it will begin sending data.  This happens automatically in SmartSDR due to the way the screen size is bound to the object.  We have an issue to examine this (#2396).
Photo of James Whiteway

James Whiteway

  • 856 Posts
  • 186 Reply Likes
William, like Eric said, you will need to set the Size Property for the Panadapter before the fadio will send the Data packets to your client.
You need to do that in the PanadapterAdded event.
Pan.Size = New Windows.Size(400,200);
Or something to that effect. Once you do that, the array "data" in the PanadapterDataReady event, will be populated with values for the "Y" part of the X and Y coordnates you will need to plot the line for the Panadapter. Loop thru the array ,(I copy the contents of the "data" array into a new array) and use the Length of the array to get the X axis values.
Once thru the array, empty it and copy the next array of values and on and on. Use Invoke to call your drawing routine or you will encounter threading problems. (Your drawing routine may never get called, or you'll get a Cross Thread exception) Hope this helps, I'm on the road and this is from memory!
James
WD5GWY