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