[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etaint.c -- MIDAS assignment editor - phase shifter intensity field
|
---|
| 4 | Version 5 -- 1987-12-19 -- 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 |
|
---|
| 17 | extern unsigned *asgob;
|
---|
| 18 |
|
---|
| 19 | extern short stcrow, stccol;
|
---|
| 20 | extern short ps_intn;
|
---|
| 21 |
|
---|
| 22 | extern short adbox[][8];
|
---|
| 23 |
|
---|
| 24 | extern char dspbuf[];
|
---|
| 25 |
|
---|
| 26 | /* |
---|
| 27 |
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 | /*
|
---|
| 31 | =============================================================================
|
---|
| 32 | et_aint() -- load the edit buffer
|
---|
| 33 | =============================================================================
|
---|
| 34 | */
|
---|
| 35 |
|
---|
| 36 | short
|
---|
| 37 | et_aint(n)
|
---|
| 38 | short n;
|
---|
| 39 | {
|
---|
| 40 | sprintf(ebuf, "%02d", ps_intn);
|
---|
| 41 | ebflag = TRUE;
|
---|
| 42 |
|
---|
| 43 | return(SUCCESS);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | /*
|
---|
| 47 | =============================================================================
|
---|
| 48 | ef_aint() -- parse (unload) the edit buffer
|
---|
| 49 | =============================================================================
|
---|
| 50 | */
|
---|
| 51 |
|
---|
| 52 | short
|
---|
| 53 | ef_aint(n)
|
---|
| 54 | short n;
|
---|
| 55 | {
|
---|
| 56 | register short i, tmpval;
|
---|
| 57 |
|
---|
| 58 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 59 | ebflag = FALSE;
|
---|
| 60 | tmpval = 0;
|
---|
| 61 |
|
---|
| 62 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 63 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 64 |
|
---|
| 65 | ps_intn = tmpval;
|
---|
| 66 | sendval(1, 0, ((ps_intn * 10) << 5));
|
---|
| 67 | modasg();
|
---|
| 68 | return(SUCCESS);
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | /* |
---|
| 72 |
|
---|
| 73 | */
|
---|
| 74 |
|
---|
| 75 | /*
|
---|
| 76 | =============================================================================
|
---|
| 77 | rd_aint() -- (re)display the field
|
---|
| 78 | =============================================================================
|
---|
| 79 | */
|
---|
| 80 |
|
---|
| 81 | short
|
---|
| 82 | rd_aint(nn)
|
---|
| 83 | short nn;
|
---|
| 84 | {
|
---|
| 85 | register short n;
|
---|
| 86 |
|
---|
| 87 | n = nn & 0xFF;
|
---|
| 88 | sprintf(dspbuf, "%02.2d", ps_intn);
|
---|
| 89 |
|
---|
| 90 | vbank(0);
|
---|
| 91 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 92 | adbox[n][6] + 1, adbox[n][7] + 8, dspbuf, 14);
|
---|
| 93 |
|
---|
| 94 | return(SUCCESS);
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | /*
|
---|
| 98 | =============================================================================
|
---|
| 99 | nd_aint() -- handle new data entry
|
---|
| 100 | =============================================================================
|
---|
| 101 | */
|
---|
| 102 |
|
---|
| 103 | short
|
---|
| 104 | nd_aint(nn, k)
|
---|
| 105 | short nn;
|
---|
| 106 | register short k;
|
---|
| 107 | {
|
---|
| 108 | register short ec, n;
|
---|
| 109 |
|
---|
| 110 | n = nn & 0xFF;
|
---|
| 111 |
|
---|
| 112 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 113 |
|
---|
| 114 | ebuf[ec] = k + '0';
|
---|
| 115 | ebuf[2] = '\0';
|
---|
| 116 |
|
---|
| 117 | dspbuf[0] = k + '0';
|
---|
| 118 | dspbuf[1] = '\0';
|
---|
| 119 |
|
---|
| 120 | vbank(0);
|
---|
| 121 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 122 |
|
---|
| 123 | advacur();
|
---|
| 124 | return(SUCCESS);
|
---|
| 125 | }
|
---|
| 126 |
|
---|