ГОСТ Р ИСО/МЭК 10373-6—2015
/* Ап-зу lor *Lme and sense coll voltage vd *f
d o u d e vtlme(MAX_SAMPL£S|; /* time a rra yV
douMe v d (MAX_SAMPLES];/* A rray for d iffe re n t colL v o ltag e */
/»*»***»***»***»***»***»***»***»***»***»***»***»»**il*IHI(****»*«4
,*f
/*** Read CSV File Function
/**»
*** /
/»**rescription:***/
/*** TJiis function reads the table of time and sense coll ***/
/*** voltage from a File In CSV Format»**/
/**»»♦*
f
/»** Input:filename***/
/**»»♦* /
/»** Return: Number of samples (sample Count)***/
/***0 if an error occurred
/ *
++
***/
*/
/*** Displays Statistics:
/* •*
***/
***/
/*** Filename, SampleCount, Sample rate, Max/Min Voltage »**/
*****♦********•******“ **’**“ •**"**’***************’*** *’***’/
lOt readcsvJChar* fname)
1
trouble a,b;
double max
_
vd,nun
_
va;
int i;
FILE*sampie_flle;
/#*♦#♦♦#*♦**# Qp6*fl Fil6 «♦***♦***********************♦*****/
if (1strohr(fname,street(fname, ".csv");
if ((samplejile - fopen(fname, ”r">)— NCLL)
i
prxntt("Cannot open input file ss
.\n",
fname);
return 0;
!**********************************************************!
/* Read CSV Fxle*/
У * *** ******************************************************/
1
0
max_va— le-9F;
man vd— max_vd;
- ?
while (!feof(sample file))
(
.1 (x>-KAX_SAXFLES)
{
print£("Warning: File truncated !l!\n*>;
printf("To much samples in file 4s\b\n",fname);
break;
I
fscanf (sample
_
iile, " iL f, iL f\n ", &a, ab),-
vtlme fi] - •»;
vdl1| - *;
if (vd(iJ>max_vd) max_vd-vd[11;
if (vdll|<mln_vd) min_vd“Vd(i|;
if*-;
I
tclose(sample_nle};
I************ Displays Statistics
************************
/
94