1 /* 2 * xnec2c - GTK2-based version of nec2c, the C translation of NEC2 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 /* xnec2c.h 20 * 21 * Common header file for xnec2c 22 */ 23 24 #ifndef COMMON_H 25 #define COMMON_H 1 26 27 #include <complex.h> 28 #include <stdio.h> 29 #include <signal.h> 30 #include <math.h> 31 #include <stdlib.h> 32 #include <unistd.h> 33 #include <string.h> 34 #include <fcntl.h> 35 #include <errno.h> 36 #include <time.h> 37 #include <sys/types.h> 38 #include <sys/times.h> 39 #include <gtk/gtk.h> 40 #include "cexp.h" 41 42 /* commonly used complex constants */ 43 #define CPLX_00 (0.0+I*0.0) 44 #define CPLX_01 (0.0+I*1.0) 45 #define CPLX_10 (1.0+I*0.0) 46 #define CPLX_11 (1.0+I*1.0) 47 48 /* common constants */ 49 #define PI 3.141592654 50 #define POT 1.570796327 51 #define TP 6.283185308 52 #define TA 1.745329252E-02 53 #define TD 57.29577951 54 #define ETA 376.73 55 #define CVEL 299.8 56 #define CONST1 (0.0+I*4.771341189) 57 #define CONST4 (0.0+I*188.365) 58 #define SMIN 1.0e-3 59 60 #define cmplx(r, i) ((r)+I*(i)) 61 62 /* Replaces the "10000" limit used to */ 63 /* identify segment/patch connections */ 64 #define PCHCON 100000 65 66 /* Max length of a line read from input file */ 67 #define LINE_LEN 135 68 69 /* Size of char arrays (strings) for error messages etc */ 70 #define MESG_SIZE 128 71 72 /* Type of projection parameters stuct */ 73 #define STRUCTURE_DRAWINGAREA 1 74 #define RDPATTERN_DRAWINGAREA 2 75 76 /* Some colors for settinn cairo context */ 77 #define WHITE 1.0, 1.0, 1.0 78 #define RED 1.0, 0.0, 0.0 79 #define YELLOW 1.0, 1.0, 0.0 80 #define GREEN 0.0, 1.0, 0.0 81 #define CYAN 0.0, 1.0, 1.0 82 #define BLUE 0.0, 0.0, 1.0 83 #define MAGENTA 1.0, 0.0, 1.0 84 #define GREY 0.5, 0.5, 0.5 85 #define BLACK 0.0, 0.0, 0.0 86 87 /* For read/write pipes */ 88 #define READ 0 89 #define WRITE 1 90 91 /* Response to error dialog box */ 92 #define ERR_OK FALSE 93 #define ERR_STOP TRUE 94 95 /*** Flow control flags ***/ 96 /* Freq Loop Control flags */ 97 #define FREQ_LOOP_RUNNING 0x0000000000000001ll 98 #define FREQ_LOOP_DONE 0x0000000000000002ll 99 #define FREQ_LOOP_INIT 0x0000000000000004ll 100 #define FREQ_LOOP_STOP 0x0000000000000008ll 101 #define FREQ_LOOP_FLAGS 0x000000000000000Fll 102 103 /* Main Window Control flags */ 104 #define DRAW_CURRENTS 0x0000000000000010ll 105 #define DRAW_CHARGES 0x0000000000000020ll 106 #define COMMON_PROJECTION 0x0000000000000040ll 107 #define COMMON_FREQUENCY 0x0000000000000080ll 108 #define MAIN_NEW_FREQ 0x0000000000000100ll 109 #define MAIN_QUIT 0x0000000000000200ll 110 111 /* Freq Plot Control flags */ 112 #define PLOT_ZREAL_ZIMAG 0x0000000000000400ll 113 #define PLOT_VSWR 0x0000000000000800ll 114 #define PLOT_ZMAG_ZPHASE 0x0000000000001000ll 115 #define PLOT_GMAX 0x0000000000002000ll 116 #define PLOT_GVIEWER 0x0000000000004000ll 117 #define PLOT_NETGAIN 0x0000000000008000ll 118 #define PLOT_GAIN_DIR 0x0000000000010000ll 119 #define PLOT_FREQ_LINE 0x0000000000020000ll 120 #define PLOT_SELECT 0x0000000000040000ll 121 #define PLOT_ENABLED 0x0000000000080000ll 122 #define PLOT_QUIT 0x0000000000100000ll 123 #define PLOT_FLAGS 0x00000000001FFC00ll 124 125 /* Radiation Pattern Control flags */ 126 #define DRAW_GAIN 0x0000000000200000ll 127 #define DRAW_EFIELD 0x0000000000400000ll 128 #define DRAW_HFIELD 0x0000000000800000ll 129 #define DRAW_EHFIELD 0x0000000001000000ll 130 #define DRAW_POYNTING 0x0000000002000000ll 131 #define DRAW_ENABLED 0x0000000004000000ll 132 #define DRAW_QUIT 0x0000000008000000ll 133 #define DRAW_NEW_RDPAT 0x0000000010000000ll 134 #define DRAW_NEW_EHFIELD 0x0000000020000000ll 135 #define OVERLAY_STRUCT 0x0000000040000000ll 136 #define NEAREH_SNAPSHOT 0x0000000080000000ll 137 #define NEAREH_ANIMATE 0x0000000100000000ll 138 #define ENABLE_RDPAT 0x0000000200000000ll 139 #define ENABLE_NEAREH 0x0000000400000000ll 140 #define DRAW_FLAGS 0x00000001FFE00000ll 141 #define RDPAT_FLAGS 0x0000000600000000ll 142 143 /* NEC2 editor flags */ 144 #define NEC2_EDIT_SAVE 0x0000000800000000ll /* Save NEC2 editor data to a file */ 145 #define NEC2_SAVE 0x0000001000000000ll /* Saving to a NEC2 input file */ 146 147 /* Structure/rad pattern/freq. plots image save */ 148 #define IMAGE_SAVE 0x0000002000000000ll 149 150 /* Save gnuplot data */ 151 #define RDPAT_GNUPLOT_SAVE 0x0000004000000000ll 152 #define PLOTS_GNUPLOT_SAVE 0x0000008000000000ll 153 #define STRCT_GNUPLOT_SAVE 0x0000010000000000ll 154 155 /* All filechooser save flags */ 156 #define ALL_SAVE_FLAGS 0x000001F000000000ll 157 158 /* Other flags */ 159 #define ERROR_CONDX 0x0000020000000000ll 160 #define INPUT_PENDING 0x0000040000000000ll 161 #define ENABLE_EXCITN 0x0000080000000000ll 162 163 /* Allocation control flags */ 164 #define ALLOC_NEAREH_BUFF 0x0000100000000000ll 165 #define ALLOC_RDPAT_BUFF 0x0000200000000000ll 166 #define ALLOC_PNTING_BUFF 0x0000400000000000ll 167 168 #define ALL_FLAGS 0xffffffffffffffffll 169 170 /* Type of near field data requested */ 171 #define NEAR_EFIELD 0x01 172 #define NEAR_HFIELD 0x02 173 #define NEAR_EHFIELD 0x03 174 175 #define CHILD isChild() 176 177 /* Gain Scaling style */ 178 enum GAIN_SCALE 179 { 180 GS_LINP = 0, 181 GS_LINV, 182 GS_ARRL, 183 GS_LOG, 184 NUM_SCALES 185 }; 186 187 /* Polarization type */ 188 enum POL_TYPE 189 { 190 POL_TOTAL = 0, 191 POL_HORIZ, 192 POL_VERT, 193 POL_RHCP, 194 POL_LHCP, 195 NUM_POL 196 }; 197 198 /*** Structs encapsulating global ("common") variables ***/ 199 /* common /crnt/ */ 200 typedef struct 201 { 202 double 203 *air, /* Ai/lambda, real part */ 204 *aii, /* Ai/lambda, imaginary part */ 205 *bir, /* Bi/lambda, real part */ 206 *bii, /* Bi/lambda, imaginary part */ 207 *cir, /* Ci/lambda, real part */ 208 *cii; /* Ci/lambda, imaginary part */ 209 210 complex double *cur; /* Amplitude of basis function */ 211 212 char newer; /* New data available */ 213 char valid; /* Available data valid */ 214 215 } crnt_t; 216 217 /* common /data/ (geometry data) */ 218 typedef struct 219 { 220 int 221 n, /* Number of wire segments */ 222 np, /* Number of wire segments in symmetry cell */ 223 m, /* Number of surface patches */ 224 mp, /* Number of surface patches in symmetry cell */ 225 npm, /* = n+m */ 226 np2m, /* = n+2m */ 227 np3m, /* = n+3m */ 228 ipsym, /* Symmetry flag */ 229 *icon1, /* Segments end 1 connection */ 230 *icon2, /* Segments end 2 connection */ 231 *itag; /* Segments tag number */ 232 233 /* Wire segment data */ 234 double 235 *x1, *y1, *z1, /* End 1 coordinates of wire segments */ 236 *x2, *y2, *z2, /* End 2 coordinates of wire segments */ 237 *x, *y, *z, /* Coordinates of segment centers */ 238 *si, *bi, /* Length and radius of segments */ 239 *cab, /* cos(a)*cos(b) */ 240 *sab, /* cos(a)*sin(b) */ 241 *salp, /* Z component - sin(a) */ 242 243 /* Surface patch data */ 244 *t1x, *t1y, *t1z, /* Coordinates of t1 vector */ 245 *t2x, *t2y, *t2z, /* Coordinates of t2 vector */ 246 *px, *py, *pz, /* Coordinates of patch center */ 247 *pbi, /* Patch surface area */ 248 *psalp, /* Z component - sin(a) */ 249 250 /* Wavelength in meters */ 251 wlam; 252 253 /* My addition, for plotting patches */ 254 double 255 *px1, *py1, *pz1, 256 *px2, *py2, *pz2; 257 258 } data_t; 259 260 /* common /dataj/ */ 261 typedef struct 262 { 263 int 264 iexk, 265 ind1, 266 indd1, 267 ind2, 268 indd2, 269 ipgnd; 270 271 double 272 s, 273 b, 274 xj, 275 yj, 276 zj, 277 cabj, 278 sabj, 279 salpj, 280 rkh, 281 t1xj, 282 t1yj, 283 t1zj, 284 t2xj, 285 t2yj, 286 t2zj; 287 288 complex double 289 exk, 290 eyk, 291 ezk, 292 exs, 293 eys, 294 ezs, 295 exc, 296 eyc, 297 ezc; 298 299 } dataj_t; 300 301 /* common /fpat/ */ 302 typedef struct 303 { 304 int 305 near, 306 nfeh, 307 nrx, 308 nry, 309 nrz, 310 nth, 311 nph, 312 ipd, 313 iavp, 314 inor, 315 iax, 316 ixtyp; 317 318 /* xpr6 moved to exec_data_t */ 319 double 320 thets, 321 phis, 322 dth, 323 dph, 324 rfld, 325 gnor, 326 clt, 327 cht, 328 epsr2, 329 sig2, 330 pinr, 331 pnlr, 332 ploss, 333 xnr, 334 ynr, 335 znr, 336 dxnr, 337 dynr, 338 dznr; 339 340 } fpat_t; 341 342 /*common /ggrid/ */ 343 typedef struct 344 { 345 int 346 *nxa, 347 *nya; 348 349 double 350 *dxa, 351 *dya, 352 *xsa, 353 *ysa; 354 355 complex double 356 epscf, 357 *ar1, 358 *ar2, 359 *ar3; 360 361 } ggrid_t; 362 363 /* common /gnd/ */ 364 typedef struct 365 { 366 int 367 ksymp, /* Ground flag */ 368 ifar, /* Int flag in RP card, for far field calculations */ 369 iperf, /* Type of ground flag */ 370 nradl; /* Number of radials in ground screen */ 371 372 double 373 t2, /* Const for radial wire ground impedance */ 374 cl, /* Distance in wavelengths of cliff edge from origin */ 375 ch, /* Cliff height in wavelengths */ 376 scrwl, /* Wire length in radial ground screen normalized to w/length */ 377 scrwr; /* Radius of wires in screen in wavelengths */ 378 379 complex double 380 zrati, /* Ground medium [Er-js/wE0]^-1/2 */ 381 zrati2, /* As above for 2nd ground medium */ 382 t1, /* Const for radial wire ground impedance */ 383 frati; /* (k1^2-k2^2)/(k1^2+k2^2), k1=w(E0Mu0)^1/2, k1=k2/ZRATI */ 384 385 } gnd_t; 386 387 /* common /gwav/ */ 388 typedef struct 389 { 390 double 391 r1, /* Distance from current element to point where field is evaluated */ 392 r2, /* Distance from image of element to point where field is evaluated */ 393 zmh, /* Z-Z', Z is height of field evaluation point */ 394 zph; /* Z+Z', Z' is height of current element */ 395 396 complex double 397 u, /* (Er-jS/WE0)^-1/2 */ 398 u2, /* u^2 */ 399 xx1, /* G1*exp(jkR1*r[i]) */ 400 xx2; /* G2*exp(jkR2*r'[i]) */ 401 402 } gwav_t; 403 404 /* common /incom/ */ 405 typedef struct 406 { 407 int isnor; 408 409 double 410 xo, 411 yo, 412 zo, 413 sn, 414 xsn, 415 ysn; 416 417 } incom_t; 418 419 /* common /matpar/ (matrix parameters) */ 420 typedef struct 421 { 422 int 423 icase, /* Storage mode of primary matrix */ 424 npblk, /* Num of blocks in first (NBLOKS-1) blocks */ 425 nlast, /* Num of blocks in last block */ 426 imat; /* Storage reserved in CM for primary NGF matrix A */ 427 428 } matpar_t; 429 430 /* common /netcx/ */ 431 typedef struct 432 { 433 int 434 masym, /* Matrix symmetry flags */ 435 neq, 436 npeq, 437 neq2, 438 nonet, /* Number of two-port networks */ 439 ntsol, /* "Network equations are solved" flag */ 440 nprint, /* Print control flag */ 441 *iseg1, /* Num of seg to which port 1 of network is connected */ 442 *iseg2, /* Num of seg to which port 2 of network is connected */ 443 *ntyp; /* Type of networks */ 444 445 double 446 *x11r, /* Real and imaginary parts of network impedances */ 447 *x11i, 448 *x12r, 449 *x12i, 450 *x22r, 451 *x22i, 452 pin, /* Total input power from sources */ 453 pnls; /* Power lost in networks */ 454 455 complex double zped; 456 457 } netcx_t; 458 459 /* common /save/ */ 460 typedef struct 461 { 462 int *ip; /* Vector of indices of pivot elements used to factor matrix */ 463 464 double 465 epsr, /* Relative dielectric constant of ground */ 466 sig, /* Conductivity of ground */ 467 scrwlt, /* Length of radials in ground screen approximation */ 468 scrwrt, /* Radius of wires in ground screen approximation */ 469 fmhz, /* Saved frequency of operation */ 470 last_freq; /* My addition, Last frequency used in calculations */ 471 472 /* My addition, replace xtemp, ytemp etc in freq. loop */ 473 double 474 *xtemp, 475 *ytemp, 476 *ztemp, 477 *sitemp, 478 *bitemp; 479 480 double *freq; /* My addition, frequencies used in freq loop */ 481 char *fstep; /* My addition, freq loop steps that returned results */ 482 483 } save_t; 484 485 /* common /segj/ */ 486 typedef struct 487 { 488 int 489 *jco, /* Stores connection data */ 490 jsno, /* Total number of entries in ax, bx, cx */ 491 maxcon; /* Max. no. connections */ 492 493 double 494 *ax, *bx, *cx; /* Store constants A, B, C used in current expansion */ 495 496 } segj_t; 497 498 /* common /smat/ */ 499 typedef struct 500 { 501 int nop; /* My addition */ 502 503 complex double *ssx; 504 505 } smat_t; 506 507 /* common /vsorc/ */ 508 typedef struct 509 { 510 int 511 *isant, /* Num of segs on which an aplied field source is located */ 512 *ivqd, /* Num of segs on which a current-slope discontinuity source is located */ 513 *iqds, /* Same as above (?) */ 514 nsant, /* Number of applied field voltage sources */ 515 nvqd, /* Number of applied current-slope discontinuity sources */ 516 nqds; /* Same as above (?) */ 517 518 complex double 519 *vqd, /* Voltage of applied-current slope discontinuity sources */ 520 *vqds, /* Same as above (?) */ 521 *vsant; /* Voltages of applied field voltage sources */ 522 523 } vsorc_t; 524 525 /* common /yparm/ */ 526 /* CP card support has been dropped */ 527 528 /* common /zload/ */ 529 typedef struct 530 { 531 int 532 *ldsegn, /* My addition, loaded segment numbers */ 533 *ldtype, /* My addition, loading type */ 534 nldseg, /* My addition, number of loaded segs */ 535 nload; /* Number of loading networks */ 536 537 complex double *zarray; /* = Zi/(Di/lambda) */ 538 539 } zload_t; 540 541 /* Parameters for projecting points on screen */ 542 typedef struct 543 { 544 double 545 Wi, /* Angle (inclination) of Z axis to Screen, +ve to viewer */ 546 Wr, /* Rotation of X-Y plane around Z axis, +ve clockwise */ 547 sin_wi, /* sin(Wi) */ 548 cos_wi, /* cos(Wi) */ 549 sin_wr, /* sin(Wr) */ 550 cos_wr, /* cos(Wr) */ 551 r_max, /* Max distance from xyz origin of a point in antenna */ 552 xy_scale1, /* Scale factor to fit structure into drawable window */ 553 xy_scale, /* Scale factor incorporating zoom factor */ 554 xy_zoom, /* Structure Zoom factor */ 555 x_center, /* X co-ordinate of xyz axes origin in screen's drawable */ 556 y_center; /* Y co-ordinate of xyz axes origin in screen's drawable */ 557 558 int 559 pixmap_width, /* Width of drawable's backing pixmap */ 560 pixmap_height; /* Height of drawable's backing pixmap */ 561 562 char type; /* Type of projection parameters stuct */ 563 564 gboolean reset; /* Reset flag needed in some functions */ 565 566 } projection_parameters_t; 567 568 /* My addition, struct to hold data needed 569 * to execute various calculations requested 570 * by commands like EX, RP, NH, NE etc. 571 */ 572 typedef struct 573 { 574 int 575 *ldtyp, 576 *ldtag, 577 *ldtagf, 578 *ldtagt, 579 nthi, 580 nphi, 581 iexk, 582 iped, 583 ifrq, /* Frequency specification flag */ 584 nfrq, /* Number of frequency steps */ 585 fstep, /* Frequency step */ 586 lastf, /* Last frequency step */ 587 ngraph, /* Number of graphs to be plotted */ 588 pol_type, /* User-specified Polarization type for plots and patterns */ 589 num_jobs; /* Number of child processes (jobs) to fork */ 590 591 double 592 *zlr, 593 *zli, 594 *zlc; 595 596 double 597 xpr1, 598 xpr2, 599 xpr3, 600 xpr4, 601 xpr5, 602 xpr6, 603 rkh, 604 zpnorm, 605 thetis, 606 phiss, 607 fmhz, /* Frequency in MHz, moved from save_t */ 608 delfrq; /* Frequency step for freq loop */ 609 610 double 611 mxfrq, /* Max frequency in freq loop */ 612 zo; /* Characteristic impedance used in VSWR calcs */ 613 614 } calc_data_t; 615 616 /* Impedance data */ 617 typedef struct 618 { 619 double 620 *zreal, /* Real part of input impedance */ 621 *zimag, /* Imag part of input impedance */ 622 *zmagn, /* Magnitude of input impedance */ 623 *zphase; /* Phase ang of input impedance */ 624 625 } impedance_data_t; 626 627 /* Radiation pattern data */ 628 typedef struct 629 { 630 double 631 *gtot, /* Radiation pattern (total gain) buffer */ 632 *max_gain, /* Maximum gain for each polarization type */ 633 *min_gain, /* Minimum gain for each polarization type */ 634 *max_gain_tht, /* Theta angle where maximum gain occurs */ 635 *max_gain_phi, /* Phi angle where minimum gain occurs */ 636 *tilt, /* Tilt angle of polarization ellipse */ 637 *axrt; /* Elliptic axial ratio of pol ellipse */ 638 639 int 640 *max_gain_idx, /* Where in rad_pattern.gtot the max value occurs */ 641 *min_gain_idx, /* Where in rad_pattern.gtot the min value occurs */ 642 *sens; /* Polarization sense (vertical, horizontal, elliptic etc) */ 643 644 } rad_pattern_t; 645 646 /* Near E/H field data */ 647 typedef struct 648 { 649 double 650 /* Magnitude and phase of E/H fields */ 651 *ex, *ey, *ez, *hx, *hy, *hz, 652 *fex, *fey, *fez, *fhx, *fhy, *fhz, 653 /* Real part of E and H field values */ 654 *erx, *ery, *erz, *er, 655 *hrx, *hry, *hrz, *hr; 656 657 /* Max of E/H field values */ 658 double 659 max_er, max_hr; 660 661 /* Co-ordinates of field points and 662 * max distance from xyz origin */ 663 double 664 *px, *py, *pz, r_max; 665 666 /* Animation step in rads */ 667 double anim_step; 668 669 char newer; /* New data available */ 670 char valid; /* Available data valid */ 671 672 } near_field_t; 673 674 /* Forked processes data */ 675 typedef struct 676 { 677 pid_t child_pid; /* Child pid */ 678 int pnt2child_pipe[2]; /* Parent-to-child write pipe */ 679 int child2pnt_pipe[2]; /* Child-to-parent write pipe */ 680 char busy; /* Child process busy flag */ 681 int fstep; /* Frequency step assigned to child */ 682 683 /* File descriptor sets for select() */ 684 fd_set read_fds; 685 fd_set write_fds; 686 687 } forked_proc_data_t; 688 689 /* Function prototypes produced by cproto */ 690 /* calculations.c */ 691 void qdsrc(int is, _Complex double v, _Complex double *e); 692 void cabc(_Complex double *curx); 693 double db10(double x); 694 double db20(double x); 695 void intrp(double x, double y, _Complex double *f1, _Complex double *f2, _Complex double *f3, _Complex double *f4); 696 void intx(double el1, double el2, double b, int ij, double *sgr, double *sgi); 697 int min(int a, int b); 698 void test(double f1r, double f2r, double *tr, double f1i, double f2i, double *ti, double dmin); 699 void sbf(int i, int is, double *aa, double *bb, double *cc); 700 void tbf(int i, int icap); 701 void trio(int j); 702 double cang(_Complex double z); 703 void zint(double sigl, double rolam, _Complex double *zint); 704 /* callback_func.c */ 705 void Save_Pixmap(GdkPixmap *pixmap, int pixmap_width, int pixmap_height, char *filename); 706 void New_Viewer_Angle(double wr, double wi, GtkSpinButton *wr_spb, GtkSpinButton *wi_spb, projection_parameters_t *params); 707 void Set_Spin_Button(GtkSpinButton *spin, gdouble value); 708 void Create_Pixmap(GdkPixmap **pixmap, int *pixmap_width, int *pixmap_height, GtkWidget *widget, GdkEventConfigure *event, projection_parameters_t *params); 709 void Motion_Event(GdkEventMotion *event, projection_parameters_t *params); 710 void Plot_Select(GtkToggleButton *togglebutton, unsigned long long int flag); 711 void Delete_Event(gchar *message); 712 void Set_Pol_Menuitem(GtkMenuItem *menuitem); 713 void Close_Windows(void); 714 gboolean Open_Editor(GtkTreeView *view); 715 void Main_Rdpattern_Activate(gboolean from_menu); 716 gboolean Main_Freqplots_Activate(void); 717 void Rdpattern_Gain_Togglebutton_Toggled(gboolean flag); 718 void Rdpattern_EH_Togglebutton_Toggled(gboolean flag); 719 void Main_Currents_Togglebutton_Toggled(gboolean flag); 720 void Main_Charges_Togglebutton_Toggled(gboolean flag); 721 void Open_Nec2_Editor(int action); 722 gboolean Nec2_Apply_Checkbutton(void); 723 void Gtk_Quit(void); 724 void Pass_EH_Flags(void); 725 void Alloc_Crnt_Buffs(void); 726 void Free_Crnt_Buffs(void); 727 /* callbacks.c */ 728 void on_main_window_destroy(GtkObject *object, gpointer user_data); 729 gboolean on_main_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 730 void on_new_activate(GtkMenuItem *menuitem, gpointer user_data); 731 void on_open_input_activate(GtkMenuItem *menuitem, gpointer user_data); 732 void on_main_save_activate(GtkMenuItem *menuitem, gpointer user_data); 733 void on_main_save_as_activate(GtkMenuItem *menuitem, gpointer user_data); 734 void on_struct_save_as_gnuplot_activate(GtkMenuItem *menuitem, gpointer user_data); 735 void on_quit_activate(GtkMenuItem *menuitem, gpointer user_data); 736 void on_main_rdpattern_activate(GtkMenuItem *menuitem, gpointer user_data); 737 void on_main_freqplots_activate(GtkMenuItem *menuitem, gpointer user_data); 738 void on_rdpattern_total_activate(GtkMenuItem *menuitem, gpointer user_data); 739 void on_rdpattern_horizontal_activate(GtkMenuItem *menuitem, gpointer user_data); 740 void on_rdpattern_vertical_activate(GtkMenuItem *menuitem, gpointer user_data); 741 void on_rdpattern_right_hand_activate(GtkMenuItem *menuitem, gpointer user_data); 742 void on_rdpattern_left_hand_activate(GtkMenuItem *menuitem, gpointer user_data); 743 void on_common_projection_activate(GtkMenuItem *menuitem, gpointer user_data); 744 void on_common_freq_activate(GtkMenuItem *menuitem, gpointer user_data); 745 void on_main_x_axis_clicked(GtkButton *button, gpointer user_data); 746 void on_main_y_axis_clicked(GtkButton *button, gpointer user_data); 747 void on_main_z_axis_clicked(GtkButton *button, gpointer user_data); 748 void on_main_default_view_clicked(GtkButton *button, gpointer user_data); 749 void on_main_rotate_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 750 void on_main_incline_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 751 void on_main_currents_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 752 void on_main_charges_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 753 gboolean on_main_colorcode_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data); 754 void on_main_freq_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 755 void on_main_freq_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 756 void on_main_new_freq_clicked(GtkButton *button, gpointer user_data); 757 gboolean on_structure_drawingarea_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data); 758 gboolean on_structure_drawingarea_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data); 759 gboolean on_structure_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data); 760 void on_filechooserdialog_response(GtkDialog *dialog, gint response_id, gpointer user_data); 761 void on_fileselection_response(GtkDialog *dialog, gint response_id, gpointer user_data); 762 gboolean on_freqplots_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 763 void on_freqplots_window_destroy(GtkObject *object, gpointer user_data); 764 void on_freqplots_save_activate(GtkMenuItem *menuitem, gpointer user_data); 765 void on_freqplots_save_as_activate(GtkMenuItem *menuitem, gpointer user_data); 766 void on_freqplots_save_as_gnuplot_activate(GtkMenuItem *menuitem, gpointer user_data); 767 void on_freqplots_gmax_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 768 void on_freqplots_gdir_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 769 void on_freqplots_gviewer_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 770 void on_freqplots_vswr_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 771 void on_freqplots_zo_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 772 void on_freqplots_zrlzim_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 773 void on_freqplots_zmgzph_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 774 gboolean on_freqplots_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data); 775 gboolean on_freqplots_drawingarea_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data); 776 gboolean on_freqplots_drawingarea_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 777 void on_rdpattern_window_destroy(GtkObject *object, gpointer user_data); 778 gboolean on_rdpattern_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 779 void on_rdpattern_save_activate(GtkMenuItem *menuitem, gpointer user_data); 780 void on_rdpattern_save_as_activate(GtkMenuItem *menuitem, gpointer user_data); 781 void on_rdpattern_save_as_gnuplot_activate(GtkMenuItem *menuitem, gpointer user_data); 782 void on_rdpattern_linear_power_activate(GtkMenuItem *menuitem, gpointer user_data); 783 void on_rdpattern_linear_voltage_activate(GtkMenuItem *menuitem, gpointer user_data); 784 void on_rdpattern_arrl_style_activate(GtkMenuItem *menuitem, gpointer user_data); 785 void on_rdpattern_logarithmic_activate(GtkMenuItem *menuitem, gpointer user_data); 786 void on_rdpattern_e_field_activate(GtkMenuItem *menuitem, gpointer user_data); 787 void on_rdpattern_h_field_activate(GtkMenuItem *menuitem, gpointer user_data); 788 void on_rdpattern_poynting_vector_activate(GtkMenuItem *menuitem, gpointer user_data); 789 void on_rdpattern_overlay_structure_activate(GtkMenuItem *menuitem, gpointer user_data); 790 void on_rdpattern_x_axis_clicked(GtkButton *button, gpointer user_data); 791 void on_rdpattern_y_axis_clicked(GtkButton *button, gpointer user_data); 792 void on_rdpattern_z_axis_clicked(GtkButton *button, gpointer user_data); 793 void on_rdpattern_default_view_clicked(GtkButton *button, gpointer user_data); 794 void on_rdpattern_rotate_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 795 void on_rdpattern_incline_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 796 void on_rdpattern_gain_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 797 void on_rdpattern_eh_togglebutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 798 gboolean on_rdpattern_colorcode_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data); 799 void on_rdpattern_freq_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 800 void on_rdpattern_new_freq_clicked(GtkButton *button, gpointer user_data); 801 gboolean on_rdpattern_drawingarea_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data); 802 gboolean on_rdpattern_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data); 803 gboolean on_rdpattern_drawingarea_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data); 804 void on_quit_cancelbutton_clicked(GtkButton *button, gpointer user_data); 805 void on_quit_okbutton_clicked(GtkButton *button, gpointer user_data); 806 void main_view_menuitem_activate(GtkMenuItem *menuitem, gpointer user_data); 807 void main_pol_menu_activate(GtkMenuItem *menuitem, gpointer user_data); 808 void freqplots_pol_menu_activate(GtkMenuItem *menuitem, gpointer user_data); 809 void rdpattern_view_menuitem_activate(GtkMenuItem *menuitem, gpointer user_data); 810 void rdpattern_pol_menu_activate(GtkMenuItem *menuitem, gpointer user_data); 811 void on_filechoser_cancel_clicked(GtkButton *button, gpointer user_data); 812 void on_fileselection_cancel_clicked(GtkButton *button, gpointer user_data); 813 void on_near_peak_value_activate(GtkMenuItem *menuitem, gpointer user_data); 814 void on_near_snapshot_activate(GtkMenuItem *menuitem, gpointer user_data); 815 void on_rdpattern_animate_activate(GtkMenuItem *menuitem, gpointer user_data); 816 void on_animation_applybutton_clicked(GtkButton *button, gpointer user_data); 817 void on_animation_cancelbutton_clicked(GtkButton *button, gpointer user_data); 818 void on_animation_okbutton_clicked(GtkButton *button, gpointer user_data); 819 void on_animate_dialog_destroy(GtkObject *object, gpointer user_data); 820 void on_quit_dialog_destroy(GtkObject *object, gpointer user_data); 821 gboolean on_error_dialog_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 822 void on_nec2_edit_activate(GtkMenuItem *menuitem, gpointer user_data); 823 gboolean on_nec2_editor_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 824 void on_nec2_editor_destroy(GtkObject *object, gpointer user_data); 825 void on_nec2_save_clicked(GtkButton *button, gpointer user_data); 826 void on_nec2_save_as_clicked(GtkButton *button, gpointer user_data); 827 void on_nec2_row_add_clicked(GtkButton *button, gpointer user_data); 828 void on_nec2_row_remv_clicked(GtkButton *button, gpointer user_data); 829 void on_nec2_treeview_clear_clicked(GtkButton *button, gpointer user_data); 830 gboolean on_nec2_cmnt_treeview_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 831 gboolean on_nec2_geom_treeview_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 832 gboolean on_nec2_cmnd_treeview_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 833 void on_nec2_revert_clicked(GtkButton *button, gpointer user_data); 834 void on_error_stopbutton_clicked(GtkButton *button, gpointer user_data); 835 void on_error_okbutton_clicked(GtkButton *button, gpointer user_data); 836 void on_error_quitbutton_clicked(GtkButton *button, gpointer user_data); 837 void on_wire_editor_destroy(GtkObject *object, gpointer user_data); 838 void on_wire_pcl_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 839 void on_wire_data_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 840 void on_wire_tagnum_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 841 void on_wire_len_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 842 void on_wire_taper_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 843 void on_wire_rlen_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 844 void on_wire_rdia_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 845 void on_wire_new_button_clicked(GtkButton *button, gpointer user_data); 846 void on_wire_res_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 847 void on_wire_cancel_button_clicked(GtkButton *button, gpointer user_data); 848 void on_wire_apply_button_clicked(GtkButton *button, gpointer user_data); 849 void on_wire_ok_button_clicked(GtkButton *button, gpointer user_data); 850 void on_gw_clicked(GtkButton *button, gpointer user_data); 851 void on_ga_clicked(GtkButton *button, gpointer user_data); 852 void on_gh_clicked(GtkButton *button, gpointer user_data); 853 void on_sp_clicked(GtkButton *button, gpointer user_data); 854 void on_gr_clicked(GtkButton *button, gpointer user_data); 855 void on_gm_clicked(GtkButton *button, gpointer user_data); 856 void on_gx_clicked(GtkButton *button, gpointer user_data); 857 void on_gs_clicked(GtkButton *button, gpointer user_data); 858 void on_ex_clicked(GtkButton *button, gpointer user_data); 859 void on_fr_clicked(GtkButton *button, gpointer user_data); 860 void on_gn_clicked(GtkButton *button, gpointer user_data); 861 void on_gd_clicked(GtkButton *button, gpointer user_data); 862 void on_rp_clicked(GtkButton *button, gpointer user_data); 863 void on_ld_clicked(GtkButton *button, gpointer user_data); 864 void on_nt_clicked(GtkButton *button, gpointer user_data); 865 void on_tl_clicked(GtkButton *button, gpointer user_data); 866 void on_ne_clicked(GtkButton *button, gpointer user_data); 867 void on_ek_clicked(GtkButton *button, gpointer user_data); 868 void on_kh_clicked(GtkButton *button, gpointer user_data); 869 void on_xq_clicked(GtkButton *button, gpointer user_data); 870 void on_patch_data_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 871 void on_patch_new_button_clicked(GtkButton *button, gpointer user_data); 872 void on_patch_cancel_button_clicked(GtkButton *button, gpointer user_data); 873 void on_patch_apply_button_clicked(GtkButton *button, gpointer user_data); 874 void on_patch_ok_button_clicked(GtkButton *button, gpointer user_data); 875 void on_patch_editor_destroy(GtkObject *object, gpointer user_data); 876 void on_patch_arbitrary_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 877 void on_patch_rectangular_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 878 void on_patch_triangular_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 879 void on_patch_quadrilateral_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 880 void on_patch_surface_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 881 void on_arc_data_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 882 void on_arc_tagnum_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 883 void on_arc_res_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 884 void on_arc_new_button_clicked(GtkButton *button, gpointer user_data); 885 void on_arc_cancel_button_clicked(GtkButton *button, gpointer user_data); 886 void on_arc_apply_button_clicked(GtkButton *button, gpointer user_data); 887 void on_arc_ok_button_clicked(GtkButton *button, gpointer user_data); 888 void on_arc_editor_destroy(GtkObject *object, gpointer user_data); 889 void on_arc_pcl_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 890 void on_helix_tagnum_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 891 void on_helix_pcl_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 892 void on_helix_nturns_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 893 void on_helix_res_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 894 void on_helix_lh_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 895 void on_helix_data_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 896 void on_helix_new_button_clicked(GtkButton *button, gpointer user_data); 897 void on_helix_cancel_button_clicked(GtkButton *button, gpointer user_data); 898 void on_helix_apply_button_clicked(GtkButton *button, gpointer user_data); 899 void on_helix_ok_button_clicked(GtkButton *button, gpointer user_data); 900 void on_helix_editor_destroy(GtkObject *object, gpointer user_data); 901 void on_helix_linkall_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 902 void on_helix_linkzo_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 903 void on_helix_linkzhl_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 904 void on_reflect_taginc_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 905 void on_reflect_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 906 void on_reflect_new_button_clicked(GtkButton *button, gpointer user_data); 907 void on_reflect_cancel_button_clicked(GtkButton *button, gpointer user_data); 908 void on_reflect_apply_button_clicked(GtkButton *button, gpointer user_data); 909 void on_reflect_ok_button_clicked(GtkButton *button, gpointer user_data); 910 void on_reflect_editor_destroy(GtkObject *object, gpointer user_data); 911 void on_scale_editor_destroy(GtkObject *object, gpointer user_data); 912 void on_scale_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 913 void on_scale_new_button_clicked(GtkButton *button, gpointer user_data); 914 void on_scale_cancel_button_clicked(GtkButton *button, gpointer user_data); 915 void on_scale_apply_button_clicked(GtkButton *button, gpointer user_data); 916 void on_scale_ok_button_clicked(GtkButton *button, gpointer user_data); 917 void on_cylinder_taginc_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 918 void on_cylinder_total_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 919 void on_cylinder_new_button_clicked(GtkButton *button, gpointer user_data); 920 void on_cylinder_cancel_button_clicked(GtkButton *button, gpointer user_data); 921 void on_cylinder_apply_button_clicked(GtkButton *button, gpointer user_data); 922 void on_cylinder_ok_button_clicked(GtkButton *button, gpointer user_data); 923 void on_cylinder_editor_destroy(GtkObject *object, gpointer user_data); 924 void on_transform_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 925 void on_transform_new_button_clicked(GtkButton *button, gpointer user_data); 926 void on_transform_cancel_button_clicked(GtkButton *button, gpointer user_data); 927 void on_transform_apply_button_clicked(GtkButton *button, gpointer user_data); 928 void on_transform_ok_button_clicked(GtkButton *button, gpointer user_data); 929 void on_transform_editor_destroy(GtkObject *object, gpointer user_data); 930 void on_gend_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 931 void on_gend_cancel_button_clicked(GtkButton *button, gpointer user_data); 932 void on_gend_apply_button_clicked(GtkButton *button, gpointer user_data); 933 void on_gend_ok_button_clicked(GtkButton *button, gpointer user_data); 934 void on_gend_editor_destroy(GtkObject *object, gpointer user_data); 935 void on_kernel_command_destroy(GtkObject *object, gpointer user_data); 936 void on_kernel_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 937 void on_kernel_new_button_clicked(GtkButton *button, gpointer user_data); 938 void on_kernel_cancel_button_clicked(GtkButton *button, gpointer user_data); 939 void on_kernel_apply_button_clicked(GtkButton *button, gpointer user_data); 940 void on_kernel_ok_button_clicked(GtkButton *button, gpointer user_data); 941 void on_execute_command_destroy(GtkObject *object, gpointer user_data); 942 void on_execute_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 943 void on_execute_new_button_clicked(GtkButton *button, gpointer user_data); 944 void on_execute_cancel_button_clicked(GtkButton *button, gpointer user_data); 945 void on_execute_apply_button_clicked(GtkButton *button, gpointer user_data); 946 void on_execute_ok_button_clicked(GtkButton *button, gpointer user_data); 947 void on_intrange_command_destroy(GtkObject *object, gpointer user_data); 948 void on_intrange_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 949 void on_intrange_new_button_clicked(GtkButton *button, gpointer user_data); 950 void on_intrange_cancel_button_clicked(GtkButton *button, gpointer user_data); 951 void on_intrange_apply_button_clicked(GtkButton *button, gpointer user_data); 952 void on_intrange_ok_button_clicked(GtkButton *button, gpointer user_data); 953 void on_ground_command_destroy(GtkObject *object, gpointer user_data); 954 void on_ground_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 955 void on_ground_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 956 void on_ground_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 957 void on_ground_new_button_clicked(GtkButton *button, gpointer user_data); 958 void on_ground_cancel_button_clicked(GtkButton *button, gpointer user_data); 959 void on_ground_apply_button_clicked(GtkButton *button, gpointer user_data); 960 void on_ground_ok_button_clicked(GtkButton *button, gpointer user_data); 961 void on_nearfield_command_destroy(GtkObject *object, gpointer user_data); 962 void on_nearfield_nh_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 963 void on_nearfield_ne_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 964 void on_nearfield_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 965 void on_nearfield_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 966 void on_nearfield_new_button_clicked(GtkButton *button, gpointer user_data); 967 void on_nearfield_cancel_button_clicked(GtkButton *button, gpointer user_data); 968 void on_nearfield_apply_button_clicked(GtkButton *button, gpointer user_data); 969 void on_nearfield_ok_button_clicked(GtkButton *button, gpointer user_data); 970 void on_radiation_command_destroy(GtkObject *object, gpointer user_data); 971 void on_radiation_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 972 void on_radiation_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 973 void on_radiation_new_button_clicked(GtkButton *button, gpointer user_data); 974 void on_radiation_cancel_button_clicked(GtkButton *button, gpointer user_data); 975 void on_radiation_apply_button_clicked(GtkButton *button, gpointer user_data); 976 void on_radiation_ok_button_clicked(GtkButton *button, gpointer user_data); 977 void on_excitation_command_destroy(GtkObject *object, gpointer user_data); 978 void on_excitation_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 979 void on_excitation_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 980 void on_excitation_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 981 void on_excitation_new_button_clicked(GtkButton *button, gpointer user_data); 982 void on_excitation_cancel_button_clicked(GtkButton *button, gpointer user_data); 983 void on_excitation_apply_button_clicked(GtkButton *button, gpointer user_data); 984 void on_excitation_ok_button_clicked(GtkButton *button, gpointer user_data); 985 void on_frequency_command_destroy(GtkObject *object, gpointer user_data); 986 void on_frequency_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 987 void on_frequency_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 988 void on_frequency_step_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 989 void on_frequency_new_button_clicked(GtkButton *button, gpointer user_data); 990 void on_frequency_cancel_button_clicked(GtkButton *button, gpointer user_data); 991 void on_frequency_apply_button_clicked(GtkButton *button, gpointer user_data); 992 void on_frequency_ok_button_clicked(GtkButton *button, gpointer user_data); 993 void on_loading_command_destroy(GtkObject *object, gpointer user_data); 994 void on_loading_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 995 void on_loading_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 996 void on_loading_new_button_clicked(GtkButton *button, gpointer user_data); 997 void on_loading_cancel_button_clicked(GtkButton *button, gpointer user_data); 998 void on_loading_apply_button_clicked(GtkButton *button, gpointer user_data); 999 void on_loading_ok_button_clicked(GtkButton *button, gpointer user_data); 1000 void on_network_command_destroy(GtkObject *object, gpointer user_data); 1001 void on_network_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 1002 void on_network_new_button_clicked(GtkButton *button, gpointer user_data); 1003 void on_network_cancel_button_clicked(GtkButton *button, gpointer user_data); 1004 void on_network_apply_button_clicked(GtkButton *button, gpointer user_data); 1005 void on_network_ok_button_clicked(GtkButton *button, gpointer user_data); 1006 void on_txline_command_destroy(GtkObject *object, gpointer user_data); 1007 void on_txline_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 1008 void on_txline_new_button_clicked(GtkButton *button, gpointer user_data); 1009 void on_txline_cancel_button_clicked(GtkButton *button, gpointer user_data); 1010 void on_txline_apply_button_clicked(GtkButton *button, gpointer user_data); 1011 void on_txline_ok_button_clicked(GtkButton *button, gpointer user_data); 1012 void on_txline_checkbutton_toggled(GtkToggleButton *togglebutton, gpointer user_data); 1013 void on_ground2_command_destroy(GtkObject *object, gpointer user_data); 1014 void on_ground2_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 1015 void on_ground2_new_button_clicked(GtkButton *button, gpointer user_data); 1016 void on_ground2_cancel_button_clicked(GtkButton *button, gpointer user_data); 1017 void on_ground2_apply_button_clicked(GtkButton *button, gpointer user_data); 1018 void on_ground2_ok_button_clicked(GtkButton *button, gpointer user_data); 1019 void on_loop_start_clicked(GtkButton *button, gpointer user_data); 1020 void on_loop_pause_clicked(GtkButton *button, gpointer user_data); 1021 void on_loop_reset_clicked(GtkButton *button, gpointer user_data); 1022 void on_about_activate(GtkMenuItem *menuitem, gpointer user_data); 1023 void on_aboutdialog_close(GtkDialog *dialog, gpointer user_data); 1024 void on_aboutdialog_response(GtkDialog *dialog, gint response_id, gpointer user_data); 1025 void on_net_gain_activate(GtkMenuItem *menuitem, gpointer user_data); 1026 gboolean on_structure_drawingarea_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 1027 void on_structure_zoom_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 1028 void on_structure_plus_button_clicked(GtkButton *button, gpointer user_data); 1029 void on_structure_minus_button_clicked(GtkButton *button, gpointer user_data); 1030 void on_structure_one_button_clicked(GtkButton *button, gpointer user_data); 1031 gboolean on_rdpattern_drawingarea_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data); 1032 void on_rdpattern_zoom_spinbutton_value_changed(GtkSpinButton *spinbutton, gpointer user_data); 1033 void on_rdpattern_plus_button_clicked(GtkButton *button, gpointer user_data); 1034 void on_rdpattern_minus_button_clicked(GtkButton *button, gpointer user_data); 1035 void on_rdpattern_one_button_clicked(GtkButton *button, gpointer user_data); 1036 gboolean on_structure_drawingarea_scroll_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 1037 gboolean on_rdpattern_drawingarea_scroll_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); 1038 /* cmnd_edit.c */ 1039 void Excitation_Command(int action); 1040 void Frequency_Command(int action); 1041 void Ground_Command(int action); 1042 void Ground2_Command(int action); 1043 void Radiation_Command(int action); 1044 void Loading_Command(int action); 1045 void Network_Command(int action); 1046 void Txline_Command(int action); 1047 void Nearfield_Command(int action); 1048 void Kernel_Command(int action); 1049 void Intrange_Command(int action); 1050 void Execute_Command(int action); 1051 void Insert_EN_Card(GtkListStore *store, GtkTreeIter *iter); 1052 void Get_Command_Data(GtkListStore *store, GtkTreeIter *iter, int *iv, double *fv); 1053 void Set_Command_Data(GtkListStore *store, GtkTreeIter *iter, int *iv, double *fv); 1054 void Insert_Blank_Command_Row(GtkTreeView *view, GtkListStore *store, GtkTreeIter *iter, const gchar *name); 1055 void Set_Labels(GtkWidget *widget, gchar **labels, gchar **text, gint num); 1056 /* draw.c */ 1057 void Set_Gdk_Segment(GdkSegment *segm, projection_parameters_t *params, double x1, double y1, double z1, double x2, double y2, double z2); 1058 void Project_on_Screen(projection_parameters_t *params, double x, double y, double z, double *xs, double *ys); 1059 void Project_XYZ_Axes(GdkPixmap *pixmap, projection_parameters_t *params, GdkSegment *segment); 1060 void Draw_XYZ_Axes(GdkPixmap *pixmap, projection_parameters_t params); 1061 void New_Projection_Parameters(int width, int height, projection_parameters_t *params); 1062 void Value_to_Color(double *red, double *grn, double *blu, double val, double max); 1063 void Cairo_Draw_Polygon(cairo_t *cr, GdkPoint *points, int npoints); 1064 void Cairo_Draw_Segments(cairo_t *cr, GdkSegment *segm, int nseg); 1065 void Cairo_Draw_Line(cairo_t *cr, int x1, int y1, int x2, int y2); 1066 void Cairo_Draw_Lines(cairo_t *cr, GdkPoint *points, int npoints); 1067 /* draw_radiation.c */ 1068 void Draw_Radiation(GtkWidget *drawingarea); 1069 void Draw_Radiation_Pattern(void); 1070 void Draw_Near_Field(void); 1071 gboolean Animate_Near_Field(gpointer udata); 1072 double Scale_Gain(double gain, int fstep, int idx); 1073 double Polarization_Factor(int pol_type, int fstep, int idx); 1074 void Set_Polarization(int pol); 1075 void Set_Gain_Style(int gs); 1076 void New_Radiation_Projection_Angle(void); 1077 gboolean Redo_Radiation_Pattern(gpointer udata); 1078 double Viewer_Gain(projection_parameters_t proj_parameters, int fstep); 1079 void Rdpattern_Window_Killed(void); 1080 void Set_Window_Labels(void); 1081 void Alloc_Rdpattern_Buffers(int nfrq, int nth, int nph); 1082 void Alloc_Nearfield_Buffers(int n1, int n2, int n3); 1083 void Free_Draw_Buffers(void); 1084 /* draw_structure.c */ 1085 void Draw_Structure(GtkWidget *drawingarea); 1086 void New_Wire_Data(void); 1087 void New_Patch_Data(void); 1088 void Process_Wire_Segments(void); 1089 void Process_Surface_Patches(void); 1090 void Draw_Wire_Segments(GdkSegment *segm, gint nseg); 1091 void Draw_Surface_Patches(GdkSegment *segm, gint npatch); 1092 gboolean Redo_Currents(gpointer udata); 1093 void New_Structure_Projection_Angle(void); 1094 void Init_Struct_Drawing(void); 1095 void Show_Viewer_Gain(GtkWidget *window, const char *widget, projection_parameters_t proj_params); 1096 /* fields.c */ 1097 void efld(double xi, double yi, double zi, double ai, int ij); 1098 void eksc(double s, double z, double rh, double xk, int ij, _Complex double *ezs, _Complex double *ers, _Complex double *ezc, _Complex double *erc, _Complex double *ezk, _Complex double *erk); 1099 void ekscx(double bx, double s, double z, double rhx, double xk, int ij, int inx1, int inx2, _Complex double *ezs, _Complex double *ers, _Complex double *ezc, _Complex double *erc, _Complex double *ezk, _Complex double *erk); 1100 void gf(double zk, double *co, double *si); 1101 void gh(double zk, double *hr, double *hi); 1102 void gwave(_Complex double *erv, _Complex double *ezv, _Complex double *erh, _Complex double *ezh, _Complex double *eph); 1103 void gx(double zz, double rh, double xk, _Complex double *gz, _Complex double *gzp); 1104 void gxx(double zz, double rh, double a, double a2, double xk, int ira, _Complex double *g1, _Complex double *g1p, _Complex double *g2, _Complex double *g2p, _Complex double *g3, _Complex double *gzp); 1105 void hfk(double el1, double el2, double rhk, double zpkx, double *sgr, double *sgi); 1106 void hintg(double xi, double yi, double zi); 1107 void hsfld(double xi, double yi, double zi, double ai); 1108 void hsflx(double s, double rh, double zpx, _Complex double *hpk, _Complex double *hps, _Complex double *hpc); 1109 void nefld(double xob, double yob, double zob, _Complex double *ex, _Complex double *ey, _Complex double *ez); 1110 void nfpat(int nfeh); 1111 void nhfld(double xob, double yob, double zob, _Complex double *hx, _Complex double *hy, _Complex double *hz); 1112 void pcint(double xi, double yi, double zi, double cabi, double sabi, double salpi, _Complex double *e); 1113 void unere(double xob, double yob, double zob); 1114 void Near_Field_Total(_Complex double ex, _Complex double ey, _Complex double ez, int nfeh, int idx); 1115 /* fork.c */ 1116 void Child_Process(int num_child); 1117 void Child_Input_File(void); 1118 int Fork_Command(const char *cdstr); 1119 ssize_t Read_Pipe(int idx, char *str, ssize_t len, gboolean err); 1120 ssize_t Write_Pipe(int idx, char *str, ssize_t len, gboolean err); 1121 ssize_t PRead_Pipe(int idx, char *str, ssize_t len, gboolean err); 1122 void Pass_Freq_Data(void); 1123 void Get_Freq_Data(int idx, int fstep); 1124 void Mem_Copy(char *buff, char *var, size_t cnt, gboolean wrt); 1125 /* geom_edit.c */ 1126 void Wire_Editor(int action); 1127 void Patch_Editor(int action); 1128 void Arc_Editor(int action); 1129 void Helix_Editor(int action); 1130 void Reflect_Editor(int action); 1131 void Scale_Editor(int action); 1132 void Cylinder_Editor(int action); 1133 void Transform_Editor(int action); 1134 void Gend_Editor(int action); 1135 void Insert_GE_Card(GtkListStore *store, GtkTreeIter *iter); 1136 void Get_Geometry_Data(GtkListStore *store, GtkTreeIter *iter, int *iv, double *fv); 1137 void Get_Geometry_Int_Data(GtkListStore *store, GtkTreeIter *iter, int *iv); 1138 void Set_Geometry_Data(GtkListStore *store, GtkTreeIter *iter, int *iv, double *fv); 1139 void Set_Geometry_Int_Data(GtkListStore *store, GtkTreeIter *iter, int *iv); 1140 gboolean Check_Card_Name(GtkListStore *store, GtkTreeIter *iter, gboolean next, const gchar *name); 1141 gboolean Give_Up(int *busy, GtkWidget *widget); 1142 void Insert_Blank_Geometry_Row(GtkTreeView *view, GtkListStore *store, GtkTreeIter *iter, const gchar *name); 1143 void Remove_Row(GtkListStore *store, GtkTreeIter *iter); 1144 gboolean Get_Selected_Row(GtkTreeView *view, GtkListStore *store, GtkTreeIter *iter, gchar *name); 1145 void Set_Wire_Conductivity(int tag, double s, GtkListStore *store); 1146 gboolean Get_Wire_Conductivity(int tag, double *s, GtkListStore *store); 1147 /* geometry.c */ 1148 gboolean arc(int itg, int ns, double rada, double ang1, double ang2, double rad); 1149 gboolean conect(int ignd); 1150 void helix(double s, double hl, double a1, double b1, double a2, double b2, double rad, int ns, int itg); 1151 int isegno(int itagi, int mx); 1152 gboolean move(double rox, double roy, double roz, double xs, double ys, double zs, int its, int nrpt, int itgi); 1153 gboolean patch(int nx, int ny, double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3, double ax4, double ay4, double az4); 1154 void subph(int nx, int ny); 1155 gboolean reflc(int ix, int iy, int iz, int iti, int nop); 1156 void wire(double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad, int ns, int itg); 1157 /* gnuplot.c */ 1158 void Save_FreqPlots_Gnuplot_Data(char *filename); 1159 void Save_RadPattern_Gnuplot_Data(char *filename); 1160 void Save_Struct_Gnuplot_Data(char *filename); 1161 /* ground.c */ 1162 void rom2(double a, double b, _Complex double *sum, double dmin); 1163 void sflds(double t, _Complex double *e); 1164 /* input.c */ 1165 gboolean Read_Comments(void); 1166 gboolean Read_Geometry(void); 1167 gboolean Read_Commands(void); 1168 gboolean readmn(char *mn, int *i1, int *i2, int *i3, int *i4, double *f1, double *f2, double *f3, double *f4, double *f5, double *f6); 1169 gboolean readgm(char *gm, int *i1, int *i2, double *x1, double *y1, double *z1, double *x2, double *y2, double *z2, double *rad); 1170 gboolean datagn(void); 1171 gboolean Tag_Seg_Error(int tag, int segs); 1172 /* interface.c */ 1173 GtkWidget *create_main_window(void); 1174 GtkWidget *create_filechooserdialog(void); 1175 GtkWidget *create_fileselection(void); 1176 GtkWidget *create_freqplots_window(void); 1177 GtkWidget *create_rdpattern_window(void); 1178 GtkWidget *create_quit_dialog(void); 1179 GtkWidget *create_error_dialog(void); 1180 GtkWidget *create_animate_dialog(void); 1181 GtkWidget *create_nec2_editor(void); 1182 GtkWidget *create_wire_editor(void); 1183 GtkWidget *create_patch_editor(void); 1184 GtkWidget *create_arc_editor(void); 1185 GtkWidget *create_transform_editor(void); 1186 GtkWidget *create_helix_editor(void); 1187 GtkWidget *create_reflect_editor(void); 1188 GtkWidget *create_scale_editor(void); 1189 GtkWidget *create_cylinder_editor(void); 1190 GtkWidget *create_kernel_command(void); 1191 GtkWidget *create_execute_command(void); 1192 GtkWidget *create_intrange_command(void); 1193 GtkWidget *create_ground_command(void); 1194 GtkWidget *create_nearfield_command(void); 1195 GtkWidget *create_radiation_command(void); 1196 GtkWidget *create_excitation_command(void); 1197 GtkWidget *create_frequency_command(void); 1198 GtkWidget *create_loading_command(void); 1199 GtkWidget *create_network_command(void); 1200 GtkWidget *create_txline_command(void); 1201 GtkWidget *create_ground2_command(void); 1202 GtkWidget *create_gend_editor(void); 1203 GtkWidget *create_aboutdialog(void); 1204 /* main.c */ 1205 int main(int argc, char *argv[]); 1206 gboolean Open_Input_File(gpointer udata); 1207 gboolean isChild(void); 1208 /* matrix.c */ 1209 void cmset(int nrow, _Complex double *cmx, double rkhx, int iexkx); 1210 void cmss(int j1, int j2, int im1, int im2, _Complex double *cmx, int nrow, int itrp); 1211 void cmsw(int j1, int j2, int i1, int i2, _Complex double *cmx, _Complex double *cw, int ncw, int nrow, int itrp); 1212 void cmws(int j, int i1, int i2, _Complex double *cmx, int nr, _Complex double *cw, int itrp); 1213 void cmww(int j, int i1, int i2, _Complex double *cmx, int nr, _Complex double *cw, int nw, int itrp); 1214 void etmns(double p1, double p2, double p3, double p4, double p5, double p6, int ipr, _Complex double *e); 1215 void factr(int n, _Complex double *a, int *ip, int ndim); 1216 void factrs(int np, int nrow, _Complex double *a, int *ip); 1217 void fblock(int nrow, int ncol, int imax, int ipsym); 1218 void solve(int n, _Complex double *a, int *ip, _Complex double *b, int ndim); 1219 void solves(_Complex double *a, int *ip, _Complex double *b, int neq, int nrh, int np, int n, int mp, int m); 1220 /* nec2_model.c */ 1221 void Nec2_Input_File_Treeview(int action); 1222 void Create_List_Stores(void); 1223 void Create_Default_File(void); 1224 void List_Comments(void); 1225 void List_Geometry(void); 1226 void List_Commands(void); 1227 void Insert_Columns(GtkWidget *window, gchar *treeview, GtkListStore *store, int ncols, char *colname[]); 1228 void cell_edited_callback(GtkCellRendererText *cell, gchar *path, gchar *new_text, gpointer user_data); 1229 void Save_Nec2_Input_File(GtkWidget *treeview_window, char *nec2_file); 1230 void Save_Treeview_Data(GtkTreeView *tree_view, int ncols, FILE *nec2_fp); 1231 gboolean gtk_tree_model_iter_previous(GtkTreeModel *tree_model, GtkTreeIter *iter); 1232 /* network.c */ 1233 void netwk(_Complex double *cmx, int *ip, _Complex double *einc); 1234 void load(int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt, double *zlr, double *zli, double *zlc); 1235 /* plot_freqdata.c */ 1236 void Plot_Frequency_Data(void); 1237 void Display_Frequency_Data(void); 1238 void Draw_Plotting_Frame(gchar **title, GdkRectangle *rect, int nhor, int nvert); 1239 void Plot_Vertical_Scale(double red, double grn, double blu, int x, int y, int height, double max, double min, int nval); 1240 void Plot_Horizontal_Scale(double red, double grn, double blu, int x, int y, int width, double max, double min, int nval); 1241 void Draw_Graph(double red, double grn, double blu, GdkRectangle *rect, double *a, double *b, double amax, double amin, double bmax, double bmin, int nval, int side); 1242 void Set_Rectangle(GdkRectangle *rect, int x, int y, int w, int h); 1243 void Fit_to_Scale(double *max, double *min, int *nval); 1244 void Fit_to_Scale2(double *max1, double *min1, double *max2, double *min2, int *nval); 1245 void New_Max_Min(double *max, double *min, double sval, int *nval); 1246 void Plot_Graph2(double *fa, double *fb, double *fc, int nc, char *titles[], int nplt, int posn); 1247 void Plot_Graph(double *fa, double *fb, int nb, char *titles[], int nplt, int posn); 1248 void Plots_Window_Killed(void); 1249 void Set_Frequency_On_Click(GdkEventButton *event); 1250 /* radiation.c */ 1251 void ffld(double thet, double phi, _Complex double *eth, _Complex double *eph); 1252 void fflds(double rox, double roy, double roz, _Complex double *scur, _Complex double *ex, _Complex double *ey, _Complex double *ez); 1253 void gfld(double rho, double phi, double rz, _Complex double *eth, _Complex double *epi, _Complex double *erd, _Complex double ux, int ksymp); 1254 void rdpat(void); 1255 /* shared.c */ 1256 /* somnec.c */ 1257 void somnec(double epr, double sig, double fmhz); 1258 void bessel(_Complex double z, _Complex double *j0, _Complex double *j0p); 1259 void evlua(_Complex double *erv, _Complex double *ezv, _Complex double *erh, _Complex double *eph); 1260 void fbar(_Complex double p, _Complex double *fbar); 1261 void gshank(_Complex double start, _Complex double dela, _Complex double *sum, int nans, _Complex double *seed, int ibk, _Complex double bk, _Complex double delb); 1262 void hankel(_Complex double z, _Complex double *h0, _Complex double *h0p); 1263 void lambda(double t, _Complex double *xlam, _Complex double *dxlam); 1264 void rom1(int n, _Complex double *sum, int nx); 1265 void saoa(double t, _Complex double *ans); 1266 /* support.c */ 1267 GtkWidget *lookup_widget(GtkWidget *widget, const gchar *widget_name); 1268 void add_pixmap_directory(const gchar *directory); 1269 GtkWidget *create_pixmap(GtkWidget *widget, const gchar *filename); 1270 GdkPixbuf *create_pixbuf(const gchar *filename); 1271 void glade_set_atk_action_description(AtkAction *action, const gchar *action_name, const gchar *description); 1272 /* utils.c */ 1273 void usage(void); 1274 int stop(char *mesg, int err); 1275 gboolean Nec2_Save_Warn(const gchar *mesg); 1276 int Load_Line(char *buff, FILE *pfile); 1277 void mem_alloc(void **ptr, size_t req, gchar *str); 1278 void mem_realloc(void **ptr, size_t req, gchar *str); 1279 void free_ptr(void **ptr); 1280 gboolean Open_File(FILE **fp, char *fname, const char *mode); 1281 void Close_File(FILE **fp); 1282 void Display_Fstep(GtkEntry *entry, int fstep); 1283 int isFlagSet(unsigned long long int flag); 1284 int isFlagClear(unsigned long long int flag); 1285 void SetFlag(unsigned long long int flag); 1286 void ClearFlag(unsigned long long int flag); 1287 void ToggleFlag(unsigned long long int flag); 1288 void SaveFlag(unsigned long long int *flag, unsigned long long int mask); 1289 void Strlcpy(char *dest, const char *src, size_t n); 1290 void Strlcat(char *dest, const char *src, size_t n); 1291 double Strtod(char *nptr, char **endptr); 1292 /* xnec2c.c */ 1293 void Frequency_Scale_Geometry(void); 1294 void Structure_Impedance_Loading(void); 1295 void Ground_Parameters(void); 1296 void Set_Interaction_Matrix(void); 1297 void Set_Excitation(void); 1298 void Set_Network_Data(void); 1299 void Power_Loss(void); 1300 void Radiation_Pattern(void); 1301 void Near_Field_Pattern(void); 1302 void New_Frequency(void); 1303 gboolean Frequency_Loop(gpointer udata); 1304 gboolean Start_Frequency_Loop(void); 1305 void Stop_Frequency_Loop(void); 1306 void Incident_Field_Loop(void); 1307 1308 #endif 1309