mirror of
https://github.com/stevenhowes/ctenna.git
synced 2026-05-26 15:53:28 +01:00
Add files via upload
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
#include "jpole.h"
|
#include "jpole.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void jpole_calc(float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *raddiam){
|
void jpole_calc(float *f, float *unit_factor, float *lambda, float *l1, float *l2, float *l3, float *l4, float *raddiam){
|
||||||
*lambda = ( 29971000 / *f ) / 100;
|
*lambda = ( 29971000 / *f ) / 100;
|
||||||
*l1 = (0.96 * *lambda * 0.75) * *unit_factor;
|
*l1 = (0.96 * *lambda * 0.75) * *unit_factor;
|
||||||
@@ -45,4 +44,4 @@ void jpole_print(float *f, float *unit_factor, float *lambda, float *l1, float *
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
//#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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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
|
void set_freq(float *f){ // change the MHz
|
||||||
float input;
|
float input;
|
||||||
@@ -105,14 +121,20 @@ int main(){
|
|||||||
case 3: clear_scr();
|
case 3: clear_scr();
|
||||||
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);
|
||||||
|
myflush ( stdin );
|
||||||
|
mypause();
|
||||||
break;
|
break;
|
||||||
case 4: clear_scr();
|
case 4: clear_scr();
|
||||||
gp_calc(&f, &unit_factor,&lambda, &l1, &l2);
|
gp_calc(&f, &unit_factor,&lambda, &l1, &l2);
|
||||||
gp_print(&f ,&unit_factor, &lambda, &l1, &l2, &unit_index);
|
gp_print(&f ,&unit_factor, &lambda, &l1, &l2, &unit_index);
|
||||||
|
myflush ( stdin );
|
||||||
|
mypause();
|
||||||
break;
|
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);
|
||||||
|
myflush ( stdin );
|
||||||
|
mypause();
|
||||||
break;
|
break;
|
||||||
// default: maybe easteregg in future
|
// default: maybe easteregg in future
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user