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