a
This commit is contained in:
@@ -0,0 +1,513 @@
|
||||
# TdManager
|
||||
|
||||
<cite>
|
||||
**本文档引用的文件**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp)
|
||||
- [TdManager.h](file://h/TdManager.h)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp)
|
||||
- [TaskDataOper.h](file://h/TaskDataOper.h)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp)
|
||||
- [TdRecord.h](file://h/TdRecord.h)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp)
|
||||
- [TestingData.h](file://h/TestingData.h)
|
||||
</cite>
|
||||
|
||||
## 目录
|
||||
1. [简介](#简介)
|
||||
2. [项目结构](#项目结构)
|
||||
3. [核心组件](#核心组件)
|
||||
4. [架构概述](#架构概述)
|
||||
5. [详细组件分析](#详细组件分析)
|
||||
6. [依赖分析](#依赖分析)
|
||||
7. [性能考虑](#性能考虑)
|
||||
8. [故障排除指南](#故障排除指南)
|
||||
9. [结论](#结论)
|
||||
10. [附录](#附录)(如有必要)
|
||||
|
||||
## 简介
|
||||
TdManager模块是GeomativeStudio软件中负责测试数据采集、存储和管理的核心组件。该模块主要负责接收来自设备或文件的原始测量数据,通过TaskDataOper进行处理,并将结果持久化到TdRecord和TestingData对象中。它在测试数据与项目、脚本的关联机制中起着关键作用,确保数据的完整性和一致性。本文档将详细介绍TdManager模块的职责和实现,包括数据解析错误或存储失败的解决方案,并提供代码示例展示数据接收和记录的核心流程。
|
||||
|
||||
## 项目结构
|
||||
GeomativeStudio项目的结构清晰,主要分为以下几个部分:
|
||||
- **CACHE**: 存储缓存文件,如`project.xml`和`testzone.xml`。
|
||||
- **DB**: 包含数据库相关的文件,如`数据库字段修改记录.txt`。
|
||||
- **Install**: 包含安装文件和配置文件,如`config.ini`和`version_info.txt`。
|
||||
- **LOG**: 存储日志文件,如`upg_geo_filetrans_log.txt`。
|
||||
- **Release**: 包含发布版本的文件,如`config.ini`和`msado15.tlh`。
|
||||
- **cpp**: 源代码目录,包含多个子目录,如`Managers`、`Operator`、`ProblemZone`等。
|
||||
- **h**: 头文件目录,包含与源代码对应的头文件。
|
||||
- **res**: 资源文件目录,包含资源文件如`GeoMative.rc2`。
|
||||
- **tools**: 工具脚本目录,包含批处理文件如`IAP-GD10.bat`。
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
subgraph "根目录"
|
||||
CACHE["CACHE"]
|
||||
DB["DB"]
|
||||
Install["Install"]
|
||||
LOG["LOG"]
|
||||
Release["Release"]
|
||||
cpp["cpp"]
|
||||
h["h"]
|
||||
res["res"]
|
||||
tools["tools"]
|
||||
end
|
||||
subgraph "cpp"
|
||||
Managers["Managers"]
|
||||
Operator["Operator"]
|
||||
ProblemZone["ProblemZone"]
|
||||
end
|
||||
subgraph "Managers"
|
||||
TdManager["TdManager.cpp"]
|
||||
TaskDataOper["TaskDataOper.cpp"]
|
||||
end
|
||||
subgraph "ProblemZone"
|
||||
TdRecord["TdRecord.cpp"]
|
||||
TestingData["TestingData.cpp"]
|
||||
end
|
||||
subgraph "h"
|
||||
TdManagerH["TdManager.h"]
|
||||
TaskDataOperH["TaskDataOper.h"]
|
||||
TdRecordH["TdRecord.h"]
|
||||
TestingDataH["TestingData.h"]
|
||||
end
|
||||
TdManager --> TdManagerH
|
||||
TaskDataOper --> TaskDataOperH
|
||||
TdRecord --> TdRecordH
|
||||
TestingData --> TestingDataH
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 核心组件
|
||||
TdManager模块的核心组件包括`TdManager`、`TaskDataOper`、`TdRecord`和`TestingData`。这些组件协同工作,确保测试数据的高效采集、处理和存储。
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 架构概述
|
||||
TdManager模块的架构设计旨在实现高效的数据管理和处理。模块通过`TdManager`类接收来自设备或文件的原始测量数据,然后通过`TaskDataOper`类进行数据处理,最终将结果持久化到`TdRecord`和`TestingData`对象中。这种设计确保了数据的完整性和一致性,同时提供了灵活的数据处理和存储机制。
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
subgraph "数据采集"
|
||||
Device["设备"]
|
||||
File["文件"]
|
||||
end
|
||||
subgraph "数据处理"
|
||||
TdManager["TdManager"]
|
||||
TaskDataOper["TaskDataOper"]
|
||||
end
|
||||
subgraph "数据存储"
|
||||
TdRecord["TdRecord"]
|
||||
TestingData["TestingData"]
|
||||
end
|
||||
Device --> TdManager
|
||||
File --> TdManager
|
||||
TdManager --> TaskDataOper
|
||||
TaskDataOper --> TdRecord
|
||||
TaskDataOper --> TestingData
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 详细组件分析
|
||||
### TdManager 分析
|
||||
`TdManager`类是测试数据管理的核心,负责接收和处理来自设备或文件的原始测量数据。它通过`ImportTdHeadToDB`、`Import2DTdOrgToDB`、`ImportCETdOrgToDB`等方法将数据导入数据库,并通过`UploadCETdFromDev`、`Upload2DTdFromDev`等方法从设备上载数据。
|
||||
|
||||
#### 类图
|
||||
```mermaid
|
||||
classDiagram
|
||||
class CTdManager {
|
||||
+void DeleteSPCETd(DWORD dwID)
|
||||
+void DeleteSP3DTd(DWORD dwID)
|
||||
+void DeleteSP2DTd(DWORD dwID)
|
||||
+void DeleteRsp3DTd(DWORD dwID)
|
||||
+void DeleteIpsp3DTd(DWORD dwID)
|
||||
+BOOL CheckTdExist(CString szPrCN, CString szTzCN, CString szTdCN, CDevice* const pDev, DWORD *TdId)
|
||||
+BOOL OnlineCheckTdExist(CString szTdID, CString szDevSN, DWORD *TdId)
|
||||
+BOOL OnlineCheckElecInfoExist(CString strTdID, CString szDevSN)
|
||||
+DWORD ImportTdHeadToDB(DWORD dwTzID, CString szHeadFile, CDevice* const pDev, DWORD* pExTdID = NULL)
|
||||
+BOOL Import2DTdOrgToDB(DWORD dwTdID, CString szOrgFile, CDevice* const pDev)
|
||||
+BOOL ImportCETdOrgToDB(DWORD dwTdID, CString szOrgFile, CDevice* const pDev)
|
||||
+BOOL Import3DTdOrgToDB(DWORD dwTdID, CString szOrgFile, CDevice* const pDev)
|
||||
+BOOL Import2DTdConToDB(DWORD dwTdID, CString szDatFile, CDevice* const pDev, int* pTSN=NULL)
|
||||
+BOOL ImportCETdConToDB(DWORD dwTdID, CString szDatFile, CDevice* const pDev)
|
||||
+BOOL Import3DTdConToDB(DWORD dwTdID, CString szDatFile, CDevice* const pDev, int* pTSN = NULL)
|
||||
+BOOL Import2DGRToDB(DWORD dwTdID, CString szGRFile, CDevice* const pDev)
|
||||
+BOOL Import3DGRToDB(DWORD dwTdID, CString szGRFile, CDevice* const pDev)
|
||||
+BOOL ImportCETGRToDB(DWORD dwTdID, CString szGRFile)
|
||||
+BOOL UploadCETdFromDev(CString szPrCN, CString szTzCN, CString szTdCN, CString strSubTdCN, CDevice* const pDev)
|
||||
+BOOL Upload2DTdFromDev(CString szPrCN, CString szTzCN, CString szTdCN, CString strSubTdCN, CDevice* const pDev)
|
||||
+BOOL Upload3DTdFromDev(CString szPrCN, CString szTzCN, CString szTdCN, CString strSubTdCN, CDevice* const pDev)
|
||||
+BOOL UploadWellTdFromDev(CString szPrCN, CString szTzCN, CString szTdCN, CString strSubTdCN, CDevice* const pDev)
|
||||
+BOOL DeleteTdInDev(CString szPrCN, CString szTzCN, CString szTdCN, CDevice* const pDev)
|
||||
+BOOL InitialTDListByTzForSyn(CListCtrl &tdList, CString szDeSN, CString szTzCN)
|
||||
+BOOL InitialTDListByProForSyn(CListCtrl &tdList, CString szDeSN, CString szPrCN)
|
||||
+BOOL InitialTDListByOnLineForSyn(CListCtrl &tdList, CString szDeSN, UINT32 &uiTotNum)
|
||||
+BOOL InitialDevListByOnLineForSyn(CListCtrl &tdList, CString szDeSN, STSynDevParam *ptLocalDevParam)
|
||||
+BOOL InitialCableListByOnLineForSyn(CListCtrl &tdList, CString szDeSN, STRemCableCallInfo *ptLocalCableInfo)
|
||||
+BOOL OnlineSevTDListSynToDB(STRemTaskArg *tTaskArg, CString szDeSN)
|
||||
+DWORD OnLineImportTdHeadToDB(STRemTaskArg *tTaskArg, CString szDevSN)
|
||||
+BOOL Convert2DTo3D(DWORD dwTzHandle)
|
||||
+void DeleteObjInMem(DWORD dwHandle)
|
||||
+void DeleteRspCETd(DWORD dwID)
|
||||
+void DeleteIpspCETd(DWORD dwID)
|
||||
+void DeleteRsp2DTd(DWORD dwID)
|
||||
+void DeleteIpsp2DTd(DWORD dwID)
|
||||
+CTestingData* GetTestingData(DWORD dwHandle)
|
||||
+bool ShowTdListByTz(DWORD dwTzHandle, CListCtrl& tdList)
|
||||
+bool ShowTd2DListByTz(DWORD dwTzHandle, int iEAmount, float fEDistance, int iAR, CListCtrl& tdList)
|
||||
+bool ShowTdListByDev(DWORD dwDevHandle, CListCtrl& tdList)
|
||||
+bool ImportTdSpecAttr(const CStringArray& strAttrArray, int iDataType, DWORD dwChID, int iTSN)
|
||||
+bool ShowTdListByProject(DWORD dwProHandle, CListCtrl& tdList)
|
||||
+void GetTaskAttr(DWORD dwHandle, DWORD& dwTdID, int& iStyle)
|
||||
+CTdManager(_ConnectionPtr& pConnection)
|
||||
+virtual ~CTdManager()
|
||||
+CHandleProcessor m_handleProcessor
|
||||
-CLinkList<CTestingData*> m_tdLinkList
|
||||
-_ConnectionPtr m_pConnection
|
||||
-FILE *m_pFile
|
||||
-CString m_log
|
||||
-BOOL InitialTd2DTo3DDlg(COpTd2DTo3DDlg *pOpTd2DTo3DDlg)
|
||||
}
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TdManager.h](file://h/TdManager.h#L1-L109)
|
||||
|
||||
### TaskDataOper 分析
|
||||
`TaskDataOper`类负责处理测试数据,包括创建任务、查询任务信息、更新任务数据等。它通过`Create1DTask`、`Create2DTask`、`Create3DTask`等方法创建不同类型的任务,并通过`QueryTdDataByElec`等方法查询任务数据。
|
||||
|
||||
#### 类图
|
||||
```mermaid
|
||||
classDiagram
|
||||
class CTaskDataOper {
|
||||
+CTaskDataOper()
|
||||
+virtual ~CTaskDataOper()
|
||||
+CString CreateTaskCN(int iTestType)
|
||||
+int Create1DTask(const ST1DTaskParam& stTaskParam, CString strTaskCN)
|
||||
+int Create2DTask(const ST2DTaskParam& stTaskParam, CString strTaskCN)
|
||||
+int Create3DTask(const ST3DTaskParam& stTaskParam, CString strTaskCN)
|
||||
+void QuerySptByAR(int iAR, std : : vector<STQuerySptInfo>& vtQuerySptRes, int iSptType)
|
||||
+void QuerySptRectByARandSCname(int iAR, CString strSCname, CString& vtQuerySptRes, CString& strPoleStep, CString& strPoleDistance, CString& strLineDirection, BYTE& ucSptType)
|
||||
+void QueryMediumInfo(int iSptType, std : : vector<STQueryMediumInfo>& vtQueryAR)
|
||||
+void QueryCmInfo(CString strCName, std : : vector<STQueryCMInfo>& vtQueryCM)
|
||||
+bool DeleteTask(int iTaskID)
|
||||
+bool DeleteTaskArray(std : : vector<int> vtTaskID)
|
||||
+bool DeleteTaskArray(std : : vector<CString> vtTaskID)
|
||||
+bool Query2DSptInfo(int iSptID, int &iMinLayer, int &iMaxLayer)
|
||||
+bool QuerySptElecTpMount(int iSptID, int &iEAmount, int &iTpMount)
|
||||
+bool QueryTdBasicInfo(int iTaskID, STQueryTaskBasicInfo* pTaskBasicInfo, CString strTaskCN=_T(""))
|
||||
+bool UpdateGrData(int iTaskID, const char* pData, int iSptType, int iAddedVal = 0)
|
||||
+bool InsertGrData(int iTaskID, WORD wGrNum, const char* pData, int iSptType=1)
|
||||
+bool InsertCoordinatesData(CString strTaskID, WORD wGrNum, const char* pData, float fMaxWellDepth, int iSptType = 1)
|
||||
+bool DeleteGrInfo(int iTaskID, WORD wElecID, BYTE ucDelFlag)
|
||||
+bool DeleteTdDataInfo(BYTE ucTdType, int iTaskID, WORD wTSN, BYTE ucDelFlag)
|
||||
+bool OpenTdData(int iTaskID, BYTE ucTdType, WORD wStartTSN = 0, WORD wMaxChannel = 1)
|
||||
+void CloseTdData()
|
||||
+int QueryNextTdBasicData(std : : vector<STSigSndDataInfo>& vtTestData)
|
||||
+bool QueryTdSigBasicData(int iTaskID, BYTE ucTdType, WORD wTSN, LPSTSigSndDataInfo pMeasuBasicReq)
|
||||
+bool UpdateTdBasicData(BYTE ucTdType, BYTE ucTestType, int iTdChannelID, int iTsn, LPSTMeasuBasicDataRes pMeasuBasicData, void *pAttachData)
|
||||
+bool UpdateTdBasicData(BYTE ucTdType, BYTE ucTestType, int iTdChannelID, int iTsn, LPSTMeasuBasicDataResEx pMeasuBasicData, void *pAttachData)
|
||||
+bool OnlineDownloadRes2DData(BYTE ucTdType, STTaskDataRes *ptTaskData, DWORD dwChID)
|
||||
+bool OnlineUploadRes2DTask(DWORD dwChID)
|
||||
+bool OnlineUploadRes2DArg(DWORD dwChID, STQueryTaskBasicInfo stQueryTdInfo)
|
||||
+bool OnlineUploadRes2DRg(DWORD dwChID, STQueryTaskBasicInfo stQueryTdInfo)
|
||||
+bool OnlineUploadRes2DData(DWORD dwChID, STQueryTaskBasicInfo stQueryTdInfo)
|
||||
+bool UploadElecCoordinatesInfo(DWORD dwTdID, STQueryTaskBasicInfo stQueryTdInfo)
|
||||
+int GetCurSelTdTestType()
|
||||
+bool QueryTdDataFromTsn(int iTaskID, BYTE ucTdType, WORD wStartTSN, int iCnt, std : : vector<STTaskDetailBasicData>& vtRes)
|
||||
+bool QueryTdDataByElec(int iSptID, BYTE ucTdType, int iStartElec, int iEndElec, std : : vector<STTaskDetailBasicData>& vtRes)
|
||||
+bool QueryElecMaxWellDepthByCN(CString strScriptCN, BYTE ucTdType, STElecCoordinatesInfoHead& stElecInfoHead)
|
||||
+bool QueryElecCoordinatesDataByCN(CString strScriptCN, BYTE ucTdType, WORD wStartTSN, int iCnt, std : : vector<STElecCoordinatesInfoBody>& vtRes)
|
||||
+void QueryTdAttrToCtrl(CListCtrl& listAttr, int iTaskID)
|
||||
+void QueryTdDataToCtrl(CListCtrl& listData, int iTaskID, int iSptType, int iTestType)
|
||||
+void QueryOnLineTdAttrToCtrl(CListCtrl& listAttr, STTaskListItem taskItem, STRemTaskArg *pstTaskArg)
|
||||
+bool QueryOnLineTdAttrFromSev(STRemTaskTable stTaskTable, STRemTaskArg *pstTaskArg)
|
||||
+bool QueryOnLineTdRgFromSev(STRemTaskArg stTaskArg, char *pRg)
|
||||
+bool QueryOnLineElecInfoFromSev(STRemTaskArg stTaskArg, char* pElecInfo)
|
||||
+bool QueryOnLineTdDataFromSev(STRemTaskArg stTaskArg, UINT32 uiStartPoint, UINT32 uiEndPoint, char *pData)
|
||||
+void QueryOnLineTdDataToCtrl(STRemTaskArg stTaskArg, std : : vector<STTaskDetailBasicData>& vtData)
|
||||
+void InitialTaskTreeCtrl(CTreeCtrl& taskTree, int iSptType)
|
||||
+void InitOnLineTaskTreeCtrl(CTreeCtrl& taskTree, int iSptType, std : : map<CString, STRemTaskTable> mapTaskList, HWND hWnd)
|
||||
+void QueryTimerTaskValiad(std : : vector<STTimerTask>& vtTimerTask, const SYSTEMTIME &sysCurTime)
|
||||
+int GetDefaultTzID()
|
||||
+bool DeleteTimerTask(const std : : vector<int>& vtTask)
|
||||
+bool DeleteTimerTask(UINT32 uiTDID)
|
||||
+void QueryTdBrowseInfo(std : : vector<STTdBrowseInfo>& vtTdBrowseInfo, bool bIsQueryTimerTd=false)
|
||||
+void QueryTdBrowseInfo(std : : vector<STTdBrowseInfo>& vtTdBrowseInfo, int iSptType, int iType, bool bIsQueryTimerTd=false)
|
||||
+bool AddTimerTask(int iTaskID, CString strTaskName, CString strTime, CString strPlcID)
|
||||
+bool InsertPlcStatusData(const STRemPlcDataInfo* pRemPlcData)
|
||||
+bool QueryPlcStatusData(std : : vector<STPlcStatusInfo>& vtPlcStatus)
|
||||
+void DeleteOldPlcStatusData()
|
||||
+bool QueryTaskPacketAttr(int& iLoopTime, int& iInterval, CString& strPlcID)
|
||||
+bool QueryTaskPacketInfo(std : : vector<STTdBrowseInfo>& vtTdBrowseInfo)
|
||||
+bool InsertTaskPacketInfo(const std : : vector<STTdBrowseInfo>& vtTdBrowseInfo, const STTaskPacketAttr& stAttr)
|
||||
+bool CreateSigTaskByAuto(const STTdBrowseInfo& stBasicTask, CString strTime, STTdBrowseInfo& stNewTask)
|
||||
+bool CreateTaskPacket(const std : : vector<STTdBrowseInfo>& vtBasicTaskPacket, CString strSysTime, std : : vector<STTdBrowseInfo>& vtNewTaskPacket)
|
||||
+int QueryARByTdID(DWORD dwTdID)
|
||||
+void AdjustParam()
|
||||
+void SetCurrentTimeRange(time_t tStartTime, time_t tEndTime)
|
||||
+unsigned int m_uiDevID
|
||||
-CGUCodeCreator m_guCodeCreator
|
||||
-_RecordsetPtr m_pRecTdData
|
||||
-BYTE m_iTdType
|
||||
-int m_iTestType
|
||||
-WORD m_wMaxChannel
|
||||
-time_t m_tStartTime
|
||||
-time_t m_tEndTime
|
||||
}
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TaskDataOper.h](file://h/TaskDataOper.h#L1-L448)
|
||||
|
||||
### TdRecord 分析
|
||||
`TdRecord`类负责处理测试数据的记录,包括加载原始数据、显示原始数据曲线等。它通过`LoadCEOrgData`、`Load2DOrgData`、`Load3DOrgData`等方法加载不同类型的原始数据,并通过`DisplayRawDataSplines`方法显示原始数据曲线。
|
||||
|
||||
#### 类图
|
||||
```mermaid
|
||||
classDiagram
|
||||
class CTdRecord {
|
||||
+CTdRecord(_ConnectionPtr& pConnection)
|
||||
+virtual ~CTdRecord()
|
||||
+DWORD m_dwChID
|
||||
+int m_iTsn
|
||||
+int m_iN
|
||||
+float m_fK
|
||||
+float m_fI
|
||||
+float m_fV
|
||||
+float m_fR0
|
||||
+float m_fSP
|
||||
+CString m_Datetime
|
||||
+CStringArray m_saVRawData
|
||||
+CStringArray m_saIRawData
|
||||
+_ConnectionPtr m_pConnection
|
||||
+float GetMaxAbsV()
|
||||
+virtual void DisplayRawDataSplines()
|
||||
+virtual BOOL LoadOrgData()
|
||||
+virtual float ConvertVOrgData(float fVOrgData)
|
||||
-float m_fMaxAbsV
|
||||
-BOOL LoadCEOrgData()
|
||||
-BOOL Load2DOrgData()
|
||||
-BOOL Load3DOrgData()
|
||||
}
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TdRecord.h](file://h/TdRecord.h#L1-L47)
|
||||
|
||||
### TestingData 分析
|
||||
`TestingData`类负责处理测试数据的高级功能,包括显示测试数据列表、保存数据为不同格式的文件等。它通过`ShowConList`、`ShowConListByPage`等方法显示测试数据列表,并通过`SaveTdToExcelFile`、`SaveTdToRes2DFile`等方法保存数据为不同格式的文件。
|
||||
|
||||
#### 类图
|
||||
```mermaid
|
||||
classDiagram
|
||||
class CTestingData {
|
||||
+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
|
||||
+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)
|
||||
+virtual bool ShowConList(CListCtrl &tdConList)
|
||||
+virtual bool ShowConListByPage(CListCtrl &tdConList, int iSType = 2)
|
||||
+virtual bool ShowDetailInfo(CListCtrl &tdDetailList)
|
||||
+virtual BOOL SaveTdToExcelFile(CString f_szFileName)
|
||||
+virtual BOOL SaveTdToResCEFile(CString f_szFileName)
|
||||
+virtual BOOL SaveTdToRes2DFile(CString f_szFileName)
|
||||
+virtual BOOL SaveTdToRes3DFile(CString f_szFileName)
|
||||
+virtual BOOL SaveTdToCsvFile(CString f_szFileName)
|
||||
+virtual bool ExportIP2DDataToDat(CString strFile)
|
||||
+virtual bool ExportIP3DToDatFile(CString strFile)
|
||||
+virtual BOOL ExportIPDataToTxt(CString strFileName)
|
||||
+virtual BOOL ExportResDataToTxt(CString strFileName)
|
||||
+virtual BOOL ExportSpDataToTxt(CString strFileName)
|
||||
+virtual BOOL Export2dDataToTxtBySort(CString strFileName, int iSortMethod)
|
||||
+virtual BOOL ExportDataToUrf(CString strFileName)
|
||||
+void SetCustToCrossHole(bool bFlag)
|
||||
+virtual BOOL DisplayGraph()
|
||||
+virtual BOOL DisplayTPSplinesGraph(int iTSN)
|
||||
+virtual BOOL LoadData(CLinkList<CMedium*>& m_medLinkList)
|
||||
+inline int CalcuCrossHolePoleID(int iOrgPoleID, int iHoleID, int iHoleFlag, int iMidEamount)
|
||||
+CTestingData(DWORD dwID, _ConnectionPtr& pConnection)
|
||||
+virtual ~CTestingData()
|
||||
+CPtrList m_tdChaList
|
||||
+_WaveCount *m_waveCount
|
||||
-_ConnectionPtr m_pConnection
|
||||
-CHandleProcessor m_handleProcessor
|
||||
-double GetCycle(int f_type)
|
||||
-BOOL SaveOrgDataToDB(DWORD dwTdID)
|
||||
-BOOL SaveGRDataToDB(DWORD dwTdID)
|
||||
-bool m_bIsCustomToCrossHole
|
||||
-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)
|
||||
}
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TestingData.h](file://h/TestingData.h#L1-L276)
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 依赖分析
|
||||
TdManager模块依赖于多个其他模块和库,包括`HandleProcessor`、`LinkList`、`TestingData`、`CtrlProtocolDef`等。这些依赖关系确保了模块的完整性和功能性。
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
TdManager --> HandleProcessor
|
||||
TdManager --> LinkList
|
||||
TdManager --> TestingData
|
||||
TdManager --> CtrlProtocolDef
|
||||
TaskDataOper --> GUCodeCreator
|
||||
TaskDataOper --> CtrlProtocolDef
|
||||
TdRecord --> TestingData
|
||||
TestingData --> Device
|
||||
TestingData --> Medium
|
||||
```
|
||||
|
||||
**图表来源**
|
||||
- [TdManager.h](file://h/TdManager.h#L1-L109)
|
||||
- [TaskDataOper.h](file://h/TaskDataOper.h#L1-L448)
|
||||
- [TdRecord.h](file://h/TdRecord.h#L1-L47)
|
||||
- [TestingData.h](file://h/TestingData.h#L1-L276)
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 性能考虑
|
||||
TdManager模块在设计时考虑了性能优化,特别是在数据处理和存储方面。通过使用高效的数据库操作和数据结构,模块能够快速处理大量测试数据。此外,模块还提供了多种数据导出格式,以满足不同用户的需求。
|
||||
|
||||
## 故障排除指南
|
||||
### 数据解析错误
|
||||
当遇到数据解析错误时,可以检查以下几点:
|
||||
- 确认数据文件的格式是否正确。
|
||||
- 检查数据文件是否损坏。
|
||||
- 确认数据文件的编码是否正确。
|
||||
|
||||
### 存储失败
|
||||
当遇到存储失败时,可以检查以下几点:
|
||||
- 确认数据库连接是否正常。
|
||||
- 检查数据库是否有足够的存储空间。
|
||||
- 确认数据库表结构是否正确。
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
|
||||
## 结论
|
||||
TdManager模块是GeomativeStudio软件中不可或缺的一部分,负责测试数据的采集、处理和存储。通过详细的分析,我们了解了模块的职责和实现,以及其在测试数据与项目、脚本的关联机制中的作用。模块的设计考虑了性能优化和错误处理,确保了数据的完整性和一致性。希望本文档能帮助开发者更好地理解和使用TdManager模块。
|
||||
|
||||
## 附录
|
||||
### 代码示例
|
||||
以下是一个简单的代码示例,展示如何使用`TdManager`类接收和记录测试数据:
|
||||
|
||||
```cpp
|
||||
// 创建TdManager实例
|
||||
CTdManager tdManager(connection);
|
||||
|
||||
// 从设备上载1D数据
|
||||
CString prCN = _T("Project1");
|
||||
CString tzCN = _T("Zone1");
|
||||
CString tdCN = _T("Test1");
|
||||
CString subTdCN = _T("");
|
||||
CDevice* pDev = new CDevice();
|
||||
BOOL result = tdManager.UploadCETdFromDev(prCN, tzCN, tdCN, subTdCN, pDev);
|
||||
|
||||
if (result) {
|
||||
// 数据上载成功
|
||||
AfxMessageBox(_T("数据上载成功"));
|
||||
} else {
|
||||
// 数据上载失败
|
||||
AfxMessageBox(_T("数据上载失败"));
|
||||
}
|
||||
|
||||
// 清理资源
|
||||
delete pDev;
|
||||
```
|
||||
|
||||
**章节来源**
|
||||
- [TdManager.cpp](file://cpp/Managers/TdManager.cpp#L1-L800)
|
||||
- [TaskDataOper.cpp](file://cpp/Operator/TaskDataOper.cpp#L1-L800)
|
||||
- [TdRecord.cpp](file://cpp/ProblemZone/TdRecord.cpp#L1-L325)
|
||||
- [TestingData.cpp](file://cpp/ProblemZone/TestingData.cpp#L1-L800)
|
||||
Reference in New Issue
Block a user