Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
Need the latest SmartSDR, Power Genius, Tuner Genius and Antenna Genius Software?
SmartSDR v3.8.20 and the SmartSDR v3.8.20 Release Notes
SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
Power Genius XL Utility v3.8.9 and the Power Genius XL Release Notes v3.8.9
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
SmartSDR v3.8.20 and the SmartSDR v3.8.20 Release Notes
SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
Power Genius XL Utility v3.8.9 and the Power Genius XL Release Notes v3.8.9
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Panadapter OnDataReady Event
James Whiteway
Member
In Panadapter.cs I find this:
public delegate void DataReadyEventHandler(Panadapter pan, ushort[] data);
public event DataReadyEventHandler DataReady;
private void OnDataReady(Panadapter pan, ushort[] data)
{
if (DataReady != null)
DataReady(pan, data);
}
My confusion is, which of the events do I subscribe to? I thought I had it figured out and subscribed to this event first:
private void radio_panadapterDataReady(Panadapter pan, ushort data)
{
}
But, none of the code I tried within that event did anything. No return values at all.
And putting a breakpoint in the code I wrote, ( I know, I didn't list the code I tried as it did not work)
shows that the event, as far as I can tell, is not fired. No data seems to get written to the array I created. I even tried dumping the data to a file to see if anything happened. The file is never written!
Same issue with the event if I use the below subscription method:
private void DataReadyEventHandler(Panadapter pan, ushort[] data)
{
}
So, maybe, I'm using the wrong event?
james
WD5GWY
public delegate void DataReadyEventHandler(Panadapter pan, ushort[] data);
public event DataReadyEventHandler DataReady;
private void OnDataReady(Panadapter pan, ushort[] data)
{
if (DataReady != null)
DataReady(pan, data);
}
My confusion is, which of the events do I subscribe to? I thought I had it figured out and subscribed to this event first:
private void radio_panadapterDataReady(Panadapter pan, ushort data)
{
}
But, none of the code I tried within that event did anything. No return values at all.
And putting a breakpoint in the code I wrote, ( I know, I didn't list the code I tried as it did not work)
shows that the event, as far as I can tell, is not fired. No data seems to get written to the array I created. I even tried dumping the data to a file to see if anything happened. The file is never written!
Same issue with the event if I use the below subscription method:
private void DataReadyEventHandler(Panadapter pan, ushort[] data)
{
}
So, maybe, I'm using the wrong event?
james
WD5GWY
0
Answers
-
The DataReady event is definitely the right event. HOWEVER, today the radio will only support a single client running Panadapters. So if you're running a different client like SmartSDR at the same time, what will happen is that the Panadapter information you are all setup to receive will be sent to the port for the client that set the API.IsGUI (in FlexLib, or "client gui" over the wire) command. Thus, the data will never get to your application.
This is a limitation we plan to address at some point in the future to allow more than one "GUI" application.0 -
Eric, my app runs and controls the radio without SSDR running or even being on the same computer. I just never can get any response/feedback from the DataReady event, no matter which version I try from my first post. Setting a Breakpoint at the start of the event, and then running my program, the running code never breaks at the DataReady event. Which it should if it ever receives data for the panadapter. I think I have not wrote the subscription event correctly. But, I get no errors reported in Visual Studio. I have even tried writing other events incorrectly to see if intellisense catches it and it does. So, I'm at a loss as to what is missing or that I've failed to add elsewhere in my program.(oh, and isGUI is set to true in my program. Otherwisw, it would not connect and control the radio without SSDR tunning) James WD5GWY0
-
James,
1. Are you setting API.IsGUI = true? This is necessary to do any work with Panadapter or Waterfall data. Note that without setting this, you can interact with these objects (set properties like bandwidth, etc), but you will not receive the data.
2. Does the radio version match the FirmwareRequiredVersion of the API that you are using? If not, FlexLib will automatically shut off persistence assuming that the client will need to load a new version.
With those things out of the way, I don't know of a reason why you wouldn't see the DataReady event. Make sure that you have the firewall running that you have an exception for your program. As a quick test to see if this is the issue, you might just disable the firewall and run the test.0 -
1. Yes. API.isGUI= true is set. If set it to false, I cannot control the radio without SSDR running at the same time. Otherwise, everything else works fine, tuning, band changes etc. When I first start my program, it comes up in the same mode, band and other settings from the previous session. So, persistance is working as well. 2. The radio firmware was updated when I upgraded to SSDR v 1.4.11. And I am using the newest version of Flexlib as well. (updated all my References in Visual Studio to v 1.4.11 after compiling the dll's again for that version) Firewall came up the first time I ran my program with the updated dll's. Set it to allow the program to access the network and all worked as it should.(well, except for the OnDataReady event for the panadapter) Only other thing I can think of if it's not an incorrectly constructed event, is, in my other events that do work, such as the PanadapterAdded event and the SliceAdded event, I have something like this: radio_SliceAdded+= _thisRadio.SliceAdded; (Not exactly that as I am not at my computer) I have tried doing something similar in the panadapterDataReady event and could never get intellisense to allow it. Nor would it offer any hints! (it does sometimes) That could be the issue. But, I don't know where, if not in the DataReady event, it would go. james WD5GWY Thanks for your patience Eric.0
-
This may be closer to the root of the problem. You probably need a call to subscribe to the DataReady event inside the PanadapterAdded event using your handler is a parameter. This is very similar to adding the PropertyChanged handlers for that event.1
-
Thank you Eric. I suspected that was the issue. When I get back home Friday, I'll dive into it again. I'm guessing the syntax should be similar to the other events I subscribe to.(like the example I gave earlier) James WD5GWY0
Leave a Comment
Categories
- All Categories
- 260 Community Topics
- 2.1K New Ideas
- 538 The Flea Market
- 7.6K Software
- 6K SmartSDR for Windows
- 139 SmartSDR for Maestro and M models
- 368 SmartSDR for Mac
- 242 SmartSDR for iOS
- 226 SmartSDR CAT
- 175 DAX
- 345 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 45 FLEX-8000 Signature Series
- 859 Maestro
- 45 FlexControl
- 849 FLEX Series (Legacy) Radios
- 807 Genius Products
- 424 Power Genius XL Amplifier
- 280 Tuner Genius XL
- 87 Antenna Genius
- 227 Shack Infrastructure
- 153 Networking
- 410 Remote Operation (SmartLink)
- 130 Contesting
- 642 Peripherals & Station Integration
- 116 Amateur Radio Interests
- 878 Third-Party Software