private void SetupExchangeFieldNumbers() { if (null == iWlDoc) { return; } WriteLogClrTypes.IQsoCollection qsoc = iWlDoc.GetQsoCollection() as WriteLogClrTypes.IQsoCollection; string[] names = qsoc.GetColumnAdifNames(); int appWriteLogGrid = -1; for (int i = 0; i < names.Length; i++) { if (names[i] == "RST_SENT") { SentRstFieldNumber = i + 1; } else if (names[i] == "RST_RCVD") { ReceivedRstFieldNumber = i + 1; } else if (names[i] == "GRIDSQUARE") { GridSquareReceivedFieldNumber = i + 1; } else if (names[i] == "APP_WRITELOG_MYGRID") { GridSquareSentFieldNumber = i + 1; } else if (names[i] == "APP_WRITELOG_GRID") { appWriteLogGrid = i + 1; } } if (GridSquareReceivedFieldNumber <= 0) { GridSquareReceivedFieldNumber = appWriteLogGrid; } string[] titles = qsoc.GetColumnTitles(); for (int i = 0; i < titles.Length; i++) { if (titles[i].ToUpper().IndexOf("DGTL") >= 0) { DgtlFieldNumber = i + 1; break; } } #if DEBUG if (DgtlFieldNumber > 0) { iWlEntry.SetFieldN((short)DgtlFieldNumber, "FT8"); } #endif }
public void CheckDupeAndMult(string fromCall, string digitalMode, XDpack77.Pack77Message.Message rm, out bool dupeout, out short mult) { int dupe = 0; mult = 0; iWlDupingEntry.ClearEntry(); if (DgtlFieldNumber > 0) { iWlDupingEntry.SetFieldN((short)DgtlFieldNumber, digitalMode); } if (ReceivedRstFieldNumber > 0) // ClearEntry in WL defaults the RST. clear it out { iWlDupingEntry.SetFieldN((short)ReceivedRstFieldNumber, ""); } if (GridSquareReceivedFieldNumber > 0) { XDpack77.Pack77Message.Exchange hisGrid = rm as XDpack77.Pack77Message.Exchange; if (hisGrid != null && !String.IsNullOrEmpty(hisGrid.GridSquare)) { iWlDupingEntry.SetFieldN((short)GridSquareReceivedFieldNumber, hisGrid.GridSquare); } } iWlDupingEntry.Callsign = fromCall; dupe = iWlDupingEntry.Dupe(); if (dupe == 0) { mult = iWlDupingEntry.IsNewMultiplier((short)-1); if (mult <= 0 && GridSquareReceivedFieldNumber > 0) { mult = iWlDupingEntry.IsNewMultiplier((short)GridSquareReceivedFieldNumber); } } dupeout = dupe != 0; }