1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etains.c -- MIDAS assignment editor -- instrument to groups
|
---|
4 | Version 10 -- 1988-07-11 -- 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 | #include "stdio.h"
|
---|
18 |
|
---|
19 | extern int8_t *numblk(int8_t *buf, int16_t n);
|
---|
20 |
|
---|
21 | extern void adswin(int16_t n);
|
---|
22 | extern void advacur(void);
|
---|
23 | extern void setinst(void);
|
---|
24 | extern void setv2gi(int16_t group);
|
---|
25 |
|
---|
26 | extern uint16_t *asgob;
|
---|
27 |
|
---|
28 | extern int16_t asgmod;
|
---|
29 | extern int16_t stccol;
|
---|
30 | extern int16_t stcrow;
|
---|
31 |
|
---|
32 | extern int8_t dspbuf[];
|
---|
33 |
|
---|
34 | extern int16_t ins2grp[];
|
---|
35 |
|
---|
36 | extern int16_t adbox[][8];
|
---|
37 |
|
---|
38 | /* |
---|
39 |
|
---|
40 | */
|
---|
41 |
|
---|
42 | /*
|
---|
43 | =============================================================================
|
---|
44 | modasg() -- indicate that the assignment table was modified
|
---|
45 | =============================================================================
|
---|
46 | */
|
---|
47 |
|
---|
48 | void modasg(void)
|
---|
49 | {
|
---|
50 | if (NOT asgmod) {
|
---|
51 |
|
---|
52 | asgmod = TRUE;
|
---|
53 | adswin(0);
|
---|
54 | }
|
---|
55 | }
|
---|
56 |
|
---|
57 | /*
|
---|
58 | =============================================================================
|
---|
59 | et_ains() -- load the edit buffer
|
---|
60 | =============================================================================
|
---|
61 | */
|
---|
62 |
|
---|
63 | int16_t et_ains(int16_t n)
|
---|
64 | {
|
---|
65 | register int16_t grp;
|
---|
66 |
|
---|
67 | int8_t buf[4];
|
---|
68 |
|
---|
69 | grp = 0x00FF & (n >> 8);
|
---|
70 |
|
---|
71 | sprintf(ebuf, "%02.2d", ins2grp[grp] & 0x00FF);
|
---|
72 | ebflag = TRUE;
|
---|
73 |
|
---|
74 | return(SUCCESS);
|
---|
75 | }
|
---|
76 |
|
---|
77 | /*
|
---|
78 | =============================================================================
|
---|
79 | ef_ains() -- parse (unload) the edit buffer
|
---|
80 | =============================================================================
|
---|
81 | */
|
---|
82 |
|
---|
83 | int16_t ef_ains(int16_t n)
|
---|
84 | {
|
---|
85 | register int16_t tmpval, grp, i;
|
---|
86 |
|
---|
87 | grp = 0x00FF & (n >> 8);
|
---|
88 | ebuf[2] = '\0';
|
---|
89 | ebflag = FALSE;
|
---|
90 | tmpval = 0;
|
---|
91 |
|
---|
92 | for (i = 0; i < 2; i++)
|
---|
93 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
94 |
|
---|
95 | if (tmpval GE NINST )
|
---|
96 | return(FAILURE);
|
---|
97 |
|
---|
98 | ins2grp[grp] = tmpval | (ins2grp[grp] & 0xFF00);
|
---|
99 | modasg();
|
---|
100 | setv2gi(grp);
|
---|
101 | setinst();
|
---|
102 | return(SUCCESS);
|
---|
103 | }
|
---|
104 |
|
---|
105 | /* |
---|
106 |
|
---|
107 | */
|
---|
108 |
|
---|
109 | /*
|
---|
110 | =============================================================================
|
---|
111 | rd_ains() -- (re)display the field
|
---|
112 | =============================================================================
|
---|
113 | */
|
---|
114 |
|
---|
115 | int16_t rd_ains(int16_t nn)
|
---|
116 | {
|
---|
117 | register int16_t n, grp;
|
---|
118 | int8_t buf[4];
|
---|
119 |
|
---|
120 | n = 0x00FF & nn;
|
---|
121 | grp = 0x00FF & (nn >> 8);
|
---|
122 |
|
---|
123 | sprintf(dspbuf, "%02.2d", ins2grp[grp] & 0x00FF);
|
---|
124 |
|
---|
125 | vbank(0);
|
---|
126 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
127 | cfetp->frow, cfetp->flcol, dspbuf, 14);
|
---|
128 |
|
---|
129 | return(SUCCESS);
|
---|
130 | }
|
---|
131 |
|
---|
132 | /*
|
---|
133 | =============================================================================
|
---|
134 | nd_ains() -- handle new data entry
|
---|
135 | =============================================================================
|
---|
136 | */
|
---|
137 |
|
---|
138 | int16_t nd_ains(int16_t nn, int16_t k)
|
---|
139 | {
|
---|
140 | register int16_t n;
|
---|
141 |
|
---|
142 | n = nn & 0xFF;
|
---|
143 | ebuf[stccol - cfetp->flcol] = k + '0';
|
---|
144 | ebuf[2] = '\0';
|
---|
145 |
|
---|
146 | dspbuf[0] = k + '0';
|
---|
147 | dspbuf[1] = '\0';
|
---|
148 |
|
---|
149 | vbank(0);
|
---|
150 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
151 | stcrow, stccol, dspbuf, 14);
|
---|
152 |
|
---|
153 | advacur();
|
---|
154 | return(SUCCESS);
|
---|
155 | }
|
---|
156 |
|
---|