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