276 lines
8.2 KiB
C++
276 lines
8.2 KiB
C++
// TestingData.h: interface for the CTestingData class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#if !defined(AFX_TESTINGDATA_H__98736B12_3B1E_4011_AE8A_0D039FC59FAB__INCLUDED_)
|
||
#define AFX_TESTINGDATA_H__98736B12_3B1E_4011_AE8A_0D039FC59FAB__INCLUDED_
|
||
#include <vector>
|
||
#if _MSC_VER > 1000
|
||
#pragma once
|
||
#endif // _MSC_VER > 1000
|
||
|
||
struct _WinTime{
|
||
int wintime_StartTime;
|
||
int wintime_width;
|
||
double wintime_V2;
|
||
double wintime_Integral;
|
||
double wintime_ETA;
|
||
double wintime_M;
|
||
};
|
||
|
||
struct _WinTimeList{
|
||
int ListLength; //包含时窗结果的长度,
|
||
double wintime_Vp;
|
||
_WinTime timeWinList[10];
|
||
};
|
||
|
||
struct _WaveCount{
|
||
int WaveLength;
|
||
_WinTimeList windowList[2]; //单个时窗的长度,由2次放电的时窗组成,每次放电的时窗最多10个,
|
||
//并且两个放电的时窗是一样的
|
||
};
|
||
|
||
typedef struct ST_SIG_TW
|
||
{
|
||
int nTWStartPos;
|
||
int nTWWidth;
|
||
ST_SIG_TW()
|
||
{
|
||
nTWStartPos = 0;
|
||
nTWWidth = 0;
|
||
}
|
||
}STSigTWInfo;
|
||
typedef struct ST_TD_TIME_WIN_INFO
|
||
{
|
||
float fThl;
|
||
float fD;
|
||
float fr;
|
||
int iTimeWinCnt;
|
||
float fEta[20];
|
||
float fM[20];
|
||
}STTdTimeWinInfo;
|
||
|
||
typedef struct ST_TD_IP_DATA_INFO
|
||
{
|
||
int iC1;
|
||
int iC2;
|
||
int iP1;
|
||
int iP2;
|
||
int iN;
|
||
float fK;
|
||
float fI;
|
||
float fV;
|
||
float fR0;
|
||
float fSP;
|
||
float fR0_LC;
|
||
float fM0_LC;
|
||
STTdTimeWinInfo stTdTimeData;
|
||
ST_TD_IP_DATA_INFO()
|
||
{
|
||
iC1 = 0;
|
||
iC2 = 0;
|
||
iP1 = 0;
|
||
iP2 = 0;
|
||
iN = 0;
|
||
fK = 0;
|
||
fI = 0;
|
||
fV = 0;
|
||
fR0 = 0;
|
||
fSP = 0;
|
||
fR0_LC = 0;
|
||
fM0_LC = 0;
|
||
memset(&stTdTimeData, 0, sizeof(STTdTimeWinInfo));
|
||
}
|
||
}StTdTaskIPDataInfo;
|
||
|
||
typedef struct ST_TD_NO_IP_DATA_INFO
|
||
{
|
||
int iC1;
|
||
int iC2;
|
||
int iP1;
|
||
int iP2;
|
||
int iN;
|
||
float fK;
|
||
float fI;
|
||
float fV;
|
||
float fR0;
|
||
float fSP;
|
||
float fR0_LC;
|
||
float fM0_LC;
|
||
ST_TD_NO_IP_DATA_INFO()
|
||
{
|
||
iC1 = 0;
|
||
iC2 = 0;
|
||
iP1 = 0;
|
||
iP2 = 0;
|
||
iN = 0;
|
||
fK = 0;
|
||
fI = 0;
|
||
fV = 0;
|
||
fR0 = 0;
|
||
fSP = 0;
|
||
fR0_LC = 0;
|
||
fM0_LC = 0;
|
||
}
|
||
|
||
}StTdTaskComDataInfo;
|
||
|
||
#define AR_WENNER_ALPHA 1 //温纳(α)
|
||
#define AR_WENNER_BETA 2 //温纳(β)
|
||
#define AR_WENNER_GAMMA 3 //温纳(γ)
|
||
#define AR_POLE_DIPOLE_AMN 4 //三极装置AMN
|
||
#define AR_DIPOLE_POLE_MNB 5 //三极装置MNB
|
||
#define AR_POLE_POLE_AM 6 //二极装置AM
|
||
#define AR_CROSS_HOLE_TYPE 16 //跨孔偶极排列
|
||
#define AR_WENNER_SCH_BASIC 50 //经典 温纳-施伦贝尔排列
|
||
#define AR_WENNER_SCHLUMBERGER 39 //温纳-施伦贝尔排列
|
||
#define AR_CUSTOM_2D_TYPE 40 //自定义2D
|
||
#define AR_EDGE_GARDIENT 41 //边缘梯度
|
||
#define AR_BIPOLE_HOLE_SPT 42 //井地井
|
||
#define AR_DOUBLE_SIZE_3P 43 //双边三级
|
||
#define AR_MID_GARDIENT_SCAN 29 //中梯扫面
|
||
#define AR_SCHLUMBERGER 11 //施伦贝谢尔排列
|
||
#define AR_MARINE 34 //海上测量
|
||
#define AR_DIP_DIP 9 //偶极偶极排列
|
||
#define AR_STRONG_GRADIENT 44 //加强梯度
|
||
#define AR_CROSS_HOLE_GEOMATIVE 45 //跨孔(Geomative)
|
||
#define AR_CROSS_HOLE_GEOMATIVE_AM 46 //跨孔am装置
|
||
#define AR_S3P_MEDIUM 47 //滚动三极装置
|
||
#define AR_LAND_FILL_ONE 48 //垃圾掩埋-斜对角模式
|
||
#define AR_LAND_FILL_TWO 49 //垃圾掩埋-相邻模式
|
||
#define EXP_2D_DATA_BY_DEPTH 1
|
||
|
||
#define AR_POLE_POLE_AM_3D 22 //三维单极-单极装置
|
||
#define AR_POLE_DIPOLE_AMN_3D 23 //三维单极-偶极装置
|
||
#define AR_DIPOLE_DIPOLE_MNB_3D 24 //三维偶极-偶极装置
|
||
#define AR_SCHLUMBERGER_3D 25 //三维斯伦贝谢装置
|
||
#define AR_WENNER_ALFA_3D 26 //三维温纳
|
||
#define AR_WENNER_BETA_3D 27 //三维温纳
|
||
#define AR_GRADIENT_3D 28 //三维中间梯度
|
||
#define AR_MID_GRADIENT_SCAN_3D 29 //三维中梯扫面
|
||
#define AR_LAND_FILL_ONE_3D 48 //三维垃圾填埋场1
|
||
#define AR_LAND_FILL_TWO_3D 49 //三维垃圾填埋场2
|
||
|
||
#define ONE_PAGE_DATA_NUMBER (100)
|
||
|
||
class CDevice;
|
||
class CMedium;
|
||
class CTestingData
|
||
{
|
||
public:
|
||
virtual void UpdataTopography(int f_disType ,int f_start,CListCtrl &f_list);
|
||
BOOL ExcuteSql(CString f_sql);
|
||
virtual void GetTimeWindowList(CListCtrl &f_list);
|
||
virtual BOOL ShowTimeWindow(CListCtrl &tdConList, int iTsn);
|
||
void GetORGCStringToArray(CString f_SrcString, CStringArray *f_array);
|
||
void FreeWindowsTime();
|
||
double GetPeriod();
|
||
bool GetTimeWindowInfo(std::vector<STSigTWInfo>& vtTWInfo);
|
||
void CreateWindowsTime();
|
||
virtual bool CalculateTimeWindows(struct _WinTimeList f_winTimeList, CStringArray *v_orgData, int f_TRwave, int f_Tcycle, int f_Sample, int f_interation, int f_industrial);
|
||
virtual bool CalculateTWInfo(CStringArray *v_orgData, int nFrenquence);
|
||
virtual BOOL DisplayIpCurveGraph();
|
||
|
||
CDevice* m_pDevice;
|
||
|
||
DWORD m_dwID;
|
||
|
||
CString m_szTdName;
|
||
CString m_szTdCN;
|
||
CString m_szTLocation;
|
||
CString m_szPrCN;
|
||
CString m_szTzName;
|
||
CString m_szTzCN;
|
||
|
||
DWORD m_dwTzID;
|
||
DWORD m_dwSCID;
|
||
CString m_szSCCN;
|
||
CString m_szSName;
|
||
int m_iSType;
|
||
int m_iTType;
|
||
int m_iTMode;
|
||
int m_iEAmount;
|
||
int m_iTPAmount;
|
||
int m_iCHAmount;
|
||
int m_iN;
|
||
int m_iTRWave;
|
||
int m_iTRFrequency;
|
||
int m_iIFrequency;
|
||
int m_iSAFrequency;
|
||
int m_iCLayout;
|
||
|
||
float m_fESpace;//电极步长
|
||
CString m_szEDistance;//电极间距
|
||
|
||
//CString m_fESpace;
|
||
//CString m_szEDistance;
|
||
|
||
int m_iWeather;
|
||
int m_iWDIR;
|
||
float m_fTemperature;
|
||
float m_fHeight;
|
||
float m_fHumidity;
|
||
float m_fTRPeriod;
|
||
CString m_szCDate;
|
||
CString m_szCTime;
|
||
CString m_szTDate;
|
||
CString m_szTTime;
|
||
int m_iRCamount;
|
||
int m_iRDirection;
|
||
int m_iCRtime;
|
||
CString m_szPM;
|
||
CString m_szOP;
|
||
CString m_szQA;
|
||
|
||
virtual bool ShowGrList(CListCtrl &tdGrList); //显示接地电阻列表(tdGrList---in:接地电阻列表)
|
||
virtual bool ShowConList(CListCtrl &tdConList); //显示测试数据列表(tdGrList---in:接地测试数据列表)
|
||
virtual bool ShowConListByPage(CListCtrl &tdConList, int iSType = 2); //显示数据内容列表(tdConList---in:数据内容列表)
|
||
virtual bool ShowDetailInfo(CListCtrl &tdDetailList); //显示测试数据详情列表(tdDetailList---in:测试数据详情列表)
|
||
|
||
virtual BOOL SaveTdToExcelFile(CString f_szFileName); //保存数据为Excel文件
|
||
virtual BOOL SaveTdToResCEFile(CString f_szFileName);
|
||
virtual BOOL SaveTdToRes2DFile(CString f_szFileName); //保存数据为Res2D文件
|
||
virtual BOOL SaveTdToRes3DFile(CString f_szFileName);
|
||
virtual BOOL SaveTdToCsvFile(CString f_szFileName); //保存数据为Csv文件
|
||
|
||
virtual bool ExportIP2DDataToDat(CString strFile) {return true;}
|
||
virtual bool ExportIP3DToDatFile(CString strFile) {return true;}
|
||
virtual BOOL ExportIPDataToTxt(CString strFileName){return TRUE;}
|
||
virtual BOOL ExportResDataToTxt(CString strFileName){return TRUE;}
|
||
virtual BOOL ExportSpDataToTxt(CString strFileName){return TRUE;}
|
||
virtual BOOL Export2dDataToTxtBySort(CString strFileName, int iSortMethod){return TRUE;}
|
||
virtual BOOL ExportDataToUrf(CString strFileName){return FALSE;}
|
||
void SetCustToCrossHole(bool bFlag){m_bIsCustomToCrossHole = bFlag;}
|
||
|
||
virtual BOOL DisplayGraph() = NULL; //显示图像
|
||
virtual BOOL DisplayTPSplinesGraph(int iTSN) = NULL; //显示曲线图
|
||
virtual BOOL LoadData(CLinkList<CMedium*>& m_medLinkList); //加载数据(m_medLinkList---in:装置列表)
|
||
|
||
//iOrgPoleID:原电极编号, iHoleID:井编号,iHoleFlag:左右井标记,左井为0,右井为1,iMidEamount为电极数的1/2,
|
||
inline int CalcuCrossHolePoleID(int iOrgPoleID, int iHoleID, int iHoleFlag, int iMidEamount){return iOrgPoleID-(iHoleID-1)*iMidEamount + iHoleFlag*iMidEamount;}
|
||
CTestingData(DWORD dwID, _ConnectionPtr& pConnection);
|
||
virtual ~CTestingData();
|
||
|
||
CPtrList m_tdChaList;
|
||
_WaveCount *m_waveCount;
|
||
|
||
protected:
|
||
_ConnectionPtr m_pConnection;
|
||
CHandleProcessor m_handleProcessor;
|
||
double GetCycle(int f_type);
|
||
BOOL SaveOrgDataToDB(DWORD dwTdID); //保存原始数据到数据库(dwTdID---in:ID)
|
||
BOOL SaveGRDataToDB(DWORD dwTdID); //保存接地电阻数据到数据库(dwTdID---in:ID)
|
||
bool m_bIsCustomToCrossHole; //是否进行将自定义装置转换为跨孔
|
||
private:
|
||
int GetSample(int f_nindustrial, int f_type);
|
||
|
||
double adc_integral(int *adc_buf, int length);
|
||
double adc_average(int *adc_buf, int length);
|
||
CString GetWaveNum(int f_waveType);
|
||
|
||
void TransfToDouble(double* f_buff, CStringArray f_szArray);
|
||
double adc_calculate(double offset, double coefficient, double adc);
|
||
};
|
||
|
||
#endif // !defined(AFX_TESTINGDATA_H__98736B12_3B1E_4011_AE8A_0D039FC59FAB__INCLUDED_)
|