1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| int tps = 1;
FILE * file;
CString datafile;
unsigned long int tmpx;
double tmpy, tmp;
bool tmprupt;
for (int cntfile = 1; cntfile <= graphProp->Data->FileNbr; cntfile++)
{
datafile.Format("%s\\%s_%04d", graphProp->Data->Param.datapath, graphProp->Data->Param.Name, cntfile);
file = fopen(datafile, "r");
while (ftell(file)!=EOF)
{
AKI_CHECK(!fread(&tmpx,sizeof(unsigned long int),1,file),"Erreur de lecture")
AKI_CHECK(!fread(&tmprupt,sizeof(bool),1,file),"Erreur de lecture")
for (int k=1;k<=graphProp->Data->Param.NbrChannels;k++)
{
if (k-1==graphNum)
AKI_CHECK(!fread(&tmpy,sizeof(double),1,file),"Erreur de saisie")
else
AKI_CHECK(!fread(&tmp,sizeof(double),1,file),"Erreur de saisie")
}
x1 = coords_x.WtoX(tmpx/(double)graphProp->Data->Param.SampleRate);
y1 = coords_y.WtoX(tmpy);
if(x != x1 || y != y1)
{
if((m_graphflags & GRAPH_SQUAREPOINTS)!=0)
DrawSquarePoint(dc, x1, y1);
if((m_graphflags & GRAPH_GRAPH_SCATTER) == 0)
{
dc->MoveTo(x, y);
dc->LineTo(x1, y1);
}
x = x1;
y = y1;
}
}
fclose(file);
} |
Partager