[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etains.c -- MIDAS assignment editor -- instrument to groups
|
---|
| 4 | Version 10 -- 1988-07-11 -- 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 asgmod;
|
---|
| 22 | extern int16_t stccol;
|
---|
| 23 | extern int16_t stcrow;
|
---|
[f40a309] | 24 |
|
---|
[7258c6a] | 25 | extern int8_t dspbuf[];
|
---|
[f40a309] | 26 |
|
---|
[7258c6a] | 27 | extern int16_t ins2grp[];
|
---|
[f40a309] | 28 |
|
---|
[7258c6a] | 29 | extern int16_t adbox[][8];
|
---|
[f40a309] | 30 |
|
---|
| 31 | /* |
---|
| 32 |
|
---|
| 33 | */
|
---|
| 34 |
|
---|
| 35 | /*
|
---|
| 36 | =============================================================================
|
---|
| 37 | modasg() -- indicate that the assignment table was modified
|
---|
| 38 | =============================================================================
|
---|
| 39 | */
|
---|
[0580615] | 40 |
|
---|
[f40a309] | 41 | void modasg(void)
|
---|
| 42 | {
|
---|
| 43 | if (NOT asgmod) {
|
---|
| 44 |
|
---|
| 45 | asgmod = TRUE;
|
---|
| 46 | adswin(0);
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | /*
|
---|
| 51 | =============================================================================
|
---|
| 52 | et_ains() -- load the edit buffer
|
---|
| 53 | =============================================================================
|
---|
| 54 | */
|
---|
[7258c6a] | 55 |
|
---|
[f40a309] | 56 | int16_t et_ains(int16_t n)
|
---|
[7258c6a] | 57 | {
|
---|
[f40a309] | 58 | register int16_t grp;
|
---|
[7258c6a] | 59 |
|
---|
[f40a309] | 60 | int8_t buf[4];
|
---|
| 61 |
|
---|
| 62 | grp = 0x00FF & (n >> 8);
|
---|
| 63 |
|
---|
| 64 | sprintf(ebuf, "%02.2d", ins2grp[grp] & 0x00FF);
|
---|
| 65 | ebflag = TRUE;
|
---|
| 66 |
|
---|
| 67 | return(SUCCESS);
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 | /*
|
---|
| 71 | =============================================================================
|
---|
| 72 | ef_ains() -- parse (unload) the edit buffer
|
---|
| 73 | =============================================================================
|
---|
| 74 | */
|
---|
[7258c6a] | 75 |
|
---|
[f40a309] | 76 | int16_t ef_ains(int16_t n)
|
---|
[7258c6a] | 77 | {
|
---|
[f40a309] | 78 | register int16_t tmpval, grp, i;
|
---|
| 79 |
|
---|
| 80 | grp = 0x00FF & (n >> 8);
|
---|
| 81 | ebuf[2] = '\0';
|
---|
| 82 | ebflag = FALSE;
|
---|
| 83 | tmpval = 0;
|
---|
| 84 |
|
---|
| 85 | for (i = 0; i < 2; i++)
|
---|
| 86 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 87 |
|
---|
| 88 | if (tmpval GE NINST )
|
---|
| 89 | return(FAILURE);
|
---|
| 90 |
|
---|
| 91 | ins2grp[grp] = tmpval | (ins2grp[grp] & 0xFF00);
|
---|
| 92 | modasg();
|
---|
| 93 | setv2gi(grp);
|
---|
| 94 | setinst();
|
---|
| 95 | return(SUCCESS);
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | /* |
---|
| 99 |
|
---|
| 100 | */
|
---|
| 101 |
|
---|
| 102 | /*
|
---|
| 103 | =============================================================================
|
---|
| 104 | rd_ains() -- (re)display the field
|
---|
| 105 | =============================================================================
|
---|
[7258c6a] | 106 | */
|
---|
[f40a309] | 107 |
|
---|
[7258c6a] | 108 | int16_t rd_ains(int16_t nn)
|
---|
| 109 | {
|
---|
[f40a309] | 110 | register int16_t n, grp;
|
---|
| 111 | int8_t buf[4];
|
---|
| 112 |
|
---|
| 113 | n = 0x00FF & nn;
|
---|
| 114 | grp = 0x00FF & (nn >> 8);
|
---|
| 115 |
|
---|
| 116 | sprintf(dspbuf, "%02.2d", ins2grp[grp] & 0x00FF);
|
---|
| 117 |
|
---|
| 118 | vbank(0);
|
---|
| 119 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 120 | cfetp->frow, cfetp->flcol, dspbuf, 14);
|
---|
| 121 |
|
---|
| 122 | return(SUCCESS);
|
---|
| 123 | }
|
---|
| 124 |
|
---|
| 125 | /*
|
---|
| 126 | =============================================================================
|
---|
| 127 | nd_ains() -- handle new data entry
|
---|
| 128 | =============================================================================
|
---|
[7258c6a] | 129 | */
|
---|
[f40a309] | 130 |
|
---|
[7258c6a] | 131 | int16_t nd_ains(int16_t nn, int16_t k)
|
---|
[f40a309] | 132 | {
|
---|
| 133 | register int16_t n;
|
---|
| 134 |
|
---|
| 135 | n = nn & 0xFF;
|
---|
| 136 | ebuf[stccol - cfetp->flcol] = k + '0';
|
---|
| 137 | ebuf[2] = '\0';
|
---|
| 138 |
|
---|
| 139 | dspbuf[0] = k + '0';
|
---|
| 140 | dspbuf[1] = '\0';
|
---|
| 141 |
|
---|
| 142 | vbank(0);
|
---|
| 143 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
| 144 | stcrow, stccol, dspbuf, 14);
|
---|
| 145 |
|
---|
| 146 | advacur();
|
---|
| 147 | return(SUCCESS);
|
---|
| 148 | }
|
---|
| 149 |
|
---|