-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClimateSet.cpp
More file actions
105 lines (90 loc) · 3.29 KB
/
ClimateSet.cpp
File metadata and controls
105 lines (90 loc) · 3.29 KB
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
// ClimateSet.h : Implementation of the CClimateSet class
// CClimateSet implementation
// code generated on Wednesday, September 28, 2005, 1:23 PM
#include "stdafx.h"
#include "ClimateSet.h"
IMPLEMENT_DYNAMIC(CClimateSet, CRecordset)
CClimateSet::CClimateSet(CDatabase* pdb)
: CRecordset(pdb)
{
m_Variable_Name = L"";
m_ShortName = L"";
m_VarID = 0;
m_BinSize = 0.0;
m_OptionType = 0;
m_Stats_Table = FALSE;
m_Stats_Graph = FALSE;
m_Daily_Freqs = FALSE;
m_Period_Mins = FALSE;
m_Period_Maxs = FALSE;
m_Data_Count = FALSE;
m_CriticalPercentile = 0;
m_cp2 = 0;
m_Daily_List = 0;
m_FilterValue = -1;
m_nFields = 15;
m_nDefaultType = dynaset;
}
//#error Security Issue: The connection string may contain a password
// The connection string below may contain plain text passwords and/or
// other sensitive information. Please remove the #error after reviewing
// the connection string for any security related issues. You may want to
// store the password in some other form or use a different user authentication.
CString CClimateSet::GetDefaultConnect()
{
return _T("");//_T("DBQ=F:\\Source\\FFP4\\Data\\r1_short.mdb;DefaultDir=F:\\Source\\FFP4\\Data;Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS Access;FILEDSN=C:\\Program Files\\Common Files\\ODBC\\Data Sources\\ffp.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;");
}
CString CClimateSet::GetDefaultSQL()
{
return _T("[ffpClimateOptions]");
}
// new function for FFP4.1 10/2012
// based on varSortOrder (from ffpOpts & ffpRunOptions)
// we set the
// i.e. replace this line:
// climSet->m_strSort = _T("[VarID]");
// with this:
// climSet->setVarSortOrder(varSortOrder);
void CClimateSet::setVarSortOrder(int _varSortOrder)
{
if (_varSortOrder == 1)
m_strSort = _T("[Variable Name]");
else if (_varSortOrder == 2)
m_strSort = _T("[OptionType],[VarID]");
else
m_strSort = _T("[VarID]");
}
void CClimateSet::DoFieldExchange(CFieldExchange* pFX)
{
pFX->SetFieldType(CFieldExchange::outputColumn);
// Macros such as RFX_Text() and RFX_Long () are dependent on the
// type of the member variable, not the type of the field in the database.
// ODBC will try to automatically convert the column value to the requested type
RFX_Text(pFX, _T("[Variable Name]"), m_Variable_Name);
RFX_Text(pFX, _T("[ShortName]"), m_ShortName);
RFX_Byte(pFX, _T("[VarID]"), m_VarID);
RFX_Single(pFX, _T("[BinSize]"), m_BinSize);
RFX_Long (pFX, _T("[OptionType]"), m_OptionType);
RFX_Bool(pFX, _T("[Stats Table]"), m_Stats_Table);
RFX_Bool(pFX, _T("[Stats Graph]"), m_Stats_Graph);
RFX_Bool(pFX, _T("[Daily Freqs]"), m_Daily_Freqs);
RFX_Bool(pFX, _T("[Period Mins]"), m_Period_Mins);
RFX_Bool(pFX, _T("[Period Maxs]"), m_Period_Maxs);
RFX_Bool(pFX, _T("[Data Count]"), m_Data_Count);
RFX_Long (pFX, _T("[CriticalPercentile]"), m_CriticalPercentile);
RFX_Long (pFX, _T("[CriticalPercentile2]"), m_cp2);
RFX_Long(pFX, _T("[Daily List]"), m_Daily_List);
RFX_Double(pFX, _T("[FilterValue]"), m_FilterValue);
}
/////////////////////////////////////////////////////////////////////////////
// CClimateSet diagnostics
#ifdef _DEBUG
void CClimateSet::AssertValid() const
{
CRecordset::AssertValid();
}
void CClimateSet::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG