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