| 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | etatun.c -- MIDAS assignment editor - tuning table field handlers
|
|---|
| 4 | Version 1 -- 1987-12-10 -- 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 curtun;
|
|---|
| 21 |
|
|---|
| 22 | extern int16_t adbox[][8];
|
|---|
| 23 |
|
|---|
| 24 | extern int8_t dspbuf[];
|
|---|
| 25 |
|
|---|
| 26 | /* |
|---|
| 27 |
|
|---|
| 28 | */
|
|---|
| 29 |
|
|---|
| 30 | /*
|
|---|
| 31 | =============================================================================
|
|---|
| 32 | et_atun() -- load the edit buffer
|
|---|
| 33 | =============================================================================
|
|---|
| 34 | */
|
|---|
| 35 |
|
|---|
| 36 | int16_t et_atun(int16_t n)
|
|---|
| 37 | {
|
|---|
| 38 | sprintf(ebuf, "%01.1d", curtun);
|
|---|
| 39 | ebflag = TRUE;
|
|---|
| 40 |
|
|---|
| 41 | return(SUCCESS);
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | /*
|
|---|
| 45 | =============================================================================
|
|---|
| 46 | ef_atun() -- parse (unload) the edit buffer
|
|---|
| 47 | =============================================================================
|
|---|
| 48 | */
|
|---|
| 49 |
|
|---|
| 50 | int16_t ef_atun(int16_t n)
|
|---|
| 51 | {
|
|---|
| 52 | register int16_t tmpval;
|
|---|
| 53 |
|
|---|
| 54 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
|---|
| 55 | ebflag = FALSE;
|
|---|
| 56 |
|
|---|
| 57 | tmpval = ebuf[0] - '0';
|
|---|
| 58 |
|
|---|
| 59 | gettun(tmpval);
|
|---|
| 60 |
|
|---|
| 61 | modasg();
|
|---|
| 62 | return(SUCCESS);
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
| 65 | /* |
|---|
| 66 |
|
|---|
| 67 | */
|
|---|
| 68 |
|
|---|
| 69 | /*
|
|---|
| 70 | =============================================================================
|
|---|
| 71 | rd_atun() -- (re)display the field
|
|---|
| 72 | =============================================================================
|
|---|
| 73 | */
|
|---|
| 74 |
|
|---|
| 75 | int16_t rd_atun(int16_t nn)
|
|---|
| 76 | {
|
|---|
| 77 | register int16_t n;
|
|---|
| 78 |
|
|---|
| 79 | n = nn & 0xFF;
|
|---|
| 80 | sprintf(dspbuf, "Tun %01.1d", curtun);
|
|---|
| 81 |
|
|---|
| 82 | vbank(0);
|
|---|
| 83 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
|---|
| 84 | adbox[n][6], adbox[n][7], dspbuf, 14);
|
|---|
| 85 |
|
|---|
| 86 | return(SUCCESS);
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | /*
|
|---|
| 90 | =============================================================================
|
|---|
| 91 | nd_atun() -- handle new data entry
|
|---|
| 92 | =============================================================================
|
|---|
| 93 | */
|
|---|
| 94 |
|
|---|
| 95 | int16_t nd_atun(int16_t nn, int16_t k)
|
|---|
| 96 | {
|
|---|
| 97 | register int16_t n;
|
|---|
| 98 |
|
|---|
| 99 | n = nn & 0xFF;
|
|---|
| 100 | ebuf[0] = k + '0';
|
|---|
| 101 | ebuf[1] = '\0';
|
|---|
| 102 |
|
|---|
| 103 | dspbuf[0] = k + '0';
|
|---|
| 104 | dspbuf[1] = '\0';
|
|---|
| 105 |
|
|---|
| 106 | vbank(0);
|
|---|
| 107 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
|---|
| 108 | stcrow, stccol, dspbuf, 14);
|
|---|
| 109 |
|
|---|
| 110 | return(SUCCESS);
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|