-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVFCHIDLG.cpp
120 lines (81 loc) · 1.96 KB
/
VFCHIDLG.cpp
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
// vfchidlg.cpp : implementation file
//
#include "float.h"
#include "stdafx.h"
#include "psx.h"
#include "vfchidlg.h"
#include "ergdlg.h"
#include "calc.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CvfchiDlg dialog
CvfchiDlg::CvfchiDlg(CWnd* pParent /*=NULL*/)
: CDialog(CvfchiDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CvfchiDlg)
m_vfchid = "";
m_vfchia = "";
m_vfchib = "";
m_vfchib = "";
//}}AFX_DATA_INIT
}
void CvfchiDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CvfchiDlg)
DDX_Text(pDX, IDC_D, m_vfchid);
DDX_Text(pDX, IDC_A, m_vfchia);
DDX_Text(pDX, IDC_B, m_vfchib);
DDX_Text(pDX, IDC_C, m_vfchic);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CvfchiDlg, CDialog)
//{{AFX_MSG_MAP(CvfchiDlg)
ON_BN_CLICKED(IDC_BERECH, OnClickedBerech)
ON_BN_CLICKED(IDC_NEU, OnClickedNeu)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CvfchiDlg message handlers
void CvfchiDlg::OnClickedBerech()
{
char ac[10],ap[10];
double chivf,phivf;
int cia, cib, cic, cid;
CvfchiDlg vfchi;
calc cal;
//CPsmDoc doc;
UpdateData(TRUE);
cia = atoi(m_vfchia);
cib = atoi(m_vfchib);
cic = atoi(m_vfchic);
cid = atoi(m_vfchid);
cal.vfc(cia, cib, cic, cid);
chivf=cal.chi;
phivf=cal.phi;
sprintf(ac,"\tChi= %3.4lf",chivf);
sprintf(ap,"\tPhi= %2.4lf",phivf);
m_ergtx1 = ac;
m_ergtx2 = ap;
//erg.m_erg1 = cal.chi;
//erg.m_erg2 = cal.phi;
}
void CvfchiDlg::OnClickedNeu()
{
m_vfchia = "";
m_vfchib = "";
m_vfchic = "";
m_vfchid = "";
UpdateData(FALSE);
}
void CvfchiDlg::OnOK()
{
FILE *ftable;
ftable = fopen("c:\\psm\\prot1.psm","a");
fprintf(ftable,"Vier-Felder Chi-quadrat\n----------------");
fclose(ftable);
CDialog::OnOK();
}