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 48
|
double Z,heure,Y;
bool erreur;
String chaine;
//Lecture des valeurs present dans excels
for(int i=2;i<=aligne;i++)
{
erreur=false;
//Transfert dans la variable aValue la Date
vCell=vWorksheet.OlePropertyGet("Cells",i,2);
aValue=vCell.OlePropertyGet("Value");
//Transfert dans la variable climatiseur le numero de la clim
vCell=vWorksheet.OlePropertyGet("Cells",i,1);
climatiseur=vCell.OlePropertyGet("Value");
//Heure
vCell=vWorksheet.OlePropertyGet("Cells",i,3);
heure=vCell.OlePropertyGet("Value");
//Condition afin d'afficher sur le graphique que la date selectionné
if(aValue==MonthCalendar1->Date && climatiseur==ComboBox1->Text)
{
//Valeur de Tambiant
vCell=vWorksheet.OlePropertyGet("Cells",i,4);
try
{
chaine=vCell.OlePropertyGet("Text");
Y=chaine.ToDouble();
}
catch(EConvertError *err)
{
erreur=true;
}
if(erreur)
{
TaskMessageDlg("Erreur graphique", "Format du Variant incorrect", mtError, TMsgDlgButtons() << mbOK, 0);
continue;
}
Z=i;
Series1->AddXY(Z,Y,Z,clRed);
}
}
} |