SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
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.
TxBandSettings Bug ??
FlexRadio.TX1Enabled = false; (FlexRadio is the Radio object.)
The key line will not disable the after a band change. The second time I try to disable the key line, it will work. It will also work correctly if I wait about 30 seconds after the band change. I am thinking this is a bug.
If it is a bug, I would think logic to be applied here would be let the key line be disabled no matter what the Tx Band Settings are, and when enabling the key line, let it enable (if tx band settings allows that) and not let the key line get enabled if the TX Band Settings show it disabled.
The other issue I am having is retrieving the current TX Band settings for the radio
Here is a code snippet I have tried
List<string> _list = new List<string>();
TXBandSettings TxBandSettings = new TxBandSettings(FlexRadio, 1);
TxBandSettings.ParseStatusKeyValuePairs(_list);
The list comes back empty. I have tried 20 as the bandID (second parameter)
What is the bandID ? Is it like 20 for 20 meters or is it just sequential numbers for each band with 160 as 0 ?
If I read "TxBandSettings.IsRcaTx1Enabled" it's always false regardless of the TX Band Settings in SmartSDR, whether I do the parse function or not.
What am I doing wrong here?
73
W8RJ
Roger
Comments
-
A band change causes many internal values to switch which invokes many radio status messages to the connected clients. There is a time window where the API object value may not have the correct state / value until the radio status message is received and parsed. So when you assign FlexRadio.TX1Enabled = false; the property may not send the TCP command as the value is already false due to the logic "if (_tx1Enabled != value)". This is not a bug since the logic is in place on many object properties so we don't flood the radio with useless commands. The solution is to have a short delay before any additional settings are made when the band is changed. Additionally you can watch the Radio property changed event for "TX1Enabled" then ensure the updated value is set to what you want. There are several ways to solve this issue. 73
0 -
TX Band Settings should be collected via TX Band Settings events. Create a collection to hold the TxBandSettings objects. I chose an ObservableCollection since I utilize this collection in a WPF Window DataGrid.
private ObservableCollection<TxBandSettings> txBandSettings = new ObservableCollection<TxBandSettings>();
Before radio connection hook events for TX Settings
fradio.TxBandSettingsAdded += fradio_TxBandSettingsAdded;
fradio.TxBandSettingsRemoved += fradio_TxBandSettingsRemoved;
txBandSettings.Clear();
Before radio disconnect unhook events
fradio.TxBandSettingsAdded -= fradio_TxBandSettingsAdded;
fradio.TxBandSettingsRemoved -= fradio_TxBandSettingsRemoved;
txBandSettings.Clear();
private void fradio_TxBandSettingsRemoved(TxBandSettings tbs)
{
Util.InvokeHelper.BeginInvokeIfNeeded(this.Dispatcher, delegate
{
lock (txBandSettings)
{
TxBandSettings txb = null;
try
{
if (txBandSettings.Count > 0)
{
txb = txBandSettings.Where((tb) => { return tb.BandId == tbs.BandId; }).FirstOrDefault();
}
if (txb != null)
txBandSettings.Remove(txb);
}
catch { }
}
});
}
private void fradio_TxBandSettingsAdded(TxBandSettings tbs)
{
Util.InvokeHelper.BeginInvokeIfNeeded(this.Dispatcher, delegate
{
lock (txBandSettings)
{
TxBandSettings txb = null;
try
{
if (txBandSettings.Count > 0)
{
txb = txBandSettings.Where((tb) => { return tb.BandId == tbs.BandId; }).FirstOrDefault();
}
if (txb != null & !object.ReferenceEquals(txb, tbs))
{
txBandSettings.Remove(txb);
txb = null;
}
if (txb == null)
txBandSettings.Add(tbs);
}
catch { }
}
});
}
0 -
I appreciate what you're saying that there will be delay after a band change for everything to settle down, but waiting 20 or 30 seconds for the TX1Enabled to act correct is a bit much.
I have another piece of info. That bug only shows up when the TX Band Settings already are enabled for TX1.
Here's my code to work around the delay, which manifests another issue.
OriginalKeyLine = FlexRadio.TX1Enabled;
if (OriginalKeyLine)
{
Thread.Sleep(500);
FlexRadio.TX1Enabled = false;
int wait = 0;
while (FlexRadio.TX1Enabled && wait < 50)
{
Thread.Sleep(1000);
FlexRadio.TX1Enabled = false;
wait++;
}
RadioState.FlagInfo("Times waited: " + wait.ToString());
}
First time through it works as expected. Second time (without band change) FlexRadio.TX1Enabled (OriginalKeyLine) shows false, which in reality is enabled and shows enabled in SmartSdR TX Band Settings window.
Since I use OrginalKeyLine to set TX1Enabled after the routine, It's going to be always wrong for subsequent times I call the routine.
0 -
More info.
The TXBandSettings TX1Enable setting is applied after TxTune or MOX is set, so trying to save the TX1Enabled setting before starting the Tune operation is useless as it will change after I set TxTune.
I am working on a driver for RemoteHams.com and I need to read and set the TXBandSettings.Tx1Enabled in the currently running instance of SmartSDR.
0 -
I would never condone waiting 30 secs for anything; don't wait in a loop, watch events and correct any TX1Enables setting after an update. If you want to discuss over the phone then reach out on the via email on QRZ.0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 535 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 360 SmartSDR for Mac
- 249 SmartSDR for iOS
- 231 SmartSDR CAT
- 172 DAX
- 352 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 29 FLEX-8000 Signature Series
- 851 Maestro
- 44 FlexControl
- 847 FLEX Series (Legacy) Radios
- 798 Genius Products
- 417 Power Genius XL Amplifier
- 278 Tuner Genius XL
- 103 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 631 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 870 Third-Party Software