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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
// EFS_CourbeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "EFS_Graphique.h"
#include "EFS_CourbeDlg.h"
// fichiers pour tracer le graphe
#include "Parametre.h"
#include "Temperature.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEFS_CourbeDlg dialog
CEFS_CourbeDlg::CEFS_CourbeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEFS_CourbeDlg::IDD, pParent)
{
EnableAutomation();
//{{AFX_DATA_INIT(CEFS_CourbeDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CEFS_CourbeDlg::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CDialog::OnFinalRelease();
}
void CEFS_CourbeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEFS_CourbeDlg)
DDX_Control(pDX, IDC_MSCHART1, m_Chart);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEFS_CourbeDlg, CDialog)
//{{AFX_MSG_MAP(CEFS_CourbeDlg)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_AFFICHER, OnAfficher)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CEFS_CourbeDlg, CDialog)
//{{AFX_DISPATCH_MAP(CEFS_CourbeDlg)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IEFS_CourbeDlg to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {111EA709-0592-40CF-9AFA-A2A49B346A9B}
static const IID IID_IEFS_CourbeDlg =
{ 0x111ea709, 0x592, 0x40cf, { 0x9a, 0xfa, 0xa2, 0xa4, 0x9b, 0x34, 0x6a, 0x9b } };
BEGIN_INTERFACE_MAP(CEFS_CourbeDlg, CDialog)
INTERFACE_PART(CEFS_CourbeDlg, IID_IEFS_CourbeDlg, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEFS_CourbeDlg message handlers
BOOL CEFS_CourbeDlg::OnInitDialog()
{ int i=0;
char nom[64];// a rempir par Nom : p.nom
char prenom[64];// a rempir par Nom : p.prenom
//char label[64];
//graphFrame = (CWnd*)GetDlgItem(IDC_GRAPH_FRAME);
DWORD numElements[2]; // 10x10
numElements[0]=10;
numElements[1]=nombre;
// Create the safe-array...
tab_valeur.Create(VT_R8, 2, numElements);
long index[2];
for(index[0]=0; index[0]<nombre; index[0]++) {
int i=0;
for(index[1]=0; index[1]<10; index[1]++) {
tab_valeur.PutElement(index, &tabT[i].valeur);
}
}
m_Chart.SetChartData(tab_valeur.Detach());
m_Chart.Refresh;
// association des controleurs
sdate = (CStatic *) GetDlgItem(IDC_GRAPH_DATE);
sheure = (CStatic *) GetDlgItem(IDC_GRAPH_HEURE);
snom = (CStatic *) GetDlgItem(IDC_GRAPH_NOM);
sprenom = (CStatic *) GetDlgItem(IDC_GRAPH_PRENOM);
_strdate(stime);
char fic_date[64];
fic_date[0]=stime[3];
fic_date[1]=stime[4];
fic_date[2]=stime[2];
fic_date[3]=stime[0];
fic_date[4]=stime[1];
fic_date[5]=stime[5];
fic_date[6]=stime[6];
fic_date[7]=stime[7];
fic_date[8]='\0';
sprintf(date,"Date : %s",fic_date);
sdate->SetWindowText(_T(date));
_strtime(stime);
sprintf(heure," Heure : %s",stime);
sheure->SetWindowText(_T(heure));
sprintf(nom," Nom : %s ",p.nom);
snom->SetWindowText(_T(nom));
sprintf(prenom,"Prénom : %s ",p.prenom);
sprenom->SetWindowText(_T(prenom));
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEFS_CourbeDlg::OnOk()
{ CDialog::OnOK();
// TODO: Add your control notification handler code here
}
void CEFS_CourbeDlg::OnAfficher()
{
// TODO: Add your control notification handler code here
//graphFrame = (CWnd*)GetDlgItem(IDC_GRAPH_FRAME);
_strdate(stime);
char fic_date[64];
fic_date[0]=stime[3];
fic_date[1]=stime[4];
fic_date[2]=stime[2];
fic_date[3]=stime[0];
fic_date[4]=stime[1];
fic_date[5]=stime[5];
fic_date[6]=stime[6];
fic_date[7]=stime[7];
fic_date[8]='\0';
sprintf(date,"Date : %s",fic_date);
sdate->SetWindowText(_T(date));
_strtime(stime);
sprintf(heure," Heure : %s",stime);
sheure->SetWindowText(_T(heure));
//UpdateWindow();
} |