Add files via upload

This commit is contained in:
thkummi
2021-08-19 04:08:39 +02:00
committed by GitHub
parent a36d0138b4
commit 96616bb2bd
6 changed files with 95 additions and 14 deletions
+4
View File
@@ -37,6 +37,10 @@
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
<Unit filename="hb9cv.h" /> <Unit filename="hb9cv.h" />
<Unit filename="jpole.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="jpole.h" />
<Unit filename="main.c"> <Unit filename="main.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
+5 -2
View File
@@ -1,8 +1,11 @@
prog: main.o hb9cv.o ctenna: main.o hb9cv.o jpole.o
gcc -o prog main.o hb9cv.o gcc -o ctenna main.o hb9cv.o jpole.o
main.o: main.c main.o: main.c
gcc -c main.c gcc -c main.c
hb9cv.o: hb9cv.c hb9cv.o: hb9cv.c
gcc -c hb9cv.c gcc -c hb9cv.c
jpole.o: jpole.c
gcc -c jpole.c
+9 -8
View File
@@ -18,13 +18,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <stdio.h> #include <stdio.h>
#include "hb9cv.h" #include "hb9cv.h"
/*
void printunits (int *unit_index){ void printunits (int *unit_index){
switch(*unit_index){ switch(*unit_index){
case 1: printf("mm\n"); break; case 1: printf("mm\n"); break;
case 2: printf("inch\n"); break; case 2: printf("inch\n"); break;
} }
} }
*/
void hb9cv_calc (float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *l5, float *bdiam, float *raddiam){ void hb9cv_calc (float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *l5, float *bdiam, float *raddiam){
*lambda = ( 30000000 / *f) / 100; *lambda = ( 30000000 / *f) / 100;
@@ -41,13 +42,13 @@ void hb9cv_print (float *f, float *unit_factor, float *lambda, float *l1, float
printf(" Calculated for %f mHz\n", *f); printf(" Calculated for %f mHz\n", *f);
printf("\n"); printf("\n");
printf(" Lambda is %f mm\n", *lambda); printf(" Lambda is %f mm\n", *lambda);
printf(" L1 Driven Element is %f ", *l1); printunits(&*unit_index); printf(" L1 Driven Element is %f ", *l1); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" L2 Reflector is %f ", *l2); printunits(&*unit_index); printf(" L2 Reflector is %f ", *l2); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" L3 element spaceing is %f ", *l3); printunits(&*unit_index); printf(" L3 element spaceing is %f ", *l3); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" L4 Matching on dr. element is %f ", *l4); printunits(&*unit_index); printf(" L4 Matching on dr. element is %f ", *l4); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" L5 Matching on reflector is %f ", *l5); printunits(&*unit_index); printf(" L5 Matching on reflector is %f ", *l5); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" Boom Diam. is %f ", *bdiam); printunits(&*unit_index); printf(" Boom Diam. is %f ", *bdiam); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" Radiator Diam. is %f ", *raddiam); printunits(&*unit_index); printf(" Radiator Diam. is %f ", *raddiam); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf("\n"); printf("\n");
printf(" connect feed on this side \n"); printf(" connect feed on this side \n");
printf(" --------------------------L1 \n"); printf(" --------------------------L1 \n");
+48
View File
@@ -0,0 +1,48 @@
#include <stdio.h>
#include "jpole.h"
void jpole_calc(float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *raddiam){
*lambda = ( 29971000 / *f ) / 100;
*l1 = (0.96 * *lambda * 0.75) * *unit_factor;
*l2 = (0.96 * *lambda * 0.25) * *unit_factor;
*l3 = (0.96 * *lambda * 0.025) * *unit_factor;
*l4 = (0.96 * *lambda * 0.026) * *unit_factor;
*raddiam = (0.96 * *lambda * 0.01) * *unit_factor;
}
void jpole_print(float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *raddiam, int *unit_index){
printf(" Calculated for %f MHz\n", *f);
printf("\n");
printf(" Radiator Diam. is %f ", *raddiam); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf("\n");
printf("\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [L1 || %f ", *l1); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" [ ||\n");
printf(" [ ||\n");
printf(" [ || || ]\n");
printf(" [ || || ]\n");
printf(" [ || || ]\n");
printf(" [ || || L2]%f ", *l2); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" [ || ______ || ]\n");
printf(" [ || / ___|___ || ]\n");
printf(" [ ||____/ /' | '\\______|| ]\n");
printf(" [ || \\.__|__./ || ] ]\n");
printf(" [ || | 50 | || L4] ]%f ", *l4); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf(" [ || | Ohm | || ] ]\n");
printf(" [ || ~~~~~~~~~ || ] ]\n");
printf(" [ || || ] ]\n");
printf(" ========================= \n");
printf(" L3 %f ", *l3); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf("\n");
printf("\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 JPOLE_H_
#define JPOLE_H_
void jpole_calc();
void jpole_print();
#endif // J-POLE_H_INCLUDED
+8 -4
View File
@@ -15,7 +15,7 @@ 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 <stdlib.h> //#include <stdlib.h>
void clear_scr(void){ void clear_scr(void){
@@ -101,9 +101,13 @@ int main(){
break; break;
case 2: clear_scr();set_units_system(&unit_factor ,&unit_index ); case 2: clear_scr();set_units_system(&unit_factor ,&unit_index );
break; break;
//case 3: printf("Not yet"); break; case 3: clear_scr();
//case 4: printf("Not yet"); break; jpole_calc(&f, &unit_factor,&lambda, &l1, &l2, &l3, &l4, &raddiam);
case 5: hb9cv_calc(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam); jpole_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &raddiam, &unit_index);
break;
case 4: printf("Not yet"); 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); hb9cv_print(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam, &unit_index);
break; break;
// default: maybe easteregg in future // default: maybe easteregg in future