Working With Multiple Slices

  • 2
  • Question
  • Updated 5 years ago
Using FlexLib in the SmartSDR API I am experimenting with a small program as a learning exercise.  Was doing well until I started trying to control multiple slices.

If I start my app with one slice already up in SSDR, all is well, and I get displayed frequency, mode, etc.  If I add a second slice via SSDR all is still well, and my app simply switches to the new slice and shows its properties.  Changing active slices via SSDR works and the app tracks the changes. Frequency and mode changes show up OK as well.

But, I am stumped at the next step I want to take - display all current slices' properties, change those properties for each slices.  So far, I have been trying to use the FlexLib Radio.cs Radio Class' ObservableCollection<Slice> SliceList member.  Thought I could get the slice data for each slice in the list, set up local slice members, etc.  This has me going in circles (not the least part is this being the first time dealing with ObservableObject and collections of same).

Anyone already try this?  Am I making it too hard and a more obvious, direct, easier approach is
available?  Thanks for any help!

73, Tom
K1FR
Photo of K1FR

K1FR

  • 111 Posts
  • 9 Reply Likes

Posted 5 years ago

  • 2
Photo of Mark - W3II

Mark - W3II

  • 231 Posts
  • 50 Reply Likes
I am happy to help out. The Flex API component is a multi-threaded interface to the Radio. Based upon this fact you must deal with objects coming and going and events arriving on background threads. I have many questions like: Are you writing a command line, Forms or WPF application? Are you handling updates to your UI on the primary thread only? etc. So as opposed to a long back and forth exchange please send me your contact information at AA3RK (at) ARRL (dot) NET. Once we exchange ideas you can post back to this thread your resolution and observations if you like.

73,
Mark AA3RK
Photo of James Whiteway

James Whiteway

  • 1060 Posts
  • 303 Reply Likes
Having any luck Tom?
jamesWD5GWY
Photo of K1FR

K1FR

  • 111 Posts
  • 9 Reply Likes
James:  :)  Ain't computers fun??  So, I just sent you a link to the file on my Google Drive.  This should go to you as a .gmail.com.  Let me know.  73, Tom K1FR
Photo of James Whiteway

James Whiteway

  • 1060 Posts
  • 303 Reply Likes
Finally got it Tom!! And it was in my Spam Folder. I don't know what criteria Earthlink uses for their spam filters, but, that's where it put it. I tried to run it in VS2010 and it wouldn't (with Windows Vista). So, I switched to my Win7 hard drive and VS 2013 Community Edition and it loaded and ran just great! Nothing wrong with your code at all as far as I can see. In fact, it helped me see how to go about updated a textbox or label when changing frequency correctly. As it was, I would manually enter a new frequency and in SmartSDR the frequency would change, but, the textbox I created to show the current Slice frequency did not update. So, I cheated a bit and just had the update freq textbox update from the manually entered frequency. (after the Tune button on my form was clicked) A real kludge and not what needed to happen as I was not getting the feedback from the radio itself to my app.
Thanks for sharing.
james
WD5GWY
Photo of K1FR

K1FR

  • 111 Posts
  • 9 Reply Likes
James:  Glad it worked!  I am hoping to get back to tinkering with the API soon.  Problem is I will probably have to go and relearn all I thought I knew two weeks ago!  :)

73, Tom
K1FR
Photo of James Whiteway

James Whiteway

  • 1060 Posts
  • 303 Reply Likes
It seems I have to do some relearning every weekend when I get back from being out on the road! But, that makes for some fun. Today, I'm stuck at home. All the roads are iced over and the guy that owns my truck says no go! So, I get to play radio and attempt to program for an additional day! Hope my brain cells can take the extra load!  :-)
james
WD5GWY
Photo of Jay / NO5J

Jay / NO5J

  • 1674 Posts
  • 263 Reply Likes
A day is a much better thing to waste, than a mind is. Code up something I can debug and learn from. Leave the bugs in. It's more educational. If it has to be rewritten from scratch, I'll include some of your blank space and give you credit and thanks!
Jay - NO5J