1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etagpt.c -- assignment editor - group to input port field handlers
|
---|
4 | Version 5 -- 198-10-04 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "stddefs.h"
|
---|
9 | #include "fields.h"
|
---|
10 | #include "vsdd.h"
|
---|
11 | #include "vsddsw.h"
|
---|
12 | #include "graphdef.h"
|
---|
13 |
|
---|
14 | #include "midas.h"
|
---|
15 | #include "asgdsp.h"
|
---|
16 |
|
---|
17 | extern char *numblk(char *buf, short n);
|
---|
18 |
|
---|
19 | extern unsigned *asgob;
|
---|
20 |
|
---|
21 | extern short stcrow, stccol;
|
---|
22 |
|
---|
23 | extern char dspbuf[];
|
---|
24 | extern char *gprep[];
|
---|
25 |
|
---|
26 | extern short key2grp[];
|
---|
27 |
|
---|
28 | extern short adbox[][8];
|
---|
29 |
|
---|
30 | extern short grp2prt[12][2]; /* group to port and channel table */
|
---|
31 | /* port [0] = 0..3, channel [1] = -1, 1..16 */
|
---|
32 |
|
---|
33 | /* |
---|
34 |
|
---|
35 | */
|
---|
36 |
|
---|
37 | /*
|
---|
38 | =============================================================================
|
---|
39 | et_agpt() -- load the edit buffer
|
---|
40 | =============================================================================
|
---|
41 | */
|
---|
42 |
|
---|
43 | short et_agpt(short n)
|
---|
44 | {
|
---|
45 | register short grp;
|
---|
46 |
|
---|
47 | grp = 0x00FF & (n >> 8);
|
---|
48 |
|
---|
49 | ebuf[0] = grp2prt[grp][0];
|
---|
50 | ebuf[1] = '\0';
|
---|
51 |
|
---|
52 | ebflag = TRUE;
|
---|
53 |
|
---|
54 | return(SUCCESS);
|
---|
55 | }
|
---|
56 |
|
---|
57 | /*
|
---|
58 | =============================================================================
|
---|
59 | ef_agpt() -- parse (unload) the edit buffer
|
---|
60 | =============================================================================
|
---|
61 | */
|
---|
62 |
|
---|
63 | short ef_agpt(short n)
|
---|
64 | {
|
---|
65 | register short tmpval, grp, i;
|
---|
66 |
|
---|
67 | grp = 0x00FF & (n >> 8);
|
---|
68 |
|
---|
69 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
70 | ebflag = FALSE;
|
---|
71 |
|
---|
72 | grp2prt[grp][0] = ebuf[0];
|
---|
73 |
|
---|
74 | if (grp2prt[grp][0] NE 1)
|
---|
75 | for (i = 0; i < 88; i++)
|
---|
76 | key2grp[i] &= ~(0x0001 << grp);
|
---|
77 |
|
---|
78 | drawk2g(grp);
|
---|
79 |
|
---|
80 | modasg();
|
---|
81 | return(SUCCESS);
|
---|
82 | }
|
---|
83 |
|
---|
84 | /* |
---|
85 |
|
---|
86 | */
|
---|
87 |
|
---|
88 | /*
|
---|
89 | =============================================================================
|
---|
90 | rd_agpt() -- (re)display the field
|
---|
91 | =============================================================================
|
---|
92 | */
|
---|
93 |
|
---|
94 | short rd_agpt(short nn)
|
---|
95 | {
|
---|
96 | register short n, grp;
|
---|
97 |
|
---|
98 | n = 0x00FF & nn;
|
---|
99 | grp = 0x00FF & (nn >> 8);
|
---|
100 |
|
---|
101 | vbank(0);
|
---|
102 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
103 | cfetp->frow, cfetp->flcol, gprep[grp2prt[grp][0]], 14);
|
---|
104 |
|
---|
105 | return(SUCCESS);
|
---|
106 | }
|
---|
107 |
|
---|
108 | /*
|
---|
109 | =============================================================================
|
---|
110 | nd_agpt() -- handle new data entry
|
---|
111 | =============================================================================
|
---|
112 | */
|
---|
113 |
|
---|
114 | short nd_agpt(short nn, short k)
|
---|
115 | {
|
---|
116 | register short n;
|
---|
117 |
|
---|
118 | n = nn & 0x00FF;
|
---|
119 |
|
---|
120 | if (k EQ 8) { /* '-' */
|
---|
121 |
|
---|
122 | if (--ebuf[0] LT 0)
|
---|
123 | ebuf[0] = 3;
|
---|
124 |
|
---|
125 | } else if (k EQ 9) { /* '+' */
|
---|
126 |
|
---|
127 | if (++ebuf[0] GT 3)
|
---|
128 | ebuf[0] = 0;
|
---|
129 |
|
---|
130 | } else {
|
---|
131 |
|
---|
132 | return(FAILURE);
|
---|
133 | }
|
---|
134 |
|
---|
135 | dspbuf[0] = *gprep[ebuf[0]];
|
---|
136 | dspbuf[1] = '\0';
|
---|
137 |
|
---|
138 | vbank(0);
|
---|
139 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
140 |
|
---|
141 | return(SUCCESS);
|
---|
142 | }
|
---|
143 |
|
---|