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
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Studying the CAT project
I'm studying it trying to figure out the order of operations for instantiating the API objects, finding the radio, opening a panadapter and a slice.
I have a basic understanding of interfaces, events, etc., but the outline of the concrete process is eluding me as the CAT program seems to use many layers of interfaces and then dynamically generated classes, events, and function calls.
Stepping through the program I didn't even see where the debugger stepped into Slice.cs or the other Flexlib source code.
Answers
-
It seems the secret is Spring and AOP.0
-
Hi Drax,I'm not quite sure just what information you need but I'll be glad to try to answer your questions.
With respect to the CAT core itself, you are correct, Spring and AOP are the important elements in CAT. The most important part is the Spring XMLClassFactory that lets us store the definition of a particular CAT command in an external file and dynamically build CAT command classes on the fly.
In PowerSDR, all the CAT commands were individual methods, hard-coded and buried in the guts of the code. It was not particularly hard code to generate, there was just a lot of repetition. Not a real model of object oriented development :>). In the new code I can change the parameters of a CAT command by editing an XML file.
AOP is not widely used in the current CAT code though the initial plan was to use it more extensively. The main usage now is to trap and log errors that may occur during CAT class construction (CatAroundAdvice.cs). There was another interceptor, CatAfterAdvice.cs, that is no longer used (but still present in the code in case I find a use for it). It was initially used to post-process CAT commands (like adding leading zeros, etc.) but a better way was found to do that.
You statement about not seeing the debugger step into Slice.cs, etc. deserves an answer. CAT only talks to the FlexLib.API. It subscribe to API events and monitors property changes that are broadcast via those events. CAT doesn't know that radio.cs or slice.cs even exist.
I tried to add some code examples here, with more explanation, but this reflector doesn't like my format. I'll find the Help file for this thing and get back to you with more explanation. Meanwhile, if you have specific questions, I'll be glad to give the a shot.
73,
BobT, K5KDN
0 -
I never knew what Spring was until I encountered it in CAT. I was thinking it might just be some minor functionality and then it turns out to be the means. Looking through the code at first, with my unenlightened eyes, I was thinking the author was either a madman, a lover of complexity, or a pure genius. I couldn't tell. So I watched some YouTube videos on Spring last night and now I understand!
Do the API objects such as Radio.cs ever get instantiated? Or are you subscribing them to CAT command events? If I want to set the frequency of a slice where is that happening in the CAT code?
0 -
Would you email me those code examples? draxfelton@gmail.com0
-
Stand by, I'm writing a "novel" on how cat works and hope to finish it today.Short answer to you question: No, CAT only uses the API events. I have an example of how frequency is read/set in what I'm writing now.
Bob
0 -
If I understand correctly what you're asking, here's the basics of how you connect to a radio:
1. You call API.Init() in the FlexLib.dll (make sure to add a reference in your project).
2. You subscribe to the RadioAdded event. You can see examples of this in the CAT code if you search for _RadioAdded.
3. In the handler for RadioAdded, you will likely want to setup handlers for the Radio events SliceAdded, SliceRemoved, PanadapterAdded, PanadapterRemoved, etc.
4. In each of those (and probably in the Radio class), you may also want to subscribe to the PropertyChanged event so that you can keep up with which things are changing in each of the objects.
Is this what you were looking for?0 -
Exactly.0
-
Thanks. That's great learning.0
-
We'll have my "How CAT Works" write-up posted here as soon as I can figure out how to do it :>)Bob, K5KDN
0 -
OK here's a link to Bob's document: How CAT Works0
-
Thanks for the write up Bob. Very helpful, especially to someone just getting their feet wet with ideas like AOP, Dependency Injection, etc. Always thought an interceptor was just a type of military aircraft. All part of the learning experience... pretty neat.
Bill - K7UOP
0
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
- 6.9K FLEX-6000 Signature Series
- 44 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
- 409 Remote Operation (SmartLink)
- 130 Contesting
- 640 Peripherals & Station Integration
- 116 Amateur Radio Interests
- 878 Third-Party Software