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