| 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | sqfield.c -- MIDAS-VII sequence display field functions
|
|---|
| 4 | Version 9 -- 1989-11-16 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #define DEBUGIT 0
|
|---|
| 9 |
|
|---|
| 10 | #include "stddefs.h"
|
|---|
| 11 | #include "hwdefs.h"
|
|---|
| 12 | #include "graphdef.h"
|
|---|
| 13 | #include "vsdd.h"
|
|---|
| 14 | #include "fields.h"
|
|---|
| 15 | #include "curpak.h"
|
|---|
| 16 | #include "patch.h"
|
|---|
| 17 | #include "macros.h"
|
|---|
| 18 |
|
|---|
| 19 | #include "midas.h"
|
|---|
| 20 | #include "ptdisp.h"
|
|---|
| 21 |
|
|---|
| 22 | #if DEBUGIT
|
|---|
| 23 | extern short debugsw;
|
|---|
| 24 |
|
|---|
| 25 | short debugqf = 1;
|
|---|
| 26 | #endif
|
|---|
| 27 |
|
|---|
| 28 | extern short (*xy_up)(), (*xy_dn)();
|
|---|
| 29 | extern short (*premove)(), (*pstmove)();
|
|---|
| 30 | extern short (*curtype)();
|
|---|
| 31 |
|
|---|
| 32 | extern void select(void);
|
|---|
| 33 | extern short nokey(void);
|
|---|
| 34 | extern short stdctp5(void);
|
|---|
| 35 | extern void cxkstd(void);
|
|---|
| 36 | extern void cykstd(void);
|
|---|
| 37 | extern void stdmkey(void);
|
|---|
| 38 | extern void stddkey(void);
|
|---|
| 39 | extern void stopsm(void);
|
|---|
| 40 | extern void smxupd(void);
|
|---|
| 41 | extern void sqyupd(void);
|
|---|
| 42 | extern void postcm(void);
|
|---|
| 43 |
|
|---|
| 44 | extern short astat;
|
|---|
| 45 | extern short cmfirst;
|
|---|
| 46 | extern short cmtype;
|
|---|
| 47 | extern short curhold;
|
|---|
| 48 | extern short curslin;
|
|---|
| 49 | extern short cvtime;
|
|---|
| 50 | extern short cvwait;
|
|---|
| 51 | extern short ncvwait;
|
|---|
| 52 | extern short sqdeflg;
|
|---|
| 53 | extern short stccol;
|
|---|
| 54 | extern short ss_ptsw;
|
|---|
| 55 | extern short ss_sqsw;
|
|---|
| 56 | extern short syrate;
|
|---|
| 57 | extern short tvcwval;
|
|---|
| 58 | extern short vcwval;
|
|---|
| 59 |
|
|---|
| 60 | extern short crate1[];
|
|---|
| 61 |
|
|---|
| 62 | extern struct selbox *csbp;
|
|---|
| 63 | extern struct selbox sqboxes[];
|
|---|
| 64 |
|
|---|
| 65 | extern struct seqent seqbuf;
|
|---|
| 66 | extern struct seqent seqtab[];
|
|---|
| 67 |
|
|---|
| 68 | extern char sqdebuf[];
|
|---|
| 69 |
|
|---|
| 70 | void sqxkey(void);
|
|---|
| 71 | void sqekey(void);
|
|---|
| 72 | void sqmkey(void);
|
|---|
| 73 | void sqdkey(void);
|
|---|
| 74 |
|
|---|
| 75 | /* |
|---|
| 76 |
|
|---|
| 77 | */
|
|---|
| 78 |
|
|---|
| 79 | struct curpak sq_flds = {
|
|---|
| 80 |
|
|---|
| 81 | stdctp5, /* curtype */
|
|---|
| 82 | nokey, /* premove */
|
|---|
| 83 | postcm, /* pstmove */
|
|---|
| 84 | cxkstd, /* cx_key */
|
|---|
| 85 | cykstd, /* cy_key */
|
|---|
| 86 | smxupd, /* cx_upd */
|
|---|
| 87 | sqyupd, /* cy_upd */
|
|---|
| 88 | stopsm, /* xy_up */
|
|---|
| 89 | nokey, /* xy_dn */
|
|---|
| 90 | sqxkey, /* x_key */
|
|---|
| 91 | sqekey, /* e_key */
|
|---|
| 92 | sqmkey, /* m_key */
|
|---|
| 93 | sqdkey, /* d_key */
|
|---|
| 94 | nokey, /* not_fld */
|
|---|
| 95 | (struct fet *)NULL, /* curfet */
|
|---|
| 96 | sqboxes, /* csbp */
|
|---|
| 97 | crate1, /* cratex */
|
|---|
| 98 | crate1, /* cratey */
|
|---|
| 99 | CT_SMTH, /* cmtype */
|
|---|
| 100 | CTOX(2), /* cxval */
|
|---|
| 101 | RTOY(DATAROW) /* cyval */
|
|---|
| 102 | };
|
|---|
| 103 |
|
|---|
| 104 | /* |
|---|
| 105 |
|
|---|
| 106 | */
|
|---|
| 107 |
|
|---|
| 108 | /*
|
|---|
| 109 | =============================================================================
|
|---|
| 110 | sqmkey() -- M key processing for the sequence display
|
|---|
| 111 | =============================================================================
|
|---|
| 112 | */
|
|---|
| 113 |
|
|---|
| 114 | void sqmkey(void)
|
|---|
| 115 | {
|
|---|
| 116 | register short nc;
|
|---|
| 117 |
|
|---|
| 118 | if (astat) {
|
|---|
| 119 |
|
|---|
| 120 | if (stccol EQ 48) {
|
|---|
| 121 |
|
|---|
| 122 | if (ss_ptsw EQ 0) {
|
|---|
| 123 |
|
|---|
| 124 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
|---|
| 125 |
|
|---|
| 126 | (*premove)(); /* handle PRE-MOVE functions */
|
|---|
| 127 |
|
|---|
| 128 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
|---|
| 129 |
|
|---|
| 130 | cvtime = syrate;
|
|---|
| 131 | ncvwait = curhold;
|
|---|
| 132 |
|
|---|
| 133 | ss_sqsw = -1;
|
|---|
| 134 | cmtype = nc;
|
|---|
| 135 | cvwait = 1;
|
|---|
| 136 | }
|
|---|
| 137 |
|
|---|
| 138 | } else
|
|---|
| 139 | stdmkey();
|
|---|
| 140 |
|
|---|
| 141 | } else {
|
|---|
| 142 |
|
|---|
| 143 | if (stccol EQ 48) {
|
|---|
| 144 |
|
|---|
| 145 | ss_sqsw = 0;
|
|---|
| 146 | cvwait = 1;
|
|---|
| 147 | ncvwait = cvtime;
|
|---|
| 148 | cmfirst = TRUE;
|
|---|
| 149 |
|
|---|
| 150 | if (ss_ptsw EQ 0)
|
|---|
| 151 | (*xy_up)();
|
|---|
| 152 |
|
|---|
| 153 | (*pstmove)(); /* handle POST-MOVE functions */
|
|---|
| 154 |
|
|---|
| 155 | } else
|
|---|
| 156 | stdmkey();
|
|---|
| 157 | }
|
|---|
| 158 | }
|
|---|
| 159 |
|
|---|
| 160 | /* |
|---|
| 161 |
|
|---|
| 162 | */
|
|---|
| 163 |
|
|---|
| 164 | /*
|
|---|
| 165 | =============================================================================
|
|---|
| 166 | sqekey() -- E key processing for the sequence display
|
|---|
| 167 | =============================================================================
|
|---|
| 168 | */
|
|---|
| 169 |
|
|---|
| 170 | void sqekey(void)
|
|---|
| 171 | {
|
|---|
| 172 | register short nc;
|
|---|
| 173 |
|
|---|
| 174 | if (astat) {
|
|---|
| 175 |
|
|---|
| 176 | if (stccol EQ 48) {
|
|---|
| 177 |
|
|---|
| 178 | if (ss_ptsw EQ 0) {
|
|---|
| 179 |
|
|---|
| 180 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
|---|
| 181 |
|
|---|
| 182 | (*premove)(); /* handle PRE-MOVE functions */
|
|---|
| 183 |
|
|---|
| 184 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
|---|
| 185 |
|
|---|
| 186 | cvtime = syrate;
|
|---|
| 187 | ncvwait = curhold;
|
|---|
| 188 |
|
|---|
| 189 | ss_sqsw = 1;
|
|---|
| 190 | cmtype = nc;
|
|---|
| 191 | cvwait = 1;
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | } else
|
|---|
| 195 | select();
|
|---|
| 196 |
|
|---|
| 197 | } else {
|
|---|
| 198 |
|
|---|
| 199 | if (stccol EQ 48) {
|
|---|
| 200 |
|
|---|
| 201 | ss_sqsw = 0;
|
|---|
| 202 | cvwait = 1;
|
|---|
| 203 | ncvwait = cvtime;
|
|---|
| 204 | cmfirst = TRUE;
|
|---|
| 205 |
|
|---|
| 206 | if (ss_ptsw EQ 0)
|
|---|
| 207 | (*xy_up)();
|
|---|
| 208 |
|
|---|
| 209 | (*pstmove)(); /* handle POST-MOVE functions */
|
|---|
| 210 |
|
|---|
| 211 | } else
|
|---|
| 212 | select();
|
|---|
| 213 | }
|
|---|
| 214 | }
|
|---|
| 215 |
|
|---|
| 216 | /* |
|---|
| 217 |
|
|---|
| 218 | */
|
|---|
| 219 |
|
|---|
| 220 | /*
|
|---|
| 221 | =============================================================================
|
|---|
| 222 | sqxkey() -- delete key handler
|
|---|
| 223 | =============================================================================
|
|---|
| 224 | */
|
|---|
| 225 |
|
|---|
| 226 | void sqxkey(void)
|
|---|
| 227 | {
|
|---|
| 228 | if (NOT astat)
|
|---|
| 229 | return;
|
|---|
| 230 |
|
|---|
| 231 | if (inrange(stccol, 2, 4)) {
|
|---|
| 232 |
|
|---|
| 233 | memsetw(&seqbuf, 0, NSEQW);
|
|---|
| 234 | memsetw(&seqtab[curslin], 0, NSEQW);
|
|---|
| 235 | dsqlin(sqdebuf, curslin);
|
|---|
| 236 | sqdeflg = TRUE;
|
|---|
| 237 | dcursq();
|
|---|
| 238 |
|
|---|
| 239 | } else if (inrange(stccol, 12, 22)) {
|
|---|
| 240 |
|
|---|
| 241 | seqtab[curslin].seqact1 = 0;
|
|---|
| 242 | seqtab[curslin].seqdat1 = 0;
|
|---|
| 243 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
|---|
| 244 | dsqlin(sqdebuf, curslin);
|
|---|
| 245 | sqdeflg = TRUE;
|
|---|
| 246 | dcursq();
|
|---|
| 247 |
|
|---|
| 248 | } else if (inrange(stccol, 24, 34)) {
|
|---|
| 249 |
|
|---|
| 250 | seqtab[curslin].seqact2 = 0;
|
|---|
| 251 | seqtab[curslin].seqdat2 = 0;
|
|---|
| 252 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
|---|
| 253 | dsqlin(sqdebuf, curslin);
|
|---|
| 254 | sqdeflg = TRUE;
|
|---|
| 255 | dcursq();
|
|---|
| 256 |
|
|---|
| 257 | } else if (inrange(stccol, 36, 46)) {
|
|---|
| 258 |
|
|---|
| 259 | seqtab[curslin].seqact3 = 0;
|
|---|
| 260 | seqtab[curslin].seqdat3 = 0;
|
|---|
| 261 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
|---|
| 262 | dsqlin(sqdebuf, curslin);
|
|---|
| 263 | sqdeflg = TRUE;
|
|---|
| 264 | dcursq();
|
|---|
| 265 | }
|
|---|
| 266 | }
|
|---|
| 267 |
|
|---|
| 268 | /* |
|---|
| 269 |
|
|---|
| 270 | */
|
|---|
| 271 |
|
|---|
| 272 | /*
|
|---|
| 273 | =============================================================================
|
|---|
| 274 | sqfield() -- setup field routines for the sequence editor
|
|---|
| 275 | =============================================================================
|
|---|
| 276 | */
|
|---|
| 277 |
|
|---|
| 278 | void sqfield(void)
|
|---|
| 279 | {
|
|---|
| 280 |
|
|---|
| 281 | #if DEBUGIT
|
|---|
| 282 | if (debugsw AND debugqf)
|
|---|
| 283 | printf("sqfield(): ENTRY\n");
|
|---|
| 284 | #endif
|
|---|
| 285 |
|
|---|
| 286 | curset(&sq_flds);
|
|---|
| 287 |
|
|---|
| 288 | #if DEBUGIT
|
|---|
| 289 | if (debugsw AND debugqf)
|
|---|
| 290 | printf("sqfield(): EXIT\n");
|
|---|
| 291 | #endif
|
|---|
| 292 |
|
|---|
| 293 | }
|
|---|