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