diff --git a/Constenna.cbp b/Constenna.cbp
index 855cdf6..ca25cf5 100644
--- a/Constenna.cbp
+++ b/Constenna.cbp
@@ -37,6 +37,10 @@
+
+
+
+
diff --git a/Makefile b/Makefile
index efeb6e4..78d0bb4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
-prog: main.o hb9cv.o
- gcc -o prog main.o hb9cv.o
+ctenna: main.o hb9cv.o jpole.o
+ gcc -o ctenna main.o hb9cv.o jpole.o
main.o: main.c
gcc -c main.c
hb9cv.o: hb9cv.c
gcc -c hb9cv.c
+
+jpole.o: jpole.c
+ gcc -c jpole.c
diff --git a/hb9cv.c b/hb9cv.c
index 80ddf98..740c1ca 100644
--- a/hb9cv.c
+++ b/hb9cv.c
@@ -18,13 +18,14 @@ along with this program. If not, see .
#include
#include "hb9cv.h"
-
+/*
void printunits (int *unit_index){
switch(*unit_index){
case 1: printf("mm\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){
*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("\n");
printf(" Lambda is %f mm\n", *lambda);
- printf(" L1 Driven Element is %f ", *l1); printunits(&*unit_index);
- printf(" L2 Reflector is %f ", *l2); printunits(&*unit_index);
- printf(" L3 element spaceing is %f ", *l3); printunits(&*unit_index);
- printf(" L4 Matching on dr. element is %f ", *l4); printunits(&*unit_index);
- printf(" L5 Matching on reflector is %f ", *l5); printunits(&*unit_index);
- printf(" Boom Diam. is %f ", *bdiam); printunits(&*unit_index);
- printf(" Radiator Diam. is %f ", *raddiam); 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); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
+ 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); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
+ 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); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
+ printf(" Radiator Diam. is %f ", *raddiam); switch(*unit_index){ case 1: printf("mm\n"); break; case 2: printf("inch\n"); break; };
printf("\n");
printf(" connect feed on this side \n");
printf(" --------------------------L1 \n");
diff --git a/jpole.c b/jpole.c
new file mode 100644
index 0000000..86bd58b
--- /dev/null
+++ b/jpole.c
@@ -0,0 +1,48 @@
+#include
+#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");
+}
diff --git a/jpole.h b/jpole.h
new file mode 100644
index 0000000..2b4a125
--- /dev/null
+++ b/jpole.h
@@ -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 .
+*/
+
+#ifndef JPOLE_H_
+#define JPOLE_H_
+
+void jpole_calc();
+void jpole_print();
+
+#endif // J-POLE_H_INCLUDED
diff --git a/main.c b/main.c
index 53220e0..98c1d01 100644
--- a/main.c
+++ b/main.c
@@ -15,7 +15,7 @@ along with this program. If not, see .
#include
#include "hb9cv.h"
-
+#include "jpole.h"
//#include
void clear_scr(void){
@@ -101,9 +101,13 @@ int main(){
break;
case 2: clear_scr();set_units_system(&unit_factor ,&unit_index );
break;
- //case 3: printf("Not yet"); break;
- //case 4: printf("Not yet"); break;
- case 5: hb9cv_calc(&f ,&unit_factor, &lambda, &l1, &l2, &l3, &l4, &l5, &bdiam, &raddiam);
+ 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);
+ 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);
break;
// default: maybe easteregg in future