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