[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etadep.c -- MIDAS assignment editor - phase shifter depth field
|
---|
| 4 | Version 4 -- 1987-12-19 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_adep() -- load the edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_adep(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
[7ecfb7b] | 18 | (void)n;
|
---|
| 19 |
|
---|
[f40a309] | 20 | sprintf(ebuf, "%02d", ps_dpth);
|
---|
| 21 | ebflag = TRUE;
|
---|
| 22 |
|
---|
| 23 | return(SUCCESS);
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | /*
|
---|
| 27 | =============================================================================
|
---|
| 28 | ef_adep() -- parse (unload) the edit buffer
|
---|
| 29 | =============================================================================
|
---|
| 30 | */
|
---|
| 31 |
|
---|
[7258c6a] | 32 | int16_t ef_adep(int16_t n)
|
---|
[f40a309] | 33 | {
|
---|
[7258c6a] | 34 | register int16_t i, tmpval;
|
---|
[f40a309] | 35 |
|
---|
[7ecfb7b] | 36 | (void)n;
|
---|
| 37 |
|
---|
[f40a309] | 38 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 39 | ebflag = FALSE;
|
---|
| 40 | tmpval = 0;
|
---|
| 41 |
|
---|
| 42 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 43 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 44 |
|
---|
| 45 | ps_dpth = tmpval;
|
---|
| 46 | sendval(3, 0, ((ps_dpth * 10) << 5));
|
---|
| 47 | modasg();
|
---|
| 48 | return(SUCCESS);
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | /*
|
---|
| 52 | =============================================================================
|
---|
| 53 | rd_adep() -- (re)display the field
|
---|
| 54 | =============================================================================
|
---|
| 55 | */
|
---|
| 56 |
|
---|
[7258c6a] | 57 | int16_t rd_adep(int16_t nn)
|
---|
[f40a309] | 58 | {
|
---|
[7258c6a] | 59 | register int16_t n;
|
---|
[f40a309] | 60 |
|
---|
| 61 | n = nn & 0xFF;
|
---|
| 62 | sprintf(dspbuf, "%02.2d", ps_dpth);
|
---|
| 63 |
|
---|
| 64 | vbank(0);
|
---|
| 65 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 66 | adbox[n][6] + 3, adbox[n][7] + 8, dspbuf, 14);
|
---|
| 67 |
|
---|
| 68 | return(SUCCESS);
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | /*
|
---|
| 72 | =============================================================================
|
---|
| 73 | nd_adep() -- handle new data entry
|
---|
| 74 | =============================================================================
|
---|
| 75 | */
|
---|
| 76 |
|
---|
[7258c6a] | 77 | int16_t nd_adep(int16_t nn, int16_t k)
|
---|
[f40a309] | 78 | {
|
---|
[7258c6a] | 79 | register int16_t ec, n;
|
---|
[f40a309] | 80 |
|
---|
| 81 | n = nn & 0xFF;
|
---|
| 82 |
|
---|
| 83 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 84 |
|
---|
[432327d] | 85 | ebuf[ec] = (int8_t)(k + '0');
|
---|
[f40a309] | 86 | ebuf[2] = '\0';
|
---|
| 87 |
|
---|
[432327d] | 88 | dspbuf[0] = (int8_t)(k + '0');
|
---|
[f40a309] | 89 | dspbuf[1] = '\0';
|
---|
| 90 |
|
---|
| 91 | vbank(0);
|
---|
| 92 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 93 |
|
---|
| 94 | advacur();
|
---|
| 95 | return(SUCCESS);
|
---|
| 96 | }
|
---|
| 97 |
|
---|
[6262b5c] | 98 |
|
---|