Add files via upload

This commit is contained in:
thkummi
2021-08-19 15:33:16 +02:00
committed by GitHub
parent 96616bb2bd
commit 470014eaee
5 changed files with 138 additions and 6 deletions
+5 -2
View File
@@ -1,5 +1,5 @@
ctenna: main.o hb9cv.o jpole.o ctenna: main.o hb9cv.o jpole.o groundplane.c
gcc -o ctenna main.o hb9cv.o jpole.o gcc -o ctenna main.o hb9cv.o jpole.o groundplane.c
main.o: main.c main.o: main.c
gcc -c main.c gcc -c main.c
@@ -9,3 +9,6 @@ hb9cv.o: hb9cv.c
jpole.o: jpole.c jpole.o: jpole.c
gcc -c jpole.c gcc -c jpole.c
groundplane.o: groundplane.c
gcc -c groundplane.c
+53
View File
@@ -0,0 +1,53 @@
<?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>
+51
View File
@@ -0,0 +1,51 @@
/*
Lambda/4 Groundplane Antanna Calculator
Copyright (C) 2021 Thomas Kummer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "groundplane.h"
void gp_calc(float *f, float *unit_factor, float *lambda, float *l1, float *l2){
*lambda = ( 29971000 / *f ) / 100;
*l1 = (0.96 * *lambda * 0.25) * *unit_factor;
*l2 = (0.96 * *lambda * 0.28) * *unit_factor;
}
void gp_print(float *f, float *unit_factor, float *lambda, float *l1, float *l2, int *unit_index){
printf(" Calculated for %f mHz\n", *f);
printf("\n");
printf(" Vertical Radiator %f ", *l1); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" Radials %f ", *l2); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf("\n");
printf("\n");
printf(" O\n");
printf(" I\n");
printf(" I\n");
printf(" Radiator I\n");
printf(" I\n");
printf(" I\n");
printf(" I\n");
printf(" I\n");
printf(" ___|___ \n");
printf(" /' | '\\ \n");
printf(" \\.__|__./ \n");
printf(" /| 50 |\\ \n");
printf(" / | Ohm | \\ \n");
printf(" Radial / ~~~~~~~~~ \\ \n");
printf(" / \\ \n");
printf(" / \\ \n");
printf("\n");
printf(" 3 - 6 radials are usual \n");
printf("\n");
}
+21
View File
@@ -0,0 +1,21 @@
/*
Copyright (C) 2021 Thomas Kummer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GROUNDPLANE_H_
#define GROUNDPLANE_H_
void gp_calc();
void gp_print();
#endif // GROUNDPLANE_H_
+6 -2
View File
@@ -16,10 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <stdio.h> #include <stdio.h>
#include "hb9cv.h" #include "hb9cv.h"
#include "jpole.h" #include "jpole.h"
#include "groundplane.h"
//#include <stdlib.h> //#include <stdlib.h>
void clear_scr(void){ void clear_scr(void){
printf("\033[H"); //brings cursor home //printf("\033[H"); //brings cursor home
printf("\x1b[2J"); //clears screen printf("\x1b[2J"); //clears screen
} }
@@ -105,7 +106,10 @@ int main(){
jpole_calc(&f, &unit_factor,&lambda, &l1, &l2, &l3, &l4, &raddiam); jpole_calc(&f, &unit_factor,&lambda, &l1, &l2, &l3, &l4, &raddiam);
jpole_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &raddiam, &unit_index); jpole_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &raddiam, &unit_index);
break; break;
case 4: printf("Not yet"); break; case 4: clear_scr();
gp_calc(&f, &unit_factor,&lambda, &l1, &l2);
gp_print(&f ,&unit_factor, &lambda, &l1, &l2, &unit_index);
break;
case 5: clear_scr(); case 5: clear_scr();
hb9cv_calc(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam); 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); hb9cv_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam, &unit_index);