[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 |
|
---|
[0580615] | 17 | extern char *numblk(char *buf, short n);
|
---|
[f40a309] | 18 |
|
---|
| 19 | extern unsigned *asgob;
|
---|
| 20 |
|
---|
| 21 | extern short asgmod;
|
---|
| 22 | extern short stccol;
|
---|
| 23 | extern short stcrow;
|
---|
| 24 |
|
---|
| 25 | extern char dspbuf[];
|
---|
| 26 |
|
---|
| 27 | extern short ins2grp[];
|
---|
| 28 |
|
---|
| 29 | extern short adbox[][8];
|
---|
| 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 | */
|
---|
[0580615] | 55 |
|
---|
[f40a309] | 56 | short et_ains(short n)
|
---|
| 57 | {
|
---|
| 58 | register short grp;
|
---|
| 59 |
|
---|
| 60 | char 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 | */
|
---|
[0580615] | 75 |
|
---|
[f40a309] | 76 | short ef_ains(short n)
|
---|
| 77 | {
|
---|
| 78 | register short 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 | =============================================================================
|
---|
[0580615] | 106 | */
|
---|
[f40a309] | 107 |
|
---|
| 108 | short rd_ains(short nn)
|
---|
| 109 | {
|
---|
| 110 | register short n, grp;
|
---|
| 111 | char 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 | =============================================================================
|
---|
[0580615] | 129 | */
|
---|
[f40a309] | 130 |
|
---|
| 131 | short nd_ains(short nn, short k)
|
---|
| 132 | {
|
---|
| 133 | register short 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 |
|
---|