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