mirror of
https://github.com/stevenhowes/ctenna.git
synced 2026-05-27 00:03:27 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6efae6552c | |||
| 60cb956822 | |||
| 27f59c8050 | |||
| b3354b5b16 | |||
| f43842b6ae | |||
| 59e6638757 | |||
| e11c928082 | |||
| 19546019e7 | |||
| d052c29210 | |||
| 37bb59eda6 | |||
| f3379c5226 | |||
| e0c8c6f084 | |||
| eb744b05fb | |||
| cb42896fd7 | |||
| b0ed5bf643 |
@@ -0,0 +1,3 @@
|
||||
|
||||
ctenna
|
||||
*.o
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="ctenna" />
|
||||
<Option execution_dir="../Constenna" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/Constenna" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/Constenna" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="Makefile" />
|
||||
<Unit filename="hb9cv.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="hb9cv.h" />
|
||||
<Unit filename="jpole.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="jpole.h" />
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions />
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
@@ -1,14 +1,17 @@
|
||||
ctenna: main.o hb9cv.o jpole.o groundplane.c
|
||||
gcc -o ctenna main.o hb9cv.o jpole.o groundplane.c
|
||||
|
||||
main.o: main.c
|
||||
gcc -c main.c
|
||||
|
||||
hb9cv.o: hb9cv.c
|
||||
gcc -c hb9cv.c
|
||||
|
||||
jpole.o: jpole.c
|
||||
gcc -c jpole.c
|
||||
clean:
|
||||
rm -f *.o ctenna
|
||||
|
||||
ctenna: main.o hb9cv.o jpole.o groundplane.o
|
||||
cc -o ctenna main.o hb9cv.o jpole.o groundplane.o
|
||||
|
||||
main.o: main.c
|
||||
cc -c main.c
|
||||
|
||||
hb9cv.o: hb9cv.c
|
||||
cc -c hb9cv.c
|
||||
|
||||
jpole.o: jpole.c
|
||||
cc -c jpole.c
|
||||
|
||||
groundplane.o: groundplane.c
|
||||
gcc -c groundplane.c
|
||||
cc -c groundplane.c
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# ctenna
|
||||
ctenna - a multi antenna calulator for console, written in C
|
||||
ctenna - a multi antenna calculator for console, written in C
|
||||
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="ctenna" />
|
||||
<Option execution_dir="../Constenna" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/Constenna" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/ctenna_win10_amd64" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="Makefile" />
|
||||
<Unit filename="groundplane.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="groundplane.h" />
|
||||
<Unit filename="hb9cv.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="hb9cv.h" />
|
||||
<Unit filename="jpole.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="jpole.h" />
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions />
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
@@ -39,7 +39,7 @@ void hb9cv_calc (float *f, float *unit_factor, float *lambda, float *l1, float *
|
||||
}
|
||||
|
||||
void hb9cv_print (float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *l5, float *bdiam, float *raddiam, int *unit_index){
|
||||
printf(" Calculated for %f mHz\n", *f);
|
||||
printf(" Calculated for %f MHz\n", *f);
|
||||
printf("\n");
|
||||
printf(" Lambda is %f mm\n", *lambda);
|
||||
printf(" L1 Driven Element is %f ", *l1); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
|
||||
|
||||
@@ -15,12 +15,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <stdio.h>
|
||||
#include "hb9cv.h"
|
||||
#include "jpole.h"
|
||||
#include "jpole.h"
|
||||
#include "groundplane.h"
|
||||
//#include <stdlib.h>
|
||||
|
||||
void clear_scr(void){
|
||||
//printf("\033[H"); //brings cursor home
|
||||
printf("\033[H"); //brings cursor home
|
||||
printf("\x1b[2J"); //clears screen
|
||||
}
|
||||
|
||||
@@ -31,7 +31,23 @@ void printunit (int *unit_index){ // prints the selected unit
|
||||
}
|
||||
}
|
||||
|
||||
void myflush ( FILE *in )
|
||||
{
|
||||
int ch;
|
||||
|
||||
do
|
||||
ch = fgetc ( in );
|
||||
while ( ch != EOF && ch != '\n' );
|
||||
|
||||
clearerr ( in );
|
||||
}
|
||||
|
||||
void mypause ( void )
|
||||
{
|
||||
printf ( "Press [Enter] to continue . . ." );
|
||||
fflush ( stdout );
|
||||
getchar();
|
||||
}
|
||||
|
||||
void set_freq(float *f){ // change the MHz
|
||||
float input;
|
||||
@@ -92,12 +108,13 @@ int main(){
|
||||
|
||||
while (main_menu_sel != 0){ // main menu loop runs until "0" for quit
|
||||
|
||||
main_menu(&f, &unit_index);
|
||||
main_menu_sel = menu_select();
|
||||
main_menu(&f, &unit_index); //prints menu
|
||||
main_menu_sel = menu_select();
|
||||
|
||||
|
||||
switch(main_menu_sel){
|
||||
|
||||
case 0: return 0;
|
||||
case 1: clear_scr();set_freq(&f);
|
||||
break;
|
||||
case 2: clear_scr();set_units_system(&unit_factor ,&unit_index );
|
||||
@@ -105,16 +122,22 @@ int main(){
|
||||
case 3: clear_scr();
|
||||
jpole_calc(&f, &unit_factor,&lambda, &l1, &l2, &l3, &l4, &raddiam);
|
||||
jpole_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &raddiam, &unit_index);
|
||||
myflush ( stdin );
|
||||
mypause();
|
||||
break;
|
||||
case 4: clear_scr();
|
||||
gp_calc(&f, &unit_factor,&lambda, &l1, &l2);
|
||||
gp_print(&f ,&unit_factor, &lambda, &l1, &l2, &unit_index);
|
||||
case 4: clear_scr();
|
||||
gp_calc(&f, &unit_factor,&lambda, &l1, &l2);
|
||||
gp_print(&f ,&unit_factor, &lambda, &l1, &l2, &unit_index);
|
||||
myflush ( stdin );
|
||||
mypause();
|
||||
break;
|
||||
case 5: clear_scr();
|
||||
hb9cv_calc(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam);
|
||||
hb9cv_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam, &unit_index);
|
||||
myflush ( stdin );
|
||||
mypause();
|
||||
break;
|
||||
// default: maybe easteregg in future
|
||||
default:printf("And then?");return 1; //maybe easteregg in future
|
||||
}
|
||||
}
|
||||
clear_scr();
|
||||
|
||||
Reference in New Issue
Block a user