/[xlog]/xlog/src/logfile/adif.c
ViewVC logotype

Diff of /xlog/src/logfile/adif.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pa4tu, Wed Oct 20 17:34:24 2004 UTC revision 1.6 by pa4tu, Fri Oct 22 18:21:54 2004 UTC
# Line 300  static const gchar *xlog2adif_name(gint Line 300  static const gchar *xlog2adif_name(gint
300                  case GMT: return "TIME_ON";                  case GMT: return "TIME_ON";
301                  case GMTEND: return "TIME_OFF";                  case GMTEND: return "TIME_OFF";
302                  case CALL: return "CALL";                  case CALL: return "CALL";
303                  case BAND: return "FREQ";       /* or BAND ? */                  case BAND:
304                    {
305                            if (preferences.saveasadif == 0)
306                                    return "FREQ";
307                            else
308                                    return "BAND";
309                    }
310                  case MODE: return "MODE";                  case MODE: return "MODE";
311                  case POWER: return "TX_POWER";                  case POWER: return "TX_POWER";
312                  case RST: return "RST_SENT";                  case RST: return "RST_SENT";
# Line 317  static const gchar *xlog2adif_name(gint Line 323  static const gchar *xlog2adif_name(gint
323                  }                  }
324  }  }
325    
326    static gchar *freq2band (gchar *freq)
327    {
328    
329            if ((strlen(freq) == 1) || (freq[1] == '.'))
330            {
331                    if (strlen(freq) > 1) freq[1] = '\0';
332                    switch (atoi(freq))
333                    {
334                            case 1: return "160M";
335                            case 3: return "80M";
336                            case 7: return "40M";
337                    }
338            }
339            else if ((strlen(freq) == 2) || (freq[2] == '.'))
340            {
341                    if (strlen(freq) > 2) freq[2] = '\0';
342                    switch (atoi(freq))
343                    {
344                            case 10: return "30M";
345                            case 14: return "20M";
346                            case 18: return "17M";
347                            case 21: return "15M";
348                            case 24: return "12M";
349                            case 28 ... 29: return "10M";
350                            case 50 ... 54: return "6M";
351                    }
352            }
353            return "?";
354    }
355    
356  /*  /*
357   */   */
358  gint adif_qso_append(LOGDB *handle, const qso_t *q)  gint adif_qso_append(LOGDB *handle, const qso_t *q)
# Line 344  gint adif_qso_append(LOGDB *handle, cons Line 380  gint adif_qso_append(LOGDB *handle, cons
380                          qfield = date;                          qfield = date;
381                          qfield_len = 8;                          qfield_len = 8;
382                  }                  }
383                    else if (fld == BAND)
384                    {
385                            if (preferences.saveasadif == 0)
386                                    qfield = q[fld];
387                            else
388                            {
389                                    qfield = freq2band (q[fld]);
390                                    qfield_len = strlen(qfield);
391                            }
392                    }
393                  /* adif doesn't know about THROB1, THROB2, THROB4, BPSK31, QPSK31 and FELDHELL */                  /* adif doesn't know about THROB1, THROB2, THROB4, BPSK31, QPSK31 and FELDHELL */
394                  else if (fld == MODE && strlen(q[MODE]) > 5)                  else if (fld == MODE && strlen(q[MODE]) > 5)
395                  {                  {

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26