Is there a downside to doing a macro expansion like this?
I've got this working and it only affects the display and not what's
transmitted. Takes advantage of unused country codes which I suppose someday
might be used..though X countries are fairly rare and calling for them even
more rare. Q would be another choice but X sounds like "Xpansion" so is a
touch more intuitive. On the other hand QA is the only Q country code and
probably less chance of collision.
CQ XH K1JT FN20 >>>> CQ FOX K1JT FN20CQ XG K1JT +05 >> CQ SPLIT K1JT +5KHZCQ XG
K1JT -01 >> CQ SPLIT K1JT -1KHZ
+void MainWindow::macroExpansion(QString& msg)
+{
+ // Let's avoid certain country codes for now
+ // See https://www.ng3k.com/Dxcc/dxcc.html
+ // These are good for now
+ // XA XB XC XD XG XH XI XJ XK XL XM XN XO XP XQ XR XS
+ msg.replace(" FD "," FIELDDAY ");
+ msg.replace(" XA "," TEST ");
+ msg.replace(" XB "," BEACON ");
+ msg.replace(" XC "," CONTEST ");
+ msg.replace(" XD "," DXPEDITION ");
+ if (msg.contains(" XG ")) {
+ msg.replace(" XG "," SPLIT ");
+ QString khz = msg.mid(0,msg.length()-1);
+ if (msg.mid(msg.length()-3)=="-") {
+ khz = "-" + khz;
+ }
+ else {
+ khz = "+" + khz;
+ }
+ msg.chop(3);
+ msg += khz + "KHZ";
+ }+ msg.replace(" XH "," FOX ");
+ msg.replace(" XM "," EMAILME ");
+ msg.replace(" XO "," 1010 ");
+ msg.replace(" XP "," QSOPARTY ");
+ msg.replace(" XS "," SOTA ");
+}
de Mike W9MDB
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel