32 |
* Compile with: gcc -lm -o wwl wwl.c |
* Compile with: gcc -lm -o wwl wwl.c |
33 |
* |
* |
34 |
* $Log$ |
* $Log$ |
35 |
|
* Revision 1.5 2003/06/24 07:29:42 fillods |
36 |
|
* allow locator computation with partial information (use center of grid for missing part). Fix a bug in error msg with invalid locator. |
37 |
|
* |
38 |
* Revision 1.4 2003/03/03 15:34:43 pa4tu |
* Revision 1.4 2003/03/03 15:34:43 pa4tu |
39 |
* ported to gtk+-2.0 |
* ported to gtk+-2.0 |
40 |
* |
* |
69 |
static gchar * |
static gchar * |
70 |
wwl (gchar * my, gchar * dx) |
wwl (gchar * my, gchar * dx) |
71 |
{ |
{ |
72 |
gint l, p, m; |
gint l, p, m, strlen_dx; |
73 |
gdouble z, y, n, h, x, w, t, s, v, u, c, d, e, lx; |
gdouble z, y, n, h, x, w, t, s, v, u, c, d, e, lx; |
74 |
gchar my_wwl[6], dx_wwl[6]; |
gchar my_wwl[7], dx_wwl[7] = "AA55MM"; |
75 |
gchar *result; |
gchar *result; |
76 |
gchar *msg; |
gchar *msg; |
77 |
|
|
83 |
return (g_strdup ("")); |
return (g_strdup ("")); |
84 |
} |
} |
85 |
|
|
86 |
if (strlen (dx) != 6) |
strlen_dx = strlen (dx); |
87 |
|
if (strlen_dx < 2 || strlen_dx > 6) |
88 |
{ |
{ |
89 |
msg = g_strdup_printf (_("%s: not a valid locator"), dx); |
msg = g_strdup_printf (_("%s: not a valid locator"), dx); |
90 |
update_statusbar (msg); |
update_statusbar (msg); |
93 |
} |
} |
94 |
|
|
95 |
strcpy (my_wwl, my); |
strcpy (my_wwl, my); |
96 |
strcpy (dx_wwl, dx); |
memcpy (dx_wwl, dx, strlen_dx); |
97 |
|
|
98 |
my_wwl[0] = toupper (my_wwl[0]); |
my_wwl[0] = toupper (my_wwl[0]); |
99 |
z = my_wwl[0] - 65; |
z = my_wwl[0] - 65; |
191 |
label = g_strdup (""); |
label = g_strdup (""); |
192 |
gtk_frame_set_label (GTK_FRAME (locatorframe), "Locator"); |
gtk_frame_set_label (GTK_FRAME (locatorframe), "Locator"); |
193 |
|
|
194 |
if ((g_ascii_strcasecmp (locator, "") != 0) && (strlen (locator) == 6)) |
if (strlen (locator) >= 2) |
195 |
{ |
{ |
196 |
label = wwl (preferences.locator, locator); |
label = wwl (preferences.locator, locator); |
197 |
g_ascii_strup (locator, -1); |
g_ascii_strup (locator, -1); |