~ubuntu-branches/ubuntu/saucy/tlf/saucy

« back to all changes in this revision

Viewing changes to src/bandmap.h

  • Committer: Package Import Robot
  • Author(s): John T. Nogatch
  • Date: 2013-02-09 14:56:34 UTC
  • mfrom: (1.2.5) (3.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130209145634-de47b40lyf5ntgsu
Tags: 1.1.5-1
* Update from upstream git
* LP: #854080, #514303

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Tlf - contest logging program for amateur radio operators
 
3
 * Copyright (C) 2011 Thomas Beierlein <tb@forth-ev.de>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
 * GNU Library General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
#ifndef _BANDMAP_H
 
21
#define _BANDMAP_H
 
22
 
 
23
typedef struct {
 
24
    char        *call;  
 
25
    int         freq;   /* freq in Hz */
 
26
    char        mode;
 
27
    short       band;
 
28
    int         node;
 
29
    int         timeout;
 
30
    char        dupe;   /* only used internal in bm_show() */
 
31
} spot;
 
32
 
 
33
#define SPOT_NEW        (bm_config.livetime)
 
34
#define SPOT_NORMAL     (SPOT_NEW * 95) / 100
 
35
#define SPOT_OLD        (SPOT_NEW * 2)  / 3
 
36
 
 
37
typedef struct {
 
38
    short allband;
 
39
    short allmode;
 
40
    short showdupes;
 
41
    short skipdupes;
 
42
    short livetime;
 
43
} bm_config_t;
 
44
 
 
45
extern bm_config_t bm_config;
 
46
 
 
47
enum {
 
48
    CB_DUPE = 8,
 
49
    CB_OLD,
 
50
    CB_NORMAL,
 
51
    CB_NEW,
 
52
    CB_MULTI
 
53
};
 
54
 
 
55
void bm_init();
 
56
 
 
57
void bm_add(char *s);
 
58
 
 
59
void bm_menu();
 
60
 
 
61
/** check if call is new multi 
 
62
 *
 
63
 * \return true if new multi
 
64
 */
 
65
int bm_ismulti(char *call);
 
66
 
 
67
 
 
68
/** check if call is a dupe 
 
69
 *
 
70
 * \return true if is dupe
 
71
 */
 
72
int bm_isdupe(char *call, int band);
 
73
 
 
74
 
 
75
/** add a new spot to bandmap data 
 
76
 * \param call          the call to add
 
77
 * \param frequ         on which frequency heard
 
78
 * \param reason        - new cluster spot
 
79
 *                      - local announcement (Ctrl-A)
 
80
 *                      - own cluster announcement (Ctrl-B)
 
81
 *                      - just worked in S&P
 
82
 */
 
83
void bandmap_addspot(char *call, unsigned int frequ, char node);
 
84
/*
 
85
 * - if call already on that band and mode replace old entry with new one and
 
86
 *   set age to 0 otherwise add it to collection
 
87
 * - if other call on same frequency (with some tolerance) replace it and set
 
88
 *   age to 0
 
89
 * - round all frequencies from cluster to 100 Hz, remember all other exactly
 
90
 *   but display only rounded to 100 Hz - sort exact
 
91
 */
 
92
 
 
93
void bandmap_age();
 
94
/*
 
95
 * - go through all entries
 
96
 *   + increment age
 
97
 *   + set state to new, normal, aged or dead
 
98
 *   + if dead -> drop it from collection
 
99
 */
 
100
 
 
101
void bandmap_show();
 
102
/*
 
103
 * display depending on filter state
 
104
 * - all bands on/off
 
105
 * - all mode  on/off
 
106
 * - dupes     on/off
 
107
 *
 
108
 * If more entries to show than place in window, show around current frequency
 
109
 *
 
110
 * mark entries according to age, source and worked state. Mark new multis
 
111
 * - new        brigth blue
 
112
 * - normal     blue
 
113
 * - aged       black
 
114
 * - worked     small caps
 
115
 * - new multi  underlined
 
116
 * - self announced stations
 
117
 *              small preceeding letter for repoting station
 
118
 *
 
119
 * maybe show own frequency as dashline in other color 
 
120
 * (maybee green highlighted)
 
121
 * - highligth actual spot if near its frequency 
 
122
 *
 
123
 * Allow selection of one of the spots (switches to S&P)
 
124
 * - Ctrl-G as known
 
125
 * - '.' and cursor plus 'Enter'
 
126
 *
 
127
 * '.' goes into map, shows help line above and supports
 
128
 * - cursormovement
 
129
 * - 'ESC' leaves mode
 
130
 * - 'Enter' selects spot
 
131
 * - 'B', 'D', 'M' switches filtering for band, dupes and mode on or off.
 
132
 */
 
133
 
 
134
spot *bandmap_lookup(char *partialcall);
 
135
 
 
136
spot *bandmap_next(unsigned int upwards, unsigned int freq);
 
137
 
 
138
#endif