Files
EF3-Interface/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Proto_Util.h
T
TAO Cheng 5a8e27e70d Merge
2013-07-22 14:34:50 +08:00

58 lines
2.0 KiB
C++

//
// Proto_Util.h: interface for the CDataLink class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Proto_Util_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_)
#define AFX_Proto_Util_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_
#define MV_TRACE if ( g_pLogger && g_pLogger->m_lLogMask & LOGACTIONS ) g_pLogger->SendAndFlushPerMode
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "logger.h"
#include "SsiStatus.h"
//======================================================================================
class CProto_Util
{
public:
double ScaleToMM(long lCount, double dResolution);
long MMtoScale(double lDistanceMM, double dResolution);
CProto_Util();
virtual ~CProto_Util();
SSI_STATUS Initialize();
void SetOutFile(FILE* pOutFile);
SSI_STATUS Terminate();
SSI_STATUS GetAppPath(CString &Path);
SSI_STATUS ExtractAppPath(CString &Path);
double TimeInSecs(void);
CLogger* g_pLogger;
void _swap_byte(unsigned short &Val);
void _reverse_dword(DWORD *);
void _scale2inch(unsigned long scale, double &inch);
void _inch2scale(unsigned long &scale, double inch);
long _4char2long(unsigned char *cBuff);
void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len);
void _clear_blanks(char *cBuff);
void _ascii2bin(char *cBuff);
void Dump_BYTES(char *cBuff, int iLen);
void Dump_SHORT_INT(char *cBuff);
void Dump_Array_BYTE(char *cBuff);
void Dump_Array_UINT(char *cBuff, int iLen);
void Dump_Array_UINT_TO_INCH(char *cBuff, int iLen);
void Dump_Array_LONG(char *cBuff, int iLen, int iSize);
void Dump_Array_LONG_REV(char *cBuff, int iLen);
long _ascii2long_rev(char *cBuff);
void Dump_Array_Ascii(char *cBuff, char iEP, char *cResult);
const char *byte_to_binary ( int x );
int HexToInt(char *Data, int Bytes);
void Dump_Array_LONG_MM(char *cBuff, int iLen);
FILE* m_pOutFile;
};
#endif
// !defined(AFX_Proto_Util_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_)