some things are working but regulation is fucked!
This commit is contained in:
44
file_print.c
Normal file
44
file_print.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* file_print.c
|
||||
*
|
||||
* Created on: 13. maj 2025
|
||||
* Author: Christian L. V. Madsen (OZ1CM)
|
||||
*/
|
||||
#include "file_print.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
FILE *fpt;
|
||||
|
||||
void cm_file_open(char *fileName, float vtarget){
|
||||
|
||||
fpt = fopen(fileName,"w+");
|
||||
fprintf(fpt,"time_s, Vout, Power, Vtarget = %.2f \n",vtarget);
|
||||
|
||||
}
|
||||
|
||||
void cm_file_close(){
|
||||
|
||||
fclose(fpt);
|
||||
|
||||
}
|
||||
|
||||
void cm_file_print(float duty,float Rload, float Vout, float time){
|
||||
|
||||
fprintf(fpt,"%.3f, %.2f, %.2f, %.2f\n", time, Vout, Vout/Rload, duty);
|
||||
|
||||
}
|
||||
|
||||
void showProcentInCmd(float time, float simulate_target_time){
|
||||
|
||||
float time_left = time / simulate_target_time;
|
||||
|
||||
time_left *= 100;
|
||||
|
||||
printf("\r Progress: %.1f%%", time_left);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user