Imported Upstream version 4.6.0
[debian/atlc] / src / non_gui / create_bmp_for_rect_cen_in_rect_coupler.c
1 /* atlc - arbitrary transmission line calculator, for the analysis of
2 transmission lines are directional couplers. 
3
4 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either package_version 2
9 of the License, or (at your option) any later package_version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
19 USA.
20
21 Dr. David Kirkby, e-mail drkirkby at ntlworld.com 
22
23 */
24 #include "config.h"
25
26 #include "definitions.h"
27 #include "exit_codes.h"
28
29 extern int main(int argc, char **argv) /* Read parameters from command line here   */
30 {
31 #ifdef GGG
32    int  bmp_size=DEFAULT_BMP_SIZE;
33    int q;
34    FILE *image_data_fp=stdout;
35    struct transmission_line_properties not_used;
36
37    while((q=get_options(argc,argv,"b:f:v")) != -1)
38    switch (q) 
39    {
40       case 'b':
41       bmp_size=atol(my_optarg); 
42       break;
43       case 'v':
44       verbose=TRUE; 
45       break;
46       case '?':
47       printf("read a ? exiting\n");
48    }
49    if(argc-my_optind ==6)
50    {
51
52       WW=atof(argv[my_optind]);
53       HH=atof(argv[my_optind+1]);
54       ww=atof(argv[my_optind+2]);
55       cc=atof(argv[my_optind+3]);
56       Er1=atof(argv[my_optind+4]);
57       if((image_data_fp=fopen(argv[my_optind+5],"wb"))==NULL)
58          exit_and_error("Can't open file for writing",CANT_OPEN_FOR_WRITING);
59
60       /* To make the program easier to write, rect_cen_in_rect uses 
61       the same variables as create_bmp_for_rect_in_rect. We just calculate the 
62       values not given (a, b, d, h and Er1 from those given
63       (W, H, c and w) */
64
65       aa=(WW-ww)/2.0;
66       bb=(WW-ww)/2.0;
67       dd=ww;
68       hh=(HH-cc)/2.0;
69       Er2=Er1;
70       check_parameters_of_create_bmp_for_rect_in_rect();
71       convert_create_bmp_for_rect_in_rect_dimensions_to_integers(bmp_size);
72       write_bitmap(image_data_fp, not_used);
73    }
74    else
75       usage_create_bmp_for_rect_cen_in_rect();
76    return(0);
77 #endif 
78   exit_with_msg_and_exit_code("This program is not implemented", PROGRAM_NOT_IMPLEMENTED);
79 return(0);
80 }