#ifndef HSI_FUNCTION_INCLUDED_ #define HSI_FUNCTION_INCLUDED_ #pragma once #include "HSI.h" enum E_EF3_PROBE_STATUS { E_EF3_PROBE_DONE,//0表示探针运行状态完成 E_EF3_PROBE_RUNNING,//1标示探针正在运行 }; class CHSIParameters { public: CHSIParameters() { for (int i = 0; i < 12; i++) { m_I[i] = 0; m_L[i] = 0; m_S[i] = _T(""); m_D[i] = 0.0; m_F[i] = 0.0; } } virtual ~CHSIParameters() {} CHSIParameters& operator=(const CHSIParameters &Param) { for (int i = 0; i < 12; i++) { m_I[i] = Param.m_I[i]; m_L[i] = Param.m_L[i]; m_S[i] = Param.m_S[i]; m_D[i] = Param.m_D[i]; m_F[i] = Param.m_F[i]; } return *this; } virtual bool CHSIParameters::operator==(const CHSIParameters &t) const { for (int i = 0; i < 12; i++) { if (m_I[i] != t.m_I[i] || m_L[i] != t.m_L[i] || m_S[i] != t.m_S[i] || m_D[i] != t.m_D[i] || m_F[i] != t.m_F[i]) return false; } return true; } int m_I[12]; long m_L[12]; CString m_S[12]; double m_D[12]; float m_F[12]; }; class CHSIMeasPoint { public: CHSIMeasPoint() { m_X = 0.0; m_Y = 0.0; m_Z = 0.0; m_I = 0.0; m_J = 0.0; m_K = 0.0; m_V = 0.0; m_W = 0.0; m_T1 = 0.0; m_T2 = 0.0; }; virtual ~CHSIMeasPoint() {} ; CHSIMeasPoint& operator=(const CHSIMeasPoint &Source) { m_X = Source.m_X; m_Y = Source.m_Y; m_Z = Source.m_Z; m_I = Source.m_I; m_J = Source.m_J; m_K = Source.m_K; m_V = Source.m_V; m_W = Source.m_W; m_T1 = Source.m_T1; m_T2 = Source.m_T2; return *this; } virtual bool CHSIMeasPoint::operator==(const CHSIMeasPoint & t) const { return (m_X == t.m_X && m_Y == t.m_Y && m_Z == t.m_Z && m_I == t.m_I && m_J == t.m_J && m_K == t.m_K && m_V == t.m_V && m_W == t.m_W && m_T1 == t.m_T1 && m_T2 == t.m_T2); } double m_X; double m_Y; double m_Z; double m_I; double m_J; double m_K; double m_V; double m_W; double m_T1; double m_T2; }; class CHSITPParams { public: CHSITPParams() { m_Overshoot = 0.0; m_Approach = 0.0; m_SeekSpeed = 0.0; m_TravelSpeed = 0.0; m_Retract = 0.0; wcsncpy_s(m_PartProgram, HSI_MaxStringLength + 1, _T(""), HSI_MaxStringLength); wcsncpy_s(m_FeatureID, HSI_MaxStringLength + 1, _T(""), HSI_MaxStringLength); }; virtual ~CHSITPParams() {} ; CHSITPParams& operator=(const CHSITPParams & Source) { m_Overshoot = Source.m_Overshoot; m_Approach = Source.m_Approach; m_SeekSpeed = Source.m_SeekSpeed; m_TravelSpeed = Source.m_TravelSpeed; m_Retract = Source.m_Retract; m_PrehitPnt = Source.m_PrehitPnt; m_RetractPnt = Source.m_RetractPnt; return *this; }; virtual bool CHSITPParams::operator==(const CHSITPParams & t) const { return ((m_Overshoot == t.m_Overshoot) && (m_Approach == t.m_Approach) && (m_SeekSpeed == t.m_SeekSpeed) && (m_TravelSpeed == t.m_TravelSpeed) && (m_Retract == t.m_Retract) && (m_PrehitPnt == t.m_PrehitPnt) && (m_RetractPnt == t.m_RetractPnt) ); }; double m_Overshoot; double m_Approach; double m_SeekSpeed; double m_TravelSpeed; double m_Retract; CHSIMeasPoint m_PrehitPnt; // Need for TP scanning CHSIMeasPoint m_RetractPnt; TCHAR m_PartProgram[HSI_MaxStringLength + 1]; TCHAR m_FeatureID[HSI_MaxStringLength + 1]; }; class CHSITPMeasurePoint : public CHSITPParams { public: CHSITPMeasurePoint() {} ; ~CHSITPMeasurePoint() {} ; CHSITPMeasurePoint & operator= (const CHSITPMeasurePoint & Source) { CHSITPParams::operator =(Source); m_MeasPoint = Source.m_MeasPoint; return *this; } virtual bool CHSITPMeasurePoint::operator==(const CHSITPMeasurePoint & t) const { return (CHSITPParams::operator==(t) && m_MeasPoint == t.m_MeasPoint ); } CHSIMeasPoint m_MeasPoint; }; class CHSITPManualConfig { public: CHSITPManualConfig() { m_Retract = 0.0; }; virtual ~CHSITPManualConfig() {} ; CHSITPManualConfig& operator=(const CHSITPManualConfig & Source) { m_Retract = Source.m_Retract; return *this; } virtual bool CHSITPManualConfig::operator==(const CHSITPManualConfig & t) const { return (m_Retract == t.m_Retract); }; double m_Retract; }; class HSI_Function :public HSI { public: HSI_Function(); ~HSI_Function(); HSI_STATUS HSI_TP_Enable(bool bProbeEnable); HSI_STATUS HSI_TP_Startup(void); HSI_STATUS HSI_TP_GetActiveProbe(int &nProbe); HSI_STATUS HSI_TP_SetActiveProbe(int nProbe); HSI_STATUS HSI_TP_SetManualTouchData(double dRetract); HSI_STATUS HSI_TP_SetTipOffset(double OffsetX, double OffsetY, double OffsetZ); HSI_STATUS HSI_TP_GetTipOffset(double &OffsetX, double &OffsetY, double &OffsetZ); HSI_STATUS HSI_TP_SetupMeasurePoint(double dBeginX, double dBeginY, double dBeginZ, double dEndX, double dEndY, double dEndZ, double dTraveSpeed, double dTouchSpeed, double dRetrackDis); HSI_STATUS HSI_TP_DoMeasure(bool bWait); HSI_STATUS HSI_TP_IsMeasuring(bool &bMeasuring); HSI_STATUS HSI_TP_GetMeasureData(double &dBeginX, double &dBeginY, double &dBeginZ, double &dEndX, double &dEndY, double &dEndZ); HSI_STATUS HSI_TP_Shutdown(void); private: double startPos[4]; double endPos[4]; double travelSpeed; double seekSpeed; double retractDis; double retractManDis; E_EF3_PROBE_STATUS probeRunStatus;//探锟斤拷锟斤拷锟斤拷状态 }; extern HSI_Function *g_pHSI_Function; #endif