2
#include "local_proto.h"
6
static int setup(void);
11
int setup_digitizer(void)
14
static Objects objects[] = {
15
INFO("Do you wish to use the digitizer? ", &use),
16
MENU("YES", yes, &use),
24
* test to see if we have a digitizer (geo.quest)
25
* make sure this program has execute permission first.
26
* then run the program and check its exit status
27
* 0 means can use digitizer, other means can't
29
sprintf(command, "%s/etc/geo.quest", G_gisbase());
30
if (access(command, 1) != 0)
37
* ask the user if he/she wishes to use it
39
Start_mouse_in_menu();
40
Input_pointer(objects);
42
Input_other(setup, "Keyboard");
47
static int setup(void)
52
* setup the digitizer. system() call must exit with 0 to indicate
53
* everything went fine
55
sprintf(command, "%s/etc/geo.reg %s %d",
56
G_gisbase(), digit_points, getpid());
58
if (system(command)) {
67
int digitizer_point(double *east, double *north)
73
/* make sure digitzer is to be used */
77
sprintf(command, "%s/etc/geo.point %s %s",
78
G_gisbase(), digit_points, digit_results);
81
if (system(command)) {
88
fd = fopen(digit_results, "r");
93
stat = (fscanf(fd, "%lf %lf", east, north) == 2);
101
static int oops(void)
103
Curses_clear_window(MENU_WINDOW);
104
Curses_write_window(MENU_WINDOW, 3, 2, "Can't get data from digitizer");