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