62 static double elmin = 10.0;
63 static double elmax = 90.0;
66 static double Fmin = 68.0;
67 static double Fmax = 900.0;
70 static double tmax = 2600.0;
72 static char tsys_tok[40][40];
73 static int tsys_num = 0;
84 if(p1->freq < p2->freq)
89 if(p1->freq > p2->freq)
102 st_report(
"Sorting %d elements", tsys_num);
117 freq = (int)round(f);
121 if(tsys_freqs[i].
used)
123 if(tsys_freqs[i].freq == freq)
133 if(!tsys_freqs[i].
used)
135 tsys_freqs[i].
used = 1;
156 bzero((
char *)tsys_tok,
sizeof(tsys_tok));
158 token = strtok(edit,
"\n\t ");
159 while(token != (
char *)NULL)
161 sprintf(tsys_tok[c++],
"%s", token);
162 token = strtok((
char *)NULL,
"\n\t ");
173 char tbuf[256], input[1024],
results[256];
177 st_fail(
"No Tsys data to Select From");
181 sprintf(input,
"--list --width=300 --height=400 --text=\"Select Frequencies to Display\" --title=\"Select Frequencies\" --checklist --multiple --column=\"Select\" --column=\"Frequency\" --separator=\" \" ");
183 for(i=0;i<tsys->num;i++)
185 sprintf(tbuf,
"%s %03d ", tsys->freqs[i].used ?
"TRUE" :
"FALSE", tsys->freqs[i].freq);
190 bzero(results,
sizeof(results));
200 for(j=0;j<tsys->num;j++)
202 tsys->freqs[j].used = 0;
207 freq = atoi(tsys_tok[i]);
209 for(j=0;j<tsys->num;j++)
211 if(freq == tsys->freqs[j].freq)
213 tsys->freqs[j].used = 1;
228 int i, j, indx, el,
first = 1;
232 bzero((
char *)&tsys_freqs,
sizeof(tsys_freqs));
245 if(freq < Fmin || freq > Fmax)
250 if(p->
el < elmin || p->
el > elmax)
255 if(fabs(p->
stsys) > tmax)
267 el = (int)(round(p->
el));
269 if(el > 0 && el < 90)
279 st_print(
"Unable to find freq index for scan %.2f\n", p->
scan);
288 if(tsys_freqs[i].used)
292 if(tsys_freqs[i].cnts[el])
311 int i, j,
el,
first=1, fm=68, fx=900;
312 char fname[256], sysBuf[300];
315 sprintf(fname,
"/tmp/%s/tsys.dat",
session);
317 if((fp = fopen(fname,
"w")) == NULL)
319 st_fail(
"Unable to open %s file", fname);
325 for(i=0;i<tsys_send.
num;i++)
354 st_fail(
"No Tsys data to plot3d");
359 sprintf(fname,
"/tmp/%s/tsys.dem",
session);
361 if((fp = fopen(fname,
"w")) == NULL)
363 st_fail(
"Unable to open %s file", fname);
369 fprintf(fp,
"set title \"Tsys vs. Freq\"\n");
370 fprintf(fp,
"set xlabel \"Freq\" \n");
371 fprintf(fp,
"set ylabel \"Elevation\" \n");
372 fprintf(fp,
"set zlabel \"Tsys\" \n");
374 fprintf(fp,
"set key off\n");
375 fprintf(fp,
"set border 4095\n");
378 fprintf(fp,
"set xrange [%d:%d]\n", fm, fx);
379 fprintf(fp,
"set yrange [%f:%f]\n", elmin, elmax);
380 fprintf(fp,
"set zrange [0:]\n");
381 fprintf(fp,
"set xyplane at 0\n");
383 fprintf(fp,
"set samples %d*%d \n", fx-fm, (
int)round(elmax-elmin));
392 fprintf(fp,
"set terminal x11 enhanced size 690, 733 position 2338, 0\n");
393 fprintf(fp,
"splot \"/tmp/%s/tsys.dat\" every 1::0::1024 with lines\n",
session);
394 fprintf(fp,
"pause -1 \"Hit Return When Finished\"\n");
398 sprintf(sysBuf,
"gnuplot %s", fname);
411 bzero((
char *)&tsys_send,
sizeof(tsys_send));
413 strcpy(tsys_send.
magic,
"TSYS_SEND");
420 if(tsys_freqs[i].used)
427 if(tsys_freqs[i].tsys[el])
439 st_fail(
"No Tsys data to Plot");
455 st_report(
"Sent TSYS struct to xgraphics");
467 st_fail(
"No Tsys data to List");
473 for(i=0;i<tsys_send.
num;i++)
561 st_fail(
"Missing arg for 'tsys elmin'");
573 st_fail(
"Missing arg for 'tsys elmax'");
585 st_fail(
"Missing arg for 'tsys fmin'");
597 st_fail(
"Missing arg for 'tsys fmax'");
609 st_fail(
"Missing arg for 'tsys tmax'");
617 st_report(
"TSYS: Freq Min: %9.0f", Fmin);
618 st_report(
"TSYS: Freq Max: %9.0f", Fmax);
619 st_report(
"TSYS: Tsys Max: %9.0f", tmax);
620 st_report(
"TSYS: Num Freqs:%9d", tsys_num);
int sock_write(struct SOCK *s, char *message, int l)
struct RESULTS results[MAX_BKNDS][MAX_BKNDS]
struct PARSE_STACK * args
int findIndex(double f, int first)
int doTsysGUI(struct TSYS_SEND *tsys)
int tsys_get_tok(char *edit)
int doZenity(char *cmd, char *rst)
int meetsCritiria(struct HEADER *p, int mask)
int tsysSort(struct TSYS_ELEM *p1, struct TSYS_ELEM *p2)
struct TSYS_FREQ freqs[MAX_TSYS_FREQS]