logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Populating Userfields based on Logform Radio Button
K8ZM
#1 Posted : Tuesday, August 7, 2018 2:22:00 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 523
Location: Mentor, OH

Thanks: 122 times
Was thanked: 185 time(s) in 166 post(s)
I want to auto-populate the "Rig" Userfield based off the active Rig's Radio Button.


The Rigs userdefined field is a drop-down list of (3) Rigs. I want to populate the field based on what the active radio button is when logging a QSO. LOGic knows what rig is active by which radio button is toggled at the top of the logform. So, if Rig (1) is active, I would like to have the userfield populated with the description of Rig (1) after hitting tab key to log the QSO. Is there anyway to read this ??


I can do this in other ways using IIF(), or better yet ICASE() expressions in Logform Set-Up under the Defaults tab but I'm going to do that for my Antennas and Amps. Populating the Rig is more complicated in that (2) of the (3) Rigs can share the same Antennas so I was thinking if there is a way to read the active rig maybe it could be used to trigger some form of IIF() expression.


Interested in other ways to do this instead of my manually selecting from a drop-down list....especially during a contest (hi hi). I did try my Antennas and the expression was getting pretty long, but it did work, although it did take lOGic twice as long to actually log the QSO, about 1 to 1.5 seconds.

73 de Brad
File Attachment(s):
Auto-Populate Rig Info.JPG (517kb) downloaded 67 time(s).
Sponsor
Note: We receive a commission from Amazon when you purchase via this link. It does not affect your cost. Thank you!
WN4AZY
#2 Posted : Thursday, August 9, 2018 7:35:11 AM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,093
Man
Location: Auburn, GA

Thanks: 997 times
Was thanked: 496 time(s) in 411 post(s)
Ok, I did some digging around in the code. The following expression returns the description of the currently-active rig:

global.log_form_ref.radio_ifc_ref.caption

I recommend filling out the DESCR in the rig setup. It will return what you entered plus the com port:

MY IC-746 (COM11)

You can experiment in tools/advanced/database commands.

? global.log_form_ref.radio_ifc_ref.caption

Will display the data.

Let me know if any questions.

Tnx & 73,

Dennis WN4AZY
1 user thanked WN4AZY for this useful post.
K8ZM on 8/9/2018(UTC)
K8ZM
#3 Posted : Thursday, August 9, 2018 8:30:09 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 523
Location: Mentor, OH

Thanks: 122 times
Was thanked: 185 time(s) in 166 post(s)
Dennis,

Thanks so much for looking at this!!! I'll get back with how its working.

Thanks again !!

73 de Brad
K8ZM
#4 Posted : Thursday, August 9, 2018 9:23:55 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 523
Location: Mentor, OH

Thanks: 122 times
Was thanked: 185 time(s) in 166 post(s)
Denis,

Ok, so did that and it grabbed the description....this is just "WAY TOO COOL FOR THE ROOM" !!!!. So I have a pre-existing list of valid values for (3) Rigs, one has the DESCR "IC-756ProII" and when I logged a new contact the expression returned "IC-756PROII (COM3)" as you said. Returning the com port results in a description that doesn't match my list of valid values and so the field isn't displaying what's being returned (it's in userfield as |RIG:IC-756PROII (COM3)| so it's working). I can certainly go back and change my Rig DESCR's to include the com port but was wondering if the (com port) has to be returned.

Its certainly worth it for me to change my Rig DESCR and I think I can do a mass change, or maybe better to add a new DESCR for each rig that includes the com port, that way I can avoid the mass change. Anyways don't want you expending a lot of effort on this.


Thanks, de Brad


WN4AZY
#5 Posted : Thursday, August 9, 2018 1:14:29 PM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,093
Man
Location: Auburn, GA

Thanks: 997 times
Was thanked: 496 time(s) in 411 post(s)
Quote:
I logged a new contact the expression returned "IC-756PROII (COM3)"
Well, we've always done it that way :lol:.

You can remove it easy enough:

strextract(global.log_form_ref.radio_ifc_ref.caption, "", " (", 1)

That removes everything before the open paren and the space before it. Note the space before the paren. Like this, not line the second line:

strextract(global.log_form_ref.radio_ifc_ref.caption, "", " (", 1)
strextract(global.log_form_ref.radio_ifc_ref.caption, "", "(", 1)

Can't remember if strextract() is documented in help or not. The first parameter is the string to act on. The second is the beginning delimiter (none in this case). The third is the ending delimiter. The 4th is the nth delimited item to return.

What I will do is add a simple function called Active_Rig_Descr() or something like that. We may need to so something special like handle conditions where there is no rig configured, in which chase it will return null or an empty string.

Thanks for the idea!

73,

Dennis WN4AZY
K8ZM
#6 Posted : Thursday, August 9, 2018 2:53:33 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 523
Location: Mentor, OH

Thanks: 122 times
Was thanked: 185 time(s) in 166 post(s)
Ok,

So....I used the expression. It didnt display (value didnt match anything in the drop-down list) but its in the userfield same as before so its grabbing it still ok. I'm confused and no amount of Dunkin coffee is helping me.

I'll use my IC-756ProII as the example. In Rig setup its Description is IC-756ProII, in my list of valid values its value is ICOM IC-756ProII. The way this has always worked was the value ICOM IC-756PROII got populated into the Rig userfield.

NO...WAIT, that's wrong...I'm an idiot !! That field was never populated by any means other than me picking it from a drop down list, i.e., it never had to match anything....until now. So, HA, I have to go and change my list of valid values to "match" the Rig description....DUH !! And, DUH again, it works when it matches.....

So, Dennis, you are GENIUS...PURE GENIUS !!


I need to "mass" change my Rig userfields. I thinks its Change Value under the Batch updates....wish me luck.


73 de Brad


K8ZM
#7 Posted : Thursday, August 9, 2018 3:43:20 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 523
Location: Mentor, OH

Thanks: 122 times
Was thanked: 185 time(s) in 166 post(s)
Dennis,

All is working great !! Thanks so much for taking the time to do this, your support and obvious love for what you do is what makes this the absolutely best software out there. You have a lifetime user here and I know many many others are of the same opinion. So unless some other software out there can know when my cup is empty and fill it with Dunkin Coffee I'll be sticking with LOGic !!!

Very Best Regards,

73, de Brad

PS: Need a way to edit the title in the post to add a status, like "RESOLVED" without breaking the thread.
1 user thanked K8ZM for this useful post.
WN4AZY on 8/12/2018(UTC)
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.290 seconds.